
open_rtb.PmpAvro Maven / Gradle / Ivy
/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package open_rtb;
/** 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. */
@org.apache.avro.specific.AvroGenerated
final public class PmpAvro extends org.apache.avro.specific.SpecificRecordBase {
/** 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) */
int private_auction;
/** A collection of “deal” objects encapsulating a list of direct deals eligible for this impression. */
org.apache.avro.generic.GenericData.Array deals;
private boolean _frozen = false;
/** Default constructor, does not initialize fields to their default values from the schema. Only use this if you know what you are doing. */
public PmpAvro() {}
public PmpAvro freeze() {
_frozen = true;
deals.forEach(e -> e.freeze());
return this;
}
@Override
public org.apache.avro.Schema getSchema() { return SCHEMA$; }
// Used by DatumWriter. Applications should not call.
@Override
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");
}
}
/** Writes record to Avro Encoder. */
public void encode(org.apache.avro.io.Encoder _encoder) throws java.io.IOException {
_encoder.writeInt(private_auction);
_encoder.writeArrayStart(); _encoder.setItemCount(deals.size()); for (open_rtb.DealAvro e : deals) { e.encode(_encoder); } _encoder.writeArrayEnd();
}
// Used by DatumReader. Applications should not call.
@Override
@SuppressWarnings(value="unchecked")
public void put(int field$, java.lang.Object value$) {
if (_frozen) {
throw new org.apache.avro.AvroRuntimeException("this Anoa SpecificRecord instance has already been frozen.");
}
switch (field$) {
case 0: private_auction = (int) value$; break;
case 1: deals = (org.apache.avro.generic.GenericData.Array) value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/** Reads record from Avro Decoder. */
public PmpAvro decode(org.apache.avro.io.Decoder _decoder) throws java.io.IOException {
if (_frozen) {
throw new org.apache.avro.AvroRuntimeException("this Anoa SpecificRecord instance has already been frozen.");
}
private_auction = _decoder.readInt();
long _i1 = _decoder.readArrayStart(); deals = new org.apache.avro.generic.GenericData.Array((int) _i1, SCHEMA$.getFields().get(1).schema()); for(; _i1 != 0; _i1 = _decoder.arrayNext()) { for (long _j1= 0; _j1 < _i1; _j1++) { deals.add(new open_rtb.DealAvro().decode(_decoder)); } }
return freeze();
}
/**
* RecordBuilder for Avro instances.
*/
static public class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase implements org.apache.avro.data.RecordBuilder {
private int private_auction;
private org.apache.avro.generic.GenericData.Array deals;
public Builder() {
super(PmpAvro.SCHEMA$);
}
public Builder(PmpAvro.Builder other) {
super(other);
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;
}
}
public Builder(PmpAvro other) {
super(PmpAvro.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 int getPrivateAuction() {
return private_auction;
}
/** Sets the value of the 'private_auction' field. */
public PmpAvro.Builder setPrivateAuction(int 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 PmpAvro.Builder clearPrivateAuction() {
fieldSetFlags()[0] = false;
return this;
}
/** Gets the value of the 'deals' field. */
public org.apache.avro.generic.GenericData.Array getDeals() {
return deals;
}
/** Sets the value of the 'deals' field. */
public PmpAvro.Builder setDeals(org.apache.avro.generic.GenericData.Array 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 PmpAvro.Builder clearDeals() {
deals = null;
fieldSetFlags()[1] = false;
return this;
}
@Override
public PmpAvro build() {
final PmpAvro record;
try {
record = new PmpAvro();
record.private_auction = fieldSetFlags()[0] ? this.private_auction : (int) defaultValue(fields()[0]);
record.deals = fieldSetFlags()[1] ? this.deals : (org.apache.avro.generic.GenericData.Array) defaultValue(fields()[1]);
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
return record.freeze();
}
}
/** Creates a new PmpAvro RecordBuilder. */
static public PmpAvro.Builder newBuilder() {
return new PmpAvro.Builder();
}
/** Creates a new PmpAvro RecordBuilder by copying an existing PmpAvro.Builder instance. */
static public PmpAvro.Builder newBuilder(PmpAvro.Builder other) {
return new PmpAvro.Builder(other);
}
/** Creates a new PmpAvro RecordBuilder by copying an existing PmpAvro instance. */
static public PmpAvro.Builder newBuilder(PmpAvro other) {
return new PmpAvro.Builder(other);
}
/** Returns Avro record schema. */
static public org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
static public final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"PmpAvro\",\"namespace\":\"open_rtb\",\"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.\",\"fields\":[{\"name\":\"private_auction\",\"type\":{\"type\":\"int\",\"max\":1,\"min\":0},\"doc\":\"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\":0,\"ordinal_\":1},{\"name\":\"deals\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"DealAvro\",\"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\":\"A unique identifier for the direct deal.\",\"default\":\"\",\"ordinal_\":1},{\"name\":\"bidfloor\",\"type\":{\"type\":\"double\",\"min\":0.0},\"doc\":\"Bid floor for this impression (in CPM of bidfloorcur).\",\"default\":0.0,\"ordinal_\":2},{\"name\":\"bidfloorcur\",\"type\":\"string\",\"doc\":\"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\",\"ordinal_\":3},{\"name\":\"wseat\",\"type\":{\"type\":\"array\",\"items\":\"string\"},\"doc\":\"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\":[],\"ordinal_\":4},{\"name\":\"wadomain\",\"type\":{\"type\":\"array\",\"items\":\"string\"},\"doc\":\"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\":[],\"ordinal_\":5},{\"name\":\"at\",\"type\":{\"type\":\"int\",\"max\":255,\"min\":0},\"doc\":\"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\":0,\"ordinal_\":6}]}},\"doc\":\"A collection of “deal” objects encapsulating a list of direct deals eligible for this impression.\",\"default\":[],\"ordinal_\":2}]}");
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy