File Coverage

lib/eBay/API/XML/Call/GetCategoryFeatures/GetCategoryFeaturesRequestType.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::GetCategoryFeatures::GetCategoryFeaturesRequestType;
4              
5 1     1   1457 use strict;
  1         2  
  1         31  
6 1     1   5 use warnings;
  1         3  
  1         44  
7              
8             ##########################################################################
9             #
10             # Module: ............... eBay/API/XML
11             # File: ................. GetCategoryFeaturesRequestType.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::GetCategoryFeatures::GetCategoryFeaturesRequestType
21              
22             =head1 DESCRIPTION
23              
24             Returns information about certain features that are only applicable to
25             certain categories on the site.
26            

27             Be sure to specify ViewAllNodes as true so that you get useful results.
28            
29             GetCategoryFeatures is not designed to return settings for every leaf
30             and parent category that exists in the category tree. It only returns settings
31             for nodes (sub-hierarchies) that are different from the SiteDefault,
32             or different from a given parent category's settings. In other words,
33             we use a "toggling" model to reduce the size of the response.
34             For example, if the SiteDefault setting for BestOfferEnabled is false,
35             it would mean most categories on the site don't support Best Offer,
36             and GetCategoryFeatures would only return the few categories where the
37             setting for BestOfferEnabled is true (if any).
38            

39            

40             Furthermore, if all of the leaf categories under a given parent category
41             have the same settings (such as BestOfferEnabled=true),
42             then GetCategoryFeatures only returns the highest-level parent category
43             with those same settings. This means the settings of that parent category are
44             inherited for all lower-level child categories down to the leaf categories.
45             (In theory, it is possible for this toggling behavior to occur more than
46             once as you drill down into lower levels of the tree. So you would need to
47             check whether any children that override the parent's settings are
48             also returned.)
49            

50            

51             Use GetCategories to retrieve information about the category hierarchy
52             (such as parent/child relationships) plus additional feature settings.
53            

54              
55              
56              
57             =head1 SYNOPSIS
58              
59             =cut
60              
61              
62             =head1 INHERITANCE
63              
64             eBay::API::XML::Call::GetCategoryFeatures::GetCategoryFeaturesRequestType inherits from the L class
65              
66             =cut
67              
68 1     1   37 use eBay::API::XML::RequestDataType;
  0            
  0            
69             our @ISA = ("eBay::API::XML::RequestDataType");
70              
71             use eBay::API::XML::DataType::Enum::FeatureIDCodeType;
72              
73              
74             my @gaProperties = ( [ 'CategoryID', 'xs:string', '', '', '' ]
75             , [ 'FeatureID', 'ns:FeatureIDCodeType', '1'
76             ,'eBay::API::XML::DataType::Enum::FeatureIDCodeType', '' ]
77             , [ 'LevelLimit', 'xs:int', '', '', '' ]
78             , [ 'ViewAllNodes', 'xs:boolean', '', '', '' ]
79             );
80             push @gaProperties, @{eBay::API::XML::RequestDataType::getPropertiesList()};
81              
82             my @gaAttributes = (
83             );
84             push @gaAttributes, @{eBay::API::XML::RequestDataType::getAttributesList()};
85              
86             =head1 Subroutines:
87              
88             =cut
89              
90             sub new {
91             my $classname = shift;
92             my %args = @_;
93             my $self = $classname->SUPER::new(%args);
94             return $self;
95             }
96              
97             sub isScalar {
98             return 0;
99             }
100              
101              
102              
103             =head2 setCategoryID()
104              
105             Defines one category for which you want feature settings.
106             If not specified, returns feature settings for all
107             categories on the site (assuming you set the DetailLevel
108             to ReturnAll and ViewAllNodes to true).
109              
110             MaxLength: 10
111              
112             RequiredInput: No
113             # Argument: 'xs:string'
114              
115             =cut
116              
117             sub setCategoryID {
118             my $self = shift;
119             $self->{'CategoryID'} = shift
120             }
121              
122             =head2 getCategoryID()
123              
124             # Returns: 'xs:string'
125              
126             =cut
127              
128             sub getCategoryID {
129             my $self = shift;
130             return $self->{'CategoryID'};
131             }
132              
133              
134             =head2 setFeatureID()
135              
136             Retrieves data related to the specified feature setting only.
137             If no feature IDs are specified, the call retrieves data for all
138             feature settings.
139              
140             RequiredInput: No
141             # Argument: reference to an array
142             of 'ns:FeatureIDCodeType'
143              
144             =cut
145              
146             sub setFeatureID {
147             my $self = shift;
148             $self->{'FeatureID'} =
149             $self->convertArray_To_RefToArrayIfNeeded(@_);
150             }
151              
152             =head2 getFeatureID()
153              
154             # Returns: reference to an array
155             of 'ns:FeatureIDCodeType'
156              
157             =cut
158              
159             sub getFeatureID {
160             my $self = shift;
161             return $self->_getDataTypeArray('FeatureID');
162             }
163              
164              
165             =head2 setLevelLimit()
166              
167             A level of depth in the category hierarchy.
168             Retrieves all category nodes with a CategoryLevel less
169             than or equal to the LevelLimit value.
170              
171             RequiredInput: No
172             # Argument: 'xs:int'
173              
174             =cut
175              
176             sub setLevelLimit {
177             my $self = shift;
178             $self->{'LevelLimit'} = shift
179             }
180              
181             =head2 getLevelLimit()
182              
183             # Returns: 'xs:int'
184              
185             =cut
186              
187             sub getLevelLimit {
188             my $self = shift;
189             return $self->{'LevelLimit'};
190             }
191              
192              
193             =head2 setViewAllNodes()
194              
195             Set this value to true to retrieve useful results.
196             If true, retrieves all categories that override the
197             site default settings.
198             (If false or not specified, only retrieves data about
199             leaf categories. If the details about overridden settings
200             are only defined on a category's ancestor, the call does
201             not return those settings if you only retrieve leaf categories.)
202              
203             RequiredInput: Conditionally
204             Default: false
205             # Argument: 'xs:boolean'
206              
207             =cut
208              
209             sub setViewAllNodes {
210             my $self = shift;
211             $self->{'ViewAllNodes'} = shift
212             }
213              
214             =head2 isViewAllNodes()
215              
216             # Returns: 'xs:boolean'
217              
218             =cut
219              
220             sub isViewAllNodes {
221             my $self = shift;
222             return $self->{'ViewAllNodes'};
223             }
224              
225              
226              
227              
228              
229             ## Attribute and Property lists
230             sub getPropertiesList {
231             my $self = shift;
232             return \@gaProperties;
233             }
234              
235             sub getAttributesList {
236             my $self = shift;
237             return \@gaAttributes;
238             }
239              
240              
241              
242             1;