using System.Text.Json.Serialization;
using System.Collections.Generic;
using Topsdk.Util;
using Topsdk.Top.Ability370.Domain;

namespace Topsdk.Top.Ability370.Request;

public class TaobaoTbkDgMaterialTemporaryOptionalRequest : AbstractTopApiRequest
{

    /*
        商品筛选(特定媒体支持)-店铺dsr评分。筛选大于等于当前设置的店铺dsr评分的商品0-50000之间
            */
    private long? startDsr;


    /*
        页大小，默认20，1~100
         默认值:20    */
    private long? pageSize;


    /*
        第几页，默认：１
         默认值:1    */
    private long? pageNo;


    /*
        链接形式：1：PC，2：无线，默认：１
         默认值:1    */
    private long? platform;


    /*
        商品筛选-淘客佣金比率上限。如：1234表示12.34%
            */
    private long? endTkRate;


    /*
        商品筛选-淘客佣金比率下限。如：1234表示12.34%
            */
    private long? startTkRate;


    /*
        商品筛选-折扣价范围上限。单位：元
            */
    private long? endPrice;


    /*
        商品筛选-折扣价范围下限。单位：元
            */
    private long? startPrice;


    /*
        商品筛选-是否海外商品。true表示属于海外商品，false或不设置表示不限
            */
    private bool? isOverseas;


    /*
        商品筛选-是否天猫商品。true表示属于天猫商品，false或不设置表示不限
            */
    private bool? isTmall;


    /*
        排序_des（降序），排序_asc（升序），销量（total_sales），淘客佣金比率（tk_rate）， 累计推广量（tk_total_sales），总支出佣金（tk_total_commi），价格（price），匹配分（match）
            */
    private string? sort;


    /*
        商品筛选-所在地
            */
    private string? itemloc;


    /*
        商品筛选-后台类目ID。用,分割，最大10个，该ID可以通过taobao.itemcats.get接口获取到
            */
    private string? cat;


    /*
        商品筛选-查询词
            */
    private string? q;


    /*
        不传时默认物料id=2836；如果直接对消费者投放，可使用官方个性化算法优化的搜索物料id=17004
         默认值:2836    */
    private long? materialId;


    /*
        优惠券筛选-是否有优惠券。true表示该商品有优惠券，false或不设置表示不限
            */
    private bool? hasCoupon;


    /*
        ip参数影响邮费获取，如果不传或者传入不准确，邮费无法精准提供
            */
    private string? ip;


    /*
        mm_xxx_xxx_12345678三段式的最后一段数字
            */
    private long? adzoneId;


    /*
        商品筛选-是否包邮。true表示包邮，false或不设置表示不限
            */
    private bool? needFreeShipment;


    /*
        商品筛选-是否加入消费者保障。true表示加入，false或不设置表示不限
            */
    private bool? needPrepay;


    /*
        商品筛选(特定媒体支持)-成交转化是否高于行业均值。True表示大于等于，false或不设置表示不限
            */
    private bool? includePayRate30;


    /*
        商品筛选-好评率是否高于行业均值。True表示大于等于，false或不设置表示不限
            */
    private bool? includeGoodRate;


    /*
        商品筛选(特定媒体支持)-退款率是否低于行业均值。True表示大于等于，false或不设置表示不限
            */
    private bool? includeRfdRate;


    /*
        商品筛选-牛皮癣程度。取值：1不限，2无，3轻微
         默认值:1    */
    private long? npxLevel;


    /*
        智能匹配-设备号加密类型：MD5
            */
    private string? deviceEncrypt;


    /*
        智能匹配-设备号加密后的值（MD5加密需32位小写）
            */
    private string? deviceValue;


    /*
        智能匹配-设备类型：IMEI/IDFA/UTDID/OAID，（IOS推荐使用IDFA，android等推荐使用OAID）
            */
    private string? deviceType;


    /*
        商品筛选-KA媒体淘客佣金比率上限。如：1234表示12.34%
            */
    private long? endKaTkRate;


    /*
        商品筛选-KA媒体淘客佣金比率下限。如：1234表示12.34%
            */
    private long? startKaTkRate;


    /*
        锁佣结束时间
            */
    private long? lockRateEndTime;


    /*
        锁佣开始时间
            */
    private long? lockRateStartTime;


    /*
        本地化业务入参-LBS信息-经度
            */
    private string? longitude;


    /*
        本地化业务入参-LBS信息-纬度
            */
    private string? latitude;


    /*
        本地化业务入参-LBS信息-国标城市码，仅支持单个请求，请求饿了么卡券物料时，该字段必填。 （详细城市ID见：https://mo.m.taobao.com/page_2020010315120200508）
            */
    private string? cityCode;


    /*
        商家id，仅支持饿了么卡券商家ID，支持批量请求1-100以内，多个商家ID使用英文逗号分隔
            */
    private string? sellerIds;


    /*
        会员运营ID
            */
    private string? specialId;


    /*
        渠道关系ID，仅适用于渠道推广场景
            */
    private string? relationId;


    /*
        本地化业务入参-分页唯一标识，非首页的请求必传，值为上一页返回结果中的page_result_key字段值
            */
    private string? pageResultKey;


    /*
        人群ID，仅适用于物料评估场景material_id=41377
            */
    private long? ucrowdId;


    /*
        物料评估-商品列表
            */
    private IList<TaobaoTbkDgMaterialTemporaryOptionalUcrowdrankitems>? ucrowdRankItems;


    /*
        是否获取前N件佣金信息	0否，1是，其他值否
            */
    private long? getTopnRate;


    [JsonPropertyName("start_dsr")]
    public long? StartDsr
    {
        get => startDsr;
        set => this.startDsr = value;
    }

    [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("platform")]
    public long? Platform
    {
        get => platform;
        set => this.platform = value;
    }

    [JsonPropertyName("end_tk_rate")]
    public long? EndTkRate
    {
        get => endTkRate;
        set => this.endTkRate = value;
    }

    [JsonPropertyName("start_tk_rate")]
    public long? StartTkRate
    {
        get => startTkRate;
        set => this.startTkRate = value;
    }

    [JsonPropertyName("end_price")]
    public long? EndPrice
    {
        get => endPrice;
        set => this.endPrice = value;
    }

    [JsonPropertyName("start_price")]
    public long? StartPrice
    {
        get => startPrice;
        set => this.startPrice = value;
    }

    [JsonPropertyName("is_overseas")]
    public bool? IsOverseas
    {
        get => isOverseas;
        set => this.isOverseas = value;
    }

    [JsonPropertyName("is_tmall")]
    public bool? IsTmall
    {
        get => isTmall;
        set => this.isTmall = value;
    }

    [JsonPropertyName("sort")]
    public string? Sort
    {
        get => sort;
        set => this.sort = value;
    }

    [JsonPropertyName("itemloc")]
    public string? Itemloc
    {
        get => itemloc;
        set => this.itemloc = value;
    }

    [JsonPropertyName("cat")]
    public string? Cat
    {
        get => cat;
        set => this.cat = value;
    }

    [JsonPropertyName("q")]
    public string? Q
    {
        get => q;
        set => this.q = value;
    }

    [JsonPropertyName("material_id")]
    public long? MaterialId
    {
        get => materialId;
        set => this.materialId = value;
    }

    [JsonPropertyName("has_coupon")]
    public bool? HasCoupon
    {
        get => hasCoupon;
        set => this.hasCoupon = value;
    }

    [JsonPropertyName("ip")]
    public string? Ip
    {
        get => ip;
        set => this.ip = value;
    }

    [JsonPropertyName("adzone_id")]
    public long? AdzoneId
    {
        get => adzoneId;
        set => this.adzoneId = value;
    }

    [JsonPropertyName("need_free_shipment")]
    public bool? NeedFreeShipment
    {
        get => needFreeShipment;
        set => this.needFreeShipment = value;
    }

    [JsonPropertyName("need_prepay")]
    public bool? NeedPrepay
    {
        get => needPrepay;
        set => this.needPrepay = value;
    }

    [JsonPropertyName("include_pay_rate_30")]
    public bool? IncludePayRate30
    {
        get => includePayRate30;
        set => this.includePayRate30 = value;
    }

    [JsonPropertyName("include_good_rate")]
    public bool? IncludeGoodRate
    {
        get => includeGoodRate;
        set => this.includeGoodRate = value;
    }

    [JsonPropertyName("include_rfd_rate")]
    public bool? IncludeRfdRate
    {
        get => includeRfdRate;
        set => this.includeRfdRate = value;
    }

