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

com.adgear.avro.openrtb.PMP Maven / Gradle / Ivy

Go to download

Test module for other Anoa modules, which exposes complex records (OpenRTB bid requests) through utility classes for use in unit tests within other Anoa modules (anoa-core, for instance).

The newest version!
/**
 * Autogenerated by Avro
 * 
 * DO NOT EDIT DIRECTLY
 */
package com.adgear.avro.openrtb;  


/** 3.3.16 PMP Object
The “pmp” object contains a parent object for usage within the context of private marketplaces and the use of the RTB protocol to execute Direct Deals.

requires:
 com.adgear.avro.openrtb.Deal */
@SuppressWarnings("all")
@org.apache.avro.specific.AvroGenerated
public class PMP extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"PMP\",\"namespace\":\"com.adgear.avro.openrtb\",\"doc\":\"3.3.16 PMP Object\\nThe “pmp” object contains a parent object for usage within the context of private marketplaces and the use of the RTB protocol to execute Direct Deals.\\n\\nrequires:\\n com.adgear.avro.openrtb.Deal\",\"fields\":[{\"name\":\"private_auction\",\"type\":[\"null\",\"int\"],\"doc\":\"[1] An integer flag indicating that this impression is a private auction eligible only to seats named in the Direct Deals object. (e.g., 1 = bids for this impression are restricted to the deals specified and the terms thereof; 0 = all bids are accepted)\",\"default\":null},{\"name\":\"deals\",\"type\":[\"null\",{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"Deal\",\"doc\":\"3.3.17 Direct Deals Object\\nA “deal” object constitutes a deal struck a priori between a buyer and a seller and indicates that this impression is available under the terms of that deal.\",\"fields\":[{\"name\":\"id\",\"type\":\"string\",\"doc\":\"[1] A unique identifier for the direct deal.\"},{\"name\":\"bidfloor\",\"type\":\"double\",\"doc\":\"[2] Bid floor for this impression (in CPM of bidfloorcur).\",\"default\":0.0},{\"name\":\"bidfloorcur\",\"type\":\"string\",\"doc\":\"[3] 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.\",\"default\":\"USD\"},{\"name\":\"wseat\",\"type\":[\"null\",{\"type\":\"array\",\"items\":\"string\"}],\"doc\":\"[4] Array of buyer seats allowed to bid on this Direct Deal. Seats are an optional feature of an exchange. For example, [“4”,”34”,”82”,”45”] indicates that only advertisers using these exchange seats are allowed to bid on this direct deal.\",\"default\":null},{\"name\":\"wadomain\",\"type\":[\"null\",{\"type\":\"array\",\"items\":\"string\"}],\"doc\":\"[5] Array of advertiser domains allowed to bid on this Direct Deal. For example, [“advertiser1.com”,”advertiser2.com”] indicates that only the listed advertisers are allowed to bid on this direct deal.\",\"default\":null},{\"name\":\"at\",\"type\":[\"null\",\"int\"],\"doc\":\"[6] Auction type. If “1”, then first price auction. If “2”, then second price auction. If “3”, the passed bidfloor indicates the apriori agreed upon deal price. Additional auction types can be defined as per the exchange’s business rules.\",\"default\":null}]}}],\"doc\":\"[2] A collection of “deal” objects encapsulating a list of direct deals eligible for this impression.\",\"default\":null}]}");
  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
  /** [1] An integer flag indicating that this impression is a private auction eligible only to seats named in the Direct Deals object. (e.g., 1 = bids for this impression are restricted to the deals specified and the terms thereof; 0 = all bids are accepted) */
  @Deprecated public java.lang.Integer private_auction;
  /** [2] A collection of “deal” objects encapsulating a list of direct deals eligible for this impression. */
  @Deprecated public java.util.List deals;

  /**
   * Default constructor.
   */
  public PMP() {}

  /**
   * All-args constructor.
   */
  public PMP(java.lang.Integer private_auction, java.util.List deals) {
    this.private_auction = private_auction;
    this.deals = deals;
  }

  public org.apache.avro.Schema getSchema() { return SCHEMA$; }
  // Used by DatumWriter.  Applications should not call. 
  public java.lang.Object get(int field$) {
    switch (field$) {
    case 0: return private_auction;
    case 1: return deals;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }
  // Used by DatumReader.  Applications should not call. 
  @SuppressWarnings(value="unchecked")
  public void put(int field$, java.lang.Object value$) {
    switch (field$) {
    case 0: private_auction = (java.lang.Integer)value$; break;
    case 1: deals = (java.util.List)value$; break;
    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
    }
  }

  /**
   * Gets the value of the 'private_auction' field.
   * [1] An integer flag indicating that this impression is a private auction eligible only to seats named in the Direct Deals object. (e.g., 1 = bids for this impression are restricted to the deals specified and the terms thereof; 0 = all bids are accepted)
   */
  public java.lang.Integer getPrivateAuction() {
    return private_auction;
  }

  /**
   * Sets the value of the 'private_auction' field.
   * [1] An integer flag indicating that this impression is a private auction eligible only to seats named in the Direct Deals object. (e.g., 1 = bids for this impression are restricted to the deals specified and the terms thereof; 0 = all bids are accepted)
   * @param value the value to set.
   */
  public void setPrivateAuction(java.lang.Integer value) {
    this.private_auction = value;
  }

  /**
   * Gets the value of the 'deals' field.
   * [2] A collection of “deal” objects encapsulating a list of direct deals eligible for this impression.
   */
  public java.util.List getDeals() {
    return deals;
  }

  /**
   * Sets the value of the 'deals' field.
   * [2] A collection of “deal” objects encapsulating a list of direct deals eligible for this impression.
   * @param value the value to set.
   */
  public void setDeals(java.util.List value) {
    this.deals = value;
  }

  /** Creates a new PMP RecordBuilder */
  public static com.adgear.avro.openrtb.PMP.Builder newBuilder() {
    return new com.adgear.avro.openrtb.PMP.Builder();
  }
  
  /** Creates a new PMP RecordBuilder by copying an existing Builder */
  public static com.adgear.avro.openrtb.PMP.Builder newBuilder(com.adgear.avro.openrtb.PMP.Builder other) {
    return new com.adgear.avro.openrtb.PMP.Builder(other);
  }
  
  /** Creates a new PMP RecordBuilder by copying an existing PMP instance */
  public static com.adgear.avro.openrtb.PMP.Builder newBuilder(com.adgear.avro.openrtb.PMP other) {
    return new com.adgear.avro.openrtb.PMP.Builder(other);
  }

  /**
   * RecordBuilder for PMP instances.
   */
  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase
    implements org.apache.avro.data.RecordBuilder {

    private java.lang.Integer private_auction;
    private java.util.List deals;

    /** Creates a new Builder */
    private Builder() {
      super(com.adgear.avro.openrtb.PMP.SCHEMA$);
    }
    
    /** Creates a Builder by copying an existing Builder */
    private Builder(com.adgear.avro.openrtb.PMP.Builder other) {
      super(other);
    }
    
    /** Creates a Builder by copying an existing PMP instance */
    private Builder(com.adgear.avro.openrtb.PMP other) {
      super(com.adgear.avro.openrtb.PMP.SCHEMA$);
      if (isValidValue(fields()[0], other.private_auction)) {
        this.private_auction = data().deepCopy(fields()[0].schema(), other.private_auction);
        fieldSetFlags()[0] = true;
      }
      if (isValidValue(fields()[1], other.deals)) {
        this.deals = data().deepCopy(fields()[1].schema(), other.deals);
        fieldSetFlags()[1] = true;
      }
    }

    /** Gets the value of the 'private_auction' field */
    public java.lang.Integer getPrivateAuction() {
      return private_auction;
    }

    /** Sets the value of the 'private_auction' field */
    public com.adgear.avro.openrtb.PMP.Builder setPrivateAuction(java.lang.Integer value) {
      validate(fields()[0], value);
      this.private_auction = value;
      fieldSetFlags()[0] = true;
      return this; 
    }
    
    /** Checks whether the 'private_auction' field has been set */
    public boolean hasPrivateAuction() {
      return fieldSetFlags()[0];
    }
    
    /** Clears the value of the 'private_auction' field */
    public com.adgear.avro.openrtb.PMP.Builder clearPrivateAuction() {
      private_auction = null;
      fieldSetFlags()[0] = false;
      return this;
    }

    /** Gets the value of the 'deals' field */
    public java.util.List getDeals() {
      return deals;
    }

    /** Sets the value of the 'deals' field */
    public com.adgear.avro.openrtb.PMP.Builder setDeals(java.util.List value) {
      validate(fields()[1], value);
      this.deals = value;
      fieldSetFlags()[1] = true;
      return this; 
    }
    
    /** Checks whether the 'deals' field has been set */
    public boolean hasDeals() {
      return fieldSetFlags()[1];
    }
    
    /** Clears the value of the 'deals' field */
    public com.adgear.avro.openrtb.PMP.Builder clearDeals() {
      deals = null;
      fieldSetFlags()[1] = false;
      return this;
    }

    @Override
    public PMP build() {
      try {
        PMP record = new PMP();
        record.private_auction = fieldSetFlags()[0] ? this.private_auction : (java.lang.Integer) defaultValue(fields()[0]);
        record.deals = fieldSetFlags()[1] ? this.deals : (java.util.List) defaultValue(fields()[1]);
        return record;
      } catch (Exception e) {
        throw new org.apache.avro.AvroRuntimeException(e);
      }
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy