Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
9048 manish.sha 1
/**
2
 * Autogenerated by Thrift Compiler (0.7.0)
3
 *
4
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5
 */
6
package in.shop2020.googleadwords;
7
 
8
import java.util.List;
9
import java.util.ArrayList;
10
import java.util.Map;
11
import java.util.HashMap;
12
import java.util.EnumMap;
13
import java.util.Set;
14
import java.util.HashSet;
15
import java.util.EnumSet;
16
import java.util.Collections;
17
import java.util.BitSet;
18
import java.nio.ByteBuffer;
19
import java.util.Arrays;
20
import org.slf4j.Logger;
21
import org.slf4j.LoggerFactory;
22
 
23
public class AdwordsCampaign implements org.apache.thrift.TBase<AdwordsCampaign, AdwordsCampaign._Fields>, java.io.Serializable, Cloneable {
24
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("AdwordsCampaign");
25
 
26
  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I64, (short)1);
27
  private static final org.apache.thrift.protocol.TField CAMPAIGN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("campaignId", org.apache.thrift.protocol.TType.I64, (short)2);
28
  private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)3);
29
  private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.I32, (short)4);
30
  private static final org.apache.thrift.protocol.TField START_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("startDate", org.apache.thrift.protocol.TType.I64, (short)5);
31
  private static final org.apache.thrift.protocol.TField END_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("endDate", org.apache.thrift.protocol.TType.I64, (short)6);
32
  private static final org.apache.thrift.protocol.TField BUDGET_AMOUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("budgetAmount", org.apache.thrift.protocol.TType.DOUBLE, (short)7);
33
  private static final org.apache.thrift.protocol.TField NETWORK_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("networkType", org.apache.thrift.protocol.TType.I32, (short)8);
34
 
35
  private long id; // required
36
  private long campaignId; // required
37
  private String name; // required
38
  private AdwordsCampaignStatus status; // required
39
  private long startDate; // required
40
  private long endDate; // required
41
  private double budgetAmount; // required
42
  private NetworkSettingType networkType; // required
43
 
44
  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
45
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
46
    ID((short)1, "id"),
47
    CAMPAIGN_ID((short)2, "campaignId"),
48
    NAME((short)3, "name"),
49
    /**
50
     * 
51
     * @see AdwordsCampaignStatus
52
     */
53
    STATUS((short)4, "status"),
54
    START_DATE((short)5, "startDate"),
55
    END_DATE((short)6, "endDate"),
56
    BUDGET_AMOUNT((short)7, "budgetAmount"),
57
    /**
58
     * 
59
     * @see NetworkSettingType
60
     */
61
    NETWORK_TYPE((short)8, "networkType");
62
 
63
    private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
64
 
65
    static {
66
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
67
        byName.put(field.getFieldName(), field);
68
      }
69
    }
70
 
71
    /**
72
     * Find the _Fields constant that matches fieldId, or null if its not found.
73
     */
74
    public static _Fields findByThriftId(int fieldId) {
75
      switch(fieldId) {
76
        case 1: // ID
77
          return ID;
78
        case 2: // CAMPAIGN_ID
79
          return CAMPAIGN_ID;
80
        case 3: // NAME
81
          return NAME;
82
        case 4: // STATUS
83
          return STATUS;
84
        case 5: // START_DATE
85
          return START_DATE;
86
        case 6: // END_DATE
87
          return END_DATE;
88
        case 7: // BUDGET_AMOUNT
89
          return BUDGET_AMOUNT;
90
        case 8: // NETWORK_TYPE
91
          return NETWORK_TYPE;
92
        default:
93
          return null;
94
      }
95
    }
96
 
97
    /**
98
     * Find the _Fields constant that matches fieldId, throwing an exception
99
     * if it is not found.
100
     */
101
    public static _Fields findByThriftIdOrThrow(int fieldId) {
102
      _Fields fields = findByThriftId(fieldId);
103
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
104
      return fields;
105
    }
106
 
107
    /**
108
     * Find the _Fields constant that matches name, or null if its not found.
109
     */
110
    public static _Fields findByName(String name) {
111
      return byName.get(name);
112
    }
113
 
114
    private final short _thriftId;
115
    private final String _fieldName;
116
 
117
    _Fields(short thriftId, String fieldName) {
118
      _thriftId = thriftId;
119
      _fieldName = fieldName;
120
    }
121
 
122
    public short getThriftFieldId() {
123
      return _thriftId;
124
    }
125
 
126
    public String getFieldName() {
127
      return _fieldName;
128
    }
129
  }
130
 
131
  // isset id assignments
132
  private static final int __ID_ISSET_ID = 0;
133
  private static final int __CAMPAIGNID_ISSET_ID = 1;
134
  private static final int __STARTDATE_ISSET_ID = 2;
135
  private static final int __ENDDATE_ISSET_ID = 3;
136
  private static final int __BUDGETAMOUNT_ISSET_ID = 4;
137
  private BitSet __isset_bit_vector = new BitSet(5);
138
 
139
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
140
  static {
141
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
142
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, 
143
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
144
    tmpMap.put(_Fields.CAMPAIGN_ID, new org.apache.thrift.meta_data.FieldMetaData("campaignId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
145
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
146
    tmpMap.put(_Fields.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, 
147
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
148
    tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.DEFAULT, 
149
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, AdwordsCampaignStatus.class)));
150
    tmpMap.put(_Fields.START_DATE, new org.apache.thrift.meta_data.FieldMetaData("startDate", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
151
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
152
    tmpMap.put(_Fields.END_DATE, new org.apache.thrift.meta_data.FieldMetaData("endDate", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
153
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
154
    tmpMap.put(_Fields.BUDGET_AMOUNT, new org.apache.thrift.meta_data.FieldMetaData("budgetAmount", org.apache.thrift.TFieldRequirementType.DEFAULT, 
155
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
156
    tmpMap.put(_Fields.NETWORK_TYPE, new org.apache.thrift.meta_data.FieldMetaData("networkType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
157
        new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, NetworkSettingType.class)));
158
    metaDataMap = Collections.unmodifiableMap(tmpMap);
159
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(AdwordsCampaign.class, metaDataMap);
160
  }
161
 
162
  public AdwordsCampaign() {
163
  }
164
 
165
  public AdwordsCampaign(
166
    long id,
167
    long campaignId,
168
    String name,
169
    AdwordsCampaignStatus status,
170
    double budgetAmount,
171
    NetworkSettingType networkType)
172
  {
173
    this();
174
    this.id = id;
175
    setIdIsSet(true);
176
    this.campaignId = campaignId;
177
    setCampaignIdIsSet(true);
178
    this.name = name;
179
    this.status = status;
180
    this.budgetAmount = budgetAmount;
181
    setBudgetAmountIsSet(true);
182
    this.networkType = networkType;
183
  }
184
 
185
  /**
186
   * Performs a deep copy on <i>other</i>.
187
   */
188
  public AdwordsCampaign(AdwordsCampaign other) {
189
    __isset_bit_vector.clear();
190
    __isset_bit_vector.or(other.__isset_bit_vector);
191
    this.id = other.id;
192
    this.campaignId = other.campaignId;
193
    if (other.isSetName()) {
194
      this.name = other.name;
195
    }
196
    if (other.isSetStatus()) {
197
      this.status = other.status;
198
    }
199
    this.startDate = other.startDate;
200
    this.endDate = other.endDate;
201
    this.budgetAmount = other.budgetAmount;
202
    if (other.isSetNetworkType()) {
203
      this.networkType = other.networkType;
204
    }
205
  }
206
 
207
  public AdwordsCampaign deepCopy() {
208
    return new AdwordsCampaign(this);
209
  }
210
 
211
  @Override
212
  public void clear() {
213
    setIdIsSet(false);
214
    this.id = 0;
215
    setCampaignIdIsSet(false);
216
    this.campaignId = 0;
217
    this.name = null;
218
    this.status = null;
219
    setStartDateIsSet(false);
220
    this.startDate = 0;
221
    setEndDateIsSet(false);
222
    this.endDate = 0;
223
    setBudgetAmountIsSet(false);
224
    this.budgetAmount = 0.0;
225
    this.networkType = null;
226
  }
227
 
228
  public long getId() {
229
    return this.id;
230
  }
231
 
232
  public void setId(long id) {
233
    this.id = id;
234
    setIdIsSet(true);
235
  }
236
 
237
  public void unsetId() {
238
    __isset_bit_vector.clear(__ID_ISSET_ID);
239
  }
240
 
241
  /** Returns true if field id is set (has been assigned a value) and false otherwise */
242
  public boolean isSetId() {
243
    return __isset_bit_vector.get(__ID_ISSET_ID);
244
  }
245
 
246
  public void setIdIsSet(boolean value) {
247
    __isset_bit_vector.set(__ID_ISSET_ID, value);
248
  }
249
 
250
  public long getCampaignId() {
251
    return this.campaignId;
252
  }
253
 
254
  public void setCampaignId(long campaignId) {
255
    this.campaignId = campaignId;
256
    setCampaignIdIsSet(true);
257
  }
258
 
259
  public void unsetCampaignId() {
260
    __isset_bit_vector.clear(__CAMPAIGNID_ISSET_ID);
261
  }
262
 
263
  /** Returns true if field campaignId is set (has been assigned a value) and false otherwise */
264
  public boolean isSetCampaignId() {
265
    return __isset_bit_vector.get(__CAMPAIGNID_ISSET_ID);
266
  }
267
 
268
  public void setCampaignIdIsSet(boolean value) {
269
    __isset_bit_vector.set(__CAMPAIGNID_ISSET_ID, value);
270
  }
271
 
272
  public String getName() {
273
    return this.name;
274
  }
275
 
276
  public void setName(String name) {
277
    this.name = name;
278
  }
279
 
280
  public void unsetName() {
281
    this.name = null;
282
  }
283
 
284
  /** Returns true if field name is set (has been assigned a value) and false otherwise */
285
  public boolean isSetName() {
286
    return this.name != null;
287
  }
288
 
289
  public void setNameIsSet(boolean value) {
290
    if (!value) {
291
      this.name = null;
292
    }
293
  }
294
 
295
  /**
296
   * 
297
   * @see AdwordsCampaignStatus
298
   */
299
  public AdwordsCampaignStatus getStatus() {
300
    return this.status;
301
  }
302
 
303
  /**
304
   * 
305
   * @see AdwordsCampaignStatus
306
   */
307
  public void setStatus(AdwordsCampaignStatus status) {
308
    this.status = status;
309
  }
310
 
311
  public void unsetStatus() {
312
    this.status = null;
313
  }
314
 
315
  /** Returns true if field status is set (has been assigned a value) and false otherwise */
316
  public boolean isSetStatus() {
317
    return this.status != null;
318
  }
319
 
320
  public void setStatusIsSet(boolean value) {
321
    if (!value) {
322
      this.status = null;
323
    }
324
  }
325
 
326
  public long getStartDate() {
327
    return this.startDate;
328
  }
329
 
330
  public void setStartDate(long startDate) {
331
    this.startDate = startDate;
332
    setStartDateIsSet(true);
333
  }
334
 
335
  public void unsetStartDate() {
336
    __isset_bit_vector.clear(__STARTDATE_ISSET_ID);
337
  }
338
 
339
  /** Returns true if field startDate is set (has been assigned a value) and false otherwise */
340
  public boolean isSetStartDate() {
341
    return __isset_bit_vector.get(__STARTDATE_ISSET_ID);
342
  }
343
 
344
  public void setStartDateIsSet(boolean value) {
345
    __isset_bit_vector.set(__STARTDATE_ISSET_ID, value);
346
  }
347
 
348
  public long getEndDate() {
349
    return this.endDate;
350
  }
351
 
352
  public void setEndDate(long endDate) {
353
    this.endDate = endDate;
354
    setEndDateIsSet(true);
355
  }
356
 
357
  public void unsetEndDate() {
358
    __isset_bit_vector.clear(__ENDDATE_ISSET_ID);
359
  }
360
 
361
  /** Returns true if field endDate is set (has been assigned a value) and false otherwise */
362
  public boolean isSetEndDate() {
363
    return __isset_bit_vector.get(__ENDDATE_ISSET_ID);
364
  }
365
 
366
  public void setEndDateIsSet(boolean value) {
367
    __isset_bit_vector.set(__ENDDATE_ISSET_ID, value);
368
  }
369
 
370
  public double getBudgetAmount() {
371
    return this.budgetAmount;
372
  }
373
 
374
  public void setBudgetAmount(double budgetAmount) {
375
    this.budgetAmount = budgetAmount;
376
    setBudgetAmountIsSet(true);
377
  }
378
 
379
  public void unsetBudgetAmount() {
380
    __isset_bit_vector.clear(__BUDGETAMOUNT_ISSET_ID);
381
  }
382
 
383
  /** Returns true if field budgetAmount is set (has been assigned a value) and false otherwise */
384
  public boolean isSetBudgetAmount() {
385
    return __isset_bit_vector.get(__BUDGETAMOUNT_ISSET_ID);
386
  }
387
 
388
  public void setBudgetAmountIsSet(boolean value) {
389
    __isset_bit_vector.set(__BUDGETAMOUNT_ISSET_ID, value);
390
  }
391
 
392
  /**
393
   * 
394
   * @see NetworkSettingType
395
   */
396
  public NetworkSettingType getNetworkType() {
397
    return this.networkType;
398
  }
399
 
400
  /**
401
   * 
402
   * @see NetworkSettingType
403
   */
404
  public void setNetworkType(NetworkSettingType networkType) {
405
    this.networkType = networkType;
406
  }
407
 
408
  public void unsetNetworkType() {
409
    this.networkType = null;
410
  }
411
 
412
  /** Returns true if field networkType is set (has been assigned a value) and false otherwise */
413
  public boolean isSetNetworkType() {
414
    return this.networkType != null;
415
  }
416
 
417
  public void setNetworkTypeIsSet(boolean value) {
418
    if (!value) {
419
      this.networkType = null;
420
    }
421
  }
422
 
423
  public void setFieldValue(_Fields field, Object value) {
424
    switch (field) {
425
    case ID:
426
      if (value == null) {
427
        unsetId();
428
      } else {
429
        setId((Long)value);
430
      }
431
      break;
432
 
433
    case CAMPAIGN_ID:
434
      if (value == null) {
435
        unsetCampaignId();
436
      } else {
437
        setCampaignId((Long)value);
438
      }
439
      break;
440
 
441
    case NAME:
442
      if (value == null) {
443
        unsetName();
444
      } else {
445
        setName((String)value);
446
      }
447
      break;
448
 
449
    case STATUS:
450
      if (value == null) {
451
        unsetStatus();
452
      } else {
453
        setStatus((AdwordsCampaignStatus)value);
454
      }
455
      break;
456
 
457
    case START_DATE:
458
      if (value == null) {
459
        unsetStartDate();
460
      } else {
461
        setStartDate((Long)value);
462
      }
463
      break;
464
 
465
    case END_DATE:
466
      if (value == null) {
467
        unsetEndDate();
468
      } else {
469
        setEndDate((Long)value);
470
      }
471
      break;
472
 
473
    case BUDGET_AMOUNT:
474
      if (value == null) {
475
        unsetBudgetAmount();
476
      } else {
477
        setBudgetAmount((Double)value);
478
      }
479
      break;
480
 
481
    case NETWORK_TYPE:
482
      if (value == null) {
483
        unsetNetworkType();
484
      } else {
485
        setNetworkType((NetworkSettingType)value);
486
      }
487
      break;
488
 
489
    }
490
  }
491
 
492
  public Object getFieldValue(_Fields field) {
493
    switch (field) {
494
    case ID:
495
      return Long.valueOf(getId());
496
 
497
    case CAMPAIGN_ID:
498
      return Long.valueOf(getCampaignId());
499
 
500
    case NAME:
501
      return getName();
502
 
503
    case STATUS:
504
      return getStatus();
505
 
506
    case START_DATE:
507
      return Long.valueOf(getStartDate());
508
 
509
    case END_DATE:
510
      return Long.valueOf(getEndDate());
511
 
512
    case BUDGET_AMOUNT:
513
      return Double.valueOf(getBudgetAmount());
514
 
515
    case NETWORK_TYPE:
516
      return getNetworkType();
517
 
518
    }
519
    throw new IllegalStateException();
520
  }
521
 
522
  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
523
  public boolean isSet(_Fields field) {
524
    if (field == null) {
525
      throw new IllegalArgumentException();
526
    }
527
 
528
    switch (field) {
529
    case ID:
530
      return isSetId();
531
    case CAMPAIGN_ID:
532
      return isSetCampaignId();
533
    case NAME:
534
      return isSetName();
535
    case STATUS:
536
      return isSetStatus();
537
    case START_DATE:
538
      return isSetStartDate();
539
    case END_DATE:
540
      return isSetEndDate();
541
    case BUDGET_AMOUNT:
542
      return isSetBudgetAmount();
543
    case NETWORK_TYPE:
544
      return isSetNetworkType();
545
    }
546
    throw new IllegalStateException();
547
  }
548
 
549
  @Override
550
  public boolean equals(Object that) {
551
    if (that == null)
552
      return false;
553
    if (that instanceof AdwordsCampaign)
554
      return this.equals((AdwordsCampaign)that);
555
    return false;
556
  }
557
 
558
  public boolean equals(AdwordsCampaign that) {
559
    if (that == null)
560
      return false;
561
 
562
    boolean this_present_id = true;
563
    boolean that_present_id = true;
564
    if (this_present_id || that_present_id) {
565
      if (!(this_present_id && that_present_id))
566
        return false;
567
      if (this.id != that.id)
568
        return false;
569
    }
570
 
571
    boolean this_present_campaignId = true;
572
    boolean that_present_campaignId = true;
573
    if (this_present_campaignId || that_present_campaignId) {
574
      if (!(this_present_campaignId && that_present_campaignId))
575
        return false;
576
      if (this.campaignId != that.campaignId)
577
        return false;
578
    }
579
 
580
    boolean this_present_name = true && this.isSetName();
581
    boolean that_present_name = true && that.isSetName();
582
    if (this_present_name || that_present_name) {
583
      if (!(this_present_name && that_present_name))
584
        return false;
585
      if (!this.name.equals(that.name))
586
        return false;
587
    }
588
 
589
    boolean this_present_status = true && this.isSetStatus();
590
    boolean that_present_status = true && that.isSetStatus();
591
    if (this_present_status || that_present_status) {
592
      if (!(this_present_status && that_present_status))
593
        return false;
594
      if (!this.status.equals(that.status))
595
        return false;
596
    }
597
 
598
    boolean this_present_startDate = true && this.isSetStartDate();
599
    boolean that_present_startDate = true && that.isSetStartDate();
600
    if (this_present_startDate || that_present_startDate) {
601
      if (!(this_present_startDate && that_present_startDate))
602
        return false;
603
      if (this.startDate != that.startDate)
604
        return false;
605
    }
606
 
607
    boolean this_present_endDate = true && this.isSetEndDate();
608
    boolean that_present_endDate = true && that.isSetEndDate();
609
    if (this_present_endDate || that_present_endDate) {
610
      if (!(this_present_endDate && that_present_endDate))
611
        return false;
612
      if (this.endDate != that.endDate)
613
        return false;
614
    }
615
 
616
    boolean this_present_budgetAmount = true;
617
    boolean that_present_budgetAmount = true;
618
    if (this_present_budgetAmount || that_present_budgetAmount) {
619
      if (!(this_present_budgetAmount && that_present_budgetAmount))
620
        return false;
621
      if (this.budgetAmount != that.budgetAmount)
622
        return false;
623
    }
624
 
625
    boolean this_present_networkType = true && this.isSetNetworkType();
626
    boolean that_present_networkType = true && that.isSetNetworkType();
627
    if (this_present_networkType || that_present_networkType) {
628
      if (!(this_present_networkType && that_present_networkType))
629
        return false;
630
      if (!this.networkType.equals(that.networkType))
631
        return false;
632
    }
633
 
634
    return true;
635
  }
636
 
637
  @Override
638
  public int hashCode() {
639
    return 0;
640
  }
641
 
642
  public int compareTo(AdwordsCampaign other) {
643
    if (!getClass().equals(other.getClass())) {
644
      return getClass().getName().compareTo(other.getClass().getName());
645
    }
646
 
647
    int lastComparison = 0;
648
    AdwordsCampaign typedOther = (AdwordsCampaign)other;
649
 
650
    lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId());
651
    if (lastComparison != 0) {
652
      return lastComparison;
653
    }
654
    if (isSetId()) {
655
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id);
656
      if (lastComparison != 0) {
657
        return lastComparison;
658
      }
659
    }
660
    lastComparison = Boolean.valueOf(isSetCampaignId()).compareTo(typedOther.isSetCampaignId());
661
    if (lastComparison != 0) {
662
      return lastComparison;
663
    }
664
    if (isSetCampaignId()) {
665
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.campaignId, typedOther.campaignId);
666
      if (lastComparison != 0) {
667
        return lastComparison;
668
      }
669
    }
670
    lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
671
    if (lastComparison != 0) {
672
      return lastComparison;
673
    }
674
    if (isSetName()) {
675
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
676
      if (lastComparison != 0) {
677
        return lastComparison;
678
      }
679
    }
680
    lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus());
681
    if (lastComparison != 0) {
682
      return lastComparison;
683
    }
684
    if (isSetStatus()) {
685
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status);
686
      if (lastComparison != 0) {
687
        return lastComparison;
688
      }
689
    }
690
    lastComparison = Boolean.valueOf(isSetStartDate()).compareTo(typedOther.isSetStartDate());
691
    if (lastComparison != 0) {
692
      return lastComparison;
693
    }
694
    if (isSetStartDate()) {
695
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startDate, typedOther.startDate);
696
      if (lastComparison != 0) {
697
        return lastComparison;
698
      }
699
    }
700
    lastComparison = Boolean.valueOf(isSetEndDate()).compareTo(typedOther.isSetEndDate());
701
    if (lastComparison != 0) {
702
      return lastComparison;
703
    }
704
    if (isSetEndDate()) {
705
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endDate, typedOther.endDate);
706
      if (lastComparison != 0) {
707
        return lastComparison;
708
      }
709
    }
710
    lastComparison = Boolean.valueOf(isSetBudgetAmount()).compareTo(typedOther.isSetBudgetAmount());
711
    if (lastComparison != 0) {
712
      return lastComparison;
713
    }
714
    if (isSetBudgetAmount()) {
715
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.budgetAmount, typedOther.budgetAmount);
716
      if (lastComparison != 0) {
717
        return lastComparison;
718
      }
719
    }
720
    lastComparison = Boolean.valueOf(isSetNetworkType()).compareTo(typedOther.isSetNetworkType());
721
    if (lastComparison != 0) {
722
      return lastComparison;
723
    }
724
    if (isSetNetworkType()) {
725
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.networkType, typedOther.networkType);
726
      if (lastComparison != 0) {
727
        return lastComparison;
728
      }
729
    }
730
    return 0;
731
  }
732
 
733
  public _Fields fieldForId(int fieldId) {
734
    return _Fields.findByThriftId(fieldId);
735
  }
736
 
737
  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
738
    org.apache.thrift.protocol.TField field;
739
    iprot.readStructBegin();
740
    while (true)
741
    {
742
      field = iprot.readFieldBegin();
743
      if (field.type == org.apache.thrift.protocol.TType.STOP) { 
744
        break;
745
      }
746
      switch (field.id) {
747
        case 1: // ID
748
          if (field.type == org.apache.thrift.protocol.TType.I64) {
749
            this.id = iprot.readI64();
750
            setIdIsSet(true);
751
          } else { 
752
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
753
          }
754
          break;
755
        case 2: // CAMPAIGN_ID
756
          if (field.type == org.apache.thrift.protocol.TType.I64) {
757
            this.campaignId = iprot.readI64();
758
            setCampaignIdIsSet(true);
759
          } else { 
760
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
761
          }
762
          break;
763
        case 3: // NAME
764
          if (field.type == org.apache.thrift.protocol.TType.STRING) {
765
            this.name = iprot.readString();
766
          } else { 
767
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
768
          }
769
          break;
770
        case 4: // STATUS
771
          if (field.type == org.apache.thrift.protocol.TType.I32) {
772
            this.status = AdwordsCampaignStatus.findByValue(iprot.readI32());
773
          } else { 
774
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
775
          }
776
          break;
777
        case 5: // START_DATE
778
          if (field.type == org.apache.thrift.protocol.TType.I64) {
779
            this.startDate = iprot.readI64();
780
            setStartDateIsSet(true);
781
          } else { 
782
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
783
          }
784
          break;
785
        case 6: // END_DATE
786
          if (field.type == org.apache.thrift.protocol.TType.I64) {
787
            this.endDate = iprot.readI64();
788
            setEndDateIsSet(true);
789
          } else { 
790
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
791
          }
792
          break;
793
        case 7: // BUDGET_AMOUNT
794
          if (field.type == org.apache.thrift.protocol.TType.DOUBLE) {
795
            this.budgetAmount = iprot.readDouble();
796
            setBudgetAmountIsSet(true);
797
          } else { 
798
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
799
          }
800
          break;
801
        case 8: // NETWORK_TYPE
802
          if (field.type == org.apache.thrift.protocol.TType.I32) {
803
            this.networkType = NetworkSettingType.findByValue(iprot.readI32());
804
          } else { 
805
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
806
          }
807
          break;
808
        default:
809
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
810
      }
811
      iprot.readFieldEnd();
812
    }
813
    iprot.readStructEnd();
814
    validate();
815
  }
816
 
817
  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
818
    validate();
819
 
820
    oprot.writeStructBegin(STRUCT_DESC);
821
    oprot.writeFieldBegin(ID_FIELD_DESC);
822
    oprot.writeI64(this.id);
823
    oprot.writeFieldEnd();
824
    oprot.writeFieldBegin(CAMPAIGN_ID_FIELD_DESC);
825
    oprot.writeI64(this.campaignId);
826
    oprot.writeFieldEnd();
827
    if (this.name != null) {
828
      oprot.writeFieldBegin(NAME_FIELD_DESC);
829
      oprot.writeString(this.name);
830
      oprot.writeFieldEnd();
831
    }
832
    if (this.status != null) {
833
      oprot.writeFieldBegin(STATUS_FIELD_DESC);
834
      oprot.writeI32(this.status.getValue());
835
      oprot.writeFieldEnd();
836
    }
837
    if (isSetStartDate()) {
838
      oprot.writeFieldBegin(START_DATE_FIELD_DESC);
839
      oprot.writeI64(this.startDate);
840
      oprot.writeFieldEnd();
841
    }
842
    if (isSetEndDate()) {
843
      oprot.writeFieldBegin(END_DATE_FIELD_DESC);
844
      oprot.writeI64(this.endDate);
845
      oprot.writeFieldEnd();
846
    }
847
    oprot.writeFieldBegin(BUDGET_AMOUNT_FIELD_DESC);
848
    oprot.writeDouble(this.budgetAmount);
849
    oprot.writeFieldEnd();
850
    if (this.networkType != null) {
851
      oprot.writeFieldBegin(NETWORK_TYPE_FIELD_DESC);
852
      oprot.writeI32(this.networkType.getValue());
853
      oprot.writeFieldEnd();
854
    }
855
    oprot.writeFieldStop();
856
    oprot.writeStructEnd();
857
  }
858
 
859
  @Override
860
  public String toString() {
861
    StringBuilder sb = new StringBuilder("AdwordsCampaign(");
862
    boolean first = true;
863
 
864
    sb.append("id:");
865
    sb.append(this.id);
866
    first = false;
867
    if (!first) sb.append(", ");
868
    sb.append("campaignId:");
869
    sb.append(this.campaignId);
870
    first = false;
871
    if (!first) sb.append(", ");
872
    sb.append("name:");
873
    if (this.name == null) {
874
      sb.append("null");
875
    } else {
876
      sb.append(this.name);
877
    }
878
    first = false;
879
    if (!first) sb.append(", ");
880
    sb.append("status:");
881
    if (this.status == null) {
882
      sb.append("null");
883
    } else {
884
      sb.append(this.status);
885
    }
886
    first = false;
887
    if (isSetStartDate()) {
888
      if (!first) sb.append(", ");
889
      sb.append("startDate:");
890
      sb.append(this.startDate);
891
      first = false;
892
    }
893
    if (isSetEndDate()) {
894
      if (!first) sb.append(", ");
895
      sb.append("endDate:");
896
      sb.append(this.endDate);
897
      first = false;
898
    }
899
    if (!first) sb.append(", ");
900
    sb.append("budgetAmount:");
901
    sb.append(this.budgetAmount);
902
    first = false;
903
    if (!first) sb.append(", ");
904
    sb.append("networkType:");
905
    if (this.networkType == null) {
906
      sb.append("null");
907
    } else {
908
      sb.append(this.networkType);
909
    }
910
    first = false;
911
    sb.append(")");
912
    return sb.toString();
913
  }
914
 
915
  public void validate() throws org.apache.thrift.TException {
916
    // check for required fields
917
  }
918
 
919
  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
920
    try {
921
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
922
    } catch (org.apache.thrift.TException te) {
923
      throw new java.io.IOException(te);
924
    }
925
  }
926
 
927
  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
928
    try {
929
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
930
      __isset_bit_vector = new BitSet(1);
931
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
932
    } catch (org.apache.thrift.TException te) {
933
      throw new java.io.IOException(te);
934
    }
935
  }
936
 
937
}
938