models.go 117 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789
  1. // Copyright 2021 Tencent Inc. All rights reserved.
  2. //
  3. // 微信支付营销系统开放API
  4. //
  5. // 新增立减金api
  6. //
  7. // API version: 3.4.0
  8. // Code generated by WechatPay APIv3 Generator based on [OpenAPI Generator](https://openapi-generator.tech); DO NOT EDIT.
  9. package cashcoupons
  10. import (
  11. "encoding/json"
  12. "fmt"
  13. )
  14. // AvailableMerchantCollection
  15. type AvailableMerchantCollection struct {
  16. // 可用商户总数量
  17. TotalCount *int64 `json:"total_count"`
  18. // 可用商户列表
  19. Data []string `json:"data,omitempty"`
  20. // 分页页码
  21. Offset *int64 `json:"offset"`
  22. // 分页大小
  23. Limit *int64 `json:"limit"`
  24. // 批次号
  25. StockId *string `json:"stock_id"`
  26. }
  27. func (o AvailableMerchantCollection) MarshalJSON() ([]byte, error) {
  28. toSerialize := map[string]interface{}{}
  29. if o.TotalCount == nil {
  30. return nil, fmt.Errorf("field `TotalCount` is required and must be specified in AvailableMerchantCollection")
  31. }
  32. toSerialize["total_count"] = o.TotalCount
  33. if o.Data != nil {
  34. toSerialize["data"] = o.Data
  35. }
  36. if o.Offset == nil {
  37. return nil, fmt.Errorf("field `Offset` is required and must be specified in AvailableMerchantCollection")
  38. }
  39. toSerialize["offset"] = o.Offset
  40. if o.Limit == nil {
  41. return nil, fmt.Errorf("field `Limit` is required and must be specified in AvailableMerchantCollection")
  42. }
  43. toSerialize["limit"] = o.Limit
  44. if o.StockId == nil {
  45. return nil, fmt.Errorf("field `StockId` is required and must be specified in AvailableMerchantCollection")
  46. }
  47. toSerialize["stock_id"] = o.StockId
  48. return json.Marshal(toSerialize)
  49. }
  50. func (o AvailableMerchantCollection) String() string {
  51. var ret string
  52. if o.TotalCount == nil {
  53. ret += "TotalCount:<nil>, "
  54. } else {
  55. ret += fmt.Sprintf("TotalCount:%v, ", *o.TotalCount)
  56. }
  57. ret += fmt.Sprintf("Data:%v, ", o.Data)
  58. if o.Offset == nil {
  59. ret += "Offset:<nil>, "
  60. } else {
  61. ret += fmt.Sprintf("Offset:%v, ", *o.Offset)
  62. }
  63. if o.Limit == nil {
  64. ret += "Limit:<nil>, "
  65. } else {
  66. ret += fmt.Sprintf("Limit:%v, ", *o.Limit)
  67. }
  68. if o.StockId == nil {
  69. ret += "StockId:<nil>"
  70. } else {
  71. ret += fmt.Sprintf("StockId:%v", *o.StockId)
  72. }
  73. return fmt.Sprintf("AvailableMerchantCollection{%s}", ret)
  74. }
  75. func (o AvailableMerchantCollection) Clone() *AvailableMerchantCollection {
  76. ret := AvailableMerchantCollection{}
  77. if o.TotalCount != nil {
  78. ret.TotalCount = new(int64)
  79. *ret.TotalCount = *o.TotalCount
  80. }
  81. if o.Data != nil {
  82. ret.Data = make([]string, len(o.Data))
  83. for i, item := range o.Data {
  84. ret.Data[i] = item
  85. }
  86. }
  87. if o.Offset != nil {
  88. ret.Offset = new(int64)
  89. *ret.Offset = *o.Offset
  90. }
  91. if o.Limit != nil {
  92. ret.Limit = new(int64)
  93. *ret.Limit = *o.Limit
  94. }
  95. if o.StockId != nil {
  96. ret.StockId = new(string)
  97. *ret.StockId = *o.StockId
  98. }
  99. return &ret
  100. }
  101. // AvailableSingleitemCollection
  102. type AvailableSingleitemCollection struct {
  103. // 可用单品编码总数
  104. TotalCount *int64 `json:"total_count"`
  105. // 可用单品编码
  106. Data []string `json:"data,omitempty"`
  107. // 分页页码
  108. Offset *int64 `json:"offset"`
  109. // 分页大小
  110. Limit *int64 `json:"limit"`
  111. // 批次号
  112. StockId *string `json:"stock_id"`
  113. }
  114. func (o AvailableSingleitemCollection) MarshalJSON() ([]byte, error) {
  115. toSerialize := map[string]interface{}{}
  116. if o.TotalCount == nil {
  117. return nil, fmt.Errorf("field `TotalCount` is required and must be specified in AvailableSingleitemCollection")
  118. }
  119. toSerialize["total_count"] = o.TotalCount
  120. if o.Data != nil {
  121. toSerialize["data"] = o.Data
  122. }
  123. if o.Offset == nil {
  124. return nil, fmt.Errorf("field `Offset` is required and must be specified in AvailableSingleitemCollection")
  125. }
  126. toSerialize["offset"] = o.Offset
  127. if o.Limit == nil {
  128. return nil, fmt.Errorf("field `Limit` is required and must be specified in AvailableSingleitemCollection")
  129. }
  130. toSerialize["limit"] = o.Limit
  131. if o.StockId == nil {
  132. return nil, fmt.Errorf("field `StockId` is required and must be specified in AvailableSingleitemCollection")
  133. }
  134. toSerialize["stock_id"] = o.StockId
  135. return json.Marshal(toSerialize)
  136. }
  137. func (o AvailableSingleitemCollection) String() string {
  138. var ret string
  139. if o.TotalCount == nil {
  140. ret += "TotalCount:<nil>, "
  141. } else {
  142. ret += fmt.Sprintf("TotalCount:%v, ", *o.TotalCount)
  143. }
  144. ret += fmt.Sprintf("Data:%v, ", o.Data)
  145. if o.Offset == nil {
  146. ret += "Offset:<nil>, "
  147. } else {
  148. ret += fmt.Sprintf("Offset:%v, ", *o.Offset)
  149. }
  150. if o.Limit == nil {
  151. ret += "Limit:<nil>, "
  152. } else {
  153. ret += fmt.Sprintf("Limit:%v, ", *o.Limit)
  154. }
  155. if o.StockId == nil {
  156. ret += "StockId:<nil>"
  157. } else {
  158. ret += fmt.Sprintf("StockId:%v", *o.StockId)
  159. }
  160. return fmt.Sprintf("AvailableSingleitemCollection{%s}", ret)
  161. }
  162. func (o AvailableSingleitemCollection) Clone() *AvailableSingleitemCollection {
  163. ret := AvailableSingleitemCollection{}
  164. if o.TotalCount != nil {
  165. ret.TotalCount = new(int64)
  166. *ret.TotalCount = *o.TotalCount
  167. }
  168. if o.Data != nil {
  169. ret.Data = make([]string, len(o.Data))
  170. for i, item := range o.Data {
  171. ret.Data[i] = item
  172. }
  173. }
  174. if o.Offset != nil {
  175. ret.Offset = new(int64)
  176. *ret.Offset = *o.Offset
  177. }
  178. if o.Limit != nil {
  179. ret.Limit = new(int64)
  180. *ret.Limit = *o.Limit
  181. }
  182. if o.StockId != nil {
  183. ret.StockId = new(string)
  184. *ret.StockId = *o.StockId
  185. }
  186. return &ret
  187. }
  188. // BackgroundColor
  189. type BackgroundColor string
  190. func (e BackgroundColor) Ptr() *BackgroundColor {
  191. return &e
  192. }
  193. // Enums of BackgroundColor
  194. const (
  195. BACKGROUNDCOLOR_COLOR010 BackgroundColor = "COLOR010"
  196. BACKGROUNDCOLOR_COLOR020 BackgroundColor = "COLOR020"
  197. BACKGROUNDCOLOR_COLOR030 BackgroundColor = "COLOR030"
  198. BACKGROUNDCOLOR_COLOR040 BackgroundColor = "COLOR040"
  199. BACKGROUNDCOLOR_COLOR050 BackgroundColor = "COLOR050"
  200. BACKGROUNDCOLOR_COLOR060 BackgroundColor = "COLOR060"
  201. BACKGROUNDCOLOR_COLOR070 BackgroundColor = "COLOR070"
  202. BACKGROUNDCOLOR_COLOR080 BackgroundColor = "COLOR080"
  203. BACKGROUNDCOLOR_COLOR081 BackgroundColor = "COLOR081"
  204. BACKGROUNDCOLOR_COLOR082 BackgroundColor = "COLOR082"
  205. BACKGROUNDCOLOR_COLOR090 BackgroundColor = "COLOR090"
  206. BACKGROUNDCOLOR_COLOR100 BackgroundColor = "COLOR100"
  207. BACKGROUNDCOLOR_COLOR101 BackgroundColor = "COLOR101"
  208. BACKGROUNDCOLOR_COLOR102 BackgroundColor = "COLOR102"
  209. )
  210. // Callback
  211. type Callback struct {
  212. // 通知地址
  213. NotifyUrl *string `json:"notify_url"`
  214. // 商户号
  215. Mchid *string `json:"mchid"`
  216. }
  217. func (o Callback) MarshalJSON() ([]byte, error) {
  218. toSerialize := map[string]interface{}{}
  219. if o.NotifyUrl == nil {
  220. return nil, fmt.Errorf("field `NotifyUrl` is required and must be specified in Callback")
  221. }
  222. toSerialize["notify_url"] = o.NotifyUrl
  223. if o.Mchid == nil {
  224. return nil, fmt.Errorf("field `Mchid` is required and must be specified in Callback")
  225. }
  226. toSerialize["mchid"] = o.Mchid
  227. return json.Marshal(toSerialize)
  228. }
  229. func (o Callback) String() string {
  230. var ret string
  231. if o.NotifyUrl == nil {
  232. ret += "NotifyUrl:<nil>, "
  233. } else {
  234. ret += fmt.Sprintf("NotifyUrl:%v, ", *o.NotifyUrl)
  235. }
  236. if o.Mchid == nil {
  237. ret += "Mchid:<nil>"
  238. } else {
  239. ret += fmt.Sprintf("Mchid:%v", *o.Mchid)
  240. }
  241. return fmt.Sprintf("Callback{%s}", ret)
  242. }
  243. func (o Callback) Clone() *Callback {
  244. ret := Callback{}
  245. if o.NotifyUrl != nil {
  246. ret.NotifyUrl = new(string)
  247. *ret.NotifyUrl = *o.NotifyUrl
  248. }
  249. if o.Mchid != nil {
  250. ret.Mchid = new(string)
  251. *ret.Mchid = *o.Mchid
  252. }
  253. return &ret
  254. }
  255. // CardLimitation
  256. type CardLimitation struct {
  257. // 当批次指定支付方式为银行卡且配置了指定银行卡信息,该字段必填,最多4个中文字符。并将在微信支付收银台中展示给用户。
  258. Name *string `json:"name"`
  259. // 当批次指定支付方式为银行卡且配置了指定银行卡信息,该字段必填,按json格式。特殊规则:单个卡BIN的字符长度为[6,9],条目个数限制为[1,10]
  260. Bin []string `json:"bin"`
  261. }
  262. func (o CardLimitation) MarshalJSON() ([]byte, error) {
  263. toSerialize := map[string]interface{}{}
  264. if o.Name == nil {
  265. return nil, fmt.Errorf("field `Name` is required and must be specified in CardLimitation")
  266. }
  267. toSerialize["name"] = o.Name
  268. if o.Bin == nil {
  269. return nil, fmt.Errorf("field `Bin` is required and must be specified in CardLimitation")
  270. }
  271. toSerialize["bin"] = o.Bin
  272. return json.Marshal(toSerialize)
  273. }
  274. func (o CardLimitation) String() string {
  275. var ret string
  276. if o.Name == nil {
  277. ret += "Name:<nil>, "
  278. } else {
  279. ret += fmt.Sprintf("Name:%v, ", *o.Name)
  280. }
  281. ret += fmt.Sprintf("Bin:%v", o.Bin)
  282. return fmt.Sprintf("CardLimitation{%s}", ret)
  283. }
  284. func (o CardLimitation) Clone() *CardLimitation {
  285. ret := CardLimitation{}
  286. if o.Name != nil {
  287. ret.Name = new(string)
  288. *ret.Name = *o.Name
  289. }
  290. if o.Bin != nil {
  291. ret.Bin = make([]string, len(o.Bin))
  292. for i, item := range o.Bin {
  293. ret.Bin[i] = item
  294. }
  295. }
  296. return &ret
  297. }
  298. // Coupon
  299. type Coupon struct {
  300. // 微信为创建方商户分配的商户号
  301. StockCreatorMchid *string `json:"stock_creator_mchid"`
  302. // 批次id
  303. StockId *string `json:"stock_id"`
  304. // 单品优惠特定信息
  305. CutToMessage *CutTypeMsg `json:"cut_to_message,omitempty"`
  306. // 代金券名称
  307. CouponName *string `json:"coupon_name"`
  308. // 代金券状态:SENDED-可用,USED-已实扣,EXPIRED-已过期
  309. Status *string `json:"status"`
  310. // 代金券描述说明字段
  311. Description *string `json:"description"`
  312. // 领券时间
  313. CreateTime *string `json:"create_time"`
  314. // NORMAL-满减券;CUT_TO-减至券
  315. CouponType *string `json:"coupon_type"`
  316. // true-是;false-否
  317. NoCash *bool `json:"no_cash"`
  318. // 可用开始时间
  319. AvailableBeginTime *string `json:"available_begin_time"`
  320. // 可用结束时间
  321. AvailableEndTime *string `json:"available_end_time"`
  322. // TRUE-是;FALSE-否
  323. Singleitem *bool `json:"singleitem"`
  324. // 普通满减券面额、门槛信息
  325. NormalCouponInformation *FixedValueStockMsg `json:"normal_coupon_information,omitempty"`
  326. }
  327. func (o Coupon) MarshalJSON() ([]byte, error) {
  328. toSerialize := map[string]interface{}{}
  329. if o.StockCreatorMchid == nil {
  330. return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in Coupon")
  331. }
  332. toSerialize["stock_creator_mchid"] = o.StockCreatorMchid
  333. if o.StockId == nil {
  334. return nil, fmt.Errorf("field `StockId` is required and must be specified in Coupon")
  335. }
  336. toSerialize["stock_id"] = o.StockId
  337. if o.CutToMessage != nil {
  338. toSerialize["cut_to_message"] = o.CutToMessage
  339. }
  340. if o.CouponName == nil {
  341. return nil, fmt.Errorf("field `CouponName` is required and must be specified in Coupon")
  342. }
  343. toSerialize["coupon_name"] = o.CouponName
  344. if o.Status == nil {
  345. return nil, fmt.Errorf("field `Status` is required and must be specified in Coupon")
  346. }
  347. toSerialize["status"] = o.Status
  348. if o.Description == nil {
  349. return nil, fmt.Errorf("field `Description` is required and must be specified in Coupon")
  350. }
  351. toSerialize["description"] = o.Description
  352. if o.CreateTime == nil {
  353. return nil, fmt.Errorf("field `CreateTime` is required and must be specified in Coupon")
  354. }
  355. toSerialize["create_time"] = o.CreateTime
  356. if o.CouponType == nil {
  357. return nil, fmt.Errorf("field `CouponType` is required and must be specified in Coupon")
  358. }
  359. toSerialize["coupon_type"] = o.CouponType
  360. if o.NoCash == nil {
  361. return nil, fmt.Errorf("field `NoCash` is required and must be specified in Coupon")
  362. }
  363. toSerialize["no_cash"] = o.NoCash
  364. if o.AvailableBeginTime == nil {
  365. return nil, fmt.Errorf("field `AvailableBeginTime` is required and must be specified in Coupon")
  366. }
  367. toSerialize["available_begin_time"] = o.AvailableBeginTime
  368. if o.AvailableEndTime == nil {
  369. return nil, fmt.Errorf("field `AvailableEndTime` is required and must be specified in Coupon")
  370. }
  371. toSerialize["available_end_time"] = o.AvailableEndTime
  372. if o.Singleitem == nil {
  373. return nil, fmt.Errorf("field `Singleitem` is required and must be specified in Coupon")
  374. }
  375. toSerialize["singleitem"] = o.Singleitem
  376. if o.NormalCouponInformation != nil {
  377. toSerialize["normal_coupon_information"] = o.NormalCouponInformation
  378. }
  379. return json.Marshal(toSerialize)
  380. }
  381. func (o Coupon) String() string {
  382. var ret string
  383. if o.StockCreatorMchid == nil {
  384. ret += "StockCreatorMchid:<nil>, "
  385. } else {
  386. ret += fmt.Sprintf("StockCreatorMchid:%v, ", *o.StockCreatorMchid)
  387. }
  388. if o.StockId == nil {
  389. ret += "StockId:<nil>, "
  390. } else {
  391. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  392. }
  393. ret += fmt.Sprintf("CutToMessage:%v, ", o.CutToMessage)
  394. if o.CouponName == nil {
  395. ret += "CouponName:<nil>, "
  396. } else {
  397. ret += fmt.Sprintf("CouponName:%v, ", *o.CouponName)
  398. }
  399. if o.Status == nil {
  400. ret += "Status:<nil>, "
  401. } else {
  402. ret += fmt.Sprintf("Status:%v, ", *o.Status)
  403. }
  404. if o.Description == nil {
  405. ret += "Description:<nil>, "
  406. } else {
  407. ret += fmt.Sprintf("Description:%v, ", *o.Description)
  408. }
  409. if o.CreateTime == nil {
  410. ret += "CreateTime:<nil>, "
  411. } else {
  412. ret += fmt.Sprintf("CreateTime:%v, ", *o.CreateTime)
  413. }
  414. if o.CouponType == nil {
  415. ret += "CouponType:<nil>, "
  416. } else {
  417. ret += fmt.Sprintf("CouponType:%v, ", *o.CouponType)
  418. }
  419. if o.NoCash == nil {
  420. ret += "NoCash:<nil>, "
  421. } else {
  422. ret += fmt.Sprintf("NoCash:%v, ", *o.NoCash)
  423. }
  424. if o.AvailableBeginTime == nil {
  425. ret += "AvailableBeginTime:<nil>, "
  426. } else {
  427. ret += fmt.Sprintf("AvailableBeginTime:%v, ", *o.AvailableBeginTime)
  428. }
  429. if o.AvailableEndTime == nil {
  430. ret += "AvailableEndTime:<nil>, "
  431. } else {
  432. ret += fmt.Sprintf("AvailableEndTime:%v, ", *o.AvailableEndTime)
  433. }
  434. if o.Singleitem == nil {
  435. ret += "Singleitem:<nil>, "
  436. } else {
  437. ret += fmt.Sprintf("Singleitem:%v, ", *o.Singleitem)
  438. }
  439. ret += fmt.Sprintf("NormalCouponInformation:%v", o.NormalCouponInformation)
  440. return fmt.Sprintf("Coupon{%s}", ret)
  441. }
  442. func (o Coupon) Clone() *Coupon {
  443. ret := Coupon{}
  444. if o.StockCreatorMchid != nil {
  445. ret.StockCreatorMchid = new(string)
  446. *ret.StockCreatorMchid = *o.StockCreatorMchid
  447. }
  448. if o.StockId != nil {
  449. ret.StockId = new(string)
  450. *ret.StockId = *o.StockId
  451. }
  452. if o.CutToMessage != nil {
  453. ret.CutToMessage = o.CutToMessage.Clone()
  454. }
  455. if o.CouponName != nil {
  456. ret.CouponName = new(string)
  457. *ret.CouponName = *o.CouponName
  458. }
  459. if o.Status != nil {
  460. ret.Status = new(string)
  461. *ret.Status = *o.Status
  462. }
  463. if o.Description != nil {
  464. ret.Description = new(string)
  465. *ret.Description = *o.Description
  466. }
  467. if o.CreateTime != nil {
  468. ret.CreateTime = new(string)
  469. *ret.CreateTime = *o.CreateTime
  470. }
  471. if o.CouponType != nil {
  472. ret.CouponType = new(string)
  473. *ret.CouponType = *o.CouponType
  474. }
  475. if o.NoCash != nil {
  476. ret.NoCash = new(bool)
  477. *ret.NoCash = *o.NoCash
  478. }
  479. if o.AvailableBeginTime != nil {
  480. ret.AvailableBeginTime = new(string)
  481. *ret.AvailableBeginTime = *o.AvailableBeginTime
  482. }
  483. if o.AvailableEndTime != nil {
  484. ret.AvailableEndTime = new(string)
  485. *ret.AvailableEndTime = *o.AvailableEndTime
  486. }
  487. if o.Singleitem != nil {
  488. ret.Singleitem = new(bool)
  489. *ret.Singleitem = *o.Singleitem
  490. }
  491. if o.NormalCouponInformation != nil {
  492. ret.NormalCouponInformation = o.NormalCouponInformation.Clone()
  493. }
  494. return &ret
  495. }
  496. // CouponCollection
  497. type CouponCollection struct {
  498. // 结果集
  499. Data []Coupon `json:"data,omitempty"`
  500. // 查询结果总数
  501. TotalCount *int64 `json:"total_count"`
  502. // 分页大小
  503. Limit *int64 `json:"limit"`
  504. // 分页页码
  505. Offset *int64 `json:"offset"`
  506. }
  507. func (o CouponCollection) MarshalJSON() ([]byte, error) {
  508. toSerialize := map[string]interface{}{}
  509. if o.Data != nil {
  510. toSerialize["data"] = o.Data
  511. }
  512. if o.TotalCount == nil {
  513. return nil, fmt.Errorf("field `TotalCount` is required and must be specified in CouponCollection")
  514. }
  515. toSerialize["total_count"] = o.TotalCount
  516. if o.Limit == nil {
  517. return nil, fmt.Errorf("field `Limit` is required and must be specified in CouponCollection")
  518. }
  519. toSerialize["limit"] = o.Limit
  520. if o.Offset == nil {
  521. return nil, fmt.Errorf("field `Offset` is required and must be specified in CouponCollection")
  522. }
  523. toSerialize["offset"] = o.Offset
  524. return json.Marshal(toSerialize)
  525. }
  526. func (o CouponCollection) String() string {
  527. var ret string
  528. ret += fmt.Sprintf("Data:%v, ", o.Data)
  529. if o.TotalCount == nil {
  530. ret += "TotalCount:<nil>, "
  531. } else {
  532. ret += fmt.Sprintf("TotalCount:%v, ", *o.TotalCount)
  533. }
  534. if o.Limit == nil {
  535. ret += "Limit:<nil>, "
  536. } else {
  537. ret += fmt.Sprintf("Limit:%v, ", *o.Limit)
  538. }
  539. if o.Offset == nil {
  540. ret += "Offset:<nil>"
  541. } else {
  542. ret += fmt.Sprintf("Offset:%v", *o.Offset)
  543. }
  544. return fmt.Sprintf("CouponCollection{%s}", ret)
  545. }
  546. func (o CouponCollection) Clone() *CouponCollection {
  547. ret := CouponCollection{}
  548. if o.Data != nil {
  549. ret.Data = make([]Coupon, len(o.Data))
  550. for i, item := range o.Data {
  551. ret.Data[i] = *item.Clone()
  552. }
  553. }
  554. if o.TotalCount != nil {
  555. ret.TotalCount = new(int64)
  556. *ret.TotalCount = *o.TotalCount
  557. }
  558. if o.Limit != nil {
  559. ret.Limit = new(int64)
  560. *ret.Limit = *o.Limit
  561. }
  562. if o.Offset != nil {
  563. ret.Offset = new(int64)
  564. *ret.Offset = *o.Offset
  565. }
  566. return &ret
  567. }
  568. // CouponRule
  569. type CouponRule struct {
  570. // 需要指定领取后延时生效可选填
  571. CouponAvailableTime *FavorAvailableTime `json:"coupon_available_time,omitempty"`
  572. // stock_type为NORMAL时必填
  573. FixedNormalCoupon *FixedValueStockMsg `json:"fixed_normal_coupon,omitempty"`
  574. // 订单优惠标记
  575. GoodsTag []string `json:"goods_tag,omitempty"`
  576. // 支付方式
  577. TradeType []TradeType `json:"trade_type,omitempty"`
  578. // true-是;false-否
  579. CombineUse *bool `json:"combine_use,omitempty"`
  580. // 可核销商品编码
  581. AvailableItems []string `json:"available_items,omitempty"`
  582. // 不参与优惠商品编码
  583. UnavailableItems []string `json:"unavailable_items,omitempty"`
  584. // 可核销商户号
  585. AvailableMerchants []string `json:"available_merchants,omitempty"`
  586. // 当批次指定支付方式为某张银行卡时才生效,可选的
  587. LimitCard *CardLimitation `json:"limit_card,omitempty"`
  588. // 限定该批次的指定支付方式,如零钱、指定银行卡等,需填入支付方式编码, 条目个数限制为[1,1] 。当前支持的支付方式,及其编码枚举值,请参考该文档: https://docs.qq.com/sheet/DWGpMbWx3b1JCbldy?c=E3A0A0
  589. LimitPay []string `json:"limit_pay,omitempty"`
  590. }
  591. func (o CouponRule) MarshalJSON() ([]byte, error) {
  592. toSerialize := map[string]interface{}{}
  593. if o.CouponAvailableTime != nil {
  594. toSerialize["coupon_available_time"] = o.CouponAvailableTime
  595. }
  596. if o.FixedNormalCoupon != nil {
  597. toSerialize["fixed_normal_coupon"] = o.FixedNormalCoupon
  598. }
  599. if o.GoodsTag != nil {
  600. toSerialize["goods_tag"] = o.GoodsTag
  601. }
  602. if o.TradeType != nil {
  603. toSerialize["trade_type"] = o.TradeType
  604. }
  605. if o.CombineUse != nil {
  606. toSerialize["combine_use"] = o.CombineUse
  607. }
  608. if o.AvailableItems != nil {
  609. toSerialize["available_items"] = o.AvailableItems
  610. }
  611. if o.UnavailableItems != nil {
  612. toSerialize["unavailable_items"] = o.UnavailableItems
  613. }
  614. if o.AvailableMerchants != nil {
  615. toSerialize["available_merchants"] = o.AvailableMerchants
  616. }
  617. if o.LimitCard != nil {
  618. toSerialize["limit_card"] = o.LimitCard
  619. }
  620. if o.LimitPay != nil {
  621. toSerialize["limit_pay"] = o.LimitPay
  622. }
  623. return json.Marshal(toSerialize)
  624. }
  625. func (o CouponRule) String() string {
  626. var ret string
  627. ret += fmt.Sprintf("CouponAvailableTime:%v, ", o.CouponAvailableTime)
  628. ret += fmt.Sprintf("FixedNormalCoupon:%v, ", o.FixedNormalCoupon)
  629. ret += fmt.Sprintf("GoodsTag:%v, ", o.GoodsTag)
  630. ret += fmt.Sprintf("TradeType:%v, ", o.TradeType)
  631. if o.CombineUse == nil {
  632. ret += "CombineUse:<nil>, "
  633. } else {
  634. ret += fmt.Sprintf("CombineUse:%v, ", *o.CombineUse)
  635. }
  636. ret += fmt.Sprintf("AvailableItems:%v, ", o.AvailableItems)
  637. ret += fmt.Sprintf("UnavailableItems:%v, ", o.UnavailableItems)
  638. ret += fmt.Sprintf("AvailableMerchants:%v, ", o.AvailableMerchants)
  639. ret += fmt.Sprintf("LimitCard:%v, ", o.LimitCard)
  640. ret += fmt.Sprintf("LimitPay:%v", o.LimitPay)
  641. return fmt.Sprintf("CouponRule{%s}", ret)
  642. }
  643. func (o CouponRule) Clone() *CouponRule {
  644. ret := CouponRule{}
  645. if o.CouponAvailableTime != nil {
  646. ret.CouponAvailableTime = o.CouponAvailableTime.Clone()
  647. }
  648. if o.FixedNormalCoupon != nil {
  649. ret.FixedNormalCoupon = o.FixedNormalCoupon.Clone()
  650. }
  651. if o.GoodsTag != nil {
  652. ret.GoodsTag = make([]string, len(o.GoodsTag))
  653. for i, item := range o.GoodsTag {
  654. ret.GoodsTag[i] = item
  655. }
  656. }
  657. if o.TradeType != nil {
  658. ret.TradeType = make([]TradeType, len(o.TradeType))
  659. for i, item := range o.TradeType {
  660. ret.TradeType[i] = item
  661. }
  662. }
  663. if o.CombineUse != nil {
  664. ret.CombineUse = new(bool)
  665. *ret.CombineUse = *o.CombineUse
  666. }
  667. if o.AvailableItems != nil {
  668. ret.AvailableItems = make([]string, len(o.AvailableItems))
  669. for i, item := range o.AvailableItems {
  670. ret.AvailableItems[i] = item
  671. }
  672. }
  673. if o.UnavailableItems != nil {
  674. ret.UnavailableItems = make([]string, len(o.UnavailableItems))
  675. for i, item := range o.UnavailableItems {
  676. ret.UnavailableItems[i] = item
  677. }
  678. }
  679. if o.AvailableMerchants != nil {
  680. ret.AvailableMerchants = make([]string, len(o.AvailableMerchants))
  681. for i, item := range o.AvailableMerchants {
  682. ret.AvailableMerchants[i] = item
  683. }
  684. }
  685. if o.LimitCard != nil {
  686. ret.LimitCard = o.LimitCard.Clone()
  687. }
  688. if o.LimitPay != nil {
  689. ret.LimitPay = make([]string, len(o.LimitPay))
  690. for i, item := range o.LimitPay {
  691. ret.LimitPay[i] = item
  692. }
  693. }
  694. return &ret
  695. }
  696. // CreateCouponStockRequest
  697. type CreateCouponStockRequest struct {
  698. // 批次名称
  699. StockName *string `json:"stock_name"`
  700. // 仅配置商户可见,用于自定义信息
  701. Comment *string `json:"comment,omitempty"`
  702. // 批次归属商户号
  703. BelongMerchant *string `json:"belong_merchant"`
  704. // 批次开始时间
  705. AvailableBeginTime *string `json:"available_begin_time"`
  706. // 批次结束时间
  707. AvailableEndTime *string `json:"available_end_time"`
  708. // 批次使用规则
  709. StockUseRule *StockRule `json:"stock_use_rule"`
  710. // 代金券详情页
  711. PatternInfo *PatternInfo `json:"pattern_info,omitempty"`
  712. //
  713. CouponUseRule *CouponRule `json:"coupon_use_rule"`
  714. // 是否无资金流,true-是;false-否
  715. NoCash *bool `json:"no_cash"`
  716. // 批次类型,NORMAL-固定面额满减券批次;DISCOUNT-折扣券批次;EXCHAHGE-换购券批次;RANDOM-千人千面券批次
  717. StockType *string `json:"stock_type"`
  718. // 商户创建批次凭据号(格式:商户id+日期+流水号),商户侧需保持唯一性
  719. OutRequestNo *string `json:"out_request_no"`
  720. // 扩展属性字段,按json格式,暂时无需填写
  721. ExtInfo *string `json:"ext_info,omitempty"`
  722. }
  723. func (o CreateCouponStockRequest) MarshalJSON() ([]byte, error) {
  724. toSerialize := map[string]interface{}{}
  725. if o.StockName == nil {
  726. return nil, fmt.Errorf("field `StockName` is required and must be specified in CreateCouponStockRequest")
  727. }
  728. toSerialize["stock_name"] = o.StockName
  729. if o.Comment != nil {
  730. toSerialize["comment"] = o.Comment
  731. }
  732. if o.BelongMerchant == nil {
  733. return nil, fmt.Errorf("field `BelongMerchant` is required and must be specified in CreateCouponStockRequest")
  734. }
  735. toSerialize["belong_merchant"] = o.BelongMerchant
  736. if o.AvailableBeginTime == nil {
  737. return nil, fmt.Errorf("field `AvailableBeginTime` is required and must be specified in CreateCouponStockRequest")
  738. }
  739. toSerialize["available_begin_time"] = o.AvailableBeginTime
  740. if o.AvailableEndTime == nil {
  741. return nil, fmt.Errorf("field `AvailableEndTime` is required and must be specified in CreateCouponStockRequest")
  742. }
  743. toSerialize["available_end_time"] = o.AvailableEndTime
  744. if o.StockUseRule == nil {
  745. return nil, fmt.Errorf("field `StockUseRule` is required and must be specified in CreateCouponStockRequest")
  746. }
  747. toSerialize["stock_use_rule"] = o.StockUseRule
  748. if o.PatternInfo != nil {
  749. toSerialize["pattern_info"] = o.PatternInfo
  750. }
  751. if o.CouponUseRule == nil {
  752. return nil, fmt.Errorf("field `CouponUseRule` is required and must be specified in CreateCouponStockRequest")
  753. }
  754. toSerialize["coupon_use_rule"] = o.CouponUseRule
  755. if o.NoCash == nil {
  756. return nil, fmt.Errorf("field `NoCash` is required and must be specified in CreateCouponStockRequest")
  757. }
  758. toSerialize["no_cash"] = o.NoCash
  759. if o.StockType == nil {
  760. return nil, fmt.Errorf("field `StockType` is required and must be specified in CreateCouponStockRequest")
  761. }
  762. toSerialize["stock_type"] = o.StockType
  763. if o.OutRequestNo == nil {
  764. return nil, fmt.Errorf("field `OutRequestNo` is required and must be specified in CreateCouponStockRequest")
  765. }
  766. toSerialize["out_request_no"] = o.OutRequestNo
  767. if o.ExtInfo != nil {
  768. toSerialize["ext_info"] = o.ExtInfo
  769. }
  770. return json.Marshal(toSerialize)
  771. }
  772. func (o CreateCouponStockRequest) String() string {
  773. var ret string
  774. if o.StockName == nil {
  775. ret += "StockName:<nil>, "
  776. } else {
  777. ret += fmt.Sprintf("StockName:%v, ", *o.StockName)
  778. }
  779. if o.Comment == nil {
  780. ret += "Comment:<nil>, "
  781. } else {
  782. ret += fmt.Sprintf("Comment:%v, ", *o.Comment)
  783. }
  784. if o.BelongMerchant == nil {
  785. ret += "BelongMerchant:<nil>, "
  786. } else {
  787. ret += fmt.Sprintf("BelongMerchant:%v, ", *o.BelongMerchant)
  788. }
  789. if o.AvailableBeginTime == nil {
  790. ret += "AvailableBeginTime:<nil>, "
  791. } else {
  792. ret += fmt.Sprintf("AvailableBeginTime:%v, ", *o.AvailableBeginTime)
  793. }
  794. if o.AvailableEndTime == nil {
  795. ret += "AvailableEndTime:<nil>, "
  796. } else {
  797. ret += fmt.Sprintf("AvailableEndTime:%v, ", *o.AvailableEndTime)
  798. }
  799. ret += fmt.Sprintf("StockUseRule:%v, ", o.StockUseRule)
  800. ret += fmt.Sprintf("PatternInfo:%v, ", o.PatternInfo)
  801. ret += fmt.Sprintf("CouponUseRule:%v, ", o.CouponUseRule)
  802. if o.NoCash == nil {
  803. ret += "NoCash:<nil>, "
  804. } else {
  805. ret += fmt.Sprintf("NoCash:%v, ", *o.NoCash)
  806. }
  807. if o.StockType == nil {
  808. ret += "StockType:<nil>, "
  809. } else {
  810. ret += fmt.Sprintf("StockType:%v, ", *o.StockType)
  811. }
  812. if o.OutRequestNo == nil {
  813. ret += "OutRequestNo:<nil>, "
  814. } else {
  815. ret += fmt.Sprintf("OutRequestNo:%v, ", *o.OutRequestNo)
  816. }
  817. if o.ExtInfo == nil {
  818. ret += "ExtInfo:<nil>"
  819. } else {
  820. ret += fmt.Sprintf("ExtInfo:%v", *o.ExtInfo)
  821. }
  822. return fmt.Sprintf("CreateCouponStockRequest{%s}", ret)
  823. }
  824. func (o CreateCouponStockRequest) Clone() *CreateCouponStockRequest {
  825. ret := CreateCouponStockRequest{}
  826. if o.StockName != nil {
  827. ret.StockName = new(string)
  828. *ret.StockName = *o.StockName
  829. }
  830. if o.Comment != nil {
  831. ret.Comment = new(string)
  832. *ret.Comment = *o.Comment
  833. }
  834. if o.BelongMerchant != nil {
  835. ret.BelongMerchant = new(string)
  836. *ret.BelongMerchant = *o.BelongMerchant
  837. }
  838. if o.AvailableBeginTime != nil {
  839. ret.AvailableBeginTime = new(string)
  840. *ret.AvailableBeginTime = *o.AvailableBeginTime
  841. }
  842. if o.AvailableEndTime != nil {
  843. ret.AvailableEndTime = new(string)
  844. *ret.AvailableEndTime = *o.AvailableEndTime
  845. }
  846. if o.StockUseRule != nil {
  847. ret.StockUseRule = o.StockUseRule.Clone()
  848. }
  849. if o.PatternInfo != nil {
  850. ret.PatternInfo = o.PatternInfo.Clone()
  851. }
  852. if o.CouponUseRule != nil {
  853. ret.CouponUseRule = o.CouponUseRule.Clone()
  854. }
  855. if o.NoCash != nil {
  856. ret.NoCash = new(bool)
  857. *ret.NoCash = *o.NoCash
  858. }
  859. if o.StockType != nil {
  860. ret.StockType = new(string)
  861. *ret.StockType = *o.StockType
  862. }
  863. if o.OutRequestNo != nil {
  864. ret.OutRequestNo = new(string)
  865. *ret.OutRequestNo = *o.OutRequestNo
  866. }
  867. if o.ExtInfo != nil {
  868. ret.ExtInfo = new(string)
  869. *ret.ExtInfo = *o.ExtInfo
  870. }
  871. return &ret
  872. }
  873. // CreateCouponStockResponse
  874. type CreateCouponStockResponse struct {
  875. // 批次号
  876. StockId *string `json:"stock_id"`
  877. // 创建时间
  878. CreateTime *string `json:"create_time"`
  879. }
  880. func (o CreateCouponStockResponse) MarshalJSON() ([]byte, error) {
  881. toSerialize := map[string]interface{}{}
  882. if o.StockId == nil {
  883. return nil, fmt.Errorf("field `StockId` is required and must be specified in CreateCouponStockResponse")
  884. }
  885. toSerialize["stock_id"] = o.StockId
  886. if o.CreateTime == nil {
  887. return nil, fmt.Errorf("field `CreateTime` is required and must be specified in CreateCouponStockResponse")
  888. }
  889. toSerialize["create_time"] = o.CreateTime
  890. return json.Marshal(toSerialize)
  891. }
  892. func (o CreateCouponStockResponse) String() string {
  893. var ret string
  894. if o.StockId == nil {
  895. ret += "StockId:<nil>, "
  896. } else {
  897. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  898. }
  899. if o.CreateTime == nil {
  900. ret += "CreateTime:<nil>"
  901. } else {
  902. ret += fmt.Sprintf("CreateTime:%v", *o.CreateTime)
  903. }
  904. return fmt.Sprintf("CreateCouponStockResponse{%s}", ret)
  905. }
  906. func (o CreateCouponStockResponse) Clone() *CreateCouponStockResponse {
  907. ret := CreateCouponStockResponse{}
  908. if o.StockId != nil {
  909. ret.StockId = new(string)
  910. *ret.StockId = *o.StockId
  911. }
  912. if o.CreateTime != nil {
  913. ret.CreateTime = new(string)
  914. *ret.CreateTime = *o.CreateTime
  915. }
  916. return &ret
  917. }
  918. // CutTypeMsg
  919. type CutTypeMsg struct {
  920. // 可用优惠的商品最高单价,单位分
  921. SinglePriceMax *int64 `json:"single_price_max"`
  922. // 减至后的优惠单价
  923. CutToPrice *int64 `json:"cut_to_price"`
  924. }
  925. func (o CutTypeMsg) MarshalJSON() ([]byte, error) {
  926. toSerialize := map[string]interface{}{}
  927. if o.SinglePriceMax == nil {
  928. return nil, fmt.Errorf("field `SinglePriceMax` is required and must be specified in CutTypeMsg")
  929. }
  930. toSerialize["single_price_max"] = o.SinglePriceMax
  931. if o.CutToPrice == nil {
  932. return nil, fmt.Errorf("field `CutToPrice` is required and must be specified in CutTypeMsg")
  933. }
  934. toSerialize["cut_to_price"] = o.CutToPrice
  935. return json.Marshal(toSerialize)
  936. }
  937. func (o CutTypeMsg) String() string {
  938. var ret string
  939. if o.SinglePriceMax == nil {
  940. ret += "SinglePriceMax:<nil>, "
  941. } else {
  942. ret += fmt.Sprintf("SinglePriceMax:%v, ", *o.SinglePriceMax)
  943. }
  944. if o.CutToPrice == nil {
  945. ret += "CutToPrice:<nil>"
  946. } else {
  947. ret += fmt.Sprintf("CutToPrice:%v", *o.CutToPrice)
  948. }
  949. return fmt.Sprintf("CutTypeMsg{%s}", ret)
  950. }
  951. func (o CutTypeMsg) Clone() *CutTypeMsg {
  952. ret := CutTypeMsg{}
  953. if o.SinglePriceMax != nil {
  954. ret.SinglePriceMax = new(int64)
  955. *ret.SinglePriceMax = *o.SinglePriceMax
  956. }
  957. if o.CutToPrice != nil {
  958. ret.CutToPrice = new(int64)
  959. *ret.CutToPrice = *o.CutToPrice
  960. }
  961. return &ret
  962. }
  963. // DeductBalanceMethod
  964. type DeductBalanceMethod string
  965. func (e DeductBalanceMethod) Ptr() *DeductBalanceMethod {
  966. return &e
  967. }
  968. // Enums of DeductBalanceMethod
  969. const (
  970. DEDUCTBALANCEMETHOD_BATCH_DEDUCT DeductBalanceMethod = "BATCH_DEDUCT"
  971. DEDUCTBALANCEMETHOD_REALTIME_DEDUCT DeductBalanceMethod = "REALTIME_DEDUCT"
  972. )
  973. // FavorAvailableTime
  974. type FavorAvailableTime struct {
  975. // 固定时间段可用
  976. FixAvailableTime *FixedAvailableTime `json:"fix_available_time,omitempty"`
  977. // true-是;false-否
  978. SecondDayAvailable *bool `json:"second_day_available,omitempty"`
  979. // 领取后有效时间,单位分钟
  980. AvailableTimeAfterReceive *int64 `json:"available_time_after_receive,omitempty"`
  981. }
  982. func (o FavorAvailableTime) MarshalJSON() ([]byte, error) {
  983. toSerialize := map[string]interface{}{}
  984. if o.FixAvailableTime != nil {
  985. toSerialize["fix_available_time"] = o.FixAvailableTime
  986. }
  987. if o.SecondDayAvailable != nil {
  988. toSerialize["second_day_available"] = o.SecondDayAvailable
  989. }
  990. if o.AvailableTimeAfterReceive != nil {
  991. toSerialize["available_time_after_receive"] = o.AvailableTimeAfterReceive
  992. }
  993. return json.Marshal(toSerialize)
  994. }
  995. func (o FavorAvailableTime) String() string {
  996. var ret string
  997. ret += fmt.Sprintf("FixAvailableTime:%v, ", o.FixAvailableTime)
  998. if o.SecondDayAvailable == nil {
  999. ret += "SecondDayAvailable:<nil>, "
  1000. } else {
  1001. ret += fmt.Sprintf("SecondDayAvailable:%v, ", *o.SecondDayAvailable)
  1002. }
  1003. if o.AvailableTimeAfterReceive == nil {
  1004. ret += "AvailableTimeAfterReceive:<nil>"
  1005. } else {
  1006. ret += fmt.Sprintf("AvailableTimeAfterReceive:%v", *o.AvailableTimeAfterReceive)
  1007. }
  1008. return fmt.Sprintf("FavorAvailableTime{%s}", ret)
  1009. }
  1010. func (o FavorAvailableTime) Clone() *FavorAvailableTime {
  1011. ret := FavorAvailableTime{}
  1012. if o.FixAvailableTime != nil {
  1013. ret.FixAvailableTime = o.FixAvailableTime.Clone()
  1014. }
  1015. if o.SecondDayAvailable != nil {
  1016. ret.SecondDayAvailable = new(bool)
  1017. *ret.SecondDayAvailable = *o.SecondDayAvailable
  1018. }
  1019. if o.AvailableTimeAfterReceive != nil {
  1020. ret.AvailableTimeAfterReceive = new(int64)
  1021. *ret.AvailableTimeAfterReceive = *o.AvailableTimeAfterReceive
  1022. }
  1023. return &ret
  1024. }
  1025. // FixedAvailableTime
  1026. type FixedAvailableTime struct {
  1027. // 0-周日;1-周一;以此类推
  1028. AvailableWeekDay []int64 `json:"available_week_day,omitempty"`
  1029. // 当天开始时间,单位秒
  1030. BeginTime *int64 `json:"begin_time"`
  1031. // 当天结束时间,单位秒,默认为23点59分59秒
  1032. EndTime *int64 `json:"end_time,omitempty"`
  1033. }
  1034. func (o FixedAvailableTime) MarshalJSON() ([]byte, error) {
  1035. toSerialize := map[string]interface{}{}
  1036. if o.AvailableWeekDay != nil {
  1037. toSerialize["available_week_day"] = o.AvailableWeekDay
  1038. }
  1039. if o.BeginTime == nil {
  1040. return nil, fmt.Errorf("field `BeginTime` is required and must be specified in FixedAvailableTime")
  1041. }
  1042. toSerialize["begin_time"] = o.BeginTime
  1043. if o.EndTime != nil {
  1044. toSerialize["end_time"] = o.EndTime
  1045. }
  1046. return json.Marshal(toSerialize)
  1047. }
  1048. func (o FixedAvailableTime) String() string {
  1049. var ret string
  1050. ret += fmt.Sprintf("AvailableWeekDay:%v, ", o.AvailableWeekDay)
  1051. if o.BeginTime == nil {
  1052. ret += "BeginTime:<nil>, "
  1053. } else {
  1054. ret += fmt.Sprintf("BeginTime:%v, ", *o.BeginTime)
  1055. }
  1056. if o.EndTime == nil {
  1057. ret += "EndTime:<nil>"
  1058. } else {
  1059. ret += fmt.Sprintf("EndTime:%v", *o.EndTime)
  1060. }
  1061. return fmt.Sprintf("FixedAvailableTime{%s}", ret)
  1062. }
  1063. func (o FixedAvailableTime) Clone() *FixedAvailableTime {
  1064. ret := FixedAvailableTime{}
  1065. if o.AvailableWeekDay != nil {
  1066. ret.AvailableWeekDay = make([]int64, len(o.AvailableWeekDay))
  1067. for i, item := range o.AvailableWeekDay {
  1068. ret.AvailableWeekDay[i] = item
  1069. }
  1070. }
  1071. if o.BeginTime != nil {
  1072. ret.BeginTime = new(int64)
  1073. *ret.BeginTime = *o.BeginTime
  1074. }
  1075. if o.EndTime != nil {
  1076. ret.EndTime = new(int64)
  1077. *ret.EndTime = *o.EndTime
  1078. }
  1079. return &ret
  1080. }
  1081. // FixedValueStockMsg
  1082. type FixedValueStockMsg struct {
  1083. // 面额,单位分
  1084. CouponAmount *int64 `json:"coupon_amount"`
  1085. // 使用券金额门槛,单位分
  1086. TransactionMinimum *int64 `json:"transaction_minimum"`
  1087. }
  1088. func (o FixedValueStockMsg) MarshalJSON() ([]byte, error) {
  1089. toSerialize := map[string]interface{}{}
  1090. if o.CouponAmount == nil {
  1091. return nil, fmt.Errorf("field `CouponAmount` is required and must be specified in FixedValueStockMsg")
  1092. }
  1093. toSerialize["coupon_amount"] = o.CouponAmount
  1094. if o.TransactionMinimum == nil {
  1095. return nil, fmt.Errorf("field `TransactionMinimum` is required and must be specified in FixedValueStockMsg")
  1096. }
  1097. toSerialize["transaction_minimum"] = o.TransactionMinimum
  1098. return json.Marshal(toSerialize)
  1099. }
  1100. func (o FixedValueStockMsg) String() string {
  1101. var ret string
  1102. if o.CouponAmount == nil {
  1103. ret += "CouponAmount:<nil>, "
  1104. } else {
  1105. ret += fmt.Sprintf("CouponAmount:%v, ", *o.CouponAmount)
  1106. }
  1107. if o.TransactionMinimum == nil {
  1108. ret += "TransactionMinimum:<nil>"
  1109. } else {
  1110. ret += fmt.Sprintf("TransactionMinimum:%v", *o.TransactionMinimum)
  1111. }
  1112. return fmt.Sprintf("FixedValueStockMsg{%s}", ret)
  1113. }
  1114. func (o FixedValueStockMsg) Clone() *FixedValueStockMsg {
  1115. ret := FixedValueStockMsg{}
  1116. if o.CouponAmount != nil {
  1117. ret.CouponAmount = new(int64)
  1118. *ret.CouponAmount = *o.CouponAmount
  1119. }
  1120. if o.TransactionMinimum != nil {
  1121. ret.TransactionMinimum = new(int64)
  1122. *ret.TransactionMinimum = *o.TransactionMinimum
  1123. }
  1124. return &ret
  1125. }
  1126. // FormFile
  1127. type FormFile struct {
  1128. Filename *string `json:"filename,omitempty"`
  1129. ContentType *string `json:"content_type,omitempty"`
  1130. Content *string `json:"content,omitempty"`
  1131. }
  1132. func (o FormFile) MarshalJSON() ([]byte, error) {
  1133. toSerialize := map[string]interface{}{}
  1134. if o.Filename != nil {
  1135. toSerialize["filename"] = o.Filename
  1136. }
  1137. if o.ContentType != nil {
  1138. toSerialize["content_type"] = o.ContentType
  1139. }
  1140. if o.Content != nil {
  1141. toSerialize["content"] = o.Content
  1142. }
  1143. return json.Marshal(toSerialize)
  1144. }
  1145. func (o FormFile) String() string {
  1146. var ret string
  1147. if o.Filename == nil {
  1148. ret += "Filename:<nil>, "
  1149. } else {
  1150. ret += fmt.Sprintf("Filename:%v, ", *o.Filename)
  1151. }
  1152. if o.ContentType == nil {
  1153. ret += "ContentType:<nil>, "
  1154. } else {
  1155. ret += fmt.Sprintf("ContentType:%v, ", *o.ContentType)
  1156. }
  1157. if o.Content == nil {
  1158. ret += "Content:<nil>"
  1159. } else {
  1160. ret += fmt.Sprintf("Content:%v", *o.Content)
  1161. }
  1162. return fmt.Sprintf("FormFile{%s}", ret)
  1163. }
  1164. func (o FormFile) Clone() *FormFile {
  1165. ret := FormFile{}
  1166. if o.Filename != nil {
  1167. ret.Filename = new(string)
  1168. *ret.Filename = *o.Filename
  1169. }
  1170. if o.ContentType != nil {
  1171. ret.ContentType = new(string)
  1172. *ret.ContentType = *o.ContentType
  1173. }
  1174. if o.Content != nil {
  1175. ret.Content = new(string)
  1176. *ret.Content = *o.Content
  1177. }
  1178. return &ret
  1179. }
  1180. // ImageMeta
  1181. type ImageMeta struct {
  1182. // 商户上传的媒体图片的名称,商户自定义,必须以JPG、BMP、PNG为后缀。
  1183. Filename *string `json:"filename,omitempty"`
  1184. // 图片文件的文件摘要,即对图片文件的二进制内容进行sha256计算得到的值。
  1185. Sha256 *string `json:"sha256,omitempty"`
  1186. }
  1187. func (o ImageMeta) MarshalJSON() ([]byte, error) {
  1188. toSerialize := map[string]interface{}{}
  1189. if o.Filename != nil {
  1190. toSerialize["filename"] = o.Filename
  1191. }
  1192. if o.Sha256 != nil {
  1193. toSerialize["sha256"] = o.Sha256
  1194. }
  1195. return json.Marshal(toSerialize)
  1196. }
  1197. func (o ImageMeta) String() string {
  1198. var ret string
  1199. if o.Filename == nil {
  1200. ret += "Filename:<nil>, "
  1201. } else {
  1202. ret += fmt.Sprintf("Filename:%v, ", *o.Filename)
  1203. }
  1204. if o.Sha256 == nil {
  1205. ret += "Sha256:<nil>"
  1206. } else {
  1207. ret += fmt.Sprintf("Sha256:%v", *o.Sha256)
  1208. }
  1209. return fmt.Sprintf("ImageMeta{%s}", ret)
  1210. }
  1211. func (o ImageMeta) Clone() *ImageMeta {
  1212. ret := ImageMeta{}
  1213. if o.Filename != nil {
  1214. ret.Filename = new(string)
  1215. *ret.Filename = *o.Filename
  1216. }
  1217. if o.Sha256 != nil {
  1218. ret.Sha256 = new(string)
  1219. *ret.Sha256 = *o.Sha256
  1220. }
  1221. return &ret
  1222. }
  1223. // JumpTarget
  1224. type JumpTarget string
  1225. func (e JumpTarget) Ptr() *JumpTarget {
  1226. return &e
  1227. }
  1228. // Enums of JumpTarget
  1229. const (
  1230. JUMPTARGET_PAYMENT_CODE JumpTarget = "PAYMENT_CODE"
  1231. JUMPTARGET_MINI_PROGRAM JumpTarget = "MINI_PROGRAM"
  1232. JUMPTARGET_DEFAULT_PAGE JumpTarget = "DEFAULT_PAGE"
  1233. )
  1234. // ListAvailableMerchantsRequest
  1235. type ListAvailableMerchantsRequest struct {
  1236. // 分页页码,最大1000
  1237. Offset *int64 `json:"offset"`
  1238. // 分页大小,最大50
  1239. Limit *int64 `json:"limit"`
  1240. // 批次创建方商户号
  1241. StockCreatorMchid *string `json:"stock_creator_mchid"`
  1242. // 批次号
  1243. StockId *string `json:"stock_id"`
  1244. }
  1245. func (o ListAvailableMerchantsRequest) MarshalJSON() ([]byte, error) {
  1246. toSerialize := map[string]interface{}{}
  1247. if o.Offset == nil {
  1248. return nil, fmt.Errorf("field `Offset` is required and must be specified in ListAvailableMerchantsRequest")
  1249. }
  1250. toSerialize["offset"] = o.Offset
  1251. if o.Limit == nil {
  1252. return nil, fmt.Errorf("field `Limit` is required and must be specified in ListAvailableMerchantsRequest")
  1253. }
  1254. toSerialize["limit"] = o.Limit
  1255. if o.StockCreatorMchid == nil {
  1256. return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in ListAvailableMerchantsRequest")
  1257. }
  1258. toSerialize["stock_creator_mchid"] = o.StockCreatorMchid
  1259. if o.StockId == nil {
  1260. return nil, fmt.Errorf("field `StockId` is required and must be specified in ListAvailableMerchantsRequest")
  1261. }
  1262. toSerialize["stock_id"] = o.StockId
  1263. return json.Marshal(toSerialize)
  1264. }
  1265. func (o ListAvailableMerchantsRequest) String() string {
  1266. var ret string
  1267. if o.Offset == nil {
  1268. ret += "Offset:<nil>, "
  1269. } else {
  1270. ret += fmt.Sprintf("Offset:%v, ", *o.Offset)
  1271. }
  1272. if o.Limit == nil {
  1273. ret += "Limit:<nil>, "
  1274. } else {
  1275. ret += fmt.Sprintf("Limit:%v, ", *o.Limit)
  1276. }
  1277. if o.StockCreatorMchid == nil {
  1278. ret += "StockCreatorMchid:<nil>, "
  1279. } else {
  1280. ret += fmt.Sprintf("StockCreatorMchid:%v, ", *o.StockCreatorMchid)
  1281. }
  1282. if o.StockId == nil {
  1283. ret += "StockId:<nil>"
  1284. } else {
  1285. ret += fmt.Sprintf("StockId:%v", *o.StockId)
  1286. }
  1287. return fmt.Sprintf("ListAvailableMerchantsRequest{%s}", ret)
  1288. }
  1289. func (o ListAvailableMerchantsRequest) Clone() *ListAvailableMerchantsRequest {
  1290. ret := ListAvailableMerchantsRequest{}
  1291. if o.Offset != nil {
  1292. ret.Offset = new(int64)
  1293. *ret.Offset = *o.Offset
  1294. }
  1295. if o.Limit != nil {
  1296. ret.Limit = new(int64)
  1297. *ret.Limit = *o.Limit
  1298. }
  1299. if o.StockCreatorMchid != nil {
  1300. ret.StockCreatorMchid = new(string)
  1301. *ret.StockCreatorMchid = *o.StockCreatorMchid
  1302. }
  1303. if o.StockId != nil {
  1304. ret.StockId = new(string)
  1305. *ret.StockId = *o.StockId
  1306. }
  1307. return &ret
  1308. }
  1309. // ListAvailableSingleitemsRequest
  1310. type ListAvailableSingleitemsRequest struct {
  1311. // 分页页码,最大500
  1312. Offset *int64 `json:"offset"`
  1313. // 分页大小,最大100
  1314. Limit *int64 `json:"limit"`
  1315. // 批次创建方商户号
  1316. StockCreatorMchid *string `json:"stock_creator_mchid"`
  1317. // 批次号
  1318. StockId *string `json:"stock_id"`
  1319. }
  1320. func (o ListAvailableSingleitemsRequest) MarshalJSON() ([]byte, error) {
  1321. toSerialize := map[string]interface{}{}
  1322. if o.Offset == nil {
  1323. return nil, fmt.Errorf("field `Offset` is required and must be specified in ListAvailableSingleitemsRequest")
  1324. }
  1325. toSerialize["offset"] = o.Offset
  1326. if o.Limit == nil {
  1327. return nil, fmt.Errorf("field `Limit` is required and must be specified in ListAvailableSingleitemsRequest")
  1328. }
  1329. toSerialize["limit"] = o.Limit
  1330. if o.StockCreatorMchid == nil {
  1331. return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in ListAvailableSingleitemsRequest")
  1332. }
  1333. toSerialize["stock_creator_mchid"] = o.StockCreatorMchid
  1334. if o.StockId == nil {
  1335. return nil, fmt.Errorf("field `StockId` is required and must be specified in ListAvailableSingleitemsRequest")
  1336. }
  1337. toSerialize["stock_id"] = o.StockId
  1338. return json.Marshal(toSerialize)
  1339. }
  1340. func (o ListAvailableSingleitemsRequest) String() string {
  1341. var ret string
  1342. if o.Offset == nil {
  1343. ret += "Offset:<nil>, "
  1344. } else {
  1345. ret += fmt.Sprintf("Offset:%v, ", *o.Offset)
  1346. }
  1347. if o.Limit == nil {
  1348. ret += "Limit:<nil>, "
  1349. } else {
  1350. ret += fmt.Sprintf("Limit:%v, ", *o.Limit)
  1351. }
  1352. if o.StockCreatorMchid == nil {
  1353. ret += "StockCreatorMchid:<nil>, "
  1354. } else {
  1355. ret += fmt.Sprintf("StockCreatorMchid:%v, ", *o.StockCreatorMchid)
  1356. }
  1357. if o.StockId == nil {
  1358. ret += "StockId:<nil>"
  1359. } else {
  1360. ret += fmt.Sprintf("StockId:%v", *o.StockId)
  1361. }
  1362. return fmt.Sprintf("ListAvailableSingleitemsRequest{%s}", ret)
  1363. }
  1364. func (o ListAvailableSingleitemsRequest) Clone() *ListAvailableSingleitemsRequest {
  1365. ret := ListAvailableSingleitemsRequest{}
  1366. if o.Offset != nil {
  1367. ret.Offset = new(int64)
  1368. *ret.Offset = *o.Offset
  1369. }
  1370. if o.Limit != nil {
  1371. ret.Limit = new(int64)
  1372. *ret.Limit = *o.Limit
  1373. }
  1374. if o.StockCreatorMchid != nil {
  1375. ret.StockCreatorMchid = new(string)
  1376. *ret.StockCreatorMchid = *o.StockCreatorMchid
  1377. }
  1378. if o.StockId != nil {
  1379. ret.StockId = new(string)
  1380. *ret.StockId = *o.StockId
  1381. }
  1382. return &ret
  1383. }
  1384. // ListCouponsByFilterRequest
  1385. type ListCouponsByFilterRequest struct {
  1386. // 用户在商户appid 下的唯一标识
  1387. Openid *string `json:"openid"`
  1388. // 微信为发券方商户分配的公众账号ID,接口传入的所有appid应该为公众号的appid(在mp.weixin.qq.com申请的),不能为APP的appid(在open.weixin.qq.com申请的)。
  1389. Appid *string `json:"appid"`
  1390. // 批次号,是否指定批次号查询,填写available_mchid,该字段不生效
  1391. StockId *string `json:"stock_id,omitempty"`
  1392. // 代金券状态:SENDED-可用,USED-已实扣,填写available_mchid,该字段不生效
  1393. Status *string `json:"status,omitempty"`
  1394. // 批次创建方商户号。创建批次的商户号,批次发放商户号,可用商户号三个参数,任意选填一个。
  1395. CreatorMchid *string `json:"creator_mchid,omitempty"`
  1396. // 批次发放商户号。创建批次的商户号,批次发放商户号,可用商户号三个参数,任意选填一个。
  1397. SenderMchid *string `json:"sender_mchid,omitempty"`
  1398. // 可用商户号。 创建批次的商户号,批次发放商户号,可用商户号三个参数,任意选填一个。
  1399. AvailableMchid *string `json:"available_mchid,omitempty"`
  1400. // 分页页码,默认0,填写available_mchid,该字段不生效
  1401. Offset *int64 `json:"offset,omitempty"`
  1402. // 分页大小,默认20,填写available_mchid,该字段不生效
  1403. Limit *int64 `json:"limit,omitempty"`
  1404. }
  1405. func (o ListCouponsByFilterRequest) MarshalJSON() ([]byte, error) {
  1406. toSerialize := map[string]interface{}{}
  1407. if o.Openid == nil {
  1408. return nil, fmt.Errorf("field `Openid` is required and must be specified in ListCouponsByFilterRequest")
  1409. }
  1410. toSerialize["openid"] = o.Openid
  1411. if o.Appid == nil {
  1412. return nil, fmt.Errorf("field `Appid` is required and must be specified in ListCouponsByFilterRequest")
  1413. }
  1414. toSerialize["appid"] = o.Appid
  1415. if o.StockId != nil {
  1416. toSerialize["stock_id"] = o.StockId
  1417. }
  1418. if o.Status != nil {
  1419. toSerialize["status"] = o.Status
  1420. }
  1421. if o.CreatorMchid != nil {
  1422. toSerialize["creator_mchid"] = o.CreatorMchid
  1423. }
  1424. if o.SenderMchid != nil {
  1425. toSerialize["sender_mchid"] = o.SenderMchid
  1426. }
  1427. if o.AvailableMchid != nil {
  1428. toSerialize["available_mchid"] = o.AvailableMchid
  1429. }
  1430. if o.Offset != nil {
  1431. toSerialize["offset"] = o.Offset
  1432. }
  1433. if o.Limit != nil {
  1434. toSerialize["limit"] = o.Limit
  1435. }
  1436. return json.Marshal(toSerialize)
  1437. }
  1438. func (o ListCouponsByFilterRequest) String() string {
  1439. var ret string
  1440. if o.Openid == nil {
  1441. ret += "Openid:<nil>, "
  1442. } else {
  1443. ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
  1444. }
  1445. if o.Appid == nil {
  1446. ret += "Appid:<nil>, "
  1447. } else {
  1448. ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
  1449. }
  1450. if o.StockId == nil {
  1451. ret += "StockId:<nil>, "
  1452. } else {
  1453. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  1454. }
  1455. if o.Status == nil {
  1456. ret += "Status:<nil>, "
  1457. } else {
  1458. ret += fmt.Sprintf("Status:%v, ", *o.Status)
  1459. }
  1460. if o.CreatorMchid == nil {
  1461. ret += "CreatorMchid:<nil>, "
  1462. } else {
  1463. ret += fmt.Sprintf("CreatorMchid:%v, ", *o.CreatorMchid)
  1464. }
  1465. if o.SenderMchid == nil {
  1466. ret += "SenderMchid:<nil>, "
  1467. } else {
  1468. ret += fmt.Sprintf("SenderMchid:%v, ", *o.SenderMchid)
  1469. }
  1470. if o.AvailableMchid == nil {
  1471. ret += "AvailableMchid:<nil>, "
  1472. } else {
  1473. ret += fmt.Sprintf("AvailableMchid:%v, ", *o.AvailableMchid)
  1474. }
  1475. if o.Offset == nil {
  1476. ret += "Offset:<nil>, "
  1477. } else {
  1478. ret += fmt.Sprintf("Offset:%v, ", *o.Offset)
  1479. }
  1480. if o.Limit == nil {
  1481. ret += "Limit:<nil>"
  1482. } else {
  1483. ret += fmt.Sprintf("Limit:%v", *o.Limit)
  1484. }
  1485. return fmt.Sprintf("ListCouponsByFilterRequest{%s}", ret)
  1486. }
  1487. func (o ListCouponsByFilterRequest) Clone() *ListCouponsByFilterRequest {
  1488. ret := ListCouponsByFilterRequest{}
  1489. if o.Openid != nil {
  1490. ret.Openid = new(string)
  1491. *ret.Openid = *o.Openid
  1492. }
  1493. if o.Appid != nil {
  1494. ret.Appid = new(string)
  1495. *ret.Appid = *o.Appid
  1496. }
  1497. if o.StockId != nil {
  1498. ret.StockId = new(string)
  1499. *ret.StockId = *o.StockId
  1500. }
  1501. if o.Status != nil {
  1502. ret.Status = new(string)
  1503. *ret.Status = *o.Status
  1504. }
  1505. if o.CreatorMchid != nil {
  1506. ret.CreatorMchid = new(string)
  1507. *ret.CreatorMchid = *o.CreatorMchid
  1508. }
  1509. if o.SenderMchid != nil {
  1510. ret.SenderMchid = new(string)
  1511. *ret.SenderMchid = *o.SenderMchid
  1512. }
  1513. if o.AvailableMchid != nil {
  1514. ret.AvailableMchid = new(string)
  1515. *ret.AvailableMchid = *o.AvailableMchid
  1516. }
  1517. if o.Offset != nil {
  1518. ret.Offset = new(int64)
  1519. *ret.Offset = *o.Offset
  1520. }
  1521. if o.Limit != nil {
  1522. ret.Limit = new(int64)
  1523. *ret.Limit = *o.Limit
  1524. }
  1525. return &ret
  1526. }
  1527. // ListStocksRequest
  1528. type ListStocksRequest struct {
  1529. // 页码从0开始,默认第0页
  1530. Offset *int64 `json:"offset"`
  1531. // 分页大小,最大10
  1532. Limit *int64 `json:"limit"`
  1533. // 批次创建方商户号
  1534. StockCreatorMchid *string `json:"stock_creator_mchid"`
  1535. // 起始创建时间
  1536. CreateStartTime *string `json:"create_start_time,omitempty"`
  1537. // 终止创建时间
  1538. CreateEndTime *string `json:"create_end_time,omitempty"`
  1539. // 批次状态: unactivated-未激活;audit-审核中;running-运行中;stoped-已停止;paused-暂停发放
  1540. Status *string `json:"status,omitempty"`
  1541. }
  1542. func (o ListStocksRequest) MarshalJSON() ([]byte, error) {
  1543. toSerialize := map[string]interface{}{}
  1544. if o.Offset == nil {
  1545. return nil, fmt.Errorf("field `Offset` is required and must be specified in ListStocksRequest")
  1546. }
  1547. toSerialize["offset"] = o.Offset
  1548. if o.Limit == nil {
  1549. return nil, fmt.Errorf("field `Limit` is required and must be specified in ListStocksRequest")
  1550. }
  1551. toSerialize["limit"] = o.Limit
  1552. if o.StockCreatorMchid == nil {
  1553. return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in ListStocksRequest")
  1554. }
  1555. toSerialize["stock_creator_mchid"] = o.StockCreatorMchid
  1556. if o.CreateStartTime != nil {
  1557. toSerialize["create_start_time"] = o.CreateStartTime
  1558. }
  1559. if o.CreateEndTime != nil {
  1560. toSerialize["create_end_time"] = o.CreateEndTime
  1561. }
  1562. if o.Status != nil {
  1563. toSerialize["status"] = o.Status
  1564. }
  1565. return json.Marshal(toSerialize)
  1566. }
  1567. func (o ListStocksRequest) String() string {
  1568. var ret string
  1569. if o.Offset == nil {
  1570. ret += "Offset:<nil>, "
  1571. } else {
  1572. ret += fmt.Sprintf("Offset:%v, ", *o.Offset)
  1573. }
  1574. if o.Limit == nil {
  1575. ret += "Limit:<nil>, "
  1576. } else {
  1577. ret += fmt.Sprintf("Limit:%v, ", *o.Limit)
  1578. }
  1579. if o.StockCreatorMchid == nil {
  1580. ret += "StockCreatorMchid:<nil>, "
  1581. } else {
  1582. ret += fmt.Sprintf("StockCreatorMchid:%v, ", *o.StockCreatorMchid)
  1583. }
  1584. if o.CreateStartTime == nil {
  1585. ret += "CreateStartTime:<nil>, "
  1586. } else {
  1587. ret += fmt.Sprintf("CreateStartTime:%v, ", *o.CreateStartTime)
  1588. }
  1589. if o.CreateEndTime == nil {
  1590. ret += "CreateEndTime:<nil>, "
  1591. } else {
  1592. ret += fmt.Sprintf("CreateEndTime:%v, ", *o.CreateEndTime)
  1593. }
  1594. if o.Status == nil {
  1595. ret += "Status:<nil>"
  1596. } else {
  1597. ret += fmt.Sprintf("Status:%v", *o.Status)
  1598. }
  1599. return fmt.Sprintf("ListStocksRequest{%s}", ret)
  1600. }
  1601. func (o ListStocksRequest) Clone() *ListStocksRequest {
  1602. ret := ListStocksRequest{}
  1603. if o.Offset != nil {
  1604. ret.Offset = new(int64)
  1605. *ret.Offset = *o.Offset
  1606. }
  1607. if o.Limit != nil {
  1608. ret.Limit = new(int64)
  1609. *ret.Limit = *o.Limit
  1610. }
  1611. if o.StockCreatorMchid != nil {
  1612. ret.StockCreatorMchid = new(string)
  1613. *ret.StockCreatorMchid = *o.StockCreatorMchid
  1614. }
  1615. if o.CreateStartTime != nil {
  1616. ret.CreateStartTime = new(string)
  1617. *ret.CreateStartTime = *o.CreateStartTime
  1618. }
  1619. if o.CreateEndTime != nil {
  1620. ret.CreateEndTime = new(string)
  1621. *ret.CreateEndTime = *o.CreateEndTime
  1622. }
  1623. if o.Status != nil {
  1624. ret.Status = new(string)
  1625. *ret.Status = *o.Status
  1626. }
  1627. return &ret
  1628. }
  1629. // MediaImageRequest
  1630. type MediaImageRequest struct {
  1631. // 将媒体图片进行二进制转换,得到的媒体图片二进制内容,在请求body中上传此二进制内容。媒体图片只支持JPG、BMP、PNG格式,文件大小不能超过2M。
  1632. File *FormFile `json:"file"`
  1633. //
  1634. Meta *ImageMeta `json:"meta"`
  1635. }
  1636. func (o MediaImageRequest) MarshalJSON() ([]byte, error) {
  1637. toSerialize := map[string]interface{}{}
  1638. if o.File == nil {
  1639. return nil, fmt.Errorf("field `File` is required and must be specified in MediaImageRequest")
  1640. }
  1641. toSerialize["file"] = o.File
  1642. if o.Meta == nil {
  1643. return nil, fmt.Errorf("field `Meta` is required and must be specified in MediaImageRequest")
  1644. }
  1645. toSerialize["meta"] = o.Meta
  1646. return json.Marshal(toSerialize)
  1647. }
  1648. func (o MediaImageRequest) String() string {
  1649. var ret string
  1650. ret += fmt.Sprintf("File:%v, ", o.File)
  1651. ret += fmt.Sprintf("Meta:%v", o.Meta)
  1652. return fmt.Sprintf("MediaImageRequest{%s}", ret)
  1653. }
  1654. func (o MediaImageRequest) Clone() *MediaImageRequest {
  1655. ret := MediaImageRequest{}
  1656. if o.File != nil {
  1657. ret.File = o.File.Clone()
  1658. }
  1659. if o.Meta != nil {
  1660. ret.Meta = o.Meta.Clone()
  1661. }
  1662. return &ret
  1663. }
  1664. // MediaImageResponse
  1665. type MediaImageResponse struct {
  1666. // 微信返回的媒体文件url地址。
  1667. MediaUrl *string `json:"media_url"`
  1668. }
  1669. func (o MediaImageResponse) MarshalJSON() ([]byte, error) {
  1670. toSerialize := map[string]interface{}{}
  1671. if o.MediaUrl == nil {
  1672. return nil, fmt.Errorf("field `MediaUrl` is required and must be specified in MediaImageResponse")
  1673. }
  1674. toSerialize["media_url"] = o.MediaUrl
  1675. return json.Marshal(toSerialize)
  1676. }
  1677. func (o MediaImageResponse) String() string {
  1678. var ret string
  1679. if o.MediaUrl == nil {
  1680. ret += "MediaUrl:<nil>"
  1681. } else {
  1682. ret += fmt.Sprintf("MediaUrl:%v", *o.MediaUrl)
  1683. }
  1684. return fmt.Sprintf("MediaImageResponse{%s}", ret)
  1685. }
  1686. func (o MediaImageResponse) Clone() *MediaImageResponse {
  1687. ret := MediaImageResponse{}
  1688. if o.MediaUrl != nil {
  1689. ret.MediaUrl = new(string)
  1690. *ret.MediaUrl = *o.MediaUrl
  1691. }
  1692. return &ret
  1693. }
  1694. // ModifyAvailableMerchantRequest
  1695. type ModifyAvailableMerchantRequest struct {
  1696. // 批次创建方商户号
  1697. StockCreatorMchid *string `json:"stock_creator_mchid"`
  1698. // 增加可用商户列表
  1699. AddMchidList []string `json:"add_mchid_list,omitempty"`
  1700. // 删除可用商户列表
  1701. DeleteMchidList []string `json:"delete_mchid_list,omitempty"`
  1702. }
  1703. func (o ModifyAvailableMerchantRequest) MarshalJSON() ([]byte, error) {
  1704. toSerialize := map[string]interface{}{}
  1705. if o.StockCreatorMchid == nil {
  1706. return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in ModifyAvailableMerchantRequest")
  1707. }
  1708. toSerialize["stock_creator_mchid"] = o.StockCreatorMchid
  1709. if o.AddMchidList != nil {
  1710. toSerialize["add_mchid_list"] = o.AddMchidList
  1711. }
  1712. if o.DeleteMchidList != nil {
  1713. toSerialize["delete_mchid_list"] = o.DeleteMchidList
  1714. }
  1715. return json.Marshal(toSerialize)
  1716. }
  1717. func (o ModifyAvailableMerchantRequest) String() string {
  1718. var ret string
  1719. if o.StockCreatorMchid == nil {
  1720. ret += "StockCreatorMchid:<nil>, "
  1721. } else {
  1722. ret += fmt.Sprintf("StockCreatorMchid:%v, ", *o.StockCreatorMchid)
  1723. }
  1724. ret += fmt.Sprintf("AddMchidList:%v, ", o.AddMchidList)
  1725. ret += fmt.Sprintf("DeleteMchidList:%v", o.DeleteMchidList)
  1726. return fmt.Sprintf("ModifyAvailableMerchantRequest{%s}", ret)
  1727. }
  1728. func (o ModifyAvailableMerchantRequest) Clone() *ModifyAvailableMerchantRequest {
  1729. ret := ModifyAvailableMerchantRequest{}
  1730. if o.StockCreatorMchid != nil {
  1731. ret.StockCreatorMchid = new(string)
  1732. *ret.StockCreatorMchid = *o.StockCreatorMchid
  1733. }
  1734. if o.AddMchidList != nil {
  1735. ret.AddMchidList = make([]string, len(o.AddMchidList))
  1736. for i, item := range o.AddMchidList {
  1737. ret.AddMchidList[i] = item
  1738. }
  1739. }
  1740. if o.DeleteMchidList != nil {
  1741. ret.DeleteMchidList = make([]string, len(o.DeleteMchidList))
  1742. for i, item := range o.DeleteMchidList {
  1743. ret.DeleteMchidList[i] = item
  1744. }
  1745. }
  1746. return &ret
  1747. }
  1748. // ModifyAvailableMerchantResponse
  1749. type ModifyAvailableMerchantResponse struct {
  1750. // 生效时间
  1751. EffectTime *string `json:"effect_time"`
  1752. // 批次号
  1753. StockId *string `json:"stock_id"`
  1754. }
  1755. func (o ModifyAvailableMerchantResponse) MarshalJSON() ([]byte, error) {
  1756. toSerialize := map[string]interface{}{}
  1757. if o.EffectTime == nil {
  1758. return nil, fmt.Errorf("field `EffectTime` is required and must be specified in ModifyAvailableMerchantResponse")
  1759. }
  1760. toSerialize["effect_time"] = o.EffectTime
  1761. if o.StockId == nil {
  1762. return nil, fmt.Errorf("field `StockId` is required and must be specified in ModifyAvailableMerchantResponse")
  1763. }
  1764. toSerialize["stock_id"] = o.StockId
  1765. return json.Marshal(toSerialize)
  1766. }
  1767. func (o ModifyAvailableMerchantResponse) String() string {
  1768. var ret string
  1769. if o.EffectTime == nil {
  1770. ret += "EffectTime:<nil>, "
  1771. } else {
  1772. ret += fmt.Sprintf("EffectTime:%v, ", *o.EffectTime)
  1773. }
  1774. if o.StockId == nil {
  1775. ret += "StockId:<nil>"
  1776. } else {
  1777. ret += fmt.Sprintf("StockId:%v", *o.StockId)
  1778. }
  1779. return fmt.Sprintf("ModifyAvailableMerchantResponse{%s}", ret)
  1780. }
  1781. func (o ModifyAvailableMerchantResponse) Clone() *ModifyAvailableMerchantResponse {
  1782. ret := ModifyAvailableMerchantResponse{}
  1783. if o.EffectTime != nil {
  1784. ret.EffectTime = new(string)
  1785. *ret.EffectTime = *o.EffectTime
  1786. }
  1787. if o.StockId != nil {
  1788. ret.StockId = new(string)
  1789. *ret.StockId = *o.StockId
  1790. }
  1791. return &ret
  1792. }
  1793. // ModifyAvailableSingleitemRequest
  1794. type ModifyAvailableSingleitemRequest struct {
  1795. // 批次创建方商户号
  1796. StockCreatorMchid *string `json:"stock_creator_mchid"`
  1797. // 增加单品编码列表
  1798. AddGoodsIdList []string `json:"add_goods_id_list,omitempty"`
  1799. // 删除单品编码列表
  1800. DeleteGoodsIdList []string `json:"delete_goods_id_list,omitempty"`
  1801. }
  1802. func (o ModifyAvailableSingleitemRequest) MarshalJSON() ([]byte, error) {
  1803. toSerialize := map[string]interface{}{}
  1804. if o.StockCreatorMchid == nil {
  1805. return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in ModifyAvailableSingleitemRequest")
  1806. }
  1807. toSerialize["stock_creator_mchid"] = o.StockCreatorMchid
  1808. if o.AddGoodsIdList != nil {
  1809. toSerialize["add_goods_id_list"] = o.AddGoodsIdList
  1810. }
  1811. if o.DeleteGoodsIdList != nil {
  1812. toSerialize["delete_goods_id_list"] = o.DeleteGoodsIdList
  1813. }
  1814. return json.Marshal(toSerialize)
  1815. }
  1816. func (o ModifyAvailableSingleitemRequest) String() string {
  1817. var ret string
  1818. if o.StockCreatorMchid == nil {
  1819. ret += "StockCreatorMchid:<nil>, "
  1820. } else {
  1821. ret += fmt.Sprintf("StockCreatorMchid:%v, ", *o.StockCreatorMchid)
  1822. }
  1823. ret += fmt.Sprintf("AddGoodsIdList:%v, ", o.AddGoodsIdList)
  1824. ret += fmt.Sprintf("DeleteGoodsIdList:%v", o.DeleteGoodsIdList)
  1825. return fmt.Sprintf("ModifyAvailableSingleitemRequest{%s}", ret)
  1826. }
  1827. func (o ModifyAvailableSingleitemRequest) Clone() *ModifyAvailableSingleitemRequest {
  1828. ret := ModifyAvailableSingleitemRequest{}
  1829. if o.StockCreatorMchid != nil {
  1830. ret.StockCreatorMchid = new(string)
  1831. *ret.StockCreatorMchid = *o.StockCreatorMchid
  1832. }
  1833. if o.AddGoodsIdList != nil {
  1834. ret.AddGoodsIdList = make([]string, len(o.AddGoodsIdList))
  1835. for i, item := range o.AddGoodsIdList {
  1836. ret.AddGoodsIdList[i] = item
  1837. }
  1838. }
  1839. if o.DeleteGoodsIdList != nil {
  1840. ret.DeleteGoodsIdList = make([]string, len(o.DeleteGoodsIdList))
  1841. for i, item := range o.DeleteGoodsIdList {
  1842. ret.DeleteGoodsIdList[i] = item
  1843. }
  1844. }
  1845. return &ret
  1846. }
  1847. // ModifyAvailableSingleitemResponse
  1848. type ModifyAvailableSingleitemResponse struct {
  1849. // 生效时间
  1850. EffectTime *string `json:"effect_time"`
  1851. // 批次号
  1852. StockId *string `json:"stock_id"`
  1853. }
  1854. func (o ModifyAvailableSingleitemResponse) MarshalJSON() ([]byte, error) {
  1855. toSerialize := map[string]interface{}{}
  1856. if o.EffectTime == nil {
  1857. return nil, fmt.Errorf("field `EffectTime` is required and must be specified in ModifyAvailableSingleitemResponse")
  1858. }
  1859. toSerialize["effect_time"] = o.EffectTime
  1860. if o.StockId == nil {
  1861. return nil, fmt.Errorf("field `StockId` is required and must be specified in ModifyAvailableSingleitemResponse")
  1862. }
  1863. toSerialize["stock_id"] = o.StockId
  1864. return json.Marshal(toSerialize)
  1865. }
  1866. func (o ModifyAvailableSingleitemResponse) String() string {
  1867. var ret string
  1868. if o.EffectTime == nil {
  1869. ret += "EffectTime:<nil>, "
  1870. } else {
  1871. ret += fmt.Sprintf("EffectTime:%v, ", *o.EffectTime)
  1872. }
  1873. if o.StockId == nil {
  1874. ret += "StockId:<nil>"
  1875. } else {
  1876. ret += fmt.Sprintf("StockId:%v", *o.StockId)
  1877. }
  1878. return fmt.Sprintf("ModifyAvailableSingleitemResponse{%s}", ret)
  1879. }
  1880. func (o ModifyAvailableSingleitemResponse) Clone() *ModifyAvailableSingleitemResponse {
  1881. ret := ModifyAvailableSingleitemResponse{}
  1882. if o.EffectTime != nil {
  1883. ret.EffectTime = new(string)
  1884. *ret.EffectTime = *o.EffectTime
  1885. }
  1886. if o.StockId != nil {
  1887. ret.StockId = new(string)
  1888. *ret.StockId = *o.StockId
  1889. }
  1890. return &ret
  1891. }
  1892. // ModifyStockBudgetRequest
  1893. type ModifyStockBudgetRequest struct {
  1894. // 批次创建方商户号
  1895. StockCreatorMchid *string `json:"stock_creator_mchid"`
  1896. // 预算修改目标额度,单位分
  1897. TargetMaxAmount *int64 `json:"target_max_amount"`
  1898. // 当前预算额度,单位分
  1899. CurrentMaxAmount *int64 `json:"current_max_amount"`
  1900. }
  1901. func (o ModifyStockBudgetRequest) MarshalJSON() ([]byte, error) {
  1902. toSerialize := map[string]interface{}{}
  1903. if o.StockCreatorMchid == nil {
  1904. return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in ModifyStockBudgetRequest")
  1905. }
  1906. toSerialize["stock_creator_mchid"] = o.StockCreatorMchid
  1907. if o.TargetMaxAmount == nil {
  1908. return nil, fmt.Errorf("field `TargetMaxAmount` is required and must be specified in ModifyStockBudgetRequest")
  1909. }
  1910. toSerialize["target_max_amount"] = o.TargetMaxAmount
  1911. if o.CurrentMaxAmount == nil {
  1912. return nil, fmt.Errorf("field `CurrentMaxAmount` is required and must be specified in ModifyStockBudgetRequest")
  1913. }
  1914. toSerialize["current_max_amount"] = o.CurrentMaxAmount
  1915. return json.Marshal(toSerialize)
  1916. }
  1917. func (o ModifyStockBudgetRequest) String() string {
  1918. var ret string
  1919. if o.StockCreatorMchid == nil {
  1920. ret += "StockCreatorMchid:<nil>, "
  1921. } else {
  1922. ret += fmt.Sprintf("StockCreatorMchid:%v, ", *o.StockCreatorMchid)
  1923. }
  1924. if o.TargetMaxAmount == nil {
  1925. ret += "TargetMaxAmount:<nil>, "
  1926. } else {
  1927. ret += fmt.Sprintf("TargetMaxAmount:%v, ", *o.TargetMaxAmount)
  1928. }
  1929. if o.CurrentMaxAmount == nil {
  1930. ret += "CurrentMaxAmount:<nil>"
  1931. } else {
  1932. ret += fmt.Sprintf("CurrentMaxAmount:%v", *o.CurrentMaxAmount)
  1933. }
  1934. return fmt.Sprintf("ModifyStockBudgetRequest{%s}", ret)
  1935. }
  1936. func (o ModifyStockBudgetRequest) Clone() *ModifyStockBudgetRequest {
  1937. ret := ModifyStockBudgetRequest{}
  1938. if o.StockCreatorMchid != nil {
  1939. ret.StockCreatorMchid = new(string)
  1940. *ret.StockCreatorMchid = *o.StockCreatorMchid
  1941. }
  1942. if o.TargetMaxAmount != nil {
  1943. ret.TargetMaxAmount = new(int64)
  1944. *ret.TargetMaxAmount = *o.TargetMaxAmount
  1945. }
  1946. if o.CurrentMaxAmount != nil {
  1947. ret.CurrentMaxAmount = new(int64)
  1948. *ret.CurrentMaxAmount = *o.CurrentMaxAmount
  1949. }
  1950. return &ret
  1951. }
  1952. // ModifyStockBudgetResponse
  1953. type ModifyStockBudgetResponse struct {
  1954. // 批次预算额度,单位分
  1955. MaxAmount *int64 `json:"max_amount"`
  1956. // 批次号
  1957. StockId *string `json:"stock_id"`
  1958. }
  1959. func (o ModifyStockBudgetResponse) MarshalJSON() ([]byte, error) {
  1960. toSerialize := map[string]interface{}{}
  1961. if o.MaxAmount == nil {
  1962. return nil, fmt.Errorf("field `MaxAmount` is required and must be specified in ModifyStockBudgetResponse")
  1963. }
  1964. toSerialize["max_amount"] = o.MaxAmount
  1965. if o.StockId == nil {
  1966. return nil, fmt.Errorf("field `StockId` is required and must be specified in ModifyStockBudgetResponse")
  1967. }
  1968. toSerialize["stock_id"] = o.StockId
  1969. return json.Marshal(toSerialize)
  1970. }
  1971. func (o ModifyStockBudgetResponse) String() string {
  1972. var ret string
  1973. if o.MaxAmount == nil {
  1974. ret += "MaxAmount:<nil>, "
  1975. } else {
  1976. ret += fmt.Sprintf("MaxAmount:%v, ", *o.MaxAmount)
  1977. }
  1978. if o.StockId == nil {
  1979. ret += "StockId:<nil>"
  1980. } else {
  1981. ret += fmt.Sprintf("StockId:%v", *o.StockId)
  1982. }
  1983. return fmt.Sprintf("ModifyStockBudgetResponse{%s}", ret)
  1984. }
  1985. func (o ModifyStockBudgetResponse) Clone() *ModifyStockBudgetResponse {
  1986. ret := ModifyStockBudgetResponse{}
  1987. if o.MaxAmount != nil {
  1988. ret.MaxAmount = new(int64)
  1989. *ret.MaxAmount = *o.MaxAmount
  1990. }
  1991. if o.StockId != nil {
  1992. ret.StockId = new(string)
  1993. *ret.StockId = *o.StockId
  1994. }
  1995. return &ret
  1996. }
  1997. // PatternInfo
  1998. type PatternInfo struct {
  1999. // 用于说明详细的活动规则,会展示在代金券详情页
  2000. Description *string `json:"description"`
  2001. // 商户logo
  2002. MerchantLogo *string `json:"merchant_logo,omitempty"`
  2003. // 商户名称
  2004. MerchantName *string `json:"merchant_name,omitempty"`
  2005. // 背景颜色
  2006. BackgroundColor *BackgroundColor `json:"background_color,omitempty"`
  2007. // 券详情图片
  2008. CouponImage *string `json:"coupon_image,omitempty"`
  2009. // 枚举值:PAYMENT_CODE:跳转至微信支付付款码,点击“立即使用”跳转至微信支付付款码 MINI_PROGRAM:跳转至小程序,点击“立即使用”跳转至配置的商家小程序(需要指定小程序appid和path) DEFAULT_PAGE:跳转至默认页, 点击“立即使用”跳转至默认页面 如未传该参数,则默认跳转至默认页。
  2010. JumpTarget *JumpTarget `json:"jump_target,omitempty"`
  2011. // 跳转的小程序appid,跳转至小程序时必填。跳转的小程序appid需至少和一个可核销商户有绑定关系。
  2012. MiniProgramAppid *string `json:"mini_program_appid,omitempty"`
  2013. // 跳转的小程序path,跳转至小程序时必填。
  2014. MiniProgramPath *string `json:"mini_program_path,omitempty"`
  2015. }
  2016. func (o PatternInfo) MarshalJSON() ([]byte, error) {
  2017. toSerialize := map[string]interface{}{}
  2018. if o.Description == nil {
  2019. return nil, fmt.Errorf("field `Description` is required and must be specified in PatternInfo")
  2020. }
  2021. toSerialize["description"] = o.Description
  2022. if o.MerchantLogo != nil {
  2023. toSerialize["merchant_logo"] = o.MerchantLogo
  2024. }
  2025. if o.MerchantName != nil {
  2026. toSerialize["merchant_name"] = o.MerchantName
  2027. }
  2028. if o.BackgroundColor != nil {
  2029. toSerialize["background_color"] = o.BackgroundColor
  2030. }
  2031. if o.CouponImage != nil {
  2032. toSerialize["coupon_image"] = o.CouponImage
  2033. }
  2034. if o.JumpTarget != nil {
  2035. toSerialize["jump_target"] = o.JumpTarget
  2036. }
  2037. if o.MiniProgramAppid != nil {
  2038. toSerialize["mini_program_appid"] = o.MiniProgramAppid
  2039. }
  2040. if o.MiniProgramPath != nil {
  2041. toSerialize["mini_program_path"] = o.MiniProgramPath
  2042. }
  2043. return json.Marshal(toSerialize)
  2044. }
  2045. func (o PatternInfo) String() string {
  2046. var ret string
  2047. if o.Description == nil {
  2048. ret += "Description:<nil>, "
  2049. } else {
  2050. ret += fmt.Sprintf("Description:%v, ", *o.Description)
  2051. }
  2052. if o.MerchantLogo == nil {
  2053. ret += "MerchantLogo:<nil>, "
  2054. } else {
  2055. ret += fmt.Sprintf("MerchantLogo:%v, ", *o.MerchantLogo)
  2056. }
  2057. if o.MerchantName == nil {
  2058. ret += "MerchantName:<nil>, "
  2059. } else {
  2060. ret += fmt.Sprintf("MerchantName:%v, ", *o.MerchantName)
  2061. }
  2062. if o.BackgroundColor == nil {
  2063. ret += "BackgroundColor:<nil>, "
  2064. } else {
  2065. ret += fmt.Sprintf("BackgroundColor:%v, ", *o.BackgroundColor)
  2066. }
  2067. if o.CouponImage == nil {
  2068. ret += "CouponImage:<nil>, "
  2069. } else {
  2070. ret += fmt.Sprintf("CouponImage:%v, ", *o.CouponImage)
  2071. }
  2072. if o.JumpTarget == nil {
  2073. ret += "JumpTarget:<nil>, "
  2074. } else {
  2075. ret += fmt.Sprintf("JumpTarget:%v, ", *o.JumpTarget)
  2076. }
  2077. if o.MiniProgramAppid == nil {
  2078. ret += "MiniProgramAppid:<nil>, "
  2079. } else {
  2080. ret += fmt.Sprintf("MiniProgramAppid:%v, ", *o.MiniProgramAppid)
  2081. }
  2082. if o.MiniProgramPath == nil {
  2083. ret += "MiniProgramPath:<nil>"
  2084. } else {
  2085. ret += fmt.Sprintf("MiniProgramPath:%v", *o.MiniProgramPath)
  2086. }
  2087. return fmt.Sprintf("PatternInfo{%s}", ret)
  2088. }
  2089. func (o PatternInfo) Clone() *PatternInfo {
  2090. ret := PatternInfo{}
  2091. if o.Description != nil {
  2092. ret.Description = new(string)
  2093. *ret.Description = *o.Description
  2094. }
  2095. if o.MerchantLogo != nil {
  2096. ret.MerchantLogo = new(string)
  2097. *ret.MerchantLogo = *o.MerchantLogo
  2098. }
  2099. if o.MerchantName != nil {
  2100. ret.MerchantName = new(string)
  2101. *ret.MerchantName = *o.MerchantName
  2102. }
  2103. if o.BackgroundColor != nil {
  2104. ret.BackgroundColor = new(BackgroundColor)
  2105. *ret.BackgroundColor = *o.BackgroundColor
  2106. }
  2107. if o.CouponImage != nil {
  2108. ret.CouponImage = new(string)
  2109. *ret.CouponImage = *o.CouponImage
  2110. }
  2111. if o.JumpTarget != nil {
  2112. ret.JumpTarget = new(JumpTarget)
  2113. *ret.JumpTarget = *o.JumpTarget
  2114. }
  2115. if o.MiniProgramAppid != nil {
  2116. ret.MiniProgramAppid = new(string)
  2117. *ret.MiniProgramAppid = *o.MiniProgramAppid
  2118. }
  2119. if o.MiniProgramPath != nil {
  2120. ret.MiniProgramPath = new(string)
  2121. *ret.MiniProgramPath = *o.MiniProgramPath
  2122. }
  2123. return &ret
  2124. }
  2125. // PauseStockBody
  2126. type PauseStockBody struct {
  2127. // 批次创建方商户号
  2128. StockCreatorMchid *string `json:"stock_creator_mchid"`
  2129. }
  2130. func (o PauseStockBody) MarshalJSON() ([]byte, error) {
  2131. toSerialize := map[string]interface{}{}
  2132. if o.StockCreatorMchid == nil {
  2133. return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in PauseStockBody")
  2134. }
  2135. toSerialize["stock_creator_mchid"] = o.StockCreatorMchid
  2136. return json.Marshal(toSerialize)
  2137. }
  2138. func (o PauseStockBody) String() string {
  2139. var ret string
  2140. if o.StockCreatorMchid == nil {
  2141. ret += "StockCreatorMchid:<nil>"
  2142. } else {
  2143. ret += fmt.Sprintf("StockCreatorMchid:%v", *o.StockCreatorMchid)
  2144. }
  2145. return fmt.Sprintf("PauseStockBody{%s}", ret)
  2146. }
  2147. func (o PauseStockBody) Clone() *PauseStockBody {
  2148. ret := PauseStockBody{}
  2149. if o.StockCreatorMchid != nil {
  2150. ret.StockCreatorMchid = new(string)
  2151. *ret.StockCreatorMchid = *o.StockCreatorMchid
  2152. }
  2153. return &ret
  2154. }
  2155. // PauseStockRequest
  2156. type PauseStockRequest struct {
  2157. // 批次创建方商户号
  2158. StockCreatorMchid *string `json:"stock_creator_mchid"`
  2159. // 批次号
  2160. StockId *string `json:"stock_id"`
  2161. }
  2162. func (o PauseStockRequest) MarshalJSON() ([]byte, error) {
  2163. toSerialize := map[string]interface{}{}
  2164. if o.StockCreatorMchid == nil {
  2165. return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in PauseStockRequest")
  2166. }
  2167. toSerialize["stock_creator_mchid"] = o.StockCreatorMchid
  2168. if o.StockId == nil {
  2169. return nil, fmt.Errorf("field `StockId` is required and must be specified in PauseStockRequest")
  2170. }
  2171. toSerialize["stock_id"] = o.StockId
  2172. return json.Marshal(toSerialize)
  2173. }
  2174. func (o PauseStockRequest) String() string {
  2175. var ret string
  2176. if o.StockCreatorMchid == nil {
  2177. ret += "StockCreatorMchid:<nil>, "
  2178. } else {
  2179. ret += fmt.Sprintf("StockCreatorMchid:%v, ", *o.StockCreatorMchid)
  2180. }
  2181. if o.StockId == nil {
  2182. ret += "StockId:<nil>"
  2183. } else {
  2184. ret += fmt.Sprintf("StockId:%v", *o.StockId)
  2185. }
  2186. return fmt.Sprintf("PauseStockRequest{%s}", ret)
  2187. }
  2188. func (o PauseStockRequest) Clone() *PauseStockRequest {
  2189. ret := PauseStockRequest{}
  2190. if o.StockCreatorMchid != nil {
  2191. ret.StockCreatorMchid = new(string)
  2192. *ret.StockCreatorMchid = *o.StockCreatorMchid
  2193. }
  2194. if o.StockId != nil {
  2195. ret.StockId = new(string)
  2196. *ret.StockId = *o.StockId
  2197. }
  2198. return &ret
  2199. }
  2200. // PauseStockResponse
  2201. type PauseStockResponse struct {
  2202. // 暂停时间,遵循[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秒。
  2203. PauseTime *string `json:"pause_time"`
  2204. // 批次号
  2205. StockId *string `json:"stock_id"`
  2206. }
  2207. func (o PauseStockResponse) MarshalJSON() ([]byte, error) {
  2208. toSerialize := map[string]interface{}{}
  2209. if o.PauseTime == nil {
  2210. return nil, fmt.Errorf("field `PauseTime` is required and must be specified in PauseStockResponse")
  2211. }
  2212. toSerialize["pause_time"] = o.PauseTime
  2213. if o.StockId == nil {
  2214. return nil, fmt.Errorf("field `StockId` is required and must be specified in PauseStockResponse")
  2215. }
  2216. toSerialize["stock_id"] = o.StockId
  2217. return json.Marshal(toSerialize)
  2218. }
  2219. func (o PauseStockResponse) String() string {
  2220. var ret string
  2221. if o.PauseTime == nil {
  2222. ret += "PauseTime:<nil>, "
  2223. } else {
  2224. ret += fmt.Sprintf("PauseTime:%v, ", *o.PauseTime)
  2225. }
  2226. if o.StockId == nil {
  2227. ret += "StockId:<nil>"
  2228. } else {
  2229. ret += fmt.Sprintf("StockId:%v", *o.StockId)
  2230. }
  2231. return fmt.Sprintf("PauseStockResponse{%s}", ret)
  2232. }
  2233. func (o PauseStockResponse) Clone() *PauseStockResponse {
  2234. ret := PauseStockResponse{}
  2235. if o.PauseTime != nil {
  2236. ret.PauseTime = new(string)
  2237. *ret.PauseTime = *o.PauseTime
  2238. }
  2239. if o.StockId != nil {
  2240. ret.StockId = new(string)
  2241. *ret.StockId = *o.StockId
  2242. }
  2243. return &ret
  2244. }
  2245. // PlatformFavorStockStatus
  2246. type PlatformFavorStockStatus string
  2247. func (e PlatformFavorStockStatus) Ptr() *PlatformFavorStockStatus {
  2248. return &e
  2249. }
  2250. // Enums of PlatformFavorStockStatus
  2251. const (
  2252. PLATFORMFAVORSTOCKSTATUS_UNACTIVATED PlatformFavorStockStatus = "UNACTIVATED"
  2253. PLATFORMFAVORSTOCKSTATUS_RUNNING PlatformFavorStockStatus = "RUNNING"
  2254. PLATFORMFAVORSTOCKSTATUS_PAUSED PlatformFavorStockStatus = "PAUSED"
  2255. PLATFORMFAVORSTOCKSTATUS_EXPIRED PlatformFavorStockStatus = "EXPIRED"
  2256. )
  2257. // QueryCallbackRequest
  2258. type QueryCallbackRequest struct {
  2259. // 商户号
  2260. Mchid *string `json:"mchid"`
  2261. }
  2262. func (o QueryCallbackRequest) MarshalJSON() ([]byte, error) {
  2263. toSerialize := map[string]interface{}{}
  2264. if o.Mchid == nil {
  2265. return nil, fmt.Errorf("field `Mchid` is required and must be specified in QueryCallbackRequest")
  2266. }
  2267. toSerialize["mchid"] = o.Mchid
  2268. return json.Marshal(toSerialize)
  2269. }
  2270. func (o QueryCallbackRequest) String() string {
  2271. var ret string
  2272. if o.Mchid == nil {
  2273. ret += "Mchid:<nil>"
  2274. } else {
  2275. ret += fmt.Sprintf("Mchid:%v", *o.Mchid)
  2276. }
  2277. return fmt.Sprintf("QueryCallbackRequest{%s}", ret)
  2278. }
  2279. func (o QueryCallbackRequest) Clone() *QueryCallbackRequest {
  2280. ret := QueryCallbackRequest{}
  2281. if o.Mchid != nil {
  2282. ret.Mchid = new(string)
  2283. *ret.Mchid = *o.Mchid
  2284. }
  2285. return &ret
  2286. }
  2287. // QueryCouponRequest
  2288. type QueryCouponRequest struct {
  2289. // 代金券id
  2290. CouponId *string `json:"coupon_id"`
  2291. // 微信为发券方商户分配的公众账号ID,接口传入的所有appid应该为公众号的appid(在mp.weixin.qq.com申请的),不能为APP的appid(在open.weixin.qq.com申请的)。
  2292. Appid *string `json:"appid"`
  2293. // Openid信息,用户在appid下的唯一标识
  2294. Openid *string `json:"openid"`
  2295. }
  2296. func (o QueryCouponRequest) MarshalJSON() ([]byte, error) {
  2297. toSerialize := map[string]interface{}{}
  2298. if o.CouponId == nil {
  2299. return nil, fmt.Errorf("field `CouponId` is required and must be specified in QueryCouponRequest")
  2300. }
  2301. toSerialize["coupon_id"] = o.CouponId
  2302. if o.Appid == nil {
  2303. return nil, fmt.Errorf("field `Appid` is required and must be specified in QueryCouponRequest")
  2304. }
  2305. toSerialize["appid"] = o.Appid
  2306. if o.Openid == nil {
  2307. return nil, fmt.Errorf("field `Openid` is required and must be specified in QueryCouponRequest")
  2308. }
  2309. toSerialize["openid"] = o.Openid
  2310. return json.Marshal(toSerialize)
  2311. }
  2312. func (o QueryCouponRequest) String() string {
  2313. var ret string
  2314. if o.CouponId == nil {
  2315. ret += "CouponId:<nil>, "
  2316. } else {
  2317. ret += fmt.Sprintf("CouponId:%v, ", *o.CouponId)
  2318. }
  2319. if o.Appid == nil {
  2320. ret += "Appid:<nil>, "
  2321. } else {
  2322. ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
  2323. }
  2324. if o.Openid == nil {
  2325. ret += "Openid:<nil>"
  2326. } else {
  2327. ret += fmt.Sprintf("Openid:%v", *o.Openid)
  2328. }
  2329. return fmt.Sprintf("QueryCouponRequest{%s}", ret)
  2330. }
  2331. func (o QueryCouponRequest) Clone() *QueryCouponRequest {
  2332. ret := QueryCouponRequest{}
  2333. if o.CouponId != nil {
  2334. ret.CouponId = new(string)
  2335. *ret.CouponId = *o.CouponId
  2336. }
  2337. if o.Appid != nil {
  2338. ret.Appid = new(string)
  2339. *ret.Appid = *o.Appid
  2340. }
  2341. if o.Openid != nil {
  2342. ret.Openid = new(string)
  2343. *ret.Openid = *o.Openid
  2344. }
  2345. return &ret
  2346. }
  2347. // QueryStockRequest
  2348. type QueryStockRequest struct {
  2349. // 批次id
  2350. StockId *string `json:"stock_id"`
  2351. // 批次创建时的商户号
  2352. StockCreatorMchid *string `json:"stock_creator_mchid"`
  2353. }
  2354. func (o QueryStockRequest) MarshalJSON() ([]byte, error) {
  2355. toSerialize := map[string]interface{}{}
  2356. if o.StockId == nil {
  2357. return nil, fmt.Errorf("field `StockId` is required and must be specified in QueryStockRequest")
  2358. }
  2359. toSerialize["stock_id"] = o.StockId
  2360. if o.StockCreatorMchid == nil {
  2361. return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in QueryStockRequest")
  2362. }
  2363. toSerialize["stock_creator_mchid"] = o.StockCreatorMchid
  2364. return json.Marshal(toSerialize)
  2365. }
  2366. func (o QueryStockRequest) String() string {
  2367. var ret string
  2368. if o.StockId == nil {
  2369. ret += "StockId:<nil>, "
  2370. } else {
  2371. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  2372. }
  2373. if o.StockCreatorMchid == nil {
  2374. ret += "StockCreatorMchid:<nil>"
  2375. } else {
  2376. ret += fmt.Sprintf("StockCreatorMchid:%v", *o.StockCreatorMchid)
  2377. }
  2378. return fmt.Sprintf("QueryStockRequest{%s}", ret)
  2379. }
  2380. func (o QueryStockRequest) Clone() *QueryStockRequest {
  2381. ret := QueryStockRequest{}
  2382. if o.StockId != nil {
  2383. ret.StockId = new(string)
  2384. *ret.StockId = *o.StockId
  2385. }
  2386. if o.StockCreatorMchid != nil {
  2387. ret.StockCreatorMchid = new(string)
  2388. *ret.StockCreatorMchid = *o.StockCreatorMchid
  2389. }
  2390. return &ret
  2391. }
  2392. // RefundFlowRequest
  2393. type RefundFlowRequest struct {
  2394. // 批次号
  2395. StockId *string `json:"stock_id"`
  2396. }
  2397. func (o RefundFlowRequest) MarshalJSON() ([]byte, error) {
  2398. toSerialize := map[string]interface{}{}
  2399. if o.StockId == nil {
  2400. return nil, fmt.Errorf("field `StockId` is required and must be specified in RefundFlowRequest")
  2401. }
  2402. toSerialize["stock_id"] = o.StockId
  2403. return json.Marshal(toSerialize)
  2404. }
  2405. func (o RefundFlowRequest) String() string {
  2406. var ret string
  2407. if o.StockId == nil {
  2408. ret += "StockId:<nil>"
  2409. } else {
  2410. ret += fmt.Sprintf("StockId:%v", *o.StockId)
  2411. }
  2412. return fmt.Sprintf("RefundFlowRequest{%s}", ret)
  2413. }
  2414. func (o RefundFlowRequest) Clone() *RefundFlowRequest {
  2415. ret := RefundFlowRequest{}
  2416. if o.StockId != nil {
  2417. ret.StockId = new(string)
  2418. *ret.StockId = *o.StockId
  2419. }
  2420. return &ret
  2421. }
  2422. // RefundFlowResponse
  2423. type RefundFlowResponse struct {
  2424. // 流水文件下载链接,30s内有效
  2425. Url *string `json:"url"`
  2426. // 文件内容的哈希值,防止篡改
  2427. HashValue *string `json:"hash_value"`
  2428. // 哈希算法类型,目前支持sha1
  2429. HashType *string `json:"hash_type"`
  2430. }
  2431. func (o RefundFlowResponse) MarshalJSON() ([]byte, error) {
  2432. toSerialize := map[string]interface{}{}
  2433. if o.Url == nil {
  2434. return nil, fmt.Errorf("field `Url` is required and must be specified in RefundFlowResponse")
  2435. }
  2436. toSerialize["url"] = o.Url
  2437. if o.HashValue == nil {
  2438. return nil, fmt.Errorf("field `HashValue` is required and must be specified in RefundFlowResponse")
  2439. }
  2440. toSerialize["hash_value"] = o.HashValue
  2441. if o.HashType == nil {
  2442. return nil, fmt.Errorf("field `HashType` is required and must be specified in RefundFlowResponse")
  2443. }
  2444. toSerialize["hash_type"] = o.HashType
  2445. return json.Marshal(toSerialize)
  2446. }
  2447. func (o RefundFlowResponse) String() string {
  2448. var ret string
  2449. if o.Url == nil {
  2450. ret += "Url:<nil>, "
  2451. } else {
  2452. ret += fmt.Sprintf("Url:%v, ", *o.Url)
  2453. }
  2454. if o.HashValue == nil {
  2455. ret += "HashValue:<nil>, "
  2456. } else {
  2457. ret += fmt.Sprintf("HashValue:%v, ", *o.HashValue)
  2458. }
  2459. if o.HashType == nil {
  2460. ret += "HashType:<nil>"
  2461. } else {
  2462. ret += fmt.Sprintf("HashType:%v", *o.HashType)
  2463. }
  2464. return fmt.Sprintf("RefundFlowResponse{%s}", ret)
  2465. }
  2466. func (o RefundFlowResponse) Clone() *RefundFlowResponse {
  2467. ret := RefundFlowResponse{}
  2468. if o.Url != nil {
  2469. ret.Url = new(string)
  2470. *ret.Url = *o.Url
  2471. }
  2472. if o.HashValue != nil {
  2473. ret.HashValue = new(string)
  2474. *ret.HashValue = *o.HashValue
  2475. }
  2476. if o.HashType != nil {
  2477. ret.HashType = new(string)
  2478. *ret.HashType = *o.HashType
  2479. }
  2480. return &ret
  2481. }
  2482. // RestartStockBody
  2483. type RestartStockBody struct {
  2484. // 批次创建方商户号
  2485. StockCreatorMchid *string `json:"stock_creator_mchid"`
  2486. }
  2487. func (o RestartStockBody) MarshalJSON() ([]byte, error) {
  2488. toSerialize := map[string]interface{}{}
  2489. if o.StockCreatorMchid == nil {
  2490. return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in RestartStockBody")
  2491. }
  2492. toSerialize["stock_creator_mchid"] = o.StockCreatorMchid
  2493. return json.Marshal(toSerialize)
  2494. }
  2495. func (o RestartStockBody) String() string {
  2496. var ret string
  2497. if o.StockCreatorMchid == nil {
  2498. ret += "StockCreatorMchid:<nil>"
  2499. } else {
  2500. ret += fmt.Sprintf("StockCreatorMchid:%v", *o.StockCreatorMchid)
  2501. }
  2502. return fmt.Sprintf("RestartStockBody{%s}", ret)
  2503. }
  2504. func (o RestartStockBody) Clone() *RestartStockBody {
  2505. ret := RestartStockBody{}
  2506. if o.StockCreatorMchid != nil {
  2507. ret.StockCreatorMchid = new(string)
  2508. *ret.StockCreatorMchid = *o.StockCreatorMchid
  2509. }
  2510. return &ret
  2511. }
  2512. // RestartStockRequest
  2513. type RestartStockRequest struct {
  2514. // 批次创建方商户号
  2515. StockCreatorMchid *string `json:"stock_creator_mchid"`
  2516. // 批次号
  2517. StockId *string `json:"stock_id"`
  2518. }
  2519. func (o RestartStockRequest) MarshalJSON() ([]byte, error) {
  2520. toSerialize := map[string]interface{}{}
  2521. if o.StockCreatorMchid == nil {
  2522. return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in RestartStockRequest")
  2523. }
  2524. toSerialize["stock_creator_mchid"] = o.StockCreatorMchid
  2525. if o.StockId == nil {
  2526. return nil, fmt.Errorf("field `StockId` is required and must be specified in RestartStockRequest")
  2527. }
  2528. toSerialize["stock_id"] = o.StockId
  2529. return json.Marshal(toSerialize)
  2530. }
  2531. func (o RestartStockRequest) String() string {
  2532. var ret string
  2533. if o.StockCreatorMchid == nil {
  2534. ret += "StockCreatorMchid:<nil>, "
  2535. } else {
  2536. ret += fmt.Sprintf("StockCreatorMchid:%v, ", *o.StockCreatorMchid)
  2537. }
  2538. if o.StockId == nil {
  2539. ret += "StockId:<nil>"
  2540. } else {
  2541. ret += fmt.Sprintf("StockId:%v", *o.StockId)
  2542. }
  2543. return fmt.Sprintf("RestartStockRequest{%s}", ret)
  2544. }
  2545. func (o RestartStockRequest) Clone() *RestartStockRequest {
  2546. ret := RestartStockRequest{}
  2547. if o.StockCreatorMchid != nil {
  2548. ret.StockCreatorMchid = new(string)
  2549. *ret.StockCreatorMchid = *o.StockCreatorMchid
  2550. }
  2551. if o.StockId != nil {
  2552. ret.StockId = new(string)
  2553. *ret.StockId = *o.StockId
  2554. }
  2555. return &ret
  2556. }
  2557. // RestartStockResponse
  2558. type RestartStockResponse struct {
  2559. // 生效时间
  2560. RestartTime *string `json:"restart_time"`
  2561. // 批次号
  2562. StockId *string `json:"stock_id"`
  2563. }
  2564. func (o RestartStockResponse) MarshalJSON() ([]byte, error) {
  2565. toSerialize := map[string]interface{}{}
  2566. if o.RestartTime == nil {
  2567. return nil, fmt.Errorf("field `RestartTime` is required and must be specified in RestartStockResponse")
  2568. }
  2569. toSerialize["restart_time"] = o.RestartTime
  2570. if o.StockId == nil {
  2571. return nil, fmt.Errorf("field `StockId` is required and must be specified in RestartStockResponse")
  2572. }
  2573. toSerialize["stock_id"] = o.StockId
  2574. return json.Marshal(toSerialize)
  2575. }
  2576. func (o RestartStockResponse) String() string {
  2577. var ret string
  2578. if o.RestartTime == nil {
  2579. ret += "RestartTime:<nil>, "
  2580. } else {
  2581. ret += fmt.Sprintf("RestartTime:%v, ", *o.RestartTime)
  2582. }
  2583. if o.StockId == nil {
  2584. ret += "StockId:<nil>"
  2585. } else {
  2586. ret += fmt.Sprintf("StockId:%v", *o.StockId)
  2587. }
  2588. return fmt.Sprintf("RestartStockResponse{%s}", ret)
  2589. }
  2590. func (o RestartStockResponse) Clone() *RestartStockResponse {
  2591. ret := RestartStockResponse{}
  2592. if o.RestartTime != nil {
  2593. ret.RestartTime = new(string)
  2594. *ret.RestartTime = *o.RestartTime
  2595. }
  2596. if o.StockId != nil {
  2597. ret.StockId = new(string)
  2598. *ret.StockId = *o.StockId
  2599. }
  2600. return &ret
  2601. }
  2602. // SendCouponBody
  2603. type SendCouponBody struct {
  2604. // 微信为每个批次分配的唯一id
  2605. StockId *string `json:"stock_id"`
  2606. // 商户此次发放凭据号(格式:商户id+日期+流水号),商户侧需保持唯一性
  2607. OutRequestNo *string `json:"out_request_no"`
  2608. // 微信为发券方商户分配的公众账号ID,接口传入的所有appid应该为公众号的appid(在mp.weixin.qq.com申请的),不能为APP的appid(在open.weixin.qq.com申请的)。
  2609. Appid *string `json:"appid"`
  2610. // 批次创建方商户号
  2611. StockCreatorMchid *string `json:"stock_creator_mchid"`
  2612. // 指定面额发券场景,券面额,其他场景不需要填,单位分
  2613. CouponValue *int64 `json:"coupon_value,omitempty"`
  2614. // 指定面额发券批次门槛,其他场景不需要,单位分
  2615. CouponMinimum *int64 `json:"coupon_minimum,omitempty"`
  2616. }
  2617. func (o SendCouponBody) MarshalJSON() ([]byte, error) {
  2618. toSerialize := map[string]interface{}{}
  2619. if o.StockId == nil {
  2620. return nil, fmt.Errorf("field `StockId` is required and must be specified in SendCouponBody")
  2621. }
  2622. toSerialize["stock_id"] = o.StockId
  2623. if o.OutRequestNo == nil {
  2624. return nil, fmt.Errorf("field `OutRequestNo` is required and must be specified in SendCouponBody")
  2625. }
  2626. toSerialize["out_request_no"] = o.OutRequestNo
  2627. if o.Appid == nil {
  2628. return nil, fmt.Errorf("field `Appid` is required and must be specified in SendCouponBody")
  2629. }
  2630. toSerialize["appid"] = o.Appid
  2631. if o.StockCreatorMchid == nil {
  2632. return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in SendCouponBody")
  2633. }
  2634. toSerialize["stock_creator_mchid"] = o.StockCreatorMchid
  2635. if o.CouponValue != nil {
  2636. toSerialize["coupon_value"] = o.CouponValue
  2637. }
  2638. if o.CouponMinimum != nil {
  2639. toSerialize["coupon_minimum"] = o.CouponMinimum
  2640. }
  2641. return json.Marshal(toSerialize)
  2642. }
  2643. func (o SendCouponBody) String() string {
  2644. var ret string
  2645. if o.StockId == nil {
  2646. ret += "StockId:<nil>, "
  2647. } else {
  2648. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  2649. }
  2650. if o.OutRequestNo == nil {
  2651. ret += "OutRequestNo:<nil>, "
  2652. } else {
  2653. ret += fmt.Sprintf("OutRequestNo:%v, ", *o.OutRequestNo)
  2654. }
  2655. if o.Appid == nil {
  2656. ret += "Appid:<nil>, "
  2657. } else {
  2658. ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
  2659. }
  2660. if o.StockCreatorMchid == nil {
  2661. ret += "StockCreatorMchid:<nil>, "
  2662. } else {
  2663. ret += fmt.Sprintf("StockCreatorMchid:%v, ", *o.StockCreatorMchid)
  2664. }
  2665. if o.CouponValue == nil {
  2666. ret += "CouponValue:<nil>, "
  2667. } else {
  2668. ret += fmt.Sprintf("CouponValue:%v, ", *o.CouponValue)
  2669. }
  2670. if o.CouponMinimum == nil {
  2671. ret += "CouponMinimum:<nil>"
  2672. } else {
  2673. ret += fmt.Sprintf("CouponMinimum:%v", *o.CouponMinimum)
  2674. }
  2675. return fmt.Sprintf("SendCouponBody{%s}", ret)
  2676. }
  2677. func (o SendCouponBody) Clone() *SendCouponBody {
  2678. ret := SendCouponBody{}
  2679. if o.StockId != nil {
  2680. ret.StockId = new(string)
  2681. *ret.StockId = *o.StockId
  2682. }
  2683. if o.OutRequestNo != nil {
  2684. ret.OutRequestNo = new(string)
  2685. *ret.OutRequestNo = *o.OutRequestNo
  2686. }
  2687. if o.Appid != nil {
  2688. ret.Appid = new(string)
  2689. *ret.Appid = *o.Appid
  2690. }
  2691. if o.StockCreatorMchid != nil {
  2692. ret.StockCreatorMchid = new(string)
  2693. *ret.StockCreatorMchid = *o.StockCreatorMchid
  2694. }
  2695. if o.CouponValue != nil {
  2696. ret.CouponValue = new(int64)
  2697. *ret.CouponValue = *o.CouponValue
  2698. }
  2699. if o.CouponMinimum != nil {
  2700. ret.CouponMinimum = new(int64)
  2701. *ret.CouponMinimum = *o.CouponMinimum
  2702. }
  2703. return &ret
  2704. }
  2705. // SendCouponRequest
  2706. type SendCouponRequest struct {
  2707. // 微信为每个批次分配的唯一id
  2708. StockId *string `json:"stock_id"`
  2709. // Openid信息,用户在appid下的唯一标识
  2710. Openid *string `json:"openid"`
  2711. // 商户此次发放凭据号(格式:商户id+日期+流水号),商户侧需保持唯一性
  2712. OutRequestNo *string `json:"out_request_no"`
  2713. // 微信为发券方商户分配的公众账号ID,接口传入的所有appid应该为公众号的appid(在mp.weixin.qq.com申请的),不能为APP的appid(在open.weixin.qq.com申请的)。
  2714. Appid *string `json:"appid"`
  2715. // 批次创建方商户号
  2716. StockCreatorMchid *string `json:"stock_creator_mchid"`
  2717. // 指定面额发券场景,券面额,其他场景不需要填,单位分
  2718. CouponValue *int64 `json:"coupon_value,omitempty"`
  2719. // 指定面额发券批次门槛,其他场景不需要,单位分
  2720. CouponMinimum *int64 `json:"coupon_minimum,omitempty"`
  2721. }
  2722. func (o SendCouponRequest) MarshalJSON() ([]byte, error) {
  2723. toSerialize := map[string]interface{}{}
  2724. if o.StockId == nil {
  2725. return nil, fmt.Errorf("field `StockId` is required and must be specified in SendCouponRequest")
  2726. }
  2727. toSerialize["stock_id"] = o.StockId
  2728. if o.Openid == nil {
  2729. return nil, fmt.Errorf("field `Openid` is required and must be specified in SendCouponRequest")
  2730. }
  2731. toSerialize["openid"] = o.Openid
  2732. if o.OutRequestNo == nil {
  2733. return nil, fmt.Errorf("field `OutRequestNo` is required and must be specified in SendCouponRequest")
  2734. }
  2735. toSerialize["out_request_no"] = o.OutRequestNo
  2736. if o.Appid == nil {
  2737. return nil, fmt.Errorf("field `Appid` is required and must be specified in SendCouponRequest")
  2738. }
  2739. toSerialize["appid"] = o.Appid
  2740. if o.StockCreatorMchid == nil {
  2741. return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in SendCouponRequest")
  2742. }
  2743. toSerialize["stock_creator_mchid"] = o.StockCreatorMchid
  2744. if o.CouponValue != nil {
  2745. toSerialize["coupon_value"] = o.CouponValue
  2746. }
  2747. if o.CouponMinimum != nil {
  2748. toSerialize["coupon_minimum"] = o.CouponMinimum
  2749. }
  2750. return json.Marshal(toSerialize)
  2751. }
  2752. func (o SendCouponRequest) String() string {
  2753. var ret string
  2754. if o.StockId == nil {
  2755. ret += "StockId:<nil>, "
  2756. } else {
  2757. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  2758. }
  2759. if o.Openid == nil {
  2760. ret += "Openid:<nil>, "
  2761. } else {
  2762. ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
  2763. }
  2764. if o.OutRequestNo == nil {
  2765. ret += "OutRequestNo:<nil>, "
  2766. } else {
  2767. ret += fmt.Sprintf("OutRequestNo:%v, ", *o.OutRequestNo)
  2768. }
  2769. if o.Appid == nil {
  2770. ret += "Appid:<nil>, "
  2771. } else {
  2772. ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
  2773. }
  2774. if o.StockCreatorMchid == nil {
  2775. ret += "StockCreatorMchid:<nil>, "
  2776. } else {
  2777. ret += fmt.Sprintf("StockCreatorMchid:%v, ", *o.StockCreatorMchid)
  2778. }
  2779. if o.CouponValue == nil {
  2780. ret += "CouponValue:<nil>, "
  2781. } else {
  2782. ret += fmt.Sprintf("CouponValue:%v, ", *o.CouponValue)
  2783. }
  2784. if o.CouponMinimum == nil {
  2785. ret += "CouponMinimum:<nil>"
  2786. } else {
  2787. ret += fmt.Sprintf("CouponMinimum:%v", *o.CouponMinimum)
  2788. }
  2789. return fmt.Sprintf("SendCouponRequest{%s}", ret)
  2790. }
  2791. func (o SendCouponRequest) Clone() *SendCouponRequest {
  2792. ret := SendCouponRequest{}
  2793. if o.StockId != nil {
  2794. ret.StockId = new(string)
  2795. *ret.StockId = *o.StockId
  2796. }
  2797. if o.Openid != nil {
  2798. ret.Openid = new(string)
  2799. *ret.Openid = *o.Openid
  2800. }
  2801. if o.OutRequestNo != nil {
  2802. ret.OutRequestNo = new(string)
  2803. *ret.OutRequestNo = *o.OutRequestNo
  2804. }
  2805. if o.Appid != nil {
  2806. ret.Appid = new(string)
  2807. *ret.Appid = *o.Appid
  2808. }
  2809. if o.StockCreatorMchid != nil {
  2810. ret.StockCreatorMchid = new(string)
  2811. *ret.StockCreatorMchid = *o.StockCreatorMchid
  2812. }
  2813. if o.CouponValue != nil {
  2814. ret.CouponValue = new(int64)
  2815. *ret.CouponValue = *o.CouponValue
  2816. }
  2817. if o.CouponMinimum != nil {
  2818. ret.CouponMinimum = new(int64)
  2819. *ret.CouponMinimum = *o.CouponMinimum
  2820. }
  2821. return &ret
  2822. }
  2823. // SendCouponResponse
  2824. type SendCouponResponse struct {
  2825. // 发放给用户的代金券id
  2826. CouponId *string `json:"coupon_id"`
  2827. }
  2828. func (o SendCouponResponse) MarshalJSON() ([]byte, error) {
  2829. toSerialize := map[string]interface{}{}
  2830. if o.CouponId == nil {
  2831. return nil, fmt.Errorf("field `CouponId` is required and must be specified in SendCouponResponse")
  2832. }
  2833. toSerialize["coupon_id"] = o.CouponId
  2834. return json.Marshal(toSerialize)
  2835. }
  2836. func (o SendCouponResponse) String() string {
  2837. var ret string
  2838. if o.CouponId == nil {
  2839. ret += "CouponId:<nil>"
  2840. } else {
  2841. ret += fmt.Sprintf("CouponId:%v", *o.CouponId)
  2842. }
  2843. return fmt.Sprintf("SendCouponResponse{%s}", ret)
  2844. }
  2845. func (o SendCouponResponse) Clone() *SendCouponResponse {
  2846. ret := SendCouponResponse{}
  2847. if o.CouponId != nil {
  2848. ret.CouponId = new(string)
  2849. *ret.CouponId = *o.CouponId
  2850. }
  2851. return &ret
  2852. }
  2853. // SetCallbackRequest
  2854. type SetCallbackRequest struct {
  2855. // 微信支付商户号
  2856. Mchid *string `json:"mchid"`
  2857. // 支付通知商户url地址
  2858. NotifyUrl *string `json:"notify_url"`
  2859. // true-开启推送;false-停止推送
  2860. Switch *bool `json:"switch,omitempty"`
  2861. }
  2862. func (o SetCallbackRequest) MarshalJSON() ([]byte, error) {
  2863. toSerialize := map[string]interface{}{}
  2864. if o.Mchid == nil {
  2865. return nil, fmt.Errorf("field `Mchid` is required and must be specified in SetCallbackRequest")
  2866. }
  2867. toSerialize["mchid"] = o.Mchid
  2868. if o.NotifyUrl == nil {
  2869. return nil, fmt.Errorf("field `NotifyUrl` is required and must be specified in SetCallbackRequest")
  2870. }
  2871. toSerialize["notify_url"] = o.NotifyUrl
  2872. if o.Switch != nil {
  2873. toSerialize["switch"] = o.Switch
  2874. }
  2875. return json.Marshal(toSerialize)
  2876. }
  2877. func (o SetCallbackRequest) String() string {
  2878. var ret string
  2879. if o.Mchid == nil {
  2880. ret += "Mchid:<nil>, "
  2881. } else {
  2882. ret += fmt.Sprintf("Mchid:%v, ", *o.Mchid)
  2883. }
  2884. if o.NotifyUrl == nil {
  2885. ret += "NotifyUrl:<nil>, "
  2886. } else {
  2887. ret += fmt.Sprintf("NotifyUrl:%v, ", *o.NotifyUrl)
  2888. }
  2889. if o.Switch == nil {
  2890. ret += "Switch:<nil>"
  2891. } else {
  2892. ret += fmt.Sprintf("Switch:%v", *o.Switch)
  2893. }
  2894. return fmt.Sprintf("SetCallbackRequest{%s}", ret)
  2895. }
  2896. func (o SetCallbackRequest) Clone() *SetCallbackRequest {
  2897. ret := SetCallbackRequest{}
  2898. if o.Mchid != nil {
  2899. ret.Mchid = new(string)
  2900. *ret.Mchid = *o.Mchid
  2901. }
  2902. if o.NotifyUrl != nil {
  2903. ret.NotifyUrl = new(string)
  2904. *ret.NotifyUrl = *o.NotifyUrl
  2905. }
  2906. if o.Switch != nil {
  2907. ret.Switch = new(bool)
  2908. *ret.Switch = *o.Switch
  2909. }
  2910. return &ret
  2911. }
  2912. // SetCallbackResponse
  2913. type SetCallbackResponse struct {
  2914. // 修改时间
  2915. UpdateTime *string `json:"update_time"`
  2916. // 通知地址
  2917. NotifyUrl *string `json:"notify_url"`
  2918. }
  2919. func (o SetCallbackResponse) MarshalJSON() ([]byte, error) {
  2920. toSerialize := map[string]interface{}{}
  2921. if o.UpdateTime == nil {
  2922. return nil, fmt.Errorf("field `UpdateTime` is required and must be specified in SetCallbackResponse")
  2923. }
  2924. toSerialize["update_time"] = o.UpdateTime
  2925. if o.NotifyUrl == nil {
  2926. return nil, fmt.Errorf("field `NotifyUrl` is required and must be specified in SetCallbackResponse")
  2927. }
  2928. toSerialize["notify_url"] = o.NotifyUrl
  2929. return json.Marshal(toSerialize)
  2930. }
  2931. func (o SetCallbackResponse) String() string {
  2932. var ret string
  2933. if o.UpdateTime == nil {
  2934. ret += "UpdateTime:<nil>, "
  2935. } else {
  2936. ret += fmt.Sprintf("UpdateTime:%v, ", *o.UpdateTime)
  2937. }
  2938. if o.NotifyUrl == nil {
  2939. ret += "NotifyUrl:<nil>"
  2940. } else {
  2941. ret += fmt.Sprintf("NotifyUrl:%v", *o.NotifyUrl)
  2942. }
  2943. return fmt.Sprintf("SetCallbackResponse{%s}", ret)
  2944. }
  2945. func (o SetCallbackResponse) Clone() *SetCallbackResponse {
  2946. ret := SetCallbackResponse{}
  2947. if o.UpdateTime != nil {
  2948. ret.UpdateTime = new(string)
  2949. *ret.UpdateTime = *o.UpdateTime
  2950. }
  2951. if o.NotifyUrl != nil {
  2952. ret.NotifyUrl = new(string)
  2953. *ret.NotifyUrl = *o.NotifyUrl
  2954. }
  2955. return &ret
  2956. }
  2957. // StartStockBody
  2958. type StartStockBody struct {
  2959. // 批次创建方商户号
  2960. StockCreatorMchid *string `json:"stock_creator_mchid"`
  2961. }
  2962. func (o StartStockBody) MarshalJSON() ([]byte, error) {
  2963. toSerialize := map[string]interface{}{}
  2964. if o.StockCreatorMchid == nil {
  2965. return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in StartStockBody")
  2966. }
  2967. toSerialize["stock_creator_mchid"] = o.StockCreatorMchid
  2968. return json.Marshal(toSerialize)
  2969. }
  2970. func (o StartStockBody) String() string {
  2971. var ret string
  2972. if o.StockCreatorMchid == nil {
  2973. ret += "StockCreatorMchid:<nil>"
  2974. } else {
  2975. ret += fmt.Sprintf("StockCreatorMchid:%v", *o.StockCreatorMchid)
  2976. }
  2977. return fmt.Sprintf("StartStockBody{%s}", ret)
  2978. }
  2979. func (o StartStockBody) Clone() *StartStockBody {
  2980. ret := StartStockBody{}
  2981. if o.StockCreatorMchid != nil {
  2982. ret.StockCreatorMchid = new(string)
  2983. *ret.StockCreatorMchid = *o.StockCreatorMchid
  2984. }
  2985. return &ret
  2986. }
  2987. // StartStockRequest
  2988. type StartStockRequest struct {
  2989. // 批次创建方商户号
  2990. StockCreatorMchid *string `json:"stock_creator_mchid"`
  2991. // 批次号
  2992. StockId *string `json:"stock_id"`
  2993. }
  2994. func (o StartStockRequest) MarshalJSON() ([]byte, error) {
  2995. toSerialize := map[string]interface{}{}
  2996. if o.StockCreatorMchid == nil {
  2997. return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in StartStockRequest")
  2998. }
  2999. toSerialize["stock_creator_mchid"] = o.StockCreatorMchid
  3000. if o.StockId == nil {
  3001. return nil, fmt.Errorf("field `StockId` is required and must be specified in StartStockRequest")
  3002. }
  3003. toSerialize["stock_id"] = o.StockId
  3004. return json.Marshal(toSerialize)
  3005. }
  3006. func (o StartStockRequest) String() string {
  3007. var ret string
  3008. if o.StockCreatorMchid == nil {
  3009. ret += "StockCreatorMchid:<nil>, "
  3010. } else {
  3011. ret += fmt.Sprintf("StockCreatorMchid:%v, ", *o.StockCreatorMchid)
  3012. }
  3013. if o.StockId == nil {
  3014. ret += "StockId:<nil>"
  3015. } else {
  3016. ret += fmt.Sprintf("StockId:%v", *o.StockId)
  3017. }
  3018. return fmt.Sprintf("StartStockRequest{%s}", ret)
  3019. }
  3020. func (o StartStockRequest) Clone() *StartStockRequest {
  3021. ret := StartStockRequest{}
  3022. if o.StockCreatorMchid != nil {
  3023. ret.StockCreatorMchid = new(string)
  3024. *ret.StockCreatorMchid = *o.StockCreatorMchid
  3025. }
  3026. if o.StockId != nil {
  3027. ret.StockId = new(string)
  3028. *ret.StockId = *o.StockId
  3029. }
  3030. return &ret
  3031. }
  3032. // StartStockResponse
  3033. type StartStockResponse struct {
  3034. // 生效时间,遵循[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秒。
  3035. StartTime *string `json:"start_time"`
  3036. // 批次号
  3037. StockId *string `json:"stock_id"`
  3038. }
  3039. func (o StartStockResponse) MarshalJSON() ([]byte, error) {
  3040. toSerialize := map[string]interface{}{}
  3041. if o.StartTime == nil {
  3042. return nil, fmt.Errorf("field `StartTime` is required and must be specified in StartStockResponse")
  3043. }
  3044. toSerialize["start_time"] = o.StartTime
  3045. if o.StockId == nil {
  3046. return nil, fmt.Errorf("field `StockId` is required and must be specified in StartStockResponse")
  3047. }
  3048. toSerialize["stock_id"] = o.StockId
  3049. return json.Marshal(toSerialize)
  3050. }
  3051. func (o StartStockResponse) String() string {
  3052. var ret string
  3053. if o.StartTime == nil {
  3054. ret += "StartTime:<nil>, "
  3055. } else {
  3056. ret += fmt.Sprintf("StartTime:%v, ", *o.StartTime)
  3057. }
  3058. if o.StockId == nil {
  3059. ret += "StockId:<nil>"
  3060. } else {
  3061. ret += fmt.Sprintf("StockId:%v", *o.StockId)
  3062. }
  3063. return fmt.Sprintf("StartStockResponse{%s}", ret)
  3064. }
  3065. func (o StartStockResponse) Clone() *StartStockResponse {
  3066. ret := StartStockResponse{}
  3067. if o.StartTime != nil {
  3068. ret.StartTime = new(string)
  3069. *ret.StartTime = *o.StartTime
  3070. }
  3071. if o.StockId != nil {
  3072. ret.StockId = new(string)
  3073. *ret.StockId = *o.StockId
  3074. }
  3075. return &ret
  3076. }
  3077. // Stock
  3078. type Stock struct {
  3079. // 批次id
  3080. StockId *string `json:"stock_id"`
  3081. // 微信为创建方商户分配的商户号
  3082. StockCreatorMchid *string `json:"stock_creator_mchid"`
  3083. // 批次名称
  3084. StockName *string `json:"stock_name"`
  3085. // 批次状态: unactivated-未激活;audit-审核中;running-运行中;stoped-已停止;paused-暂停发放
  3086. Status *string `json:"status"`
  3087. // 批次创建时间
  3088. CreateTime *string `json:"create_time"`
  3089. // 批次描述信息
  3090. Description *string `json:"description"`
  3091. // 普通发券批次特定信息
  3092. StockUseRule *StockUseRule `json:"stock_use_rule,omitempty"`
  3093. // 可用开始时间
  3094. AvailableBeginTime *string `json:"available_begin_time"`
  3095. // 可用结束时间
  3096. AvailableEndTime *string `json:"available_end_time"`
  3097. // 已发券数量
  3098. DistributedCoupons *int64 `json:"distributed_coupons"`
  3099. // 是否无资金流,ture-是;false-否
  3100. NoCash *bool `json:"no_cash"`
  3101. // 批次激活开启时间
  3102. StartTime *string `json:"start_time,omitempty"`
  3103. // 批次永久停止时间
  3104. StopTime *string `json:"stop_time,omitempty"`
  3105. // 单品优惠特定信息
  3106. CutToMessage *CutTypeMsg `json:"cut_to_message,omitempty"`
  3107. // true-是;false-否
  3108. Singleitem *bool `json:"singleitem"`
  3109. // NORMAL-代金券批次;DISCOUNT_CUT-立减与折扣;OTHER-其他
  3110. StockType *string `json:"stock_type"`
  3111. // 微信卡包ID
  3112. CardId *string `json:"card_id,omitempty"`
  3113. }
  3114. func (o Stock) MarshalJSON() ([]byte, error) {
  3115. toSerialize := map[string]interface{}{}
  3116. if o.StockId == nil {
  3117. return nil, fmt.Errorf("field `StockId` is required and must be specified in Stock")
  3118. }
  3119. toSerialize["stock_id"] = o.StockId
  3120. if o.StockCreatorMchid == nil {
  3121. return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in Stock")
  3122. }
  3123. toSerialize["stock_creator_mchid"] = o.StockCreatorMchid
  3124. if o.StockName == nil {
  3125. return nil, fmt.Errorf("field `StockName` is required and must be specified in Stock")
  3126. }
  3127. toSerialize["stock_name"] = o.StockName
  3128. if o.Status == nil {
  3129. return nil, fmt.Errorf("field `Status` is required and must be specified in Stock")
  3130. }
  3131. toSerialize["status"] = o.Status
  3132. if o.CreateTime == nil {
  3133. return nil, fmt.Errorf("field `CreateTime` is required and must be specified in Stock")
  3134. }
  3135. toSerialize["create_time"] = o.CreateTime
  3136. if o.Description == nil {
  3137. return nil, fmt.Errorf("field `Description` is required and must be specified in Stock")
  3138. }
  3139. toSerialize["description"] = o.Description
  3140. if o.StockUseRule != nil {
  3141. toSerialize["stock_use_rule"] = o.StockUseRule
  3142. }
  3143. if o.AvailableBeginTime == nil {
  3144. return nil, fmt.Errorf("field `AvailableBeginTime` is required and must be specified in Stock")
  3145. }
  3146. toSerialize["available_begin_time"] = o.AvailableBeginTime
  3147. if o.AvailableEndTime == nil {
  3148. return nil, fmt.Errorf("field `AvailableEndTime` is required and must be specified in Stock")
  3149. }
  3150. toSerialize["available_end_time"] = o.AvailableEndTime
  3151. if o.DistributedCoupons == nil {
  3152. return nil, fmt.Errorf("field `DistributedCoupons` is required and must be specified in Stock")
  3153. }
  3154. toSerialize["distributed_coupons"] = o.DistributedCoupons
  3155. if o.NoCash == nil {
  3156. return nil, fmt.Errorf("field `NoCash` is required and must be specified in Stock")
  3157. }
  3158. toSerialize["no_cash"] = o.NoCash
  3159. if o.StartTime != nil {
  3160. toSerialize["start_time"] = o.StartTime
  3161. }
  3162. if o.StopTime != nil {
  3163. toSerialize["stop_time"] = o.StopTime
  3164. }
  3165. if o.CutToMessage != nil {
  3166. toSerialize["cut_to_message"] = o.CutToMessage
  3167. }
  3168. if o.Singleitem == nil {
  3169. return nil, fmt.Errorf("field `Singleitem` is required and must be specified in Stock")
  3170. }
  3171. toSerialize["singleitem"] = o.Singleitem
  3172. if o.StockType == nil {
  3173. return nil, fmt.Errorf("field `StockType` is required and must be specified in Stock")
  3174. }
  3175. toSerialize["stock_type"] = o.StockType
  3176. if o.CardId != nil {
  3177. toSerialize["card_id"] = o.CardId
  3178. }
  3179. return json.Marshal(toSerialize)
  3180. }
  3181. func (o Stock) String() string {
  3182. var ret string
  3183. if o.StockId == nil {
  3184. ret += "StockId:<nil>, "
  3185. } else {
  3186. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  3187. }
  3188. if o.StockCreatorMchid == nil {
  3189. ret += "StockCreatorMchid:<nil>, "
  3190. } else {
  3191. ret += fmt.Sprintf("StockCreatorMchid:%v, ", *o.StockCreatorMchid)
  3192. }
  3193. if o.StockName == nil {
  3194. ret += "StockName:<nil>, "
  3195. } else {
  3196. ret += fmt.Sprintf("StockName:%v, ", *o.StockName)
  3197. }
  3198. if o.Status == nil {
  3199. ret += "Status:<nil>, "
  3200. } else {
  3201. ret += fmt.Sprintf("Status:%v, ", *o.Status)
  3202. }
  3203. if o.CreateTime == nil {
  3204. ret += "CreateTime:<nil>, "
  3205. } else {
  3206. ret += fmt.Sprintf("CreateTime:%v, ", *o.CreateTime)
  3207. }
  3208. if o.Description == nil {
  3209. ret += "Description:<nil>, "
  3210. } else {
  3211. ret += fmt.Sprintf("Description:%v, ", *o.Description)
  3212. }
  3213. ret += fmt.Sprintf("StockUseRule:%v, ", o.StockUseRule)
  3214. if o.AvailableBeginTime == nil {
  3215. ret += "AvailableBeginTime:<nil>, "
  3216. } else {
  3217. ret += fmt.Sprintf("AvailableBeginTime:%v, ", *o.AvailableBeginTime)
  3218. }
  3219. if o.AvailableEndTime == nil {
  3220. ret += "AvailableEndTime:<nil>, "
  3221. } else {
  3222. ret += fmt.Sprintf("AvailableEndTime:%v, ", *o.AvailableEndTime)
  3223. }
  3224. if o.DistributedCoupons == nil {
  3225. ret += "DistributedCoupons:<nil>, "
  3226. } else {
  3227. ret += fmt.Sprintf("DistributedCoupons:%v, ", *o.DistributedCoupons)
  3228. }
  3229. if o.NoCash == nil {
  3230. ret += "NoCash:<nil>, "
  3231. } else {
  3232. ret += fmt.Sprintf("NoCash:%v, ", *o.NoCash)
  3233. }
  3234. if o.StartTime == nil {
  3235. ret += "StartTime:<nil>, "
  3236. } else {
  3237. ret += fmt.Sprintf("StartTime:%v, ", *o.StartTime)
  3238. }
  3239. if o.StopTime == nil {
  3240. ret += "StopTime:<nil>, "
  3241. } else {
  3242. ret += fmt.Sprintf("StopTime:%v, ", *o.StopTime)
  3243. }
  3244. ret += fmt.Sprintf("CutToMessage:%v, ", o.CutToMessage)
  3245. if o.Singleitem == nil {
  3246. ret += "Singleitem:<nil>, "
  3247. } else {
  3248. ret += fmt.Sprintf("Singleitem:%v, ", *o.Singleitem)
  3249. }
  3250. if o.StockType == nil {
  3251. ret += "StockType:<nil>, "
  3252. } else {
  3253. ret += fmt.Sprintf("StockType:%v, ", *o.StockType)
  3254. }
  3255. if o.CardId == nil {
  3256. ret += "CardId:<nil>"
  3257. } else {
  3258. ret += fmt.Sprintf("CardId:%v", *o.CardId)
  3259. }
  3260. return fmt.Sprintf("Stock{%s}", ret)
  3261. }
  3262. func (o Stock) Clone() *Stock {
  3263. ret := Stock{}
  3264. if o.StockId != nil {
  3265. ret.StockId = new(string)
  3266. *ret.StockId = *o.StockId
  3267. }
  3268. if o.StockCreatorMchid != nil {
  3269. ret.StockCreatorMchid = new(string)
  3270. *ret.StockCreatorMchid = *o.StockCreatorMchid
  3271. }
  3272. if o.StockName != nil {
  3273. ret.StockName = new(string)
  3274. *ret.StockName = *o.StockName
  3275. }
  3276. if o.Status != nil {
  3277. ret.Status = new(string)
  3278. *ret.Status = *o.Status
  3279. }
  3280. if o.CreateTime != nil {
  3281. ret.CreateTime = new(string)
  3282. *ret.CreateTime = *o.CreateTime
  3283. }
  3284. if o.Description != nil {
  3285. ret.Description = new(string)
  3286. *ret.Description = *o.Description
  3287. }
  3288. if o.StockUseRule != nil {
  3289. ret.StockUseRule = o.StockUseRule.Clone()
  3290. }
  3291. if o.AvailableBeginTime != nil {
  3292. ret.AvailableBeginTime = new(string)
  3293. *ret.AvailableBeginTime = *o.AvailableBeginTime
  3294. }
  3295. if o.AvailableEndTime != nil {
  3296. ret.AvailableEndTime = new(string)
  3297. *ret.AvailableEndTime = *o.AvailableEndTime
  3298. }
  3299. if o.DistributedCoupons != nil {
  3300. ret.DistributedCoupons = new(int64)
  3301. *ret.DistributedCoupons = *o.DistributedCoupons
  3302. }
  3303. if o.NoCash != nil {
  3304. ret.NoCash = new(bool)
  3305. *ret.NoCash = *o.NoCash
  3306. }
  3307. if o.StartTime != nil {
  3308. ret.StartTime = new(string)
  3309. *ret.StartTime = *o.StartTime
  3310. }
  3311. if o.StopTime != nil {
  3312. ret.StopTime = new(string)
  3313. *ret.StopTime = *o.StopTime
  3314. }
  3315. if o.CutToMessage != nil {
  3316. ret.CutToMessage = o.CutToMessage.Clone()
  3317. }
  3318. if o.Singleitem != nil {
  3319. ret.Singleitem = new(bool)
  3320. *ret.Singleitem = *o.Singleitem
  3321. }
  3322. if o.StockType != nil {
  3323. ret.StockType = new(string)
  3324. *ret.StockType = *o.StockType
  3325. }
  3326. if o.CardId != nil {
  3327. ret.CardId = new(string)
  3328. *ret.CardId = *o.CardId
  3329. }
  3330. return &ret
  3331. }
  3332. // StockCollection
  3333. type StockCollection struct {
  3334. // 命中查询条件总数量
  3335. TotalCount *int64 `json:"total_count"`
  3336. // 批次详情
  3337. Data []Stock `json:"data,omitempty"`
  3338. // 分页大小,最大10
  3339. Limit *int64 `json:"limit"`
  3340. // 页码从0开始,默认第0页
  3341. Offset *int64 `json:"offset"`
  3342. }
  3343. func (o StockCollection) MarshalJSON() ([]byte, error) {
  3344. toSerialize := map[string]interface{}{}
  3345. if o.TotalCount == nil {
  3346. return nil, fmt.Errorf("field `TotalCount` is required and must be specified in StockCollection")
  3347. }
  3348. toSerialize["total_count"] = o.TotalCount
  3349. if o.Data != nil {
  3350. toSerialize["data"] = o.Data
  3351. }
  3352. if o.Limit == nil {
  3353. return nil, fmt.Errorf("field `Limit` is required and must be specified in StockCollection")
  3354. }
  3355. toSerialize["limit"] = o.Limit
  3356. if o.Offset == nil {
  3357. return nil, fmt.Errorf("field `Offset` is required and must be specified in StockCollection")
  3358. }
  3359. toSerialize["offset"] = o.Offset
  3360. return json.Marshal(toSerialize)
  3361. }
  3362. func (o StockCollection) String() string {
  3363. var ret string
  3364. if o.TotalCount == nil {
  3365. ret += "TotalCount:<nil>, "
  3366. } else {
  3367. ret += fmt.Sprintf("TotalCount:%v, ", *o.TotalCount)
  3368. }
  3369. ret += fmt.Sprintf("Data:%v, ", o.Data)
  3370. if o.Limit == nil {
  3371. ret += "Limit:<nil>, "
  3372. } else {
  3373. ret += fmt.Sprintf("Limit:%v, ", *o.Limit)
  3374. }
  3375. if o.Offset == nil {
  3376. ret += "Offset:<nil>"
  3377. } else {
  3378. ret += fmt.Sprintf("Offset:%v", *o.Offset)
  3379. }
  3380. return fmt.Sprintf("StockCollection{%s}", ret)
  3381. }
  3382. func (o StockCollection) Clone() *StockCollection {
  3383. ret := StockCollection{}
  3384. if o.TotalCount != nil {
  3385. ret.TotalCount = new(int64)
  3386. *ret.TotalCount = *o.TotalCount
  3387. }
  3388. if o.Data != nil {
  3389. ret.Data = make([]Stock, len(o.Data))
  3390. for i, item := range o.Data {
  3391. ret.Data[i] = *item.Clone()
  3392. }
  3393. }
  3394. if o.Limit != nil {
  3395. ret.Limit = new(int64)
  3396. *ret.Limit = *o.Limit
  3397. }
  3398. if o.Offset != nil {
  3399. ret.Offset = new(int64)
  3400. *ret.Offset = *o.Offset
  3401. }
  3402. return &ret
  3403. }
  3404. // StockRule
  3405. type StockRule struct {
  3406. // 最大发券数
  3407. MaxCoupons *int64 `json:"max_coupons"`
  3408. // 总消耗金额,单位分
  3409. MaxAmount *int64 `json:"max_amount"`
  3410. // 单天最高消耗金额,单位分
  3411. MaxAmountByDay *int64 `json:"max_amount_by_day,omitempty"`
  3412. // 单个用户可领个数
  3413. MaxCouponsPerUser *int64 `json:"max_coupons_per_user"`
  3414. // true-是;false-否,默认否
  3415. NaturalPersonLimit *bool `json:"natural_person_limit"`
  3416. // true-是;false-否,默认否
  3417. PreventApiAbuse *bool `json:"prevent_api_abuse"`
  3418. }
  3419. func (o StockRule) MarshalJSON() ([]byte, error) {
  3420. toSerialize := map[string]interface{}{}
  3421. if o.MaxCoupons == nil {
  3422. return nil, fmt.Errorf("field `MaxCoupons` is required and must be specified in StockRule")
  3423. }
  3424. toSerialize["max_coupons"] = o.MaxCoupons
  3425. if o.MaxAmount == nil {
  3426. return nil, fmt.Errorf("field `MaxAmount` is required and must be specified in StockRule")
  3427. }
  3428. toSerialize["max_amount"] = o.MaxAmount
  3429. if o.MaxAmountByDay != nil {
  3430. toSerialize["max_amount_by_day"] = o.MaxAmountByDay
  3431. }
  3432. if o.MaxCouponsPerUser == nil {
  3433. return nil, fmt.Errorf("field `MaxCouponsPerUser` is required and must be specified in StockRule")
  3434. }
  3435. toSerialize["max_coupons_per_user"] = o.MaxCouponsPerUser
  3436. if o.NaturalPersonLimit == nil {
  3437. return nil, fmt.Errorf("field `NaturalPersonLimit` is required and must be specified in StockRule")
  3438. }
  3439. toSerialize["natural_person_limit"] = o.NaturalPersonLimit
  3440. if o.PreventApiAbuse == nil {
  3441. return nil, fmt.Errorf("field `PreventApiAbuse` is required and must be specified in StockRule")
  3442. }
  3443. toSerialize["prevent_api_abuse"] = o.PreventApiAbuse
  3444. return json.Marshal(toSerialize)
  3445. }
  3446. func (o StockRule) String() string {
  3447. var ret string
  3448. if o.MaxCoupons == nil {
  3449. ret += "MaxCoupons:<nil>, "
  3450. } else {
  3451. ret += fmt.Sprintf("MaxCoupons:%v, ", *o.MaxCoupons)
  3452. }
  3453. if o.MaxAmount == nil {
  3454. ret += "MaxAmount:<nil>, "
  3455. } else {
  3456. ret += fmt.Sprintf("MaxAmount:%v, ", *o.MaxAmount)
  3457. }
  3458. if o.MaxAmountByDay == nil {
  3459. ret += "MaxAmountByDay:<nil>, "
  3460. } else {
  3461. ret += fmt.Sprintf("MaxAmountByDay:%v, ", *o.MaxAmountByDay)
  3462. }
  3463. if o.MaxCouponsPerUser == nil {
  3464. ret += "MaxCouponsPerUser:<nil>, "
  3465. } else {
  3466. ret += fmt.Sprintf("MaxCouponsPerUser:%v, ", *o.MaxCouponsPerUser)
  3467. }
  3468. if o.NaturalPersonLimit == nil {
  3469. ret += "NaturalPersonLimit:<nil>, "
  3470. } else {
  3471. ret += fmt.Sprintf("NaturalPersonLimit:%v, ", *o.NaturalPersonLimit)
  3472. }
  3473. if o.PreventApiAbuse == nil {
  3474. ret += "PreventApiAbuse:<nil>"
  3475. } else {
  3476. ret += fmt.Sprintf("PreventApiAbuse:%v", *o.PreventApiAbuse)
  3477. }
  3478. return fmt.Sprintf("StockRule{%s}", ret)
  3479. }
  3480. func (o StockRule) Clone() *StockRule {
  3481. ret := StockRule{}
  3482. if o.MaxCoupons != nil {
  3483. ret.MaxCoupons = new(int64)
  3484. *ret.MaxCoupons = *o.MaxCoupons
  3485. }
  3486. if o.MaxAmount != nil {
  3487. ret.MaxAmount = new(int64)
  3488. *ret.MaxAmount = *o.MaxAmount
  3489. }
  3490. if o.MaxAmountByDay != nil {
  3491. ret.MaxAmountByDay = new(int64)
  3492. *ret.MaxAmountByDay = *o.MaxAmountByDay
  3493. }
  3494. if o.MaxCouponsPerUser != nil {
  3495. ret.MaxCouponsPerUser = new(int64)
  3496. *ret.MaxCouponsPerUser = *o.MaxCouponsPerUser
  3497. }
  3498. if o.NaturalPersonLimit != nil {
  3499. ret.NaturalPersonLimit = new(bool)
  3500. *ret.NaturalPersonLimit = *o.NaturalPersonLimit
  3501. }
  3502. if o.PreventApiAbuse != nil {
  3503. ret.PreventApiAbuse = new(bool)
  3504. *ret.PreventApiAbuse = *o.PreventApiAbuse
  3505. }
  3506. return &ret
  3507. }
  3508. // StockUseRule
  3509. type StockUseRule struct {
  3510. // 最大发券数
  3511. MaxCoupons *int64 `json:"max_coupons"`
  3512. // 总消耗金额,单位分
  3513. MaxAmount *int64 `json:"max_amount"`
  3514. // 单天最高消耗金额,单位分
  3515. MaxAmountByDay *int64 `json:"max_amount_by_day"`
  3516. // 固定面额发券批次特定信息
  3517. FixedNormalCoupon *FixedValueStockMsg `json:"fixed_normal_coupon,omitempty"`
  3518. // 单个用户可领个数
  3519. MaxCouponsPerUser *int64 `json:"max_coupons_per_user"`
  3520. // NORMAL-满减券;CUT_TO-减至券
  3521. CouponType *string `json:"coupon_type,omitempty"`
  3522. // 订单优惠标记
  3523. GoodsTag []string `json:"goods_tag,omitempty"`
  3524. // 默认不限制,可设置以下各种组合方式 1、付款码支付 2、小程序支付 3、其他支付 4、付款码支付&小程序支付 5、付款码支付&其他支付
  3525. TradeType []TradeType `json:"trade_type,omitempty"`
  3526. // true-是;false-否
  3527. CombineUse *bool `json:"combine_use,omitempty"`
  3528. }
  3529. func (o StockUseRule) MarshalJSON() ([]byte, error) {
  3530. toSerialize := map[string]interface{}{}
  3531. if o.MaxCoupons == nil {
  3532. return nil, fmt.Errorf("field `MaxCoupons` is required and must be specified in StockUseRule")
  3533. }
  3534. toSerialize["max_coupons"] = o.MaxCoupons
  3535. if o.MaxAmount == nil {
  3536. return nil, fmt.Errorf("field `MaxAmount` is required and must be specified in StockUseRule")
  3537. }
  3538. toSerialize["max_amount"] = o.MaxAmount
  3539. if o.MaxAmountByDay == nil {
  3540. return nil, fmt.Errorf("field `MaxAmountByDay` is required and must be specified in StockUseRule")
  3541. }
  3542. toSerialize["max_amount_by_day"] = o.MaxAmountByDay
  3543. if o.FixedNormalCoupon != nil {
  3544. toSerialize["fixed_normal_coupon"] = o.FixedNormalCoupon
  3545. }
  3546. if o.MaxCouponsPerUser == nil {
  3547. return nil, fmt.Errorf("field `MaxCouponsPerUser` is required and must be specified in StockUseRule")
  3548. }
  3549. toSerialize["max_coupons_per_user"] = o.MaxCouponsPerUser
  3550. if o.CouponType != nil {
  3551. toSerialize["coupon_type"] = o.CouponType
  3552. }
  3553. if o.GoodsTag != nil {
  3554. toSerialize["goods_tag"] = o.GoodsTag
  3555. }
  3556. if o.TradeType != nil {
  3557. toSerialize["trade_type"] = o.TradeType
  3558. }
  3559. if o.CombineUse != nil {
  3560. toSerialize["combine_use"] = o.CombineUse
  3561. }
  3562. return json.Marshal(toSerialize)
  3563. }
  3564. func (o StockUseRule) String() string {
  3565. var ret string
  3566. if o.MaxCoupons == nil {
  3567. ret += "MaxCoupons:<nil>, "
  3568. } else {
  3569. ret += fmt.Sprintf("MaxCoupons:%v, ", *o.MaxCoupons)
  3570. }
  3571. if o.MaxAmount == nil {
  3572. ret += "MaxAmount:<nil>, "
  3573. } else {
  3574. ret += fmt.Sprintf("MaxAmount:%v, ", *o.MaxAmount)
  3575. }
  3576. if o.MaxAmountByDay == nil {
  3577. ret += "MaxAmountByDay:<nil>, "
  3578. } else {
  3579. ret += fmt.Sprintf("MaxAmountByDay:%v, ", *o.MaxAmountByDay)
  3580. }
  3581. ret += fmt.Sprintf("FixedNormalCoupon:%v, ", o.FixedNormalCoupon)
  3582. if o.MaxCouponsPerUser == nil {
  3583. ret += "MaxCouponsPerUser:<nil>, "
  3584. } else {
  3585. ret += fmt.Sprintf("MaxCouponsPerUser:%v, ", *o.MaxCouponsPerUser)
  3586. }
  3587. if o.CouponType == nil {
  3588. ret += "CouponType:<nil>, "
  3589. } else {
  3590. ret += fmt.Sprintf("CouponType:%v, ", *o.CouponType)
  3591. }
  3592. ret += fmt.Sprintf("GoodsTag:%v, ", o.GoodsTag)
  3593. ret += fmt.Sprintf("TradeType:%v, ", o.TradeType)
  3594. if o.CombineUse == nil {
  3595. ret += "CombineUse:<nil>"
  3596. } else {
  3597. ret += fmt.Sprintf("CombineUse:%v", *o.CombineUse)
  3598. }
  3599. return fmt.Sprintf("StockUseRule{%s}", ret)
  3600. }
  3601. func (o StockUseRule) Clone() *StockUseRule {
  3602. ret := StockUseRule{}
  3603. if o.MaxCoupons != nil {
  3604. ret.MaxCoupons = new(int64)
  3605. *ret.MaxCoupons = *o.MaxCoupons
  3606. }
  3607. if o.MaxAmount != nil {
  3608. ret.MaxAmount = new(int64)
  3609. *ret.MaxAmount = *o.MaxAmount
  3610. }
  3611. if o.MaxAmountByDay != nil {
  3612. ret.MaxAmountByDay = new(int64)
  3613. *ret.MaxAmountByDay = *o.MaxAmountByDay
  3614. }
  3615. if o.FixedNormalCoupon != nil {
  3616. ret.FixedNormalCoupon = o.FixedNormalCoupon.Clone()
  3617. }
  3618. if o.MaxCouponsPerUser != nil {
  3619. ret.MaxCouponsPerUser = new(int64)
  3620. *ret.MaxCouponsPerUser = *o.MaxCouponsPerUser
  3621. }
  3622. if o.CouponType != nil {
  3623. ret.CouponType = new(string)
  3624. *ret.CouponType = *o.CouponType
  3625. }
  3626. if o.GoodsTag != nil {
  3627. ret.GoodsTag = make([]string, len(o.GoodsTag))
  3628. for i, item := range o.GoodsTag {
  3629. ret.GoodsTag[i] = item
  3630. }
  3631. }
  3632. if o.TradeType != nil {
  3633. ret.TradeType = make([]TradeType, len(o.TradeType))
  3634. for i, item := range o.TradeType {
  3635. ret.TradeType[i] = item
  3636. }
  3637. }
  3638. if o.CombineUse != nil {
  3639. ret.CombineUse = new(bool)
  3640. *ret.CombineUse = *o.CombineUse
  3641. }
  3642. return &ret
  3643. }
  3644. // StopStockBody
  3645. type StopStockBody struct {
  3646. // 批次创建方商户号
  3647. StockCreatorMchid *string `json:"stock_creator_mchid"`
  3648. }
  3649. func (o StopStockBody) MarshalJSON() ([]byte, error) {
  3650. toSerialize := map[string]interface{}{}
  3651. if o.StockCreatorMchid == nil {
  3652. return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in StopStockBody")
  3653. }
  3654. toSerialize["stock_creator_mchid"] = o.StockCreatorMchid
  3655. return json.Marshal(toSerialize)
  3656. }
  3657. func (o StopStockBody) String() string {
  3658. var ret string
  3659. if o.StockCreatorMchid == nil {
  3660. ret += "StockCreatorMchid:<nil>"
  3661. } else {
  3662. ret += fmt.Sprintf("StockCreatorMchid:%v", *o.StockCreatorMchid)
  3663. }
  3664. return fmt.Sprintf("StopStockBody{%s}", ret)
  3665. }
  3666. func (o StopStockBody) Clone() *StopStockBody {
  3667. ret := StopStockBody{}
  3668. if o.StockCreatorMchid != nil {
  3669. ret.StockCreatorMchid = new(string)
  3670. *ret.StockCreatorMchid = *o.StockCreatorMchid
  3671. }
  3672. return &ret
  3673. }
  3674. // StopStockRequest
  3675. type StopStockRequest struct {
  3676. // 批次创建方商户号
  3677. StockCreatorMchid *string `json:"stock_creator_mchid"`
  3678. // 批次号
  3679. StockId *string `json:"stock_id"`
  3680. }
  3681. func (o StopStockRequest) MarshalJSON() ([]byte, error) {
  3682. toSerialize := map[string]interface{}{}
  3683. if o.StockCreatorMchid == nil {
  3684. return nil, fmt.Errorf("field `StockCreatorMchid` is required and must be specified in StopStockRequest")
  3685. }
  3686. toSerialize["stock_creator_mchid"] = o.StockCreatorMchid
  3687. if o.StockId == nil {
  3688. return nil, fmt.Errorf("field `StockId` is required and must be specified in StopStockRequest")
  3689. }
  3690. toSerialize["stock_id"] = o.StockId
  3691. return json.Marshal(toSerialize)
  3692. }
  3693. func (o StopStockRequest) String() string {
  3694. var ret string
  3695. if o.StockCreatorMchid == nil {
  3696. ret += "StockCreatorMchid:<nil>, "
  3697. } else {
  3698. ret += fmt.Sprintf("StockCreatorMchid:%v, ", *o.StockCreatorMchid)
  3699. }
  3700. if o.StockId == nil {
  3701. ret += "StockId:<nil>"
  3702. } else {
  3703. ret += fmt.Sprintf("StockId:%v", *o.StockId)
  3704. }
  3705. return fmt.Sprintf("StopStockRequest{%s}", ret)
  3706. }
  3707. func (o StopStockRequest) Clone() *StopStockRequest {
  3708. ret := StopStockRequest{}
  3709. if o.StockCreatorMchid != nil {
  3710. ret.StockCreatorMchid = new(string)
  3711. *ret.StockCreatorMchid = *o.StockCreatorMchid
  3712. }
  3713. if o.StockId != nil {
  3714. ret.StockId = new(string)
  3715. *ret.StockId = *o.StockId
  3716. }
  3717. return &ret
  3718. }
  3719. // StopStockResponse
  3720. type StopStockResponse struct {
  3721. // 暂停时间
  3722. StopTime *string `json:"stop_time"`
  3723. // 批次号
  3724. StockId *string `json:"stock_id"`
  3725. }
  3726. func (o StopStockResponse) MarshalJSON() ([]byte, error) {
  3727. toSerialize := map[string]interface{}{}
  3728. if o.StopTime == nil {
  3729. return nil, fmt.Errorf("field `StopTime` is required and must be specified in StopStockResponse")
  3730. }
  3731. toSerialize["stop_time"] = o.StopTime
  3732. if o.StockId == nil {
  3733. return nil, fmt.Errorf("field `StockId` is required and must be specified in StopStockResponse")
  3734. }
  3735. toSerialize["stock_id"] = o.StockId
  3736. return json.Marshal(toSerialize)
  3737. }
  3738. func (o StopStockResponse) String() string {
  3739. var ret string
  3740. if o.StopTime == nil {
  3741. ret += "StopTime:<nil>, "
  3742. } else {
  3743. ret += fmt.Sprintf("StopTime:%v, ", *o.StopTime)
  3744. }
  3745. if o.StockId == nil {
  3746. ret += "StockId:<nil>"
  3747. } else {
  3748. ret += fmt.Sprintf("StockId:%v", *o.StockId)
  3749. }
  3750. return fmt.Sprintf("StopStockResponse{%s}", ret)
  3751. }
  3752. func (o StopStockResponse) Clone() *StopStockResponse {
  3753. ret := StopStockResponse{}
  3754. if o.StopTime != nil {
  3755. ret.StopTime = new(string)
  3756. *ret.StopTime = *o.StopTime
  3757. }
  3758. if o.StockId != nil {
  3759. ret.StockId = new(string)
  3760. *ret.StockId = *o.StockId
  3761. }
  3762. return &ret
  3763. }
  3764. // TradeType
  3765. type TradeType string
  3766. func (e TradeType) Ptr() *TradeType {
  3767. return &e
  3768. }
  3769. // Enums of TradeType
  3770. const (
  3771. TRADETYPE_MICROAPP TradeType = "MICROAPP"
  3772. TRADETYPE_APPPAY TradeType = "APPPAY"
  3773. TRADETYPE_PPAY TradeType = "PPAY"
  3774. TRADETYPE_CARD TradeType = "CARD"
  3775. TRADETYPE_FACE TradeType = "FACE"
  3776. TRADETYPE_OTHER TradeType = "OTHER"
  3777. )
  3778. // UseFlowRequest
  3779. type UseFlowRequest struct {
  3780. // 批次号
  3781. StockId *string `json:"stock_id"`
  3782. }
  3783. func (o UseFlowRequest) MarshalJSON() ([]byte, error) {
  3784. toSerialize := map[string]interface{}{}
  3785. if o.StockId == nil {
  3786. return nil, fmt.Errorf("field `StockId` is required and must be specified in UseFlowRequest")
  3787. }
  3788. toSerialize["stock_id"] = o.StockId
  3789. return json.Marshal(toSerialize)
  3790. }
  3791. func (o UseFlowRequest) String() string {
  3792. var ret string
  3793. if o.StockId == nil {
  3794. ret += "StockId:<nil>"
  3795. } else {
  3796. ret += fmt.Sprintf("StockId:%v", *o.StockId)
  3797. }
  3798. return fmt.Sprintf("UseFlowRequest{%s}", ret)
  3799. }
  3800. func (o UseFlowRequest) Clone() *UseFlowRequest {
  3801. ret := UseFlowRequest{}
  3802. if o.StockId != nil {
  3803. ret.StockId = new(string)
  3804. *ret.StockId = *o.StockId
  3805. }
  3806. return &ret
  3807. }
  3808. // UseFlowResponse
  3809. type UseFlowResponse struct {
  3810. // 流水文件下载链接,30s内有效
  3811. Url *string `json:"url"`
  3812. // 文件内容的哈希值,防止篡改
  3813. HashValue *string `json:"hash_value"`
  3814. // 哈希算法类型,目前只支持sha1
  3815. HashType *string `json:"hash_type"`
  3816. }
  3817. func (o UseFlowResponse) MarshalJSON() ([]byte, error) {
  3818. toSerialize := map[string]interface{}{}
  3819. if o.Url == nil {
  3820. return nil, fmt.Errorf("field `Url` is required and must be specified in UseFlowResponse")
  3821. }
  3822. toSerialize["url"] = o.Url
  3823. if o.HashValue == nil {
  3824. return nil, fmt.Errorf("field `HashValue` is required and must be specified in UseFlowResponse")
  3825. }
  3826. toSerialize["hash_value"] = o.HashValue
  3827. if o.HashType == nil {
  3828. return nil, fmt.Errorf("field `HashType` is required and must be specified in UseFlowResponse")
  3829. }
  3830. toSerialize["hash_type"] = o.HashType
  3831. return json.Marshal(toSerialize)
  3832. }
  3833. func (o UseFlowResponse) String() string {
  3834. var ret string
  3835. if o.Url == nil {
  3836. ret += "Url:<nil>, "
  3837. } else {
  3838. ret += fmt.Sprintf("Url:%v, ", *o.Url)
  3839. }
  3840. if o.HashValue == nil {
  3841. ret += "HashValue:<nil>, "
  3842. } else {
  3843. ret += fmt.Sprintf("HashValue:%v, ", *o.HashValue)
  3844. }
  3845. if o.HashType == nil {
  3846. ret += "HashType:<nil>"
  3847. } else {
  3848. ret += fmt.Sprintf("HashType:%v", *o.HashType)
  3849. }
  3850. return fmt.Sprintf("UseFlowResponse{%s}", ret)
  3851. }
  3852. func (o UseFlowResponse) Clone() *UseFlowResponse {
  3853. ret := UseFlowResponse{}
  3854. if o.Url != nil {
  3855. ret.Url = new(string)
  3856. *ret.Url = *o.Url
  3857. }
  3858. if o.HashValue != nil {
  3859. ret.HashValue = new(string)
  3860. *ret.HashValue = *o.HashValue
  3861. }
  3862. if o.HashType != nil {
  3863. ret.HashType = new(string)
  3864. *ret.HashType = *o.HashType
  3865. }
  3866. return &ret
  3867. }