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

open_rtb.ImpressionThrift 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.2 Impression Object
 * The “imp” object describes the ad position or impression being auctioned. A single bid request can include multiple “imp” objects, a use case for which might be an exchange that supports selling all ad positions on a given page as a bundle. Each “imp” object has a required ID so that bids can reference them individually. An exchange can also conduct private auctions by restricting involvement to specific subsets of seats within bidders.
 */
@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2016-6-3")
public class ImpressionThrift 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("ImpressionThrift");

  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 BANNER_FIELD_DESC = new org.apache.thrift.protocol.TField("banner", org.apache.thrift.protocol.TType.STRUCT, (short)2);
  private static final org.apache.thrift.protocol.TField VIDEO_FIELD_DESC = new org.apache.thrift.protocol.TField("video", org.apache.thrift.protocol.TType.STRUCT, (short)3);
  private static final org.apache.thrift.protocol.TField DISPLAYMANAGER_FIELD_DESC = new org.apache.thrift.protocol.TField("displaymanager", org.apache.thrift.protocol.TType.STRING, (short)4);
  private static final org.apache.thrift.protocol.TField DISPLAYMANAGERVER_FIELD_DESC = new org.apache.thrift.protocol.TField("displaymanagerver", org.apache.thrift.protocol.TType.STRING, (short)5);
  private static final org.apache.thrift.protocol.TField INSTL_FIELD_DESC = new org.apache.thrift.protocol.TField("instl", org.apache.thrift.protocol.TType.BYTE, (short)6);
  private static final org.apache.thrift.protocol.TField TAGID_FIELD_DESC = new org.apache.thrift.protocol.TField("tagid", org.apache.thrift.protocol.TType.STRING, (short)7);
  private static final org.apache.thrift.protocol.TField BIDFLOOR_FIELD_DESC = new org.apache.thrift.protocol.TField("bidfloor", org.apache.thrift.protocol.TType.DOUBLE, (short)8);
  private static final org.apache.thrift.protocol.TField BIDFLOORCUR_FIELD_DESC = new org.apache.thrift.protocol.TField("bidfloorcur", org.apache.thrift.protocol.TType.STRING, (short)9);
  private static final org.apache.thrift.protocol.TField SECURE_FIELD_DESC = new org.apache.thrift.protocol.TField("secure", org.apache.thrift.protocol.TType.BYTE, (short)10);
  private static final org.apache.thrift.protocol.TField IFRAMEBUSTER_FIELD_DESC = new org.apache.thrift.protocol.TField("iframebuster", org.apache.thrift.protocol.TType.LIST, (short)11);
  private static final org.apache.thrift.protocol.TField PMP_FIELD_DESC = new org.apache.thrift.protocol.TField("pmp", org.apache.thrift.protocol.TType.STRUCT, (short)12);

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

  /**
   * A unique identifier for this impression within the context of the bid request (typically, value starts with 1, and increments up to n for n impressions).
   */
  public String id; // optional
  /**
   * A reference to a banner object. Either a banner or video object (or both if the impression could be either) must be included in an impression object. See Banner Object.
   */
  public BannerThrift banner; // optional
  /**
   * A reference to a video object. Either a banner or video object (or both if the impression could be either) must be included in an impression object. See Video Object.
   */
  public VideoThrift video; // optional
  /**
   * Name of ad mediation partner, SDK technology, or native player responsible for rendering ad (typically video or mobile). Used by some ad servers to customize ad code by partner.
   */
  public String displaymanager; // optional
  /**
   * Version of ad mediation partner, SDK technology, or native player responsible for rendering ad (typically video or mobile). Used by some ad servers to customize ad code by partner.
   */
  public String displaymanagerver; // optional
  /**
   * 1 if the ad is interstitial or full screen; else 0 (i.e., no).
   */
  public byte instl; // optional
  /**
   * Identifier for specific ad placement or ad tag that was used to initiate the auction. This can be useful for debugging of any issues, or for optimization by the buyer.
   */
  public String tagid; // optional
  /**
   * Bid floor for this impression (in CPM of bidfloorcur).
   */
  public double bidfloor; // optional
  /**
   * If bid floor is specified and multiple currencies supported per bid request, then currency should be specified here using ISO-4217 alphabetic codes. Note, this may be different from bid currency returned by bidder, if this is allowed on an exchange.
   */
  public String bidfloorcur; // optional
  /**
   * Flag to indicate whether the impression requires secure HTTPS URL creative assets and markup. A value of “1” means that the impression requires secure assets. A value of "0" means non-secure assets. If this field is omitted the bidder should interpret the secure state is unknown and assume HTTP is supported.
   */
  public byte secure; // optional
  /**
   * Array of names for supported iframe busters. Exchange specific.
   */
  public List iframebuster; // optional
  /**
   * A reference to the PMP object containing any Deals eligible for the impression object. See the PMP Object definition.
   */
  public PmpThrift pmp; // 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 {
    /**
     * A unique identifier for this impression within the context of the bid request (typically, value starts with 1, and increments up to n for n impressions).
     */
    ID((short)1, "id"),
    /**
     * A reference to a banner object. Either a banner or video object (or both if the impression could be either) must be included in an impression object. See Banner Object.
     */
    BANNER((short)2, "banner"),
    /**
     * A reference to a video object. Either a banner or video object (or both if the impression could be either) must be included in an impression object. See Video Object.
     */
    VIDEO((short)3, "video"),
    /**
     * Name of ad mediation partner, SDK technology, or native player responsible for rendering ad (typically video or mobile). Used by some ad servers to customize ad code by partner.
     */
    DISPLAYMANAGER((short)4, "displaymanager"),
    /**
     * Version of ad mediation partner, SDK technology, or native player responsible for rendering ad (typically video or mobile). Used by some ad servers to customize ad code by partner.
     */
    DISPLAYMANAGERVER((short)5, "displaymanagerver"),
    /**
     * 1 if the ad is interstitial or full screen; else 0 (i.e., no).
     */
    INSTL((short)6, "instl"),
    /**
     * Identifier for specific ad placement or ad tag that was used to initiate the auction. This can be useful for debugging of any issues, or for optimization by the buyer.
     */
    TAGID((short)7, "tagid"),
    /**
     * Bid floor for this impression (in CPM of bidfloorcur).
     */
    BIDFLOOR((short)8, "bidfloor"),
    /**
     * If bid floor is specified and multiple currencies supported per bid request, then currency should be specified here using ISO-4217 alphabetic codes. Note, this may be different from bid currency returned by bidder, if this is allowed on an exchange.
     */
    BIDFLOORCUR((short)9, "bidfloorcur"),
    /**
     * Flag to indicate whether the impression requires secure HTTPS URL creative assets and markup. A value of “1” means that the impression requires secure assets. A value of "0" means non-secure assets. If this field is omitted the bidder should interpret the secure state is unknown and assume HTTP is supported.
     */
    SECURE((short)10, "secure"),
    /**
     * Array of names for supported iframe busters. Exchange specific.
     */
    IFRAMEBUSTER((short)11, "iframebuster"),
    /**
     * A reference to the PMP object containing any Deals eligible for the impression object. See the PMP Object definition.
     */
    PMP((short)12, "pmp");

    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: // BANNER
          return BANNER;
        case 3: // VIDEO
          return VIDEO;
        case 4: // DISPLAYMANAGER
          return DISPLAYMANAGER;
        case 5: // DISPLAYMANAGERVER
          return DISPLAYMANAGERVER;
        case 6: // INSTL
          return INSTL;
        case 7: // TAGID
          return TAGID;
        case 8: // BIDFLOOR
          return BIDFLOOR;
        case 9: // BIDFLOORCUR
          return BIDFLOORCUR;
        case 10: // SECURE
          return SECURE;
        case 11: // IFRAMEBUSTER
          return IFRAMEBUSTER;
        case 12: // PMP
          return PMP;
        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 __INSTL_ISSET_ID = 0;
  private static final int __BIDFLOOR_ISSET_ID = 1;
  private static final int __SECURE_ISSET_ID = 2;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.ID,_Fields.BANNER,_Fields.VIDEO,_Fields.DISPLAYMANAGER,_Fields.DISPLAYMANAGERVER,_Fields.INSTL,_Fields.TAGID,_Fields.BIDFLOOR,_Fields.BIDFLOORCUR,_Fields.SECURE,_Fields.IFRAMEBUSTER,_Fields.PMP};
  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.BANNER, new org.apache.thrift.meta_data.FieldMetaData("banner", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, BannerThrift.class)));
    tmpMap.put(_Fields.VIDEO, new org.apache.thrift.meta_data.FieldMetaData("video", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, VideoThrift.class)));
    tmpMap.put(_Fields.DISPLAYMANAGER, new org.apache.thrift.meta_data.FieldMetaData("displaymanager", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.DISPLAYMANAGERVER, new org.apache.thrift.meta_data.FieldMetaData("displaymanagerver", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.INSTL, new org.apache.thrift.meta_data.FieldMetaData("instl", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE)));
    tmpMap.put(_Fields.TAGID, new org.apache.thrift.meta_data.FieldMetaData("tagid", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.BIDFLOOR, new org.apache.thrift.meta_data.FieldMetaData("bidfloor", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.BIDFLOORCUR, new org.apache.thrift.meta_data.FieldMetaData("bidfloorcur", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.SECURE, new org.apache.thrift.meta_data.FieldMetaData("secure", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE)));
    tmpMap.put(_Fields.IFRAMEBUSTER, new org.apache.thrift.meta_data.FieldMetaData("iframebuster", 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.PMP, new org.apache.thrift.meta_data.FieldMetaData("pmp", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, PmpThrift.class)));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ImpressionThrift.class, metaDataMap);
  }

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

    this.displaymanager = "";

    this.displaymanagerver = "";

    this.instl = (byte)0;

    this.tagid = "";

    this.bidfloor = 0;

    this.bidfloorcur = "USD";

    this.secure = (byte)0;

  }

  /**
   * Performs a deep copy on other.
   */
  public ImpressionThrift(ImpressionThrift other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetId()) {
      this.id = other.id;
    }
    if (other.isSetBanner()) {
      this.banner = new BannerThrift(other.banner);
    }
    if (other.isSetVideo()) {
      this.video = new VideoThrift(other.video);
    }
    if (other.isSetDisplaymanager()) {
      this.displaymanager = other.displaymanager;
    }
    if (other.isSetDisplaymanagerver()) {
      this.displaymanagerver = other.displaymanagerver;
    }
    this.instl = other.instl;
    if (other.isSetTagid()) {
      this.tagid = other.tagid;
    }
    this.bidfloor = other.bidfloor;
    if (other.isSetBidfloorcur()) {
      this.bidfloorcur = other.bidfloorcur;
    }
    this.secure = other.secure;
    if (other.isSetIframebuster()) {
      List __this__iframebuster = new ArrayList(other.iframebuster);
      this.iframebuster = __this__iframebuster;
    }
    if (other.isSetPmp()) {
      this.pmp = new PmpThrift(other.pmp);
    }
  }

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

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

    this.banner = null;
    this.video = null;
    this.displaymanager = "";

    this.displaymanagerver = "";

    this.instl = (byte)0;

    this.tagid = "";

    this.bidfloor = 0;

    this.bidfloorcur = "USD";

    this.secure = (byte)0;

    this.iframebuster = null;
    this.pmp = null;
  }

  /**
   * A unique identifier for this impression within the context of the bid request (typically, value starts with 1, and increments up to n for n impressions).
   */
  public String getId() {
    return this.id;
  }

  /**
   * A unique identifier for this impression within the context of the bid request (typically, value starts with 1, and increments up to n for n impressions).
   */
  public ImpressionThrift 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;
    }
  }

  /**
   * A reference to a banner object. Either a banner or video object (or both if the impression could be either) must be included in an impression object. See Banner Object.
   */
  public BannerThrift getBanner() {
    return this.banner;
  }

  /**
   * A reference to a banner object. Either a banner or video object (or both if the impression could be either) must be included in an impression object. See Banner Object.
   */
  public ImpressionThrift setBanner(BannerThrift banner) {
    this.banner = banner;
    return this;
  }

  public void unsetBanner() {
    this.banner = null;
  }

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

  public void setBannerIsSet(boolean value) {
    if (!value) {
      this.banner = null;
    }
  }

  /**
   * A reference to a video object. Either a banner or video object (or both if the impression could be either) must be included in an impression object. See Video Object.
   */
  public VideoThrift getVideo() {
    return this.video;
  }

  /**
   * A reference to a video object. Either a banner or video object (or both if the impression could be either) must be included in an impression object. See Video Object.
   */
  public ImpressionThrift setVideo(VideoThrift video) {
    this.video = video;
    return this;
  }

  public void unsetVideo() {
    this.video = null;
  }

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

  public void setVideoIsSet(boolean value) {
    if (!value) {
      this.video = null;
    }
  }

  /**
   * Name of ad mediation partner, SDK technology, or native player responsible for rendering ad (typically video or mobile). Used by some ad servers to customize ad code by partner.
   */
  public String getDisplaymanager() {
    return this.displaymanager;
  }

  /**
   * Name of ad mediation partner, SDK technology, or native player responsible for rendering ad (typically video or mobile). Used by some ad servers to customize ad code by partner.
   */
  public ImpressionThrift setDisplaymanager(String displaymanager) {
    this.displaymanager = displaymanager;
    return this;
  }

  public void unsetDisplaymanager() {
    this.displaymanager = null;
  }

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

  public void setDisplaymanagerIsSet(boolean value) {
    if (!value) {
      this.displaymanager = null;
    }
  }

  /**
   * Version of ad mediation partner, SDK technology, or native player responsible for rendering ad (typically video or mobile). Used by some ad servers to customize ad code by partner.
   */
  public String getDisplaymanagerver() {
    return this.displaymanagerver;
  }

  /**
   * Version of ad mediation partner, SDK technology, or native player responsible for rendering ad (typically video or mobile). Used by some ad servers to customize ad code by partner.
   */
  public ImpressionThrift setDisplaymanagerver(String displaymanagerver) {
    this.displaymanagerver = displaymanagerver;
    return this;
  }

  public void unsetDisplaymanagerver() {
    this.displaymanagerver = null;
  }

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

  public void setDisplaymanagerverIsSet(boolean value) {
    if (!value) {
      this.displaymanagerver = null;
    }
  }

  /**
   * 1 if the ad is interstitial or full screen; else 0 (i.e., no).
   */
  public byte getInstl() {
    return this.instl;
  }

  /**
   * 1 if the ad is interstitial or full screen; else 0 (i.e., no).
   */
  public ImpressionThrift setInstl(byte instl) {
    this.instl = instl;
    setInstlIsSet(true);
    return this;
  }

  public void unsetInstl() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __INSTL_ISSET_ID);
  }

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

  public void setInstlIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __INSTL_ISSET_ID, value);
  }

  /**
   * Identifier for specific ad placement or ad tag that was used to initiate the auction. This can be useful for debugging of any issues, or for optimization by the buyer.
   */
  public String getTagid() {
    return this.tagid;
  }

  /**
   * Identifier for specific ad placement or ad tag that was used to initiate the auction. This can be useful for debugging of any issues, or for optimization by the buyer.
   */
  public ImpressionThrift setTagid(String tagid) {
    this.tagid = tagid;
    return this;
  }

  public void unsetTagid() {
    this.tagid = null;
  }

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

  public void setTagidIsSet(boolean value) {
    if (!value) {
      this.tagid = null;
    }
  }

  /**
   * Bid floor for this impression (in CPM of bidfloorcur).
   */
  public double getBidfloor() {
    return this.bidfloor;
  }

  /**
   * Bid floor for this impression (in CPM of bidfloorcur).
   */
  public ImpressionThrift setBidfloor(double bidfloor) {
    this.bidfloor = bidfloor;
    setBidfloorIsSet(true);
    return this;
  }

  public void unsetBidfloor() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BIDFLOOR_ISSET_ID);
  }

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

  public void setBidfloorIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BIDFLOOR_ISSET_ID, value);
  }

  /**
   * If bid floor is specified and multiple currencies supported per bid request, then currency should be specified here using ISO-4217 alphabetic codes. Note, this may be different from bid currency returned by bidder, if this is allowed on an exchange.
   */
  public String getBidfloorcur() {
    return this.bidfloorcur;
  }

  /**
   * If bid floor is specified and multiple currencies supported per bid request, then currency should be specified here using ISO-4217 alphabetic codes. Note, this may be different from bid currency returned by bidder, if this is allowed on an exchange.
   */
  public ImpressionThrift setBidfloorcur(String bidfloorcur) {
    this.bidfloorcur = bidfloorcur;
    return this;
  }

  public void unsetBidfloorcur() {
    this.bidfloorcur = null;
  }

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

  public void setBidfloorcurIsSet(boolean value) {
    if (!value) {
      this.bidfloorcur = null;
    }
  }

  /**
   * Flag to indicate whether the impression requires secure HTTPS URL creative assets and markup. A value of “1” means that the impression requires secure assets. A value of "0" means non-secure assets. If this field is omitted the bidder should interpret the secure state is unknown and assume HTTP is supported.
   */
  public byte getSecure() {
    return this.secure;
  }

  /**
   * Flag to indicate whether the impression requires secure HTTPS URL creative assets and markup. A value of “1” means that the impression requires secure assets. A value of "0" means non-secure assets. If this field is omitted the bidder should interpret the secure state is unknown and assume HTTP is supported.
   */
  public ImpressionThrift setSecure(byte secure) {
    this.secure = secure;
    setSecureIsSet(true);
    return this;
  }

  public void unsetSecure() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SECURE_ISSET_ID);
  }

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

  public void setSecureIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SECURE_ISSET_ID, value);
  }

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

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

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

  /**
   * Array of names for supported iframe busters. Exchange specific.
   */
  public List getIframebuster() {
    return this.iframebuster;
  }

  /**
   * Array of names for supported iframe busters. Exchange specific.
   */
  public ImpressionThrift setIframebuster(List iframebuster) {
    this.iframebuster = iframebuster;
    return this;
  }

  public void unsetIframebuster() {
    this.iframebuster = null;
  }

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

  public void setIframebusterIsSet(boolean value) {
    if (!value) {
      this.iframebuster = null;
    }
  }

  /**
   * A reference to the PMP object containing any Deals eligible for the impression object. See the PMP Object definition.
   */
  public PmpThrift getPmp() {
    return this.pmp;
  }

  /**
   * A reference to the PMP object containing any Deals eligible for the impression object. See the PMP Object definition.
   */
  public ImpressionThrift setPmp(PmpThrift pmp) {
    this.pmp = pmp;
    return this;
  }

  public void unsetPmp() {
    this.pmp = null;
  }

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

  public void setPmpIsSet(boolean value) {
    if (!value) {
      this.pmp = null;
    }
  }

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

    case BANNER:
      if (value == null) {
        unsetBanner();
      } else {
        setBanner((BannerThrift)value);
      }
      break;

    case VIDEO:
      if (value == null) {
        unsetVideo();
      } else {
        setVideo((VideoThrift)value);
      }
      break;

    case DISPLAYMANAGER:
      if (value == null) {
        unsetDisplaymanager();
      } else {
        setDisplaymanager((String)value);
      }
      break;

    case DISPLAYMANAGERVER:
      if (value == null) {
        unsetDisplaymanagerver();
      } else {
        setDisplaymanagerver((String)value);
      }
      break;

    case INSTL:
      if (value == null) {
        unsetInstl();
      } else {
        setInstl((Byte)value);
      }
      break;

    case TAGID:
      if (value == null) {
        unsetTagid();
      } else {
        setTagid((String)value);
      }
      break;

    case BIDFLOOR:
      if (value == null) {
        unsetBidfloor();
      } else {
        setBidfloor((Double)value);
      }
      break;

    case BIDFLOORCUR:
      if (value == null) {
        unsetBidfloorcur();
      } else {
        setBidfloorcur((String)value);
      }
      break;

    case SECURE:
      if (value == null) {
        unsetSecure();
      } else {
        setSecure((Byte)value);
      }
      break;

    case IFRAMEBUSTER:
      if (value == null) {
        unsetIframebuster();
      } else {
        setIframebuster((List)value);
      }
      break;

    case PMP:
      if (value == null) {
        unsetPmp();
      } else {
        setPmp((PmpThrift)value);
      }
      break;

    }
  }

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

    case BANNER:
      return getBanner();

    case VIDEO:
      return getVideo();

    case DISPLAYMANAGER:
      return getDisplaymanager();

    case DISPLAYMANAGERVER:
      return getDisplaymanagerver();

    case INSTL:
      return Byte.valueOf(getInstl());

    case TAGID:
      return getTagid();

    case BIDFLOOR:
      return Double.valueOf(getBidfloor());

    case BIDFLOORCUR:
      return getBidfloorcur();

    case SECURE:
      return Byte.valueOf(getSecure());

    case IFRAMEBUSTER:
      return getIframebuster();

    case PMP:
      return getPmp();

    }
    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 BANNER:
      return isSetBanner();
    case VIDEO:
      return isSetVideo();
    case DISPLAYMANAGER:
      return isSetDisplaymanager();
    case DISPLAYMANAGERVER:
      return isSetDisplaymanagerver();
    case INSTL:
      return isSetInstl();
    case TAGID:
      return isSetTagid();
    case BIDFLOOR:
      return isSetBidfloor();
    case BIDFLOORCUR:
      return isSetBidfloorcur();
    case SECURE:
      return isSetSecure();
    case IFRAMEBUSTER:
      return isSetIframebuster();
    case PMP:
      return isSetPmp();
    }
    throw new IllegalStateException();
  }

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

  public boolean equals(ImpressionThrift 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_banner = true && this.isSetBanner();
    boolean that_present_banner = true && that.isSetBanner();
    if (this_present_banner || that_present_banner) {
      if (!(this_present_banner && that_present_banner))
        return false;
      if (!this.banner.equals(that.banner))
        return false;
    }

    boolean this_present_video = true && this.isSetVideo();
    boolean that_present_video = true && that.isSetVideo();
    if (this_present_video || that_present_video) {
      if (!(this_present_video && that_present_video))
        return false;
      if (!this.video.equals(that.video))
        return false;
    }

    boolean this_present_displaymanager = true && this.isSetDisplaymanager();
    boolean that_present_displaymanager = true && that.isSetDisplaymanager();
    if (this_present_displaymanager || that_present_displaymanager) {
      if (!(this_present_displaymanager && that_present_displaymanager))
        return false;
      if (!this.displaymanager.equals(that.displaymanager))
        return false;
    }

    boolean this_present_displaymanagerver = true && this.isSetDisplaymanagerver();
    boolean that_present_displaymanagerver = true && that.isSetDisplaymanagerver();
    if (this_present_displaymanagerver || that_present_displaymanagerver) {
      if (!(this_present_displaymanagerver && that_present_displaymanagerver))
        return false;
      if (!this.displaymanagerver.equals(that.displaymanagerver))
        return false;
    }

    boolean this_present_instl = true && this.isSetInstl();
    boolean that_present_instl = true && that.isSetInstl();
    if (this_present_instl || that_present_instl) {
      if (!(this_present_instl && that_present_instl))
        return false;
      if (this.instl != that.instl)
        return false;
    }

    boolean this_present_tagid = true && this.isSetTagid();
    boolean that_present_tagid = true && that.isSetTagid();
    if (this_present_tagid || that_present_tagid) {
      if (!(this_present_tagid && that_present_tagid))
        return false;
      if (!this.tagid.equals(that.tagid))
        return false;
    }

    boolean this_present_bidfloor = true && this.isSetBidfloor();
    boolean that_present_bidfloor = true && that.isSetBidfloor();
    if (this_present_bidfloor || that_present_bidfloor) {
      if (!(this_present_bidfloor && that_present_bidfloor))
        return false;
      if (this.bidfloor != that.bidfloor)
        return false;
    }

    boolean this_present_bidfloorcur = true && this.isSetBidfloorcur();
    boolean that_present_bidfloorcur = true && that.isSetBidfloorcur();
    if (this_present_bidfloorcur || that_present_bidfloorcur) {
      if (!(this_present_bidfloorcur && that_present_bidfloorcur))
        return false;
      if (!this.bidfloorcur.equals(that.bidfloorcur))
        return false;
    }

    boolean this_present_secure = true && this.isSetSecure();
    boolean that_present_secure = true && that.isSetSecure();
    if (this_present_secure || that_present_secure) {
      if (!(this_present_secure && that_present_secure))
        return false;
      if (this.secure != that.secure)
        return false;
    }

    boolean this_present_iframebuster = true && this.isSetIframebuster();
    boolean that_present_iframebuster = true && that.isSetIframebuster();
    if (this_present_iframebuster || that_present_iframebuster) {
      if (!(this_present_iframebuster && that_present_iframebuster))
        return false;
      if (!this.iframebuster.equals(that.iframebuster))
        return false;
    }

    boolean this_present_pmp = true && this.isSetPmp();
    boolean that_present_pmp = true && that.isSetPmp();
    if (this_present_pmp || that_present_pmp) {
      if (!(this_present_pmp && that_present_pmp))
        return false;
      if (!this.pmp.equals(that.pmp))
        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_banner = true && (isSetBanner());
    list.add(present_banner);
    if (present_banner)
      list.add(banner);

    boolean present_video = true && (isSetVideo());
    list.add(present_video);
    if (present_video)
      list.add(video);

    boolean present_displaymanager = true && (isSetDisplaymanager());
    list.add(present_displaymanager);
    if (present_displaymanager)
      list.add(displaymanager);

    boolean present_displaymanagerver = true && (isSetDisplaymanagerver());
    list.add(present_displaymanagerver);
    if (present_displaymanagerver)
      list.add(displaymanagerver);

    boolean present_instl = true && (isSetInstl());
    list.add(present_instl);
    if (present_instl)
      list.add(instl);

    boolean present_tagid = true && (isSetTagid());
    list.add(present_tagid);
    if (present_tagid)
      list.add(tagid);

    boolean present_bidfloor = true && (isSetBidfloor());
    list.add(present_bidfloor);
    if (present_bidfloor)
      list.add(bidfloor);

    boolean present_bidfloorcur = true && (isSetBidfloorcur());
    list.add(present_bidfloorcur);
    if (present_bidfloorcur)
      list.add(bidfloorcur);

    boolean present_secure = true && (isSetSecure());
    list.add(present_secure);
    if (present_secure)
      list.add(secure);

    boolean present_iframebuster = true && (isSetIframebuster());
    list.add(present_iframebuster);
    if (present_iframebuster)
      list.add(iframebuster);

    boolean present_pmp = true && (isSetPmp());
    list.add(present_pmp);
    if (present_pmp)
      list.add(pmp);

    return list.hashCode();
  }

  @Override
  public int compareTo(ImpressionThrift 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(isSetBanner()).compareTo(other.isSetBanner());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBanner()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.banner, other.banner);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetVideo()).compareTo(other.isSetVideo());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetVideo()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.video, other.video);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDisplaymanager()).compareTo(other.isSetDisplaymanager());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDisplaymanager()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.displaymanager, other.displaymanager);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDisplaymanagerver()).compareTo(other.isSetDisplaymanagerver());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDisplaymanagerver()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.displaymanagerver, other.displaymanagerver);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetInstl()).compareTo(other.isSetInstl());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetInstl()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.instl, other.instl);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTagid()).compareTo(other.isSetTagid());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTagid()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tagid, other.tagid);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetBidfloor()).compareTo(other.isSetBidfloor());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBidfloor()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bidfloor, other.bidfloor);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetBidfloorcur()).compareTo(other.isSetBidfloorcur());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBidfloorcur()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bidfloorcur, other.bidfloorcur);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSecure()).compareTo(other.isSetSecure());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSecure()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.secure, other.secure);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetIframebuster()).compareTo(other.isSetIframebuster());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetIframebuster()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.iframebuster, other.iframebuster);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPmp()).compareTo(other.isSetPmp());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPmp()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pmp, other.pmp);
      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("ImpressionThrift(");
    boolean first = true;

    if (isSetId()) {
      sb.append("id:");
      if (this.id == null) {
        sb.append("null");
      } else {
        sb.append(this.id);
      }
      first = false;
    }
    if (isSetBanner()) {
      if (!first) sb.append(", ");
      sb.append("banner:");
      if (this.banner == null) {
        sb.append("null");
      } else {
        sb.append(this.banner);
      }
      first = false;
    }
    if (isSetVideo()) {
      if (!first) sb.append(", ");
      sb.append("video:");
      if (this.video == null) {
        sb.append("null");
      } else {
        sb.append(this.video);
      }
      first = false;
    }
    if (isSetDisplaymanager()) {
      if (!first) sb.append(", ");
      sb.append("displaymanager:");
      if (this.displaymanager == null) {
        sb.append("null");
      } else {
        sb.append(this.displaymanager);
      }
      first = false;
    }
    if (isSetDisplaymanagerver()) {
      if (!first) sb.append(", ");
      sb.append("displaymanagerver:");
      if (this.displaymanagerver == null) {
        sb.append("null");
      } else {
        sb.append(this.displaymanagerver);
      }
      first = false;
    }
    if (isSetInstl()) {
      if (!first) sb.append(", ");
      sb.append("instl:");
      sb.append(this.instl);
      first = false;
    }
    if (isSetTagid()) {
      if (!first) sb.append(", ");
      sb.append("tagid:");
      if (this.tagid == null) {
        sb.append("null");
      } else {
        sb.append(this.tagid);
      }
      first = false;
    }
    if (isSetBidfloor()) {
      if (!first) sb.append(", ");
      sb.append("bidfloor:");
      sb.append(this.bidfloor);
      first = false;
    }
    if (isSetBidfloorcur()) {
      if (!first) sb.append(", ");
      sb.append("bidfloorcur:");
      if (this.bidfloorcur == null) {
        sb.append("null");
      } else {
        sb.append(this.bidfloorcur);
      }
      first = false;
    }
    if (isSetSecure()) {
      if (!first) sb.append(", ");
      sb.append("secure:");
      sb.append(this.secure);
      first = false;
    }
    if (isSetIframebuster()) {
      if (!first) sb.append(", ");
      sb.append("iframebuster:");
      if (this.iframebuster == null) {
        sb.append("null");
      } else {
        sb.append(this.iframebuster);
      }
      first = false;
    }
    if (isSetPmp()) {
      if (!first) sb.append(", ");
      sb.append("pmp:");
      if (this.pmp == null) {
        sb.append("null");
      } else {
        sb.append(this.pmp);
      }
      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 (banner != null) {
      banner.validate();
    }
    if (video != null) {
      video.validate();
    }
    if (pmp != null) {
      pmp.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 ImpressionThriftStandardSchemeFactory implements SchemeFactory {
    public ImpressionThriftStandardScheme getScheme() {
      return new ImpressionThriftStandardScheme();
    }
  }

  private static class ImpressionThriftStandardScheme extends StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, ImpressionThrift 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: // BANNER
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.banner = new BannerThrift();
              struct.banner.read(iprot);
              struct.setBannerIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // VIDEO
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.video = new VideoThrift();
              struct.video.read(iprot);
              struct.setVideoIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // DISPLAYMANAGER
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.displaymanager = iprot.readString();
              struct.setDisplaymanagerIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // DISPLAYMANAGERVER
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.displaymanagerver = iprot.readString();
              struct.setDisplaymanagerverIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // INSTL
            if (schemeField.type == org.apache.thrift.protocol.TType.BYTE) {
              struct.instl = iprot.readByte();
              struct.setInstlIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // TAGID
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.tagid = iprot.readString();
              struct.setTagidIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // BIDFLOOR
            if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
              struct.bidfloor = iprot.readDouble();
              struct.setBidfloorIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 9: // BIDFLOORCUR
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.bidfloorcur = iprot.readString();
              struct.setBidfloorcurIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 10: // SECURE
            if (schemeField.type == org.apache.thrift.protocol.TType.BYTE) {
              struct.secure = iprot.readByte();
              struct.setSecureIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 11: // IFRAMEBUSTER
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list128 = iprot.readListBegin();
                struct.iframebuster = new ArrayList(_list128.size);
                String _elem129;
                for (int _i130 = 0; _i130 < _list128.size; ++_i130)
                {
                  _elem129 = iprot.readString();
                  struct.iframebuster.add(_elem129);
                }
                iprot.readListEnd();
              }
              struct.setIframebusterIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 12: // PMP
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.pmp = new PmpThrift();
              struct.pmp.read(iprot);
              struct.setPmpIsSet(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, ImpressionThrift 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.banner != null) {
        if (struct.isSetBanner()) {
          oprot.writeFieldBegin(BANNER_FIELD_DESC);
          struct.banner.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.video != null) {
        if (struct.isSetVideo()) {
          oprot.writeFieldBegin(VIDEO_FIELD_DESC);
          struct.video.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      if (struct.displaymanager != null) {
        if (struct.isSetDisplaymanager()) {
          oprot.writeFieldBegin(DISPLAYMANAGER_FIELD_DESC);
          oprot.writeString(struct.displaymanager);
          oprot.writeFieldEnd();
        }
      }
      if (struct.displaymanagerver != null) {
        if (struct.isSetDisplaymanagerver()) {
          oprot.writeFieldBegin(DISPLAYMANAGERVER_FIELD_DESC);
          oprot.writeString(struct.displaymanagerver);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetInstl()) {
        oprot.writeFieldBegin(INSTL_FIELD_DESC);
        oprot.writeByte(struct.instl);
        oprot.writeFieldEnd();
      }
      if (struct.tagid != null) {
        if (struct.isSetTagid()) {
          oprot.writeFieldBegin(TAGID_FIELD_DESC);
          oprot.writeString(struct.tagid);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetBidfloor()) {
        oprot.writeFieldBegin(BIDFLOOR_FIELD_DESC);
        oprot.writeDouble(struct.bidfloor);
        oprot.writeFieldEnd();
      }
      if (struct.bidfloorcur != null) {
        if (struct.isSetBidfloorcur()) {
          oprot.writeFieldBegin(BIDFLOORCUR_FIELD_DESC);
          oprot.writeString(struct.bidfloorcur);
          oprot.writeFieldEnd();
        }
      }
      if (struct.isSetSecure()) {
        oprot.writeFieldBegin(SECURE_FIELD_DESC);
        oprot.writeByte(struct.secure);
        oprot.writeFieldEnd();
      }
      if (struct.iframebuster != null) {
        if (struct.isSetIframebuster()) {
          oprot.writeFieldBegin(IFRAMEBUSTER_FIELD_DESC);
          {
            oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.iframebuster.size()));
            for (String _iter131 : struct.iframebuster)
            {
              oprot.writeString(_iter131);
            }
            oprot.writeListEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.pmp != null) {
        if (struct.isSetPmp()) {
          oprot.writeFieldBegin(PMP_FIELD_DESC);
          struct.pmp.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class ImpressionThriftTupleSchemeFactory implements SchemeFactory {
    public ImpressionThriftTupleScheme getScheme() {
      return new ImpressionThriftTupleScheme();
    }
  }

  private static class ImpressionThriftTupleScheme extends TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, ImpressionThrift struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetId()) {
        optionals.set(0);
      }
      if (struct.isSetBanner()) {
        optionals.set(1);
      }
      if (struct.isSetVideo()) {
        optionals.set(2);
      }
      if (struct.isSetDisplaymanager()) {
        optionals.set(3);
      }
      if (struct.isSetDisplaymanagerver()) {
        optionals.set(4);
      }
      if (struct.isSetInstl()) {
        optionals.set(5);
      }
      if (struct.isSetTagid()) {
        optionals.set(6);
      }
      if (struct.isSetBidfloor()) {
        optionals.set(7);
      }
      if (struct.isSetBidfloorcur()) {
        optionals.set(8);
      }
      if (struct.isSetSecure()) {
        optionals.set(9);
      }
      if (struct.isSetIframebuster()) {
        optionals.set(10);
      }
      if (struct.isSetPmp()) {
        optionals.set(11);
      }
      oprot.writeBitSet(optionals, 12);
      if (struct.isSetId()) {
        oprot.writeString(struct.id);
      }
      if (struct.isSetBanner()) {
        struct.banner.write(oprot);
      }
      if (struct.isSetVideo()) {
        struct.video.write(oprot);
      }
      if (struct.isSetDisplaymanager()) {
        oprot.writeString(struct.displaymanager);
      }
      if (struct.isSetDisplaymanagerver()) {
        oprot.writeString(struct.displaymanagerver);
      }
      if (struct.isSetInstl()) {
        oprot.writeByte(struct.instl);
      }
      if (struct.isSetTagid()) {
        oprot.writeString(struct.tagid);
      }
      if (struct.isSetBidfloor()) {
        oprot.writeDouble(struct.bidfloor);
      }
      if (struct.isSetBidfloorcur()) {
        oprot.writeString(struct.bidfloorcur);
      }
      if (struct.isSetSecure()) {
        oprot.writeByte(struct.secure);
      }
      if (struct.isSetIframebuster()) {
        {
          oprot.writeI32(struct.iframebuster.size());
          for (String _iter132 : struct.iframebuster)
          {
            oprot.writeString(_iter132);
          }
        }
      }
      if (struct.isSetPmp()) {
        struct.pmp.write(oprot);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, ImpressionThrift struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(12);
      if (incoming.get(0)) {
        struct.id = iprot.readString();
        struct.setIdIsSet(true);
      }
      if (incoming.get(1)) {
        struct.banner = new BannerThrift();
        struct.banner.read(iprot);
        struct.setBannerIsSet(true);
      }
      if (incoming.get(2)) {
        struct.video = new VideoThrift();
        struct.video.read(iprot);
        struct.setVideoIsSet(true);
      }
      if (incoming.get(3)) {
        struct.displaymanager = iprot.readString();
        struct.setDisplaymanagerIsSet(true);
      }
      if (incoming.get(4)) {
        struct.displaymanagerver = iprot.readString();
        struct.setDisplaymanagerverIsSet(true);
      }
      if (incoming.get(5)) {
        struct.instl = iprot.readByte();
        struct.setInstlIsSet(true);
      }
      if (incoming.get(6)) {
        struct.tagid = iprot.readString();
        struct.setTagidIsSet(true);
      }
      if (incoming.get(7)) {
        struct.bidfloor = iprot.readDouble();
        struct.setBidfloorIsSet(true);
      }
      if (incoming.get(8)) {
        struct.bidfloorcur = iprot.readString();
        struct.setBidfloorcurIsSet(true);
      }
      if (incoming.get(9)) {
        struct.secure = iprot.readByte();
        struct.setSecureIsSet(true);
      }
      if (incoming.get(10)) {
        {
          org.apache.thrift.protocol.TList _list133 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
          struct.iframebuster = new ArrayList(_list133.size);
          String _elem134;
          for (int _i135 = 0; _i135 < _list133.size; ++_i135)
          {
            _elem134 = iprot.readString();
            struct.iframebuster.add(_elem134);
          }
        }
        struct.setIframebusterIsSet(true);
      }
      if (incoming.get(11)) {
        struct.pmp = new PmpThrift();
        struct.pmp.read(iprot);
        struct.setPmpIsSet(true);
      }
    }
  }

}