Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
12451 kshitij.so 1
 
2
package com.amazonaws.mws.model;
3
 
4
import javax.xml.bind.annotation.XmlAccessType;
5
import javax.xml.bind.annotation.XmlAccessorType;
6
import javax.xml.bind.annotation.XmlElement;
7
import javax.xml.bind.annotation.XmlRootElement;
8
import javax.xml.bind.annotation.XmlSchemaType;
9
import javax.xml.bind.annotation.XmlType;
10
import javax.xml.datatype.XMLGregorianCalendar;
11
 
12
 
13
/**
14
 * <p>Java class for anonymous complex type.
15
 * 
16
 * <p>The following schema fragment specifies the expected content contained within this class.
17
 * 
18
 * <pre>
19
 * &lt;complexType>
20
 *   &lt;complexContent>
21
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
22
 *       &lt;sequence>
23
 *         &lt;element name="Marketplace" type="{http://www.w3.org/2001/XMLSchema}string"/>
24
 *         &lt;element name="Merchant" type="{http://www.w3.org/2001/XMLSchema}string"/>
25
 *         &lt;element name="ReportType" type="{http://www.w3.org/2001/XMLSchema}string"/>
26
 *         &lt;element name="StartDate" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
27
 *         &lt;element name="EndDate" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
28
 *       &lt;/sequence>
29
 *     &lt;/restriction>
30
 *   &lt;/complexContent>
31
 * &lt;/complexType>
32
 * </pre>
33
 * Generated by AWS Code Generator
34
 * <p/>
35
 * Wed Feb 18 13:28:59 PST 2009
36
 * 
37
 */
38
@XmlAccessorType(XmlAccessType.FIELD)
39
@XmlType(name = "", propOrder = {
40
    "marketplace",
41
    "marketplaceIdList",
42
    "merchant",
43
    "reportType",
44
    "startDate",
45
    "endDate",
46
    "reportOptions"
47
})
48
@XmlRootElement(name = "RequestReportRequest")
49
public class RequestReportRequest {
50
 
51
    @XmlElement(name = "Marketplace")
52
    protected String marketplace;
53
    @XmlElement(name = "MarketplaceIdList")
54
    protected IdList marketplaceIdList;
55
    @XmlElement(name = "Merchant", required = true)
56
    protected String merchant;
57
    @XmlElement(name = "ReportType", required = true)
58
    protected String reportType;
59
    @XmlElement(name = "StartDate")
60
    @XmlSchemaType(name = "dateTime")
61
    protected XMLGregorianCalendar startDate;
62
    @XmlElement(name = "EndDate")
63
    @XmlSchemaType(name = "dateTime")
64
    protected XMLGregorianCalendar endDate;
65
    @XmlElement(name="ReportOptions")
66
    protected String reportOptions;
67
 
68
    /**
69
     * Default constructor
70
     * 
71
     */
72
    public RequestReportRequest() {
73
        super();
74
    }
75
 
76
    /**
77
     * Value constructor
78
     * 
79
     */
80
    public RequestReportRequest(final String marketplace, final IdList marketplaceIdList, final String merchant, final String reportType, final XMLGregorianCalendar startDate, final XMLGregorianCalendar endDate, final String reportOptions) {
81
        this.marketplace = marketplace;
82
        this.marketplaceIdList = marketplaceIdList;
83
        this.merchant = merchant;
84
        this.reportType = reportType;
85
        this.startDate = startDate;
86
        this.endDate = endDate;
87
        this.reportOptions = reportOptions;
88
    }
89
 
90
    public void setReportOptions(String reportOptions) {
91
        this.reportOptions = reportOptions;
92
    }
93
 
94
    public String getReportOptions() {
95
        return reportOptions;
96
    }
97
 
98
    public RequestReportRequest withReportOptions(String reportOptions) {
99
        setReportOptions(reportOptions);
100
        return this;
101
    }
102
 
103
    public boolean isSetReportOptions() {
104
        return reportOptions != null;
105
    }
106
 
107
    /**
108
     * Gets the value of the merchant property.
109
     * 
110
     * @return
111
     *     possible object is
112
     *     {@link String }
113
     *     
114
     */
115
    public String getMerchant() {
116
        return merchant;
117
    }
118
 
119
    /**
120
     * Sets the value of the merchant property.
121
     * 
122
     * @param value
123
     *     allowed object is
124
     *     {@link String }
125
     *     
126
     */
127
    public void setMerchant(String value) {
128
        this.merchant = value;
129
    }
130
 
131
    public boolean isSetMerchant() {
132
        return (this.merchant!= null);
133
    }
134
 
135
    /**
136
     * Gets the value of the marketplace property.
137
     * 
138
     * @deprecated  See {@link #setMarketplace(String)}
139
     * @return
140
     *     possible object is
141
     *     {@link String }
142
     *     
143
     */
144
    public String getMarketplace() {
145
        return marketplace;
146
    }
147
 
148
    /**
149
     * Sets the value of the marketplace property.
150
     * 
151
     * @deprecated Not used anymore.  MWS ignores this parameter, but it is left
152
     * in here for backwards compatibility.  
153
     * Use {@link #setMarketplaceIdList(IdList)} instead.
154
     * @param value
155
     *     allowed object is
156
     *     {@link String }
157
     *     
158
     */
159
    public void setMarketplace(String value) {
160
        this.marketplace = value;
161
    }
162
 
163
    /**
164
     * @deprecated  See {@link #setMarketplace(String)}
165
     */
166
    public boolean isSetMarketplace() {
167
        return (this.marketplace!= null);
168
    }
169
 
170
    /**
171
     * Sets the value of the Marketplace property.
172
     * 
173
     * @deprecated  See {@link #setMarketplace(String)}
174
     * @param value
175
     * @return
176
     *     this instance
177
     */
178
    public RequestReportRequest withMarketplace(String value) {
179
        setMarketplace(value);
180
        return this;
181
    }
182
 
183
    /**
184
     * Gets the value of the reportType property.
185
     * 
186
     * @return
187
     *     possible object is
188
     *     {@link String }
189
     *     
190
     */
191
    public String getReportType() {
192
        return reportType;
193
    }
194
 
195
    /**
196
     * Sets the value of the reportType property.
197
     * 
198
     * @param value
199
     *     allowed object is
200
     *     {@link String }
201
     *     
202
     */
203
    public void setReportType(String value) {
204
        this.reportType = value;
205
    }
206
 
207
    public boolean isSetReportType() {
208
        return (this.reportType!= null);
209
    }
210
 
211
    /**
212
     * Gets the value of the startDate property.
213
     * 
214
     * @return
215
     *     possible object is
216
     *     {@link XMLGregorianCalendar }
217
     *     
218
     */
219
    public XMLGregorianCalendar getStartDate() {
220
        return startDate;
221
    }
222
 
223
    /**
224
     * Sets the value of the startDate property.
225
     * 
226
     * @param value
227
     *     allowed object is
228
     *     {@link XMLGregorianCalendar }
229
     *     
230
     */
231
    public void setStartDate(XMLGregorianCalendar value) {
232
        this.startDate = value;
233
    }
234
 
235
    public boolean isSetStartDate() {
236
        return (this.startDate!= null);
237
    }
238
 
239
    /**
240
     * Gets the value of the endDate property.
241
     * 
242
     * @return
243
     *     possible object is
244
     *     {@link XMLGregorianCalendar }
245
     *     
246
     */
247
    public XMLGregorianCalendar getEndDate() {
248
        return endDate;
249
    }
250
 
251
    /**
252
     * Sets the value of the endDate property.
253
     * 
254
     * @param value
255
     *     allowed object is
256
     *     {@link XMLGregorianCalendar }
257
     *     
258
     */
259
    public void setEndDate(XMLGregorianCalendar value) {
260
        this.endDate = value;
261
    }
262
 
263
    public boolean isSetEndDate() {
264
        return (this.endDate!= null);
265
    }
266
 
267
    /**
268
     * Sets the value of the Merchant property.
269
     * 
270
     * @param value
271
     * @return
272
     *     this instance
273
     */
274
    public RequestReportRequest withMerchant(String value) {
275
        setMerchant(value);
276
        return this;
277
    }
278
 
279
    /**
280
     * Sets the value of the ReportType property.
281
     * 
282
     * @param value
283
     * @return
284
     *     this instance
285
     */
286
    public RequestReportRequest withReportType(String value) {
287
        setReportType(value);
288
        return this;
289
    }
290
 
291
    /**
292
     * Sets the value of the StartDate property.
293
     * 
294
     * @param value
295
     * @return
296
     *     this instance
297
     */
298
    public RequestReportRequest withStartDate(XMLGregorianCalendar value) {
299
        setStartDate(value);
300
        return this;
301
    }
302
 
303
    /**
304
     * Sets the value of the EndDate property.
305
     * 
306
     * @param value
307
     * @return
308
     *     this instance
309
     */
310
    public RequestReportRequest withEndDate(XMLGregorianCalendar value) {
311
        setEndDate(value);
312
        return this;
313
    }
314
 
315
    public void setMarketplaceIdList(IdList marketplaceIdList) {
316
        this.marketplaceIdList = marketplaceIdList;
317
    }
318
 
319
    public IdList getMarketplaceIdList() {
320
        return marketplaceIdList;
321
    }
322
 
323
    public RequestReportRequest withMarketplaceIdList(IdList marketplaceIdList) {
324
        setMarketplaceIdList(marketplaceIdList);
325
        return this;
326
    }
327
 
328
    public boolean isSetMarketplaceIdList() {
329
        return marketplaceIdList != null;
330
    }
331
 
332
    /**
333
     *
334
     * JSON fragment representation of this object
335
     *
336
     * @return JSON fragment for this object. Name for outer
337
     * object expected to be set by calling method. This fragment
338
     * returns inner properties representation only
339
     *
340
     */
341
    protected String toJSONFragment() {
342
        StringBuffer json = new StringBuffer();
343
        boolean first = true;
344
        if (isSetMarketplace()) {
345
            if (!first) json.append(", ");
346
            json.append(quoteJSON("Marketplace"));
347
            json.append(" : ");
348
            json.append(quoteJSON(getMarketplace()));
349
            first = false;
350
        }
351
        if (isSetMerchant()) {
352
            if (!first) json.append(", ");
353
            json.append(quoteJSON("Merchant"));
354
            json.append(" : ");
355
            json.append(quoteJSON(getMerchant()));
356
            first = false;
357
        }
358
        if (isSetMarketplaceIdList()) {
359
            if (!first) json.append(", ");
360
            json.append("\"MarketplaceIdList\" : {");
361
            IdList  marketplaceIdList = getMarketplaceIdList();
362
 
363
 
364
            json.append(marketplaceIdList.toJSONFragment());
365
            json.append("}");
366
            first = false;
367
        }
368
        if (isSetReportType()) {
369
            if (!first) json.append(", ");
370
            json.append(quoteJSON("ReportType"));
371
            json.append(" : ");
372
            json.append(quoteJSON(getReportType()));
373
            first = false;
374
        }
375
        if (isSetReportOptions()) {
376
            if (!first) json.append(", ");
377
            json.append(quoteJSON("ReportOptions"));
378
            json.append(" : ");
379
            json.append(quoteJSON(getReportOptions()));
380
            first = false;
381
        }
382
        if (isSetStartDate()) {
383
            if (!first) json.append(", ");
384
            json.append(quoteJSON("StartDate"));
385
            json.append(" : ");
386
            json.append(quoteJSON(getStartDate() + ""));
387
            first = false;
388
        }
389
        if (isSetEndDate()) {
390
            if (!first) json.append(", ");
391
            json.append(quoteJSON("EndDate"));
392
            json.append(" : ");
393
            json.append(quoteJSON(getEndDate() + ""));
394
            first = false;
395
        }
396
        return json.toString();
397
    }
398
 
399
    /**
400
     *
401
     * Quote JSON string
402
     */
403
    private String quoteJSON(String string) {
404
        StringBuffer sb = new StringBuffer();
405
        sb.append("\"");
406
        int length = string.length();
407
        for (int i = 0; i < length; ++i) {
408
            char c = string.charAt(i);
409
            switch (c) {
410
            case '"':
411
                sb.append("\\\"");
412
                break;
413
            case '\\':
414
                sb.append("\\\\");
415
                break;
416
            case '/':
417
                sb.append("\\/");
418
                break;
419
            case '\b':
420
                sb.append("\\b");
421
                break;
422
            case '\f':
423
                sb.append("\\f");
424
                break;
425
            case '\n':
426
                sb.append("\\n");
427
                break;
428
            case '\r':
429
                sb.append("\\r");
430
                break;
431
            case '\t':
432
                sb.append("\\t");
433
                break;
434
            default:
435
                if (c <  ' ') {
436
                    sb.append("\\u" + String.format("%03x", Integer.valueOf(c)));
437
                } else {
438
                sb.append(c);
439
            }
440
        }
441
        }
442
        sb.append("\"");
443
        return sb.toString();
444
    }
445
 
446
 
447
}