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

com.pdd.pop.sdk.http.api.pop.request.PddAdApiUnitCreateRequest Maven / Gradle / Ivy

There is a newer version: 1.10.85
Show newest version
package com.pdd.pop.sdk.http.api.pop.request;

import com.pdd.pop.sdk.common.util.JsonUtil;
import com.pdd.pop.ext.fasterxml.jackson.annotation.JsonProperty;
import com.pdd.pop.sdk.http.api.pop.response.PddAdApiUnitCreateResponse;
import com.pdd.pop.sdk.http.HttpMethod;
import com.pdd.pop.sdk.http.PopBaseHttpRequest;

import java.util.List;
import java.util.Map;

public class PddAdApiUnitCreateRequest extends PopBaseHttpRequest {

    /**
     * 单元创建信息
     */
    @JsonProperty("adUnitCreateComplexMessage")
    private AdUnitCreateComplexMessage adUnitCreateComplexMessage;

    /**
     * 广告计划Id
     */
    @JsonProperty("planId")
    private Long planId;

    /**
     * 场景类型。0表示搜索,2表示展示。
     */
    @JsonProperty("scenesType")
    private Integer scenesType;

    @Override
    public String getVersion() {
        return "V1";
    }

    @Override
    public String getDataType() {
        return "JSON";
    }

    @Override
    public Integer getPlatform() {
        return 0;
    }

    @Override
    public String getType() {
        return "pdd.ad.api.unit.create";
    }

    @Override
    public HttpMethod getHttpMethod() {
        return HttpMethod.POST;
    }

    @Override
    public Class getResponseClass() {
        return PddAdApiUnitCreateResponse.class;
    }

    @Override
    protected void setUserParams(Map params) {
        setUserParam(params, "adUnitCreateComplexMessage", adUnitCreateComplexMessage);
        setUserParam(params, "planId", planId);
        setUserParam(params, "scenesType", scenesType);
    }

    public void setAdUnitCreateComplexMessage(AdUnitCreateComplexMessage adUnitCreateComplexMessage) {
        this.adUnitCreateComplexMessage = adUnitCreateComplexMessage;
    }

    public void setPlanId(Long planId) {
        this.planId = planId;
    }

    public void setScenesType(Integer scenesType) {
        this.scenesType = scenesType;
    }

    public static class AdUnitCreateComplexMessage {

        /**
         * 创意创建信息列表
         */
        @JsonProperty("adCreativeCreateMessagesList")
        private List adCreativeCreateMessagesList;

        /**
         * 关键词创建列表
         */
        @JsonProperty("adKeywordCreateMessageList")
        private List adKeywordCreateMessageList;

        /**
         * 智能词包相关信息
         */
        @JsonProperty("adKeywordSetMessage")
        private AdUnitCreateComplexMessageAdKeywordSetMessage adKeywordSetMessage;

        /**
         * 商品创建信息
         */
        @JsonProperty("adProductCreateMessage")
        private AdUnitCreateComplexMessageAdProductCreateMessage adProductCreateMessage;

        /**
         * 单元创建信息
         */
        @JsonProperty("adUnitCreateMessage")
        private AdUnitCreateComplexMessageAdUnitCreateMessage adUnitCreateMessage;

        /**
         * 人群定向创建信息列表
         */
        @JsonProperty("audienceBidCreateMessageList")
        private List audienceBidCreateMessageList;

        /**
         * 资源位定向创建信息列表。仅支持展示广告。
         */
        @JsonProperty("locationBidCreateMessageList")
        private List locationBidCreateMessageList;

        /**
         * 智能创意创建信息
         */
        @JsonProperty("smartCreativeCreateMessage")
        private AdUnitCreateComplexMessageSmartCreativeCreateMessage smartCreativeCreateMessage;

        public void setAdCreativeCreateMessagesList(List adCreativeCreateMessagesList) {
            this.adCreativeCreateMessagesList = adCreativeCreateMessagesList;
        }

        public void setAdKeywordCreateMessageList(List adKeywordCreateMessageList) {
            this.adKeywordCreateMessageList = adKeywordCreateMessageList;
        }

        public void setAdKeywordSetMessage(AdUnitCreateComplexMessageAdKeywordSetMessage adKeywordSetMessage) {
            this.adKeywordSetMessage = adKeywordSetMessage;
        }

