File Coverage

lib/eBay/API/XML/DataType/ProductSearchType.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::DataType::ProductSearchType;
4              
5 1     1   1141 use strict;
  1         1  
  1         32  
6 1     1   4 use warnings;
  1         2  
  1         28  
7              
8             ##########################################################################
9             #
10             # Module: ............... eBay/API/XML
11             # File: ................. ProductSearchType.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::DataType::ProductSearchType
21              
22             =head1 DESCRIPTION
23              
24             Container for a product query and pagination instructions.
25             This data is applicable when searching eBay catalogs for stock product
26             information (to use in listings with Pre-filled Item Information.)
27             Input only.
28              
29              
30              
31             =head1 SYNOPSIS
32              
33             =cut
34              
35              
36             =head1 INHERITANCE
37              
38             eBay::API::XML::DataType::ProductSearchType inherits from the L class
39              
40             =cut
41              
42 1     1   35 use eBay::API::XML::BaseDataType;
  0            
  0            
43             our @ISA = ("eBay::API::XML::BaseDataType");
44              
45             use eBay::API::XML::DataType::CharacteristicSetIDsType;
46             use eBay::API::XML::DataType::ExternalProductIDType;
47             use eBay::API::XML::DataType::PaginationType;
48             use eBay::API::XML::DataType::SearchAttributesType;
49              
50              
51             my @gaProperties = ( [ 'AttributeSetID', 'xs:int', '', '', '' ]
52             , [ 'AvailableItemsOnly', 'xs:boolean', '', '', '' ]
53             , [ 'CharacteristicSetIDs', 'ns:CharacteristicSetIDsType', ''
54             ,'eBay::API::XML::DataType::CharacteristicSetIDsType', '1' ]
55             , [ 'ExternalProductID', 'ns:ExternalProductIDType', ''
56             ,'eBay::API::XML::DataType::ExternalProductIDType', '1' ]
57             , [ 'MaxChildrenPerFamily', 'xs:int', '', '', '' ]
58             , [ 'Pagination', 'ns:PaginationType', ''
59             ,'eBay::API::XML::DataType::PaginationType', '1' ]
60             , [ 'ProductFinderID', 'xs:int', '', '', '' ]
61             , [ 'ProductID', 'xs:string', '', '', '' ]
62             , [ 'ProductReferenceID', 'xs:string', '', '', '' ]
63             , [ 'ProductSearchID', 'xs:string', '', '', '' ]
64             , [ 'QueryKeywords', 'xs:string', '', '', '' ]
65             , [ 'SearchAttributes', 'ns:SearchAttributesType', '1'
66             ,'eBay::API::XML::DataType::SearchAttributesType', '1' ]
67             , [ 'SortAttributeID', 'xs:int', '', '', '' ]
68             );
69             push @gaProperties, @{eBay::API::XML::BaseDataType::getPropertiesList()};
70              
71             my @gaAttributes = (
72             );
73             push @gaAttributes, @{eBay::API::XML::BaseDataType::getAttributesList()};
74              
75             =head1 Subroutines:
76              
77             =cut
78              
79             sub new {
80             my $classname = shift;
81             my %args = @_;
82             my $self = $classname->SUPER::new(%args);
83             return $self;
84             }
85              
86             sub isScalar {
87             return 0;
88             }
89              
90              
91              
92             =head2 setAttributeSetID()
93              
94             For GetProductFinder and GetProductSearchResults
95             only: Identifier for a characteristic set
96             (an attribute set) that is mapped to
97             a catalog-enabled category (unique across all eBay sites).
98             Required when you use SearchAttributes
99             (for searches based on product search page and product finder data).
100             Returns an error with QueryKeywords (use CharacteristicSetIDs instead).
101             Use GetProductSearchPage or GetProductFinder to determine valid IDs for the
102             type of search you are performing.
103            
104            
105             For GetProducts only:
106             This field is not applicable to GetProducts. However, if you are using
107             a SOAP toolkit and you get an error indicating that this field is
108             required for GetProducts, you can specify this field with any integer
109             value. It will be ignored by eBay.
110              
111             SeeLink: URL: http://developer.ebay.com/DevZone/XML/docs/WebHelp/index.htm?context=eBay_XML_API&topic=AttrPSPSearch
112             Title: Searching with a Single-Attribute Search Page
113             , URL: http://developer.ebay.com/DevZone/XML/docs/WebHelp/index.htm?context=eBay_XML_API&topic=AttrPFSearch
114             Title: Searching with a Sell-Side Product Finder
115              
116              
117             Calls: GetProductFamilyMembers
118             GetProductSearchResults
119             RequiredInput: Conditionally
120              
121             # Argument: 'xs:int'
122              
123             =cut
124              
125             sub setAttributeSetID {
126             my $self = shift;
127             $self->{'AttributeSetID'} = shift
128             }
129              
130             =head2 getAttributeSetID()
131              
132             # Returns: 'xs:int'
133              
134             =cut
135              
136             sub getAttributeSetID {
137             my $self = shift;
138             return $self->{'AttributeSetID'};
139             }
140              
141              
142             =head2 setAvailableItemsOnly()
143              
144             If true, only retrieve products that have been used to pre-fill
145             active listings on the specified eBay site.
146             If false, retrieve all products that match the query.
147             For GetProducts This is useful when you use
148             QueryKeywords and you only want to find products that have items
149             (that is, where ItemArray is not empty).
150            
151             For GetProductSearchResults: Ths can be useful when
152             you want to find products that other sellers have recently used to
153             pre-fill similar listings.
154              
155             Calls: GetProductSearchResults
156             GetProducts
157             RequiredInput: No
158             Default: false
159              
160             # Argument: 'xs:boolean'
161              
162             =cut
163              
164             sub setAvailableItemsOnly {
165             my $self = shift;
166             $self->{'AvailableItemsOnly'} = shift
167             }
168              
169             =head2 isAvailableItemsOnly()
170              
171             # Returns: 'xs:boolean'
172              
173             =cut
174              
175             sub isAvailableItemsOnly {
176             my $self = shift;
177             return $self->{'AvailableItemsOnly'};
178             }
179              
180              
181             =head2 setCharacteristicSetIDs()
182              
183             List of one or more IDs that indicate which domain
184             (characteristic set) to search in. If not specified, the search is
185             conducted across all domains (characteristic sets).
186            
187             For GetProducts Only useful when QueryKeywords
188             is specified. If you use this with ProductReferenceID or
189             ExternalProductID, AND logic is applied. In this case, if you specify an ID that doesn't match the product, no matching product will be found. Therefore, we recommend that you only use this with QueryKeywords.
190            
191             For GetProductSearchResults: Only applicable when QueryKeywords is specified. Ignored when SearchAttributes is specified.
192              
193             Calls: GetProductSearchResults
194             GetProducts
195             RequiredInput: No
196              
197             # Argument: 'ns:CharacteristicSetIDsType'
198              
199             =cut
200              
201             sub setCharacteristicSetIDs {
202             my $self = shift;
203             $self->{'CharacteristicSetIDs'} = shift
204             }
205              
206             =head2 getCharacteristicSetIDs()
207              
208             # Returns: 'ns:CharacteristicSetIDsType'
209              
210             =cut
211              
212             sub getCharacteristicSetIDs {
213             my $self = shift;
214             return $self->_getDataTypeInstance( 'CharacteristicSetIDs'
215             ,'eBay::API::XML::DataType::CharacteristicSetIDsType');
216             }
217              
218              
219             =head2 setExternalProductID()
220              
221             A query that only retrieves items that were listed with stock products
222             that have ISBN or UPC values (such as books, DVDs, CDs, and video game
223             products).
224             Use this query to retrieve basic details about one catalog product
225             (or a very limited number of products). The results can optionally
226             include items, reviews, and/or buying guides that match that product.
227             (Specifically, the items returned are items that sellers listed with the
228             specified product's stock information.)
229            
230             If you have gotten the ISBN or UPC from another Web site or resource,
231             you can use that ID. Otherwise, call GetProducts with
232             QueryKeywords (or ProductReferenceID). Any matching products that
233             include ISBN or UPC values will return those values in
234             Product.ExternalProductID.
235            
236             The request requires either QueryKeywords, ProductReferenceID,
237             or ExternalProductID, but these fields cannot be used together.
238              
239             Calls: GetProducts
240             RequiredInput: Conditionally
241              
242             # Argument: 'ns:ExternalProductIDType'
243              
244             =cut
245              
246             sub setExternalProductID {
247             my $self = shift;
248             $self->{'ExternalProductID'} = shift
249             }
250              
251             =head2 getExternalProductID()
252              
253             # Returns: 'ns:ExternalProductIDType'
254              
255             =cut
256              
257             sub getExternalProductID {
258             my $self = shift;
259             return $self->_getDataTypeInstance( 'ExternalProductID'
260             ,'eBay::API::XML::DataType::ExternalProductIDType');
261             }
262              
263              
264             =head2 setMaxChildrenPerFamily()
265              
266             Pagination instruction that specifies the maximum quantity of products to return for each
267             product family within the search response whose ID matches the current request's ID.
268             In the response, if the last family returned contains MaxChildrenPerFamily or fewer
269             additional products, those additional products are also returned (i.e., the actual quantity
270             returned for the last family can exceed the specified maximum value).
271             See "Limit the Quantity of Products Returned Per Family" in the eBay Web Services Guide.
272             The value should not include punctuation (i.e., a thousands separator is not valid).
273              
274             SeeLink: URL: http://developer.ebay.com/DevZone/XML/docs/WebHelp/index.htm?context=eBay_XML_API&topic=MaxChildrenPerFamily
275             Title: Step2:Limit the Quantity of Products Returned Per Family
276              
277             Calls: GetProductSearchResults
278             RequiredInput: Conditionally
279             Default: 5
280             Max: 20000
281             Min: 1
282              
283             # Argument: 'xs:int'
284              
285             =cut
286              
287             sub setMaxChildrenPerFamily {
288             my $self = shift;
289             $self->{'MaxChildrenPerFamily'} = shift
290             }
291              
292             =head2 getMaxChildrenPerFamily()
293              
294             # Returns: 'xs:int'
295              
296             =cut
297              
298             sub getMaxChildrenPerFamily {
299             my $self = shift;
300             return $self->{'MaxChildrenPerFamily'};
301             }
302              
303              
304             =head2 setPagination()
305              
306             Pagination instruction that specifies the virtual page of data to return
307             per search request.
308             For GetProducts, this is primarily useful when you use QueryKeywords.
309             When you use ExternalProductID or ProductReferenceID, only one page of
310             data is typically returned.
311              
312             Calls: GetProductFamilyMembers
313             GetProductSearchResults
314             GetProducts
315             RequiredInput: No
316             SeeLink: URL: http://developer.ebay.com/DevZone/XML/docs/WebHelp/index.htm?context=eBay_XML_API&topic=AttrPagination, Title: Step4:Specify Pagination Properties
317              
318             # Argument: 'ns:PaginationType'
319              
320             =cut
321              
322             sub setPagination {
323             my $self = shift;
324             $self->{'Pagination'} = shift
325             }
326              
327             =head2 getPagination()
328              
329             # Returns: 'ns:PaginationType'
330              
331             =cut
332              
333             sub getPagination {
334             my $self = shift;
335             return $self->_getDataTypeInstance( 'Pagination'
336             ,'eBay::API::XML::DataType::PaginationType');
337             }
338              
339              
340             =head2 setProductFinderID()
341              
342             Required when you are performing a sell-side product finder search.
343             (Not applicable to product search page searches.)
344             Numeric identifier for a sell-side product finder that was used to retrieve
345             the search attributes being used in the request. The product finder must be
346             mapped to a catalog-enabled category (i.e., it cannot be a buy-side product finder ID)
347             associated with the characteristics set.
348             Use a product finder when you want to specify multiple attributes in a
349             product search query. Call GetCategory2CS to determine which categories
350             support sell-side product finder searches.
351              
352             SeeLink: URL: http://developer.ebay.com/DevZone/XML/docs/WebHelp/index.htm?context=eBay_XML_API&topic=AttrPFSearch
353             Title: Searching with a Sell-Side Product Finder
354              
355             Calls: GetProductSearchResults
356             RequiredInput: Conditionally
357              
358             # Argument: 'xs:int'
359              
360             =cut
361              
362             sub setProductFinderID {
363             my $self = shift;
364             $self->{'ProductFinderID'} = shift
365             }
366              
367             =head2 getProductFinderID()
368              
369             # Returns: 'xs:int'
370              
371             =cut
372              
373             sub getProductFinderID {
374             my $self = shift;
375             return $self->{'ProductFinderID'};
376             }
377              
378              
379             =head2 setProductID()
380              
381             Identifier for a representative stock product in a product family.
382             Used as input in GetProductFamilyMembers requests to identify a product family.
383             Use GetProductSearchResults to determine the available IDs.
384              
385             SeeLink: URL: http://developer.ebay.com/DevZone/XML/docs/WebHelp/index.htm?context=eBay_XML_API&topic=AttrGPFM
386             Title: Retrieving All Members of a Product Family
387             MaxLength: 4000
388              
389             Calls: GetProductFamilyMembers
390             RequiredInput: Yes
391              
392             # Argument: 'xs:string'
393              
394             =cut
395              
396             sub setProductID {
397             my $self = shift;
398             $self->{'ProductID'} = shift
399             }
400              
401             =head2 getProductID()
402              
403             # Returns: 'xs:string'
404              
405             =cut
406              
407             sub getProductID {
408             my $self = shift;
409             return $self->{'ProductID'};
410             }
411              
412              
413             =head2 setProductReferenceID()
414              
415             The global reference ID for an eBay catalog product.
416             Use this query to retrieve basic details about one catalog product.
417             The results can optionally include items, reviews, and/or buying guides
418             that match that product.
419             (Specifically, the items returned are items that sellers listed with the
420             specified product's stock information.)
421            
422             To determine valid reference IDs, call GetProducts with QueryKeywords
423             (or ExternalProductID). Each matching product returns a reference ID in
424             Product.ProductReferenceID.
425            
426             Note:
427             This value is not the same as the ProductID used in AddItem and related
428             calls. A ProductID represents a particular version
429             of a catalog product. (A given version could have an older or newer
430             description, set of Item Specifics, or other details.)
431             A ProductReferenceID is a more generic or global reference to a product
432             (regardless of version), which is useful for buy-side searching.
433             One product reference ID can be associated with multiple
434             product IDs.
435            
436             As of mid-2008, some sites (such as eBay US, Germany, Austria, and Switzerland) are
437             updating, replacing, deleting, or merging some products (as a result of migrating from one
438             catalog data provider to another).
439             If you specify one of these products, the call may return a warning,
440             or it may return an error if the product has been deleted.
441            
442             The request requires either QueryKeywords, ProductReferenceID,
443             or ExternalProductID, but these fields cannot be used together.
444              
445             Calls: GetProducts
446             RequiredInput: Conditionally
447              
448             # Argument: 'xs:string'
449              
450             =cut
451              
452             sub setProductReferenceID {
453             my $self = shift;
454             $self->{'ProductReferenceID'} = shift
455             }
456              
457             =head2 getProductReferenceID()
458              
459             # Returns: 'xs:string'
460              
461             =cut
462              
463             sub getProductReferenceID {
464             my $self = shift;
465             return $self->{'ProductReferenceID'};
466             }
467              
468              
469             =head2 setProductSearchID()
470              
471             Unique alphanumeric key help you distinguish between query results in the response.
472             You define the key. Each search request ID must be unique within the same call.
473             Primarily useful when conducting multiple searches in the same call.
474             If not specified, the ProductSearchResult.ID values in the response are
475             indexed starting from 0 (zero).
476              
477             Calls: GetProductFamilyMembers
478             GetProductSearchResults
479             RequiredInput: No
480              
481             # Argument: 'xs:string'
482              
483             =cut
484              
485             sub setProductSearchID {
486             my $self = shift;
487             $self->{'ProductSearchID'} = shift
488             }
489              
490             =head2 getProductSearchID()
491              
492             # Returns: 'xs:string'
493              
494             =cut
495              
496             sub getProductSearchID {
497             my $self = shift;
498             return $self->{'ProductSearchID'};
499             }
500              
501              
502             =head2 setQueryKeywords()
503              
504             One or more keywords to search for. The words "and" and "or" are
505             treated like any other word. Only use "and", "or", or "the" if you are
506             searching for products containing these words. To use AND or OR logic,
507             use eBay's standard search string modifiers.
508             Wildcards (+, -, or *) are also supported. Be careful when using spaces
509             before or after modifiers and wildcards.
510            
511             For GetProducts
512             When you use a keyword search, eBay searches the product database for
513             matching words in the product title, description, and/or Item Specifics,
514             and it returns a list of matching products (with no items, reviews,
515             or guides). (To retrieve items, reviews, and/or guides for a particular
516             product, use ProductReferenceID instead.) If specified,
517             you must pass in at least 3 alphanumeric characters. Some keyword queries can result in response times of 30 seconds or longer.
518             If more than 2000 matches are found, the call fails with an error.
519             If this kind of error occurs, refine the search by passing in more
520             keywords and/or by using CharacteristicSetIDs to restrict the search to
521             certain domains (such as DVDs). If you are searching for a particular
522             book, DVD, CD, or video game and you already know its ISBN (for a book)
523             or UPC, consider using ExternalProductID instead to retrieve more
524             precise results. The request requires either QueryKeywords,
525             ProductReferenceID, or ExternalProductID, but these fields cannot be used together.
526            
527             For GetProductSearchResults:
528             eBay searches only in the characteristic set specified in
529             CharacteristicSetIDs. Both the product title and Item Specifics
530             are searched. For each ProductSearch, either SearchAttributes or
531             QueryKeywords is required (but do not pass both). Blank searches are not applicable (and result in a warning).
532             If your search is using a Keyword attribute returned by GetProductSearchPage,
533             use SearchAttributes instead.
534              
535             SeeLink: URL: http://developer.ebay.com/DevZone/XML/docs/WebHelp/index.htm?context=eBay_XML_API&topic=AttrQKWSearch
536             Title: Searching with Plain-Text Keywords
537             MaxLength: 350
538              
539             Calls: GetProductSearchResults
540             GetProducts
541             RequiredInput: Conditionally
542              
543             # Argument: 'xs:string'
544              
545             =cut
546              
547             sub setQueryKeywords {
548             my $self = shift;
549             $self->{'QueryKeywords'} = shift
550             }
551              
552             =head2 getQueryKeywords()
553              
554             # Returns: 'xs:string'
555              
556             =cut
557              
558             sub getQueryKeywords {
559             my $self = shift;
560             return $self->{'QueryKeywords'};
561             }
562              
563              
564             =head2 setSearchAttributes()
565              
566             A predefined attribute against which to search (e.g., Author).
567             Use this to create a query based on a set of Item Specifics from the catalog.
568             Both the product title and product Item Specifics are searched.
569             If the query includes multiple SearchAttributes fields (one for each attribute),
570             the search engine will apply "AND" logic to the query.
571             Call GetProductSearchPage or GetProductFinder to determine the list of valid attributes and how many are
572             permitted for the specified characteristic set. See the eBay Web Services guide for details.
573             For each ProductSearch, either SearchAttributes or QueryKeywords is required (but do not pass both).
574              
575             Calls: GetProductSearchResults
576             RequiredInput: Conditionally
577              
578             # Argument: reference to an array
579             of 'ns:SearchAttributesType'
580              
581             =cut
582              
583             sub setSearchAttributes {
584             my $self = shift;
585             $self->{'SearchAttributes'} =
586             $self->convertArray_To_RefToArrayIfNeeded(@_);
587             }
588              
589             =head2 getSearchAttributes()
590              
591             # Returns: reference to an array
592             of 'ns:SearchAttributesType'
593              
594             =cut
595              
596             sub getSearchAttributes {
597             my $self = shift;
598             return $self->_getDataTypeArray('SearchAttributes');
599             }
600              
601              
602             =head2 setSortAttributeID()
603              
604             Unique identifier for a sortable attribute. Use GetProductSearchPage
605             or GetProductFinder to determine the valid sort attribute IDs for the
606             specified characteristic set (including the default sort attribute that will be
607             used if you do not specify this field).
608              
609             SeeLink: URL: http://developer.ebay.com/DevZone/XML/docs/WebHelp/index.htm?context=eBay_XML_API&topic=SortAttributeID
610             Title: Step3:Specify the Product Sort Criteria
611              
612             Calls: GetProductFamilyMembers
613             GetProductSearchResults
614             RequiredInput: No
615              
616             # Argument: 'xs:int'
617              
618             =cut
619              
620             sub setSortAttributeID {
621             my $self = shift;
622             $self->{'SortAttributeID'} = shift
623             }
624              
625             =head2 getSortAttributeID()
626              
627             # Returns: 'xs:int'
628              
629             =cut
630              
631             sub getSortAttributeID {
632             my $self = shift;
633             return $self->{'SortAttributeID'};
634             }
635              
636              
637              
638              
639              
640             ## Attribute and Property lists
641             sub getPropertiesList {
642             my $self = shift;
643             return \@gaProperties;
644             }
645              
646             sub getAttributesList {
647             my $self = shift;
648             return \@gaAttributes;
649             }
650              
651              
652              
653             1;