// Copyright 2021 Tencent Inc. All rights reserved. // // 微信支付营销系统开放API // // 新增立减金api // // API version: 3.4.0 // Code generated by WechatPay APIv3 Generator based on [OpenAPI Generator](https://openapi-generator.tech); DO NOT EDIT. package cashcoupons import ( "encoding/json" "fmt" ) // AvailableMerchantCollection type AvailableMerchantCollection struct { // 可用商户总数量 TotalCount *int64 `json:"total_count"` // 可用商户列表 Data []string `json:"data,omitempty"` // 分页页码 Offset *int64 `json:"offset"` // 分页大小 Limit *int64 `json:"limit"` // 批次号 StockId *string `json:"stock_id"` } func (o AvailableMerchantCollection) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.TotalCount == nil { return nil, fmt.Errorf("field `TotalCount` is required and must be specified in AvailableMerchantCollection") } toSerialize["total_count"] = o.TotalCount if o.Data != nil { toSerialize["data"] = o.Data } if o.Offset == nil { return nil, fmt.Errorf("field `Offset` is required and must be specified in AvailableMerchantCollection") } toSerialize["offset"] = o.Offset if o.Limit == nil { return nil, fmt.Errorf("field `Limit` is required and must be specified in AvailableMerchantCollection") } toSerialize["limit"] = o.Limit if o.StockId == nil { return nil, fmt.Errorf("field `StockId` is required and must be specified in AvailableMerchantCollection") } toSerialize["stock_id"] = o.StockId return json.Marshal(toSerialize) } func (o AvailableMerchantCollection) String() string { var ret string if o.TotalCount == nil { ret += "TotalCount:, " } else { ret += fmt.Sprintf("TotalCount:%v, ", *o.TotalCount) } ret += fmt.Sprintf("Data:%v, ", o.Data) if o.Offset == nil { ret += "Offset:, " } else { ret += fmt.Sprintf("Offset:%v, ", *o.Offset) } if o.Limit == nil { ret += "Limit:, " } else { ret += fmt.Sprintf("Limit:%v, ", *o.Limit) } if o.StockId == nil { ret += "StockId:" } else { ret += fmt.Sprintf("StockId:%v", *o.StockId) } return fmt.Sprintf("AvailableMerchantCollection{%s}", ret) } func (o AvailableMerchantCollection) Clone() *AvailableMerchantCollection { ret := AvailableMerchantCollection{} if o.TotalCount != nil { ret.TotalCount = new(int64) *ret.TotalCount = *o.TotalCount } if o.Data != nil { ret.Data = make([]string, len(o.Data)) for i, item := range o.Data { ret.Data[i] = item } } if o.Offset != nil { ret.Offset = new(int64) *ret.Offset = *o.Offset } if o.Limit != nil { ret.Limit = new(int64) *ret.Limit = *o.Limit } if o.StockId != nil { ret.StockId = new(string) *ret.StockId = *o.StockId } return &ret } // AvailableSingleitemCollection type AvailableSingleitemCollection struct { // 可用单品编码总数 TotalCount *int64 `json:"total_count"` // 可用单品编码 Data []string `json:"data,omitempty"` // 分页页码 Offset *int64 `json:"offset"` // 分页大小 Limit *int64 `json:"limit"` // 批次号 StockId *string `json:"stock_id"` } func (o AvailableSingleitemCollection) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.TotalCount == nil { return nil, fmt.Errorf("field `TotalCount` is required and must be specified in AvailableSingleitemCollection") } toSerialize["total_count"] = o.TotalCount if o.Data != nil { toSerialize["data"] = o.Data } if o.Offset == nil { return nil, fmt.Errorf("field `Offset` is required and must be specified in AvailableSingleitemCollection") } toSerialize["offset"] = o.Offset if o.Limit == nil { return nil, fmt.Errorf("field `Limit` is required and must be specified in AvailableSingleitemCollection") } toSerialize["limit"] = o.Limit if o.StockId == nil { return nil, fmt.Errorf("field `StockId` is required and must be specified in AvailableSingleitemCollection") } toSerialize["stock_id"] = o.StockId return json.Marshal(toSerialize) } func (o AvailableSingleitemCollection) String() string { var ret string if o.TotalCount == nil { ret += "TotalCount:, " } else { ret += fmt.Sprintf("TotalCount:%v, ", *o.TotalCount) } ret += fmt.Sprintf("Data:%v, ", o.Data) if o.Offset == nil { ret += "Offset:, " } else { ret += fmt.Sprintf("Offset:%v, ", *o.Offset) } if o.Limit == nil { ret += "Limit:, " } else { ret += fmt.Sprintf("Limit:%v, ", *o.Limit) } if o.StockId == nil { ret += "StockId:" } else { ret += fmt.Sprintf("StockId:%v", *o.StockId) } return fmt.Sprintf("AvailableSingleitemCollection{%s}", ret) } func (o AvailableSingleitemCollection) Clone() *AvailableSingleitemCollection { ret := AvailableSingleitemCollection{} if o.TotalCount != nil { ret.TotalCount = new(int64) *ret.TotalCount = *o.TotalCount } if o.Data != nil { ret.Data = make([]string, len(o.Data)) for i, item := range o.Data { ret.Data[i] = item } } if o.Offset != nil { ret.Offset = new(int64) *ret.Offset = *o.Offset } if o.Limit != nil { ret.Limit = new(int64) *ret.Limit = *o.Limit } if o.StockId != nil { ret.StockId = new(string) *ret.StockId = *o.StockId } return &ret } // BackgroundColor type BackgroundColor string func (e BackgroundColor) Ptr() *BackgroundColor { return &e } // Enums of BackgroundColor const ( BACKGROUNDCOLOR_COLOR010 BackgroundColor = "COLOR010" BACKGROUNDCOLOR_COLOR020 BackgroundColor = "COLOR020" BACKGROUNDCOLOR_COLOR030 BackgroundColor = "COLOR030" BACKGROUNDCOLOR_COLOR040 BackgroundColor = "COLOR040" BACKGROUNDCOLOR_COLOR050 BackgroundColor = "COLOR050" BACKGROUNDCOLOR_COLOR060 BackgroundColor = "COLOR060" BACKGROUNDCOLOR_COLOR070 BackgroundColor = "COLOR070" BACKGROUNDCOLOR_COLOR080 BackgroundColor = "COLOR080" BACKGROUNDCOLOR_COLOR081 BackgroundColor = "COLOR081" BACKGROUNDCOLOR_COLOR082 BackgroundColor = "COLOR082" BACKGROUNDCOLOR_COLOR090 BackgroundColor = "COLOR090" BACKGROUNDCOLOR_COLOR100 BackgroundColor = "COLOR100" BACKGROUNDCOLOR_COLOR101 BackgroundColor = "COLOR101" BACKGROUNDCOLOR_COLOR102 BackgroundColor = "COLOR102" ) // Callback type Callback struct { // 通知地址 NotifyUrl *string `json:"notify_url"` // 商户号 Mchid *string `json:"mchid"` } func (o Callback) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.NotifyUrl == nil { return nil, fmt.Errorf("field `NotifyUrl` is required and must be specified in Callback") } toSerialize["notify_url"] = o.NotifyUrl if o.Mchid == nil { return nil, fmt.Errorf("field `Mchid` is required and must be specified in Callback") } toSerialize["mchid"] = o.Mchid return json.Marshal(toSerialize) } func (o Callback) String() string { var ret string if o.NotifyUrl == nil { ret += "NotifyUrl:, " } else { ret += fmt.Sprintf("NotifyUrl:%v, ", *o.NotifyUrl) } if o.Mchid == nil { ret += "Mchid:" } else { ret += fmt.Sprintf("Mchid:%v", *o.Mchid) } return fmt.Sprintf("Callback{%s}", ret) } func (o Callback) Clone() *Callback { ret := Callback{} if o.NotifyUrl != nil { ret.NotifyUrl = new(string) *ret.NotifyUrl = *o.NotifyUrl } if o.Mchid != nil { ret.Mchid = new(string) *ret.Mchid = *o.Mchid } return &ret } // CardLimitation type CardLimitation struct { // 当批次指定支付方式为银行卡且配置了指定银行卡信息,该字段必填,最多4个中文字符。并将在微信支付收银台中展示给用户。 Name *string `json:"name"` // 当批次指定支付方式为银行卡且配置了指定银行卡信息,该字段必填,按json格式。特殊规则:单个卡BIN的字符长度为[6,9],条目个数限制为[1,10] Bin []string `json:"bin"` } func (o CardLimitation) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Name == nil { return nil, fmt.Errorf("field `Name` is required and must be specified in CardLimitation") } toSerialize["name"] = o.Name if o.Bin == nil { return nil, fmt.Errorf("field `Bin` is required and must be specified in CardLimitation") } toSerialize["bin"] = o.Bin return json.Marshal(toSerialize) } func (o CardLimitation) String() string { var ret string if o.Name == nil { ret += "Name:, " } else { ret += fmt.Sprintf("Name:%v, ", *o.Name) } ret += fmt.Sprintf("Bin:%v", o.Bin) return fmt.Sprintf("CardLimitation{%s}", ret) } func (o CardLimitation) Clone() *CardLimitation { ret := CardLimitation{} if o.Name != nil { ret.Name = new(string) *ret.Name = *o.Name } if o.Bin != nil { ret.Bin = make([]string, len(o.Bin)) for i, item := range o.Bin { ret.Bin[i] = item } } return &ret } // Coupon type Coupon struct { // 微信为创建方商户分配的商户号 StockCreatorMchid *string `json:"stock_creator_mchid"` // 批次id StockId *string `json:"stock_id"` // 单品优惠特定信息 CutToMessage *CutTypeMsg `json:"cut_to_message,omitempty"` // 代金券名称 CouponName *string `json:"coupon_name"` // 代金券状态:SENDED-可用,USED-已实扣,EXPIRED-已过期 Status *string `json:"status"` // 代金券描述说明字段 Description *string `json:"description"` // 领券时间 CreateTime *string `json:"create_time"` // NORMAL-满减券;CUT_TO-减至券 CouponType *string `json:"coupon_type"` // true-是;false-否 NoCash *bool `json:"no_cash"` // 可用开始时间 AvailableBeginTime *string `json:"available_begin_time"` // 可用结束时间 AvailableEndTime *string `json:"available_end_time"` // TRUE-是;FALSE-否 Singleitem *bool `json:"singleitem"` // 普通满减券面额、门槛信息 NormalCouponInformation *FixedValueStockMsg `json:"normal_coupon_information,omitempty"` } func (o Coupon) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.StockCreatorMchid == nil { return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in Coupon") } toSerialize["stock_creator_mchid"] = o.StockCreatorMchid if o.StockId == nil { return nil, fmt.Errorf("field `StockId` is required and must be specified in Coupon") } toSerialize["stock_id"] = o.StockId if o.CutToMessage != nil { toSerialize["cut_to_message"] = o.CutToMessage } if o.CouponName == nil { return nil, fmt.Errorf("field `CouponName` is required and must be specified in Coupon") } toSerialize["coupon_name"] = o.CouponName if o.Status == nil { return nil, fmt.Errorf("field `Status` is required and must be specified in Coupon") } toSerialize["status"] = o.Status if o.Description == nil { return nil, fmt.Errorf("field `Description` is required and must be specified in Coupon") } toSerialize["description"] = o.Description if o.CreateTime == nil { return nil, fmt.Errorf("field `CreateTime` is required and must be specified in Coupon") } toSerialize["create_time"] = o.CreateTime if o.CouponType == nil { return nil, fmt.Errorf("field `CouponType` is required and must be specified in Coupon") } toSerialize["coupon_type"] = o.CouponType if o.NoCash == nil { return nil, fmt.Errorf("field `NoCash` is required and must be specified in Coupon") } toSerialize["no_cash"] = o.NoCash if o.AvailableBeginTime == nil { return nil, fmt.Errorf("field `AvailableBeginTime` is required and must be specified in Coupon") } toSerialize["available_begin_time"] = o.AvailableBeginTime if o.AvailableEndTime == nil { return nil, fmt.Errorf("field `AvailableEndTime` is required and must be specified in Coupon") } toSerialize["available_end_time"] = o.AvailableEndTime if o.Singleitem == nil { return nil, fmt.Errorf("field `Singleitem` is required and must be specified in Coupon") } toSerialize["singleitem"] = o.Singleitem if o.NormalCouponInformation != nil { toSerialize["normal_coupon_information"] = o.NormalCouponInformation } return json.Marshal(toSerialize) } func (o Coupon) String() string { var ret string if o.StockCreatorMchid == nil { ret += "StockCreatorMchid:, " } else { ret += fmt.Sprintf("StockCreatorMchid:%v, ", *o.StockCreatorMchid) } if o.StockId == nil { ret += "StockId:, " } else { ret += fmt.Sprintf("StockId:%v, ", *o.StockId) } ret += fmt.Sprintf("CutToMessage:%v, ", o.CutToMessage) if o.CouponName == nil { ret += "CouponName:, " } else { ret += fmt.Sprintf("CouponName:%v, ", *o.CouponName) } if o.Status == nil { ret += "Status:, " } else { ret += fmt.Sprintf("Status:%v, ", *o.Status) } if o.Description == nil { ret += "Description:, " } else { ret += fmt.Sprintf("Description:%v, ", *o.Description) } if o.CreateTime == nil { ret += "CreateTime:, " } else { ret += fmt.Sprintf("CreateTime:%v, ", *o.CreateTime) } if o.CouponType == nil { ret += "CouponType:, " } else { ret += fmt.Sprintf("CouponType:%v, ", *o.CouponType) } if o.NoCash == nil { ret += "NoCash:, " } else { ret += fmt.Sprintf("NoCash:%v, ", *o.NoCash) } if o.AvailableBeginTime == nil { ret += "AvailableBeginTime:, " } else { ret += fmt.Sprintf("AvailableBeginTime:%v, ", *o.AvailableBeginTime) } if o.AvailableEndTime == nil { ret += "AvailableEndTime:, " } else { ret += fmt.Sprintf("AvailableEndTime:%v, ", *o.AvailableEndTime) } if o.Singleitem == nil { ret += "Singleitem:, " } else { ret += fmt.Sprintf("Singleitem:%v, ", *o.Singleitem) } ret += fmt.Sprintf("NormalCouponInformation:%v", o.NormalCouponInformation) return fmt.Sprintf("Coupon{%s}", ret) } func (o Coupon) Clone() *Coupon { ret := Coupon{} if o.StockCreatorMchid != nil { ret.StockCreatorMchid = new(string) *ret.StockCreatorMchid = *o.StockCreatorMchid } if o.StockId != nil { ret.StockId = new(string) *ret.StockId = *o.StockId } if o.CutToMessage != nil { ret.CutToMessage = o.CutToMessage.Clone() } if o.CouponName != nil { ret.CouponName = new(string) *ret.CouponName = *o.CouponName } if o.Status != nil { ret.Status = new(string) *ret.Status = *o.Status } if o.Description != nil { ret.Description = new(string) *ret.Description = *o.Description } if o.CreateTime != nil { ret.CreateTime = new(string) *ret.CreateTime = *o.CreateTime } if o.CouponType != nil { ret.CouponType = new(string) *ret.CouponType = *o.CouponType } if o.NoCash != nil { ret.NoCash = new(bool) *ret.NoCash = *o.NoCash } if o.AvailableBeginTime != nil { ret.AvailableBeginTime = new(string) *ret.AvailableBeginTime = *o.AvailableBeginTime } if o.AvailableEndTime != nil { ret.AvailableEndTime = new(string) *ret.AvailableEndTime = *o.AvailableEndTime } if o.Singleitem != nil { ret.Singleitem = new(bool) *ret.Singleitem = *o.Singleitem } if o.NormalCouponInformation != nil { ret.NormalCouponInformation = o.NormalCouponInformation.Clone() } return &ret } // CouponCollection type CouponCollection struct { // 结果集 Data []Coupon `json:"data,omitempty"` // 查询结果总数 TotalCount *int64 `json:"total_count"` // 分页大小 Limit *int64 `json:"limit"` // 分页页码 Offset *int64 `json:"offset"` } func (o CouponCollection) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Data != nil { toSerialize["data"] = o.Data } if o.TotalCount == nil { return nil, fmt.Errorf("field `TotalCount` is required and must be specified in CouponCollection") } toSerialize["total_count"] = o.TotalCount if o.Limit == nil { return nil, fmt.Errorf("field `Limit` is required and must be specified in CouponCollection") } toSerialize["limit"] = o.Limit if o.Offset == nil { return nil, fmt.Errorf("field `Offset` is required and must be specified in CouponCollection") } toSerialize["offset"] = o.Offset return json.Marshal(toSerialize) } func (o CouponCollection) String() string { var ret string ret += fmt.Sprintf("Data:%v, ", o.Data) if o.TotalCount == nil { ret += "TotalCount:, " } else { ret += fmt.Sprintf("TotalCount:%v, ", *o.TotalCount) } if o.Limit == nil { ret += "Limit:, " } else { ret += fmt.Sprintf("Limit:%v, ", *o.Limit) } if o.Offset == nil { ret += "Offset:" } else { ret += fmt.Sprintf("Offset:%v", *o.Offset) } return fmt.Sprintf("CouponCollection{%s}", ret) } func (o CouponCollection) Clone() *CouponCollection { ret := CouponCollection{} if o.Data != nil { ret.Data = make([]Coupon, len(o.Data)) for i, item := range o.Data { ret.Data[i] = *item.Clone() } } if o.TotalCount != nil { ret.TotalCount = new(int64) *ret.TotalCount = *o.TotalCount } if o.Limit != nil { ret.Limit = new(int64) *ret.Limit = *o.Limit } if o.Offset != nil { ret.Offset = new(int64) *ret.Offset = *o.Offset } return &ret } // CouponRule type CouponRule struct { // 需要指定领取后延时生效可选填 CouponAvailableTime *FavorAvailableTime `json:"coupon_available_time,omitempty"` // stock_type为NORMAL时必填 FixedNormalCoupon *FixedValueStockMsg `json:"fixed_normal_coupon,omitempty"` // 订单优惠标记 GoodsTag []string `json:"goods_tag,omitempty"` // 支付方式 TradeType []TradeType `json:"trade_type,omitempty"` // true-是;false-否 CombineUse *bool `json:"combine_use,omitempty"` // 可核销商品编码 AvailableItems []string `json:"available_items,omitempty"` // 不参与优惠商品编码 UnavailableItems []string `json:"unavailable_items,omitempty"` // 可核销商户号 AvailableMerchants []string `json:"available_merchants,omitempty"` // 当批次指定支付方式为某张银行卡时才生效,可选的 LimitCard *CardLimitation `json:"limit_card,omitempty"` // 限定该批次的指定支付方式,如零钱、指定银行卡等,需填入支付方式编码, 条目个数限制为[1,1] 。当前支持的支付方式,及其编码枚举值,请参考该文档: https://docs.qq.com/sheet/DWGpMbWx3b1JCbldy?c=E3A0A0 LimitPay []string `json:"limit_pay,omitempty"` } func (o CouponRule) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.CouponAvailableTime != nil { toSerialize["coupon_available_time"] = o.CouponAvailableTime } if o.FixedNormalCoupon != nil { toSerialize["fixed_normal_coupon"] = o.FixedNormalCoupon } if o.GoodsTag != nil { toSerialize["goods_tag"] = o.GoodsTag } if o.TradeType != nil { toSerialize["trade_type"] = o.TradeType } if o.CombineUse != nil { toSerialize["combine_use"] = o.CombineUse } if o.AvailableItems != nil { toSerialize["available_items"] = o.AvailableItems } if o.UnavailableItems != nil { toSerialize["unavailable_items"] = o.UnavailableItems } if o.AvailableMerchants != nil { toSerialize["available_merchants"] = o.AvailableMerchants } if o.LimitCard != nil { toSerialize["limit_card"] = o.LimitCard } if o.LimitPay != nil { toSerialize["limit_pay"] = o.LimitPay } return json.Marshal(toSerialize) } func (o CouponRule) String() string { var ret string ret += fmt.Sprintf("CouponAvailableTime:%v, ", o.CouponAvailableTime) ret += fmt.Sprintf("FixedNormalCoupon:%v, ", o.FixedNormalCoupon) ret += fmt.Sprintf("GoodsTag:%v, ", o.GoodsTag) ret += fmt.Sprintf("TradeType:%v, ", o.TradeType) if o.CombineUse == nil { ret += "CombineUse:, " } else { ret += fmt.Sprintf("CombineUse:%v, ", *o.CombineUse) } ret += fmt.Sprintf("AvailableItems:%v, ", o.AvailableItems) ret += fmt.Sprintf("UnavailableItems:%v, ", o.UnavailableItems) ret += fmt.Sprintf("AvailableMerchants:%v, ", o.AvailableMerchants) ret += fmt.Sprintf("LimitCard:%v, ", o.LimitCard) ret += fmt.Sprintf("LimitPay:%v", o.LimitPay) return fmt.Sprintf("CouponRule{%s}", ret) } func (o CouponRule) Clone() *CouponRule { ret := CouponRule{} if o.CouponAvailableTime != nil { ret.CouponAvailableTime = o.CouponAvailableTime.Clone() } if o.FixedNormalCoupon != nil { ret.FixedNormalCoupon = o.FixedNormalCoupon.Clone() } if o.GoodsTag != nil { ret.GoodsTag = make([]string, len(o.GoodsTag)) for i, item := range o.GoodsTag { ret.GoodsTag[i] = item } } if o.TradeType != nil { ret.TradeType = make([]TradeType, len(o.TradeType)) for i, item := range o.TradeType { ret.TradeType[i] = item } } if o.CombineUse != nil { ret.CombineUse = new(bool) *ret.CombineUse = *o.CombineUse } if o.AvailableItems != nil { ret.AvailableItems = make([]string, len(o.AvailableItems)) for i, item := range o.AvailableItems { ret.AvailableItems[i] = item } } if o.UnavailableItems != nil { ret.UnavailableItems = make([]string, len(o.UnavailableItems)) for i, item := range o.UnavailableItems { ret.UnavailableItems[i] = item } } if o.AvailableMerchants != nil { ret.AvailableMerchants = make([]string, len(o.AvailableMerchants)) for i, item := range o.AvailableMerchants { ret.AvailableMerchants[i] = item } } if o.LimitCard != nil { ret.LimitCard = o.LimitCard.Clone() } if o.LimitPay != nil { ret.LimitPay = make([]string, len(o.LimitPay)) for i, item := range o.LimitPay { ret.LimitPay[i] = item } } return &ret } // CreateCouponStockRequest type CreateCouponStockRequest struct { // 批次名称 StockName *string `json:"stock_name"` // 仅配置商户可见,用于自定义信息 Comment *string `json:"comment,omitempty"` // 批次归属商户号 BelongMerchant *string `json:"belong_merchant"` // 批次开始时间 AvailableBeginTime *string `json:"available_begin_time"` // 批次结束时间 AvailableEndTime *string `json:"available_end_time"` // 批次使用规则 StockUseRule *StockRule `json:"stock_use_rule"` // 代金券详情页 PatternInfo *PatternInfo `json:"pattern_info,omitempty"` // CouponUseRule *CouponRule `json:"coupon_use_rule"` // 是否无资金流,true-是;false-否 NoCash *bool `json:"no_cash"` // 批次类型,NORMAL-固定面额满减券批次;DISCOUNT-折扣券批次;EXCHAHGE-换购券批次;RANDOM-千人千面券批次 StockType *string `json:"stock_type"` // 商户创建批次凭据号(格式:商户id+日期+流水号),商户侧需保持唯一性 OutRequestNo *string `json:"out_request_no"` // 扩展属性字段,按json格式,暂时无需填写 ExtInfo *string `json:"ext_info,omitempty"` } func (o CreateCouponStockRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.StockName == nil { return nil, fmt.Errorf("field `StockName` is required and must be specified in CreateCouponStockRequest") } toSerialize["stock_name"] = o.StockName if o.Comment != nil { toSerialize["comment"] = o.Comment } if o.BelongMerchant == nil { return nil, fmt.Errorf("field `BelongMerchant` is required and must be specified in CreateCouponStockRequest") } toSerialize["belong_merchant"] = o.BelongMerchant if o.AvailableBeginTime == nil { return nil, fmt.Errorf("field `AvailableBeginTime` is required and must be specified in CreateCouponStockRequest") } toSerialize["available_begin_time"] = o.AvailableBeginTime if o.AvailableEndTime == nil { return nil, fmt.Errorf("field `AvailableEndTime` is required and must be specified in CreateCouponStockRequest") } toSerialize["available_end_time"] = o.AvailableEndTime if o.StockUseRule == nil { return nil, fmt.Errorf("field `StockUseRule` is required and must be specified in CreateCouponStockRequest") } toSerialize["stock_use_rule"] = o.StockUseRule if o.PatternInfo != nil { toSerialize["pattern_info"] = o.PatternInfo } if o.CouponUseRule == nil { return nil, fmt.Errorf("field `CouponUseRule` is required and must be specified in CreateCouponStockRequest") } toSerialize["coupon_use_rule"] = o.CouponUseRule if o.NoCash == nil { return nil, fmt.Errorf("field `NoCash` is required and must be specified in CreateCouponStockRequest") } toSerialize["no_cash"] = o.NoCash if o.StockType == nil { return nil, fmt.Errorf("field `StockType` is required and must be specified in CreateCouponStockRequest") } toSerialize["stock_type"] = o.StockType if o.OutRequestNo == nil { return nil, fmt.Errorf("field `OutRequestNo` is required and must be specified in CreateCouponStockRequest") } toSerialize["out_request_no"] = o.OutRequestNo if o.ExtInfo != nil { toSerialize["ext_info"] = o.ExtInfo } return json.Marshal(toSerialize) } func (o CreateCouponStockRequest) String() string { var ret string if o.StockName == nil { ret += "StockName:, " } else { ret += fmt.Sprintf("StockName:%v, ", *o.StockName) } if o.Comment == nil { ret += "Comment:, " } else { ret += fmt.Sprintf("Comment:%v, ", *o.Comment) } if o.BelongMerchant == nil { ret += "BelongMerchant:, " } else { ret += fmt.Sprintf("BelongMerchant:%v, ", *o.BelongMerchant) } if o.AvailableBeginTime == nil { ret += "AvailableBeginTime:, " } else { ret += fmt.Sprintf("AvailableBeginTime:%v, ", *o.AvailableBeginTime) } if o.AvailableEndTime == nil { ret += "AvailableEndTime:, " } else { ret += fmt.Sprintf("AvailableEndTime:%v, ", *o.AvailableEndTime) } ret += fmt.Sprintf("StockUseRule:%v, ", o.StockUseRule) ret += fmt.Sprintf("PatternInfo:%v, ", o.PatternInfo) ret += fmt.Sprintf("CouponUseRule:%v, ", o.CouponUseRule) if o.NoCash == nil { ret += "NoCash:, " } else { ret += fmt.Sprintf("NoCash:%v, ", *o.NoCash) } if o.StockType == nil { ret += "StockType:, " } else { ret += fmt.Sprintf("StockType:%v, ", *o.StockType) } if o.OutRequestNo == nil { ret += "OutRequestNo:, " } else { ret += fmt.Sprintf("OutRequestNo:%v, ", *o.OutRequestNo) } if o.ExtInfo == nil { ret += "ExtInfo:" } else { ret += fmt.Sprintf("ExtInfo:%v", *o.ExtInfo) } return fmt.Sprintf("CreateCouponStockRequest{%s}", ret) } func (o CreateCouponStockRequest) Clone() *CreateCouponStockRequest { ret := CreateCouponStockRequest{} if o.StockName != nil { ret.StockName = new(string) *ret.StockName = *o.StockName } if o.Comment != nil { ret.Comment = new(string) *ret.Comment = *o.Comment } if o.BelongMerchant != nil { ret.BelongMerchant = new(string) *ret.BelongMerchant = *o.BelongMerchant } if o.AvailableBeginTime != nil { ret.AvailableBeginTime = new(string) *ret.AvailableBeginTime = *o.AvailableBeginTime } if o.AvailableEndTime != nil { ret.AvailableEndTime = new(string) *ret.AvailableEndTime = *o.AvailableEndTime } if o.StockUseRule != nil { ret.StockUseRule = o.StockUseRule.Clone() } if o.PatternInfo != nil { ret.PatternInfo = o.PatternInfo.Clone() } if o.CouponUseRule != nil { ret.CouponUseRule = o.CouponUseRule.Clone() } if o.NoCash != nil { ret.NoCash = new(bool) *ret.NoCash = *o.NoCash } if o.StockType != nil { ret.StockType = new(string) *ret.StockType = *o.StockType } if o.OutRequestNo != nil { ret.OutRequestNo = new(string) *ret.OutRequestNo = *o.OutRequestNo } if o.ExtInfo != nil { ret.ExtInfo = new(string) *ret.ExtInfo = *o.ExtInfo } return &ret } // CreateCouponStockResponse type CreateCouponStockResponse struct { // 批次号 StockId *string `json:"stock_id"` // 创建时间 CreateTime *string `json:"create_time"` } func (o CreateCouponStockResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.StockId == nil { return nil, fmt.Errorf("field `StockId` is required and must be specified in CreateCouponStockResponse") } toSerialize["stock_id"] = o.StockId if o.CreateTime == nil { return nil, fmt.Errorf("field `CreateTime` is required and must be specified in CreateCouponStockResponse") } toSerialize["create_time"] = o.CreateTime return json.Marshal(toSerialize) } func (o CreateCouponStockResponse) String() string { var ret string if o.StockId == nil { ret += "StockId:, " } else { ret += fmt.Sprintf("StockId:%v, ", *o.StockId) } if o.CreateTime == nil { ret += "CreateTime:" } else { ret += fmt.Sprintf("CreateTime:%v", *o.CreateTime) } return fmt.Sprintf("CreateCouponStockResponse{%s}", ret) } func (o CreateCouponStockResponse) Clone() *CreateCouponStockResponse { ret := CreateCouponStockResponse{} if o.StockId != nil { ret.StockId = new(string) *ret.StockId = *o.StockId } if o.CreateTime != nil { ret.CreateTime = new(string) *ret.CreateTime = *o.CreateTime } return &ret } // CutTypeMsg type CutTypeMsg struct { // 可用优惠的商品最高单价,单位分 SinglePriceMax *int64 `json:"single_price_max"` // 减至后的优惠单价 CutToPrice *int64 `json:"cut_to_price"` } func (o CutTypeMsg) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.SinglePriceMax == nil { return nil, fmt.Errorf("field `SinglePriceMax` is required and must be specified in CutTypeMsg") } toSerialize["single_price_max"] = o.SinglePriceMax if o.CutToPrice == nil { return nil, fmt.Errorf("field `CutToPrice` is required and must be specified in CutTypeMsg") } toSerialize["cut_to_price"] = o.CutToPrice return json.Marshal(toSerialize) } func (o CutTypeMsg) String() string { var ret string if o.SinglePriceMax == nil { ret += "SinglePriceMax:, " } else { ret += fmt.Sprintf("SinglePriceMax:%v, ", *o.SinglePriceMax) } if o.CutToPrice == nil { ret += "CutToPrice:" } else { ret += fmt.Sprintf("CutToPrice:%v", *o.CutToPrice) } return fmt.Sprintf("CutTypeMsg{%s}", ret) } func (o CutTypeMsg) Clone() *CutTypeMsg { ret := CutTypeMsg{} if o.SinglePriceMax != nil { ret.SinglePriceMax = new(int64) *ret.SinglePriceMax = *o.SinglePriceMax } if o.CutToPrice != nil { ret.CutToPrice = new(int64) *ret.CutToPrice = *o.CutToPrice } return &ret } // DeductBalanceMethod type DeductBalanceMethod string func (e DeductBalanceMethod) Ptr() *DeductBalanceMethod { return &e } // Enums of DeductBalanceMethod const ( DEDUCTBALANCEMETHOD_BATCH_DEDUCT DeductBalanceMethod = "BATCH_DEDUCT" DEDUCTBALANCEMETHOD_REALTIME_DEDUCT DeductBalanceMethod = "REALTIME_DEDUCT" ) // FavorAvailableTime type FavorAvailableTime struct { // 固定时间段可用 FixAvailableTime *FixedAvailableTime `json:"fix_available_time,omitempty"` // true-是;false-否 SecondDayAvailable *bool `json:"second_day_available,omitempty"` // 领取后有效时间,单位分钟 AvailableTimeAfterReceive *int64 `json:"available_time_after_receive,omitempty"` } func (o FavorAvailableTime) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.FixAvailableTime != nil { toSerialize["fix_available_time"] = o.FixAvailableTime } if o.SecondDayAvailable != nil { toSerialize["second_day_available"] = o.SecondDayAvailable } if o.AvailableTimeAfterReceive != nil { toSerialize["available_time_after_receive"] = o.AvailableTimeAfterReceive } return json.Marshal(toSerialize) } func (o FavorAvailableTime) String() string { var ret string ret += fmt.Sprintf("FixAvailableTime:%v, ", o.FixAvailableTime) if o.SecondDayAvailable == nil { ret += "SecondDayAvailable:, " } else { ret += fmt.Sprintf("SecondDayAvailable:%v, ", *o.SecondDayAvailable) } if o.AvailableTimeAfterReceive == nil { ret += "AvailableTimeAfterReceive:" } else { ret += fmt.Sprintf("AvailableTimeAfterReceive:%v", *o.AvailableTimeAfterReceive) } return fmt.Sprintf("FavorAvailableTime{%s}", ret) } func (o FavorAvailableTime) Clone() *FavorAvailableTime { ret := FavorAvailableTime{} if o.FixAvailableTime != nil { ret.FixAvailableTime = o.FixAvailableTime.Clone() } if o.SecondDayAvailable != nil { ret.SecondDayAvailable = new(bool) *ret.SecondDayAvailable = *o.SecondDayAvailable } if o.AvailableTimeAfterReceive != nil { ret.AvailableTimeAfterReceive = new(int64) *ret.AvailableTimeAfterReceive = *o.AvailableTimeAfterReceive } return &ret } // FixedAvailableTime type FixedAvailableTime struct { // 0-周日;1-周一;以此类推 AvailableWeekDay []int64 `json:"available_week_day,omitempty"` // 当天开始时间,单位秒 BeginTime *int64 `json:"begin_time"` // 当天结束时间,单位秒,默认为23点59分59秒 EndTime *int64 `json:"end_time,omitempty"` } func (o FixedAvailableTime) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.AvailableWeekDay != nil { toSerialize["available_week_day"] = o.AvailableWeekDay } if o.BeginTime == nil { return nil, fmt.Errorf("field `BeginTime` is required and must be specified in FixedAvailableTime") } toSerialize["begin_time"] = o.BeginTime if o.EndTime != nil { toSerialize["end_time"] = o.EndTime } return json.Marshal(toSerialize) } func (o FixedAvailableTime) String() string { var ret string ret += fmt.Sprintf("AvailableWeekDay:%v, ", o.AvailableWeekDay) if o.BeginTime == nil { ret += "BeginTime:, " } else { ret += fmt.Sprintf("BeginTime:%v, ", *o.BeginTime) } if o.EndTime == nil { ret += "EndTime:" } else { ret += fmt.Sprintf("EndTime:%v", *o.EndTime) } return fmt.Sprintf("FixedAvailableTime{%s}", ret) } func (o FixedAvailableTime) Clone() *FixedAvailableTime { ret := FixedAvailableTime{} if o.AvailableWeekDay != nil { ret.AvailableWeekDay = make([]int64, len(o.AvailableWeekDay)) for i, item := range o.AvailableWeekDay { ret.AvailableWeekDay[i] = item } } if o.BeginTime != nil { ret.BeginTime = new(int64) *ret.BeginTime = *o.BeginTime } if o.EndTime != nil { ret.EndTime = new(int64) *ret.EndTime = *o.EndTime } return &ret } // FixedValueStockMsg type FixedValueStockMsg struct { // 面额,单位分 CouponAmount *int64 `json:"coupon_amount"` // 使用券金额门槛,单位分 TransactionMinimum *int64 `json:"transaction_minimum"` } func (o FixedValueStockMsg) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.CouponAmount == nil { return nil, fmt.Errorf("field `CouponAmount` is required and must be specified in FixedValueStockMsg") } toSerialize["coupon_amount"] = o.CouponAmount if o.TransactionMinimum == nil { return nil, fmt.Errorf("field `TransactionMinimum` is required and must be specified in FixedValueStockMsg") } toSerialize["transaction_minimum"] = o.TransactionMinimum return json.Marshal(toSerialize) } func (o FixedValueStockMsg) String() string { var ret string if o.CouponAmount == nil { ret += "CouponAmount:, " } else { ret += fmt.Sprintf("CouponAmount:%v, ", *o.CouponAmount) } if o.TransactionMinimum == nil { ret += "TransactionMinimum:" } else { ret += fmt.Sprintf("TransactionMinimum:%v", *o.TransactionMinimum) } return fmt.Sprintf("FixedValueStockMsg{%s}", ret) } func (o FixedValueStockMsg) Clone() *FixedValueStockMsg { ret := FixedValueStockMsg{} if o.CouponAmount != nil { ret.CouponAmount = new(int64) *ret.CouponAmount = *o.CouponAmount } if o.TransactionMinimum != nil { ret.TransactionMinimum = new(int64) *ret.TransactionMinimum = *o.TransactionMinimum } return &ret } // FormFile type FormFile struct { Filename *string `json:"filename,omitempty"` ContentType *string `json:"content_type,omitempty"` Content *string `json:"content,omitempty"` } func (o FormFile) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Filename != nil { toSerialize["filename"] = o.Filename } if o.ContentType != nil { toSerialize["content_type"] = o.ContentType } if o.Content != nil { toSerialize["content"] = o.Content } return json.Marshal(toSerialize) } func (o FormFile) String() string { var ret string if o.Filename == nil { ret += "Filename:, " } else { ret += fmt.Sprintf("Filename:%v, ", *o.Filename) } if o.ContentType == nil { ret += "ContentType:, " } else { ret += fmt.Sprintf("ContentType:%v, ", *o.ContentType) } if o.Content == nil { ret += "Content:" } else { ret += fmt.Sprintf("Content:%v", *o.Content) } return fmt.Sprintf("FormFile{%s}", ret) } func (o FormFile) Clone() *FormFile { ret := FormFile{} if o.Filename != nil { ret.Filename = new(string) *ret.Filename = *o.Filename } if o.ContentType != nil { ret.ContentType = new(string) *ret.ContentType = *o.ContentType } if o.Content != nil { ret.Content = new(string) *ret.Content = *o.Content } return &ret } // ImageMeta type ImageMeta struct { // 商户上传的媒体图片的名称,商户自定义,必须以JPG、BMP、PNG为后缀。 Filename *string `json:"filename,omitempty"` // 图片文件的文件摘要,即对图片文件的二进制内容进行sha256计算得到的值。 Sha256 *string `json:"sha256,omitempty"` } func (o ImageMeta) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Filename != nil { toSerialize["filename"] = o.Filename } if o.Sha256 != nil { toSerialize["sha256"] = o.Sha256 } return json.Marshal(toSerialize) } func (o ImageMeta) String() string { var ret string if o.Filename == nil { ret += "Filename:, " } else { ret += fmt.Sprintf("Filename:%v, ", *o.Filename) } if o.Sha256 == nil { ret += "Sha256:" } else { ret += fmt.Sprintf("Sha256:%v", *o.Sha256) } return fmt.Sprintf("ImageMeta{%s}", ret) } func (o ImageMeta) Clone() *ImageMeta { ret := ImageMeta{} if o.Filename != nil { ret.Filename = new(string) *ret.Filename = *o.Filename } if o.Sha256 != nil { ret.Sha256 = new(string) *ret.Sha256 = *o.Sha256 } return &ret } // JumpTarget type JumpTarget string func (e JumpTarget) Ptr() *JumpTarget { return &e } // Enums of JumpTarget const ( JUMPTARGET_PAYMENT_CODE JumpTarget = "PAYMENT_CODE" JUMPTARGET_MINI_PROGRAM JumpTarget = "MINI_PROGRAM" JUMPTARGET_DEFAULT_PAGE JumpTarget = "DEFAULT_PAGE" ) // ListAvailableMerchantsRequest type ListAvailableMerchantsRequest struct { // 分页页码,最大1000 Offset *int64 `json:"offset"` // 分页大小,最大50 Limit *int64 `json:"limit"` // 批次创建方商户号 StockCreatorMchid *string `json:"stock_creator_mchid"` // 批次号 StockId *string `json:"stock_id"` } func (o ListAvailableMerchantsRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Offset == nil { return nil, fmt.Errorf("field `Offset` is required and must be specified in ListAvailableMerchantsRequest") } toSerialize["offset"] = o.Offset if o.Limit == nil { return nil, fmt.Errorf("field `Limit` is required and must be specified in ListAvailableMerchantsRequest") } toSerialize["limit"] = o.Limit if o.StockCreatorMchid == nil { return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in ListAvailableMerchantsRequest") } toSerialize["stock_creator_mchid"] = o.StockCreatorMchid if o.StockId == nil { return nil, fmt.Errorf("field `StockId` is required and must be specified in ListAvailableMerchantsRequest") } toSerialize["stock_id"] = o.StockId return json.Marshal(toSerialize) } func (o ListAvailableMerchantsRequest) String() string { var ret string if o.Offset == nil { ret += "Offset:, " } else { ret += fmt.Sprintf("Offset:%v, ", *o.Offset) } if o.Limit == nil { ret += "Limit:, " } else { ret += fmt.Sprintf("Limit:%v, ", *o.Limit) } if o.StockCreatorMchid == nil { ret += "StockCreatorMchid:, " } else { ret += fmt.Sprintf("StockCreatorMchid:%v, ", *o.StockCreatorMchid) } if o.StockId == nil { ret += "StockId:" } else { ret += fmt.Sprintf("StockId:%v", *o.StockId) } return fmt.Sprintf("ListAvailableMerchantsRequest{%s}", ret) } func (o ListAvailableMerchantsRequest) Clone() *ListAvailableMerchantsRequest { ret := ListAvailableMerchantsRequest{} if o.Offset != nil { ret.Offset = new(int64) *ret.Offset = *o.Offset } if o.Limit != nil { ret.Limit = new(int64) *ret.Limit = *o.Limit } if o.StockCreatorMchid != nil { ret.StockCreatorMchid = new(string) *ret.StockCreatorMchid = *o.StockCreatorMchid } if o.StockId != nil { ret.StockId = new(string) *ret.StockId = *o.StockId } return &ret } // ListAvailableSingleitemsRequest type ListAvailableSingleitemsRequest struct { // 分页页码,最大500 Offset *int64 `json:"offset"` // 分页大小,最大100 Limit *int64 `json:"limit"` // 批次创建方商户号 StockCreatorMchid *string `json:"stock_creator_mchid"` // 批次号 StockId *string `json:"stock_id"` } func (o ListAvailableSingleitemsRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Offset == nil { return nil, fmt.Errorf("field `Offset` is required and must be specified in ListAvailableSingleitemsRequest") } toSerialize["offset"] = o.Offset if o.Limit == nil { return nil, fmt.Errorf("field `Limit` is required and must be specified in ListAvailableSingleitemsRequest") } toSerialize["limit"] = o.Limit if o.StockCreatorMchid == nil { return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in ListAvailableSingleitemsRequest") } toSerialize["stock_creator_mchid"] = o.StockCreatorMchid if o.StockId == nil { return nil, fmt.Errorf("field `StockId` is required and must be specified in ListAvailableSingleitemsRequest") } toSerialize["stock_id"] = o.StockId return json.Marshal(toSerialize) } func (o ListAvailableSingleitemsRequest) String() string { var ret string if o.Offset == nil { ret += "Offset:, " } else { ret += fmt.Sprintf("Offset:%v, ", *o.Offset) } if o.Limit == nil { ret += "Limit:, " } else { ret += fmt.Sprintf("Limit:%v, ", *o.Limit) } if o.StockCreatorMchid == nil { ret += "StockCreatorMchid:, " } else { ret += fmt.Sprintf("StockCreatorMchid:%v, ", *o.StockCreatorMchid) } if o.StockId == nil { ret += "StockId:" } else { ret += fmt.Sprintf("StockId:%v", *o.StockId) } return fmt.Sprintf("ListAvailableSingleitemsRequest{%s}", ret) } func (o ListAvailableSingleitemsRequest) Clone() *ListAvailableSingleitemsRequest { ret := ListAvailableSingleitemsRequest{} if o.Offset != nil { ret.Offset = new(int64) *ret.Offset = *o.Offset } if o.Limit != nil { ret.Limit = new(int64) *ret.Limit = *o.Limit } if o.StockCreatorMchid != nil { ret.StockCreatorMchid = new(string) *ret.StockCreatorMchid = *o.StockCreatorMchid } if o.StockId != nil { ret.StockId = new(string) *ret.StockId = *o.StockId } return &ret } // ListCouponsByFilterRequest type ListCouponsByFilterRequest struct { // 用户在商户appid 下的唯一标识 Openid *string `json:"openid"` // 微信为发券方商户分配的公众账号ID,接口传入的所有appid应该为公众号的appid(在mp.weixin.qq.com申请的),不能为APP的appid(在open.weixin.qq.com申请的)。 Appid *string `json:"appid"` // 批次号,是否指定批次号查询,填写available_mchid,该字段不生效 StockId *string `json:"stock_id,omitempty"` // 代金券状态:SENDED-可用,USED-已实扣,填写available_mchid,该字段不生效 Status *string `json:"status,omitempty"` // 批次创建方商户号。创建批次的商户号,批次发放商户号,可用商户号三个参数,任意选填一个。 CreatorMchid *string `json:"creator_mchid,omitempty"` // 批次发放商户号。创建批次的商户号,批次发放商户号,可用商户号三个参数,任意选填一个。 SenderMchid *string `json:"sender_mchid,omitempty"` // 可用商户号。 创建批次的商户号,批次发放商户号,可用商户号三个参数,任意选填一个。 AvailableMchid *string `json:"available_mchid,omitempty"` // 分页页码,默认0,填写available_mchid,该字段不生效 Offset *int64 `json:"offset,omitempty"` // 分页大小,默认20,填写available_mchid,该字段不生效 Limit *int64 `json:"limit,omitempty"` } func (o ListCouponsByFilterRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Openid == nil { return nil, fmt.Errorf("field `Openid` is required and must be specified in ListCouponsByFilterRequest") } toSerialize["openid"] = o.Openid if o.Appid == nil { return nil, fmt.Errorf("field `Appid` is required and must be specified in ListCouponsByFilterRequest") } toSerialize["appid"] = o.Appid if o.StockId != nil { toSerialize["stock_id"] = o.StockId } if o.Status != nil { toSerialize["status"] = o.Status } if o.CreatorMchid != nil { toSerialize["creator_mchid"] = o.CreatorMchid } if o.SenderMchid != nil { toSerialize["sender_mchid"] = o.SenderMchid } if o.AvailableMchid != nil { toSerialize["available_mchid"] = o.AvailableMchid } if o.Offset != nil { toSerialize["offset"] = o.Offset } if o.Limit != nil { toSerialize["limit"] = o.Limit } return json.Marshal(toSerialize) } func (o ListCouponsByFilterRequest) String() string { var ret string if o.Openid == nil { ret += "Openid:, " } else { ret += fmt.Sprintf("Openid:%v, ", *o.Openid) } if o.Appid == nil { ret += "Appid:, " } else { ret += fmt.Sprintf("Appid:%v, ", *o.Appid) } if o.StockId == nil { ret += "StockId:, " } else { ret += fmt.Sprintf("StockId:%v, ", *o.StockId) } if o.Status == nil { ret += "Status:, " } else { ret += fmt.Sprintf("Status:%v, ", *o.Status) } if o.CreatorMchid == nil { ret += "CreatorMchid:, " } else { ret += fmt.Sprintf("CreatorMchid:%v, ", *o.CreatorMchid) } if o.SenderMchid == nil { ret += "SenderMchid:, " } else { ret += fmt.Sprintf("SenderMchid:%v, ", *o.SenderMchid) } if o.AvailableMchid == nil { ret += "AvailableMchid:, " } else { ret += fmt.Sprintf("AvailableMchid:%v, ", *o.AvailableMchid) } if o.Offset == nil { ret += "Offset:, " } else { ret += fmt.Sprintf("Offset:%v, ", *o.Offset) } if o.Limit == nil { ret += "Limit:" } else { ret += fmt.Sprintf("Limit:%v", *o.Limit) } return fmt.Sprintf("ListCouponsByFilterRequest{%s}", ret) } func (o ListCouponsByFilterRequest) Clone() *ListCouponsByFilterRequest { ret := ListCouponsByFilterRequest{} if o.Openid != nil { ret.Openid = new(string) *ret.Openid = *o.Openid } if o.Appid != nil { ret.Appid = new(string) *ret.Appid = *o.Appid } if o.StockId != nil { ret.StockId = new(string) *ret.StockId = *o.StockId } if o.Status != nil { ret.Status = new(string) *ret.Status = *o.Status } if o.CreatorMchid != nil { ret.CreatorMchid = new(string) *ret.CreatorMchid = *o.CreatorMchid } if o.SenderMchid != nil { ret.SenderMchid = new(string) *ret.SenderMchid = *o.SenderMchid } if o.AvailableMchid != nil { ret.AvailableMchid = new(string) *ret.AvailableMchid = *o.AvailableMchid } if o.Offset != nil { ret.Offset = new(int64) *ret.Offset = *o.Offset } if o.Limit != nil { ret.Limit = new(int64) *ret.Limit = *o.Limit } return &ret } // ListStocksRequest type ListStocksRequest struct { // 页码从0开始,默认第0页 Offset *int64 `json:"offset"` // 分页大小,最大10 Limit *int64 `json:"limit"` // 批次创建方商户号 StockCreatorMchid *string `json:"stock_creator_mchid"` // 起始创建时间 CreateStartTime *string `json:"create_start_time,omitempty"` // 终止创建时间 CreateEndTime *string `json:"create_end_time,omitempty"` // 批次状态: unactivated-未激活;audit-审核中;running-运行中;stoped-已停止;paused-暂停发放 Status *string `json:"status,omitempty"` } func (o ListStocksRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Offset == nil { return nil, fmt.Errorf("field `Offset` is required and must be specified in ListStocksRequest") } toSerialize["offset"] = o.Offset if o.Limit == nil { return nil, fmt.Errorf("field `Limit` is required and must be specified in ListStocksRequest") } toSerialize["limit"] = o.Limit if o.StockCreatorMchid == nil { return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in ListStocksRequest") } toSerialize["stock_creator_mchid"] = o.StockCreatorMchid if o.CreateStartTime != nil { toSerialize["create_start_time"] = o.CreateStartTime } if o.CreateEndTime != nil { toSerialize["create_end_time"] = o.CreateEndTime } if o.Status != nil { toSerialize["status"] = o.Status } return json.Marshal(toSerialize) } func (o ListStocksRequest) String() string { var ret string if o.Offset == nil { ret += "Offset:, " } else { ret += fmt.Sprintf("Offset:%v, ", *o.Offset) } if o.Limit == nil { ret += "Limit:, " } else { ret += fmt.Sprintf("Limit:%v, ", *o.Limit) } if o.StockCreatorMchid == nil { ret += "StockCreatorMchid:, " } else { ret += fmt.Sprintf("StockCreatorMchid:%v, ", *o.StockCreatorMchid) } if o.CreateStartTime == nil { ret += "CreateStartTime:, " } else { ret += fmt.Sprintf("CreateStartTime:%v, ", *o.CreateStartTime) } if o.CreateEndTime == nil { ret += "CreateEndTime:, " } else { ret += fmt.Sprintf("CreateEndTime:%v, ", *o.CreateEndTime) } if o.Status == nil { ret += "Status:" } else { ret += fmt.Sprintf("Status:%v", *o.Status) } return fmt.Sprintf("ListStocksRequest{%s}", ret) } func (o ListStocksRequest) Clone() *ListStocksRequest { ret := ListStocksRequest{} if o.Offset != nil { ret.Offset = new(int64) *ret.Offset = *o.Offset } if o.Limit != nil { ret.Limit = new(int64) *ret.Limit = *o.Limit } if o.StockCreatorMchid != nil { ret.StockCreatorMchid = new(string) *ret.StockCreatorMchid = *o.StockCreatorMchid } if o.CreateStartTime != nil { ret.CreateStartTime = new(string) *ret.CreateStartTime = *o.CreateStartTime } if o.CreateEndTime != nil { ret.CreateEndTime = new(string) *ret.CreateEndTime = *o.CreateEndTime } if o.Status != nil { ret.Status = new(string) *ret.Status = *o.Status } return &ret } // MediaImageRequest type MediaImageRequest struct { // 将媒体图片进行二进制转换,得到的媒体图片二进制内容,在请求body中上传此二进制内容。媒体图片只支持JPG、BMP、PNG格式,文件大小不能超过2M。 File *FormFile `json:"file"` // Meta *ImageMeta `json:"meta"` } func (o MediaImageRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.File == nil { return nil, fmt.Errorf("field `File` is required and must be specified in MediaImageRequest") } toSerialize["file"] = o.File if o.Meta == nil { return nil, fmt.Errorf("field `Meta` is required and must be specified in MediaImageRequest") } toSerialize["meta"] = o.Meta return json.Marshal(toSerialize) } func (o MediaImageRequest) String() string { var ret string ret += fmt.Sprintf("File:%v, ", o.File) ret += fmt.Sprintf("Meta:%v", o.Meta) return fmt.Sprintf("MediaImageRequest{%s}", ret) } func (o MediaImageRequest) Clone() *MediaImageRequest { ret := MediaImageRequest{} if o.File != nil { ret.File = o.File.Clone() } if o.Meta != nil { ret.Meta = o.Meta.Clone() } return &ret } // MediaImageResponse type MediaImageResponse struct { // 微信返回的媒体文件url地址。 MediaUrl *string `json:"media_url"` } func (o MediaImageResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.MediaUrl == nil { return nil, fmt.Errorf("field `MediaUrl` is required and must be specified in MediaImageResponse") } toSerialize["media_url"] = o.MediaUrl return json.Marshal(toSerialize) } func (o MediaImageResponse) String() string { var ret string if o.MediaUrl == nil { ret += "MediaUrl:" } else { ret += fmt.Sprintf("MediaUrl:%v", *o.MediaUrl) } return fmt.Sprintf("MediaImageResponse{%s}", ret) } func (o MediaImageResponse) Clone() *MediaImageResponse { ret := MediaImageResponse{} if o.MediaUrl != nil { ret.MediaUrl = new(string) *ret.MediaUrl = *o.MediaUrl } return &ret } // ModifyAvailableMerchantRequest type ModifyAvailableMerchantRequest struct { // 批次创建方商户号 StockCreatorMchid *string `json:"stock_creator_mchid"` // 增加可用商户列表 AddMchidList []string `json:"add_mchid_list,omitempty"` // 删除可用商户列表 DeleteMchidList []string `json:"delete_mchid_list,omitempty"` } func (o ModifyAvailableMerchantRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.StockCreatorMchid == nil { return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in ModifyAvailableMerchantRequest") } toSerialize["stock_creator_mchid"] = o.StockCreatorMchid if o.AddMchidList != nil { toSerialize["add_mchid_list"] = o.AddMchidList } if o.DeleteMchidList != nil { toSerialize["delete_mchid_list"] = o.DeleteMchidList } return json.Marshal(toSerialize) } func (o ModifyAvailableMerchantRequest) String() string { var ret string if o.StockCreatorMchid == nil { ret += "StockCreatorMchid:, " } else { ret += fmt.Sprintf("StockCreatorMchid:%v, ", *o.StockCreatorMchid) } ret += fmt.Sprintf("AddMchidList:%v, ", o.AddMchidList) ret += fmt.Sprintf("DeleteMchidList:%v", o.DeleteMchidList) return fmt.Sprintf("ModifyAvailableMerchantRequest{%s}", ret) } func (o ModifyAvailableMerchantRequest) Clone() *ModifyAvailableMerchantRequest { ret := ModifyAvailableMerchantRequest{} if o.StockCreatorMchid != nil { ret.StockCreatorMchid = new(string) *ret.StockCreatorMchid = *o.StockCreatorMchid } if o.AddMchidList != nil { ret.AddMchidList = make([]string, len(o.AddMchidList)) for i, item := range o.AddMchidList { ret.AddMchidList[i] = item } } if o.DeleteMchidList != nil { ret.DeleteMchidList = make([]string, len(o.DeleteMchidList)) for i, item := range o.DeleteMchidList { ret.DeleteMchidList[i] = item } } return &ret } // ModifyAvailableMerchantResponse type ModifyAvailableMerchantResponse struct { // 生效时间 EffectTime *string `json:"effect_time"` // 批次号 StockId *string `json:"stock_id"` } func (o ModifyAvailableMerchantResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.EffectTime == nil { return nil, fmt.Errorf("field `EffectTime` is required and must be specified in ModifyAvailableMerchantResponse") } toSerialize["effect_time"] = o.EffectTime if o.StockId == nil { return nil, fmt.Errorf("field `StockId` is required and must be specified in ModifyAvailableMerchantResponse") } toSerialize["stock_id"] = o.StockId return json.Marshal(toSerialize) } func (o ModifyAvailableMerchantResponse) String() string { var ret string if o.EffectTime == nil { ret += "EffectTime:, " } else { ret += fmt.Sprintf("EffectTime:%v, ", *o.EffectTime) } if o.StockId == nil { ret += "StockId:" } else { ret += fmt.Sprintf("StockId:%v", *o.StockId) } return fmt.Sprintf("ModifyAvailableMerchantResponse{%s}", ret) } func (o ModifyAvailableMerchantResponse) Clone() *ModifyAvailableMerchantResponse { ret := ModifyAvailableMerchantResponse{} if o.EffectTime != nil { ret.EffectTime = new(string) *ret.EffectTime = *o.EffectTime } if o.StockId != nil { ret.StockId = new(string) *ret.StockId = *o.StockId } return &ret } // ModifyAvailableSingleitemRequest type ModifyAvailableSingleitemRequest struct { // 批次创建方商户号 StockCreatorMchid *string `json:"stock_creator_mchid"` // 增加单品编码列表 AddGoodsIdList []string `json:"add_goods_id_list,omitempty"` // 删除单品编码列表 DeleteGoodsIdList []string `json:"delete_goods_id_list,omitempty"` } func (o ModifyAvailableSingleitemRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.StockCreatorMchid == nil { return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in ModifyAvailableSingleitemRequest") } toSerialize["stock_creator_mchid"] = o.StockCreatorMchid if o.AddGoodsIdList != nil { toSerialize["add_goods_id_list"] = o.AddGoodsIdList } if o.DeleteGoodsIdList != nil { toSerialize["delete_goods_id_list"] = o.DeleteGoodsIdList } return json.Marshal(toSerialize) } func (o ModifyAvailableSingleitemRequest) String() string { var ret string if o.StockCreatorMchid == nil { ret += "StockCreatorMchid:, " } else { ret += fmt.Sprintf("StockCreatorMchid:%v, ", *o.StockCreatorMchid) } ret += fmt.Sprintf("AddGoodsIdList:%v, ", o.AddGoodsIdList) ret += fmt.Sprintf("DeleteGoodsIdList:%v", o.DeleteGoodsIdList) return fmt.Sprintf("ModifyAvailableSingleitemRequest{%s}", ret) } func (o ModifyAvailableSingleitemRequest) Clone() *ModifyAvailableSingleitemRequest { ret := ModifyAvailableSingleitemRequest{} if o.StockCreatorMchid != nil { ret.StockCreatorMchid = new(string) *ret.StockCreatorMchid = *o.StockCreatorMchid } if o.AddGoodsIdList != nil { ret.AddGoodsIdList = make([]string, len(o.AddGoodsIdList)) for i, item := range o.AddGoodsIdList { ret.AddGoodsIdList[i] = item } } if o.DeleteGoodsIdList != nil { ret.DeleteGoodsIdList = make([]string, len(o.DeleteGoodsIdList)) for i, item := range o.DeleteGoodsIdList { ret.DeleteGoodsIdList[i] = item } } return &ret } // ModifyAvailableSingleitemResponse type ModifyAvailableSingleitemResponse struct { // 生效时间 EffectTime *string `json:"effect_time"` // 批次号 StockId *string `json:"stock_id"` } func (o ModifyAvailableSingleitemResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.EffectTime == nil { return nil, fmt.Errorf("field `EffectTime` is required and must be specified in ModifyAvailableSingleitemResponse") } toSerialize["effect_time"] = o.EffectTime if o.StockId == nil { return nil, fmt.Errorf("field `StockId` is required and must be specified in ModifyAvailableSingleitemResponse") } toSerialize["stock_id"] = o.StockId return json.Marshal(toSerialize) } func (o ModifyAvailableSingleitemResponse) String() string { var ret string if o.EffectTime == nil { ret += "EffectTime:, " } else { ret += fmt.Sprintf("EffectTime:%v, ", *o.EffectTime) } if o.StockId == nil { ret += "StockId:" } else { ret += fmt.Sprintf("StockId:%v", *o.StockId) } return fmt.Sprintf("ModifyAvailableSingleitemResponse{%s}", ret) } func (o ModifyAvailableSingleitemResponse) Clone() *ModifyAvailableSingleitemResponse { ret := ModifyAvailableSingleitemResponse{} if o.EffectTime != nil { ret.EffectTime = new(string) *ret.EffectTime = *o.EffectTime } if o.StockId != nil { ret.StockId = new(string) *ret.StockId = *o.StockId } return &ret } // ModifyStockBudgetRequest type ModifyStockBudgetRequest struct { // 批次创建方商户号 StockCreatorMchid *string `json:"stock_creator_mchid"` // 预算修改目标额度,单位分 TargetMaxAmount *int64 `json:"target_max_amount"` // 当前预算额度,单位分 CurrentMaxAmount *int64 `json:"current_max_amount"` } func (o ModifyStockBudgetRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.StockCreatorMchid == nil { return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in ModifyStockBudgetRequest") } toSerialize["stock_creator_mchid"] = o.StockCreatorMchid if o.TargetMaxAmount == nil { return nil, fmt.Errorf("field `TargetMaxAmount` is required and must be specified in ModifyStockBudgetRequest") } toSerialize["target_max_amount"] = o.TargetMaxAmount if o.CurrentMaxAmount == nil { return nil, fmt.Errorf("field `CurrentMaxAmount` is required and must be specified in ModifyStockBudgetRequest") } toSerialize["current_max_amount"] = o.CurrentMaxAmount return json.Marshal(toSerialize) } func (o ModifyStockBudgetRequest) String() string { var ret string if o.StockCreatorMchid == nil { ret += "StockCreatorMchid:, " } else { ret += fmt.Sprintf("StockCreatorMchid:%v, ", *o.StockCreatorMchid) } if o.TargetMaxAmount == nil { ret += "TargetMaxAmount:, " } else { ret += fmt.Sprintf("TargetMaxAmount:%v, ", *o.TargetMaxAmount) } if o.CurrentMaxAmount == nil { ret += "CurrentMaxAmount:" } else { ret += fmt.Sprintf("CurrentMaxAmount:%v", *o.CurrentMaxAmount) } return fmt.Sprintf("ModifyStockBudgetRequest{%s}", ret) } func (o ModifyStockBudgetRequest) Clone() *ModifyStockBudgetRequest { ret := ModifyStockBudgetRequest{} if o.StockCreatorMchid != nil { ret.StockCreatorMchid = new(string) *ret.StockCreatorMchid = *o.StockCreatorMchid } if o.TargetMaxAmount != nil { ret.TargetMaxAmount = new(int64) *ret.TargetMaxAmount = *o.TargetMaxAmount } if o.CurrentMaxAmount != nil { ret.CurrentMaxAmount = new(int64) *ret.CurrentMaxAmount = *o.CurrentMaxAmount } return &ret } // ModifyStockBudgetResponse type ModifyStockBudgetResponse struct { // 批次预算额度,单位分 MaxAmount *int64 `json:"max_amount"` // 批次号 StockId *string `json:"stock_id"` } func (o ModifyStockBudgetResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.MaxAmount == nil { return nil, fmt.Errorf("field `MaxAmount` is required and must be specified in ModifyStockBudgetResponse") } toSerialize["max_amount"] = o.MaxAmount if o.StockId == nil { return nil, fmt.Errorf("field `StockId` is required and must be specified in ModifyStockBudgetResponse") } toSerialize["stock_id"] = o.StockId return json.Marshal(toSerialize) } func (o ModifyStockBudgetResponse) String() string { var ret string if o.MaxAmount == nil { ret += "MaxAmount:, " } else { ret += fmt.Sprintf("MaxAmount:%v, ", *o.MaxAmount) } if o.StockId == nil { ret += "StockId:" } else { ret += fmt.Sprintf("StockId:%v", *o.StockId) } return fmt.Sprintf("ModifyStockBudgetResponse{%s}", ret) } func (o ModifyStockBudgetResponse) Clone() *ModifyStockBudgetResponse { ret := ModifyStockBudgetResponse{} if o.MaxAmount != nil { ret.MaxAmount = new(int64) *ret.MaxAmount = *o.MaxAmount } if o.StockId != nil { ret.StockId = new(string) *ret.StockId = *o.StockId } return &ret } // PatternInfo type PatternInfo struct { // 用于说明详细的活动规则,会展示在代金券详情页 Description *string `json:"description"` // 商户logo MerchantLogo *string `json:"merchant_logo,omitempty"` // 商户名称 MerchantName *string `json:"merchant_name,omitempty"` // 背景颜色 BackgroundColor *BackgroundColor `json:"background_color,omitempty"` // 券详情图片 CouponImage *string `json:"coupon_image,omitempty"` // 枚举值:PAYMENT_CODE:跳转至微信支付付款码,点击“立即使用”跳转至微信支付付款码 MINI_PROGRAM:跳转至小程序,点击“立即使用”跳转至配置的商家小程序(需要指定小程序appid和path) DEFAULT_PAGE:跳转至默认页, 点击“立即使用”跳转至默认页面 如未传该参数,则默认跳转至默认页。 JumpTarget *JumpTarget `json:"jump_target,omitempty"` // 跳转的小程序appid,跳转至小程序时必填。跳转的小程序appid需至少和一个可核销商户有绑定关系。 MiniProgramAppid *string `json:"mini_program_appid,omitempty"` // 跳转的小程序path,跳转至小程序时必填。 MiniProgramPath *string `json:"mini_program_path,omitempty"` } func (o PatternInfo) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Description == nil { return nil, fmt.Errorf("field `Description` is required and must be specified in PatternInfo") } toSerialize["description"] = o.Description if o.MerchantLogo != nil { toSerialize["merchant_logo"] = o.MerchantLogo } if o.MerchantName != nil { toSerialize["merchant_name"] = o.MerchantName } if o.BackgroundColor != nil { toSerialize["background_color"] = o.BackgroundColor } if o.CouponImage != nil { toSerialize["coupon_image"] = o.CouponImage } if o.JumpTarget != nil { toSerialize["jump_target"] = o.JumpTarget } if o.MiniProgramAppid != nil { toSerialize["mini_program_appid"] = o.MiniProgramAppid } if o.MiniProgramPath != nil { toSerialize["mini_program_path"] = o.MiniProgramPath } return json.Marshal(toSerialize) } func (o PatternInfo) String() string { var ret string if o.Description == nil { ret += "Description:, " } else { ret += fmt.Sprintf("Description:%v, ", *o.Description) } if o.MerchantLogo == nil { ret += "MerchantLogo:, " } else { ret += fmt.Sprintf("MerchantLogo:%v, ", *o.MerchantLogo) } if o.MerchantName == nil { ret += "MerchantName:, " } else { ret += fmt.Sprintf("MerchantName:%v, ", *o.MerchantName) } if o.BackgroundColor == nil { ret += "BackgroundColor:, " } else { ret += fmt.Sprintf("BackgroundColor:%v, ", *o.BackgroundColor) } if o.CouponImage == nil { ret += "CouponImage:, " } else { ret += fmt.Sprintf("CouponImage:%v, ", *o.CouponImage) } if o.JumpTarget == nil { ret += "JumpTarget:, " } else { ret += fmt.Sprintf("JumpTarget:%v, ", *o.JumpTarget) } if o.MiniProgramAppid == nil { ret += "MiniProgramAppid:, " } else { ret += fmt.Sprintf("MiniProgramAppid:%v, ", *o.MiniProgramAppid) } if o.MiniProgramPath == nil { ret += "MiniProgramPath:" } else { ret += fmt.Sprintf("MiniProgramPath:%v", *o.MiniProgramPath) } return fmt.Sprintf("PatternInfo{%s}", ret) } func (o PatternInfo) Clone() *PatternInfo { ret := PatternInfo{} if o.Description != nil { ret.Description = new(string) *ret.Description = *o.Description } if o.MerchantLogo != nil { ret.MerchantLogo = new(string) *ret.MerchantLogo = *o.MerchantLogo } if o.MerchantName != nil { ret.MerchantName = new(string) *ret.MerchantName = *o.MerchantName } if o.BackgroundColor != nil { ret.BackgroundColor = new(BackgroundColor) *ret.BackgroundColor = *o.BackgroundColor } if o.CouponImage != nil { ret.CouponImage = new(string) *ret.CouponImage = *o.CouponImage } if o.JumpTarget != nil { ret.JumpTarget = new(JumpTarget) *ret.JumpTarget = *o.JumpTarget } if o.MiniProgramAppid != nil { ret.MiniProgramAppid = new(string) *ret.MiniProgramAppid = *o.MiniProgramAppid } if o.MiniProgramPath != nil { ret.MiniProgramPath = new(string) *ret.MiniProgramPath = *o.MiniProgramPath } return &ret } // PauseStockBody type PauseStockBody struct { // 批次创建方商户号 StockCreatorMchid *string `json:"stock_creator_mchid"` } func (o PauseStockBody) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.StockCreatorMchid == nil { return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in PauseStockBody") } toSerialize["stock_creator_mchid"] = o.StockCreatorMchid return json.Marshal(toSerialize) } func (o PauseStockBody) String() string { var ret string if o.StockCreatorMchid == nil { ret += "StockCreatorMchid:" } else { ret += fmt.Sprintf("StockCreatorMchid:%v", *o.StockCreatorMchid) } return fmt.Sprintf("PauseStockBody{%s}", ret) } func (o PauseStockBody) Clone() *PauseStockBody { ret := PauseStockBody{} if o.StockCreatorMchid != nil { ret.StockCreatorMchid = new(string) *ret.StockCreatorMchid = *o.StockCreatorMchid } return &ret } // PauseStockRequest type PauseStockRequest struct { // 批次创建方商户号 StockCreatorMchid *string `json:"stock_creator_mchid"` // 批次号 StockId *string `json:"stock_id"` } func (o PauseStockRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.StockCreatorMchid == nil { return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in PauseStockRequest") } toSerialize["stock_creator_mchid"] = o.StockCreatorMchid if o.StockId == nil { return nil, fmt.Errorf("field `StockId` is required and must be specified in PauseStockRequest") } toSerialize["stock_id"] = o.StockId return json.Marshal(toSerialize) } func (o PauseStockRequest) String() string { var ret string if o.StockCreatorMchid == nil { ret += "StockCreatorMchid:, " } else { ret += fmt.Sprintf("StockCreatorMchid:%v, ", *o.StockCreatorMchid) } if o.StockId == nil { ret += "StockId:" } else { ret += fmt.Sprintf("StockId:%v", *o.StockId) } return fmt.Sprintf("PauseStockRequest{%s}", ret) } func (o PauseStockRequest) Clone() *PauseStockRequest { ret := PauseStockRequest{} if o.StockCreatorMchid != nil { ret.StockCreatorMchid = new(string) *ret.StockCreatorMchid = *o.StockCreatorMchid } if o.StockId != nil { ret.StockId = new(string) *ret.StockId = *o.StockId } return &ret } // PauseStockResponse type PauseStockResponse struct { // 暂停时间,遵循[rfc3339标准格式](https://datatracker.ietf.org/doc/html/rfc3339),格式为yyyy-MM-DDTHH:mm:ss.sss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。 PauseTime *string `json:"pause_time"` // 批次号 StockId *string `json:"stock_id"` } func (o PauseStockResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.PauseTime == nil { return nil, fmt.Errorf("field `PauseTime` is required and must be specified in PauseStockResponse") } toSerialize["pause_time"] = o.PauseTime if o.StockId == nil { return nil, fmt.Errorf("field `StockId` is required and must be specified in PauseStockResponse") } toSerialize["stock_id"] = o.StockId return json.Marshal(toSerialize) } func (o PauseStockResponse) String() string { var ret string if o.PauseTime == nil { ret += "PauseTime:, " } else { ret += fmt.Sprintf("PauseTime:%v, ", *o.PauseTime) } if o.StockId == nil { ret += "StockId:" } else { ret += fmt.Sprintf("StockId:%v", *o.StockId) } return fmt.Sprintf("PauseStockResponse{%s}", ret) } func (o PauseStockResponse) Clone() *PauseStockResponse { ret := PauseStockResponse{} if o.PauseTime != nil { ret.PauseTime = new(string) *ret.PauseTime = *o.PauseTime } if o.StockId != nil { ret.StockId = new(string) *ret.StockId = *o.StockId } return &ret } // PlatformFavorStockStatus type PlatformFavorStockStatus string func (e PlatformFavorStockStatus) Ptr() *PlatformFavorStockStatus { return &e } // Enums of PlatformFavorStockStatus const ( PLATFORMFAVORSTOCKSTATUS_UNACTIVATED PlatformFavorStockStatus = "UNACTIVATED" PLATFORMFAVORSTOCKSTATUS_RUNNING PlatformFavorStockStatus = "RUNNING" PLATFORMFAVORSTOCKSTATUS_PAUSED PlatformFavorStockStatus = "PAUSED" PLATFORMFAVORSTOCKSTATUS_EXPIRED PlatformFavorStockStatus = "EXPIRED" ) // QueryCallbackRequest type QueryCallbackRequest struct { // 商户号 Mchid *string `json:"mchid"` } func (o QueryCallbackRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Mchid == nil { return nil, fmt.Errorf("field `Mchid` is required and must be specified in QueryCallbackRequest") } toSerialize["mchid"] = o.Mchid return json.Marshal(toSerialize) } func (o QueryCallbackRequest) String() string { var ret string if o.Mchid == nil { ret += "Mchid:" } else { ret += fmt.Sprintf("Mchid:%v", *o.Mchid) } return fmt.Sprintf("QueryCallbackRequest{%s}", ret) } func (o QueryCallbackRequest) Clone() *QueryCallbackRequest { ret := QueryCallbackRequest{} if o.Mchid != nil { ret.Mchid = new(string) *ret.Mchid = *o.Mchid } return &ret } // QueryCouponRequest type QueryCouponRequest struct { // 代金券id CouponId *string `json:"coupon_id"` // 微信为发券方商户分配的公众账号ID,接口传入的所有appid应该为公众号的appid(在mp.weixin.qq.com申请的),不能为APP的appid(在open.weixin.qq.com申请的)。 Appid *string `json:"appid"` // Openid信息,用户在appid下的唯一标识 Openid *string `json:"openid"` } func (o QueryCouponRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.CouponId == nil { return nil, fmt.Errorf("field `CouponId` is required and must be specified in QueryCouponRequest") } toSerialize["coupon_id"] = o.CouponId if o.Appid == nil { return nil, fmt.Errorf("field `Appid` is required and must be specified in QueryCouponRequest") } toSerialize["appid"] = o.Appid if o.Openid == nil { return nil, fmt.Errorf("field `Openid` is required and must be specified in QueryCouponRequest") } toSerialize["openid"] = o.Openid return json.Marshal(toSerialize) } func (o QueryCouponRequest) String() string { var ret string if o.CouponId == nil { ret += "CouponId:, " } else { ret += fmt.Sprintf("CouponId:%v, ", *o.CouponId) } if o.Appid == nil { ret += "Appid:, " } else { ret += fmt.Sprintf("Appid:%v, ", *o.Appid) } if o.Openid == nil { ret += "Openid:" } else { ret += fmt.Sprintf("Openid:%v", *o.Openid) } return fmt.Sprintf("QueryCouponRequest{%s}", ret) } func (o QueryCouponRequest) Clone() *QueryCouponRequest { ret := QueryCouponRequest{} if o.CouponId != nil { ret.CouponId = new(string) *ret.CouponId = *o.CouponId } if o.Appid != nil { ret.Appid = new(string) *ret.Appid = *o.Appid } if o.Openid != nil { ret.Openid = new(string) *ret.Openid = *o.Openid } return &ret } // QueryStockRequest type QueryStockRequest struct { // 批次id StockId *string `json:"stock_id"` // 批次创建时的商户号 StockCreatorMchid *string `json:"stock_creator_mchid"` } func (o QueryStockRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.StockId == nil { return nil, fmt.Errorf("field `StockId` is required and must be specified in QueryStockRequest") } toSerialize["stock_id"] = o.StockId if o.StockCreatorMchid == nil { return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in QueryStockRequest") } toSerialize["stock_creator_mchid"] = o.StockCreatorMchid return json.Marshal(toSerialize) } func (o QueryStockRequest) String() string { var ret string if o.StockId == nil { ret += "StockId:, " } else { ret += fmt.Sprintf("StockId:%v, ", *o.StockId) } if o.StockCreatorMchid == nil { ret += "StockCreatorMchid:" } else { ret += fmt.Sprintf("StockCreatorMchid:%v", *o.StockCreatorMchid) } return fmt.Sprintf("QueryStockRequest{%s}", ret) } func (o QueryStockRequest) Clone() *QueryStockRequest { ret := QueryStockRequest{} if o.StockId != nil { ret.StockId = new(string) *ret.StockId = *o.StockId } if o.StockCreatorMchid != nil { ret.StockCreatorMchid = new(string) *ret.StockCreatorMchid = *o.StockCreatorMchid } return &ret } // RefundFlowRequest type RefundFlowRequest struct { // 批次号 StockId *string `json:"stock_id"` } func (o RefundFlowRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.StockId == nil { return nil, fmt.Errorf("field `StockId` is required and must be specified in RefundFlowRequest") } toSerialize["stock_id"] = o.StockId return json.Marshal(toSerialize) } func (o RefundFlowRequest) String() string { var ret string if o.StockId == nil { ret += "StockId:" } else { ret += fmt.Sprintf("StockId:%v", *o.StockId) } return fmt.Sprintf("RefundFlowRequest{%s}", ret) } func (o RefundFlowRequest) Clone() *RefundFlowRequest { ret := RefundFlowRequest{} if o.StockId != nil { ret.StockId = new(string) *ret.StockId = *o.StockId } return &ret } // RefundFlowResponse type RefundFlowResponse struct { // 流水文件下载链接,30s内有效 Url *string `json:"url"` // 文件内容的哈希值,防止篡改 HashValue *string `json:"hash_value"` // 哈希算法类型,目前支持sha1 HashType *string `json:"hash_type"` } func (o RefundFlowResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Url == nil { return nil, fmt.Errorf("field `Url` is required and must be specified in RefundFlowResponse") } toSerialize["url"] = o.Url if o.HashValue == nil { return nil, fmt.Errorf("field `HashValue` is required and must be specified in RefundFlowResponse") } toSerialize["hash_value"] = o.HashValue if o.HashType == nil { return nil, fmt.Errorf("field `HashType` is required and must be specified in RefundFlowResponse") } toSerialize["hash_type"] = o.HashType return json.Marshal(toSerialize) } func (o RefundFlowResponse) String() string { var ret string if o.Url == nil { ret += "Url:, " } else { ret += fmt.Sprintf("Url:%v, ", *o.Url) } if o.HashValue == nil { ret += "HashValue:, " } else { ret += fmt.Sprintf("HashValue:%v, ", *o.HashValue) } if o.HashType == nil { ret += "HashType:" } else { ret += fmt.Sprintf("HashType:%v", *o.HashType) } return fmt.Sprintf("RefundFlowResponse{%s}", ret) } func (o RefundFlowResponse) Clone() *RefundFlowResponse { ret := RefundFlowResponse{} if o.Url != nil { ret.Url = new(string) *ret.Url = *o.Url } if o.HashValue != nil { ret.HashValue = new(string) *ret.HashValue = *o.HashValue } if o.HashType != nil { ret.HashType = new(string) *ret.HashType = *o.HashType } return &ret } // RestartStockBody type RestartStockBody struct { // 批次创建方商户号 StockCreatorMchid *string `json:"stock_creator_mchid"` } func (o RestartStockBody) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.StockCreatorMchid == nil { return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in RestartStockBody") } toSerialize["stock_creator_mchid"] = o.StockCreatorMchid return json.Marshal(toSerialize) } func (o RestartStockBody) String() string { var ret string if o.StockCreatorMchid == nil { ret += "StockCreatorMchid:" } else { ret += fmt.Sprintf("StockCreatorMchid:%v", *o.StockCreatorMchid) } return fmt.Sprintf("RestartStockBody{%s}", ret) } func (o RestartStockBody) Clone() *RestartStockBody { ret := RestartStockBody{} if o.StockCreatorMchid != nil { ret.StockCreatorMchid = new(string) *ret.StockCreatorMchid = *o.StockCreatorMchid } return &ret } // RestartStockRequest type RestartStockRequest struct { // 批次创建方商户号 StockCreatorMchid *string `json:"stock_creator_mchid"` // 批次号 StockId *string `json:"stock_id"` } func (o RestartStockRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.StockCreatorMchid == nil { return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in RestartStockRequest") } toSerialize["stock_creator_mchid"] = o.StockCreatorMchid if o.StockId == nil { return nil, fmt.Errorf("field `StockId` is required and must be specified in RestartStockRequest") } toSerialize["stock_id"] = o.StockId return json.Marshal(toSerialize) } func (o RestartStockRequest) String() string { var ret string if o.StockCreatorMchid == nil { ret += "StockCreatorMchid:, " } else { ret += fmt.Sprintf("StockCreatorMchid:%v, ", *o.StockCreatorMchid) } if o.StockId == nil { ret += "StockId:" } else { ret += fmt.Sprintf("StockId:%v", *o.StockId) } return fmt.Sprintf("RestartStockRequest{%s}", ret) } func (o RestartStockRequest) Clone() *RestartStockRequest { ret := RestartStockRequest{} if o.StockCreatorMchid != nil { ret.StockCreatorMchid = new(string) *ret.StockCreatorMchid = *o.StockCreatorMchid } if o.StockId != nil { ret.StockId = new(string) *ret.StockId = *o.StockId } return &ret } // RestartStockResponse type RestartStockResponse struct { // 生效时间 RestartTime *string `json:"restart_time"` // 批次号 StockId *string `json:"stock_id"` } func (o RestartStockResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.RestartTime == nil { return nil, fmt.Errorf("field `RestartTime` is required and must be specified in RestartStockResponse") } toSerialize["restart_time"] = o.RestartTime if o.StockId == nil { return nil, fmt.Errorf("field `StockId` is required and must be specified in RestartStockResponse") } toSerialize["stock_id"] = o.StockId return json.Marshal(toSerialize) } func (o RestartStockResponse) String() string { var ret string if o.RestartTime == nil { ret += "RestartTime:, " } else { ret += fmt.Sprintf("RestartTime:%v, ", *o.RestartTime) } if o.StockId == nil { ret += "StockId:" } else { ret += fmt.Sprintf("StockId:%v", *o.StockId) } return fmt.Sprintf("RestartStockResponse{%s}", ret) } func (o RestartStockResponse) Clone() *RestartStockResponse { ret := RestartStockResponse{} if o.RestartTime != nil { ret.RestartTime = new(string) *ret.RestartTime = *o.RestartTime } if o.StockId != nil { ret.StockId = new(string) *ret.StockId = *o.StockId } return &ret } // SendCouponBody type SendCouponBody struct { // 微信为每个批次分配的唯一id StockId *string `json:"stock_id"` // 商户此次发放凭据号(格式:商户id+日期+流水号),商户侧需保持唯一性 OutRequestNo *string `json:"out_request_no"` // 微信为发券方商户分配的公众账号ID,接口传入的所有appid应该为公众号的appid(在mp.weixin.qq.com申请的),不能为APP的appid(在open.weixin.qq.com申请的)。 Appid *string `json:"appid"` // 批次创建方商户号 StockCreatorMchid *string `json:"stock_creator_mchid"` // 指定面额发券场景,券面额,其他场景不需要填,单位分 CouponValue *int64 `json:"coupon_value,omitempty"` // 指定面额发券批次门槛,其他场景不需要,单位分 CouponMinimum *int64 `json:"coupon_minimum,omitempty"` } func (o SendCouponBody) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.StockId == nil { return nil, fmt.Errorf("field `StockId` is required and must be specified in SendCouponBody") } toSerialize["stock_id"] = o.StockId if o.OutRequestNo == nil { return nil, fmt.Errorf("field `OutRequestNo` is required and must be specified in SendCouponBody") } toSerialize["out_request_no"] = o.OutRequestNo if o.Appid == nil { return nil, fmt.Errorf("field `Appid` is required and must be specified in SendCouponBody") } toSerialize["appid"] = o.Appid if o.StockCreatorMchid == nil { return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in SendCouponBody") } toSerialize["stock_creator_mchid"] = o.StockCreatorMchid if o.CouponValue != nil { toSerialize["coupon_value"] = o.CouponValue } if o.CouponMinimum != nil { toSerialize["coupon_minimum"] = o.CouponMinimum } return json.Marshal(toSerialize) } func (o SendCouponBody) String() string { var ret string if o.StockId == nil { ret += "StockId:, " } else { ret += fmt.Sprintf("StockId:%v, ", *o.StockId) } if o.OutRequestNo == nil { ret += "OutRequestNo:, " } else { ret += fmt.Sprintf("OutRequestNo:%v, ", *o.OutRequestNo) } if o.Appid == nil { ret += "Appid:, " } else { ret += fmt.Sprintf("Appid:%v, ", *o.Appid) } if o.StockCreatorMchid == nil { ret += "StockCreatorMchid:, " } else { ret += fmt.Sprintf("StockCreatorMchid:%v, ", *o.StockCreatorMchid) } if o.CouponValue == nil { ret += "CouponValue:, " } else { ret += fmt.Sprintf("CouponValue:%v, ", *o.CouponValue) } if o.CouponMinimum == nil { ret += "CouponMinimum:" } else { ret += fmt.Sprintf("CouponMinimum:%v", *o.CouponMinimum) } return fmt.Sprintf("SendCouponBody{%s}", ret) } func (o SendCouponBody) Clone() *SendCouponBody { ret := SendCouponBody{} if o.StockId != nil { ret.StockId = new(string) *ret.StockId = *o.StockId } if o.OutRequestNo != nil { ret.OutRequestNo = new(string) *ret.OutRequestNo = *o.OutRequestNo } if o.Appid != nil { ret.Appid = new(string) *ret.Appid = *o.Appid } if o.StockCreatorMchid != nil { ret.StockCreatorMchid = new(string) *ret.StockCreatorMchid = *o.StockCreatorMchid } if o.CouponValue != nil { ret.CouponValue = new(int64) *ret.CouponValue = *o.CouponValue } if o.CouponMinimum != nil { ret.CouponMinimum = new(int64) *ret.CouponMinimum = *o.CouponMinimum } return &ret } // SendCouponRequest type SendCouponRequest struct { // 微信为每个批次分配的唯一id StockId *string `json:"stock_id"` // Openid信息,用户在appid下的唯一标识 Openid *string `json:"openid"` // 商户此次发放凭据号(格式:商户id+日期+流水号),商户侧需保持唯一性 OutRequestNo *string `json:"out_request_no"` // 微信为发券方商户分配的公众账号ID,接口传入的所有appid应该为公众号的appid(在mp.weixin.qq.com申请的),不能为APP的appid(在open.weixin.qq.com申请的)。 Appid *string `json:"appid"` // 批次创建方商户号 StockCreatorMchid *string `json:"stock_creator_mchid"` // 指定面额发券场景,券面额,其他场景不需要填,单位分 CouponValue *int64 `json:"coupon_value,omitempty"` // 指定面额发券批次门槛,其他场景不需要,单位分 CouponMinimum *int64 `json:"coupon_minimum,omitempty"` } func (o SendCouponRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.StockId == nil { return nil, fmt.Errorf("field `StockId` is required and must be specified in SendCouponRequest") } toSerialize["stock_id"] = o.StockId if o.Openid == nil { return nil, fmt.Errorf("field `Openid` is required and must be specified in SendCouponRequest") } toSerialize["openid"] = o.Openid if o.OutRequestNo == nil { return nil, fmt.Errorf("field `OutRequestNo` is required and must be specified in SendCouponRequest") } toSerialize["out_request_no"] = o.OutRequestNo if o.Appid == nil { return nil, fmt.Errorf("field `Appid` is required and must be specified in SendCouponRequest") } toSerialize["appid"] = o.Appid if o.StockCreatorMchid == nil { return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in SendCouponRequest") } toSerialize["stock_creator_mchid"] = o.StockCreatorMchid if o.CouponValue != nil { toSerialize["coupon_value"] = o.CouponValue } if o.CouponMinimum != nil { toSerialize["coupon_minimum"] = o.CouponMinimum } return json.Marshal(toSerialize) } func (o SendCouponRequest) String() string { var ret string if o.StockId == nil { ret += "StockId:, " } else { ret += fmt.Sprintf("StockId:%v, ", *o.StockId) } if o.Openid == nil { ret += "Openid:, " } else { ret += fmt.Sprintf("Openid:%v, ", *o.Openid) } if o.OutRequestNo == nil { ret += "OutRequestNo:, " } else { ret += fmt.Sprintf("OutRequestNo:%v, ", *o.OutRequestNo) } if o.Appid == nil { ret += "Appid:, " } else { ret += fmt.Sprintf("Appid:%v, ", *o.Appid) } if o.StockCreatorMchid == nil { ret += "StockCreatorMchid:, " } else { ret += fmt.Sprintf("StockCreatorMchid:%v, ", *o.StockCreatorMchid) } if o.CouponValue == nil { ret += "CouponValue:, " } else { ret += fmt.Sprintf("CouponValue:%v, ", *o.CouponValue) } if o.CouponMinimum == nil { ret += "CouponMinimum:" } else { ret += fmt.Sprintf("CouponMinimum:%v", *o.CouponMinimum) } return fmt.Sprintf("SendCouponRequest{%s}", ret) } func (o SendCouponRequest) Clone() *SendCouponRequest { ret := SendCouponRequest{} if o.StockId != nil { ret.StockId = new(string) *ret.StockId = *o.StockId } if o.Openid != nil { ret.Openid = new(string) *ret.Openid = *o.Openid } if o.OutRequestNo != nil { ret.OutRequestNo = new(string) *ret.OutRequestNo = *o.OutRequestNo } if o.Appid != nil { ret.Appid = new(string) *ret.Appid = *o.Appid } if o.StockCreatorMchid != nil { ret.StockCreatorMchid = new(string) *ret.StockCreatorMchid = *o.StockCreatorMchid } if o.CouponValue != nil { ret.CouponValue = new(int64) *ret.CouponValue = *o.CouponValue } if o.CouponMinimum != nil { ret.CouponMinimum = new(int64) *ret.CouponMinimum = *o.CouponMinimum } return &ret } // SendCouponResponse type SendCouponResponse struct { // 发放给用户的代金券id CouponId *string `json:"coupon_id"` } func (o SendCouponResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.CouponId == nil { return nil, fmt.Errorf("field `CouponId` is required and must be specified in SendCouponResponse") } toSerialize["coupon_id"] = o.CouponId return json.Marshal(toSerialize) } func (o SendCouponResponse) String() string { var ret string if o.CouponId == nil { ret += "CouponId:" } else { ret += fmt.Sprintf("CouponId:%v", *o.CouponId) } return fmt.Sprintf("SendCouponResponse{%s}", ret) } func (o SendCouponResponse) Clone() *SendCouponResponse { ret := SendCouponResponse{} if o.CouponId != nil { ret.CouponId = new(string) *ret.CouponId = *o.CouponId } return &ret } // SetCallbackRequest type SetCallbackRequest struct { // 微信支付商户号 Mchid *string `json:"mchid"` // 支付通知商户url地址 NotifyUrl *string `json:"notify_url"` // true-开启推送;false-停止推送 Switch *bool `json:"switch,omitempty"` } func (o SetCallbackRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Mchid == nil { return nil, fmt.Errorf("field `Mchid` is required and must be specified in SetCallbackRequest") } toSerialize["mchid"] = o.Mchid if o.NotifyUrl == nil { return nil, fmt.Errorf("field `NotifyUrl` is required and must be specified in SetCallbackRequest") } toSerialize["notify_url"] = o.NotifyUrl if o.Switch != nil { toSerialize["switch"] = o.Switch } return json.Marshal(toSerialize) } func (o SetCallbackRequest) String() string { var ret string if o.Mchid == nil { ret += "Mchid:, " } else { ret += fmt.Sprintf("Mchid:%v, ", *o.Mchid) } if o.NotifyUrl == nil { ret += "NotifyUrl:, " } else { ret += fmt.Sprintf("NotifyUrl:%v, ", *o.NotifyUrl) } if o.Switch == nil { ret += "Switch:" } else { ret += fmt.Sprintf("Switch:%v", *o.Switch) } return fmt.Sprintf("SetCallbackRequest{%s}", ret) } func (o SetCallbackRequest) Clone() *SetCallbackRequest { ret := SetCallbackRequest{} if o.Mchid != nil { ret.Mchid = new(string) *ret.Mchid = *o.Mchid } if o.NotifyUrl != nil { ret.NotifyUrl = new(string) *ret.NotifyUrl = *o.NotifyUrl } if o.Switch != nil { ret.Switch = new(bool) *ret.Switch = *o.Switch } return &ret } // SetCallbackResponse type SetCallbackResponse struct { // 修改时间 UpdateTime *string `json:"update_time"` // 通知地址 NotifyUrl *string `json:"notify_url"` } func (o SetCallbackResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.UpdateTime == nil { return nil, fmt.Errorf("field `UpdateTime` is required and must be specified in SetCallbackResponse") } toSerialize["update_time"] = o.UpdateTime if o.NotifyUrl == nil { return nil, fmt.Errorf("field `NotifyUrl` is required and must be specified in SetCallbackResponse") } toSerialize["notify_url"] = o.NotifyUrl return json.Marshal(toSerialize) } func (o SetCallbackResponse) String() string { var ret string if o.UpdateTime == nil { ret += "UpdateTime:, " } else { ret += fmt.Sprintf("UpdateTime:%v, ", *o.UpdateTime) } if o.NotifyUrl == nil { ret += "NotifyUrl:" } else { ret += fmt.Sprintf("NotifyUrl:%v", *o.NotifyUrl) } return fmt.Sprintf("SetCallbackResponse{%s}", ret) } func (o SetCallbackResponse) Clone() *SetCallbackResponse { ret := SetCallbackResponse{} if o.UpdateTime != nil { ret.UpdateTime = new(string) *ret.UpdateTime = *o.UpdateTime } if o.NotifyUrl != nil { ret.NotifyUrl = new(string) *ret.NotifyUrl = *o.NotifyUrl } return &ret } // StartStockBody type StartStockBody struct { // 批次创建方商户号 StockCreatorMchid *string `json:"stock_creator_mchid"` } func (o StartStockBody) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.StockCreatorMchid == nil { return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in StartStockBody") } toSerialize["stock_creator_mchid"] = o.StockCreatorMchid return json.Marshal(toSerialize) } func (o StartStockBody) String() string { var ret string if o.StockCreatorMchid == nil { ret += "StockCreatorMchid:" } else { ret += fmt.Sprintf("StockCreatorMchid:%v", *o.StockCreatorMchid) } return fmt.Sprintf("StartStockBody{%s}", ret) } func (o StartStockBody) Clone() *StartStockBody { ret := StartStockBody{} if o.StockCreatorMchid != nil { ret.StockCreatorMchid = new(string) *ret.StockCreatorMchid = *o.StockCreatorMchid } return &ret } // StartStockRequest type StartStockRequest struct { // 批次创建方商户号 StockCreatorMchid *string `json:"stock_creator_mchid"` // 批次号 StockId *string `json:"stock_id"` } func (o StartStockRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.StockCreatorMchid == nil { return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in StartStockRequest") } toSerialize["stock_creator_mchid"] = o.StockCreatorMchid if o.StockId == nil { return nil, fmt.Errorf("field `StockId` is required and must be specified in StartStockRequest") } toSerialize["stock_id"] = o.StockId return json.Marshal(toSerialize) } func (o StartStockRequest) String() string { var ret string if o.StockCreatorMchid == nil { ret += "StockCreatorMchid:, " } else { ret += fmt.Sprintf("StockCreatorMchid:%v, ", *o.StockCreatorMchid) } if o.StockId == nil { ret += "StockId:" } else { ret += fmt.Sprintf("StockId:%v", *o.StockId) } return fmt.Sprintf("StartStockRequest{%s}", ret) } func (o StartStockRequest) Clone() *StartStockRequest { ret := StartStockRequest{} if o.StockCreatorMchid != nil { ret.StockCreatorMchid = new(string) *ret.StockCreatorMchid = *o.StockCreatorMchid } if o.StockId != nil { ret.StockId = new(string) *ret.StockId = *o.StockId } return &ret } // StartStockResponse type StartStockResponse struct { // 生效时间,遵循[rfc3339标准格式](https://datatracker.ietf.org/doc/html/rfc3339),格式为yyyy-MM-DDTHH:mm:ss.sss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。 StartTime *string `json:"start_time"` // 批次号 StockId *string `json:"stock_id"` } func (o StartStockResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.StartTime == nil { return nil, fmt.Errorf("field `StartTime` is required and must be specified in StartStockResponse") } toSerialize["start_time"] = o.StartTime if o.StockId == nil { return nil, fmt.Errorf("field `StockId` is required and must be specified in StartStockResponse") } toSerialize["stock_id"] = o.StockId return json.Marshal(toSerialize) } func (o StartStockResponse) String() string { var ret string if o.StartTime == nil { ret += "StartTime:, " } else { ret += fmt.Sprintf("StartTime:%v, ", *o.StartTime) } if o.StockId == nil { ret += "StockId:" } else { ret += fmt.Sprintf("StockId:%v", *o.StockId) } return fmt.Sprintf("StartStockResponse{%s}", ret) } func (o StartStockResponse) Clone() *StartStockResponse { ret := StartStockResponse{} if o.StartTime != nil { ret.StartTime = new(string) *ret.StartTime = *o.StartTime } if o.StockId != nil { ret.StockId = new(string) *ret.StockId = *o.StockId } return &ret } // Stock type Stock struct { // 批次id StockId *string `json:"stock_id"` // 微信为创建方商户分配的商户号 StockCreatorMchid *string `json:"stock_creator_mchid"` // 批次名称 StockName *string `json:"stock_name"` // 批次状态: unactivated-未激活;audit-审核中;running-运行中;stoped-已停止;paused-暂停发放 Status *string `json:"status"` // 批次创建时间 CreateTime *string `json:"create_time"` // 批次描述信息 Description *string `json:"description"` // 普通发券批次特定信息 StockUseRule *StockUseRule `json:"stock_use_rule,omitempty"` // 可用开始时间 AvailableBeginTime *string `json:"available_begin_time"` // 可用结束时间 AvailableEndTime *string `json:"available_end_time"` // 已发券数量 DistributedCoupons *int64 `json:"distributed_coupons"` // 是否无资金流,ture-是;false-否 NoCash *bool `json:"no_cash"` // 批次激活开启时间 StartTime *string `json:"start_time,omitempty"` // 批次永久停止时间 StopTime *string `json:"stop_time,omitempty"` // 单品优惠特定信息 CutToMessage *CutTypeMsg `json:"cut_to_message,omitempty"` // true-是;false-否 Singleitem *bool `json:"singleitem"` // NORMAL-代金券批次;DISCOUNT_CUT-立减与折扣;OTHER-其他 StockType *string `json:"stock_type"` // 微信卡包ID CardId *string `json:"card_id,omitempty"` } func (o Stock) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.StockId == nil { return nil, fmt.Errorf("field `StockId` is required and must be specified in Stock") } toSerialize["stock_id"] = o.StockId if o.StockCreatorMchid == nil { return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in Stock") } toSerialize["stock_creator_mchid"] = o.StockCreatorMchid if o.StockName == nil { return nil, fmt.Errorf("field `StockName` is required and must be specified in Stock") } toSerialize["stock_name"] = o.StockName if o.Status == nil { return nil, fmt.Errorf("field `Status` is required and must be specified in Stock") } toSerialize["status"] = o.Status if o.CreateTime == nil { return nil, fmt.Errorf("field `CreateTime` is required and must be specified in Stock") } toSerialize["create_time"] = o.CreateTime if o.Description == nil { return nil, fmt.Errorf("field `Description` is required and must be specified in Stock") } toSerialize["description"] = o.Description if o.StockUseRule != nil { toSerialize["stock_use_rule"] = o.StockUseRule } if o.AvailableBeginTime == nil { return nil, fmt.Errorf("field `AvailableBeginTime` is required and must be specified in Stock") } toSerialize["available_begin_time"] = o.AvailableBeginTime if o.AvailableEndTime == nil { return nil, fmt.Errorf("field `AvailableEndTime` is required and must be specified in Stock") } toSerialize["available_end_time"] = o.AvailableEndTime if o.DistributedCoupons == nil { return nil, fmt.Errorf("field `DistributedCoupons` is required and must be specified in Stock") } toSerialize["distributed_coupons"] = o.DistributedCoupons if o.NoCash == nil { return nil, fmt.Errorf("field `NoCash` is required and must be specified in Stock") } toSerialize["no_cash"] = o.NoCash if o.StartTime != nil { toSerialize["start_time"] = o.StartTime } if o.StopTime != nil { toSerialize["stop_time"] = o.StopTime } if o.CutToMessage != nil { toSerialize["cut_to_message"] = o.CutToMessage } if o.Singleitem == nil { return nil, fmt.Errorf("field `Singleitem` is required and must be specified in Stock") } toSerialize["singleitem"] = o.Singleitem if o.StockType == nil { return nil, fmt.Errorf("field `StockType` is required and must be specified in Stock") } toSerialize["stock_type"] = o.StockType if o.CardId != nil { toSerialize["card_id"] = o.CardId } return json.Marshal(toSerialize) } func (o Stock) String() string { var ret string if o.StockId == nil { ret += "StockId:, " } else { ret += fmt.Sprintf("StockId:%v, ", *o.StockId) } if o.StockCreatorMchid == nil { ret += "StockCreatorMchid:, " } else { ret += fmt.Sprintf("StockCreatorMchid:%v, ", *o.StockCreatorMchid) } if o.StockName == nil { ret += "StockName:, " } else { ret += fmt.Sprintf("StockName:%v, ", *o.StockName) } if o.Status == nil { ret += "Status:, " } else { ret += fmt.Sprintf("Status:%v, ", *o.Status) } if o.CreateTime == nil { ret += "CreateTime:, " } else { ret += fmt.Sprintf("CreateTime:%v, ", *o.CreateTime) } if o.Description == nil { ret += "Description:, " } else { ret += fmt.Sprintf("Description:%v, ", *o.Description) } ret += fmt.Sprintf("StockUseRule:%v, ", o.StockUseRule) if o.AvailableBeginTime == nil { ret += "AvailableBeginTime:, " } else { ret += fmt.Sprintf("AvailableBeginTime:%v, ", *o.AvailableBeginTime) } if o.AvailableEndTime == nil { ret += "AvailableEndTime:, " } else { ret += fmt.Sprintf("AvailableEndTime:%v, ", *o.AvailableEndTime) } if o.DistributedCoupons == nil { ret += "DistributedCoupons:, " } else { ret += fmt.Sprintf("DistributedCoupons:%v, ", *o.DistributedCoupons) } if o.NoCash == nil { ret += "NoCash:, " } else { ret += fmt.Sprintf("NoCash:%v, ", *o.NoCash) } if o.StartTime == nil { ret += "StartTime:, " } else { ret += fmt.Sprintf("StartTime:%v, ", *o.StartTime) } if o.StopTime == nil { ret += "StopTime:, " } else { ret += fmt.Sprintf("StopTime:%v, ", *o.StopTime) } ret += fmt.Sprintf("CutToMessage:%v, ", o.CutToMessage) if o.Singleitem == nil { ret += "Singleitem:, " } else { ret += fmt.Sprintf("Singleitem:%v, ", *o.Singleitem) } if o.StockType == nil { ret += "StockType:, " } else { ret += fmt.Sprintf("StockType:%v, ", *o.StockType) } if o.CardId == nil { ret += "CardId:" } else { ret += fmt.Sprintf("CardId:%v", *o.CardId) } return fmt.Sprintf("Stock{%s}", ret) } func (o Stock) Clone() *Stock { ret := Stock{} if o.StockId != nil { ret.StockId = new(string) *ret.StockId = *o.StockId } if o.StockCreatorMchid != nil { ret.StockCreatorMchid = new(string) *ret.StockCreatorMchid = *o.StockCreatorMchid } if o.StockName != nil { ret.StockName = new(string) *ret.StockName = *o.StockName } if o.Status != nil { ret.Status = new(string) *ret.Status = *o.Status } if o.CreateTime != nil { ret.CreateTime = new(string) *ret.CreateTime = *o.CreateTime } if o.Description != nil { ret.Description = new(string) *ret.Description = *o.Description } if o.StockUseRule != nil { ret.StockUseRule = o.StockUseRule.Clone() } if o.AvailableBeginTime != nil { ret.AvailableBeginTime = new(string) *ret.AvailableBeginTime = *o.AvailableBeginTime } if o.AvailableEndTime != nil { ret.AvailableEndTime = new(string) *ret.AvailableEndTime = *o.AvailableEndTime } if o.DistributedCoupons != nil { ret.DistributedCoupons = new(int64) *ret.DistributedCoupons = *o.DistributedCoupons } if o.NoCash != nil { ret.NoCash = new(bool) *ret.NoCash = *o.NoCash } if o.StartTime != nil { ret.StartTime = new(string) *ret.StartTime = *o.StartTime } if o.StopTime != nil { ret.StopTime = new(string) *ret.StopTime = *o.StopTime } if o.CutToMessage != nil { ret.CutToMessage = o.CutToMessage.Clone() } if o.Singleitem != nil { ret.Singleitem = new(bool) *ret.Singleitem = *o.Singleitem } if o.StockType != nil { ret.StockType = new(string) *ret.StockType = *o.StockType } if o.CardId != nil { ret.CardId = new(string) *ret.CardId = *o.CardId } return &ret } // StockCollection type StockCollection struct { // 命中查询条件总数量 TotalCount *int64 `json:"total_count"` // 批次详情 Data []Stock `json:"data,omitempty"` // 分页大小,最大10 Limit *int64 `json:"limit"` // 页码从0开始,默认第0页 Offset *int64 `json:"offset"` } func (o StockCollection) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.TotalCount == nil { return nil, fmt.Errorf("field `TotalCount` is required and must be specified in StockCollection") } toSerialize["total_count"] = o.TotalCount if o.Data != nil { toSerialize["data"] = o.Data } if o.Limit == nil { return nil, fmt.Errorf("field `Limit` is required and must be specified in StockCollection") } toSerialize["limit"] = o.Limit if o.Offset == nil { return nil, fmt.Errorf("field `Offset` is required and must be specified in StockCollection") } toSerialize["offset"] = o.Offset return json.Marshal(toSerialize) } func (o StockCollection) String() string { var ret string if o.TotalCount == nil { ret += "TotalCount:, " } else { ret += fmt.Sprintf("TotalCount:%v, ", *o.TotalCount) } ret += fmt.Sprintf("Data:%v, ", o.Data) if o.Limit == nil { ret += "Limit:, " } else { ret += fmt.Sprintf("Limit:%v, ", *o.Limit) } if o.Offset == nil { ret += "Offset:" } else { ret += fmt.Sprintf("Offset:%v", *o.Offset) } return fmt.Sprintf("StockCollection{%s}", ret) } func (o StockCollection) Clone() *StockCollection { ret := StockCollection{} if o.TotalCount != nil { ret.TotalCount = new(int64) *ret.TotalCount = *o.TotalCount } if o.Data != nil { ret.Data = make([]Stock, len(o.Data)) for i, item := range o.Data { ret.Data[i] = *item.Clone() } } if o.Limit != nil { ret.Limit = new(int64) *ret.Limit = *o.Limit } if o.Offset != nil { ret.Offset = new(int64) *ret.Offset = *o.Offset } return &ret } // StockRule type StockRule struct { // 最大发券数 MaxCoupons *int64 `json:"max_coupons"` // 总消耗金额,单位分 MaxAmount *int64 `json:"max_amount"` // 单天最高消耗金额,单位分 MaxAmountByDay *int64 `json:"max_amount_by_day,omitempty"` // 单个用户可领个数 MaxCouponsPerUser *int64 `json:"max_coupons_per_user"` // true-是;false-否,默认否 NaturalPersonLimit *bool `json:"natural_person_limit"` // true-是;false-否,默认否 PreventApiAbuse *bool `json:"prevent_api_abuse"` } func (o StockRule) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.MaxCoupons == nil { return nil, fmt.Errorf("field `MaxCoupons` is required and must be specified in StockRule") } toSerialize["max_coupons"] = o.MaxCoupons if o.MaxAmount == nil { return nil, fmt.Errorf("field `MaxAmount` is required and must be specified in StockRule") } toSerialize["max_amount"] = o.MaxAmount if o.MaxAmountByDay != nil { toSerialize["max_amount_by_day"] = o.MaxAmountByDay } if o.MaxCouponsPerUser == nil { return nil, fmt.Errorf("field `MaxCouponsPerUser` is required and must be specified in StockRule") } toSerialize["max_coupons_per_user"] = o.MaxCouponsPerUser if o.NaturalPersonLimit == nil { return nil, fmt.Errorf("field `NaturalPersonLimit` is required and must be specified in StockRule") } toSerialize["natural_person_limit"] = o.NaturalPersonLimit if o.PreventApiAbuse == nil { return nil, fmt.Errorf("field `PreventApiAbuse` is required and must be specified in StockRule") } toSerialize["prevent_api_abuse"] = o.PreventApiAbuse return json.Marshal(toSerialize) } func (o StockRule) String() string { var ret string if o.MaxCoupons == nil { ret += "MaxCoupons:, " } else { ret += fmt.Sprintf("MaxCoupons:%v, ", *o.MaxCoupons) } if o.MaxAmount == nil { ret += "MaxAmount:, " } else { ret += fmt.Sprintf("MaxAmount:%v, ", *o.MaxAmount) } if o.MaxAmountByDay == nil { ret += "MaxAmountByDay:, " } else { ret += fmt.Sprintf("MaxAmountByDay:%v, ", *o.MaxAmountByDay) } if o.MaxCouponsPerUser == nil { ret += "MaxCouponsPerUser:, " } else { ret += fmt.Sprintf("MaxCouponsPerUser:%v, ", *o.MaxCouponsPerUser) } if o.NaturalPersonLimit == nil { ret += "NaturalPersonLimit:, " } else { ret += fmt.Sprintf("NaturalPersonLimit:%v, ", *o.NaturalPersonLimit) } if o.PreventApiAbuse == nil { ret += "PreventApiAbuse:" } else { ret += fmt.Sprintf("PreventApiAbuse:%v", *o.PreventApiAbuse) } return fmt.Sprintf("StockRule{%s}", ret) } func (o StockRule) Clone() *StockRule { ret := StockRule{} if o.MaxCoupons != nil { ret.MaxCoupons = new(int64) *ret.MaxCoupons = *o.MaxCoupons } if o.MaxAmount != nil { ret.MaxAmount = new(int64) *ret.MaxAmount = *o.MaxAmount } if o.MaxAmountByDay != nil { ret.MaxAmountByDay = new(int64) *ret.MaxAmountByDay = *o.MaxAmountByDay } if o.MaxCouponsPerUser != nil { ret.MaxCouponsPerUser = new(int64) *ret.MaxCouponsPerUser = *o.MaxCouponsPerUser } if o.NaturalPersonLimit != nil { ret.NaturalPersonLimit = new(bool) *ret.NaturalPersonLimit = *o.NaturalPersonLimit } if o.PreventApiAbuse != nil { ret.PreventApiAbuse = new(bool) *ret.PreventApiAbuse = *o.PreventApiAbuse } return &ret } // StockUseRule type StockUseRule struct { // 最大发券数 MaxCoupons *int64 `json:"max_coupons"` // 总消耗金额,单位分 MaxAmount *int64 `json:"max_amount"` // 单天最高消耗金额,单位分 MaxAmountByDay *int64 `json:"max_amount_by_day"` // 固定面额发券批次特定信息 FixedNormalCoupon *FixedValueStockMsg `json:"fixed_normal_coupon,omitempty"` // 单个用户可领个数 MaxCouponsPerUser *int64 `json:"max_coupons_per_user"` // NORMAL-满减券;CUT_TO-减至券 CouponType *string `json:"coupon_type,omitempty"` // 订单优惠标记 GoodsTag []string `json:"goods_tag,omitempty"` // 默认不限制,可设置以下各种组合方式 1、付款码支付 2、小程序支付 3、其他支付 4、付款码支付&小程序支付 5、付款码支付&其他支付 TradeType []TradeType `json:"trade_type,omitempty"` // true-是;false-否 CombineUse *bool `json:"combine_use,omitempty"` } func (o StockUseRule) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.MaxCoupons == nil { return nil, fmt.Errorf("field `MaxCoupons` is required and must be specified in StockUseRule") } toSerialize["max_coupons"] = o.MaxCoupons if o.MaxAmount == nil { return nil, fmt.Errorf("field `MaxAmount` is required and must be specified in StockUseRule") } toSerialize["max_amount"] = o.MaxAmount if o.MaxAmountByDay == nil { return nil, fmt.Errorf("field `MaxAmountByDay` is required and must be specified in StockUseRule") } toSerialize["max_amount_by_day"] = o.MaxAmountByDay if o.FixedNormalCoupon != nil { toSerialize["fixed_normal_coupon"] = o.FixedNormalCoupon } if o.MaxCouponsPerUser == nil { return nil, fmt.Errorf("field `MaxCouponsPerUser` is required and must be specified in StockUseRule") } toSerialize["max_coupons_per_user"] = o.MaxCouponsPerUser if o.CouponType != nil { toSerialize["coupon_type"] = o.CouponType } if o.GoodsTag != nil { toSerialize["goods_tag"] = o.GoodsTag } if o.TradeType != nil { toSerialize["trade_type"] = o.TradeType } if o.CombineUse != nil { toSerialize["combine_use"] = o.CombineUse } return json.Marshal(toSerialize) } func (o StockUseRule) String() string { var ret string if o.MaxCoupons == nil { ret += "MaxCoupons:, " } else { ret += fmt.Sprintf("MaxCoupons:%v, ", *o.MaxCoupons) } if o.MaxAmount == nil { ret += "MaxAmount:, " } else { ret += fmt.Sprintf("MaxAmount:%v, ", *o.MaxAmount) } if o.MaxAmountByDay == nil { ret += "MaxAmountByDay:, " } else { ret += fmt.Sprintf("MaxAmountByDay:%v, ", *o.MaxAmountByDay) } ret += fmt.Sprintf("FixedNormalCoupon:%v, ", o.FixedNormalCoupon) if o.MaxCouponsPerUser == nil { ret += "MaxCouponsPerUser:, " } else { ret += fmt.Sprintf("MaxCouponsPerUser:%v, ", *o.MaxCouponsPerUser) } if o.CouponType == nil { ret += "CouponType:, " } else { ret += fmt.Sprintf("CouponType:%v, ", *o.CouponType) } ret += fmt.Sprintf("GoodsTag:%v, ", o.GoodsTag) ret += fmt.Sprintf("TradeType:%v, ", o.TradeType) if o.CombineUse == nil { ret += "CombineUse:" } else { ret += fmt.Sprintf("CombineUse:%v", *o.CombineUse) } return fmt.Sprintf("StockUseRule{%s}", ret) } func (o StockUseRule) Clone() *StockUseRule { ret := StockUseRule{} if o.MaxCoupons != nil { ret.MaxCoupons = new(int64) *ret.MaxCoupons = *o.MaxCoupons } if o.MaxAmount != nil { ret.MaxAmount = new(int64) *ret.MaxAmount = *o.MaxAmount } if o.MaxAmountByDay != nil { ret.MaxAmountByDay = new(int64) *ret.MaxAmountByDay = *o.MaxAmountByDay } if o.FixedNormalCoupon != nil { ret.FixedNormalCoupon = o.FixedNormalCoupon.Clone() } if o.MaxCouponsPerUser != nil { ret.MaxCouponsPerUser = new(int64) *ret.MaxCouponsPerUser = *o.MaxCouponsPerUser } if o.CouponType != nil { ret.CouponType = new(string) *ret.CouponType = *o.CouponType } if o.GoodsTag != nil { ret.GoodsTag = make([]string, len(o.GoodsTag)) for i, item := range o.GoodsTag { ret.GoodsTag[i] = item } } if o.TradeType != nil { ret.TradeType = make([]TradeType, len(o.TradeType)) for i, item := range o.TradeType { ret.TradeType[i] = item } } if o.CombineUse != nil { ret.CombineUse = new(bool) *ret.CombineUse = *o.CombineUse } return &ret } // StopStockBody type StopStockBody struct { // 批次创建方商户号 StockCreatorMchid *string `json:"stock_creator_mchid"` } func (o StopStockBody) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.StockCreatorMchid == nil { return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in StopStockBody") } toSerialize["stock_creator_mchid"] = o.StockCreatorMchid return json.Marshal(toSerialize) } func (o StopStockBody) String() string { var ret string if o.StockCreatorMchid == nil { ret += "StockCreatorMchid:" } else { ret += fmt.Sprintf("StockCreatorMchid:%v", *o.StockCreatorMchid) } return fmt.Sprintf("StopStockBody{%s}", ret) } func (o StopStockBody) Clone() *StopStockBody { ret := StopStockBody{} if o.StockCreatorMchid != nil { ret.StockCreatorMchid = new(string) *ret.StockCreatorMchid = *o.StockCreatorMchid } return &ret } // StopStockRequest type StopStockRequest struct { // 批次创建方商户号 StockCreatorMchid *string `json:"stock_creator_mchid"` // 批次号 StockId *string `json:"stock_id"` } func (o StopStockRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.StockCreatorMchid == nil { return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in StopStockRequest") } toSerialize["stock_creator_mchid"] = o.StockCreatorMchid if o.StockId == nil { return nil, fmt.Errorf("field `StockId` is required and must be specified in StopStockRequest") } toSerialize["stock_id"] = o.StockId return json.Marshal(toSerialize) } func (o StopStockRequest) String() string { var ret string if o.StockCreatorMchid == nil { ret += "StockCreatorMchid:, " } else { ret += fmt.Sprintf("StockCreatorMchid:%v, ", *o.StockCreatorMchid) } if o.StockId == nil { ret += "StockId:" } else { ret += fmt.Sprintf("StockId:%v", *o.StockId) } return fmt.Sprintf("StopStockRequest{%s}", ret) } func (o StopStockRequest) Clone() *StopStockRequest { ret := StopStockRequest{} if o.StockCreatorMchid != nil { ret.StockCreatorMchid = new(string) *ret.StockCreatorMchid = *o.StockCreatorMchid } if o.StockId != nil { ret.StockId = new(string) *ret.StockId = *o.StockId } return &ret } // StopStockResponse type StopStockResponse struct { // 暂停时间 StopTime *string `json:"stop_time"` // 批次号 StockId *string `json:"stock_id"` } func (o StopStockResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.StopTime == nil { return nil, fmt.Errorf("field `StopTime` is required and must be specified in StopStockResponse") } toSerialize["stop_time"] = o.StopTime if o.StockId == nil { return nil, fmt.Errorf("field `StockId` is required and must be specified in StopStockResponse") } toSerialize["stock_id"] = o.StockId return json.Marshal(toSerialize) } func (o StopStockResponse) String() string { var ret string if o.StopTime == nil { ret += "StopTime:, " } else { ret += fmt.Sprintf("StopTime:%v, ", *o.StopTime) } if o.StockId == nil { ret += "StockId:" } else { ret += fmt.Sprintf("StockId:%v", *o.StockId) } return fmt.Sprintf("StopStockResponse{%s}", ret) } func (o StopStockResponse) Clone() *StopStockResponse { ret := StopStockResponse{} if o.StopTime != nil { ret.StopTime = new(string) *ret.StopTime = *o.StopTime } if o.StockId != nil { ret.StockId = new(string) *ret.StockId = *o.StockId } return &ret } // TradeType type TradeType string func (e TradeType) Ptr() *TradeType { return &e } // Enums of TradeType const ( TRADETYPE_MICROAPP TradeType = "MICROAPP" TRADETYPE_APPPAY TradeType = "APPPAY" TRADETYPE_PPAY TradeType = "PPAY" TRADETYPE_CARD TradeType = "CARD" TRADETYPE_FACE TradeType = "FACE" TRADETYPE_OTHER TradeType = "OTHER" ) // UseFlowRequest type UseFlowRequest struct { // 批次号 StockId *string `json:"stock_id"` } func (o UseFlowRequest) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.StockId == nil { return nil, fmt.Errorf("field `StockId` is required and must be specified in UseFlowRequest") } toSerialize["stock_id"] = o.StockId return json.Marshal(toSerialize) } func (o UseFlowRequest) String() string { var ret string if o.StockId == nil { ret += "StockId:" } else { ret += fmt.Sprintf("StockId:%v", *o.StockId) } return fmt.Sprintf("UseFlowRequest{%s}", ret) } func (o UseFlowRequest) Clone() *UseFlowRequest { ret := UseFlowRequest{} if o.StockId != nil { ret.StockId = new(string) *ret.StockId = *o.StockId } return &ret } // UseFlowResponse type UseFlowResponse struct { // 流水文件下载链接,30s内有效 Url *string `json:"url"` // 文件内容的哈希值,防止篡改 HashValue *string `json:"hash_value"` // 哈希算法类型,目前只支持sha1 HashType *string `json:"hash_type"` } func (o UseFlowResponse) MarshalJSON() ([]byte, error) { toSerialize := map[string]interface{}{} if o.Url == nil { return nil, fmt.Errorf("field `Url` is required and must be specified in UseFlowResponse") } toSerialize["url"] = o.Url if o.HashValue == nil { return nil, fmt.Errorf("field `HashValue` is required and must be specified in UseFlowResponse") } toSerialize["hash_value"] = o.HashValue if o.HashType == nil { return nil, fmt.Errorf("field `HashType` is required and must be specified in UseFlowResponse") } toSerialize["hash_type"] = o.HashType return json.Marshal(toSerialize) } func (o UseFlowResponse) String() string { var ret string if o.Url == nil { ret += "Url:, " } else { ret += fmt.Sprintf("Url:%v, ", *o.Url) } if o.HashValue == nil { ret += "HashValue:, " } else { ret += fmt.Sprintf("HashValue:%v, ", *o.HashValue) } if o.HashType == nil { ret += "HashType:" } else { ret += fmt.Sprintf("HashType:%v", *o.HashType) } return fmt.Sprintf("UseFlowResponse{%s}", ret) } func (o UseFlowResponse) Clone() *UseFlowResponse { ret := UseFlowResponse{} if o.Url != nil { ret.Url = new(string) *ret.Url = *o.Url } if o.HashValue != nil { ret.HashValue = new(string) *ret.HashValue = *o.HashValue } if o.HashType != nil { ret.HashType = new(string) *ret.HashType = *o.HashType } return &ret }