        public void setAdProductCreateMessage(AdUnitCreateComplexMessageAdProductCreateMessage adProductCreateMessage) {
            this.adProductCreateMessage = adProductCreateMessage;
        }

        public void setAdUnitCreateMessage(AdUnitCreateComplexMessageAdUnitCreateMessage adUnitCreateMessage) {
            this.adUnitCreateMessage = adUnitCreateMessage;
        }

        public void setAudienceBidCreateMessageList(List audienceBidCreateMessageList) {
            this.audienceBidCreateMessageList = audienceBidCreateMessageList;
        }

        public void setLocationBidCreateMessageList(List locationBidCreateMessageList) {
            this.locationBidCreateMessageList = locationBidCreateMessageList;
        }

        public void setSmartCreativeCreateMessage(AdUnitCreateComplexMessageSmartCreativeCreateMessage smartCreativeCreateMessage) {
            this.smartCreativeCreateMessage = smartCreativeCreateMessage;
        }

        @Override
        public String toString() {
            return JsonUtil.transferToJson(this);
        }
    }

    public static class AdUnitCreateComplexMessageAdCreativeCreateMessagesListItem {

        /**
         * 创意图片列表
         */
        @JsonProperty("adImageVOList")
        private List adImageVOList;

        /**
         * 创意标题列表
         */
        @JsonProperty("adTextVOList")
        private List adTextVOList;

        /**
         * 创意规格,6:商品轮播图,7:商品长图,其余规格暂不支持
         */
        @JsonProperty("creativeSpecificationId")
        private Long creativeSpecificationId;

        public void setAdImageVOList(List adImageVOList) {
            this.adImageVOList = adImageVOList;
        }

        public void setAdTextVOList(List adTextVOList) {
            this.adTextVOList = adTextVOList;
        }

        public void setCreativeSpecificationId(Long creativeSpecificationId) {
            this.creativeSpecificationId = creativeSpecificationId;
        }

        @Override
        public String toString() {
            return JsonUtil.transferToJson(this);
        }
    }

    public static class AdUnitCreateComplexMessageAdCreativeCreateMessagesListItemAdImageVOListItem {

        /**
         * 图片链接,可用图片参考以下接口返回:pdd.ad.api.goods.query.gallery.images(轮播图),pdd.ad.api.goods.query.long.images(长图)
         */
        @JsonProperty("imageUrl")
        private String imageUrl;

        public void setImageUrl(String imageUrl) {
            this.imageUrl = imageUrl;
        }

        @Override
        public String toString() {
            return JsonUtil.transferToJson(this);
        }
    }

    public static class AdUnitCreateComplexMessageAdCreativeCreateMessagesListItemAdTextVOListItem {

        /**
         * 标题
         */
        @JsonProperty("text")
        private String text;

        public void setText(String text) {
            this.text = text;
        }

        @Override
        public String toString() {
            return JsonUtil.transferToJson(this);
        }
    }

    public static class AdUnitCreateComplexMessageAdKeywordCreateMessageListItem {

        /**
         * 关键词出价
         */
        @JsonProperty("bid")
        private Long bid;

        /**
         * 关键词溢价比例。万分比
         */
        @JsonProperty("premiumRate")
        private Long premiumRate;

        /**
         * 关键词
         */
        @JsonProperty("word")
        private String word;

        public void setBid(Long bid) {
            this.bid = bid;
        }

        public void setPremiumRate(Long premiumRate) {
            this.premiumRate = premiumRate;
        }

        public void setWord(String word) {
            this.word = word;
        }

        @Override
        public String toString() {
            return JsonUtil.transferToJson(this);
        }
    }

    public static class AdUnitCreateComplexMessageAdKeywordSetMessage {

        /**
         * 词包出价。出价需在[0.10, 99.00]之间。
         */
        @JsonProperty("keywordSetBid")
        private Long keywordSetBid;

        /**
         * 优化目标。1表示优化ROI,2表示优化订单量。
         */
        @JsonProperty("performanceGoal")
        private Integer performanceGoal;

        public void setKeywordSetBid(Long keywordSetBid) {
            this.keywordSetBid = keywordSetBid;
        }

        public void setPerformanceGoal(Integer performanceGoal) {
            this.performanceGoal = performanceGoal;
        }

        @Override
        public String toString() {
            return JsonUtil.transferToJson(this);
        }
    }

    public static class AdUnitCreateComplexMessageAdProductCreateMessage {

        /**
         * 商品Id
         */
        @JsonProperty("goodsId")
        private Long goodsId;

        public void setGoodsId(Long goodsId) {
            this.goodsId = goodsId;
        }

        @Override
        public String toString() {
            return JsonUtil.transferToJson(this);
        }
    }

    public static class AdUnitCreateComplexMessageAdUnitCreateMessage {

        /**
         * 推广单元名称
         */
        @JsonProperty("adName")
        private String adName;

        /**
         * 基础出价。单位厘。
         */
        @JsonProperty("bid")
        private Long bid;

        /**
         * 智能优化广告相关。当单元使用自定义推广时,不要使用该字段。
         */
        @JsonProperty("optimizationMessage")
        private AdUnitCreateComplexMessageAdUnitCreateMessageOptimizationMessage optimizationMessage;

        public void setAdName(String adName) {
            this.adName = adName;
        }

        public void setBid(Long bid) {
            this.bid = bid;
        }

        public void setOptimizationMessage(AdUnitCreateComplexMessageAdUnitCreateMessageOptimizationMessage optimizationMessage) {
            this.optimizationMessage = optimizationMessage;
        }

        @Override
        public String toString() {
            return JsonUtil.transferToJson(this);
        }
    }

    public static class AdUnitCreateComplexMessageAdUnitCreateMessageOptimizationMessage {

        /**
         * 数据积累期出价。当使用OCPC时对该字段赋值。
         */
        @JsonProperty("accumulationBid")
        private Long accumulationBid;

        /**
         * 智能投放期出价。当使用OCPC时对该字段赋值。
         */
        @JsonProperty("optimizationBid")
        private Long optimizationBid;

        /**
         * 优化目标。0表示不优化。1表示优化ROI,2表示优化转化成本.自定义单元时,该值必传0;当单元使用展示自动调价功能(ECPC)时,该值必须传1;当单元使用展示OCPC功能(plan_strategy=3)时,该值必须传2。目前ECPC及OCPC仅支持展示广告。
         */
        @JsonProperty("optimizationGoal")
        private Integer optimizationGoal;

        /**
         * 优化方式。0表示不优化,1表示ECPC,2表示OCPC。当单元使用ECPC时,该值必须传1;当使用OCPC时,该值必须传2。目前ECPC及OCPC仅支持展示广告。
         */
        @JsonProperty("optimizationMethod")
        private Integer optimizationMethod;

        public void setAccumulationBid(Long accumulationBid) {
            this.accumulationBid = accumulationBid;
        }

        public void setOptimizationBid(Long optimizationBid) {
            this.optimizationBid = optimizationBid;
        }

        public void setOptimizationGoal(Integer optimizationGoal) {
            this.optimizationGoal = optimizationGoal;
        }

        public void setOptimizationMethod(Integer optimizationMethod) {
            this.optimizationMethod = optimizationMethod;
        }

        @Override
        public String toString() {
            return JsonUtil.transferToJson(this);
        }
    }

    public static class AdUnitCreateComplexMessageAudienceBidCreateMessageListItem {

        /**
         * 定向创建信息
         */
        @JsonProperty("adTargetingCreateMessage")
        private AdUnitCreateComplexMessageAudienceBidCreateMessageListItemAdTargetingCreateMessage adTargetingCreateMessage;

        /**
         * 人群定向类型,可用枚举值,参考接口:pdd.ad.api.unit.bid.query.base.target.profile
         */
        @JsonProperty("bidReferenceId")
        private Long bidReferenceId;

        /**
         * 出价,万分比
         */
        @JsonProperty("bidValue")
        private Long bidValue;

        /**
         * 人群定向二级Id。当人群定向为展示场景下的兴趣点或人群包时,该字段必须赋值且值不得为0。兴趣点可取值参考接口:pdd.ad.api.unit.bid.query.interest.profile。人群包可用值参考接口:pdd.ad.api.unit.bid.query.audience.profile
         */
        @JsonProperty("subBidReferenceId")
        private Long subBidReferenceId;

        public void setAdTargetingCreateMessage(AdUnitCreateComplexMessageAudienceBidCreateMessageListItemAdTargetingCreateMessage adTargetingCreateMessage) {
            this.adTargetingCreateMessage = adTargetingCreateMessage;
        }

