All Downloads are FREE. Search and download functionalities are using the official Maven repository.

open_rtb.BidRequestThrift Maven / Gradle / Ivy

There is a newer version: 3.1.2
Show newest version
/**
 * Autogenerated by Thrift Compiler (0.9.2)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package open_rtb;

import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;

import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
/**
 * 3.3.1 Bid Request Object
 * The top-level bid request object contains a globally unique bid request or auction ID. This “id” attribute is required as is at least one “imp” (i.e., impression) object. Other attributes are optional since an exchange may establish default values.
 */
@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2016-6-3")
public class BidRequestThrift implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BidRequestThrift");

  private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField IMP_FIELD_DESC = new org.apache.thrift.protocol.TField("imp", org.apache.thrift.protocol.TType.LIST, (short)2);
  private static final org.apache.thrift.protocol.TField SITE_FIELD_DESC = new org.apache.thrift.protocol.TField("site", org.apache.thrift.protocol.TType.STRUCT, (short)3);
  private static final org.apache.thrift.protocol.TField APP_FIELD_DESC = new org.apache.thrift.protocol.TField("app", org.apache.thrift.protocol.TType.STRUCT, (short)4);
  private static final org.apache.thrift.protocol.TField DEVICE_FIELD_DESC = new org.apache.thrift.protocol.TField("device", org.apache.thrift.protocol.TType.STRUCT, (short)5);
  private static final org.apache.thrift.protocol.TField USER_FIELD_DESC = new org.apache.thrift.protocol.TField("user", org.apache.thrift.protocol.TType.STRUCT, (short)6);
  private static final org.apache.thrift.protocol.TField AT_FIELD_DESC = new org.apache.thrift.protocol.TField("at", org.apache.thrift.protocol.TType.I16, (short)7);
  private static final org.apache.thrift.protocol.TField TMAX_FIELD_DESC = new org.apache.thrift.protocol.TField("tmax", org.apache.thrift.protocol.TType.I32, (short)8);
  private static final org.apache.thrift.protocol.TField WSEAT_FIELD_DESC = new org.apache.thrift.protocol.TField("wseat", org.apache.thrift.protocol.TType.LIST, (short)9);
  private static final org.apache.thrift.protocol.TField ALLIMPS_FIELD_DESC = new org.apache.thrift.protocol.TField("allimps", org.apache.thrift.protocol.TType.BYTE, (short)10);
  private static final org.apache.thrift.protocol.TField CUR_FIELD_DESC = new org.apache.thrift.protocol.TField("cur", org.apache.thrift.protocol.TType.LIST, (short)11);
  private static final org.apache.thrift.protocol.TField BCAT_FIELD_DESC = new org.apache.thrift.protocol.TField("bcat", org.apache.thrift.protocol.TType.LIST, (short)12);
  private static final org.apache.thrift.protocol.TField BADV_FIELD_DESC = new org.apache.thrift.protocol.TField("badv", org.apache.thrift.protocol.TType.LIST, (short)13);
  private static final org.apache.thrift.protocol.TField REGS_FIELD_DESC = new org.apache.thrift.protocol.TField("regs", org.apache.thrift.protocol.TType.STRUCT, (short)14);

  private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
  static {
    schemes.put(StandardScheme.class, new BidRequestThriftStandardSchemeFactory());
    schemes.put(TupleScheme.class, new BidRequestThriftTupleSchemeFactory());
  }

  /**
   * Unique ID of the bid request, provided by the exchange.
   */
  public String id; // optional
  /**
   * Array of impression objects. Multiple impression auctions may be specified in a single bid request. At least one impression is required for a valid bid request.
   */
  public List imp; // optional
  /**
   * See Site Object.
   */
  public SiteThrift site; // optional
  /**
   * See App Object.
   */
  public AppThrift app; // optional
  /**
   * See Device Object.
   */
  public DeviceThrift device; // optional
  /**
   * See User Object.
   */
  public UserThrift user; // optional
  /**
   * Auction Type. If “1”, then first price auction. If “2”, then second price auction. Additional auction types can be defined as per the exchange’s business rules. Exchange specific rules should be numbered over 500.
   */
  public short at; // optional
  /**
   * Maximum amount of time in milliseconds to submit a bid (e.g., 120 means the bidder has 120ms to submit a bid before the auction is complete). If this value never changes across an exchange, then the exchange can supply this information offline.
   */
  public int tmax; // optional
  /**
   * Array of buyer seats allowed to bid on this auction. Seats are an optional feature of exchange. For example, [“4”,”34”,”82”,”A45”] indicates that only advertisers using these exchange seats are allowed to bid on the impressions in this auction.
   */
  public List wseat; // optional
  /**
   * Flag to indicate whether Exchange can verify that all impressions offered represent all of the impressions available in context (e.g., all impressions available on the web page; all impressions available for a video [pre, mid and postroll spots], etc.) to support road-blocking. A true value should only be passed if the exchange is aware of all impressions in context for the publisher. “0” means the exchange cannot verify, and “1” means that all impressions represent all impressions available.
   */
  public byte allimps; // optional
  /**
   * Array of allowed currencies for bids on this bid request using ISO-4217 alphabetic codes. If only one currency is used by the exchange, this parameter is not required.
   */
  public List cur; // optional
  /**
   * Blocked Advertiser Categories. Note that there is no existing categorization / taxonomy of advertiser industries. However, as a substitute exchanges may decide to use IAB categories as an approximation (See Table 6.1 Content Categories)
   */
  public List bcat; // optional
  /**
   * Array of strings of blocked top-level domains of advertisers. For example, {“company1.com”, “company2.com”}.
   */
  public List badv; // optional
  /**
   * This object is a container for any legal, governmental or industry regulations in force for the request.
   */
  public RegulationsThrift regs; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    /**
     * Unique ID of the bid request, provided by the exchange.
     */
    ID((short)1, "id"),
    /**
     * Array of impression objects. Multiple impression auctions may be specified in a single bid request. At least one impression is required for a valid bid request.
     */
    IMP((short)2, "imp"),
    /**
     * See Site Object.
     */
    SITE((short)3, "site"),
    /**
     * See App Object.
     */
    APP((short)4, "app"),
    /**
     * See Device Object.
     */
    DEVICE((short)5, "device"),
    /**
     * See User Object.
     */
    USER((short)6, "user"),
    /**
     * Auction Type. If “1”, then first price auction. If “2”, then second price auction. Additional auction types can be defined as per the exchange’s business rules. Exchange specific rules should be numbered over 500.
     */
    AT((short)7, "at"),
    /**
     * Maximum amount of time in milliseconds to submit a bid (e.g., 120 means the bidder has 120ms to submit a bid before the auction is complete). If this value never changes across an exchange, then the exchange can supply this information offline.
     */
    TMAX((short)8, "tmax"),
    /**
     * Array of buyer seats allowed to bid on this auction. Seats are an optional feature of exchange. For example, [“4”,”34”,”82”,”A45”] indicates that only advertisers using these exchange seats are allowed to bid on the impressions in this auction.
     */
    WSEAT((short)9, "wseat"),
    /**
     * Flag to indicate whether Exchange can verify that all impressions offered represent all of the impressions available in context (e.g., all impressions available on the web page; all impressions available for a video [pre, mid and postroll spots], etc.) to support road-blocking. A true value should only be passed if the exchange is aware of all impressions in context for the publisher. “0” means the exchange cannot verify, and “1” means that all impressions represent all impressions available.
     */
    ALLIMPS((short)10, "allimps"),
    /**
     * Array of allowed currencies for bids on this bid request using ISO-4217 alphabetic codes. If only one currency is used by the exchange, this parameter is not required.
     */
    CUR((short)11, "cur"),
    /**
     * Blocked Advertiser Categories. Note that there is no existing categorization / taxonomy of advertiser industries. However, as a substitute exchanges may decide to use IAB categories as an approximation (See Table 6.1 Content Categories)
     */
    BCAT((short)12, "bcat"),
    /**
     * Array of strings of blocked top-level domains of advertisers. For example, {“company1.com”, “company2.com”}.
     */
    BADV((short)13, "badv"),
    /**
     * This object is a container for any legal, governmental or industry regulations in force for the request.
     */
    REGS((short)14, "regs");

    private static final Map byName = new HashMap();

    static {
      for (_Fields field : EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // ID
          return ID;
        case 2: // IMP
          return IMP;
        case 3: // SITE
          return SITE;
        case 4: // APP
          return APP;
        case 5: // DEVICE
          return DEVICE;
        case 6: // USER
          return USER;
        case 7: // AT
          return AT;
        case 8: // TMAX
          return TMAX;
        case 9: // WSEAT
          return WSEAT;
        case 10: // ALLIMPS
          return ALLIMPS;
        case 11: // CUR
          return CUR;
        case 12: // BCAT
          return BCAT;
        case 13: // BADV
          return BADV;
        case 14: // REGS
          return REGS;
        default:
          return null;
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, throwing an exception
     * if it is not found.
     */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    public static _Fields findByName(String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final String _fieldName;

    _Fields(short thriftId, String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __AT_ISSET_ID = 0;
  private static final int __TMAX_ISSET_ID = 1;
  private static final int __ALLIMPS_ISSET_ID = 2;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.ID,_Fields.IMP,_Fields.SITE,_Fields.APP,_Fields.DEVICE,_Fields.USER,_Fields.AT,_Fields.TMAX,_Fields.WSEAT,_Fields.ALLIMPS,_Fields.CUR,_Fields.BCAT,_Fields.BADV,_Fields.REGS};
  public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.IMP, new org.apache.thrift.meta_data.FieldMetaData("imp", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ImpressionThrift.class))));
    tmpMap.put(_Fields.SITE, new org.apache.thrift.meta_data.FieldMetaData("site", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, SiteThrift.class)));
    tmpMap.put(_Fields.APP, new org.apache.thrift.meta_data.FieldMetaData("app", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, AppThrift.class)));
    tmpMap.put(_Fields.DEVICE, new org.apache.thrift.meta_data.FieldMetaData("device", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, DeviceThrift.class)));
    tmpMap.put(_Fields.USER, new org.apache.thrift.meta_data.FieldMetaData("user", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, UserThrift.class)));
    tmpMap.put(_Fields.AT, new org.apache.thrift.meta_data.FieldMetaData("at", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16)));
    tmpMap.put(_Fields.TMAX, new org.apache.thrift.meta_data.FieldMetaData("tmax", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
    tmpMap.put(_Fields.WSEAT, new org.apache.thrift.meta_data.FieldMetaData("wseat", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.ALLIMPS, new org.apache.thrift.meta_data.FieldMetaData("allimps", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE)));
    tmpMap.put(_Fields.CUR, new org.apache.thrift.meta_data.FieldMetaData("cur", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.BCAT, new org.apache.thrift.meta_data.FieldMetaData("bcat", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.BADV, new org.apache.thrift.meta_data.FieldMetaData("badv", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
    tmpMap.put(_Fields.REGS, new org.apache.thrift.meta_data.FieldMetaData("regs", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, RegulationsThrift.class)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(BidRequestThrift.class, metaDataMap);
  }

  public BidRequestThrift() {
    this.id = "";

    this.at = (short)2;

    this.tmax = 0;

    this.allimps = (byte)0;

  }

  /**
   * Performs a deep copy on other.
   */
  public BidRequestThrift(BidRequestThrift other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetId()) {
      this.id = other.id;
    }
    if (other.isSetImp()) {
      List __this__imp = new ArrayList(other.imp.size());
      for (ImpressionThrift other_element : other.imp) {
        __this__imp.add(new ImpressionThrift(other_element));
      }
      this.imp = __this__imp;
    }
    if (other.isSetSite()) {
      this.site = new SiteThrift(other.site);
    }
    if (other.isSetApp()) {
      this.app = new AppThrift(other.app);
    }
    if (other.isSetDevice()) {
      this.device = new DeviceThrift(other.device);
    }
    if (other.isSetUser()) {
      this.user = new UserThrift(other.user);
    }
    this.at = other.at;
    this.tmax = other.tmax;
    if (other.isSetWseat()) {
      List __this__wseat = new ArrayList(other.wseat);
      this.wseat = __this__wseat;
    }
    this.allimps = other.allimps;
    if (other.isSetCur()) {
      List __this__cur = new ArrayList(other.cur);
      this.cur = __this__cur;
    }
    if (other.isSetBcat()) {
      List __this__bcat = new ArrayList(other.bcat);
      this.bcat = __this__bcat;
    }
    if (other.isSetBadv()) {
      List __this__badv = new ArrayList(other.badv);
      this.badv = __this__badv;
    }
    if (other.isSetRegs()) {
      this.regs = new RegulationsThrift(other.regs);
    }
  }

  public BidRequestThrift deepCopy() {
    return new BidRequestThrift(this);
  }

  @Override
  public void clear() {
    this.id = "";

    this.imp = null;
    this.site = null;
    this.app = null;
    this.device = null;
    this.user = null;
    this.at = (short)2;

    this.tmax = 0;

    this.wseat = null;
    this.allimps = (byte)0;

    this.cur = null;
    this.bcat = null;
    this.badv = null;
    this.regs = null;
  }

  /**
   * Unique ID of the bid request, provided by the exchange.
   */
  public String getId() {
    return this.id;
  }

  /**
   * Unique ID of the bid request, provided by the exchange.
   */
  public BidRequestThrift setId(String id) {
    this.id = id;
    return this;
  }

  public void unsetId() {
    this.id = null;
  }

  /** Returns true if field id is set (has been assigned a value) and false otherwise */
  public boolean isSetId() {
    return this.id != null;
  }

  public void setIdIsSet(boolean value) {
    if (!value) {
      this.id = null;
    }
  }

  public int getImpSize() {
    return (this.imp == null) ? 0 : this.imp.size();
  }

  public java.util.Iterator getImpIterator() {
    return (this.imp == null) ? null : this.imp.iterator();
  }

  public void addToImp(ImpressionThrift elem) {
    if (this.imp == null) {
      this.imp = new ArrayList();
    }
    this.imp.add(elem);
  }

  /**
   * Array of impression objects. Multiple impression auctions may be specified in a single bid request. At least one impression is required for a valid bid request.
   */
  public List getImp() {
    return this.imp;
  }

  /**
   * Array of impression objects. Multiple impression auctions may be specified in a single bid request. At least one impression is required for a valid bid request.
   */
  public BidRequestThrift setImp(List imp) {
    this.imp = imp;
    return this;
  }

  public void unsetImp() {
    this.imp = null;
  }

  /** Returns true if field imp is set (has been assigned a value) and false otherwise */
  public boolean isSetImp() {
    return this.imp != null;
  }

  public void setImpIsSet(boolean value) {
    if (!value) {
      this.imp = null;
    }
  }

  /**
   * See Site Object.
   */
  public SiteThrift getSite() {
    return this.site;
  }

  /**
   * See Site Object.
   */
  public BidRequestThrift setSite(SiteThrift site) {
    this.site = site;
    return this;
  }

  public void unsetSite() {
    this.site = null;
  }

  /** Returns true if field site is set (has been assigned a value) and false otherwise */
  public boolean isSetSite() {
    return this.site != null;
  }

  public void setSiteIsSet(boolean value) {
    if (!value) {
      this.site = null;
    }
  }

  /**
   * See App Object.
   */
  public AppThrift getApp() {
    return this.app;
  }

  /**
   * See App Object.
   */
  public BidRequestThrift setApp(AppThrift app) {
    this.app = app;
    return this;
  }

  public void unsetApp() {
    this.app = null;
  }

  /** Returns true if field app is set (has been assigned a value) and false otherwise */
  public boolean isSetApp() {
    return this.app != null;
  }

  public void setAppIsSet(boolean value) {
    if (!value) {
      this.app = null;
    }
  }

  /**
   * See Device Object.
   */
  public DeviceThrift getDevice() {
    return this.device;
  }

  /**
   * See Device Object.
   */
  public BidRequestThrift setDevice(DeviceThrift device) {
    this.device = device;
    return this;
  }

  public void unsetDevice() {
    this.device = null;
  }

  /** Returns true if field device is set (has been assigned a value) and false otherwise */
  public boolean isSetDevice() {
    return this.device != null;
  }

  public void setDeviceIsSet(boolean value) {
    if (!value) {
      this.device = null;
    }
  }

  /**
   * See User Object.
   */
  public UserThrift getUser() {
    return this.user;
  }

  /**
   * See User Object.
   */
  public BidRequestThrift setUser(UserThrift user) {
    this.user = user;
    return this;
  }

  public void unsetUser() {
    this.user = null;
  }

  /** Returns true if field user is set (has been assigned a value) and false otherwise */
  public boolean isSetUser() {
    return this.user != null;
  }

  public void setUserIsSet(boolean value) {
    if (!value) {
      this.user = null;
    }
  }

  /**
   * Auction Type. If “1”, then first price auction. If “2”, then second price auction. Additional auction types can be defined as per the exchange’s business rules. Exchange specific rules should be numbered over 500.
   */
  public short getAt() {
    return this.at;
  }

  /**
   * Auction Type. If “1”, then first price auction. If “2”, then second price auction. Additional auction types can be defined as per the exchange’s business rules. Exchange specific rules should be numbered over 500.
   */
  public BidRequestThrift setAt(short at) {
    this.at = at;
    setAtIsSet(true);
    return this;
  }

  public void unsetAt() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __AT_ISSET_ID);
  }

  /** Returns true if field at is set (has been assigned a value) and false otherwise */
  public boolean isSetAt() {
    return EncodingUtils.testBit(__isset_bitfield, __AT_ISSET_ID);
  }

  public void setAtIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __AT_ISSET_ID, value);
  }

  /**
   * Maximum amount of time in milliseconds to submit a bid (e.g., 120 means the bidder has 120ms to submit a bid before the auction is complete). If this value never changes across an exchange, then the exchange can supply this information offline.
   */
  public int getTmax() {
    return this.tmax;
  }

  /**
   * Maximum amount of time in milliseconds to submit a bid (e.g., 120 means the bidder has 120ms to submit a bid before the auction is complete). If this value never changes across an exchange, then the exchange can supply this information offline.
   */
  public BidRequestThrift setTmax(int tmax) {
    this.tmax = tmax;
    setTmaxIsSet(true);
    return this;
  }

  public void unsetTmax() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TMAX_ISSET_ID);
  }

  /** Returns true if field tmax is set (has been assigned a value) and false otherwise */
  public boolean isSetTmax() {
    return EncodingUtils.testBit(__isset_bitfield, __TMAX_ISSET_ID);
  }

  public void setTmaxIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TMAX_ISSET_ID, value);
  }

  public int getWseatSize() {
    return (this.wseat == null) ? 0 : this.wseat.size();
  }

  public java.util.Iterator getWseatIterator() {
    return (this.wseat == null) ? null : this.wseat.iterator();
  }

  public void addToWseat(String elem) {
    if (this.wseat == null) {
      this.wseat = new ArrayList();
    }
    this.wseat.add(elem);
  }

  /**
   * Array of buyer seats allowed to bid on this auction. Seats are an optional feature of exchange. For example, [“4”,”34”,”82”,”A45”] indicates that only advertisers using these exchange seats are allowed to bid on the impressions in this auction.
   */
  public List getWseat() {
    return this.wseat;
  }

  /**
   * Array of buyer seats allowed to bid on this auction. Seats are an optional feature of exchange. For example, [“4”,”34”,”82”,”A45”] indicates that only advertisers using these exchange seats are allowed to bid on the impressions in this auction.
   */
  public BidRequestThrift setWseat(List wseat) {
    this.wseat = wseat;
    return this;
  }

  public void unsetWseat() {
    this.wseat = null;
  }

  /** Returns true if field wseat is set (has been assigned a value) and false otherwise */
  public boolean isSetWseat() {
    return this.wseat != null;
  }

  public void setWseatIsSet(boolean value) {
    if (!value) {
      this.wseat = null;
    }
  }

  /**
   * Flag to indicate whether Exchange can verify that all impressions offered represent all of the impressions available in context (e.g., all impressions available on the web page; all impressions available for a video [pre, mid and postroll spots], etc.) to support road-blocking. A true value should only be passed if the exchange is aware of all impressions in context for the publisher. “0” means the exchange cannot verify, and “1” means that all impressions represent all impressions available.
   */
  public byte getAllimps() {
    return this.allimps;
  }

  /**
   * Flag to indicate whether Exchange can verify that all impressions offered represent all of the impressions available in context (e.g., all impressions available on the web page; all impressions available for a video [pre, mid and postroll spots], etc.) to support road-blocking. A true value should only be passed if the exchange is aware of all impressions in context for the publisher. “0” means the exchange cannot verify, and “1” means that all impressions represent all impressions available.
   */
  public BidRequestThrift setAllimps(byte allimps) {
    this.allimps = allimps;
    setAllimpsIsSet(true);
    return this;
  }

  public void unsetAllimps() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ALLIMPS_ISSET_ID);
  }

  /** Returns true if field allimps is set (has been assigned a value) and false otherwise */
  public boolean isSetAllimps() {
    return EncodingUtils.testBit(__isset_bitfield, __ALLIMPS_ISSET_ID);
  }

  public void setAllimpsIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ALLIMPS_ISSET_ID, value);
  }

  public int getCurSize() {
    return (this.cur == null) ? 0 : this.cur.size();
  }

  public java.util.Iterator getCurIterator() {
    return (this.cur == null) ? null : this.cur.iterator();
  }

  public void addToCur(String elem) {
    if (this.cur == null) {
      this.cur = new ArrayList();
    }
    this.cur.add(elem);
  }

  /**
   * Array of allowed currencies for bids on this bid request using ISO-4217 alphabetic codes. If only one currency is used by the exchange, this parameter is not required.
   */
  public List getCur() {
    return this.cur;
  }

  /**
   * Array of allowed currencies for bids on this bid request using ISO-4217 alphabetic codes. If only one currency is used by the exchange, this parameter is not required.
   */
  public BidRequestThrift setCur(List cur) {
    this.cur = cur;
    return this;
  }

  public void unsetCur() {
    this.cur = null;
  }

  /** Returns true if field cur is set (has been assigned a value) and false otherwise */
  public boolean isSetCur() {
    return this.cur != null;
  }

  public void setCurIsSet(boolean value) {
    if (!value) {
      this.cur = null;
    }
  }

  public int getBcatSize() {
    return (this.bcat == null) ? 0 : this.bcat.size();
  }

  public java.util.Iterator getBcatIterator() {
    return (this.bcat == null) ? null : this.bcat.iterator();
  }

  public void addToBcat(String elem) {
    if (this.bcat == null) {
      this.bcat = new ArrayList();
    }
    this.bcat.add(elem);
  }

  /**
   * Blocked Advertiser Categories. Note that there is no existing categorization / taxonomy of advertiser industries. However, as a substitute exchanges may decide to use IAB categories as an approximation (See Table 6.1 Content Categories)
   */
  public List getBcat() {
    return this.bcat;
  }

  /**
   * Blocked Advertiser Categories. Note that there is no existing categorization / taxonomy of advertiser industries. However, as a substitute exchanges may decide to use IAB categories as an approximation (See Table 6.1 Content Categories)
   */
  public BidRequestThrift setBcat(List bcat) {
    this.bcat = bcat;
    return this;
  }

  public void unsetBcat() {
    this.bcat = null;
  }

  /** Returns true if field bcat is set (has been assigned a value) and false otherwise */
  public boolean isSetBcat() {
    return this.bcat != null;
  }

  public void setBcatIsSet(boolean value) {
    if (!value) {
      this.bcat = null;
    }
  }

  public int getBadvSize() {
    return (this.badv == null) ? 0 : this.badv.size();
  }

  public java.util.Iterator getBadvIterator() {
    return (this.badv == null) ? null : this.badv.iterator();
  }

  public void addToBadv(String elem) {
    if (this.badv == null) {
      this.badv = new ArrayList();
    }
    this.badv.add(elem);
  }

  /**
   * Array of strings of blocked top-level domains of advertisers. For example, {“company1.com”, “company2.com”}.
   */
  public List getBadv() {
    return this.badv;
  }

  /**
   * Array of strings of blocked top-level domains of advertisers. For example, {“company1.com”, “company2.com”}.
   */
  public BidRequestThrift setBadv(List badv) {
    this.badv = badv;
    return this;
  }

  public void unsetBadv() {
    this.badv = null;
  }

  /** Returns true if field badv is set (has been assigned a value) and false otherwise */
  public boolean isSetBadv() {
    return this.badv != null;
  }

  public void setBadvIsSet(boolean value) {
    if (!value) {
      this.badv = null;
    }
  }

  /**
   * This object is a container for any legal, governmental or industry regulations in force for the request.
   */
  public RegulationsThrift getRegs() {
    return this.regs;
  }

  /**
   * This object is a container for any legal, governmental or industry regulations in force for the request.
   */
  public BidRequestThrift setRegs(RegulationsThrift regs) {
    this.regs = regs;
    return this;
  }

  public void unsetRegs() {
    this.regs = null;
  }

  /** Returns true if field regs is set (has been assigned a value) and false otherwise */
  public boolean isSetRegs() {
    return this.regs != null;
  }

  public void setRegsIsSet(boolean value) {
    if (!value) {
      this.regs = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case ID:
      if (value == null) {
        unsetId();
      } else {
        setId((String)value);
      }
      break;

    case IMP:
      if (value == null) {
        unsetImp();
      } else {
        setImp((List)value);
      }
      break;

    case SITE:
      if (value == null) {
        unsetSite();
      } else {
        setSite((SiteThrift)value);
      }
      break;

    case APP:
      if (value == null) {
        unsetApp();
      } else {
        setApp((AppThrift)value);
      }
      break;

    case DEVICE:
      if (value == null) {
        unsetDevice();
      } else {
        setDevice((DeviceThrift)value);
      }
      break;

    case USER:
      if (value == null) {
        unsetUser();
      } else {
        setUser((UserThrift)value);
      }
      break;

    case AT:
      if (value == null) {
        unsetAt();
      } else {
        setAt((Short)value);
      }
      break;

    case TMAX:
      if (value == null) {
        unsetTmax();
      } else {
        setTmax((Integer)value);
      }
      break;

    case WSEAT:
      if (value == null) {
        unsetWseat();
      } else {
        setWseat((List)value);
      }
      break;

    case ALLIMPS:
      if (value == null) {
        unsetAllimps();
      } else {
        setAllimps((Byte)value);
      }
      break;

    case CUR:
      if (value == null) {
        unsetCur();
      } else {
        setCur((List)value);
      }
      break;

    case BCAT:
      if (value == null) {
        unsetBcat();
      } else {
        setBcat((List)value);
      }
      break;

    case BADV:
      if (value == null) {
        unsetBadv();
      } else {
        setBadv((List)value);
      }
      break;

    case REGS:
      if (value == null) {
        unsetRegs();
      } else {
        setRegs((RegulationsThrift)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case ID:
      return getId();

    case IMP:
      return getImp();

    case SITE:
      return getSite();

    case APP:
      return getApp();

    case DEVICE:
      return getDevice();

    case USER:
      return getUser();

    case AT:
      return Short.valueOf(getAt());

    case TMAX:
      return Integer.valueOf(getTmax());

    case WSEAT:
      return getWseat();

    case ALLIMPS:
      return Byte.valueOf(getAllimps());

    case CUR:
      return getCur();

    case BCAT:
      return getBcat();

    case BADV:
      return getBadv();

    case REGS:
      return getRegs();

    }
    throw new IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new IllegalArgumentException();
    }

    switch (field) {
    case ID:
      return isSetId();
    case IMP:
      return isSetImp();
    case SITE:
      return isSetSite();
    case APP:
      return isSetApp();
    case DEVICE:
      return isSetDevice();
    case USER:
      return isSetUser();
    case AT:
      return isSetAt();
    case TMAX:
      return isSetTmax();
    case WSEAT:
      return isSetWseat();
    case ALLIMPS:
      return isSetAllimps();
    case CUR:
      return isSetCur();
    case BCAT:
      return isSetBcat();
    case BADV:
      return isSetBadv();
    case REGS:
      return isSetRegs();
    }
    throw new IllegalStateException();
  }

  @Override
  public boolean equals(Object that) {
    if (that == null)
      return false;
    if (that instanceof BidRequestThrift)
      return this.equals((BidRequestThrift)that);
    return false;
  }

  public boolean equals(BidRequestThrift that) {
    if (that == null)
      return false;

    boolean this_present_id = true && this.isSetId();
    boolean that_present_id = true && that.isSetId();
    if (this_present_id || that_present_id) {
      if (!(this_present_id && that_present_id))
        return false;
      if (!this.id.equals(that.id))
        return false;
    }

    boolean this_present_imp = true && this.isSetImp();
    boolean that_present_imp = true && that.isSetImp();
    if (this_present_imp || that_present_imp) {
      if (!(this_present_imp && that_present_imp))
        return false;
      if (!this.imp.equals(that.imp))
        return false;
    }

    boolean this_present_site = true && this.isSetSite();
    boolean that_present_site = true && that.isSetSite();
    if (this_present_site || that_present_site) {
      if (!(this_present_site && that_present_site))
        return false;
      if (!this.site.equals(that.site))
        return false;
    }

    boolean this_present_app = true && this.isSetApp();
    boolean that_present_app = true && that.isSetApp();
    if (this_present_app || that_present_app) {
      if (!(this_present_app && that_present_app))
        return false;
      if (!this.app.equals(that.app))
        return false;
    }

    boolean this_present_device = true && this.isSetDevice();
    boolean that_present_device = true && that.isSetDevice();
    if (this_present_device || that_present_device) {
      if (!(this_present_device && that_present_device))
        return false;
      if (!this.device.equals(that.device))
        return false;
    }

    boolean this_present_user = true && this.isSetUser();
    boolean that_present_user = true && that.isSetUser();
    if (this_present_user || that_present_user) {
      if (!(this_present_user && that_present_user))
        return false;
      if (!this.user.equals(that.user))
        return false;
    }

    boolean this_present_at = true && this.isSetAt();
    boolean that_present_at = true && that.isSetAt();
    if (this_present_at || that_present_at) {
      if (!(this_present_at && that_present_at))
        return false;
      if (this.at != that.at)
        return false;
    }

    boolean this_present_tmax = true && this.isSetTmax();
    boolean that_present_tmax = true && that.isSetTmax();
    if (this_present_tmax || that_present_tmax) {
      if (!(this_present_tmax && that_present_tmax))
        return false;
      if (this.tmax != that.tmax)
        return false;
    }

    boolean this_present_wseat = true && this.isSetWseat();
    boolean that_present_wseat = true && that.isSetWseat();
    if (this_present_wseat || that_present_wseat) {
      if (!(this_present_wseat && that_present_wseat))
        return false;
      if (!this.wseat.equals(that.wseat))
        return false;
    }

    boolean this_present_allimps = true && this.isSetAllimps();
    boolean that_present_allimps = true && that.isSetAllimps();
    if (this_present_allimps || that_present_allimps) {
      if (!(this_present_allimps && that_present_allimps))
        return false;
      if (this.allimps != that.allimps)
        return false;
    }

    boolean this_present_cur = true && this.isSetCur();
    boolean that_present_cur = true && that.isSetCur();
    if (this_present_cur || that_present_cur) {
      if (!(this_present_cur && that_present_cur))
        return false;
      if (!this.cur.equals(that.cur))
        return false;
    }

    boolean this_present_bcat = true && this.isSetBcat();
    boolean that_present_bcat = true && that.isSetBcat();
    if (this_present_bcat || that_present_bcat) {
      if (!(this_present_bcat && that_present_bcat))
        return false;
      if (!this.bcat.equals(that.bcat))
        return false;
    }

    boolean this_present_badv = true && this.isSetBadv();
    boolean that_present_badv = true && that.isSetBadv();
    if (this_present_badv || that_present_badv) {
      if (!(this_present_badv && that_present_badv))
        return false;
      if (!this.badv.equals(that.badv))
        return false;
    }

    boolean this_present_regs = true && this.isSetRegs();
    boolean that_present_regs = true && that.isSetRegs();
    if (this_present_regs || that_present_regs) {
      if (!(this_present_regs && that_present_regs))
        return false;
      if (!this.regs.equals(that.regs))
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    List list = new ArrayList();

    boolean present_id = true && (isSetId());
    list.add(present_id);
    if (present_id)
      list.add(id);

    boolean present_imp = true && (isSetImp());
    list.add(present_imp);
    if (present_imp)
      list.add(imp);

    boolean present_site = true && (isSetSite());
    list.add(present_site);
    if (present_site)
      list.add(site);

    boolean present_app = true && (isSetApp());
    list.add(present_app);
    if (present_app)
      list.add(app);

    boolean present_device = true && (isSetDevice());
    list.add(present_device);
    if (present_device)
      list.add(device);

    boolean present_user = true && (isSetUser());
    list.add(present_user);
    if (present_user)
      list.add(user);

    boolean present_at = true && (isSetAt());
    list.add(present_at);
    if (present_at)
      list.add(at);

    boolean present_tmax = true && (isSetTmax());
    list.add(present_tmax);
    if (present_tmax)
      list.add(tmax);

    boolean present_wseat = true && (isSetWseat());
    list.add(present_wseat);
    if (present_wseat)
      list.add(wseat);

    boolean present_allimps = true && (isSetAllimps());
    list.add(present_allimps);
    if (present_allimps)
      list.add(allimps);

    boolean present_cur = true && (isSetCur());
    list.add(present_cur);
    if (present_cur)
      list.add(cur);

    boolean present_bcat = true && (isSetBcat());
    list.add(present_bcat);
    if (present_bcat)
      list.add(bcat);

    boolean present_badv = true && (isSetBadv());
    list.add(present_badv);
    if (present_badv)
      list.add(badv);

    boolean present_regs = true && (isSetRegs());
    list.add(present_regs);
    if (present_regs)
      list.add(regs);

    return list.hashCode();
  }

  @Override
  public int compareTo(BidRequestThrift other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetImp()).compareTo(other.isSetImp());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetImp()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imp, other.imp);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSite()).compareTo(other.isSetSite());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSite()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.site, other.site);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetApp()).compareTo(other.isSetApp());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetApp()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.app, other.app);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDevice()).compareTo(other.isSetDevice());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDevice()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.device, other.device);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetUser()).compareTo(other.isSetUser());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUser()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.user, other.user);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAt()).compareTo(other.isSetAt());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAt()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.at, other.at);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTmax()).compareTo(other.isSetTmax());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTmax()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tmax, other.tmax);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetWseat()).compareTo(other.isSetWseat());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetWseat()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.wseat, other.wseat);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAllimps()).compareTo(other.isSetAllimps());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAllimps()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.allimps, other.allimps);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCur()).compareTo(other.isSetCur());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCur()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cur, other.cur);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetBcat()).compareTo(other.isSetBcat());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBcat()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bcat, other.bcat);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetBadv()).compareTo(other.isSetBadv());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBadv()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.badv, other.badv);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRegs()).compareTo(other.isSetRegs());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRegs()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.regs, other.regs);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder("BidRequestThrift(");
    boolean first = true;

    if (isSetId()) {
      sb.append("id:");
      if (this.id == null) {
        sb.append("null");
      } else {
        sb.append(this.id);
      }
      first = false;
    }
    if (isSetImp()) {
      if (!first) sb.append(", ");
      sb.append("imp:");
      if (this.imp == null) {
        sb.append("null");
      } else {
        sb.append(this.imp);
      }
      first = false;
    }
    if (isSetSite()) {
      if (!first) sb.append(", ");
      sb.append("site:");
      if (this.site == null) {
        sb.append("null");
      } else {
        sb.append(this.site);
      }
      first = false;
    }
    if (isSetApp()) {
      if (!first) sb.append(", ");
      sb.append("app:");
      if (this.app == null) {
        sb.append("null");
      } else {
        sb.append(this.app);
      }
      first = false;
    }
    if (isSetDevice()) {
      if (!first) sb.append(", ");
      sb.append("device:");
      if (this.device == null) {
        sb.append("null");
      } else {
        sb.append(this.device);
      }
      first = false;
    }
    if (isSetUser()) {
      if (!first) sb.append(", ");
      sb.append("user:");
      if (this.user == null) {
        sb.append("null");
      } else {
        sb.append(this.user);
      }
      first = false;
    }
    if (isSetAt()) {
      if (!first) sb.append(", ");
      sb.append("at:");
      sb.append(this.at);
      first = false;
    }
    if (isSetTmax()) {
      if (!first) sb.append(", ");
      sb.append("tmax:");
      sb.append(this.tmax);
      first = false;
    }
    if (isSetWseat()) {
      if (!first) sb.append(", ");
      sb.append("wseat:");
      if (this.wseat == null) {
        sb.append("null");
      } else {
        sb.append(this.wseat);
      }
      first = false;
    }
    if (isSetAllimps()) {
      if (!first) sb.append(", ");
      sb.append("allimps:");
      sb.append(this.allimps);
      first = false;
    }
    if (isSetCur()) {
      if (!first) sb.append(", ");
      sb.append("cur:");
      if (this.cur == null) {
        sb.append("null");
      } else {
        sb.append(this.cur);
      }
      first = false;
    }
    if (isSetBcat()) {
      if (!first) sb.append(", ");
      sb.append("bcat:");
      if (this.bcat == null) {
        sb.append("null");
      } else {
        sb.append(this.bcat);
      }
      first = false;
    }
    if (isSetBadv()) {
      if (!first) sb.append(", ");
      sb.append("badv:");
      if (this.badv == null) {
        sb.append("null");
      } else {
        sb.append(this.badv);
      }
      first = false;
    }
    if (isSetRegs()) {
      if (!first) sb.append(", ");
      sb.append("regs:");
      if (this.regs == null) {
        sb.append("null");
      } else {
        sb.append(this.regs);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // check for sub-struct validity
    if (site != null) {
      site.validate();
    }
    if (app != null) {
      app.validate();
    }
    if (device != null) {
      device.validate();
    }
    if (user != null) {
      user.validate();
    }
    if (regs != null) {
      regs.validate();
    }
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
    try {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
      __isset_bitfield = 0;
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class BidRequestThriftStandardSchemeFactory implements SchemeFactory {
    public BidRequestThriftStandardScheme getScheme() {
      return new BidRequestThriftStandardScheme();
    }
  }

  private static class BidRequestThriftStandardScheme extends StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, BidRequestThrift struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true)
      {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
          break;
        }
        switch (schemeField.id) {
          case 1: // ID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.id = iprot.readString();
              struct.setIdIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // IMP
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list224 = iprot.readListBegin();
                struct.imp = new ArrayList(_list224.size);
                ImpressionThrift _elem225;
                for (int _i226 = 0; _i226 < _list224.size; ++_i226)
                {
                  _elem225 = new ImpressionThrift();
                  _elem225.read(iprot);
                  struct.imp.add(_elem225);
                }
                iprot.readListEnd();
              }
              struct.setImpIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // SITE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.site = new SiteThrift();
              struct.site.read(iprot);
              struct.setSiteIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // APP
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.app = new AppThrift();
              struct.app.read(iprot);
              struct.setAppIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // DEVICE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.device = new DeviceThrift();
              struct.device.read(iprot);
              struct.setDeviceIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // USER
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.user = new UserThrift();
              struct.user.read(iprot);
              struct.setUserIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // AT
            if (schemeField.type == org.apache.thrift.protocol.TType.I16) {
              struct.at = iprot.readI16();
              struct.setAtIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // TMAX
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.tmax = iprot.readI32();
              struct.setTmaxIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // WSEAT
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list227 = iprot.readListBegin();
                struct.wseat = new ArrayList(_list227.size);
                String _elem228;
                for (int _i229 = 0; _i229 < _list227.size; ++_i229)
                {
                  _elem228 = iprot.readString();
                  struct.wseat.add(_elem228);
                }
                iprot.readListEnd();
              }
              struct.setWseatIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 10: // ALLIMPS
            if (schemeField.type == org.apache.thrift.protocol.TType.BYTE) {
              struct.allimps = iprot.readByte();
              struct.setAllimpsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 11: // CUR
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list230 = iprot.readListBegin();
                struct.cur = new ArrayList(_list230.size);
                String _elem231;
                for (int _i232 = 0; _i232 < _list230.size; ++_i232)
                {
                  _elem231 = iprot.readString();
                  struct.cur.add(_elem231);
                }
                iprot.readListEnd();
              }
              struct.setCurIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 12: // BCAT
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list233 = iprot.readListBegin();
                struct.bcat = new ArrayList(_list233.size);
                String _elem234;
                for (int _i235 = 0; _i235 < _list233.size; ++_i235)
                {
                  _elem234 = iprot.readString();
                  struct.bcat.add(_elem234);
                }
                iprot.readListEnd();
              }
              struct.setBcatIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 13: // BADV
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list236 = iprot.readListBegin();
                struct.badv = new ArrayList(_list236.size);
                String _elem237;
                for (int _i238 = 0; _i238 < _list236.size; ++_i238)
                {
                  _elem237 = iprot.readString();
                  struct.badv.add(_elem237);
                }
                iprot.readListEnd();
              }
              struct.setBadvIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 14: // REGS
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.regs = new RegulationsThrift();
              struct.regs.read(iprot);
              struct.setRegsIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, BidRequestThrift struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.id != null) {
        if (struct.isSetId()) {
          oprot.writeFieldBegin(ID_FIELD_DESC);
          oprot.writeString(struct.id);
          oprot.writeFieldEnd();
        }
      }
      if (struct.imp != null) {
        if (struct.isSetImp()) {
          oprot.writeFieldBegin(IMP_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.imp.size()));
            for (ImpressionThrift _iter239 : struct.imp)
            {
              _iter239.write(oprot);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.site != null) {
        if (struct.isSetSite()) {
          oprot.writeFieldBegin(SITE_FIELD_DESC);
          struct.site.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.app != null) {
        if (struct.isSetApp()) {
          oprot.writeFieldBegin(APP_FIELD_DESC);
          struct.app.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.device != null) {
        if (struct.isSetDevice()) {
          oprot.writeFieldBegin(DEVICE_FIELD_DESC);
          struct.device.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.user != null) {
        if (struct.isSetUser()) {
          oprot.writeFieldBegin(USER_FIELD_DESC);
          struct.user.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetAt()) {
        oprot.writeFieldBegin(AT_FIELD_DESC);
        oprot.writeI16(struct.at);
        oprot.writeFieldEnd();
      }
      if (struct.isSetTmax()) {
        oprot.writeFieldBegin(TMAX_FIELD_DESC);
        oprot.writeI32(struct.tmax);
        oprot.writeFieldEnd();
      }
      if (struct.wseat != null) {
        if (struct.isSetWseat()) {
          oprot.writeFieldBegin(WSEAT_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.wseat.size()));
            for (String _iter240 : struct.wseat)
            {
              oprot.writeString(_iter240);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetAllimps()) {
        oprot.writeFieldBegin(ALLIMPS_FIELD_DESC);
        oprot.writeByte(struct.allimps);
        oprot.writeFieldEnd();
      }
      if (struct.cur != null) {
        if (struct.isSetCur()) {
          oprot.writeFieldBegin(CUR_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.cur.size()));
            for (String _iter241 : struct.cur)
            {
              oprot.writeString(_iter241);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.bcat != null) {
        if (struct.isSetBcat()) {
          oprot.writeFieldBegin(BCAT_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.bcat.size()));
            for (String _iter242 : struct.bcat)
            {
              oprot.writeString(_iter242);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.badv != null) {
        if (struct.isSetBadv()) {
          oprot.writeFieldBegin(BADV_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.badv.size()));
            for (String _iter243 : struct.badv)
            {
              oprot.writeString(_iter243);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.regs != null) {
        if (struct.isSetRegs()) {
          oprot.writeFieldBegin(REGS_FIELD_DESC);
          struct.regs.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class BidRequestThriftTupleSchemeFactory implements SchemeFactory {
    public BidRequestThriftTupleScheme getScheme() {
      return new BidRequestThriftTupleScheme();
    }
  }

  private static class BidRequestThriftTupleScheme extends TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, BidRequestThrift struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetId()) {
        optionals.set(0);
      }
      if (struct.isSetImp()) {
        optionals.set(1);
      }
      if (struct.isSetSite()) {
        optionals.set(2);
      }
      if (struct.isSetApp()) {
        optionals.set(3);
      }
      if (struct.isSetDevice()) {
        optionals.set(4);
      }
      if (struct.isSetUser()) {
        optionals.set(5);
      }
      if (struct.isSetAt()) {
        optionals.set(6);
      }
      if (struct.isSetTmax()) {
        optionals.set(7);
      }
      if (struct.isSetWseat()) {
        optionals.set(8);
      }
      if (struct.isSetAllimps()) {
        optionals.set(9);
      }
      if (struct.isSetCur()) {
        optionals.set(10);
      }
      if (struct.isSetBcat()) {
        optionals.set(11);
      }
      if (struct.isSetBadv()) {
        optionals.set(12);
      }
      if (struct.isSetRegs()) {
        optionals.set(13);
      }
      oprot.writeBitSet(optionals, 14);
      if (struct.isSetId()) {
        oprot.writeString(struct.id);
      }
      if (struct.isSetImp()) {
        {
          oprot.writeI32(struct.imp.size());
          for (ImpressionThrift _iter244 : struct.imp)
          {
            _iter244.write(oprot);
          }
        }
      }
      if (struct.isSetSite()) {
        struct.site.write(oprot);
      }
      if (struct.isSetApp()) {
        struct.app.write(oprot);
      }
      if (struct.isSetDevice()) {
        struct.device.write(oprot);
      }
      if (struct.isSetUser()) {
        struct.user.write(oprot);
      }
      if (struct.isSetAt()) {
        oprot.writeI16(struct.at);
      }
      if (struct.isSetTmax()) {
        oprot.writeI32(struct.tmax);
      }
      if (struct.isSetWseat()) {
        {
          oprot.writeI32(struct.wseat.size());
          for (String _iter245 : struct.wseat)
          {
            oprot.writeString(_iter245);
          }
        }
      }
      if (struct.isSetAllimps()) {
        oprot.writeByte(struct.allimps);
      }
      if (struct.isSetCur()) {
        {
          oprot.writeI32(struct.cur.size());
          for (String _iter246 : struct.cur)
          {
            oprot.writeString(_iter246);
          }
        }
      }
      if (struct.isSetBcat()) {
        {
          oprot.writeI32(struct.bcat.size());
          for (String _iter247 : struct.bcat)
          {
            oprot.writeString(_iter247);
          }
        }
      }
      if (struct.isSetBadv()) {
        {
          oprot.writeI32(struct.badv.size());
          for (String _iter248 : struct.badv)
          {
            oprot.writeString(_iter248);
          }
        }
      }
      if (struct.isSetRegs()) {
        struct.regs.write(oprot);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, BidRequestThrift struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(14);
      if (incoming.get(0)) {
        struct.id = iprot.readString();
        struct.setIdIsSet(true);
      }
      if (incoming.get(1)) {
        {
          org.apache.thrift.protocol.TList _list249 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
          struct.imp = new ArrayList(_list249.size);
          ImpressionThrift _elem250;
          for (int _i251 = 0; _i251 < _list249.size; ++_i251)
          {
            _elem250 = new ImpressionThrift();
            _elem250.read(iprot);
            struct.imp.add(_elem250);
          }
        }
        struct.setImpIsSet(true);
      }
      if (incoming.get(2)) {
        struct.site = new SiteThrift();
        struct.site.read(iprot);
        struct.setSiteIsSet(true);
      }
      if (incoming.get(3)) {
        struct.app = new AppThrift();
        struct.app.read(iprot);
        struct.setAppIsSet(true);
      }
      if (incoming.get(4)) {
        struct.device = new DeviceThrift();
        struct.device.read(iprot);
        struct.setDeviceIsSet(true);
      }
      if (incoming.get(5)) {
        struct.user = new UserThrift();
        struct.user.read(iprot);
        struct.setUserIsSet(true);
      }
      if (incoming.get(6)) {
        struct.at = iprot.readI16();
        struct.setAtIsSet(true);
      }
      if (incoming.get(7)) {
        struct.tmax = iprot.readI32();
        struct.setTmaxIsSet(true);
      }
      if (incoming.get(8)) {
        {
          org.apache.thrift.protocol.TList _list252 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.wseat = new ArrayList(_list252.size);
          String _elem253;
          for (int _i254 = 0; _i254 < _list252.size; ++_i254)
          {
            _elem253 = iprot.readString();
            struct.wseat.add(_elem253);
          }
        }
        struct.setWseatIsSet(true);
      }
      if (incoming.get(9)) {
        struct.allimps = iprot.readByte();
        struct.setAllimpsIsSet(true);
      }
      if (incoming.get(10)) {
        {
          org.apache.thrift.protocol.TList _list255 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.cur = new ArrayList(_list255.size);
          String _elem256;
          for (int _i257 = 0; _i257 < _list255.size; ++_i257)
          {
            _elem256 = iprot.readString();
            struct.cur.add(_elem256);
          }
        }
        struct.setCurIsSet(true);
      }
      if (incoming.get(11)) {
        {
          org.apache.thrift.protocol.TList _list258 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.bcat = new ArrayList(_list258.size);
          String _elem259;
          for (int _i260 = 0; _i260 < _list258.size; ++_i260)
          {
            _elem259 = iprot.readString();
            struct.bcat.add(_elem259);
          }
        }
        struct.setBcatIsSet(true);
      }
      if (incoming.get(12)) {
        {
          org.apache.thrift.protocol.TList _list261 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.badv = new ArrayList(_list261.size);
          String _elem262;
          for (int _i263 = 0; _i263 < _list261.size; ++_i263)
          {
            _elem262 = iprot.readString();
            struct.badv.add(_elem262);
          }
        }
        struct.setBadvIsSet(true);
      }
      if (incoming.get(13)) {
        struct.regs = new RegulationsThrift();
        struct.regs.read(iprot);
        struct.setRegsIsSet(true);
      }
    }
  }

}