
open_rtb.SeatBidAvro Maven / Gradle / Ivy
/**
* Autogenerated by Avro
*
* DO NOT EDIT DIRECTLY
*/
package open_rtb;
/** 4.3.2 Seat Bid Object
A bid response can contain multiple “seatbid” objects, each on behalf of a different bidder seat. Since a bid request can include multiple impressions, each “seatbid” object can contain multiple bids each pertaining to a different impression on behalf of a seat. Thus, each “bid” object must include the impression ID to which it pertains as well as the bid price. The “group” attribute can be used to specify if a seat is willing to accept any impressions that it can win (default) or if it is only interested in winning any if it can win them all (i.e., all or nothing). */
@org.apache.avro.specific.AvroGenerated
final public class SeatBidAvro extends org.apache.avro.specific.SpecificRecordBase {
/** Array of bid objects; each bid object relates to an imp object in the bid request. Note that, if supported by an exchange, one imp object can have many bid objects. */
org.apache.avro.generic.GenericData.Array bid;
/** ID of the bidder seat on whose behalf this bid is made. */
org.apache.avro.util.Utf8 seat;
/** “1” means impressions must be won-lost as a group; default is “0”. */
int group;
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 SeatBidAvro() {}
public SeatBidAvro freeze() {
_frozen = true;
bid.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 bid;
case 1: return seat;
case 2: return group;
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.writeArrayStart(); _encoder.setItemCount(bid.size()); for (open_rtb.BidAvro e : bid) { e.encode(_encoder); } _encoder.writeArrayEnd();
_encoder.writeString(seat);
_encoder.writeInt(group);
}
// 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: bid = (org.apache.avro.generic.GenericData.Array) value$; break;
case 1: seat = (org.apache.avro.util.Utf8) value$; break;
case 2: group = (int) value$; break;
default: throw new org.apache.avro.AvroRuntimeException("Bad index");
}
}
/** Reads record from Avro Decoder. */
public SeatBidAvro 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.");
}
long _i0 = _decoder.readArrayStart(); bid = new org.apache.avro.generic.GenericData.Array((int) _i0, SCHEMA$.getFields().get(0).schema()); for(; _i0 != 0; _i0 = _decoder.arrayNext()) { for (long _j0= 0; _j0 < _i0; _j0++) { bid.add(new open_rtb.BidAvro().decode(_decoder)); } }
seat = _decoder.readString(seat);
group = _decoder.readInt();
return freeze();
}
/**
* RecordBuilder for Avro instances.
*/
static public class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase implements org.apache.avro.data.RecordBuilder {
private org.apache.avro.generic.GenericData.Array bid;
private org.apache.avro.util.Utf8 seat;
private int group;
public Builder() {
super(SeatBidAvro.SCHEMA$);
}
public Builder(SeatBidAvro.Builder other) {
super(other);
if (isValidValue(fields()[0], other.bid)) {
this.bid = data().deepCopy(fields()[0].schema(), other.bid);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.seat)) {
this.seat = data().deepCopy(fields()[1].schema(), other.seat);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.group)) {
this.group = data().deepCopy(fields()[2].schema(), other.group);
fieldSetFlags()[2] = true;
}
}
public Builder(SeatBidAvro other) {
super(SeatBidAvro.SCHEMA$);
if (isValidValue(fields()[0], other.bid)) {
this.bid = data().deepCopy(fields()[0].schema(), other.bid);
fieldSetFlags()[0] = true;
}
if (isValidValue(fields()[1], other.seat)) {
this.seat = data().deepCopy(fields()[1].schema(), other.seat);
fieldSetFlags()[1] = true;
}
if (isValidValue(fields()[2], other.group)) {
this.group = data().deepCopy(fields()[2].schema(), other.group);
fieldSetFlags()[2] = true;
}
}
/** Gets the value of the 'bid' field. */
public org.apache.avro.generic.GenericData.Array getBid() {
return bid;
}
/** Sets the value of the 'bid' field. */
public SeatBidAvro.Builder setBid(org.apache.avro.generic.GenericData.Array value) {
validate(fields()[0], value);
this.bid = value;
fieldSetFlags()[0] = true;
return this;
}
/** Checks whether the 'bid' field has been set. */
public boolean hasBid() {
return fieldSetFlags()[0];
}
/** Clears the value of the 'bid' field. */
public SeatBidAvro.Builder clearBid() {
bid = null;
fieldSetFlags()[0] = false;
return this;
}
/** Gets the value of the 'seat' field. */
public org.apache.avro.util.Utf8 getSeat() {
return seat;
}
/** Sets the value of the 'seat' field. */
public SeatBidAvro.Builder setSeat(org.apache.avro.util.Utf8 value) {
validate(fields()[1], value);
this.seat = value;
fieldSetFlags()[1] = true;
return this;
}
/** Checks whether the 'seat' field has been set. */
public boolean hasSeat() {
return fieldSetFlags()[1];
}
/** Clears the value of the 'seat' field. */
public SeatBidAvro.Builder clearSeat() {
seat = null;
fieldSetFlags()[1] = false;
return this;
}
/** Gets the value of the 'group' field. */
public int getGroup() {
return group;
}
/** Sets the value of the 'group' field. */
public SeatBidAvro.Builder setGroup(int value) {
validate(fields()[2], value);
this.group = value;
fieldSetFlags()[2] = true;
return this;
}
/** Checks whether the 'group' field has been set. */
public boolean hasGroup() {
return fieldSetFlags()[2];
}
/** Clears the value of the 'group' field. */
public SeatBidAvro.Builder clearGroup() {
fieldSetFlags()[2] = false;
return this;
}
@Override
public SeatBidAvro build() {
final SeatBidAvro record;
try {
record = new SeatBidAvro();
record.bid = fieldSetFlags()[0] ? this.bid : (org.apache.avro.generic.GenericData.Array) defaultValue(fields()[0]);
record.seat = fieldSetFlags()[1] ? this.seat : (org.apache.avro.util.Utf8) defaultValue(fields()[1]);
record.group = fieldSetFlags()[2] ? this.group : (int) defaultValue(fields()[2]);
} catch (Exception e) {
throw new org.apache.avro.AvroRuntimeException(e);
}
return record.freeze();
}
}
/** Creates a new SeatBidAvro RecordBuilder. */
static public SeatBidAvro.Builder newBuilder() {
return new SeatBidAvro.Builder();
}
/** Creates a new SeatBidAvro RecordBuilder by copying an existing SeatBidAvro.Builder instance. */
static public SeatBidAvro.Builder newBuilder(SeatBidAvro.Builder other) {
return new SeatBidAvro.Builder(other);
}
/** Creates a new SeatBidAvro RecordBuilder by copying an existing SeatBidAvro instance. */
static public SeatBidAvro.Builder newBuilder(SeatBidAvro other) {
return new SeatBidAvro.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\":\"SeatBidAvro\",\"namespace\":\"open_rtb\",\"doc\":\"4.3.2 Seat Bid Object\\nA bid response can contain multiple “seatbid” objects, each on behalf of a different bidder seat. Since a bid request can include multiple impressions, each “seatbid” object can contain multiple bids each pertaining to a different impression on behalf of a seat. Thus, each “bid” object must include the impression ID to which it pertains as well as the bid price. The “group” attribute can be used to specify if a seat is willing to accept any impressions that it can win (default) or if it is only interested in winning any if it can win them all (i.e., all or nothing).\",\"fields\":[{\"name\":\"bid\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"BidAvro\",\"doc\":\"4.3.3 Bid Object\\nFor each bid, the “nurl” attribute contains the win notice URL. If the bidder wins the impression, the exchange calls this notice URL a) to inform the bidder of the win and b) to convey certain information using substitution macros (see Section 4.6 Substitution Macros).\\nThe “adomain” attribute can be used to check advertiser block list compliance. The “iurl” attribute can provide a link to an image that is representative of the campaign’s content (irrespective of whether the campaign may have multiple creatives). This enables human review for spotting inappropriate content. The “cid” attribute can be used to block ads that were previously identified as inappropriate; essentially a safety net beyond the block lists. The “crid” attribute can be helpful in reporting creative issues back to bidders. Finally, the “attr” array indicates the creative attributes that describe the ad to be served.\\nBEST PRACTICE: Substitution macros may allow a bidder to use a static notice URL for all of its bids. Thus, exchanges should offer the option of a default notice URL that can be pre- configured per bidder to reduce redundant data transfer.\",\"fields\":[{\"name\":\"id\",\"type\":\"string\",\"doc\":\"ID for the bid object chosen by the bidder for tracking and debugging purposes. Useful when multiple bids are submitted for a single impression for a given seat.\",\"default\":\"\",\"ordinal_\":1},{\"name\":\"impid\",\"type\":\"string\",\"doc\":\"ID of the impression object to which this bid applies.\",\"default\":\"\",\"ordinal_\":2},{\"name\":\"price\",\"type\":{\"type\":\"double\",\"min\":0.0},\"doc\":\"Bid price in CPM. WARNING/Best Practice Note: Although this value is a float, OpenRTB strongly suggests using integer math for accounting to avoid rounding errors.\",\"default\":0.0,\"ordinal_\":3},{\"name\":\"adid\",\"type\":\"string\",\"doc\":\"ID that references the ad to be served if the bid wins.\",\"default\":\"\",\"ordinal_\":4},{\"name\":\"nurl\",\"type\":\"string\",\"doc\":\"Win notice URL. Note that ad markup is also typically, but not necessarily, returned via this URL.\",\"default\":\"\",\"ordinal_\":5},{\"name\":\"adm\",\"type\":\"string\",\"doc\":\"Actual ad markup. XHTML if a response to a banner object, or VAST XML if a response to a video object.\",\"default\":\"\",\"ordinal_\":6},{\"name\":\"adomain\",\"type\":{\"type\":\"array\",\"items\":\"string\"},\"doc\":\"Advertiser’s primary or top-level domain for advertiser checking. This can be a list of domains if there is a rotating creative. However, exchanges may mandate that only one landing domain is allowed.\",\"default\":[],\"ordinal_\":7},{\"name\":\"lurl\",\"type\":\"string\",\"doc\":\"Sample image URL (without cache busting) for content checking.\",\"default\":\"\",\"ordinal_\":8},{\"name\":\"cid\",\"type\":\"string\",\"doc\":\"Campaign ID or similar that appears within the ad markup.\",\"default\":\"\",\"ordinal_\":9},{\"name\":\"crid\",\"type\":\"string\",\"doc\":\"Creative ID for reporting content issues or defects. This could also be used as a reference to a creative ID that is posted with an exchange.\",\"default\":\"\",\"ordinal_\":10},{\"name\":\"attr\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"int\",\"max\":255,\"min\":0}},\"doc\":\"Array of creative attributes. See Table 6.3 Creative Attributes.\",\"default\":[],\"ordinal_\":11},{\"name\":\"dealid\",\"type\":\"string\",\"doc\":\"A unique identifier for the direct deal associated with the bid. If the bid is associated and in response to a dealid in the request object it is _required_ in the response object.\",\"default\":\"\",\"ordinal_\":12},{\"name\":\"w\",\"type\":{\"type\":\"int\",\"max\":4294967295,\"min\":0},\"doc\":\"Width of the ad in pixels. If the bid request contained the wmax/hmax and wmin/hmin optional fields it is recommended that the response bid contains this field to signal the size of ad chosen.\",\"default\":0,\"ordinal_\":13},{\"name\":\"h\",\"type\":{\"type\":\"int\",\"max\":4294967295,\"min\":0},\"doc\":\"Height of the ad in pixels. If the bid request contained the wmax/hmax and wmin/hmin optional fields it is recommended that the response bid contains this field to signal the size of ad chosen.\",\"default\":0,\"ordinal_\":14}]}},\"doc\":\"Array of bid objects; each bid object relates to an imp object in the bid request. Note that, if supported by an exchange, one imp object can have many bid objects.\",\"default\":[],\"ordinal_\":1},{\"name\":\"seat\",\"type\":\"string\",\"doc\":\"ID of the bidder seat on whose behalf this bid is made.\",\"default\":\"\",\"ordinal_\":2},{\"name\":\"group\",\"type\":{\"type\":\"int\",\"max\":1,\"min\":0},\"doc\":\"“1” means impressions must be won-lost as a group; default is “0”.\",\"default\":0,\"ordinal_\":3}]}");
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy