File Coverage

lib/eBay/API/XML/Call/UploadSiteHostedPictures/UploadSiteHostedPicturesRequestType.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::UploadSiteHostedPictures::UploadSiteHostedPicturesRequestType;
4              
5 1     1   1295 use strict;
  1         2  
  1         28  
6 1     1   4 use warnings;
  1         2  
  1         46  
7              
8             ##########################################################################
9             #
10             # Module: ............... eBay/API/XML
11             # File: ................. UploadSiteHostedPicturesRequestType.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::UploadSiteHostedPictures::UploadSiteHostedPicturesRequestType
21              
22             =head1 DESCRIPTION
23              
24             Uploads a picture to EPS (eBay Picture Services)
25             by including a binary attachment.
26             This call is available only in the XML API (not in the SOAP API).
27             This call requires that you use HTTP version 1.0.
28            
29            
30             This call will only be successful if a binary attachment is included,
31             after the XML input, as part of the request.
32            
33            
34             If you want to use this call as part of the My Picture Uploads feature,
35             see PictureUploadPolicy.
36            
37            
38             Please see FAQs on eBayPictureServices (EPS) and the UploadSiteHostedPictures API call and see samples at the following locations:
39            
40            
41             Java sample for UploadSiteHostedPictures
42            
43            
44             .NET sample in C# for UploadSiteHostedPictures
45            
46            
47             PHP sample for UploadSiteHostedPictures
48            
49            
50             VB6 sample for UploadSiteHostedPictures
51            
52            
53             The binary attachment is image data, including headers,
54             from a JPG, GIF, PNG, BMP, or TIF format image file.
55             JPG is recommended. If you use, for example, PNG, it will be converted
56             to JPG (or GIF) format.
57            
58            
59             The binary attachment must be sent after
60             the XML input as a MIME attachment,
61             in the same POST request.
62            
63            
64             The only necessary call-specific input is an attachment of a picture.
65             An EPS (eBay Picture Services) URL is returned for the picture,
66             in SiteHostedPictureDetails.FullURL. The value in
67             SiteHostedPictureDetails.FullURL must be stored
68             by your application (for use by AddItem, ReviseItem, or RelistItem in the
69             Item.PictureDetails.PictureURL field)
70             because no API call is available for finding a
71             URL of an uploaded, unassociated picture.
72            
73            
74             That is, your application uses the value in SiteHostedPictureDetails.FullURL to
75             associate the picture with an item (using
76             Item.PictureDetails.PictureURL in AddItem, ReviseItem, or RelistItem).
77             This must be done within 48 hours; unassociated pictures
78             are automatically deleted after that period.
79            
80            
81             The maximum picture size is 4 MB.
82             EPS downscales and compresses the picture to store it at the different sizes in the imageset.
83             For good quality results, the recommended minimum dimensions of the uploaded picture
84             are at least 1000 pixels on the longer side. Recommended JPG quality is 90 or greater.
85             The file size of images meeting these minimum requirements is 200KB-400KB.
86             Larger dimensions and file sizes will not typically provide better quality
87             in the final images processed by EPS.
88            
89            
90             If the dimensions of an uploaded picture are less than a size that is stored in EPS,
91             the upload will be accepted (without warning) and the stored picture
92             will be the same dimensions as the uploaded picture.
93             In this case, image quality of the stored picture is likely to be degraded.
94            
95            
96             If end-users use image processing editors or utilities to prepare
97             pictures for upload (e.g., crop, rotates, brightness correction, etc.),
98             they should avoid use of Save for the Web commands or options to save
99             output since these will cause reduced image quality after the uploaded
100             pictures are processed by EPS. They should use the standard Save command instead.
101            
102            
103             EPS supports upload of image data in JPG, GIF, PNG, BMP, and TIF formats.
104             Other image formats, such as PSD, will result in an error.
105             Successfully processed uploads for item pictures are stored
106             in EPS in JPG format, at sizes and compression settings designed
107             to provide the best trade-off between image quality and page-load times.
108            
109            
110             If the API request specifies a Supersize imageset and the response confirms
111             that a Supersize or Large imageset was created, then the AddItem,
112             ReviseItem, or RelistItem call must specify Supersize or PicturePack
113             as the PhotoDisplayType. In the case of ReviseItem, if there are existing
114             pictures for a listing, it is not possible to change the PhotoDisplayType
115             from Normal to Supersize or PicturePack.
116              
117              
118              
119             =head1 SYNOPSIS
120              
121             =cut
122              
123              
124             =head1 INHERITANCE
125              
126             eBay::API::XML::Call::UploadSiteHostedPictures::UploadSiteHostedPicturesRequestType inherits from the L class
127              
128             =cut
129              
130 1     1   37 use eBay::API::XML::RequestDataType;
  0            
  0            
131             our @ISA = ("eBay::API::XML::RequestDataType");
132              
133             use eBay::API::XML::DataType::Base64BinaryType;
134             use eBay::API::XML::DataType::Enum::PictureSetCodeType;
135             use eBay::API::XML::DataType::Enum::PictureUploadPolicyCodeType;
136              
137              
138             my @gaProperties = ( [ 'PictureData', 'ns:Base64BinaryType', ''
139             ,'eBay::API::XML::DataType::Base64BinaryType', '1' ]
140             , [ 'PictureName', 'xs:string', '', '', '' ]
141             , [ 'PictureSet', 'ns:PictureSetCodeType', ''
142             ,'eBay::API::XML::DataType::Enum::PictureSetCodeType', '' ]
143             , [ 'PictureSystemVersion', 'xs:int', '', '', '' ]
144             , [ 'PictureUploadPolicy', 'ns:PictureUploadPolicyCodeType', ''
145             ,'eBay::API::XML::DataType::Enum::PictureUploadPolicyCodeType', '' ]
146             );
147             push @gaProperties, @{eBay::API::XML::RequestDataType::getPropertiesList()};
148              
149             my @gaAttributes = (
150             );
151             push @gaAttributes, @{eBay::API::XML::RequestDataType::getAttributesList()};
152              
153             =head1 Subroutines:
154              
155             =cut
156              
157             sub new {
158             my $classname = shift;
159             my %args = @_;
160             my $self = $classname->SUPER::new(%args);
161             return $self;
162             }
163              
164             sub isScalar {
165             return 0;
166             }
167              
168              
169              
170             =head2 setPictureData()
171              
172             An optional reference ID to the binary attachment.
173             The PictureData field does not contain the binary attachment.
174             The binary attachment is image data,
175             including headers, from a JPG, GIF, PNG, BMP, or TIF format image file.
176             The binary attachment must be sent as a MIME attachment,
177             in your POST request, after the XML input.
178              
179             RequiredInput: No
180             # Argument: 'ns:Base64BinaryType'
181              
182             =cut
183              
184             sub setPictureData {
185             my $self = shift;
186             $self->{'PictureData'} = shift
187             }
188              
189             =head2 getPictureData()
190              
191             # Returns: 'ns:Base64BinaryType'
192              
193             =cut
194              
195             sub getPictureData {
196             my $self = shift;
197             return $self->_getDataTypeInstance( 'PictureData'
198             ,'eBay::API::XML::DataType::Base64BinaryType');
199             }
200              
201              
202             =head2 setPictureName()
203              
204             A name you provide for the picture.
205             Returned as SiteHostedPictureDetails.PictureName in the call response.
206              
207             RequiredInput: No
208             # Argument: 'xs:string'
209              
210             =cut
211              
212             sub setPictureName {
213             my $self = shift;
214             $self->{'PictureName'} = shift
215             }
216              
217             =head2 getPictureName()
218              
219             # Returns: 'xs:string'
220              
221             =cut
222              
223             sub getPictureName {
224             my $self = shift;
225             return $self->{'PictureName'};
226             }
227              
228              
229             =head2 setPictureSet()
230              
231             The image sizes that will be generated.
232              
233             RequiredInput: No
234             AllValuesExcept: Large
235             Default: Standard
236             # Argument: 'ns:PictureSetCodeType'
237              
238             =cut
239              
240             sub setPictureSet {
241             my $self = shift;
242             $self->{'PictureSet'} = shift
243             }
244              
245             =head2 getPictureSet()
246              
247             # Returns: 'ns:PictureSetCodeType'
248              
249             =cut
250              
251             sub getPictureSet {
252             my $self = shift;
253             return $self->{'PictureSet'};
254             }
255              
256              
257             =head2 setPictureSystemVersion()
258              
259             Specifies the picture system version. Only version 2 is valid.
260             Available to support future changes in the picture system version.
261              
262             RequiredInput: No
263             Default: 2
264             # Argument: 'xs:int'
265              
266             =cut
267              
268             sub setPictureSystemVersion {
269             my $self = shift;
270             $self->{'PictureSystemVersion'} = shift
271             }
272              
273             =head2 getPictureSystemVersion()
274              
275             # Returns: 'xs:int'
276              
277             =cut
278              
279             sub getPictureSystemVersion {
280             my $self = shift;
281             return $self->{'PictureSystemVersion'};
282             }
283              
284              
285             =head2 setPictureUploadPolicy()
286              
287             When the My Picture Uploads feature is available (see the Trading API Release Notes), applications
288             (including non-listing apps, such as photo-editors and digital-camera software) will be able to use
289             the PictureUploadPolicy field to specify that an uploaded picture is available to a seller on the eBay site. When you use PictureUploadPolicy, you are specifying that the picture you uploaded (and its URL) is stored for 48 hours on the eBay site. (If, within 48 hours, the picture is associated with an item,
290             then it persists on the eBay site for the same time length as other pictures uploaded using
291             the UploadSiteHostedPictures call).
292             As a result of the storage on the eBay site, the picture is available to the seller on
293             the My Picture Uploads tab within the Sell Your Item (SYI) pages.
294             A maximum of 25 URLs can be stored.
295              
296             RequiredInput: No
297             # Argument: 'ns:PictureUploadPolicyCodeType'
298              
299             =cut
300              
301             sub setPictureUploadPolicy {
302             my $self = shift;
303             $self->{'PictureUploadPolicy'} = shift
304             }
305              
306             =head2 getPictureUploadPolicy()
307              
308             # Returns: 'ns:PictureUploadPolicyCodeType'
309              
310             =cut
311              
312             sub getPictureUploadPolicy {
313             my $self = shift;
314             return $self->{'PictureUploadPolicy'};
315             }
316              
317              
318              
319              
320              
321             ## Attribute and Property lists
322             sub getPropertiesList {
323             my $self = shift;
324             return \@gaProperties;
325             }
326              
327             sub getAttributesList {
328             my $self = shift;
329             return \@gaAttributes;
330             }
331              
332              
333              
334             1;