using System.Text.Json.Serialization; using System.Collections.Generic; using Topsdk.Util; namespace Topsdk.Top.Defaultability.Request; public class TaobaoTbkDgMaterialRecommendRequest : AbstractTopApiRequest { /* 页大小,默认20,1~100 默认值:20 */ private long? pageSize; /* 第几页,默认:1 默认值:1 */ private long? pageNo; /* 官方提供的物料Id;可以通过taobao.tbk.optimus.tou.material.ids.get接口获取公开的物料id列表或查看物料id汇总贴:https://market.m.taobao.com/app/qn/toutiao-new/index-pc.html#/detail/10628875?_k=gpov9a */ private long? materialId; /* 推广位id,mm_xxx_xxx_12345678三段式的最后一段数字(登录pub.alimama.com推广管理-推广位管理中查询) */ private long? adzoneId; /* 渠道关系ID,仅适用于渠道推广场景 */ private long? relationId; /* 智能匹配-设备号类型:IMEI,或者IDFA,或者UTDID(UTDID不支持MD5加密),或者OAID;使用智能推荐请先签署协议https://pub.alimama.com/fourth/protocol/common.htm?key=hangye_laxin */ private string? deviceType; /* 智能匹配-设备号加密类型:MD5;使用智能推荐请先签署协议https://pub.alimama.com/fourth/protocol/common.htm?key=hangye_laxin */ private string? deviceEncrypt; /* 智能匹配-设备号加密后的值(MD5加密需32位小写);使用智能推荐请先签署协议https://pub.alimama.com/fourth/protocol/common.htm?key=hangye_laxin */ private string? deviceValue; /* 1-自购省,2-推广赚(代理模式专属ID,代理模式必填,非代理模式不用填写该字段) */ private string? promotionType; /* 会员运营ID */ private string? specialId; /* 淘宝客新商品ID;用于相似商品推荐(注意:使用相似商品推荐material_id=13256必传,并请先签署协议https://pub.alimama.com/fourth/protocol/common.htm?key=hangye_laxin);另关于《淘宝客新商品ID升级》参考白皮书:https://www.yuque.com/taobaolianmengguanfangxiaoer/zmig94/tfyt0pahmlpzu2ud */ private string? itemId; /* 选品库收藏夹id,获取收藏夹id参考文档:https://mos.m.taobao.com/union/page_20230109_175050_176?spm=a219t._portal_v2_pages_promo_goods_index_htm.0.0.7c2a75a5H2ER3N */ private string? favoritesId; [JsonPropertyName("page_size")] public long? PageSize { get => pageSize; set => this.pageSize = value; } [JsonPropertyName("page_no")] public long? PageNo { get => pageNo; set => this.pageNo = value; } [JsonPropertyName("material_id")] public long? MaterialId { get => materialId; set => this.materialId = value; } [JsonPropertyName("adzone_id")] public long? AdzoneId { get => adzoneId; set => this.adzoneId = value; } [JsonPropertyName("relation_id")] public long? RelationId { get => relationId; set => this.relationId = value; } [JsonPropertyName("device_type")] public string? DeviceType { get => deviceType; set => this.deviceType = value; } [JsonPropertyName("device_encrypt")] public string? DeviceEncrypt { get => deviceEncrypt; set => this.deviceEncrypt = value; } [JsonPropertyName("device_value")] public string? DeviceValue { get => deviceValue; set => this.deviceValue = value; } [JsonPropertyName("promotion_type")] public string? PromotionType { get => promotionType; set => this.promotionType = value; } [JsonPropertyName("special_id")] public string? SpecialId { get => specialId; set => this.specialId = value; } [JsonPropertyName("item_id")] public string? ItemId { get => itemId; set => this.itemId = value; } [JsonPropertyName("favorites_id")] public string? FavoritesId { get => favoritesId; set => this.favoritesId = value; } public override IDictionary ToRequestParam() { IDictionary requestParam = new Dictionary(); if(this.pageSize != null) { requestParam.Add("page_size",TopUtils.ConvertBasicType(this.pageSize)); } if(this.pageNo != null) { requestParam.Add("page_no",TopUtils.ConvertBasicType(this.pageNo)); } if(this.materialId != null) { requestParam.Add("material_id",TopUtils.ConvertBasicType(this.materialId)); } if(this.adzoneId != null) { requestParam.Add("adzone_id",TopUtils.ConvertBasicType(this.adzoneId)); } if(this.relationId != null) { requestParam.Add("relation_id",TopUtils.ConvertBasicType(this.relationId)); } if(this.deviceType != null) { requestParam.Add("device_type",TopUtils.ConvertBasicType(this.deviceType)); } if(this.deviceEncrypt != null) { requestParam.Add("device_encrypt",TopUtils.ConvertBasicType(this.deviceEncrypt)); } if(this.deviceValue != null) { requestParam.Add("device_value",TopUtils.ConvertBasicType(this.deviceValue)); } if(this.promotionType != null) { requestParam.Add("promotion_type",TopUtils.ConvertBasicType(this.promotionType)); } if(this.specialId != null) { requestParam.Add("special_id",TopUtils.ConvertBasicType(this.specialId)); } if(this.itemId != null) { requestParam.Add("item_id",TopUtils.ConvertBasicType(this.itemId)); } if(this.favoritesId != null) { requestParam.Add("favorites_id",TopUtils.ConvertBasicType(this.favoritesId)); } return requestParam; } public override IDictionary ToFileParam() { IDictionary fileParam = new Dictionary(); return fileParam; } public override string GetApiCode() { return "taobao.tbk.dg.material.recommend"; } }