Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/main/java/com/metamx/datatypes/openrtb/Imp.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class Imp
private final String id;
private final Banner banner;
private final Video video;
private final Native nativeObj;
private final String displayManager;
private final String displayManagerVer;
private final Integer instl;
Expand All @@ -42,6 +43,7 @@ public Imp(
@JsonProperty("id") String id,
@JsonProperty("banner") Banner banner,
@JsonProperty("video") Video video,
@JsonProperty("native") Native nativeObj,
@JsonProperty("displaymanager") String displayManager,
@JsonProperty("displaymanagerver") String displayManagerVer,
@JsonProperty("instl") Integer instl,
Expand All @@ -57,6 +59,7 @@ public Imp(
this.id = id;
this.banner = banner;
this.video = video;
this.nativeObj = nativeObj;
this.displayManager = displayManager;
this.displayManagerVer = displayManagerVer;
this.instl = instl;
Expand Down Expand Up @@ -87,6 +90,12 @@ public Video getVideo()
return video;
}

@JsonProperty
public Native getNativeObj()
{
return nativeObj;
}

@JsonProperty("displaymanager")
public String getDisplayManager()
{
Expand Down Expand Up @@ -157,6 +166,7 @@ public static class Builder
private String id;
private Banner banner;
private Video video;
private Native nativeObj;
private String displayManager;
private String displayManagerVer;
private Integer instl;
Expand Down Expand Up @@ -188,6 +198,12 @@ public Builder video(final Video video)
return this;
}

public Builder nativeObj(final Native nativeObj)
{
this.nativeObj = nativeObj;
return this;
}

public Builder displayManager(final String displayManager)
{
this.displayManager = displayManager;
Expand Down Expand Up @@ -253,6 +269,7 @@ public Imp build()
id,
banner,
video,
nativeObj,
displayManager,
displayManagerVer,
instl,
Expand Down
136 changes: 136 additions & 0 deletions src/main/java/com/metamx/datatypes/openrtb/Native.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
/*
* Rad-tech-datatypes.
* Copyright 2014 Metamarkets Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.metamx.datatypes.openrtb;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.List;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class Native
{
private final String request;
private final String ver;
private final List<Integer> api;
private final List<Integer> battr;
private final Ext ext;

public Native(
@JsonProperty("request") String request,
@JsonProperty("ver") String ver,
@JsonProperty("api") List<Integer> api,
@JsonProperty("battr") List<Integer> battr,
@JsonProperty("ext") Ext ext
)
{
this.request = request;
this.ver = ver;
this.api = api;
this.battr = battr;
this.ext = ext;
}

@JsonProperty
public String getRequest()
{
return request;
}

@JsonProperty
public String getVer()
{
return ver;
}

@JsonProperty
public List<Integer> getApi()
{
return api;
}

@JsonProperty
public List<Integer> getBattr()
{
return battr;
}

@JsonProperty
public Ext getExt()
{
return ext;
}

public static Builder builder()
{
return new Builder();
}

public static class Builder
{
private String request;
private String ver = "1";
private List<Integer> api;
private List<Integer> battr;
private Ext ext;

public Builder() {}

public Builder request(final String request)
{
this.request = request;
return this;
}

public Builder ver(final String ver)
{
this.ver = ver;
return this;
}

public Builder api(final List<Integer> api)
{
this.api = api;
return this;
}

public Builder battr(final List<Integer> battr)
{
this.battr = battr;
return this;
}

public Builder ext(final Ext ext)
{
this.ext = ext;
return this;
}

public Native build()
{
return new Native(
request,
ver,
api,
battr,
ext
);
}
}

}
170 changes: 170 additions & 0 deletions src/main/java/com/metamx/datatypes/openrtbnative/AssetObj.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
/*
* Rad-tech-datatypes.
* Copyright 2014 Metamarkets Group Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.metamx.datatypes.openrtbnative;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.metamx.datatypes.openrtb.Ext;
import com.metamx.datatypes.openrtb.Video;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class AssetObj
{
private final int id;
private final int req;
private final TitleReq title;
private final ImgReq imgReq;
private final Video video;
private final DataReq dataReq;
private final Ext ext;

public AssetObj(
@JsonProperty("id") int id,
@JsonProperty("req") int req,
@JsonProperty("title") TitleReq title,
@JsonProperty("img") ImgReq imgReq,
@JsonProperty("video") Video video,
@JsonProperty("data") DataReq dataReq,
@JsonProperty("ext") Ext ext
)
{
this.id = id;
this.req = req;
this.title = title;
this.imgReq = imgReq;
this.video = video;
this.dataReq = dataReq;
this.ext = ext;
}

@JsonProperty
public int getId()
{
return id;
}

@JsonProperty
public int getReq()
{
return req;
}

@JsonProperty
public TitleReq getTitle()
{
return title;
}

@JsonProperty
public ImgReq getImgReq()
{
return imgReq;
}

@JsonProperty
public Video getVideo()
{
return video;
}

@JsonProperty
public DataReq getDataReq()
{
return dataReq;
}

@JsonProperty
public Ext getExt()
{
return ext;
}

public static Builder builder()
{
return new Builder();
}

public static class Builder
{
private int id;
private int req;
private TitleReq title;
private ImgReq imgReq;
private Video video;
private DataReq dataReq;
private Ext ext;

public Builder() {}

public Builder id(final int id)
{
this.id = id;
return this;
}

public Builder req(final int req)
{
this.req = req;
return this;
}

public Builder title(final TitleReq title)
{
this.title = title;
return this;
}

public Builder img(final ImgReq imgReq)
{
this.imgReq = imgReq;
return this;
}

public Builder video(final Video video)
{
this.video = video;
return this;
}

public Builder data(final DataReq dataReq)
{
this.dataReq = dataReq;
return this;
}

public Builder ext(final Ext ext)
{
this.ext = ext;
return this;
}

public AssetObj build()
{
return new AssetObj(
id,
req,
title,
imgReq,
video,
dataReq,
ext
);
}
}

}
Loading