    [JsonPropertyName("npx_level")]
    public long? NpxLevel
    {
        get => npxLevel;
        set => this.npxLevel = 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("device_type")]
    public string? DeviceType
    {
        get => deviceType;
        set => this.deviceType = value;
    }

    [JsonPropertyName("end_ka_tk_rate")]
    public long? EndKaTkRate
    {
        get => endKaTkRate;
        set => this.endKaTkRate = value;
    }

    [JsonPropertyName("start_ka_tk_rate")]
    public long? StartKaTkRate
    {
        get => startKaTkRate;
        set => this.startKaTkRate = value;
    }

    [JsonPropertyName("lock_rate_end_time")]
    public long? LockRateEndTime
    {
        get => lockRateEndTime;
        set => this.lockRateEndTime = value;
    }

    [JsonPropertyName("lock_rate_start_time")]
    public long? LockRateStartTime
    {
        get => lockRateStartTime;
        set => this.lockRateStartTime = value;
    }

    [JsonPropertyName("longitude")]
    public string? Longitude
    {
        get => longitude;
        set => this.longitude = value;
    }

    [JsonPropertyName("latitude")]
    public string? Latitude
    {
        get => latitude;
        set => this.latitude = value;
    }

    [JsonPropertyName("city_code")]
    public string? CityCode
    {
        get => cityCode;
        set => this.cityCode = value;
    }

    [JsonPropertyName("seller_ids")]
    public string? SellerIds
    {
        get => sellerIds;
        set => this.sellerIds = value;
    }

    [JsonPropertyName("special_id")]
    public string? SpecialId
    {
        get => specialId;
        set => this.specialId = value;
    }

    [JsonPropertyName("relation_id")]
    public string? RelationId
    {
        get => relationId;
        set => this.relationId = value;
    }

    [JsonPropertyName("page_result_key")]
    public string? PageResultKey
    {
        get => pageResultKey;
        set => this.pageResultKey = value;
    }

    [JsonPropertyName("ucrowd_id")]
    public long? UcrowdId
    {
        get => ucrowdId;
        set => this.ucrowdId = value;
    }

    [JsonPropertyName("ucrowd_rank_items")]
    public IList<TaobaoTbkDgMaterialTemporaryOptionalUcrowdrankitems>? UcrowdRankItems
    {
        get => ucrowdRankItems;
        set => this.ucrowdRankItems = value;
    }

    [JsonPropertyName("get_topn_rate")]
    public long? GetTopnRate
    {
        get => getTopnRate;
        set => this.getTopnRate = value;
    }



    public override IDictionary<string, string> ToRequestParam()
    {
        IDictionary<string, string> requestParam = new Dictionary<string, string>();
        if(this.startDsr != null)
        {
            requestParam.Add("start_dsr",TopUtils.ConvertBasicType(this.startDsr));
        }
        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.platform != null)
        {
            requestParam.Add("platform",TopUtils.ConvertBasicType(this.platform));
        }
        if(this.endTkRate != null)
        {
            requestParam.Add("end_tk_rate",TopUtils.ConvertBasicType(this.endTkRate));
        }
        if(this.startTkRate != null)
        {
            requestParam.Add("start_tk_rate",TopUtils.ConvertBasicType(this.startTkRate));
        }
        if(this.endPrice != null)
        {
            requestParam.Add("end_price",TopUtils.ConvertBasicType(this.endPrice));
        }
        if(this.startPrice != null)
        {
            requestParam.Add("start_price",TopUtils.ConvertBasicType(this.startPrice));
        }
        if(this.isOverseas != null)
        {
            requestParam.Add("is_overseas",TopUtils.ConvertBasicType(this.isOverseas));
        }
        if(this.isTmall != null)
        {
            requestParam.Add("is_tmall",TopUtils.ConvertBasicType(this.isTmall));
        }
        if(this.sort != null)
        {
            requestParam.Add("sort",TopUtils.ConvertBasicType(this.sort));
        }
        if(this.itemloc != null)
        {
            requestParam.Add("itemloc",TopUtils.ConvertBasicType(this.itemloc));
        }
        if(this.cat != null)
        {
            requestParam.Add("cat",TopUtils.ConvertBasicType(this.cat));
        }
        if(this.q != null)
        {
            requestParam.Add("q",TopUtils.ConvertBasicType(this.q));
        }
        if(this.materialId != null)
        {
            requestParam.Add("material_id",TopUtils.ConvertBasicType(this.materialId));
        }
        if(this.hasCoupon != null)
        {
            requestParam.Add("has_coupon",TopUtils.ConvertBasicType(this.hasCoupon));
        }
        if(this.ip != null)
        {
            requestParam.Add("ip",TopUtils.ConvertBasicType(this.ip));
        }
        if(this.adzoneId != null)
        {
            requestParam.Add("adzone_id",TopUtils.ConvertBasicType(this.adzoneId));
        }
        if(this.needFreeShipment != null)
        {
            requestParam.Add("need_free_shipment",TopUtils.ConvertBasicType(this.needFreeShipment));
        }
        if(this.needPrepay != null)
        {
            requestParam.Add("need_prepay",TopUtils.ConvertBasicType(this.needPrepay));
        }
        if(this.includePayRate30 != null)
        {
            requestParam.Add("include_pay_rate_30",TopUtils.ConvertBasicType(this.includePayRate30));
        }
        if(this.includeGoodRate != null)
        {
            requestParam.Add("include_good_rate",TopUtils.ConvertBasicType(this.includeGoodRate));
        }
        if(this.includeRfdRate != null)
        {
            requestParam.Add("include_rfd_rate",TopUtils.ConvertBasicType(this.includeRfdRate));
        }
        if(this.npxLevel != null)
        {
            requestParam.Add("npx_level",TopUtils.ConvertBasicType(this.npxLevel));
        }
        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.deviceType != null)
        {
            requestParam.Add("device_type",TopUtils.ConvertBasicType(this.deviceType));
        }
        if(this.endKaTkRate != null)
        {
            requestParam.Add("end_ka_tk_rate",TopUtils.ConvertBasicType(this.endKaTkRate));
        }
        if(this.startKaTkRate != null)
        {
            requestParam.Add("start_ka_tk_rate",TopUtils.ConvertBasicType(this.startKaTkRate));
        }
        if(this.lockRateEndTime != null)
        {
            requestParam.Add("lock_rate_end_time",TopUtils.ConvertBasicType(this.lockRateEndTime));
        }
        if(this.lockRateStartTime != null)
        {
            requestParam.Add("lock_rate_start_time",TopUtils.ConvertBasicType(this.lockRateStartTime));
        }
        if(this.longitude != null)
        {
            requestParam.Add("longitude",TopUtils.ConvertBasicType(this.longitude));
        }
        if(this.latitude != null)
        {
            requestParam.Add("latitude",TopUtils.ConvertBasicType(this.latitude));
        }
        if(this.cityCode != null)
        {
            requestParam.Add("city_code",TopUtils.ConvertBasicType(this.cityCode));
        }
        if(this.sellerIds != null)
        {
            requestParam.Add("seller_ids",TopUtils.ConvertBasicType(this.sellerIds));
        }
        if(this.specialId != null)
        {
            requestParam.Add("special_id",TopUtils.ConvertBasicType(this.specialId));
        }
        if(this.relationId != null)
        {
            requestParam.Add("relation_id",TopUtils.ConvertBasicType(this.relationId));
        }
        if(this.pageResultKey != null)
        {
            requestParam.Add("page_result_key",TopUtils.ConvertBasicType(this.pageResultKey));
        }
        if(this.ucrowdId != null)
        {
            requestParam.Add("ucrowd_id",TopUtils.ConvertBasicType(this.ucrowdId));
        }
        if(this.ucrowdRankItems != null)
        {
            requestParam.Add("ucrowd_rank_items",TopUtils.ConvertStructList(this.ucrowdRankItems));
        }
        if(this.getTopnRate != null)
        {
            requestParam.Add("get_topn_rate",TopUtils.ConvertBasicType(this.getTopnRate));
        }
        return requestParam;
    }

    public override IDictionary<string, TopFileItem> ToFileParam()
    {
        IDictionary<string, TopFileItem> fileParam = new Dictionary<string, TopFileItem>();
        return fileParam;
    }

    public override string GetApiCode()
    {
        return "taobao.tbk.dg.material.temporary.optional";
    }

}

