Subversion Repositories SmartDukaan

Rev

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