        public void setBidReferenceId(Long bidReferenceId) {
            this.bidReferenceId = bidReferenceId;
        }

        public void setBidValue(Long bidValue) {
            this.bidValue = bidValue;
        }

        public void setSubBidReferenceId(Long subBidReferenceId) {
            this.subBidReferenceId = subBidReferenceId;
        }

        @Override
        public String toString() {
            return JsonUtil.transferToJson(this);
        }
    }

    public static class AdUnitCreateComplexMessageAudienceBidCreateMessageListItemAdTargetingCreateMessage {

        /**
         * 定向集合
         */
        @JsonProperty("adTargetingSet")
        private AdUnitCreateComplexMessageAudienceBidCreateMessageListItemAdTargetingCreateMessageAdTargetingSet adTargetingSet;

        /**
         * 定向名称
         */
        @JsonProperty("targetingName")
        private String targetingName;

        public void setAdTargetingSet(AdUnitCreateComplexMessageAudienceBidCreateMessageListItemAdTargetingCreateMessageAdTargetingSet adTargetingSet) {
            this.adTargetingSet = adTargetingSet;
        }

        public void setTargetingName(String targetingName) {
            this.targetingName = targetingName;
        }

        @Override
        public String toString() {
            return JsonUtil.transferToJson(this);
        }
    }

    public static class AdUnitCreateComplexMessageAudienceBidCreateMessageListItemAdTargetingCreateMessageAdTargetingSet {

        /**
         * 地域定向
         */
        @JsonProperty("areaStruct")
        private AdUnitCreateComplexMessageAudienceBidCreateMessageListItemAdTargetingCreateMessageAdTargetingSetAreaStruct areaStruct;

        public void setAreaStruct(AdUnitCreateComplexMessageAudienceBidCreateMessageListItemAdTargetingCreateMessageAdTargetingSetAreaStruct areaStruct) {
            this.areaStruct = areaStruct;
        }

        @Override
        public String toString() {
            return JsonUtil.transferToJson(this);
        }
    }

    public static class AdUnitCreateComplexMessageAudienceBidCreateMessageListItemAdTargetingCreateMessageAdTargetingSetAreaStruct {

        /**
         * 地域Id列表。具体地域Id编码参见接口返回:pdd.ad.api.unit.bid.query.targeting.tag.list
         */
        @JsonProperty("areaIds")
        private List areaIds;

        public void setAreaIds(List areaIds) {
            this.areaIds = areaIds;
        }

        @Override
        public String toString() {
            return JsonUtil.transferToJson(this);
        }
    }

    public static class AdUnitCreateComplexMessageLocationBidCreateMessageListItem {

        /**
         * 资源位定向类型。可取值参考接口:pdd.ad.api.unit.bid.query.available.location
         */
        @JsonProperty("bidReferenceId")
        private Long bidReferenceId;

        /**
         * 出价,万分比
         */
        @JsonProperty("bidValue")
        private Long bidValue;

        public void setBidReferenceId(Long bidReferenceId) {
            this.bidReferenceId = bidReferenceId;
        }

        public void setBidValue(Long bidValue) {
            this.bidValue = bidValue;
        }

        @Override
        public String toString() {
            return JsonUtil.transferToJson(this);
        }
    }

    public static class AdUnitCreateComplexMessageSmartCreativeCreateMessage {

        /**
         * 智能创意流量分配比例
         */
        @JsonProperty("creativeFlowRate")
        private Integer creativeFlowRate;

        /**
         * 是否启用智能创意标识
         */
        @JsonProperty("enableSmartCreative")
        private Integer enableSmartCreative;

        /**
         * 智能创意标题
         */
        @JsonProperty("smartCreativeTitle")
        private String smartCreativeTitle;

        public void setCreativeFlowRate(Integer creativeFlowRate) {
            this.creativeFlowRate = creativeFlowRate;
        }

        public void setEnableSmartCreative(Integer enableSmartCreative) {
            this.enableSmartCreative = enableSmartCreative;
        }

        public void setSmartCreativeTitle(String smartCreativeTitle) {
            this.smartCreativeTitle = smartCreativeTitle;
        }

        @Override
        public String toString() {
            return JsonUtil.transferToJson(this);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy