models.go 201 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188
  1. // Copyright 2021 Tencent Inc. All rights reserved.
  2. //
  3. // 营销商家券对外API
  4. //
  5. // No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
  6. //
  7. // API version: 0.0.11
  8. // Code generated by WechatPay APIv3 Generator based on [OpenAPI Generator](https://openapi-generator.tech); DO NOT EDIT.
  9. package merchantexclusivecoupon
  10. import (
  11. "encoding/json"
  12. "fmt"
  13. "strings"
  14. "time"
  15. )
  16. // AssociateTradeInfoRequest
  17. type AssociateTradeInfoRequest struct {
  18. // 微信为每个商家券批次分配的唯一ID,对于商户自定义code的批次,关联请求必须填写批次号
  19. StockId *string `json:"stock_id"`
  20. // 券的唯一标识
  21. CouponCode *string `json:"coupon_code"`
  22. // 微信支付下单时的商户订单号,欲与该商家券关联的微信支付
  23. OutTradeNo *string `json:"out_trade_no"`
  24. // 商户创建批次凭据号(格式:商户ID+日期+流水号),商户侧需保持唯一性,可包含英文字母,数字,|,\\_,\\*,-等内容,不允许出现其他不合法符号。
  25. OutRequestNo *string `json:"out_request_no"`
  26. }
  27. func (o AssociateTradeInfoRequest) MarshalJSON() ([]byte, error) {
  28. toSerialize := map[string]interface{}{}
  29. if o.StockId == nil {
  30. return nil, fmt.Errorf("field `StockId` is required and must be specified in AssociateTradeInfoRequest")
  31. }
  32. toSerialize["stock_id"] = o.StockId
  33. if o.CouponCode == nil {
  34. return nil, fmt.Errorf("field `CouponCode` is required and must be specified in AssociateTradeInfoRequest")
  35. }
  36. toSerialize["coupon_code"] = o.CouponCode
  37. if o.OutTradeNo == nil {
  38. return nil, fmt.Errorf("field `OutTradeNo` is required and must be specified in AssociateTradeInfoRequest")
  39. }
  40. toSerialize["out_trade_no"] = o.OutTradeNo
  41. if o.OutRequestNo == nil {
  42. return nil, fmt.Errorf("field `OutRequestNo` is required and must be specified in AssociateTradeInfoRequest")
  43. }
  44. toSerialize["out_request_no"] = o.OutRequestNo
  45. return json.Marshal(toSerialize)
  46. }
  47. func (o AssociateTradeInfoRequest) String() string {
  48. var ret string
  49. if o.StockId == nil {
  50. ret += "StockId:<nil>, "
  51. } else {
  52. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  53. }
  54. if o.CouponCode == nil {
  55. ret += "CouponCode:<nil>, "
  56. } else {
  57. ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
  58. }
  59. if o.OutTradeNo == nil {
  60. ret += "OutTradeNo:<nil>, "
  61. } else {
  62. ret += fmt.Sprintf("OutTradeNo:%v, ", *o.OutTradeNo)
  63. }
  64. if o.OutRequestNo == nil {
  65. ret += "OutRequestNo:<nil>"
  66. } else {
  67. ret += fmt.Sprintf("OutRequestNo:%v", *o.OutRequestNo)
  68. }
  69. return fmt.Sprintf("AssociateTradeInfoRequest{%s}", ret)
  70. }
  71. func (o AssociateTradeInfoRequest) Clone() *AssociateTradeInfoRequest {
  72. ret := AssociateTradeInfoRequest{}
  73. if o.StockId != nil {
  74. ret.StockId = new(string)
  75. *ret.StockId = *o.StockId
  76. }
  77. if o.CouponCode != nil {
  78. ret.CouponCode = new(string)
  79. *ret.CouponCode = *o.CouponCode
  80. }
  81. if o.OutTradeNo != nil {
  82. ret.OutTradeNo = new(string)
  83. *ret.OutTradeNo = *o.OutTradeNo
  84. }
  85. if o.OutRequestNo != nil {
  86. ret.OutRequestNo = new(string)
  87. *ret.OutRequestNo = *o.OutRequestNo
  88. }
  89. return &ret
  90. }
  91. // AssociateTradeInfoResponse
  92. type AssociateTradeInfoResponse struct {
  93. // 系统关联券成功的时间,遵循[rfc3339](https://datatracker.ietf.org/doc/html/rfc3339)标准格式,格式为yyyy-MM-DDTHH:mm:ss+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秒。
  94. WechatpayAssociateTime *time.Time `json:"wechatpay_associate_time"`
  95. }
  96. func (o AssociateTradeInfoResponse) MarshalJSON() ([]byte, error) {
  97. toSerialize := map[string]interface{}{}
  98. if o.WechatpayAssociateTime == nil {
  99. return nil, fmt.Errorf("field `WechatpayAssociateTime` is required and must be specified in AssociateTradeInfoResponse")
  100. }
  101. toSerialize["wechatpay_associate_time"] = o.WechatpayAssociateTime.Format(time.RFC3339)
  102. return json.Marshal(toSerialize)
  103. }
  104. func (o AssociateTradeInfoResponse) String() string {
  105. var ret string
  106. if o.WechatpayAssociateTime == nil {
  107. ret += "WechatpayAssociateTime:<nil>"
  108. } else {
  109. ret += fmt.Sprintf("WechatpayAssociateTime:%v", *o.WechatpayAssociateTime)
  110. }
  111. return fmt.Sprintf("AssociateTradeInfoResponse{%s}", ret)
  112. }
  113. func (o AssociateTradeInfoResponse) Clone() *AssociateTradeInfoResponse {
  114. ret := AssociateTradeInfoResponse{}
  115. if o.WechatpayAssociateTime != nil {
  116. ret.WechatpayAssociateTime = new(time.Time)
  117. *ret.WechatpayAssociateTime = *o.WechatpayAssociateTime
  118. }
  119. return &ret
  120. }
  121. // AvailableCurrentDayTime
  122. type AvailableCurrentDayTime struct {
  123. // 当天可用开始时间 单位秒 1代表当天0点0分1秒
  124. BeginTime *int64 `json:"begin_time,omitempty"`
  125. // 当天可用结束时间 单位秒 86399代表当天23点59分59秒
  126. EndTime *int64 `json:"end_time,omitempty"`
  127. }
  128. func (o AvailableCurrentDayTime) MarshalJSON() ([]byte, error) {
  129. toSerialize := map[string]interface{}{}
  130. if o.BeginTime != nil {
  131. toSerialize["begin_time"] = o.BeginTime
  132. }
  133. if o.EndTime != nil {
  134. toSerialize["end_time"] = o.EndTime
  135. }
  136. return json.Marshal(toSerialize)
  137. }
  138. func (o AvailableCurrentDayTime) String() string {
  139. var ret string
  140. if o.BeginTime == nil {
  141. ret += "BeginTime:<nil>, "
  142. } else {
  143. ret += fmt.Sprintf("BeginTime:%v, ", *o.BeginTime)
  144. }
  145. if o.EndTime == nil {
  146. ret += "EndTime:<nil>"
  147. } else {
  148. ret += fmt.Sprintf("EndTime:%v", *o.EndTime)
  149. }
  150. return fmt.Sprintf("AvailableCurrentDayTime{%s}", ret)
  151. }
  152. func (o AvailableCurrentDayTime) Clone() *AvailableCurrentDayTime {
  153. ret := AvailableCurrentDayTime{}
  154. if o.BeginTime != nil {
  155. ret.BeginTime = new(int64)
  156. *ret.BeginTime = *o.BeginTime
  157. }
  158. if o.EndTime != nil {
  159. ret.EndTime = new(int64)
  160. *ret.EndTime = *o.EndTime
  161. }
  162. return &ret
  163. }
  164. // AvailableWeek
  165. type AvailableWeek struct {
  166. // 0代表周日,1代表周一,以此类推 当填写available_day_time时,week_day必填
  167. WeekDay []int64 `json:"week_day,omitempty"`
  168. // 可以填写多个时间段,最多不超过2个
  169. AvailableDayTime []AvailableCurrentDayTime `json:"available_day_time,omitempty"`
  170. }
  171. func (o AvailableWeek) MarshalJSON() ([]byte, error) {
  172. toSerialize := map[string]interface{}{}
  173. if o.WeekDay != nil {
  174. toSerialize["week_day"] = o.WeekDay
  175. }
  176. if o.AvailableDayTime != nil {
  177. toSerialize["available_day_time"] = o.AvailableDayTime
  178. }
  179. return json.Marshal(toSerialize)
  180. }
  181. func (o AvailableWeek) String() string {
  182. var ret string
  183. ret += fmt.Sprintf("WeekDay:%v, ", o.WeekDay)
  184. ret += fmt.Sprintf("AvailableDayTime:%v", o.AvailableDayTime)
  185. return fmt.Sprintf("AvailableWeek{%s}", ret)
  186. }
  187. func (o AvailableWeek) Clone() *AvailableWeek {
  188. ret := AvailableWeek{}
  189. if o.WeekDay != nil {
  190. ret.WeekDay = make([]int64, len(o.WeekDay))
  191. for i, item := range o.WeekDay {
  192. ret.WeekDay[i] = item
  193. }
  194. }
  195. if o.AvailableDayTime != nil {
  196. ret.AvailableDayTime = make([]AvailableCurrentDayTime, len(o.AvailableDayTime))
  197. for i, item := range o.AvailableDayTime {
  198. ret.AvailableDayTime[i] = *item.Clone()
  199. }
  200. }
  201. return &ret
  202. }
  203. // BusiFavorStockType
  204. type BusiFavorStockType string
  205. func (e BusiFavorStockType) Ptr() *BusiFavorStockType {
  206. return &e
  207. }
  208. // Enums of BusiFavorStockType
  209. const (
  210. BUSIFAVORSTOCKTYPE_NORMAL BusiFavorStockType = "NORMAL"
  211. BUSIFAVORSTOCKTYPE_DISCOUNT BusiFavorStockType = "DISCOUNT"
  212. BUSIFAVORSTOCKTYPE_EXCHANGE BusiFavorStockType = "EXCHANGE"
  213. )
  214. // CodeDisplayMode
  215. type CodeDisplayMode string
  216. func (e CodeDisplayMode) Ptr() *CodeDisplayMode {
  217. return &e
  218. }
  219. // Enums of CodeDisplayMode
  220. const (
  221. CODEDISPLAYMODE_NOT_SHOW CodeDisplayMode = "NOT_SHOW"
  222. CODEDISPLAYMODE_BARCODE CodeDisplayMode = "BARCODE"
  223. CODEDISPLAYMODE_QRCODE CodeDisplayMode = "QRCODE"
  224. )
  225. // CouponCodeCount
  226. type CouponCodeCount struct {
  227. // 该批次总共已上传的code总数
  228. TotalCount *int64 `json:"total_count"`
  229. // 该批次当前可用的code数
  230. AvailableCount *int64 `json:"available_count"`
  231. }
  232. func (o CouponCodeCount) MarshalJSON() ([]byte, error) {
  233. toSerialize := map[string]interface{}{}
  234. if o.TotalCount == nil {
  235. return nil, fmt.Errorf("field `TotalCount` is required and must be specified in CouponCodeCount")
  236. }
  237. toSerialize["total_count"] = o.TotalCount
  238. if o.AvailableCount == nil {
  239. return nil, fmt.Errorf("field `AvailableCount` is required and must be specified in CouponCodeCount")
  240. }
  241. toSerialize["available_count"] = o.AvailableCount
  242. return json.Marshal(toSerialize)
  243. }
  244. func (o CouponCodeCount) String() string {
  245. var ret string
  246. if o.TotalCount == nil {
  247. ret += "TotalCount:<nil>, "
  248. } else {
  249. ret += fmt.Sprintf("TotalCount:%v, ", *o.TotalCount)
  250. }
  251. if o.AvailableCount == nil {
  252. ret += "AvailableCount:<nil>"
  253. } else {
  254. ret += fmt.Sprintf("AvailableCount:%v", *o.AvailableCount)
  255. }
  256. return fmt.Sprintf("CouponCodeCount{%s}", ret)
  257. }
  258. func (o CouponCodeCount) Clone() *CouponCodeCount {
  259. ret := CouponCodeCount{}
  260. if o.TotalCount != nil {
  261. ret.TotalCount = new(int64)
  262. *ret.TotalCount = *o.TotalCount
  263. }
  264. if o.AvailableCount != nil {
  265. ret.AvailableCount = new(int64)
  266. *ret.AvailableCount = *o.AvailableCount
  267. }
  268. return &ret
  269. }
  270. // CouponCodeEntity
  271. type CouponCodeEntity struct {
  272. // 商户上传code
  273. Code *string `json:"code"`
  274. // 商户上传code分配状态
  275. CodeStatus *CouponCodeStatus `json:"code_status"`
  276. // code上传成功的时间
  277. UploadTime *time.Time `json:"upload_time,omitempty"`
  278. // 当code状态为被分配时,code被分配的时间
  279. DispatchedTime *time.Time `json:"dispatched_time,omitempty"`
  280. // 领券用户的OpenID
  281. Openid *string `json:"openid,omitempty"`
  282. // 领券用户的UnionID,具体参见https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html
  283. Unionid *string `json:"unionid,omitempty"`
  284. // 券的唯一标识
  285. CouponCode *string `json:"coupon_code,omitempty"`
  286. }
  287. func (o CouponCodeEntity) MarshalJSON() ([]byte, error) {
  288. toSerialize := map[string]interface{}{}
  289. if o.Code == nil {
  290. return nil, fmt.Errorf("field `Code` is required and must be specified in CouponCodeEntity")
  291. }
  292. toSerialize["code"] = o.Code
  293. if o.CodeStatus == nil {
  294. return nil, fmt.Errorf("field `CodeStatus` is required and must be specified in CouponCodeEntity")
  295. }
  296. toSerialize["code_status"] = o.CodeStatus
  297. if o.UploadTime != nil {
  298. toSerialize["upload_time"] = o.UploadTime.Format(time.RFC3339)
  299. }
  300. if o.DispatchedTime != nil {
  301. toSerialize["dispatched_time"] = o.DispatchedTime.Format(time.RFC3339)
  302. }
  303. if o.Openid != nil {
  304. toSerialize["openid"] = o.Openid
  305. }
  306. if o.Unionid != nil {
  307. toSerialize["unionid"] = o.Unionid
  308. }
  309. if o.CouponCode != nil {
  310. toSerialize["coupon_code"] = o.CouponCode
  311. }
  312. return json.Marshal(toSerialize)
  313. }
  314. func (o CouponCodeEntity) String() string {
  315. var ret string
  316. if o.Code == nil {
  317. ret += "Code:<nil>, "
  318. } else {
  319. ret += fmt.Sprintf("Code:%v, ", *o.Code)
  320. }
  321. if o.CodeStatus == nil {
  322. ret += "CodeStatus:<nil>, "
  323. } else {
  324. ret += fmt.Sprintf("CodeStatus:%v, ", *o.CodeStatus)
  325. }
  326. if o.UploadTime == nil {
  327. ret += "UploadTime:<nil>, "
  328. } else {
  329. ret += fmt.Sprintf("UploadTime:%v, ", *o.UploadTime)
  330. }
  331. if o.DispatchedTime == nil {
  332. ret += "DispatchedTime:<nil>, "
  333. } else {
  334. ret += fmt.Sprintf("DispatchedTime:%v, ", *o.DispatchedTime)
  335. }
  336. if o.Openid == nil {
  337. ret += "Openid:<nil>, "
  338. } else {
  339. ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
  340. }
  341. if o.Unionid == nil {
  342. ret += "Unionid:<nil>, "
  343. } else {
  344. ret += fmt.Sprintf("Unionid:%v, ", *o.Unionid)
  345. }
  346. if o.CouponCode == nil {
  347. ret += "CouponCode:<nil>"
  348. } else {
  349. ret += fmt.Sprintf("CouponCode:%v", *o.CouponCode)
  350. }
  351. return fmt.Sprintf("CouponCodeEntity{%s}", ret)
  352. }
  353. func (o CouponCodeEntity) Clone() *CouponCodeEntity {
  354. ret := CouponCodeEntity{}
  355. if o.Code != nil {
  356. ret.Code = new(string)
  357. *ret.Code = *o.Code
  358. }
  359. if o.CodeStatus != nil {
  360. ret.CodeStatus = new(CouponCodeStatus)
  361. *ret.CodeStatus = *o.CodeStatus
  362. }
  363. if o.UploadTime != nil {
  364. ret.UploadTime = new(time.Time)
  365. *ret.UploadTime = *o.UploadTime
  366. }
  367. if o.DispatchedTime != nil {
  368. ret.DispatchedTime = new(time.Time)
  369. *ret.DispatchedTime = *o.DispatchedTime
  370. }
  371. if o.Openid != nil {
  372. ret.Openid = new(string)
  373. *ret.Openid = *o.Openid
  374. }
  375. if o.Unionid != nil {
  376. ret.Unionid = new(string)
  377. *ret.Unionid = *o.Unionid
  378. }
  379. if o.CouponCode != nil {
  380. ret.CouponCode = new(string)
  381. *ret.CouponCode = *o.CouponCode
  382. }
  383. return &ret
  384. }
  385. // CouponCodeInfoRequest
  386. type CouponCodeInfoRequest struct {
  387. // 商家券批次号
  388. StockId *string `json:"stock_id"`
  389. // 商户上传code
  390. CouponCode *string `json:"coupon_code"`
  391. // 公众账号ID
  392. Appid *string `json:"appid,omitempty"`
  393. }
  394. func (o CouponCodeInfoRequest) MarshalJSON() ([]byte, error) {
  395. toSerialize := map[string]interface{}{}
  396. if o.StockId == nil {
  397. return nil, fmt.Errorf("field `StockId` is required and must be specified in CouponCodeInfoRequest")
  398. }
  399. toSerialize["stock_id"] = o.StockId
  400. if o.CouponCode == nil {
  401. return nil, fmt.Errorf("field `CouponCode` is required and must be specified in CouponCodeInfoRequest")
  402. }
  403. toSerialize["coupon_code"] = o.CouponCode
  404. if o.Appid != nil {
  405. toSerialize["appid"] = o.Appid
  406. }
  407. return json.Marshal(toSerialize)
  408. }
  409. func (o CouponCodeInfoRequest) String() string {
  410. var ret string
  411. if o.StockId == nil {
  412. ret += "StockId:<nil>, "
  413. } else {
  414. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  415. }
  416. if o.CouponCode == nil {
  417. ret += "CouponCode:<nil>, "
  418. } else {
  419. ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
  420. }
  421. if o.Appid == nil {
  422. ret += "Appid:<nil>"
  423. } else {
  424. ret += fmt.Sprintf("Appid:%v", *o.Appid)
  425. }
  426. return fmt.Sprintf("CouponCodeInfoRequest{%s}", ret)
  427. }
  428. func (o CouponCodeInfoRequest) Clone() *CouponCodeInfoRequest {
  429. ret := CouponCodeInfoRequest{}
  430. if o.StockId != nil {
  431. ret.StockId = new(string)
  432. *ret.StockId = *o.StockId
  433. }
  434. if o.CouponCode != nil {
  435. ret.CouponCode = new(string)
  436. *ret.CouponCode = *o.CouponCode
  437. }
  438. if o.Appid != nil {
  439. ret.Appid = new(string)
  440. *ret.Appid = *o.Appid
  441. }
  442. return &ret
  443. }
  444. // CouponCodeInfoResponse
  445. type CouponCodeInfoResponse struct {
  446. // 商户上传code信息,含状态,上传时间等
  447. CodeInformation *CouponCodeEntity `json:"code_information"`
  448. // 用户券信息,仅当商户上传code的状态为DISPATCHED时返回券详情
  449. CouponInformation *CouponEntity `json:"coupon_information,omitempty"`
  450. }
  451. func (o CouponCodeInfoResponse) MarshalJSON() ([]byte, error) {
  452. toSerialize := map[string]interface{}{}
  453. if o.CodeInformation == nil {
  454. return nil, fmt.Errorf("field `CodeInformation` is required and must be specified in CouponCodeInfoResponse")
  455. }
  456. toSerialize["code_information"] = o.CodeInformation
  457. if o.CouponInformation != nil {
  458. toSerialize["coupon_information"] = o.CouponInformation
  459. }
  460. return json.Marshal(toSerialize)
  461. }
  462. func (o CouponCodeInfoResponse) String() string {
  463. var ret string
  464. ret += fmt.Sprintf("CodeInformation:%v, ", o.CodeInformation)
  465. ret += fmt.Sprintf("CouponInformation:%v", o.CouponInformation)
  466. return fmt.Sprintf("CouponCodeInfoResponse{%s}", ret)
  467. }
  468. func (o CouponCodeInfoResponse) Clone() *CouponCodeInfoResponse {
  469. ret := CouponCodeInfoResponse{}
  470. if o.CodeInformation != nil {
  471. ret.CodeInformation = o.CodeInformation.Clone()
  472. }
  473. if o.CouponInformation != nil {
  474. ret.CouponInformation = o.CouponInformation.Clone()
  475. }
  476. return &ret
  477. }
  478. // CouponCodeListResponse
  479. type CouponCodeListResponse struct {
  480. // 商家券批次号
  481. StockId *string `json:"stock_id"`
  482. // 该批次已上传code总个数
  483. TotalCount *int64 `json:"total_count"`
  484. // 查询code的结果列表
  485. Data []CouponCodeEntity `json:"data,omitempty"`
  486. // 分页起始位置,与请求相同
  487. Offset *int64 `json:"offset"`
  488. // 返回数据的实际个数
  489. Limit *int64 `json:"limit"`
  490. }
  491. func (o CouponCodeListResponse) MarshalJSON() ([]byte, error) {
  492. toSerialize := map[string]interface{}{}
  493. if o.StockId == nil {
  494. return nil, fmt.Errorf("field `StockId` is required and must be specified in CouponCodeListResponse")
  495. }
  496. toSerialize["stock_id"] = o.StockId
  497. if o.TotalCount == nil {
  498. return nil, fmt.Errorf("field `TotalCount` is required and must be specified in CouponCodeListResponse")
  499. }
  500. toSerialize["total_count"] = o.TotalCount
  501. if o.Data != nil {
  502. toSerialize["data"] = o.Data
  503. }
  504. if o.Offset == nil {
  505. return nil, fmt.Errorf("field `Offset` is required and must be specified in CouponCodeListResponse")
  506. }
  507. toSerialize["offset"] = o.Offset
  508. if o.Limit == nil {
  509. return nil, fmt.Errorf("field `Limit` is required and must be specified in CouponCodeListResponse")
  510. }
  511. toSerialize["limit"] = o.Limit
  512. return json.Marshal(toSerialize)
  513. }
  514. func (o CouponCodeListResponse) String() string {
  515. var ret string
  516. if o.StockId == nil {
  517. ret += "StockId:<nil>, "
  518. } else {
  519. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  520. }
  521. if o.TotalCount == nil {
  522. ret += "TotalCount:<nil>, "
  523. } else {
  524. ret += fmt.Sprintf("TotalCount:%v, ", *o.TotalCount)
  525. }
  526. ret += fmt.Sprintf("Data:%v, ", o.Data)
  527. if o.Offset == nil {
  528. ret += "Offset:<nil>, "
  529. } else {
  530. ret += fmt.Sprintf("Offset:%v, ", *o.Offset)
  531. }
  532. if o.Limit == nil {
  533. ret += "Limit:<nil>"
  534. } else {
  535. ret += fmt.Sprintf("Limit:%v", *o.Limit)
  536. }
  537. return fmt.Sprintf("CouponCodeListResponse{%s}", ret)
  538. }
  539. func (o CouponCodeListResponse) Clone() *CouponCodeListResponse {
  540. ret := CouponCodeListResponse{}
  541. if o.StockId != nil {
  542. ret.StockId = new(string)
  543. *ret.StockId = *o.StockId
  544. }
  545. if o.TotalCount != nil {
  546. ret.TotalCount = new(int64)
  547. *ret.TotalCount = *o.TotalCount
  548. }
  549. if o.Data != nil {
  550. ret.Data = make([]CouponCodeEntity, len(o.Data))
  551. for i, item := range o.Data {
  552. ret.Data[i] = *item.Clone()
  553. }
  554. }
  555. if o.Offset != nil {
  556. ret.Offset = new(int64)
  557. *ret.Offset = *o.Offset
  558. }
  559. if o.Limit != nil {
  560. ret.Limit = new(int64)
  561. *ret.Limit = *o.Limit
  562. }
  563. return &ret
  564. }
  565. // CouponCodeMode
  566. type CouponCodeMode string
  567. func (e CouponCodeMode) Ptr() *CouponCodeMode {
  568. return &e
  569. }
  570. // Enums of CouponCodeMode
  571. const (
  572. COUPONCODEMODE_WECHATPAY_MODE CouponCodeMode = "WECHATPAY_MODE"
  573. COUPONCODEMODE_MERCHANT_API CouponCodeMode = "MERCHANT_API"
  574. COUPONCODEMODE_MERCHANT_UPLOAD CouponCodeMode = "MERCHANT_UPLOAD"
  575. )
  576. // CouponCodeStatus
  577. type CouponCodeStatus string
  578. func (e CouponCodeStatus) Ptr() *CouponCodeStatus {
  579. return &e
  580. }
  581. // Enums of CouponCodeStatus
  582. const (
  583. COUPONCODESTATUS_AVAILABLE CouponCodeStatus = "AVAILABLE"
  584. COUPONCODESTATUS_DISPATCHED CouponCodeStatus = "DISPATCHED"
  585. )
  586. // CouponEntity
  587. type CouponEntity struct {
  588. // 代金券的所属商户号
  589. BelongMerchant *string `json:"belong_merchant"`
  590. // 批次名称,字数上限为21个,一个中文汉字/英文字母/数字均占用一个字数。
  591. StockName *string `json:"stock_name"`
  592. // 仅配置商户可见,用于自定义信息。字数上限为20个,一个中文汉字/英文字母/数字均占用一个字数。
  593. Comment *string `json:"comment,omitempty"`
  594. // 适用商品范围,字数上限为15个,一个中文汉字/英文字母/数字均占用一个字数。
  595. GoodsName *string `json:"goods_name"`
  596. // 批次类型
  597. StockType *BusiFavorStockType `json:"stock_type"`
  598. // 不填默认否,枚举值: true:是 false:否 该字段暂未开放
  599. Transferable *bool `json:"transferable,omitempty"`
  600. // 不填默认否,枚举值: true:是 false:否 该字段暂未开放
  601. Shareable *bool `json:"shareable,omitempty"`
  602. // 商家券状态
  603. CouponState *CouponStatus `json:"coupon_state,omitempty"`
  604. //
  605. DisplayPatternInfo *DisplayPatternInfo `json:"display_pattern_info,omitempty"`
  606. //
  607. CouponUseRule *CouponUseRule `json:"coupon_use_rule"`
  608. //
  609. CustomEntrance *CustomEntrance `json:"custom_entrance,omitempty"`
  610. // 券的唯一标识
  611. CouponCode *string `json:"coupon_code,omitempty"`
  612. // 批次号
  613. StockId *string `json:"stock_id,omitempty"`
  614. // 用户领取到的这张券实际可使用的开始时间:如批次设置的领取后可用,则开始时间即为券的领取时间; 如批次设置的领取后第X天可用,则为领取时间后第X天00:00:00
  615. AvailableStartTime *time.Time `json:"available_start_time,omitempty"`
  616. // 用户领取到这张券的过期时间
  617. ExpireTime *time.Time `json:"expire_time,omitempty"`
  618. // 用户领取到这张券的时间
  619. ReceiveTime *time.Time `json:"receive_time,omitempty"`
  620. // 发券时传入的唯一凭证
  621. SendRequestNo *string `json:"send_request_no,omitempty"`
  622. // 核销时传入的唯一凭证(如券已被核销,将返回此字段)
  623. UseRequestNo *string `json:"use_request_no,omitempty"`
  624. // 券被核销的时间(如券已被核销,将返回此字段)
  625. UseTime *time.Time `json:"use_time,omitempty"`
  626. // 若商家券操作过关联商户订单信息,则该字段返回商家券已关联的商户订单号。
  627. AssociateOutTradeNo *time.Time `json:"associate_out_trade_no,omitempty"`
  628. // 回退时传入的唯一凭证(如券发生了退回,将返回此字段)
  629. ReturnRequestNo *string `json:"return_request_no,omitempty"`
  630. // 券被回退的时间(如券发生了退回,将返回此字段)
  631. ReturnTime *time.Time `json:"return_time,omitempty"`
  632. // 失效时传入的唯一凭证(如果一张券已失效,将返回此字段)
  633. DeactivateRequestNo *string `json:"deactivate_request_no,omitempty"`
  634. // 券被失效的时间(如果一张券已失效,将返回此字段)
  635. DeactivateTime *time.Time `json:"deactivate_time,omitempty"`
  636. // 失效一张券的原因(如果一张券已失效,可能返回此字段)
  637. DeactivateReason *string `json:"deactivate_reason,omitempty"`
  638. }
  639. func (o CouponEntity) MarshalJSON() ([]byte, error) {
  640. toSerialize := map[string]interface{}{}
  641. if o.BelongMerchant == nil {
  642. return nil, fmt.Errorf("field `BelongMerchant` is required and must be specified in CouponEntity")
  643. }
  644. toSerialize["belong_merchant"] = o.BelongMerchant
  645. if o.StockName == nil {
  646. return nil, fmt.Errorf("field `StockName` is required and must be specified in CouponEntity")
  647. }
  648. toSerialize["stock_name"] = o.StockName
  649. if o.Comment != nil {
  650. toSerialize["comment"] = o.Comment
  651. }
  652. if o.GoodsName == nil {
  653. return nil, fmt.Errorf("field `GoodsName` is required and must be specified in CouponEntity")
  654. }
  655. toSerialize["goods_name"] = o.GoodsName
  656. if o.StockType == nil {
  657. return nil, fmt.Errorf("field `StockType` is required and must be specified in CouponEntity")
  658. }
  659. toSerialize["stock_type"] = o.StockType
  660. if o.Transferable != nil {
  661. toSerialize["transferable"] = o.Transferable
  662. }
  663. if o.Shareable != nil {
  664. toSerialize["shareable"] = o.Shareable
  665. }
  666. if o.CouponState != nil {
  667. toSerialize["coupon_state"] = o.CouponState
  668. }
  669. if o.DisplayPatternInfo != nil {
  670. toSerialize["display_pattern_info"] = o.DisplayPatternInfo
  671. }
  672. if o.CouponUseRule == nil {
  673. return nil, fmt.Errorf("field `CouponUseRule` is required and must be specified in CouponEntity")
  674. }
  675. toSerialize["coupon_use_rule"] = o.CouponUseRule
  676. if o.CustomEntrance != nil {
  677. toSerialize["custom_entrance"] = o.CustomEntrance
  678. }
  679. if o.CouponCode != nil {
  680. toSerialize["coupon_code"] = o.CouponCode
  681. }
  682. if o.StockId != nil {
  683. toSerialize["stock_id"] = o.StockId
  684. }
  685. if o.AvailableStartTime != nil {
  686. toSerialize["available_start_time"] = o.AvailableStartTime.Format(time.RFC3339)
  687. }
  688. if o.ExpireTime != nil {
  689. toSerialize["expire_time"] = o.ExpireTime.Format(time.RFC3339)
  690. }
  691. if o.ReceiveTime != nil {
  692. toSerialize["receive_time"] = o.ReceiveTime.Format(time.RFC3339)
  693. }
  694. if o.SendRequestNo != nil {
  695. toSerialize["send_request_no"] = o.SendRequestNo
  696. }
  697. if o.UseRequestNo != nil {
  698. toSerialize["use_request_no"] = o.UseRequestNo
  699. }
  700. if o.UseTime != nil {
  701. toSerialize["use_time"] = o.UseTime.Format(time.RFC3339)
  702. }
  703. if o.AssociateOutTradeNo != nil {
  704. toSerialize["associate_out_trade_no"] = o.AssociateOutTradeNo.Format(time.RFC3339)
  705. }
  706. if o.ReturnRequestNo != nil {
  707. toSerialize["return_request_no"] = o.ReturnRequestNo
  708. }
  709. if o.ReturnTime != nil {
  710. toSerialize["return_time"] = o.ReturnTime.Format(time.RFC3339)
  711. }
  712. if o.DeactivateRequestNo != nil {
  713. toSerialize["deactivate_request_no"] = o.DeactivateRequestNo
  714. }
  715. if o.DeactivateTime != nil {
  716. toSerialize["deactivate_time"] = o.DeactivateTime.Format(time.RFC3339)
  717. }
  718. if o.DeactivateReason != nil {
  719. toSerialize["deactivate_reason"] = o.DeactivateReason
  720. }
  721. return json.Marshal(toSerialize)
  722. }
  723. func (o CouponEntity) String() string {
  724. var ret string
  725. if o.BelongMerchant == nil {
  726. ret += "BelongMerchant:<nil>, "
  727. } else {
  728. ret += fmt.Sprintf("BelongMerchant:%v, ", *o.BelongMerchant)
  729. }
  730. if o.StockName == nil {
  731. ret += "StockName:<nil>, "
  732. } else {
  733. ret += fmt.Sprintf("StockName:%v, ", *o.StockName)
  734. }
  735. if o.Comment == nil {
  736. ret += "Comment:<nil>, "
  737. } else {
  738. ret += fmt.Sprintf("Comment:%v, ", *o.Comment)
  739. }
  740. if o.GoodsName == nil {
  741. ret += "GoodsName:<nil>, "
  742. } else {
  743. ret += fmt.Sprintf("GoodsName:%v, ", *o.GoodsName)
  744. }
  745. if o.StockType == nil {
  746. ret += "StockType:<nil>, "
  747. } else {
  748. ret += fmt.Sprintf("StockType:%v, ", *o.StockType)
  749. }
  750. if o.Transferable == nil {
  751. ret += "Transferable:<nil>, "
  752. } else {
  753. ret += fmt.Sprintf("Transferable:%v, ", *o.Transferable)
  754. }
  755. if o.Shareable == nil {
  756. ret += "Shareable:<nil>, "
  757. } else {
  758. ret += fmt.Sprintf("Shareable:%v, ", *o.Shareable)
  759. }
  760. if o.CouponState == nil {
  761. ret += "CouponState:<nil>, "
  762. } else {
  763. ret += fmt.Sprintf("CouponState:%v, ", *o.CouponState)
  764. }
  765. ret += fmt.Sprintf("DisplayPatternInfo:%v, ", o.DisplayPatternInfo)
  766. ret += fmt.Sprintf("CouponUseRule:%v, ", o.CouponUseRule)
  767. ret += fmt.Sprintf("CustomEntrance:%v, ", o.CustomEntrance)
  768. if o.CouponCode == nil {
  769. ret += "CouponCode:<nil>, "
  770. } else {
  771. ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
  772. }
  773. if o.StockId == nil {
  774. ret += "StockId:<nil>, "
  775. } else {
  776. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  777. }
  778. if o.AvailableStartTime == nil {
  779. ret += "AvailableStartTime:<nil>, "
  780. } else {
  781. ret += fmt.Sprintf("AvailableStartTime:%v, ", *o.AvailableStartTime)
  782. }
  783. if o.ExpireTime == nil {
  784. ret += "ExpireTime:<nil>, "
  785. } else {
  786. ret += fmt.Sprintf("ExpireTime:%v, ", *o.ExpireTime)
  787. }
  788. if o.ReceiveTime == nil {
  789. ret += "ReceiveTime:<nil>, "
  790. } else {
  791. ret += fmt.Sprintf("ReceiveTime:%v, ", *o.ReceiveTime)
  792. }
  793. if o.SendRequestNo == nil {
  794. ret += "SendRequestNo:<nil>, "
  795. } else {
  796. ret += fmt.Sprintf("SendRequestNo:%v, ", *o.SendRequestNo)
  797. }
  798. if o.UseRequestNo == nil {
  799. ret += "UseRequestNo:<nil>, "
  800. } else {
  801. ret += fmt.Sprintf("UseRequestNo:%v, ", *o.UseRequestNo)
  802. }
  803. if o.UseTime == nil {
  804. ret += "UseTime:<nil>, "
  805. } else {
  806. ret += fmt.Sprintf("UseTime:%v, ", *o.UseTime)
  807. }
  808. if o.AssociateOutTradeNo == nil {
  809. ret += "AssociateOutTradeNo:<nil>, "
  810. } else {
  811. ret += fmt.Sprintf("AssociateOutTradeNo:%v, ", *o.AssociateOutTradeNo)
  812. }
  813. if o.ReturnRequestNo == nil {
  814. ret += "ReturnRequestNo:<nil>, "
  815. } else {
  816. ret += fmt.Sprintf("ReturnRequestNo:%v, ", *o.ReturnRequestNo)
  817. }
  818. if o.ReturnTime == nil {
  819. ret += "ReturnTime:<nil>, "
  820. } else {
  821. ret += fmt.Sprintf("ReturnTime:%v, ", *o.ReturnTime)
  822. }
  823. if o.DeactivateRequestNo == nil {
  824. ret += "DeactivateRequestNo:<nil>, "
  825. } else {
  826. ret += fmt.Sprintf("DeactivateRequestNo:%v, ", *o.DeactivateRequestNo)
  827. }
  828. if o.DeactivateTime == nil {
  829. ret += "DeactivateTime:<nil>, "
  830. } else {
  831. ret += fmt.Sprintf("DeactivateTime:%v, ", *o.DeactivateTime)
  832. }
  833. if o.DeactivateReason == nil {
  834. ret += "DeactivateReason:<nil>"
  835. } else {
  836. ret += fmt.Sprintf("DeactivateReason:%v", *o.DeactivateReason)
  837. }
  838. return fmt.Sprintf("CouponEntity{%s}", ret)
  839. }
  840. func (o CouponEntity) Clone() *CouponEntity {
  841. ret := CouponEntity{}
  842. if o.BelongMerchant != nil {
  843. ret.BelongMerchant = new(string)
  844. *ret.BelongMerchant = *o.BelongMerchant
  845. }
  846. if o.StockName != nil {
  847. ret.StockName = new(string)
  848. *ret.StockName = *o.StockName
  849. }
  850. if o.Comment != nil {
  851. ret.Comment = new(string)
  852. *ret.Comment = *o.Comment
  853. }
  854. if o.GoodsName != nil {
  855. ret.GoodsName = new(string)
  856. *ret.GoodsName = *o.GoodsName
  857. }
  858. if o.StockType != nil {
  859. ret.StockType = new(BusiFavorStockType)
  860. *ret.StockType = *o.StockType
  861. }
  862. if o.Transferable != nil {
  863. ret.Transferable = new(bool)
  864. *ret.Transferable = *o.Transferable
  865. }
  866. if o.Shareable != nil {
  867. ret.Shareable = new(bool)
  868. *ret.Shareable = *o.Shareable
  869. }
  870. if o.CouponState != nil {
  871. ret.CouponState = new(CouponStatus)
  872. *ret.CouponState = *o.CouponState
  873. }
  874. if o.DisplayPatternInfo != nil {
  875. ret.DisplayPatternInfo = o.DisplayPatternInfo.Clone()
  876. }
  877. if o.CouponUseRule != nil {
  878. ret.CouponUseRule = o.CouponUseRule.Clone()
  879. }
  880. if o.CustomEntrance != nil {
  881. ret.CustomEntrance = o.CustomEntrance.Clone()
  882. }
  883. if o.CouponCode != nil {
  884. ret.CouponCode = new(string)
  885. *ret.CouponCode = *o.CouponCode
  886. }
  887. if o.StockId != nil {
  888. ret.StockId = new(string)
  889. *ret.StockId = *o.StockId
  890. }
  891. if o.AvailableStartTime != nil {
  892. ret.AvailableStartTime = new(time.Time)
  893. *ret.AvailableStartTime = *o.AvailableStartTime
  894. }
  895. if o.ExpireTime != nil {
  896. ret.ExpireTime = new(time.Time)
  897. *ret.ExpireTime = *o.ExpireTime
  898. }
  899. if o.ReceiveTime != nil {
  900. ret.ReceiveTime = new(time.Time)
  901. *ret.ReceiveTime = *o.ReceiveTime
  902. }
  903. if o.SendRequestNo != nil {
  904. ret.SendRequestNo = new(string)
  905. *ret.SendRequestNo = *o.SendRequestNo
  906. }
  907. if o.UseRequestNo != nil {
  908. ret.UseRequestNo = new(string)
  909. *ret.UseRequestNo = *o.UseRequestNo
  910. }
  911. if o.UseTime != nil {
  912. ret.UseTime = new(time.Time)
  913. *ret.UseTime = *o.UseTime
  914. }
  915. if o.AssociateOutTradeNo != nil {
  916. ret.AssociateOutTradeNo = new(time.Time)
  917. *ret.AssociateOutTradeNo = *o.AssociateOutTradeNo
  918. }
  919. if o.ReturnRequestNo != nil {
  920. ret.ReturnRequestNo = new(string)
  921. *ret.ReturnRequestNo = *o.ReturnRequestNo
  922. }
  923. if o.ReturnTime != nil {
  924. ret.ReturnTime = new(time.Time)
  925. *ret.ReturnTime = *o.ReturnTime
  926. }
  927. if o.DeactivateRequestNo != nil {
  928. ret.DeactivateRequestNo = new(string)
  929. *ret.DeactivateRequestNo = *o.DeactivateRequestNo
  930. }
  931. if o.DeactivateTime != nil {
  932. ret.DeactivateTime = new(time.Time)
  933. *ret.DeactivateTime = *o.DeactivateTime
  934. }
  935. if o.DeactivateReason != nil {
  936. ret.DeactivateReason = new(string)
  937. *ret.DeactivateReason = *o.DeactivateReason
  938. }
  939. return &ret
  940. }
  941. // CouponListResponse
  942. type CouponListResponse struct {
  943. Data []CouponEntity `json:"data,omitempty"`
  944. // 总数量
  945. TotalCount *int64 `json:"total_count"`
  946. // 分页大小
  947. Limit *int64 `json:"limit"`
  948. // 分页页码
  949. Offset *int64 `json:"offset"`
  950. }
  951. func (o CouponListResponse) MarshalJSON() ([]byte, error) {
  952. toSerialize := map[string]interface{}{}
  953. if o.Data != nil {
  954. toSerialize["data"] = o.Data
  955. }
  956. if o.TotalCount == nil {
  957. return nil, fmt.Errorf("field `TotalCount` is required and must be specified in CouponListResponse")
  958. }
  959. toSerialize["total_count"] = o.TotalCount
  960. if o.Limit == nil {
  961. return nil, fmt.Errorf("field `Limit` is required and must be specified in CouponListResponse")
  962. }
  963. toSerialize["limit"] = o.Limit
  964. if o.Offset == nil {
  965. return nil, fmt.Errorf("field `Offset` is required and must be specified in CouponListResponse")
  966. }
  967. toSerialize["offset"] = o.Offset
  968. return json.Marshal(toSerialize)
  969. }
  970. func (o CouponListResponse) String() string {
  971. var ret string
  972. ret += fmt.Sprintf("Data:%v, ", o.Data)
  973. if o.TotalCount == nil {
  974. ret += "TotalCount:<nil>, "
  975. } else {
  976. ret += fmt.Sprintf("TotalCount:%v, ", *o.TotalCount)
  977. }
  978. if o.Limit == nil {
  979. ret += "Limit:<nil>, "
  980. } else {
  981. ret += fmt.Sprintf("Limit:%v, ", *o.Limit)
  982. }
  983. if o.Offset == nil {
  984. ret += "Offset:<nil>"
  985. } else {
  986. ret += fmt.Sprintf("Offset:%v", *o.Offset)
  987. }
  988. return fmt.Sprintf("CouponListResponse{%s}", ret)
  989. }
  990. func (o CouponListResponse) Clone() *CouponListResponse {
  991. ret := CouponListResponse{}
  992. if o.Data != nil {
  993. ret.Data = make([]CouponEntity, len(o.Data))
  994. for i, item := range o.Data {
  995. ret.Data[i] = *item.Clone()
  996. }
  997. }
  998. if o.TotalCount != nil {
  999. ret.TotalCount = new(int64)
  1000. *ret.TotalCount = *o.TotalCount
  1001. }
  1002. if o.Limit != nil {
  1003. ret.Limit = new(int64)
  1004. *ret.Limit = *o.Limit
  1005. }
  1006. if o.Offset != nil {
  1007. ret.Offset = new(int64)
  1008. *ret.Offset = *o.Offset
  1009. }
  1010. return &ret
  1011. }
  1012. // CouponSendGovCardRequest
  1013. type CouponSendGovCardRequest struct {
  1014. // 消费卡cardi\\_d创建方的AppID,需与API调用方商户号有绑定关系,入参中的用户OpenID也需用此AppID生成
  1015. Appid *string `json:"appid"`
  1016. // 待发券用户的OpenID,需为消费卡创建方AppID生成的OpenID
  1017. Openid *string `json:"openid"`
  1018. // 商户此次发放凭据号。推荐使用大小写字母和数字,不同添加请求发放凭据号不同,商户侧需保证同一发券请求的out_request_no+send_time唯一性
  1019. OutRequestNo *string `json:"out_request_no"`
  1020. // 单次请求发卡时间,消费卡在商户系统的实际发放时间,为东八区标准时间(UTC+8)。商户需保证同一次请求的out_request_no+send_time唯一。由于系统限制,暂不支持传入早于当前时间24小时以上的时间进行发券请求。
  1021. SendTime *string `json:"send_time"`
  1022. }
  1023. func (o CouponSendGovCardRequest) MarshalJSON() ([]byte, error) {
  1024. toSerialize := map[string]interface{}{}
  1025. if o.Appid == nil {
  1026. return nil, fmt.Errorf("field `Appid` is required and must be specified in CouponSendGovCardRequest")
  1027. }
  1028. toSerialize["appid"] = o.Appid
  1029. if o.Openid == nil {
  1030. return nil, fmt.Errorf("field `Openid` is required and must be specified in CouponSendGovCardRequest")
  1031. }
  1032. toSerialize["openid"] = o.Openid
  1033. if o.OutRequestNo == nil {
  1034. return nil, fmt.Errorf("field `OutRequestNo` is required and must be specified in CouponSendGovCardRequest")
  1035. }
  1036. toSerialize["out_request_no"] = o.OutRequestNo
  1037. if o.SendTime == nil {
  1038. return nil, fmt.Errorf("field `SendTime` is required and must be specified in CouponSendGovCardRequest")
  1039. }
  1040. toSerialize["send_time"] = o.SendTime
  1041. return json.Marshal(toSerialize)
  1042. }
  1043. func (o CouponSendGovCardRequest) String() string {
  1044. var ret string
  1045. if o.Appid == nil {
  1046. ret += "Appid:<nil>, "
  1047. } else {
  1048. ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
  1049. }
  1050. if o.Openid == nil {
  1051. ret += "Openid:<nil>, "
  1052. } else {
  1053. ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
  1054. }
  1055. if o.OutRequestNo == nil {
  1056. ret += "OutRequestNo:<nil>, "
  1057. } else {
  1058. ret += fmt.Sprintf("OutRequestNo:%v, ", *o.OutRequestNo)
  1059. }
  1060. if o.SendTime == nil {
  1061. ret += "SendTime:<nil>"
  1062. } else {
  1063. ret += fmt.Sprintf("SendTime:%v", *o.SendTime)
  1064. }
  1065. return fmt.Sprintf("CouponSendGovCardRequest{%s}", ret)
  1066. }
  1067. func (o CouponSendGovCardRequest) Clone() *CouponSendGovCardRequest {
  1068. ret := CouponSendGovCardRequest{}
  1069. if o.Appid != nil {
  1070. ret.Appid = new(string)
  1071. *ret.Appid = *o.Appid
  1072. }
  1073. if o.Openid != nil {
  1074. ret.Openid = new(string)
  1075. *ret.Openid = *o.Openid
  1076. }
  1077. if o.OutRequestNo != nil {
  1078. ret.OutRequestNo = new(string)
  1079. *ret.OutRequestNo = *o.OutRequestNo
  1080. }
  1081. if o.SendTime != nil {
  1082. ret.SendTime = new(string)
  1083. *ret.SendTime = *o.SendTime
  1084. }
  1085. return &ret
  1086. }
  1087. // CouponSendGovCardResponse
  1088. type CouponSendGovCardResponse struct {
  1089. // 消费卡card_id下的code
  1090. CardCode *string `json:"card_code"`
  1091. }
  1092. func (o CouponSendGovCardResponse) MarshalJSON() ([]byte, error) {
  1093. toSerialize := map[string]interface{}{}
  1094. if o.CardCode == nil {
  1095. return nil, fmt.Errorf("field `CardCode` is required and must be specified in CouponSendGovCardResponse")
  1096. }
  1097. toSerialize["card_code"] = o.CardCode
  1098. return json.Marshal(toSerialize)
  1099. }
  1100. func (o CouponSendGovCardResponse) String() string {
  1101. var ret string
  1102. if o.CardCode == nil {
  1103. ret += "CardCode:<nil>"
  1104. } else {
  1105. ret += fmt.Sprintf("CardCode:%v", *o.CardCode)
  1106. }
  1107. return fmt.Sprintf("CouponSendGovCardResponse{%s}", ret)
  1108. }
  1109. func (o CouponSendGovCardResponse) Clone() *CouponSendGovCardResponse {
  1110. ret := CouponSendGovCardResponse{}
  1111. if o.CardCode != nil {
  1112. ret.CardCode = new(string)
  1113. *ret.CardCode = *o.CardCode
  1114. }
  1115. return &ret
  1116. }
  1117. // CouponStatus
  1118. type CouponStatus string
  1119. func (e CouponStatus) Ptr() *CouponStatus {
  1120. return &e
  1121. }
  1122. // Enums of CouponStatus
  1123. const (
  1124. COUPONSTATUS_SENDED CouponStatus = "SENDED"
  1125. COUPONSTATUS_USED CouponStatus = "USED"
  1126. COUPONSTATUS_EXPIRED CouponStatus = "EXPIRED"
  1127. COUPONSTATUS_DELETED CouponStatus = "DELETED"
  1128. COUPONSTATUS_DEACTIVATED CouponStatus = "DEACTIVATED"
  1129. )
  1130. // CouponUseMethod
  1131. type CouponUseMethod string
  1132. func (e CouponUseMethod) Ptr() *CouponUseMethod {
  1133. return &e
  1134. }
  1135. // Enums of CouponUseMethod
  1136. const (
  1137. COUPONUSEMETHOD_OFF_LINE CouponUseMethod = "OFF_LINE"
  1138. COUPONUSEMETHOD_MINI_PROGRAMS CouponUseMethod = "MINI_PROGRAMS"
  1139. COUPONUSEMETHOD_SELF_CONSUME CouponUseMethod = "SELF_CONSUME"
  1140. COUPONUSEMETHOD_PAYMENT_CODE CouponUseMethod = "PAYMENT_CODE"
  1141. )
  1142. // CouponUseRule
  1143. type CouponUseRule struct {
  1144. // 日期区间内可以使用优惠
  1145. CouponAvailableTime *FavorAvailableTime `json:"coupon_available_time"`
  1146. // 固定面额满减,折扣券,换购券使用规则三选一,stock_type为NORMAL时必填。
  1147. FixedNormalCoupon *FixedValueStockMsg `json:"fixed_normal_coupon,omitempty"`
  1148. // 固定面额满减,折扣券,换购券使用规则三选一,stock_type为DISCOUNT时必填。
  1149. DiscountCoupon *DiscountMsg `json:"discount_coupon,omitempty"`
  1150. // 固定面额满减,折扣券,换购券使用规则三选一,stock_type为EXCHANGE时必填。
  1151. ExchangeCoupon *ExchangeMsg `json:"exchange_coupon,omitempty"`
  1152. // 核销方式
  1153. UseMethod *CouponUseMethod `json:"use_method"`
  1154. // 核销方式为线上小程序核销才有效
  1155. MiniProgramsAppid *string `json:"mini_programs_appid,omitempty"`
  1156. // 核销方式为线上小程序核销才有效
  1157. MiniProgramsPath *string `json:"mini_programs_path,omitempty"`
  1158. }
  1159. func (o CouponUseRule) MarshalJSON() ([]byte, error) {
  1160. toSerialize := map[string]interface{}{}
  1161. if o.CouponAvailableTime == nil {
  1162. return nil, fmt.Errorf("field `CouponAvailableTime` is required and must be specified in CouponUseRule")
  1163. }
  1164. toSerialize["coupon_available_time"] = o.CouponAvailableTime
  1165. if o.FixedNormalCoupon != nil {
  1166. toSerialize["fixed_normal_coupon"] = o.FixedNormalCoupon
  1167. }
  1168. if o.DiscountCoupon != nil {
  1169. toSerialize["discount_coupon"] = o.DiscountCoupon
  1170. }
  1171. if o.ExchangeCoupon != nil {
  1172. toSerialize["exchange_coupon"] = o.ExchangeCoupon
  1173. }
  1174. if o.UseMethod == nil {
  1175. return nil, fmt.Errorf("field `UseMethod` is required and must be specified in CouponUseRule")
  1176. }
  1177. toSerialize["use_method"] = o.UseMethod
  1178. if o.MiniProgramsAppid != nil {
  1179. toSerialize["mini_programs_appid"] = o.MiniProgramsAppid
  1180. }
  1181. if o.MiniProgramsPath != nil {
  1182. toSerialize["mini_programs_path"] = o.MiniProgramsPath
  1183. }
  1184. return json.Marshal(toSerialize)
  1185. }
  1186. func (o CouponUseRule) String() string {
  1187. var ret string
  1188. ret += fmt.Sprintf("CouponAvailableTime:%v, ", o.CouponAvailableTime)
  1189. ret += fmt.Sprintf("FixedNormalCoupon:%v, ", o.FixedNormalCoupon)
  1190. ret += fmt.Sprintf("DiscountCoupon:%v, ", o.DiscountCoupon)
  1191. ret += fmt.Sprintf("ExchangeCoupon:%v, ", o.ExchangeCoupon)
  1192. if o.UseMethod == nil {
  1193. ret += "UseMethod:<nil>, "
  1194. } else {
  1195. ret += fmt.Sprintf("UseMethod:%v, ", *o.UseMethod)
  1196. }
  1197. if o.MiniProgramsAppid == nil {
  1198. ret += "MiniProgramsAppid:<nil>, "
  1199. } else {
  1200. ret += fmt.Sprintf("MiniProgramsAppid:%v, ", *o.MiniProgramsAppid)
  1201. }
  1202. if o.MiniProgramsPath == nil {
  1203. ret += "MiniProgramsPath:<nil>"
  1204. } else {
  1205. ret += fmt.Sprintf("MiniProgramsPath:%v", *o.MiniProgramsPath)
  1206. }
  1207. return fmt.Sprintf("CouponUseRule{%s}", ret)
  1208. }
  1209. func (o CouponUseRule) Clone() *CouponUseRule {
  1210. ret := CouponUseRule{}
  1211. if o.CouponAvailableTime != nil {
  1212. ret.CouponAvailableTime = o.CouponAvailableTime.Clone()
  1213. }
  1214. if o.FixedNormalCoupon != nil {
  1215. ret.FixedNormalCoupon = o.FixedNormalCoupon.Clone()
  1216. }
  1217. if o.DiscountCoupon != nil {
  1218. ret.DiscountCoupon = o.DiscountCoupon.Clone()
  1219. }
  1220. if o.ExchangeCoupon != nil {
  1221. ret.ExchangeCoupon = o.ExchangeCoupon.Clone()
  1222. }
  1223. if o.UseMethod != nil {
  1224. ret.UseMethod = new(CouponUseMethod)
  1225. *ret.UseMethod = *o.UseMethod
  1226. }
  1227. if o.MiniProgramsAppid != nil {
  1228. ret.MiniProgramsAppid = new(string)
  1229. *ret.MiniProgramsAppid = *o.MiniProgramsAppid
  1230. }
  1231. if o.MiniProgramsPath != nil {
  1232. ret.MiniProgramsPath = new(string)
  1233. *ret.MiniProgramsPath = *o.MiniProgramsPath
  1234. }
  1235. return &ret
  1236. }
  1237. // CreateBusiFavorStockRequest
  1238. type CreateBusiFavorStockRequest struct {
  1239. // 批次名称,字数上限为21个,一个中文汉字/英文字母/数字均占用一个字数。
  1240. StockName *string `json:"stock_name"`
  1241. // 批次归属于哪个商户。 注: 普通直连模式,该参数为直连商户号; 服务商模式,该参数为子商户号; 间连模式,该参数为子商户号。
  1242. BelongMerchant *string `json:"belong_merchant"`
  1243. // 仅配置商户可见,用于自定义信息。字数上限为20个,一个中文汉字/英文字母/数字均占用一个字数。
  1244. Comment *string `json:"comment,omitempty"`
  1245. // 用来描述批次在哪些商品可用,会显示在微信卡包中。字数上限为15个,一个中文汉字/英文字母/数字均占用一个字数。
  1246. GoodsName *string `json:"goods_name"`
  1247. // 批次类型
  1248. StockType *BusiFavorStockType `json:"stock_type"`
  1249. // 券核销相关规则
  1250. CouponUseRule *CouponUseRule `json:"coupon_use_rule"`
  1251. // 券发放相关规则
  1252. StockSendRule *StockSendRule `json:"stock_send_rule"`
  1253. // 商户创建批次凭据号(格式:商户ID+日期+流水号),商户侧需保持唯一性
  1254. OutRequestNo *string `json:"out_request_no"`
  1255. // 卡详情页面,可选择多种入口引导用户
  1256. CustomEntrance *CustomEntrance `json:"custom_entrance,omitempty"`
  1257. // 创建批次时的样式信息。
  1258. DisplayPatternInfo *DisplayPatternInfo `json:"display_pattern_info,omitempty"`
  1259. // 特殊规则: 1、券code模式为WECHATPAY\\_MODE时,是微信自动分配券code,商户不需要预存code;适用于多种场景 2、券code模式为MERCHANT\\_API时,无需调用上传预存code接口,调用发券接口时需指定券code;更多用在商家自有流量场景(例如:商家自有小程序、H5网页等) 3、券code模式为MERCHANT\\_UPLOAD,需要调用上传预存code接口上传code,调用发券接口时无需指定code;更多适用在微信支付平台流量场景(例如:支付有礼、支付有优惠等)
  1260. CouponCodeMode *CouponCodeMode `json:"coupon_code_mode"`
  1261. // 事件回调通知商户的配置
  1262. NotifyConfig *NotifyConfig `json:"notify_config,omitempty"`
  1263. // 该批次发放的券是否允许进行补差,默认为false 注:该字段暂未开放
  1264. Subsidy *bool `json:"subsidy,omitempty"`
  1265. }
  1266. func (o CreateBusiFavorStockRequest) MarshalJSON() ([]byte, error) {
  1267. toSerialize := map[string]interface{}{}
  1268. if o.StockName == nil {
  1269. return nil, fmt.Errorf("field `StockName` is required and must be specified in CreateBusiFavorStockRequest")
  1270. }
  1271. toSerialize["stock_name"] = o.StockName
  1272. if o.BelongMerchant == nil {
  1273. return nil, fmt.Errorf("field `BelongMerchant` is required and must be specified in CreateBusiFavorStockRequest")
  1274. }
  1275. toSerialize["belong_merchant"] = o.BelongMerchant
  1276. if o.Comment != nil {
  1277. toSerialize["comment"] = o.Comment
  1278. }
  1279. if o.GoodsName == nil {
  1280. return nil, fmt.Errorf("field `GoodsName` is required and must be specified in CreateBusiFavorStockRequest")
  1281. }
  1282. toSerialize["goods_name"] = o.GoodsName
  1283. if o.StockType == nil {
  1284. return nil, fmt.Errorf("field `StockType` is required and must be specified in CreateBusiFavorStockRequest")
  1285. }
  1286. toSerialize["stock_type"] = o.StockType
  1287. if o.CouponUseRule == nil {
  1288. return nil, fmt.Errorf("field `CouponUseRule` is required and must be specified in CreateBusiFavorStockRequest")
  1289. }
  1290. toSerialize["coupon_use_rule"] = o.CouponUseRule
  1291. if o.StockSendRule == nil {
  1292. return nil, fmt.Errorf("field `StockSendRule` is required and must be specified in CreateBusiFavorStockRequest")
  1293. }
  1294. toSerialize["stock_send_rule"] = o.StockSendRule
  1295. if o.OutRequestNo == nil {
  1296. return nil, fmt.Errorf("field `OutRequestNo` is required and must be specified in CreateBusiFavorStockRequest")
  1297. }
  1298. toSerialize["out_request_no"] = o.OutRequestNo
  1299. if o.CustomEntrance != nil {
  1300. toSerialize["custom_entrance"] = o.CustomEntrance
  1301. }
  1302. if o.DisplayPatternInfo != nil {
  1303. toSerialize["display_pattern_info"] = o.DisplayPatternInfo
  1304. }
  1305. if o.CouponCodeMode == nil {
  1306. return nil, fmt.Errorf("field `CouponCodeMode` is required and must be specified in CreateBusiFavorStockRequest")
  1307. }
  1308. toSerialize["coupon_code_mode"] = o.CouponCodeMode
  1309. if o.NotifyConfig != nil {
  1310. toSerialize["notify_config"] = o.NotifyConfig
  1311. }
  1312. if o.Subsidy != nil {
  1313. toSerialize["subsidy"] = o.Subsidy
  1314. }
  1315. return json.Marshal(toSerialize)
  1316. }
  1317. func (o CreateBusiFavorStockRequest) String() string {
  1318. var ret string
  1319. if o.StockName == nil {
  1320. ret += "StockName:<nil>, "
  1321. } else {
  1322. ret += fmt.Sprintf("StockName:%v, ", *o.StockName)
  1323. }
  1324. if o.BelongMerchant == nil {
  1325. ret += "BelongMerchant:<nil>, "
  1326. } else {
  1327. ret += fmt.Sprintf("BelongMerchant:%v, ", *o.BelongMerchant)
  1328. }
  1329. if o.Comment == nil {
  1330. ret += "Comment:<nil>, "
  1331. } else {
  1332. ret += fmt.Sprintf("Comment:%v, ", *o.Comment)
  1333. }
  1334. if o.GoodsName == nil {
  1335. ret += "GoodsName:<nil>, "
  1336. } else {
  1337. ret += fmt.Sprintf("GoodsName:%v, ", *o.GoodsName)
  1338. }
  1339. if o.StockType == nil {
  1340. ret += "StockType:<nil>, "
  1341. } else {
  1342. ret += fmt.Sprintf("StockType:%v, ", *o.StockType)
  1343. }
  1344. ret += fmt.Sprintf("CouponUseRule:%v, ", o.CouponUseRule)
  1345. ret += fmt.Sprintf("StockSendRule:%v, ", o.StockSendRule)
  1346. if o.OutRequestNo == nil {
  1347. ret += "OutRequestNo:<nil>, "
  1348. } else {
  1349. ret += fmt.Sprintf("OutRequestNo:%v, ", *o.OutRequestNo)
  1350. }
  1351. ret += fmt.Sprintf("CustomEntrance:%v, ", o.CustomEntrance)
  1352. ret += fmt.Sprintf("DisplayPatternInfo:%v, ", o.DisplayPatternInfo)
  1353. if o.CouponCodeMode == nil {
  1354. ret += "CouponCodeMode:<nil>, "
  1355. } else {
  1356. ret += fmt.Sprintf("CouponCodeMode:%v, ", *o.CouponCodeMode)
  1357. }
  1358. ret += fmt.Sprintf("NotifyConfig:%v, ", o.NotifyConfig)
  1359. if o.Subsidy == nil {
  1360. ret += "Subsidy:<nil>"
  1361. } else {
  1362. ret += fmt.Sprintf("Subsidy:%v", *o.Subsidy)
  1363. }
  1364. return fmt.Sprintf("CreateBusiFavorStockRequest{%s}", ret)
  1365. }
  1366. func (o CreateBusiFavorStockRequest) Clone() *CreateBusiFavorStockRequest {
  1367. ret := CreateBusiFavorStockRequest{}
  1368. if o.StockName != nil {
  1369. ret.StockName = new(string)
  1370. *ret.StockName = *o.StockName
  1371. }
  1372. if o.BelongMerchant != nil {
  1373. ret.BelongMerchant = new(string)
  1374. *ret.BelongMerchant = *o.BelongMerchant
  1375. }
  1376. if o.Comment != nil {
  1377. ret.Comment = new(string)
  1378. *ret.Comment = *o.Comment
  1379. }
  1380. if o.GoodsName != nil {
  1381. ret.GoodsName = new(string)
  1382. *ret.GoodsName = *o.GoodsName
  1383. }
  1384. if o.StockType != nil {
  1385. ret.StockType = new(BusiFavorStockType)
  1386. *ret.StockType = *o.StockType
  1387. }
  1388. if o.CouponUseRule != nil {
  1389. ret.CouponUseRule = o.CouponUseRule.Clone()
  1390. }
  1391. if o.StockSendRule != nil {
  1392. ret.StockSendRule = o.StockSendRule.Clone()
  1393. }
  1394. if o.OutRequestNo != nil {
  1395. ret.OutRequestNo = new(string)
  1396. *ret.OutRequestNo = *o.OutRequestNo
  1397. }
  1398. if o.CustomEntrance != nil {
  1399. ret.CustomEntrance = o.CustomEntrance.Clone()
  1400. }
  1401. if o.DisplayPatternInfo != nil {
  1402. ret.DisplayPatternInfo = o.DisplayPatternInfo.Clone()
  1403. }
  1404. if o.CouponCodeMode != nil {
  1405. ret.CouponCodeMode = new(CouponCodeMode)
  1406. *ret.CouponCodeMode = *o.CouponCodeMode
  1407. }
  1408. if o.NotifyConfig != nil {
  1409. ret.NotifyConfig = o.NotifyConfig.Clone()
  1410. }
  1411. if o.Subsidy != nil {
  1412. ret.Subsidy = new(bool)
  1413. *ret.Subsidy = *o.Subsidy
  1414. }
  1415. return &ret
  1416. }
  1417. type CreateBusifavorStockRequest CreateBusiFavorStockRequest
  1418. func (o CreateBusifavorStockRequest) MarshalJSON() ([]byte, error) {
  1419. return json.Marshal(CreateBusiFavorStockRequest(o))
  1420. }
  1421. func (o CreateBusifavorStockRequest) String() string {
  1422. return "CreateBusifavorStockRequest" + strings.TrimPrefix(CreateBusiFavorStockRequest(o).String(), "CreateBusiFavorStockRequest")
  1423. }
  1424. func (o CreateBusifavorStockRequest) Clone() *CreateBusifavorStockRequest {
  1425. clone := CreateBusiFavorStockRequest(o).Clone()
  1426. return (*CreateBusifavorStockRequest)(clone)
  1427. }
  1428. // CreateBusiFavorStockResponse
  1429. type CreateBusiFavorStockResponse struct {
  1430. // 批次号
  1431. StockId *string `json:"stock_id"`
  1432. // 创建时间,遵循[rfc3339](https://datatracker.ietf.org/doc/html/rfc3339)标准格式,格式为yyyy-MM-DDTHH:mm:ss+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秒。
  1433. CreateTime *string `json:"create_time"`
  1434. }
  1435. func (o CreateBusiFavorStockResponse) MarshalJSON() ([]byte, error) {
  1436. toSerialize := map[string]interface{}{}
  1437. if o.StockId == nil {
  1438. return nil, fmt.Errorf("field `StockId` is required and must be specified in CreateBusiFavorStockResponse")
  1439. }
  1440. toSerialize["stock_id"] = o.StockId
  1441. if o.CreateTime == nil {
  1442. return nil, fmt.Errorf("field `CreateTime` is required and must be specified in CreateBusiFavorStockResponse")
  1443. }
  1444. toSerialize["create_time"] = o.CreateTime
  1445. return json.Marshal(toSerialize)
  1446. }
  1447. func (o CreateBusiFavorStockResponse) String() string {
  1448. var ret string
  1449. if o.StockId == nil {
  1450. ret += "StockId:<nil>, "
  1451. } else {
  1452. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  1453. }
  1454. if o.CreateTime == nil {
  1455. ret += "CreateTime:<nil>"
  1456. } else {
  1457. ret += fmt.Sprintf("CreateTime:%v", *o.CreateTime)
  1458. }
  1459. return fmt.Sprintf("CreateBusiFavorStockResponse{%s}", ret)
  1460. }
  1461. func (o CreateBusiFavorStockResponse) Clone() *CreateBusiFavorStockResponse {
  1462. ret := CreateBusiFavorStockResponse{}
  1463. if o.StockId != nil {
  1464. ret.StockId = new(string)
  1465. *ret.StockId = *o.StockId
  1466. }
  1467. if o.CreateTime != nil {
  1468. ret.CreateTime = new(string)
  1469. *ret.CreateTime = *o.CreateTime
  1470. }
  1471. return &ret
  1472. }
  1473. // CustomEntrance
  1474. type CustomEntrance struct {
  1475. // 需要小程序APPID、path、入口文案、引导文案。如果需要跳转小程序,APPID、path、入口文案为必填,引导文案非必填。 AppID要与归属商户号有M-A or M-m-suba关系。 注:请查看[绑定关系说明文档](https://pay.weixin.qq.com/wiki/doc/apiv3/open/pay/chapter5_2_2.shtml#part-7)
  1476. MiniProgramsInfo *MiniAppInfo `json:"mini_programs_info,omitempty"`
  1477. // 可配置商户公众号,从券详情可跳转至公众号,用户自定义字段。 校验规则:传入的AppID得是与调用方商户号(即请求头里面的商户号)有绑定关系的AppID 或 传入的AppID得是归属商户号有绑定关系的AppID
  1478. Appid *string `json:"appid,omitempty"`
  1479. // 填写微信支付营销馆的馆ID,用户自定义字段。[营销馆](https://pay.weixin.qq.com/index.php/xphp/cfav_market/hall#/pages/list/list)需在商户平台创建。
  1480. HallId *string `json:"hall_id,omitempty"`
  1481. // 填写代金券可用门店ID
  1482. StoreId *string `json:"store_id,omitempty"`
  1483. // code展示模式
  1484. CodeDisplayMode *CodeDisplayMode `json:"code_display_mode,omitempty"`
  1485. }
  1486. func (o CustomEntrance) MarshalJSON() ([]byte, error) {
  1487. toSerialize := map[string]interface{}{}
  1488. if o.MiniProgramsInfo != nil {
  1489. toSerialize["mini_programs_info"] = o.MiniProgramsInfo
  1490. }
  1491. if o.Appid != nil {
  1492. toSerialize["appid"] = o.Appid
  1493. }
  1494. if o.HallId != nil {
  1495. toSerialize["hall_id"] = o.HallId
  1496. }
  1497. if o.StoreId != nil {
  1498. toSerialize["store_id"] = o.StoreId
  1499. }
  1500. if o.CodeDisplayMode != nil {
  1501. toSerialize["code_display_mode"] = o.CodeDisplayMode
  1502. }
  1503. return json.Marshal(toSerialize)
  1504. }
  1505. func (o CustomEntrance) String() string {
  1506. var ret string
  1507. ret += fmt.Sprintf("MiniProgramsInfo:%v, ", o.MiniProgramsInfo)
  1508. if o.Appid == nil {
  1509. ret += "Appid:<nil>, "
  1510. } else {
  1511. ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
  1512. }
  1513. if o.HallId == nil {
  1514. ret += "HallId:<nil>, "
  1515. } else {
  1516. ret += fmt.Sprintf("HallId:%v, ", *o.HallId)
  1517. }
  1518. if o.StoreId == nil {
  1519. ret += "StoreId:<nil>, "
  1520. } else {
  1521. ret += fmt.Sprintf("StoreId:%v, ", *o.StoreId)
  1522. }
  1523. if o.CodeDisplayMode == nil {
  1524. ret += "CodeDisplayMode:<nil>"
  1525. } else {
  1526. ret += fmt.Sprintf("CodeDisplayMode:%v", *o.CodeDisplayMode)
  1527. }
  1528. return fmt.Sprintf("CustomEntrance{%s}", ret)
  1529. }
  1530. func (o CustomEntrance) Clone() *CustomEntrance {
  1531. ret := CustomEntrance{}
  1532. if o.MiniProgramsInfo != nil {
  1533. ret.MiniProgramsInfo = o.MiniProgramsInfo.Clone()
  1534. }
  1535. if o.Appid != nil {
  1536. ret.Appid = new(string)
  1537. *ret.Appid = *o.Appid
  1538. }
  1539. if o.HallId != nil {
  1540. ret.HallId = new(string)
  1541. *ret.HallId = *o.HallId
  1542. }
  1543. if o.StoreId != nil {
  1544. ret.StoreId = new(string)
  1545. *ret.StoreId = *o.StoreId
  1546. }
  1547. if o.CodeDisplayMode != nil {
  1548. ret.CodeDisplayMode = new(CodeDisplayMode)
  1549. *ret.CodeDisplayMode = *o.CodeDisplayMode
  1550. }
  1551. return &ret
  1552. }
  1553. // DeactivateCouponRequest
  1554. type DeactivateCouponRequest struct {
  1555. // 券的唯一标识
  1556. CouponCode *string `json:"coupon_code"`
  1557. // 券的所属批次号
  1558. StockId *string `json:"stock_id"`
  1559. // 每次失效请求的唯一标识,商户需保证唯一
  1560. DeactivateRequestNo *string `json:"deactivate_request_no"`
  1561. // 商户失效券的原因
  1562. DeactivateReason *string `json:"deactivate_reason,omitempty"`
  1563. }
  1564. func (o DeactivateCouponRequest) MarshalJSON() ([]byte, error) {
  1565. toSerialize := map[string]interface{}{}
  1566. if o.CouponCode == nil {
  1567. return nil, fmt.Errorf("field `CouponCode` is required and must be specified in DeactivateCouponRequest")
  1568. }
  1569. toSerialize["coupon_code"] = o.CouponCode
  1570. if o.StockId == nil {
  1571. return nil, fmt.Errorf("field `StockId` is required and must be specified in DeactivateCouponRequest")
  1572. }
  1573. toSerialize["stock_id"] = o.StockId
  1574. if o.DeactivateRequestNo == nil {
  1575. return nil, fmt.Errorf("field `DeactivateRequestNo` is required and must be specified in DeactivateCouponRequest")
  1576. }
  1577. toSerialize["deactivate_request_no"] = o.DeactivateRequestNo
  1578. if o.DeactivateReason != nil {
  1579. toSerialize["deactivate_reason"] = o.DeactivateReason
  1580. }
  1581. return json.Marshal(toSerialize)
  1582. }
  1583. func (o DeactivateCouponRequest) String() string {
  1584. var ret string
  1585. if o.CouponCode == nil {
  1586. ret += "CouponCode:<nil>, "
  1587. } else {
  1588. ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
  1589. }
  1590. if o.StockId == nil {
  1591. ret += "StockId:<nil>, "
  1592. } else {
  1593. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  1594. }
  1595. if o.DeactivateRequestNo == nil {
  1596. ret += "DeactivateRequestNo:<nil>, "
  1597. } else {
  1598. ret += fmt.Sprintf("DeactivateRequestNo:%v, ", *o.DeactivateRequestNo)
  1599. }
  1600. if o.DeactivateReason == nil {
  1601. ret += "DeactivateReason:<nil>"
  1602. } else {
  1603. ret += fmt.Sprintf("DeactivateReason:%v", *o.DeactivateReason)
  1604. }
  1605. return fmt.Sprintf("DeactivateCouponRequest{%s}", ret)
  1606. }
  1607. func (o DeactivateCouponRequest) Clone() *DeactivateCouponRequest {
  1608. ret := DeactivateCouponRequest{}
  1609. if o.CouponCode != nil {
  1610. ret.CouponCode = new(string)
  1611. *ret.CouponCode = *o.CouponCode
  1612. }
  1613. if o.StockId != nil {
  1614. ret.StockId = new(string)
  1615. *ret.StockId = *o.StockId
  1616. }
  1617. if o.DeactivateRequestNo != nil {
  1618. ret.DeactivateRequestNo = new(string)
  1619. *ret.DeactivateRequestNo = *o.DeactivateRequestNo
  1620. }
  1621. if o.DeactivateReason != nil {
  1622. ret.DeactivateReason = new(string)
  1623. *ret.DeactivateReason = *o.DeactivateReason
  1624. }
  1625. return &ret
  1626. }
  1627. // DeactivateCouponResponse
  1628. type DeactivateCouponResponse struct {
  1629. // 系统券成功失效的时间,遵循[rfc3339](https://datatracker.ietf.org/doc/html/rfc3339)标准格式,格式为yyyy-MM-DDTHH:mm:ss+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秒。
  1630. WechatpayDeactivateTime *time.Time `json:"wechatpay_deactivate_time"`
  1631. }
  1632. func (o DeactivateCouponResponse) MarshalJSON() ([]byte, error) {
  1633. toSerialize := map[string]interface{}{}
  1634. if o.WechatpayDeactivateTime == nil {
  1635. return nil, fmt.Errorf("field `WechatpayDeactivateTime` is required and must be specified in DeactivateCouponResponse")
  1636. }
  1637. toSerialize["wechatpay_deactivate_time"] = o.WechatpayDeactivateTime.Format(time.RFC3339)
  1638. return json.Marshal(toSerialize)
  1639. }
  1640. func (o DeactivateCouponResponse) String() string {
  1641. var ret string
  1642. if o.WechatpayDeactivateTime == nil {
  1643. ret += "WechatpayDeactivateTime:<nil>"
  1644. } else {
  1645. ret += fmt.Sprintf("WechatpayDeactivateTime:%v", *o.WechatpayDeactivateTime)
  1646. }
  1647. return fmt.Sprintf("DeactivateCouponResponse{%s}", ret)
  1648. }
  1649. func (o DeactivateCouponResponse) Clone() *DeactivateCouponResponse {
  1650. ret := DeactivateCouponResponse{}
  1651. if o.WechatpayDeactivateTime != nil {
  1652. ret.WechatpayDeactivateTime = new(time.Time)
  1653. *ret.WechatpayDeactivateTime = *o.WechatpayDeactivateTime
  1654. }
  1655. return &ret
  1656. }
  1657. // DeleteCouponCodeRequest
  1658. type DeleteCouponCodeRequest struct {
  1659. // 商家券批次号
  1660. StockId *string `json:"stock_id"`
  1661. // 上传的自定义code
  1662. CouponCode *string `json:"coupon_code"`
  1663. // 商户删除code的凭据号,商户侧需保持唯一性
  1664. DeleteRequestNo *string `json:"delete_request_no"`
  1665. }
  1666. func (o DeleteCouponCodeRequest) MarshalJSON() ([]byte, error) {
  1667. toSerialize := map[string]interface{}{}
  1668. if o.StockId == nil {
  1669. return nil, fmt.Errorf("field `StockId` is required and must be specified in DeleteCouponCodeRequest")
  1670. }
  1671. toSerialize["stock_id"] = o.StockId
  1672. if o.CouponCode == nil {
  1673. return nil, fmt.Errorf("field `CouponCode` is required and must be specified in DeleteCouponCodeRequest")
  1674. }
  1675. toSerialize["coupon_code"] = o.CouponCode
  1676. if o.DeleteRequestNo == nil {
  1677. return nil, fmt.Errorf("field `DeleteRequestNo` is required and must be specified in DeleteCouponCodeRequest")
  1678. }
  1679. toSerialize["delete_request_no"] = o.DeleteRequestNo
  1680. return json.Marshal(toSerialize)
  1681. }
  1682. func (o DeleteCouponCodeRequest) String() string {
  1683. var ret string
  1684. if o.StockId == nil {
  1685. ret += "StockId:<nil>, "
  1686. } else {
  1687. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  1688. }
  1689. if o.CouponCode == nil {
  1690. ret += "CouponCode:<nil>, "
  1691. } else {
  1692. ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
  1693. }
  1694. if o.DeleteRequestNo == nil {
  1695. ret += "DeleteRequestNo:<nil>"
  1696. } else {
  1697. ret += fmt.Sprintf("DeleteRequestNo:%v", *o.DeleteRequestNo)
  1698. }
  1699. return fmt.Sprintf("DeleteCouponCodeRequest{%s}", ret)
  1700. }
  1701. func (o DeleteCouponCodeRequest) Clone() *DeleteCouponCodeRequest {
  1702. ret := DeleteCouponCodeRequest{}
  1703. if o.StockId != nil {
  1704. ret.StockId = new(string)
  1705. *ret.StockId = *o.StockId
  1706. }
  1707. if o.CouponCode != nil {
  1708. ret.CouponCode = new(string)
  1709. *ret.CouponCode = *o.CouponCode
  1710. }
  1711. if o.DeleteRequestNo != nil {
  1712. ret.DeleteRequestNo = new(string)
  1713. *ret.DeleteRequestNo = *o.DeleteRequestNo
  1714. }
  1715. return &ret
  1716. }
  1717. // DeleteCouponCodeResponse
  1718. type DeleteCouponCodeResponse struct {
  1719. // 商家券批次号
  1720. StockId *string `json:"stock_id"`
  1721. // 商家券code实际被删除的时间
  1722. DeleteTime *string `json:"delete_time"`
  1723. }
  1724. func (o DeleteCouponCodeResponse) MarshalJSON() ([]byte, error) {
  1725. toSerialize := map[string]interface{}{}
  1726. if o.StockId == nil {
  1727. return nil, fmt.Errorf("field `StockId` is required and must be specified in DeleteCouponCodeResponse")
  1728. }
  1729. toSerialize["stock_id"] = o.StockId
  1730. if o.DeleteTime == nil {
  1731. return nil, fmt.Errorf("field `DeleteTime` is required and must be specified in DeleteCouponCodeResponse")
  1732. }
  1733. toSerialize["delete_time"] = o.DeleteTime
  1734. return json.Marshal(toSerialize)
  1735. }
  1736. func (o DeleteCouponCodeResponse) String() string {
  1737. var ret string
  1738. if o.StockId == nil {
  1739. ret += "StockId:<nil>, "
  1740. } else {
  1741. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  1742. }
  1743. if o.DeleteTime == nil {
  1744. ret += "DeleteTime:<nil>"
  1745. } else {
  1746. ret += fmt.Sprintf("DeleteTime:%v", *o.DeleteTime)
  1747. }
  1748. return fmt.Sprintf("DeleteCouponCodeResponse{%s}", ret)
  1749. }
  1750. func (o DeleteCouponCodeResponse) Clone() *DeleteCouponCodeResponse {
  1751. ret := DeleteCouponCodeResponse{}
  1752. if o.StockId != nil {
  1753. ret.StockId = new(string)
  1754. *ret.StockId = *o.StockId
  1755. }
  1756. if o.DeleteTime != nil {
  1757. ret.DeleteTime = new(string)
  1758. *ret.DeleteTime = *o.DeleteTime
  1759. }
  1760. return &ret
  1761. }
  1762. // DisassociateTradeInfoRequest
  1763. type DisassociateTradeInfoRequest struct {
  1764. // 微信为每个商家券批次分配的唯一ID, 对于商户自定义code的批次,关联请求必须填写批次号
  1765. StockId *string `json:"stock_id"`
  1766. // 券的唯一标识
  1767. CouponCode *string `json:"coupon_code"`
  1768. // 欲取消与商家券关联的微信支付下单的商户订单号,该单号需要已操作过与券关联,否则无法取消关联
  1769. OutTradeNo *string `json:"out_trade_no"`
  1770. // 商户创建批次凭据号(格式:商户ID+日期+流水号),商户侧需保持唯一性,可包含英文字母,数字,|,_,*,-等内容,不允许出现其他不合法符号。
  1771. OutRequestNo *string `json:"out_request_no"`
  1772. }
  1773. func (o DisassociateTradeInfoRequest) MarshalJSON() ([]byte, error) {
  1774. toSerialize := map[string]interface{}{}
  1775. if o.StockId == nil {
  1776. return nil, fmt.Errorf("field `StockId` is required and must be specified in DisassociateTradeInfoRequest")
  1777. }
  1778. toSerialize["stock_id"] = o.StockId
  1779. if o.CouponCode == nil {
  1780. return nil, fmt.Errorf("field `CouponCode` is required and must be specified in DisassociateTradeInfoRequest")
  1781. }
  1782. toSerialize["coupon_code"] = o.CouponCode
  1783. if o.OutTradeNo == nil {
  1784. return nil, fmt.Errorf("field `OutTradeNo` is required and must be specified in DisassociateTradeInfoRequest")
  1785. }
  1786. toSerialize["out_trade_no"] = o.OutTradeNo
  1787. if o.OutRequestNo == nil {
  1788. return nil, fmt.Errorf("field `OutRequestNo` is required and must be specified in DisassociateTradeInfoRequest")
  1789. }
  1790. toSerialize["out_request_no"] = o.OutRequestNo
  1791. return json.Marshal(toSerialize)
  1792. }
  1793. func (o DisassociateTradeInfoRequest) String() string {
  1794. var ret string
  1795. if o.StockId == nil {
  1796. ret += "StockId:<nil>, "
  1797. } else {
  1798. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  1799. }
  1800. if o.CouponCode == nil {
  1801. ret += "CouponCode:<nil>, "
  1802. } else {
  1803. ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
  1804. }
  1805. if o.OutTradeNo == nil {
  1806. ret += "OutTradeNo:<nil>, "
  1807. } else {
  1808. ret += fmt.Sprintf("OutTradeNo:%v, ", *o.OutTradeNo)
  1809. }
  1810. if o.OutRequestNo == nil {
  1811. ret += "OutRequestNo:<nil>"
  1812. } else {
  1813. ret += fmt.Sprintf("OutRequestNo:%v", *o.OutRequestNo)
  1814. }
  1815. return fmt.Sprintf("DisassociateTradeInfoRequest{%s}", ret)
  1816. }
  1817. func (o DisassociateTradeInfoRequest) Clone() *DisassociateTradeInfoRequest {
  1818. ret := DisassociateTradeInfoRequest{}
  1819. if o.StockId != nil {
  1820. ret.StockId = new(string)
  1821. *ret.StockId = *o.StockId
  1822. }
  1823. if o.CouponCode != nil {
  1824. ret.CouponCode = new(string)
  1825. *ret.CouponCode = *o.CouponCode
  1826. }
  1827. if o.OutTradeNo != nil {
  1828. ret.OutTradeNo = new(string)
  1829. *ret.OutTradeNo = *o.OutTradeNo
  1830. }
  1831. if o.OutRequestNo != nil {
  1832. ret.OutRequestNo = new(string)
  1833. *ret.OutRequestNo = *o.OutRequestNo
  1834. }
  1835. return &ret
  1836. }
  1837. // DisassociateTradeInfoResponse
  1838. type DisassociateTradeInfoResponse struct {
  1839. // 系统成功取消商家券与订单信息关联关系的时间,遵循[rfc3339](https://datatracker.ietf.org/doc/html/rfc3339)标准格式,格式为yyyy-MM-DDTHH:mm:ss+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秒。
  1840. WechatpayDisassociateTime *time.Time `json:"wechatpay_disassociate_time"`
  1841. }
  1842. func (o DisassociateTradeInfoResponse) MarshalJSON() ([]byte, error) {
  1843. toSerialize := map[string]interface{}{}
  1844. if o.WechatpayDisassociateTime == nil {
  1845. return nil, fmt.Errorf("field `WechatpayDisassociateTime` is required and must be specified in DisassociateTradeInfoResponse")
  1846. }
  1847. toSerialize["wechatpay_disassociate_time"] = o.WechatpayDisassociateTime.Format(time.RFC3339)
  1848. return json.Marshal(toSerialize)
  1849. }
  1850. func (o DisassociateTradeInfoResponse) String() string {
  1851. var ret string
  1852. if o.WechatpayDisassociateTime == nil {
  1853. ret += "WechatpayDisassociateTime:<nil>"
  1854. } else {
  1855. ret += fmt.Sprintf("WechatpayDisassociateTime:%v", *o.WechatpayDisassociateTime)
  1856. }
  1857. return fmt.Sprintf("DisassociateTradeInfoResponse{%s}", ret)
  1858. }
  1859. func (o DisassociateTradeInfoResponse) Clone() *DisassociateTradeInfoResponse {
  1860. ret := DisassociateTradeInfoResponse{}
  1861. if o.WechatpayDisassociateTime != nil {
  1862. ret.WechatpayDisassociateTime = new(time.Time)
  1863. *ret.WechatpayDisassociateTime = *o.WechatpayDisassociateTime
  1864. }
  1865. return &ret
  1866. }
  1867. // DiscountMsg
  1868. type DiscountMsg struct {
  1869. // 折扣百分比,88为88折
  1870. DiscountPercent *int64 `json:"discount_percent,omitempty"`
  1871. // 消费门槛,单位:分。 特殊规则:取值范围 1 ≤ value ≤ 10000000
  1872. TransactionMinimum *int64 `json:"transaction_minimum,omitempty"`
  1873. }
  1874. func (o DiscountMsg) MarshalJSON() ([]byte, error) {
  1875. toSerialize := map[string]interface{}{}
  1876. if o.DiscountPercent != nil {
  1877. toSerialize["discount_percent"] = o.DiscountPercent
  1878. }
  1879. if o.TransactionMinimum != nil {
  1880. toSerialize["transaction_minimum"] = o.TransactionMinimum
  1881. }
  1882. return json.Marshal(toSerialize)
  1883. }
  1884. func (o DiscountMsg) String() string {
  1885. var ret string
  1886. if o.DiscountPercent == nil {
  1887. ret += "DiscountPercent:<nil>, "
  1888. } else {
  1889. ret += fmt.Sprintf("DiscountPercent:%v, ", *o.DiscountPercent)
  1890. }
  1891. if o.TransactionMinimum == nil {
  1892. ret += "TransactionMinimum:<nil>"
  1893. } else {
  1894. ret += fmt.Sprintf("TransactionMinimum:%v", *o.TransactionMinimum)
  1895. }
  1896. return fmt.Sprintf("DiscountMsg{%s}", ret)
  1897. }
  1898. func (o DiscountMsg) Clone() *DiscountMsg {
  1899. ret := DiscountMsg{}
  1900. if o.DiscountPercent != nil {
  1901. ret.DiscountPercent = new(int64)
  1902. *ret.DiscountPercent = *o.DiscountPercent
  1903. }
  1904. if o.TransactionMinimum != nil {
  1905. ret.TransactionMinimum = new(int64)
  1906. *ret.TransactionMinimum = *o.TransactionMinimum
  1907. }
  1908. return &ret
  1909. }
  1910. // DisplayPatternInfo
  1911. type DisplayPatternInfo struct {
  1912. // 用于说明详细的活动规则,会展示在代金券详情页。
  1913. Description *string `json:"description,omitempty"`
  1914. // 若券归属商户号有认证品牌,则系统将自动拉取对应品牌logo;若券归属商户号不在认证品牌下,需自定义上传logo,未上传时将展示兜底灰色logo样式,影响券详情页用户体验,请及时上传。 商户logo的URL地址,仅支持通过《[图片上传API](https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter9_0_1.shtml)》接口获取的图片URL地址。 1、商户logo大小需为120像素\\*120像素。 2、支持JPG/JPEG/PNG格式,且图片小于1M。 注:该字段暂不支持修改
  1915. MerchantLogoUrl *string `json:"merchant_logo_url,omitempty"`
  1916. // 不支持商户自定义。若券归属商户号有认证品牌,系统将自动拉取认证品牌号下的品牌名称;若券归属商户号不在认证品牌下,则拉取本商户号的商户简称。展示上限12个字符。 注:该字段暂不支持修改
  1917. MerchantName *string `json:"merchant_name,omitempty"`
  1918. // 券的背景颜色,可设置10种颜色,色值请参考[卡券背景颜色图](https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter9_2_1.shtml#part-01)。颜色取值为颜色图中的颜色名称。
  1919. BackgroundColor *string `json:"background_color,omitempty"`
  1920. // 券详情图片,1074像素(宽)\\*603像素(高),图片大小不超过2M,支持JPG/PNG格式。仅支持通过《[图片上传API](https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter9_0_1.shtml)》接口获取的图片URL地址。
  1921. CouponImageUrl *string `json:"coupon_image_url,omitempty"`
  1922. // 视频号相关信息
  1923. FinderInfo *FinderInfo `json:"finder_info,omitempty"`
  1924. }
  1925. func (o DisplayPatternInfo) MarshalJSON() ([]byte, error) {
  1926. toSerialize := map[string]interface{}{}
  1927. if o.Description != nil {
  1928. toSerialize["description"] = o.Description
  1929. }
  1930. if o.MerchantLogoUrl != nil {
  1931. toSerialize["merchant_logo_url"] = o.MerchantLogoUrl
  1932. }
  1933. if o.MerchantName != nil {
  1934. toSerialize["merchant_name"] = o.MerchantName
  1935. }
  1936. if o.BackgroundColor != nil {
  1937. toSerialize["background_color"] = o.BackgroundColor
  1938. }
  1939. if o.CouponImageUrl != nil {
  1940. toSerialize["coupon_image_url"] = o.CouponImageUrl
  1941. }
  1942. if o.FinderInfo != nil {
  1943. toSerialize["finder_info"] = o.FinderInfo
  1944. }
  1945. return json.Marshal(toSerialize)
  1946. }
  1947. func (o DisplayPatternInfo) String() string {
  1948. var ret string
  1949. if o.Description == nil {
  1950. ret += "Description:<nil>, "
  1951. } else {
  1952. ret += fmt.Sprintf("Description:%v, ", *o.Description)
  1953. }
  1954. if o.MerchantLogoUrl == nil {
  1955. ret += "MerchantLogoUrl:<nil>, "
  1956. } else {
  1957. ret += fmt.Sprintf("MerchantLogoUrl:%v, ", *o.MerchantLogoUrl)
  1958. }
  1959. if o.MerchantName == nil {
  1960. ret += "MerchantName:<nil>, "
  1961. } else {
  1962. ret += fmt.Sprintf("MerchantName:%v, ", *o.MerchantName)
  1963. }
  1964. if o.BackgroundColor == nil {
  1965. ret += "BackgroundColor:<nil>, "
  1966. } else {
  1967. ret += fmt.Sprintf("BackgroundColor:%v, ", *o.BackgroundColor)
  1968. }
  1969. if o.CouponImageUrl == nil {
  1970. ret += "CouponImageUrl:<nil>, "
  1971. } else {
  1972. ret += fmt.Sprintf("CouponImageUrl:%v, ", *o.CouponImageUrl)
  1973. }
  1974. ret += fmt.Sprintf("FinderInfo:%v", o.FinderInfo)
  1975. return fmt.Sprintf("DisplayPatternInfo{%s}", ret)
  1976. }
  1977. func (o DisplayPatternInfo) Clone() *DisplayPatternInfo {
  1978. ret := DisplayPatternInfo{}
  1979. if o.Description != nil {
  1980. ret.Description = new(string)
  1981. *ret.Description = *o.Description
  1982. }
  1983. if o.MerchantLogoUrl != nil {
  1984. ret.MerchantLogoUrl = new(string)
  1985. *ret.MerchantLogoUrl = *o.MerchantLogoUrl
  1986. }
  1987. if o.MerchantName != nil {
  1988. ret.MerchantName = new(string)
  1989. *ret.MerchantName = *o.MerchantName
  1990. }
  1991. if o.BackgroundColor != nil {
  1992. ret.BackgroundColor = new(string)
  1993. *ret.BackgroundColor = *o.BackgroundColor
  1994. }
  1995. if o.CouponImageUrl != nil {
  1996. ret.CouponImageUrl = new(string)
  1997. *ret.CouponImageUrl = *o.CouponImageUrl
  1998. }
  1999. if o.FinderInfo != nil {
  2000. ret.FinderInfo = o.FinderInfo.Clone()
  2001. }
  2002. return &ret
  2003. }
  2004. // ExchangeMsg
  2005. type ExchangeMsg struct {
  2006. // 单品换购价,单位:分。 特殊规则:取值范围 0 ≤ value ≤ 10000000
  2007. ExchangePrice *int64 `json:"exchange_price,omitempty"`
  2008. // 消费门槛,单位:分。 特殊规则:取值范围 1 ≤ value ≤ 10000000
  2009. TransactionMinimum *int64 `json:"transaction_minimum,omitempty"`
  2010. }
  2011. func (o ExchangeMsg) MarshalJSON() ([]byte, error) {
  2012. toSerialize := map[string]interface{}{}
  2013. if o.ExchangePrice != nil {
  2014. toSerialize["exchange_price"] = o.ExchangePrice
  2015. }
  2016. if o.TransactionMinimum != nil {
  2017. toSerialize["transaction_minimum"] = o.TransactionMinimum
  2018. }
  2019. return json.Marshal(toSerialize)
  2020. }
  2021. func (o ExchangeMsg) String() string {
  2022. var ret string
  2023. if o.ExchangePrice == nil {
  2024. ret += "ExchangePrice:<nil>, "
  2025. } else {
  2026. ret += fmt.Sprintf("ExchangePrice:%v, ", *o.ExchangePrice)
  2027. }
  2028. if o.TransactionMinimum == nil {
  2029. ret += "TransactionMinimum:<nil>"
  2030. } else {
  2031. ret += fmt.Sprintf("TransactionMinimum:%v", *o.TransactionMinimum)
  2032. }
  2033. return fmt.Sprintf("ExchangeMsg{%s}", ret)
  2034. }
  2035. func (o ExchangeMsg) Clone() *ExchangeMsg {
  2036. ret := ExchangeMsg{}
  2037. if o.ExchangePrice != nil {
  2038. ret.ExchangePrice = new(int64)
  2039. *ret.ExchangePrice = *o.ExchangePrice
  2040. }
  2041. if o.TransactionMinimum != nil {
  2042. ret.TransactionMinimum = new(int64)
  2043. *ret.TransactionMinimum = *o.TransactionMinimum
  2044. }
  2045. return &ret
  2046. }
  2047. // FavorAvailableTime
  2048. type FavorAvailableTime struct {
  2049. // 批次开始时间,遵循[rfc3339](https://datatracker.ietf.org/doc/html/rfc3339)标准格式,格式为yyyy-MM-DDTHH:mm:ss+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秒。 注意:商家券有效期最长为1年。
  2050. AvailableBeginTime *time.Time `json:"available_begin_time"`
  2051. // 批次结束时间,遵循[rfc3339](https://datatracker.ietf.org/doc/html/rfc3339)标准格式,格式为yyyy-MM-DDTHH:mm:ss+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秒。 注意:商家券有效期最长为1年。
  2052. AvailableEndTime *time.Time `json:"available_end_time"`
  2053. // 日期区间内,券生效后x天内有效。例如生效当天内有效填1,生效后2天内有效填2,以此类推……注意,用户在有效期开始前领取商家券,则从有效期第1天开始计算天数,用户在有效期内领取商家券,则从领取当天开始计算天数,无论用户何时领取商家券,商家券在活动有效期结束后均不可用。可配合wait_days_after_receive一同填写,也可单独填写。单独填写时,有效期内领券后立即生效,生效后x天内有效。
  2054. AvailableDayAfterReceive *int64 `json:"available_day_after_receive,omitempty"`
  2055. // 可以设置多个星期下的多个可用时间段,比如每周二10点到18点
  2056. AvailableWeek *AvailableWeek `json:"available_week,omitempty"`
  2057. // 无规律的有效时间,多个无规律时间段
  2058. IrregularyAvaliableTime []IrregularAvailableTime `json:"irregulary_avaliable_time,omitempty"`
  2059. // 日期区间内,用户领券后需等待x天开始生效。例如领券后当天开始生效则无需填写,领券后第2天开始生效填1,以此类推……用户在有效期开始前领取商家券,则从有效期第1天开始计算天数,用户在有效期内领取商家券,则从领取当天开始计算天数。无论用户何时领取商家券,商家券在活动有效期结束后均不可用。需配合available_day_after_receive一同填写,不可单独填写。注:最大不能超过30天
  2060. WaitDaysAfterReceive *int64 `json:"wait_days_after_receive,omitempty"`
  2061. }
  2062. func (o FavorAvailableTime) MarshalJSON() ([]byte, error) {
  2063. toSerialize := map[string]interface{}{}
  2064. if o.AvailableBeginTime == nil {
  2065. return nil, fmt.Errorf("field `AvailableBeginTime` is required and must be specified in FavorAvailableTime")
  2066. }
  2067. toSerialize["available_begin_time"] = o.AvailableBeginTime.Format(time.RFC3339)
  2068. if o.AvailableEndTime == nil {
  2069. return nil, fmt.Errorf("field `AvailableEndTime` is required and must be specified in FavorAvailableTime")
  2070. }
  2071. toSerialize["available_end_time"] = o.AvailableEndTime.Format(time.RFC3339)
  2072. if o.AvailableDayAfterReceive != nil {
  2073. toSerialize["available_day_after_receive"] = o.AvailableDayAfterReceive
  2074. }
  2075. if o.AvailableWeek != nil {
  2076. toSerialize["available_week"] = o.AvailableWeek
  2077. }
  2078. if o.IrregularyAvaliableTime != nil {
  2079. toSerialize["irregulary_avaliable_time"] = o.IrregularyAvaliableTime
  2080. }
  2081. if o.WaitDaysAfterReceive != nil {
  2082. toSerialize["wait_days_after_receive"] = o.WaitDaysAfterReceive
  2083. }
  2084. return json.Marshal(toSerialize)
  2085. }
  2086. func (o FavorAvailableTime) String() string {
  2087. var ret string
  2088. if o.AvailableBeginTime == nil {
  2089. ret += "AvailableBeginTime:<nil>, "
  2090. } else {
  2091. ret += fmt.Sprintf("AvailableBeginTime:%v, ", *o.AvailableBeginTime)
  2092. }
  2093. if o.AvailableEndTime == nil {
  2094. ret += "AvailableEndTime:<nil>, "
  2095. } else {
  2096. ret += fmt.Sprintf("AvailableEndTime:%v, ", *o.AvailableEndTime)
  2097. }
  2098. if o.AvailableDayAfterReceive == nil {
  2099. ret += "AvailableDayAfterReceive:<nil>, "
  2100. } else {
  2101. ret += fmt.Sprintf("AvailableDayAfterReceive:%v, ", *o.AvailableDayAfterReceive)
  2102. }
  2103. ret += fmt.Sprintf("AvailableWeek:%v, ", o.AvailableWeek)
  2104. ret += fmt.Sprintf("IrregularyAvaliableTime:%v, ", o.IrregularyAvaliableTime)
  2105. if o.WaitDaysAfterReceive == nil {
  2106. ret += "WaitDaysAfterReceive:<nil>"
  2107. } else {
  2108. ret += fmt.Sprintf("WaitDaysAfterReceive:%v", *o.WaitDaysAfterReceive)
  2109. }
  2110. return fmt.Sprintf("FavorAvailableTime{%s}", ret)
  2111. }
  2112. func (o FavorAvailableTime) Clone() *FavorAvailableTime {
  2113. ret := FavorAvailableTime{}
  2114. if o.AvailableBeginTime != nil {
  2115. ret.AvailableBeginTime = new(time.Time)
  2116. *ret.AvailableBeginTime = *o.AvailableBeginTime
  2117. }
  2118. if o.AvailableEndTime != nil {
  2119. ret.AvailableEndTime = new(time.Time)
  2120. *ret.AvailableEndTime = *o.AvailableEndTime
  2121. }
  2122. if o.AvailableDayAfterReceive != nil {
  2123. ret.AvailableDayAfterReceive = new(int64)
  2124. *ret.AvailableDayAfterReceive = *o.AvailableDayAfterReceive
  2125. }
  2126. if o.AvailableWeek != nil {
  2127. ret.AvailableWeek = o.AvailableWeek.Clone()
  2128. }
  2129. if o.IrregularyAvaliableTime != nil {
  2130. ret.IrregularyAvaliableTime = make([]IrregularAvailableTime, len(o.IrregularyAvaliableTime))
  2131. for i, item := range o.IrregularyAvaliableTime {
  2132. ret.IrregularyAvaliableTime[i] = *item.Clone()
  2133. }
  2134. }
  2135. if o.WaitDaysAfterReceive != nil {
  2136. ret.WaitDaysAfterReceive = new(int64)
  2137. *ret.WaitDaysAfterReceive = *o.WaitDaysAfterReceive
  2138. }
  2139. return &ret
  2140. }
  2141. // FinderInfo
  2142. type FinderInfo struct {
  2143. // 关联视频号将展示在优惠券详情的顶部右侧,作为跳转去视频号的入口,入参参数请配置视频号id,请前往[视频号助手](https://channels.weixin.qq.com)管理查看视频号ID
  2144. FinderId *string `json:"finder_id,omitempty"`
  2145. // 券详情视频内容,支持配置关联视频号下的具体视频内容,入参参数请配置视频id,请前往[视频号助手](https://channels.weixin.qq.com)管理后台复制具体视频ID
  2146. FinderVideoId *string `json:"finder_video_id,omitempty"`
  2147. // 截取的视频号图片将在券到期提醒消息、券详情中展示。 1.图片尺寸:716像素(宽)\\*402像素(高);图片大小不超过2M,支持JPG/PNG格式。 2.仅支持通过《[图片上传API](https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter9_0_1.shtml)》接口获取的图片URL地址。
  2148. FinderVideoCoverImageUrl *string `json:"finder_video_cover_image_url,omitempty"`
  2149. }
  2150. func (o FinderInfo) MarshalJSON() ([]byte, error) {
  2151. toSerialize := map[string]interface{}{}
  2152. if o.FinderId != nil {
  2153. toSerialize["finder_id"] = o.FinderId
  2154. }
  2155. if o.FinderVideoId != nil {
  2156. toSerialize["finder_video_id"] = o.FinderVideoId
  2157. }
  2158. if o.FinderVideoCoverImageUrl != nil {
  2159. toSerialize["finder_video_cover_image_url"] = o.FinderVideoCoverImageUrl
  2160. }
  2161. return json.Marshal(toSerialize)
  2162. }
  2163. func (o FinderInfo) String() string {
  2164. var ret string
  2165. if o.FinderId == nil {
  2166. ret += "FinderId:<nil>, "
  2167. } else {
  2168. ret += fmt.Sprintf("FinderId:%v, ", *o.FinderId)
  2169. }
  2170. if o.FinderVideoId == nil {
  2171. ret += "FinderVideoId:<nil>, "
  2172. } else {
  2173. ret += fmt.Sprintf("FinderVideoId:%v, ", *o.FinderVideoId)
  2174. }
  2175. if o.FinderVideoCoverImageUrl == nil {
  2176. ret += "FinderVideoCoverImageUrl:<nil>"
  2177. } else {
  2178. ret += fmt.Sprintf("FinderVideoCoverImageUrl:%v", *o.FinderVideoCoverImageUrl)
  2179. }
  2180. return fmt.Sprintf("FinderInfo{%s}", ret)
  2181. }
  2182. func (o FinderInfo) Clone() *FinderInfo {
  2183. ret := FinderInfo{}
  2184. if o.FinderId != nil {
  2185. ret.FinderId = new(string)
  2186. *ret.FinderId = *o.FinderId
  2187. }
  2188. if o.FinderVideoId != nil {
  2189. ret.FinderVideoId = new(string)
  2190. *ret.FinderVideoId = *o.FinderVideoId
  2191. }
  2192. if o.FinderVideoCoverImageUrl != nil {
  2193. ret.FinderVideoCoverImageUrl = new(string)
  2194. *ret.FinderVideoCoverImageUrl = *o.FinderVideoCoverImageUrl
  2195. }
  2196. return &ret
  2197. }
  2198. // FixedValueStockMsg
  2199. type FixedValueStockMsg struct {
  2200. // 优惠金额 单位分。 特殊规则:取值范围 1 ≤ value ≤ 10000000
  2201. DiscountAmount *int64 `json:"discount_amount,omitempty"`
  2202. // 消费门槛,单位:分。 特殊规则:取值范围 1 ≤ value ≤ 10000000
  2203. TransactionMinimum *int64 `json:"transaction_minimum,omitempty"`
  2204. }
  2205. func (o FixedValueStockMsg) MarshalJSON() ([]byte, error) {
  2206. toSerialize := map[string]interface{}{}
  2207. if o.DiscountAmount != nil {
  2208. toSerialize["discount_amount"] = o.DiscountAmount
  2209. }
  2210. if o.TransactionMinimum != nil {
  2211. toSerialize["transaction_minimum"] = o.TransactionMinimum
  2212. }
  2213. return json.Marshal(toSerialize)
  2214. }
  2215. func (o FixedValueStockMsg) String() string {
  2216. var ret string
  2217. if o.DiscountAmount == nil {
  2218. ret += "DiscountAmount:<nil>, "
  2219. } else {
  2220. ret += fmt.Sprintf("DiscountAmount:%v, ", *o.DiscountAmount)
  2221. }
  2222. if o.TransactionMinimum == nil {
  2223. ret += "TransactionMinimum:<nil>"
  2224. } else {
  2225. ret += fmt.Sprintf("TransactionMinimum:%v", *o.TransactionMinimum)
  2226. }
  2227. return fmt.Sprintf("FixedValueStockMsg{%s}", ret)
  2228. }
  2229. func (o FixedValueStockMsg) Clone() *FixedValueStockMsg {
  2230. ret := FixedValueStockMsg{}
  2231. if o.DiscountAmount != nil {
  2232. ret.DiscountAmount = new(int64)
  2233. *ret.DiscountAmount = *o.DiscountAmount
  2234. }
  2235. if o.TransactionMinimum != nil {
  2236. ret.TransactionMinimum = new(int64)
  2237. *ret.TransactionMinimum = *o.TransactionMinimum
  2238. }
  2239. return &ret
  2240. }
  2241. // GetCouponNotifyRequest
  2242. type GetCouponNotifyRequest struct {
  2243. // 商户号,不填默认查询调用方商户号
  2244. Mchid *string `json:"mchid,omitempty"`
  2245. }
  2246. func (o GetCouponNotifyRequest) MarshalJSON() ([]byte, error) {
  2247. toSerialize := map[string]interface{}{}
  2248. if o.Mchid != nil {
  2249. toSerialize["mchid"] = o.Mchid
  2250. }
  2251. return json.Marshal(toSerialize)
  2252. }
  2253. func (o GetCouponNotifyRequest) String() string {
  2254. var ret string
  2255. if o.Mchid == nil {
  2256. ret += "Mchid:<nil>"
  2257. } else {
  2258. ret += fmt.Sprintf("Mchid:%v", *o.Mchid)
  2259. }
  2260. return fmt.Sprintf("GetCouponNotifyRequest{%s}", ret)
  2261. }
  2262. func (o GetCouponNotifyRequest) Clone() *GetCouponNotifyRequest {
  2263. ret := GetCouponNotifyRequest{}
  2264. if o.Mchid != nil {
  2265. ret.Mchid = new(string)
  2266. *ret.Mchid = *o.Mchid
  2267. }
  2268. return &ret
  2269. }
  2270. // GetCouponNotifyResponse
  2271. type GetCouponNotifyResponse struct {
  2272. // 商户号
  2273. Mchid *string `json:"mchid"`
  2274. // 商户提供的用于接收商家券事件通知的URL地址,必须支持HTTPS。
  2275. NotifyUrl *string `json:"notify_url"`
  2276. }
  2277. func (o GetCouponNotifyResponse) MarshalJSON() ([]byte, error) {
  2278. toSerialize := map[string]interface{}{}
  2279. if o.Mchid == nil {
  2280. return nil, fmt.Errorf("field `Mchid` is required and must be specified in GetCouponNotifyResponse")
  2281. }
  2282. toSerialize["mchid"] = o.Mchid
  2283. if o.NotifyUrl == nil {
  2284. return nil, fmt.Errorf("field `NotifyUrl` is required and must be specified in GetCouponNotifyResponse")
  2285. }
  2286. toSerialize["notify_url"] = o.NotifyUrl
  2287. return json.Marshal(toSerialize)
  2288. }
  2289. func (o GetCouponNotifyResponse) String() string {
  2290. var ret string
  2291. if o.Mchid == nil {
  2292. ret += "Mchid:<nil>, "
  2293. } else {
  2294. ret += fmt.Sprintf("Mchid:%v, ", *o.Mchid)
  2295. }
  2296. if o.NotifyUrl == nil {
  2297. ret += "NotifyUrl:<nil>"
  2298. } else {
  2299. ret += fmt.Sprintf("NotifyUrl:%v", *o.NotifyUrl)
  2300. }
  2301. return fmt.Sprintf("GetCouponNotifyResponse{%s}", ret)
  2302. }
  2303. func (o GetCouponNotifyResponse) Clone() *GetCouponNotifyResponse {
  2304. ret := GetCouponNotifyResponse{}
  2305. if o.Mchid != nil {
  2306. ret.Mchid = new(string)
  2307. *ret.Mchid = *o.Mchid
  2308. }
  2309. if o.NotifyUrl != nil {
  2310. ret.NotifyUrl = new(string)
  2311. *ret.NotifyUrl = *o.NotifyUrl
  2312. }
  2313. return &ret
  2314. }
  2315. // IrregularAvailableTime
  2316. type IrregularAvailableTime struct {
  2317. // 开始时间,遵循[rfc3339](https://datatracker.ietf.org/doc/html/rfc3339)标准格式,格式为yyyy-MM-DDTHH:mm:ss+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秒。
  2318. BeginTime *time.Time `json:"begin_time,omitempty"`
  2319. // 结束时间,遵循[rfc3339](https://datatracker.ietf.org/doc/html/rfc3339)标准格式,格式为yyyy-MM-DDTHH:mm:ss+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秒。
  2320. EndTime *time.Time `json:"end_time,omitempty"`
  2321. }
  2322. func (o IrregularAvailableTime) MarshalJSON() ([]byte, error) {
  2323. toSerialize := map[string]interface{}{}
  2324. if o.BeginTime != nil {
  2325. toSerialize["begin_time"] = o.BeginTime.Format(time.RFC3339)
  2326. }
  2327. if o.EndTime != nil {
  2328. toSerialize["end_time"] = o.EndTime.Format(time.RFC3339)
  2329. }
  2330. return json.Marshal(toSerialize)
  2331. }
  2332. func (o IrregularAvailableTime) String() string {
  2333. var ret string
  2334. if o.BeginTime == nil {
  2335. ret += "BeginTime:<nil>, "
  2336. } else {
  2337. ret += fmt.Sprintf("BeginTime:%v, ", *o.BeginTime)
  2338. }
  2339. if o.EndTime == nil {
  2340. ret += "EndTime:<nil>"
  2341. } else {
  2342. ret += fmt.Sprintf("EndTime:%v", *o.EndTime)
  2343. }
  2344. return fmt.Sprintf("IrregularAvailableTime{%s}", ret)
  2345. }
  2346. func (o IrregularAvailableTime) Clone() *IrregularAvailableTime {
  2347. ret := IrregularAvailableTime{}
  2348. if o.BeginTime != nil {
  2349. ret.BeginTime = new(time.Time)
  2350. *ret.BeginTime = *o.BeginTime
  2351. }
  2352. if o.EndTime != nil {
  2353. ret.EndTime = new(time.Time)
  2354. *ret.EndTime = *o.EndTime
  2355. }
  2356. return &ret
  2357. }
  2358. // ListCouponsByFilterRequest
  2359. type ListCouponsByFilterRequest struct {
  2360. // Openid信息,用户在AppID下的唯一标识。 校验规则:传入的OpenID得是调用方商户号(即请求头里面的商户号)有绑定关系的AppID获取的OpenID或传入的OpenID得是归属商户号有绑定关系的AppID获取的OpenID。[获取OpenID文档](https://pay.weixin.qq.com/wiki/doc/apiv3/terms_definition/chapter1_1_3.shtml#part-3)
  2361. Openid *string `json:"openid"`
  2362. // 支持传入与当前调用接口商户号有绑定关系的AppID。支持小程序AppID与公众号AppID。 校验规则:传入的AppID得是与调用方商户号(即请求头里面的商户号)有绑定关系的AppID 或 传入的AppID得是归属商户号有绑定关系的AppID
  2363. Appid *string `json:"appid"`
  2364. // 批次号,是否指定批次号查询
  2365. StockId *string `json:"stock_id,omitempty"`
  2366. // 批次创建方商户号 校验规则:当调用方商户号(即请求头中的商户号)为创建批次方商户号时,该参数必传
  2367. CreatorMerchant *string `json:"creator_merchant,omitempty"`
  2368. // 批次归属商户号 校验规则:当调用方商户号(即请求头中的商户号)为批次归属商户号时,该参数必传
  2369. BelongMerchant *string `json:"belong_merchant,omitempty"`
  2370. // 批次发放商户号 校验规则:当调用方商户号(即请求头中的商户号)为批次发放商户号时,该参数必传;委托营销关系下,请填写委托发券的商户号
  2371. SenderMerchant *string `json:"sender_merchant,omitempty"`
  2372. // 分页页码
  2373. Offset *int64 `json:"offset,omitempty"`
  2374. // 分页大小
  2375. Limit *int64 `json:"limit,omitempty"`
  2376. // 商家券状态
  2377. CouponState *CouponStatus `json:"coupon_state,omitempty"`
  2378. }
  2379. func (o ListCouponsByFilterRequest) MarshalJSON() ([]byte, error) {
  2380. toSerialize := map[string]interface{}{}
  2381. if o.Openid == nil {
  2382. return nil, fmt.Errorf("field `Openid` is required and must be specified in ListCouponsByFilterRequest")
  2383. }
  2384. toSerialize["openid"] = o.Openid
  2385. if o.Appid == nil {
  2386. return nil, fmt.Errorf("field `Appid` is required and must be specified in ListCouponsByFilterRequest")
  2387. }
  2388. toSerialize["appid"] = o.Appid
  2389. if o.StockId != nil {
  2390. toSerialize["stock_id"] = o.StockId
  2391. }
  2392. if o.CreatorMerchant != nil {
  2393. toSerialize["creator_merchant"] = o.CreatorMerchant
  2394. }
  2395. if o.BelongMerchant != nil {
  2396. toSerialize["belong_merchant"] = o.BelongMerchant
  2397. }
  2398. if o.SenderMerchant != nil {
  2399. toSerialize["sender_merchant"] = o.SenderMerchant
  2400. }
  2401. if o.Offset != nil {
  2402. toSerialize["offset"] = o.Offset
  2403. }
  2404. if o.Limit != nil {
  2405. toSerialize["limit"] = o.Limit
  2406. }
  2407. if o.CouponState != nil {
  2408. toSerialize["coupon_state"] = o.CouponState
  2409. }
  2410. return json.Marshal(toSerialize)
  2411. }
  2412. func (o ListCouponsByFilterRequest) String() string {
  2413. var ret string
  2414. if o.Openid == nil {
  2415. ret += "Openid:<nil>, "
  2416. } else {
  2417. ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
  2418. }
  2419. if o.Appid == nil {
  2420. ret += "Appid:<nil>, "
  2421. } else {
  2422. ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
  2423. }
  2424. if o.StockId == nil {
  2425. ret += "StockId:<nil>, "
  2426. } else {
  2427. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  2428. }
  2429. if o.CreatorMerchant == nil {
  2430. ret += "CreatorMerchant:<nil>, "
  2431. } else {
  2432. ret += fmt.Sprintf("CreatorMerchant:%v, ", *o.CreatorMerchant)
  2433. }
  2434. if o.BelongMerchant == nil {
  2435. ret += "BelongMerchant:<nil>, "
  2436. } else {
  2437. ret += fmt.Sprintf("BelongMerchant:%v, ", *o.BelongMerchant)
  2438. }
  2439. if o.SenderMerchant == nil {
  2440. ret += "SenderMerchant:<nil>, "
  2441. } else {
  2442. ret += fmt.Sprintf("SenderMerchant:%v, ", *o.SenderMerchant)
  2443. }
  2444. if o.Offset == nil {
  2445. ret += "Offset:<nil>, "
  2446. } else {
  2447. ret += fmt.Sprintf("Offset:%v, ", *o.Offset)
  2448. }
  2449. if o.Limit == nil {
  2450. ret += "Limit:<nil>, "
  2451. } else {
  2452. ret += fmt.Sprintf("Limit:%v, ", *o.Limit)
  2453. }
  2454. if o.CouponState == nil {
  2455. ret += "CouponState:<nil>"
  2456. } else {
  2457. ret += fmt.Sprintf("CouponState:%v", *o.CouponState)
  2458. }
  2459. return fmt.Sprintf("ListCouponsByFilterRequest{%s}", ret)
  2460. }
  2461. func (o ListCouponsByFilterRequest) Clone() *ListCouponsByFilterRequest {
  2462. ret := ListCouponsByFilterRequest{}
  2463. if o.Openid != nil {
  2464. ret.Openid = new(string)
  2465. *ret.Openid = *o.Openid
  2466. }
  2467. if o.Appid != nil {
  2468. ret.Appid = new(string)
  2469. *ret.Appid = *o.Appid
  2470. }
  2471. if o.StockId != nil {
  2472. ret.StockId = new(string)
  2473. *ret.StockId = *o.StockId
  2474. }
  2475. if o.CreatorMerchant != nil {
  2476. ret.CreatorMerchant = new(string)
  2477. *ret.CreatorMerchant = *o.CreatorMerchant
  2478. }
  2479. if o.BelongMerchant != nil {
  2480. ret.BelongMerchant = new(string)
  2481. *ret.BelongMerchant = *o.BelongMerchant
  2482. }
  2483. if o.SenderMerchant != nil {
  2484. ret.SenderMerchant = new(string)
  2485. *ret.SenderMerchant = *o.SenderMerchant
  2486. }
  2487. if o.Offset != nil {
  2488. ret.Offset = new(int64)
  2489. *ret.Offset = *o.Offset
  2490. }
  2491. if o.Limit != nil {
  2492. ret.Limit = new(int64)
  2493. *ret.Limit = *o.Limit
  2494. }
  2495. if o.CouponState != nil {
  2496. ret.CouponState = new(CouponStatus)
  2497. *ret.CouponState = *o.CouponState
  2498. }
  2499. return &ret
  2500. }
  2501. // MiniAppInfo
  2502. type MiniAppInfo struct {
  2503. // 商家小程序AppID要与归属商户号有M-A or M-m-suba关系。 校验规则:传入的AppID得是与调用方商户号(即请求头里面的商户号)有绑定关系的AppID 或 传入的AppID得是归属商户号有绑定关系的AppID
  2504. MiniProgramsAppid *string `json:"mini_programs_appid"`
  2505. // 商家小程序path
  2506. MiniProgramsPath *string `json:"mini_programs_path"`
  2507. // 入口文案,字数上限为5个,一个中文汉字/英文字母/数字均占用一个字数。
  2508. EntranceWords *string `json:"entrance_words"`
  2509. // 小程序入口引导文案,用户自定义字段。字数上限为6个,一个中文汉字/英文字母/数字均占用一个字数。
  2510. GuidingWords *string `json:"guiding_words,omitempty"`
  2511. }
  2512. func (o MiniAppInfo) MarshalJSON() ([]byte, error) {
  2513. toSerialize := map[string]interface{}{}
  2514. if o.MiniProgramsAppid == nil {
  2515. return nil, fmt.Errorf("field `MiniProgramsAppid` is required and must be specified in MiniAppInfo")
  2516. }
  2517. toSerialize["mini_programs_appid"] = o.MiniProgramsAppid
  2518. if o.MiniProgramsPath == nil {
  2519. return nil, fmt.Errorf("field `MiniProgramsPath` is required and must be specified in MiniAppInfo")
  2520. }
  2521. toSerialize["mini_programs_path"] = o.MiniProgramsPath
  2522. if o.EntranceWords == nil {
  2523. return nil, fmt.Errorf("field `EntranceWords` is required and must be specified in MiniAppInfo")
  2524. }
  2525. toSerialize["entrance_words"] = o.EntranceWords
  2526. if o.GuidingWords != nil {
  2527. toSerialize["guiding_words"] = o.GuidingWords
  2528. }
  2529. return json.Marshal(toSerialize)
  2530. }
  2531. func (o MiniAppInfo) String() string {
  2532. var ret string
  2533. if o.MiniProgramsAppid == nil {
  2534. ret += "MiniProgramsAppid:<nil>, "
  2535. } else {
  2536. ret += fmt.Sprintf("MiniProgramsAppid:%v, ", *o.MiniProgramsAppid)
  2537. }
  2538. if o.MiniProgramsPath == nil {
  2539. ret += "MiniProgramsPath:<nil>, "
  2540. } else {
  2541. ret += fmt.Sprintf("MiniProgramsPath:%v, ", *o.MiniProgramsPath)
  2542. }
  2543. if o.EntranceWords == nil {
  2544. ret += "EntranceWords:<nil>, "
  2545. } else {
  2546. ret += fmt.Sprintf("EntranceWords:%v, ", *o.EntranceWords)
  2547. }
  2548. if o.GuidingWords == nil {
  2549. ret += "GuidingWords:<nil>"
  2550. } else {
  2551. ret += fmt.Sprintf("GuidingWords:%v", *o.GuidingWords)
  2552. }
  2553. return fmt.Sprintf("MiniAppInfo{%s}", ret)
  2554. }
  2555. func (o MiniAppInfo) Clone() *MiniAppInfo {
  2556. ret := MiniAppInfo{}
  2557. if o.MiniProgramsAppid != nil {
  2558. ret.MiniProgramsAppid = new(string)
  2559. *ret.MiniProgramsAppid = *o.MiniProgramsAppid
  2560. }
  2561. if o.MiniProgramsPath != nil {
  2562. ret.MiniProgramsPath = new(string)
  2563. *ret.MiniProgramsPath = *o.MiniProgramsPath
  2564. }
  2565. if o.EntranceWords != nil {
  2566. ret.EntranceWords = new(string)
  2567. *ret.EntranceWords = *o.EntranceWords
  2568. }
  2569. if o.GuidingWords != nil {
  2570. ret.GuidingWords = new(string)
  2571. *ret.GuidingWords = *o.GuidingWords
  2572. }
  2573. return &ret
  2574. }
  2575. // ModifyBudgetBody
  2576. type ModifyBudgetBody struct {
  2577. // 批次最大发放个数,target\\_max\\_coupons与target\\_max\\_coupons\\_by\\_day只能修改一个 注:目标批次即修改后的批次
  2578. TargetMaxCoupons *int64 `json:"target_max_coupons,omitempty"`
  2579. // 当前批次最大发放个数,当传入target\\_max\\_coupons大于0时,current\\_max\\_coupons必传 注:当前批次即未修改的批次
  2580. CurrentMaxCoupons *int64 `json:"current_max_coupons,omitempty"`
  2581. // 单天发放上限个数,target\\_max\\_coupons与target\\_max\\_coupons\\_by\\_day只能修改一个 注:目标批次即修改后的批次
  2582. TargetMaxCouponsByDay *int64 `json:"target_max_coupons_by_day,omitempty"`
  2583. // 当前单天发放上限个数 ,当传入target\\_max\\_coupons\\_by\\_day大于0时,current\\_max\\_coupons\\_by\\_day必填 注:当前批次即未修改的批次
  2584. CurrentMaxCouponsByDay *int64 `json:"current_max_coupons_by_day,omitempty"`
  2585. // 修改预算请求单据号
  2586. ModifyBudgetRequestNo *string `json:"modify_budget_request_no"`
  2587. }
  2588. func (o ModifyBudgetBody) MarshalJSON() ([]byte, error) {
  2589. toSerialize := map[string]interface{}{}
  2590. if o.TargetMaxCoupons != nil {
  2591. toSerialize["target_max_coupons"] = o.TargetMaxCoupons
  2592. }
  2593. if o.CurrentMaxCoupons != nil {
  2594. toSerialize["current_max_coupons"] = o.CurrentMaxCoupons
  2595. }
  2596. if o.TargetMaxCouponsByDay != nil {
  2597. toSerialize["target_max_coupons_by_day"] = o.TargetMaxCouponsByDay
  2598. }
  2599. if o.CurrentMaxCouponsByDay != nil {
  2600. toSerialize["current_max_coupons_by_day"] = o.CurrentMaxCouponsByDay
  2601. }
  2602. if o.ModifyBudgetRequestNo == nil {
  2603. return nil, fmt.Errorf("field `ModifyBudgetRequestNo` is required and must be specified in ModifyBudgetBody")
  2604. }
  2605. toSerialize["modify_budget_request_no"] = o.ModifyBudgetRequestNo
  2606. return json.Marshal(toSerialize)
  2607. }
  2608. func (o ModifyBudgetBody) String() string {
  2609. var ret string
  2610. if o.TargetMaxCoupons == nil {
  2611. ret += "TargetMaxCoupons:<nil>, "
  2612. } else {
  2613. ret += fmt.Sprintf("TargetMaxCoupons:%v, ", *o.TargetMaxCoupons)
  2614. }
  2615. if o.CurrentMaxCoupons == nil {
  2616. ret += "CurrentMaxCoupons:<nil>, "
  2617. } else {
  2618. ret += fmt.Sprintf("CurrentMaxCoupons:%v, ", *o.CurrentMaxCoupons)
  2619. }
  2620. if o.TargetMaxCouponsByDay == nil {
  2621. ret += "TargetMaxCouponsByDay:<nil>, "
  2622. } else {
  2623. ret += fmt.Sprintf("TargetMaxCouponsByDay:%v, ", *o.TargetMaxCouponsByDay)
  2624. }
  2625. if o.CurrentMaxCouponsByDay == nil {
  2626. ret += "CurrentMaxCouponsByDay:<nil>, "
  2627. } else {
  2628. ret += fmt.Sprintf("CurrentMaxCouponsByDay:%v, ", *o.CurrentMaxCouponsByDay)
  2629. }
  2630. if o.ModifyBudgetRequestNo == nil {
  2631. ret += "ModifyBudgetRequestNo:<nil>"
  2632. } else {
  2633. ret += fmt.Sprintf("ModifyBudgetRequestNo:%v", *o.ModifyBudgetRequestNo)
  2634. }
  2635. return fmt.Sprintf("ModifyBudgetBody{%s}", ret)
  2636. }
  2637. func (o ModifyBudgetBody) Clone() *ModifyBudgetBody {
  2638. ret := ModifyBudgetBody{}
  2639. if o.TargetMaxCoupons != nil {
  2640. ret.TargetMaxCoupons = new(int64)
  2641. *ret.TargetMaxCoupons = *o.TargetMaxCoupons
  2642. }
  2643. if o.CurrentMaxCoupons != nil {
  2644. ret.CurrentMaxCoupons = new(int64)
  2645. *ret.CurrentMaxCoupons = *o.CurrentMaxCoupons
  2646. }
  2647. if o.TargetMaxCouponsByDay != nil {
  2648. ret.TargetMaxCouponsByDay = new(int64)
  2649. *ret.TargetMaxCouponsByDay = *o.TargetMaxCouponsByDay
  2650. }
  2651. if o.CurrentMaxCouponsByDay != nil {
  2652. ret.CurrentMaxCouponsByDay = new(int64)
  2653. *ret.CurrentMaxCouponsByDay = *o.CurrentMaxCouponsByDay
  2654. }
  2655. if o.ModifyBudgetRequestNo != nil {
  2656. ret.ModifyBudgetRequestNo = new(string)
  2657. *ret.ModifyBudgetRequestNo = *o.ModifyBudgetRequestNo
  2658. }
  2659. return &ret
  2660. }
  2661. // ModifyBudgetRequest
  2662. type ModifyBudgetRequest struct {
  2663. // 批次号
  2664. StockId *string `json:"stock_id"`
  2665. // 批次最大发放个数,target\\_max\\_coupons与target\\_max\\_coupons\\_by\\_day只能修改一个 注:目标批次即修改后的批次
  2666. TargetMaxCoupons *int64 `json:"target_max_coupons,omitempty"`
  2667. // 当前批次最大发放个数,当传入target\\_max\\_coupons大于0时,current\\_max\\_coupons必传 注:当前批次即未修改的批次
  2668. CurrentMaxCoupons *int64 `json:"current_max_coupons,omitempty"`
  2669. // 单天发放上限个数,target\\_max\\_coupons与target\\_max\\_coupons\\_by\\_day只能修改一个 注:目标批次即修改后的批次
  2670. TargetMaxCouponsByDay *int64 `json:"target_max_coupons_by_day,omitempty"`
  2671. // 当前单天发放上限个数 ,当传入target\\_max\\_coupons\\_by\\_day大于0时,current\\_max\\_coupons\\_by\\_day必填 注:当前批次即未修改的批次
  2672. CurrentMaxCouponsByDay *int64 `json:"current_max_coupons_by_day,omitempty"`
  2673. // 修改预算请求单据号
  2674. ModifyBudgetRequestNo *string `json:"modify_budget_request_no"`
  2675. }
  2676. func (o ModifyBudgetRequest) MarshalJSON() ([]byte, error) {
  2677. toSerialize := map[string]interface{}{}
  2678. if o.StockId == nil {
  2679. return nil, fmt.Errorf("field `StockId` is required and must be specified in ModifyBudgetRequest")
  2680. }
  2681. toSerialize["stock_id"] = o.StockId
  2682. if o.TargetMaxCoupons != nil {
  2683. toSerialize["target_max_coupons"] = o.TargetMaxCoupons
  2684. }
  2685. if o.CurrentMaxCoupons != nil {
  2686. toSerialize["current_max_coupons"] = o.CurrentMaxCoupons
  2687. }
  2688. if o.TargetMaxCouponsByDay != nil {
  2689. toSerialize["target_max_coupons_by_day"] = o.TargetMaxCouponsByDay
  2690. }
  2691. if o.CurrentMaxCouponsByDay != nil {
  2692. toSerialize["current_max_coupons_by_day"] = o.CurrentMaxCouponsByDay
  2693. }
  2694. if o.ModifyBudgetRequestNo == nil {
  2695. return nil, fmt.Errorf("field `ModifyBudgetRequestNo` is required and must be specified in ModifyBudgetRequest")
  2696. }
  2697. toSerialize["modify_budget_request_no"] = o.ModifyBudgetRequestNo
  2698. return json.Marshal(toSerialize)
  2699. }
  2700. func (o ModifyBudgetRequest) String() string {
  2701. var ret string
  2702. if o.StockId == nil {
  2703. ret += "StockId:<nil>, "
  2704. } else {
  2705. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  2706. }
  2707. if o.TargetMaxCoupons == nil {
  2708. ret += "TargetMaxCoupons:<nil>, "
  2709. } else {
  2710. ret += fmt.Sprintf("TargetMaxCoupons:%v, ", *o.TargetMaxCoupons)
  2711. }
  2712. if o.CurrentMaxCoupons == nil {
  2713. ret += "CurrentMaxCoupons:<nil>, "
  2714. } else {
  2715. ret += fmt.Sprintf("CurrentMaxCoupons:%v, ", *o.CurrentMaxCoupons)
  2716. }
  2717. if o.TargetMaxCouponsByDay == nil {
  2718. ret += "TargetMaxCouponsByDay:<nil>, "
  2719. } else {
  2720. ret += fmt.Sprintf("TargetMaxCouponsByDay:%v, ", *o.TargetMaxCouponsByDay)
  2721. }
  2722. if o.CurrentMaxCouponsByDay == nil {
  2723. ret += "CurrentMaxCouponsByDay:<nil>, "
  2724. } else {
  2725. ret += fmt.Sprintf("CurrentMaxCouponsByDay:%v, ", *o.CurrentMaxCouponsByDay)
  2726. }
  2727. if o.ModifyBudgetRequestNo == nil {
  2728. ret += "ModifyBudgetRequestNo:<nil>"
  2729. } else {
  2730. ret += fmt.Sprintf("ModifyBudgetRequestNo:%v", *o.ModifyBudgetRequestNo)
  2731. }
  2732. return fmt.Sprintf("ModifyBudgetRequest{%s}", ret)
  2733. }
  2734. func (o ModifyBudgetRequest) Clone() *ModifyBudgetRequest {
  2735. ret := ModifyBudgetRequest{}
  2736. if o.StockId != nil {
  2737. ret.StockId = new(string)
  2738. *ret.StockId = *o.StockId
  2739. }
  2740. if o.TargetMaxCoupons != nil {
  2741. ret.TargetMaxCoupons = new(int64)
  2742. *ret.TargetMaxCoupons = *o.TargetMaxCoupons
  2743. }
  2744. if o.CurrentMaxCoupons != nil {
  2745. ret.CurrentMaxCoupons = new(int64)
  2746. *ret.CurrentMaxCoupons = *o.CurrentMaxCoupons
  2747. }
  2748. if o.TargetMaxCouponsByDay != nil {
  2749. ret.TargetMaxCouponsByDay = new(int64)
  2750. *ret.TargetMaxCouponsByDay = *o.TargetMaxCouponsByDay
  2751. }
  2752. if o.CurrentMaxCouponsByDay != nil {
  2753. ret.CurrentMaxCouponsByDay = new(int64)
  2754. *ret.CurrentMaxCouponsByDay = *o.CurrentMaxCouponsByDay
  2755. }
  2756. if o.ModifyBudgetRequestNo != nil {
  2757. ret.ModifyBudgetRequestNo = new(string)
  2758. *ret.ModifyBudgetRequestNo = *o.ModifyBudgetRequestNo
  2759. }
  2760. return &ret
  2761. }
  2762. // ModifyBudgetResponse
  2763. type ModifyBudgetResponse struct {
  2764. // 批次最大发放个数
  2765. MaxCoupons *int64 `json:"max_coupons"`
  2766. // 当前单天发放上限个数
  2767. MaxCouponsByDay *int64 `json:"max_coupons_by_day,omitempty"`
  2768. }
  2769. func (o ModifyBudgetResponse) MarshalJSON() ([]byte, error) {
  2770. toSerialize := map[string]interface{}{}
  2771. if o.MaxCoupons == nil {
  2772. return nil, fmt.Errorf("field `MaxCoupons` is required and must be specified in ModifyBudgetResponse")
  2773. }
  2774. toSerialize["max_coupons"] = o.MaxCoupons
  2775. if o.MaxCouponsByDay != nil {
  2776. toSerialize["max_coupons_by_day"] = o.MaxCouponsByDay
  2777. }
  2778. return json.Marshal(toSerialize)
  2779. }
  2780. func (o ModifyBudgetResponse) String() string {
  2781. var ret string
  2782. if o.MaxCoupons == nil {
  2783. ret += "MaxCoupons:<nil>, "
  2784. } else {
  2785. ret += fmt.Sprintf("MaxCoupons:%v, ", *o.MaxCoupons)
  2786. }
  2787. if o.MaxCouponsByDay == nil {
  2788. ret += "MaxCouponsByDay:<nil>"
  2789. } else {
  2790. ret += fmt.Sprintf("MaxCouponsByDay:%v", *o.MaxCouponsByDay)
  2791. }
  2792. return fmt.Sprintf("ModifyBudgetResponse{%s}", ret)
  2793. }
  2794. func (o ModifyBudgetResponse) Clone() *ModifyBudgetResponse {
  2795. ret := ModifyBudgetResponse{}
  2796. if o.MaxCoupons != nil {
  2797. ret.MaxCoupons = new(int64)
  2798. *ret.MaxCoupons = *o.MaxCoupons
  2799. }
  2800. if o.MaxCouponsByDay != nil {
  2801. ret.MaxCouponsByDay = new(int64)
  2802. *ret.MaxCouponsByDay = *o.MaxCouponsByDay
  2803. }
  2804. return &ret
  2805. }
  2806. // ModifyCouponUseRule
  2807. type ModifyCouponUseRule struct {
  2808. // 核销方式
  2809. UseMethod *CouponUseMethod `json:"use_method,omitempty"`
  2810. // 核销方式为线上小程序核销才有效
  2811. MiniProgramsAppid *string `json:"mini_programs_appid,omitempty"`
  2812. // 核销方式为线上小程序核销才有效
  2813. MiniProgramsPath *string `json:"mini_programs_path,omitempty"`
  2814. }
  2815. func (o ModifyCouponUseRule) MarshalJSON() ([]byte, error) {
  2816. toSerialize := map[string]interface{}{}
  2817. if o.UseMethod != nil {
  2818. toSerialize["use_method"] = o.UseMethod
  2819. }
  2820. if o.MiniProgramsAppid != nil {
  2821. toSerialize["mini_programs_appid"] = o.MiniProgramsAppid
  2822. }
  2823. if o.MiniProgramsPath != nil {
  2824. toSerialize["mini_programs_path"] = o.MiniProgramsPath
  2825. }
  2826. return json.Marshal(toSerialize)
  2827. }
  2828. func (o ModifyCouponUseRule) String() string {
  2829. var ret string
  2830. if o.UseMethod == nil {
  2831. ret += "UseMethod:<nil>, "
  2832. } else {
  2833. ret += fmt.Sprintf("UseMethod:%v, ", *o.UseMethod)
  2834. }
  2835. if o.MiniProgramsAppid == nil {
  2836. ret += "MiniProgramsAppid:<nil>, "
  2837. } else {
  2838. ret += fmt.Sprintf("MiniProgramsAppid:%v, ", *o.MiniProgramsAppid)
  2839. }
  2840. if o.MiniProgramsPath == nil {
  2841. ret += "MiniProgramsPath:<nil>"
  2842. } else {
  2843. ret += fmt.Sprintf("MiniProgramsPath:%v", *o.MiniProgramsPath)
  2844. }
  2845. return fmt.Sprintf("ModifyCouponUseRule{%s}", ret)
  2846. }
  2847. func (o ModifyCouponUseRule) Clone() *ModifyCouponUseRule {
  2848. ret := ModifyCouponUseRule{}
  2849. if o.UseMethod != nil {
  2850. ret.UseMethod = new(CouponUseMethod)
  2851. *ret.UseMethod = *o.UseMethod
  2852. }
  2853. if o.MiniProgramsAppid != nil {
  2854. ret.MiniProgramsAppid = new(string)
  2855. *ret.MiniProgramsAppid = *o.MiniProgramsAppid
  2856. }
  2857. if o.MiniProgramsPath != nil {
  2858. ret.MiniProgramsPath = new(string)
  2859. *ret.MiniProgramsPath = *o.MiniProgramsPath
  2860. }
  2861. return &ret
  2862. }
  2863. // ModifyCustomEntrance
  2864. type ModifyCustomEntrance struct {
  2865. // 需要小程序APPID、path、入口文案、引导文案。如果需要跳转小程序,APPID、path、入口文案为必填,引导文案非必填。AppID要与归属商户号有绑定关系
  2866. MiniProgramsInfo *ModifyMiniAppInfo `json:"mini_programs_info,omitempty"`
  2867. // 可配置商户公众号,从券详情可跳转至公众号
  2868. Appid *string `json:"appid,omitempty"`
  2869. // 填写微信支付营销馆的馆id,用户自定义字段。[营销馆](https://pay.weixin.qq.com/index.php/xphp/cfav_market/hall#/pages/list/list)需在商户平台创建。
  2870. HallId *string `json:"hall_id,omitempty"`
  2871. // code展示模式
  2872. CodeDisplayMode *CodeDisplayMode `json:"code_display_mode,omitempty"`
  2873. }
  2874. func (o ModifyCustomEntrance) MarshalJSON() ([]byte, error) {
  2875. toSerialize := map[string]interface{}{}
  2876. if o.MiniProgramsInfo != nil {
  2877. toSerialize["mini_programs_info"] = o.MiniProgramsInfo
  2878. }
  2879. if o.Appid != nil {
  2880. toSerialize["appid"] = o.Appid
  2881. }
  2882. if o.HallId != nil {
  2883. toSerialize["hall_id"] = o.HallId
  2884. }
  2885. if o.CodeDisplayMode != nil {
  2886. toSerialize["code_display_mode"] = o.CodeDisplayMode
  2887. }
  2888. return json.Marshal(toSerialize)
  2889. }
  2890. func (o ModifyCustomEntrance) String() string {
  2891. var ret string
  2892. ret += fmt.Sprintf("MiniProgramsInfo:%v, ", o.MiniProgramsInfo)
  2893. if o.Appid == nil {
  2894. ret += "Appid:<nil>, "
  2895. } else {
  2896. ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
  2897. }
  2898. if o.HallId == nil {
  2899. ret += "HallId:<nil>, "
  2900. } else {
  2901. ret += fmt.Sprintf("HallId:%v, ", *o.HallId)
  2902. }
  2903. if o.CodeDisplayMode == nil {
  2904. ret += "CodeDisplayMode:<nil>"
  2905. } else {
  2906. ret += fmt.Sprintf("CodeDisplayMode:%v", *o.CodeDisplayMode)
  2907. }
  2908. return fmt.Sprintf("ModifyCustomEntrance{%s}", ret)
  2909. }
  2910. func (o ModifyCustomEntrance) Clone() *ModifyCustomEntrance {
  2911. ret := ModifyCustomEntrance{}
  2912. if o.MiniProgramsInfo != nil {
  2913. ret.MiniProgramsInfo = o.MiniProgramsInfo.Clone()
  2914. }
  2915. if o.Appid != nil {
  2916. ret.Appid = new(string)
  2917. *ret.Appid = *o.Appid
  2918. }
  2919. if o.HallId != nil {
  2920. ret.HallId = new(string)
  2921. *ret.HallId = *o.HallId
  2922. }
  2923. if o.CodeDisplayMode != nil {
  2924. ret.CodeDisplayMode = new(CodeDisplayMode)
  2925. *ret.CodeDisplayMode = *o.CodeDisplayMode
  2926. }
  2927. return &ret
  2928. }
  2929. // ModifyMiniAppInfo
  2930. type ModifyMiniAppInfo struct {
  2931. // 需要小程序AppID与归属商户号有绑定关系
  2932. MiniProgramsAppid *string `json:"mini_programs_appid,omitempty"`
  2933. // 商家小程序path
  2934. MiniProgramsPath *string `json:"mini_programs_path,omitempty"`
  2935. // 入口文案,字数上限为5个,一个中文汉字/英文字母/数字均占用一个字数。
  2936. EntranceWords *string `json:"entrance_words,omitempty"`
  2937. // 小程序入口引导文案,字数上限为6个,一个中文汉字/英文字母/数字均占用一个字数。
  2938. GuidingWords *string `json:"guiding_words,omitempty"`
  2939. }
  2940. func (o ModifyMiniAppInfo) MarshalJSON() ([]byte, error) {
  2941. toSerialize := map[string]interface{}{}
  2942. if o.MiniProgramsAppid != nil {
  2943. toSerialize["mini_programs_appid"] = o.MiniProgramsAppid
  2944. }
  2945. if o.MiniProgramsPath != nil {
  2946. toSerialize["mini_programs_path"] = o.MiniProgramsPath
  2947. }
  2948. if o.EntranceWords != nil {
  2949. toSerialize["entrance_words"] = o.EntranceWords
  2950. }
  2951. if o.GuidingWords != nil {
  2952. toSerialize["guiding_words"] = o.GuidingWords
  2953. }
  2954. return json.Marshal(toSerialize)
  2955. }
  2956. func (o ModifyMiniAppInfo) String() string {
  2957. var ret string
  2958. if o.MiniProgramsAppid == nil {
  2959. ret += "MiniProgramsAppid:<nil>, "
  2960. } else {
  2961. ret += fmt.Sprintf("MiniProgramsAppid:%v, ", *o.MiniProgramsAppid)
  2962. }
  2963. if o.MiniProgramsPath == nil {
  2964. ret += "MiniProgramsPath:<nil>, "
  2965. } else {
  2966. ret += fmt.Sprintf("MiniProgramsPath:%v, ", *o.MiniProgramsPath)
  2967. }
  2968. if o.EntranceWords == nil {
  2969. ret += "EntranceWords:<nil>, "
  2970. } else {
  2971. ret += fmt.Sprintf("EntranceWords:%v, ", *o.EntranceWords)
  2972. }
  2973. if o.GuidingWords == nil {
  2974. ret += "GuidingWords:<nil>"
  2975. } else {
  2976. ret += fmt.Sprintf("GuidingWords:%v", *o.GuidingWords)
  2977. }
  2978. return fmt.Sprintf("ModifyMiniAppInfo{%s}", ret)
  2979. }
  2980. func (o ModifyMiniAppInfo) Clone() *ModifyMiniAppInfo {
  2981. ret := ModifyMiniAppInfo{}
  2982. if o.MiniProgramsAppid != nil {
  2983. ret.MiniProgramsAppid = new(string)
  2984. *ret.MiniProgramsAppid = *o.MiniProgramsAppid
  2985. }
  2986. if o.MiniProgramsPath != nil {
  2987. ret.MiniProgramsPath = new(string)
  2988. *ret.MiniProgramsPath = *o.MiniProgramsPath
  2989. }
  2990. if o.EntranceWords != nil {
  2991. ret.EntranceWords = new(string)
  2992. *ret.EntranceWords = *o.EntranceWords
  2993. }
  2994. if o.GuidingWords != nil {
  2995. ret.GuidingWords = new(string)
  2996. *ret.GuidingWords = *o.GuidingWords
  2997. }
  2998. return &ret
  2999. }
  3000. // ModifyStockInfoBody
  3001. type ModifyStockInfoBody struct {
  3002. // 卡详情页面,可选择多种入口引导用户
  3003. CustomEntrance *ModifyCustomEntrance `json:"custom_entrance,omitempty"`
  3004. // 批次名称,字数上限为21个,一个中文汉字/英文字母/数字均占用一个字数。 注:该字段暂不支持修改
  3005. StockName *string `json:"stock_name,omitempty"`
  3006. // 仅配置商户可见,用于自定义信息。字数上限为20个,一个中文汉字/英文字母/数字均占用一个字数。
  3007. Comment *string `json:"comment,omitempty"`
  3008. // 用来描述批次在哪些商品可用,会显示在微信卡包中。字数上限为15个,一个中文汉字/英文字母/数字均占用一个字数。
  3009. GoodsName *string `json:"goods_name,omitempty"`
  3010. // 商户修改批次凭据号(格式:商户ID+日期+流水号),商户侧需保持唯一性。
  3011. OutRequestNo *string `json:"out_request_no"`
  3012. //
  3013. DisplayPatternInfo *DisplayPatternInfo `json:"display_pattern_info,omitempty"`
  3014. // 券核销相关规则
  3015. CouponUseRule *ModifyCouponUseRule `json:"coupon_use_rule,omitempty"`
  3016. // 券发放相关规则
  3017. StockSendRule *ModifyStockSendRule `json:"stock_send_rule,omitempty"`
  3018. // 事件回调通知商户的配置
  3019. NotifyConfig *NotifyConfig `json:"notify_config,omitempty"`
  3020. // 该批次发放的券是否允许进行补差。只允许从false改为true,不支持从true改为false 注:该字段暂未开放
  3021. Subsidy *bool `json:"subsidy,omitempty"`
  3022. }
  3023. func (o ModifyStockInfoBody) MarshalJSON() ([]byte, error) {
  3024. toSerialize := map[string]interface{}{}
  3025. if o.CustomEntrance != nil {
  3026. toSerialize["custom_entrance"] = o.CustomEntrance
  3027. }
  3028. if o.StockName != nil {
  3029. toSerialize["stock_name"] = o.StockName
  3030. }
  3031. if o.Comment != nil {
  3032. toSerialize["comment"] = o.Comment
  3033. }
  3034. if o.GoodsName != nil {
  3035. toSerialize["goods_name"] = o.GoodsName
  3036. }
  3037. if o.OutRequestNo == nil {
  3038. return nil, fmt.Errorf("field `OutRequestNo` is required and must be specified in ModifyStockInfoBody")
  3039. }
  3040. toSerialize["out_request_no"] = o.OutRequestNo
  3041. if o.DisplayPatternInfo != nil {
  3042. toSerialize["display_pattern_info"] = o.DisplayPatternInfo
  3043. }
  3044. if o.CouponUseRule != nil {
  3045. toSerialize["coupon_use_rule"] = o.CouponUseRule
  3046. }
  3047. if o.StockSendRule != nil {
  3048. toSerialize["stock_send_rule"] = o.StockSendRule
  3049. }
  3050. if o.NotifyConfig != nil {
  3051. toSerialize["notify_config"] = o.NotifyConfig
  3052. }
  3053. if o.Subsidy != nil {
  3054. toSerialize["subsidy"] = o.Subsidy
  3055. }
  3056. return json.Marshal(toSerialize)
  3057. }
  3058. func (o ModifyStockInfoBody) String() string {
  3059. var ret string
  3060. ret += fmt.Sprintf("CustomEntrance:%v, ", o.CustomEntrance)
  3061. if o.StockName == nil {
  3062. ret += "StockName:<nil>, "
  3063. } else {
  3064. ret += fmt.Sprintf("StockName:%v, ", *o.StockName)
  3065. }
  3066. if o.Comment == nil {
  3067. ret += "Comment:<nil>, "
  3068. } else {
  3069. ret += fmt.Sprintf("Comment:%v, ", *o.Comment)
  3070. }
  3071. if o.GoodsName == nil {
  3072. ret += "GoodsName:<nil>, "
  3073. } else {
  3074. ret += fmt.Sprintf("GoodsName:%v, ", *o.GoodsName)
  3075. }
  3076. if o.OutRequestNo == nil {
  3077. ret += "OutRequestNo:<nil>, "
  3078. } else {
  3079. ret += fmt.Sprintf("OutRequestNo:%v, ", *o.OutRequestNo)
  3080. }
  3081. ret += fmt.Sprintf("DisplayPatternInfo:%v, ", o.DisplayPatternInfo)
  3082. ret += fmt.Sprintf("CouponUseRule:%v, ", o.CouponUseRule)
  3083. ret += fmt.Sprintf("StockSendRule:%v, ", o.StockSendRule)
  3084. ret += fmt.Sprintf("NotifyConfig:%v, ", o.NotifyConfig)
  3085. if o.Subsidy == nil {
  3086. ret += "Subsidy:<nil>"
  3087. } else {
  3088. ret += fmt.Sprintf("Subsidy:%v", *o.Subsidy)
  3089. }
  3090. return fmt.Sprintf("ModifyStockInfoBody{%s}", ret)
  3091. }
  3092. func (o ModifyStockInfoBody) Clone() *ModifyStockInfoBody {
  3093. ret := ModifyStockInfoBody{}
  3094. if o.CustomEntrance != nil {
  3095. ret.CustomEntrance = o.CustomEntrance.Clone()
  3096. }
  3097. if o.StockName != nil {
  3098. ret.StockName = new(string)
  3099. *ret.StockName = *o.StockName
  3100. }
  3101. if o.Comment != nil {
  3102. ret.Comment = new(string)
  3103. *ret.Comment = *o.Comment
  3104. }
  3105. if o.GoodsName != nil {
  3106. ret.GoodsName = new(string)
  3107. *ret.GoodsName = *o.GoodsName
  3108. }
  3109. if o.OutRequestNo != nil {
  3110. ret.OutRequestNo = new(string)
  3111. *ret.OutRequestNo = *o.OutRequestNo
  3112. }
  3113. if o.DisplayPatternInfo != nil {
  3114. ret.DisplayPatternInfo = o.DisplayPatternInfo.Clone()
  3115. }
  3116. if o.CouponUseRule != nil {
  3117. ret.CouponUseRule = o.CouponUseRule.Clone()
  3118. }
  3119. if o.StockSendRule != nil {
  3120. ret.StockSendRule = o.StockSendRule.Clone()
  3121. }
  3122. if o.NotifyConfig != nil {
  3123. ret.NotifyConfig = o.NotifyConfig.Clone()
  3124. }
  3125. if o.Subsidy != nil {
  3126. ret.Subsidy = new(bool)
  3127. *ret.Subsidy = *o.Subsidy
  3128. }
  3129. return &ret
  3130. }
  3131. // ModifyStockInfoRequest
  3132. type ModifyStockInfoRequest struct {
  3133. // 批次号
  3134. StockId *string `json:"stock_id"`
  3135. // 卡详情页面,可选择多种入口引导用户
  3136. CustomEntrance *ModifyCustomEntrance `json:"custom_entrance,omitempty"`
  3137. // 批次名称,字数上限为21个,一个中文汉字/英文字母/数字均占用一个字数。 注:该字段暂不支持修改
  3138. StockName *string `json:"stock_name,omitempty"`
  3139. // 仅配置商户可见,用于自定义信息。字数上限为20个,一个中文汉字/英文字母/数字均占用一个字数。
  3140. Comment *string `json:"comment,omitempty"`
  3141. // 用来描述批次在哪些商品可用,会显示在微信卡包中。字数上限为15个,一个中文汉字/英文字母/数字均占用一个字数。
  3142. GoodsName *string `json:"goods_name,omitempty"`
  3143. // 商户修改批次凭据号(格式:商户ID+日期+流水号),商户侧需保持唯一性。
  3144. OutRequestNo *string `json:"out_request_no"`
  3145. //
  3146. DisplayPatternInfo *DisplayPatternInfo `json:"display_pattern_info,omitempty"`
  3147. // 券核销相关规则
  3148. CouponUseRule *ModifyCouponUseRule `json:"coupon_use_rule,omitempty"`
  3149. // 券发放相关规则
  3150. StockSendRule *ModifyStockSendRule `json:"stock_send_rule,omitempty"`
  3151. // 事件回调通知商户的配置
  3152. NotifyConfig *NotifyConfig `json:"notify_config,omitempty"`
  3153. // 该批次发放的券是否允许进行补差。只允许从false改为true,不支持从true改为false 注:该字段暂未开放
  3154. Subsidy *bool `json:"subsidy,omitempty"`
  3155. }
  3156. func (o ModifyStockInfoRequest) MarshalJSON() ([]byte, error) {
  3157. toSerialize := map[string]interface{}{}
  3158. if o.StockId == nil {
  3159. return nil, fmt.Errorf("field `StockId` is required and must be specified in ModifyStockInfoRequest")
  3160. }
  3161. toSerialize["stock_id"] = o.StockId
  3162. if o.CustomEntrance != nil {
  3163. toSerialize["custom_entrance"] = o.CustomEntrance
  3164. }
  3165. if o.StockName != nil {
  3166. toSerialize["stock_name"] = o.StockName
  3167. }
  3168. if o.Comment != nil {
  3169. toSerialize["comment"] = o.Comment
  3170. }
  3171. if o.GoodsName != nil {
  3172. toSerialize["goods_name"] = o.GoodsName
  3173. }
  3174. if o.OutRequestNo == nil {
  3175. return nil, fmt.Errorf("field `OutRequestNo` is required and must be specified in ModifyStockInfoRequest")
  3176. }
  3177. toSerialize["out_request_no"] = o.OutRequestNo
  3178. if o.DisplayPatternInfo != nil {
  3179. toSerialize["display_pattern_info"] = o.DisplayPatternInfo
  3180. }
  3181. if o.CouponUseRule != nil {
  3182. toSerialize["coupon_use_rule"] = o.CouponUseRule
  3183. }
  3184. if o.StockSendRule != nil {
  3185. toSerialize["stock_send_rule"] = o.StockSendRule
  3186. }
  3187. if o.NotifyConfig != nil {
  3188. toSerialize["notify_config"] = o.NotifyConfig
  3189. }
  3190. if o.Subsidy != nil {
  3191. toSerialize["subsidy"] = o.Subsidy
  3192. }
  3193. return json.Marshal(toSerialize)
  3194. }
  3195. func (o ModifyStockInfoRequest) String() string {
  3196. var ret string
  3197. if o.StockId == nil {
  3198. ret += "StockId:<nil>, "
  3199. } else {
  3200. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  3201. }
  3202. ret += fmt.Sprintf("CustomEntrance:%v, ", o.CustomEntrance)
  3203. if o.StockName == nil {
  3204. ret += "StockName:<nil>, "
  3205. } else {
  3206. ret += fmt.Sprintf("StockName:%v, ", *o.StockName)
  3207. }
  3208. if o.Comment == nil {
  3209. ret += "Comment:<nil>, "
  3210. } else {
  3211. ret += fmt.Sprintf("Comment:%v, ", *o.Comment)
  3212. }
  3213. if o.GoodsName == nil {
  3214. ret += "GoodsName:<nil>, "
  3215. } else {
  3216. ret += fmt.Sprintf("GoodsName:%v, ", *o.GoodsName)
  3217. }
  3218. if o.OutRequestNo == nil {
  3219. ret += "OutRequestNo:<nil>, "
  3220. } else {
  3221. ret += fmt.Sprintf("OutRequestNo:%v, ", *o.OutRequestNo)
  3222. }
  3223. ret += fmt.Sprintf("DisplayPatternInfo:%v, ", o.DisplayPatternInfo)
  3224. ret += fmt.Sprintf("CouponUseRule:%v, ", o.CouponUseRule)
  3225. ret += fmt.Sprintf("StockSendRule:%v, ", o.StockSendRule)
  3226. ret += fmt.Sprintf("NotifyConfig:%v, ", o.NotifyConfig)
  3227. if o.Subsidy == nil {
  3228. ret += "Subsidy:<nil>"
  3229. } else {
  3230. ret += fmt.Sprintf("Subsidy:%v", *o.Subsidy)
  3231. }
  3232. return fmt.Sprintf("ModifyStockInfoRequest{%s}", ret)
  3233. }
  3234. func (o ModifyStockInfoRequest) Clone() *ModifyStockInfoRequest {
  3235. ret := ModifyStockInfoRequest{}
  3236. if o.StockId != nil {
  3237. ret.StockId = new(string)
  3238. *ret.StockId = *o.StockId
  3239. }
  3240. if o.CustomEntrance != nil {
  3241. ret.CustomEntrance = o.CustomEntrance.Clone()
  3242. }
  3243. if o.StockName != nil {
  3244. ret.StockName = new(string)
  3245. *ret.StockName = *o.StockName
  3246. }
  3247. if o.Comment != nil {
  3248. ret.Comment = new(string)
  3249. *ret.Comment = *o.Comment
  3250. }
  3251. if o.GoodsName != nil {
  3252. ret.GoodsName = new(string)
  3253. *ret.GoodsName = *o.GoodsName
  3254. }
  3255. if o.OutRequestNo != nil {
  3256. ret.OutRequestNo = new(string)
  3257. *ret.OutRequestNo = *o.OutRequestNo
  3258. }
  3259. if o.DisplayPatternInfo != nil {
  3260. ret.DisplayPatternInfo = o.DisplayPatternInfo.Clone()
  3261. }
  3262. if o.CouponUseRule != nil {
  3263. ret.CouponUseRule = o.CouponUseRule.Clone()
  3264. }
  3265. if o.StockSendRule != nil {
  3266. ret.StockSendRule = o.StockSendRule.Clone()
  3267. }
  3268. if o.NotifyConfig != nil {
  3269. ret.NotifyConfig = o.NotifyConfig.Clone()
  3270. }
  3271. if o.Subsidy != nil {
  3272. ret.Subsidy = new(bool)
  3273. *ret.Subsidy = *o.Subsidy
  3274. }
  3275. return &ret
  3276. }
  3277. // ModifyStockSendRule
  3278. type ModifyStockSendRule struct {
  3279. // true-是;false-否,不填默认否 注:该字段暂不支持修改
  3280. NaturalPersonLimit *bool `json:"natural_person_limit,omitempty"`
  3281. // true-是;false-否,不填默认否
  3282. PreventApiAbuse *bool `json:"prevent_api_abuse,omitempty"`
  3283. }
  3284. func (o ModifyStockSendRule) MarshalJSON() ([]byte, error) {
  3285. toSerialize := map[string]interface{}{}
  3286. if o.NaturalPersonLimit != nil {
  3287. toSerialize["natural_person_limit"] = o.NaturalPersonLimit
  3288. }
  3289. if o.PreventApiAbuse != nil {
  3290. toSerialize["prevent_api_abuse"] = o.PreventApiAbuse
  3291. }
  3292. return json.Marshal(toSerialize)
  3293. }
  3294. func (o ModifyStockSendRule) String() string {
  3295. var ret string
  3296. if o.NaturalPersonLimit == nil {
  3297. ret += "NaturalPersonLimit:<nil>, "
  3298. } else {
  3299. ret += fmt.Sprintf("NaturalPersonLimit:%v, ", *o.NaturalPersonLimit)
  3300. }
  3301. if o.PreventApiAbuse == nil {
  3302. ret += "PreventApiAbuse:<nil>"
  3303. } else {
  3304. ret += fmt.Sprintf("PreventApiAbuse:%v", *o.PreventApiAbuse)
  3305. }
  3306. return fmt.Sprintf("ModifyStockSendRule{%s}", ret)
  3307. }
  3308. func (o ModifyStockSendRule) Clone() *ModifyStockSendRule {
  3309. ret := ModifyStockSendRule{}
  3310. if o.NaturalPersonLimit != nil {
  3311. ret.NaturalPersonLimit = new(bool)
  3312. *ret.NaturalPersonLimit = *o.NaturalPersonLimit
  3313. }
  3314. if o.PreventApiAbuse != nil {
  3315. ret.PreventApiAbuse = new(bool)
  3316. *ret.PreventApiAbuse = *o.PreventApiAbuse
  3317. }
  3318. return &ret
  3319. }
  3320. // NotifyConfig
  3321. type NotifyConfig struct {
  3322. // 用于回调通知时,计算返回操作用户的OpenID(诸如领券用户),支持小程序or公众号的AppID;如该字段不填写,则回调通知中涉及到用户身份信息的OpenID与UnionID都将为空。
  3323. NotifyAppid *string `json:"notify_appid,omitempty"`
  3324. }
  3325. func (o NotifyConfig) MarshalJSON() ([]byte, error) {
  3326. toSerialize := map[string]interface{}{}
  3327. if o.NotifyAppid != nil {
  3328. toSerialize["notify_appid"] = o.NotifyAppid
  3329. }
  3330. return json.Marshal(toSerialize)
  3331. }
  3332. func (o NotifyConfig) String() string {
  3333. var ret string
  3334. if o.NotifyAppid == nil {
  3335. ret += "NotifyAppid:<nil>"
  3336. } else {
  3337. ret += fmt.Sprintf("NotifyAppid:%v", *o.NotifyAppid)
  3338. }
  3339. return fmt.Sprintf("NotifyConfig{%s}", ret)
  3340. }
  3341. func (o NotifyConfig) Clone() *NotifyConfig {
  3342. ret := NotifyConfig{}
  3343. if o.NotifyAppid != nil {
  3344. ret.NotifyAppid = new(string)
  3345. *ret.NotifyAppid = *o.NotifyAppid
  3346. }
  3347. return &ret
  3348. }
  3349. // PayReceiptInfoRequest
  3350. type PayReceiptInfoRequest struct {
  3351. // 补差付款唯一单号,由微信支付生成,仅在补差付款成功后有返回
  3352. SubsidyReceiptId *string `json:"subsidy_receipt_id"`
  3353. }
  3354. func (o PayReceiptInfoRequest) MarshalJSON() ([]byte, error) {
  3355. toSerialize := map[string]interface{}{}
  3356. if o.SubsidyReceiptId == nil {
  3357. return nil, fmt.Errorf("field `SubsidyReceiptId` is required and must be specified in PayReceiptInfoRequest")
  3358. }
  3359. toSerialize["subsidy_receipt_id"] = o.SubsidyReceiptId
  3360. return json.Marshal(toSerialize)
  3361. }
  3362. func (o PayReceiptInfoRequest) String() string {
  3363. var ret string
  3364. if o.SubsidyReceiptId == nil {
  3365. ret += "SubsidyReceiptId:<nil>"
  3366. } else {
  3367. ret += fmt.Sprintf("SubsidyReceiptId:%v", *o.SubsidyReceiptId)
  3368. }
  3369. return fmt.Sprintf("PayReceiptInfoRequest{%s}", ret)
  3370. }
  3371. func (o PayReceiptInfoRequest) Clone() *PayReceiptInfoRequest {
  3372. ret := PayReceiptInfoRequest{}
  3373. if o.SubsidyReceiptId != nil {
  3374. ret.SubsidyReceiptId = new(string)
  3375. *ret.SubsidyReceiptId = *o.SubsidyReceiptId
  3376. }
  3377. return &ret
  3378. }
  3379. // PayReceiptListRequest
  3380. type PayReceiptListRequest struct {
  3381. // 由微信支付生成,调用创建商家券API成功时返回的唯一批次ID
  3382. StockId *string `json:"stock_id"`
  3383. // 券的唯一标识。 在WECHATPAY\\_MODE的券code模式下,商家券code是由微信支付生成的唯一ID; 在MERCHANT\\_UPLOAD、MERCHANT\\_API的券code模式下,商家券code是由商户上传或指定,在批次下保证唯一;
  3384. CouponCode *string `json:"coupon_code"`
  3385. // 商户调用补差付款API时填写的“业务请求唯一单号”
  3386. OutSubsidyNo *string `json:"out_subsidy_no,omitempty"`
  3387. }
  3388. func (o PayReceiptListRequest) MarshalJSON() ([]byte, error) {
  3389. toSerialize := map[string]interface{}{}
  3390. if o.StockId == nil {
  3391. return nil, fmt.Errorf("field `StockId` is required and must be specified in PayReceiptListRequest")
  3392. }
  3393. toSerialize["stock_id"] = o.StockId
  3394. if o.CouponCode == nil {
  3395. return nil, fmt.Errorf("field `CouponCode` is required and must be specified in PayReceiptListRequest")
  3396. }
  3397. toSerialize["coupon_code"] = o.CouponCode
  3398. if o.OutSubsidyNo != nil {
  3399. toSerialize["out_subsidy_no"] = o.OutSubsidyNo
  3400. }
  3401. return json.Marshal(toSerialize)
  3402. }
  3403. func (o PayReceiptListRequest) String() string {
  3404. var ret string
  3405. if o.StockId == nil {
  3406. ret += "StockId:<nil>, "
  3407. } else {
  3408. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  3409. }
  3410. if o.CouponCode == nil {
  3411. ret += "CouponCode:<nil>, "
  3412. } else {
  3413. ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
  3414. }
  3415. if o.OutSubsidyNo == nil {
  3416. ret += "OutSubsidyNo:<nil>"
  3417. } else {
  3418. ret += fmt.Sprintf("OutSubsidyNo:%v", *o.OutSubsidyNo)
  3419. }
  3420. return fmt.Sprintf("PayReceiptListRequest{%s}", ret)
  3421. }
  3422. func (o PayReceiptListRequest) Clone() *PayReceiptListRequest {
  3423. ret := PayReceiptListRequest{}
  3424. if o.StockId != nil {
  3425. ret.StockId = new(string)
  3426. *ret.StockId = *o.StockId
  3427. }
  3428. if o.CouponCode != nil {
  3429. ret.CouponCode = new(string)
  3430. *ret.CouponCode = *o.CouponCode
  3431. }
  3432. if o.OutSubsidyNo != nil {
  3433. ret.OutSubsidyNo = new(string)
  3434. *ret.OutSubsidyNo = *o.OutSubsidyNo
  3435. }
  3436. return &ret
  3437. }
  3438. // QueryCouponCodeListRequest
  3439. type QueryCouponCodeListRequest struct {
  3440. // 商家券批次号
  3441. StockId *string `json:"stock_id"`
  3442. // 分页查询的最大size
  3443. Limit *int64 `json:"limit,omitempty"`
  3444. // 分页查询的起始位置
  3445. Offset *int64 `json:"offset,omitempty"`
  3446. // 公众账号ID
  3447. Appid *string `json:"appid,omitempty"`
  3448. // 券code状态,当不填写时为查询所有状态的code列表
  3449. Status *CouponCodeStatus `json:"status,omitempty"`
  3450. }
  3451. func (o QueryCouponCodeListRequest) MarshalJSON() ([]byte, error) {
  3452. toSerialize := map[string]interface{}{}
  3453. if o.StockId == nil {
  3454. return nil, fmt.Errorf("field `StockId` is required and must be specified in QueryCouponCodeListRequest")
  3455. }
  3456. toSerialize["stock_id"] = o.StockId
  3457. if o.Limit != nil {
  3458. toSerialize["limit"] = o.Limit
  3459. }
  3460. if o.Offset != nil {
  3461. toSerialize["offset"] = o.Offset
  3462. }
  3463. if o.Appid != nil {
  3464. toSerialize["appid"] = o.Appid
  3465. }
  3466. if o.Status != nil {
  3467. toSerialize["status"] = o.Status
  3468. }
  3469. return json.Marshal(toSerialize)
  3470. }
  3471. func (o QueryCouponCodeListRequest) String() string {
  3472. var ret string
  3473. if o.StockId == nil {
  3474. ret += "StockId:<nil>, "
  3475. } else {
  3476. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  3477. }
  3478. if o.Limit == nil {
  3479. ret += "Limit:<nil>, "
  3480. } else {
  3481. ret += fmt.Sprintf("Limit:%v, ", *o.Limit)
  3482. }
  3483. if o.Offset == nil {
  3484. ret += "Offset:<nil>, "
  3485. } else {
  3486. ret += fmt.Sprintf("Offset:%v, ", *o.Offset)
  3487. }
  3488. if o.Appid == nil {
  3489. ret += "Appid:<nil>, "
  3490. } else {
  3491. ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
  3492. }
  3493. if o.Status == nil {
  3494. ret += "Status:<nil>"
  3495. } else {
  3496. ret += fmt.Sprintf("Status:%v", *o.Status)
  3497. }
  3498. return fmt.Sprintf("QueryCouponCodeListRequest{%s}", ret)
  3499. }
  3500. func (o QueryCouponCodeListRequest) Clone() *QueryCouponCodeListRequest {
  3501. ret := QueryCouponCodeListRequest{}
  3502. if o.StockId != nil {
  3503. ret.StockId = new(string)
  3504. *ret.StockId = *o.StockId
  3505. }
  3506. if o.Limit != nil {
  3507. ret.Limit = new(int64)
  3508. *ret.Limit = *o.Limit
  3509. }
  3510. if o.Offset != nil {
  3511. ret.Offset = new(int64)
  3512. *ret.Offset = *o.Offset
  3513. }
  3514. if o.Appid != nil {
  3515. ret.Appid = new(string)
  3516. *ret.Appid = *o.Appid
  3517. }
  3518. if o.Status != nil {
  3519. ret.Status = new(CouponCodeStatus)
  3520. *ret.Status = *o.Status
  3521. }
  3522. return &ret
  3523. }
  3524. // QueryCouponRequest
  3525. type QueryCouponRequest struct {
  3526. // 券的唯一标识
  3527. CouponCode *string `json:"coupon_code"`
  3528. // 支持传入与当前调用接口商户号有绑定关系的AppID。支持小程序AppID与公众号AppID。 校验规则:传入的AppID得是与调用方商户号(即请求头里面的商户号)有绑定关系的AppID或传入的AppID得是归属商户号有绑定关系的AppID
  3529. Appid *string `json:"appid"`
  3530. // OpenID信息,用户在AppID下的唯一标识。 校验规则:传入的OpenID得是调用方商户号(即请求头里面的商户号)有绑定关系的AppID获取的OpenID或传入的OpenID得是归属商户号有绑定关系的AppID获取的OpenID。[获取OpenID文档](https://pay.weixin.qq.com/wiki/doc/apiv3/terms_definition/chapter1_1_3.shtml#part-3)
  3531. Openid *string `json:"openid"`
  3532. }
  3533. func (o QueryCouponRequest) MarshalJSON() ([]byte, error) {
  3534. toSerialize := map[string]interface{}{}
  3535. if o.CouponCode == nil {
  3536. return nil, fmt.Errorf("field `CouponCode` is required and must be specified in QueryCouponRequest")
  3537. }
  3538. toSerialize["coupon_code"] = o.CouponCode
  3539. if o.Appid == nil {
  3540. return nil, fmt.Errorf("field `Appid` is required and must be specified in QueryCouponRequest")
  3541. }
  3542. toSerialize["appid"] = o.Appid
  3543. if o.Openid == nil {
  3544. return nil, fmt.Errorf("field `Openid` is required and must be specified in QueryCouponRequest")
  3545. }
  3546. toSerialize["openid"] = o.Openid
  3547. return json.Marshal(toSerialize)
  3548. }
  3549. func (o QueryCouponRequest) String() string {
  3550. var ret string
  3551. if o.CouponCode == nil {
  3552. ret += "CouponCode:<nil>, "
  3553. } else {
  3554. ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
  3555. }
  3556. if o.Appid == nil {
  3557. ret += "Appid:<nil>, "
  3558. } else {
  3559. ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
  3560. }
  3561. if o.Openid == nil {
  3562. ret += "Openid:<nil>"
  3563. } else {
  3564. ret += fmt.Sprintf("Openid:%v", *o.Openid)
  3565. }
  3566. return fmt.Sprintf("QueryCouponRequest{%s}", ret)
  3567. }
  3568. func (o QueryCouponRequest) Clone() *QueryCouponRequest {
  3569. ret := QueryCouponRequest{}
  3570. if o.CouponCode != nil {
  3571. ret.CouponCode = new(string)
  3572. *ret.CouponCode = *o.CouponCode
  3573. }
  3574. if o.Appid != nil {
  3575. ret.Appid = new(string)
  3576. *ret.Appid = *o.Appid
  3577. }
  3578. if o.Openid != nil {
  3579. ret.Openid = new(string)
  3580. *ret.Openid = *o.Openid
  3581. }
  3582. return &ret
  3583. }
  3584. // QueryStockRequest
  3585. type QueryStockRequest struct {
  3586. // 微信为每个商家券批次分配的唯一ID
  3587. StockId *string `json:"stock_id"`
  3588. }
  3589. func (o QueryStockRequest) MarshalJSON() ([]byte, error) {
  3590. toSerialize := map[string]interface{}{}
  3591. if o.StockId == nil {
  3592. return nil, fmt.Errorf("field `StockId` is required and must be specified in QueryStockRequest")
  3593. }
  3594. toSerialize["stock_id"] = o.StockId
  3595. return json.Marshal(toSerialize)
  3596. }
  3597. func (o QueryStockRequest) String() string {
  3598. var ret string
  3599. if o.StockId == nil {
  3600. ret += "StockId:<nil>"
  3601. } else {
  3602. ret += fmt.Sprintf("StockId:%v", *o.StockId)
  3603. }
  3604. return fmt.Sprintf("QueryStockRequest{%s}", ret)
  3605. }
  3606. func (o QueryStockRequest) Clone() *QueryStockRequest {
  3607. ret := QueryStockRequest{}
  3608. if o.StockId != nil {
  3609. ret.StockId = new(string)
  3610. *ret.StockId = *o.StockId
  3611. }
  3612. return &ret
  3613. }
  3614. // ReturnCouponRequest
  3615. type ReturnCouponRequest struct {
  3616. // 券的唯一标识
  3617. CouponCode *string `json:"coupon_code"`
  3618. // 券的所属批次号
  3619. StockId *string `json:"stock_id"`
  3620. // 每次退券请求的唯一标识,商户需保证唯一
  3621. ReturnRequestNo *string `json:"return_request_no"`
  3622. }
  3623. func (o ReturnCouponRequest) MarshalJSON() ([]byte, error) {
  3624. toSerialize := map[string]interface{}{}
  3625. if o.CouponCode == nil {
  3626. return nil, fmt.Errorf("field `CouponCode` is required and must be specified in ReturnCouponRequest")
  3627. }
  3628. toSerialize["coupon_code"] = o.CouponCode
  3629. if o.StockId == nil {
  3630. return nil, fmt.Errorf("field `StockId` is required and must be specified in ReturnCouponRequest")
  3631. }
  3632. toSerialize["stock_id"] = o.StockId
  3633. if o.ReturnRequestNo == nil {
  3634. return nil, fmt.Errorf("field `ReturnRequestNo` is required and must be specified in ReturnCouponRequest")
  3635. }
  3636. toSerialize["return_request_no"] = o.ReturnRequestNo
  3637. return json.Marshal(toSerialize)
  3638. }
  3639. func (o ReturnCouponRequest) String() string {
  3640. var ret string
  3641. if o.CouponCode == nil {
  3642. ret += "CouponCode:<nil>, "
  3643. } else {
  3644. ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
  3645. }
  3646. if o.StockId == nil {
  3647. ret += "StockId:<nil>, "
  3648. } else {
  3649. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  3650. }
  3651. if o.ReturnRequestNo == nil {
  3652. ret += "ReturnRequestNo:<nil>"
  3653. } else {
  3654. ret += fmt.Sprintf("ReturnRequestNo:%v", *o.ReturnRequestNo)
  3655. }
  3656. return fmt.Sprintf("ReturnCouponRequest{%s}", ret)
  3657. }
  3658. func (o ReturnCouponRequest) Clone() *ReturnCouponRequest {
  3659. ret := ReturnCouponRequest{}
  3660. if o.CouponCode != nil {
  3661. ret.CouponCode = new(string)
  3662. *ret.CouponCode = *o.CouponCode
  3663. }
  3664. if o.StockId != nil {
  3665. ret.StockId = new(string)
  3666. *ret.StockId = *o.StockId
  3667. }
  3668. if o.ReturnRequestNo != nil {
  3669. ret.ReturnRequestNo = new(string)
  3670. *ret.ReturnRequestNo = *o.ReturnRequestNo
  3671. }
  3672. return &ret
  3673. }
  3674. // ReturnCouponResponse
  3675. type ReturnCouponResponse struct {
  3676. // 微信退券成功的时间,遵循[rfc3339](https://datatracker.ietf.org/doc/html/rfc3339)标准格式,格式为yyyy-MM-DDTHH:mm:ss+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秒。
  3677. WechatpayReturnTime *time.Time `json:"wechatpay_return_time"`
  3678. }
  3679. func (o ReturnCouponResponse) MarshalJSON() ([]byte, error) {
  3680. toSerialize := map[string]interface{}{}
  3681. if o.WechatpayReturnTime == nil {
  3682. return nil, fmt.Errorf("field `WechatpayReturnTime` is required and must be specified in ReturnCouponResponse")
  3683. }
  3684. toSerialize["wechatpay_return_time"] = o.WechatpayReturnTime.Format(time.RFC3339)
  3685. return json.Marshal(toSerialize)
  3686. }
  3687. func (o ReturnCouponResponse) String() string {
  3688. var ret string
  3689. if o.WechatpayReturnTime == nil {
  3690. ret += "WechatpayReturnTime:<nil>"
  3691. } else {
  3692. ret += fmt.Sprintf("WechatpayReturnTime:%v", *o.WechatpayReturnTime)
  3693. }
  3694. return fmt.Sprintf("ReturnCouponResponse{%s}", ret)
  3695. }
  3696. func (o ReturnCouponResponse) Clone() *ReturnCouponResponse {
  3697. ret := ReturnCouponResponse{}
  3698. if o.WechatpayReturnTime != nil {
  3699. ret.WechatpayReturnTime = new(time.Time)
  3700. *ret.WechatpayReturnTime = *o.WechatpayReturnTime
  3701. }
  3702. return &ret
  3703. }
  3704. // ReturnReceiptInfoRequest
  3705. type ReturnReceiptInfoRequest struct {
  3706. // 补差回退唯一单号,由微信支付生成,仅在补差回退成功后有返回
  3707. SubsidyReturnReceiptId *string `json:"subsidy_return_receipt_id"`
  3708. }
  3709. func (o ReturnReceiptInfoRequest) MarshalJSON() ([]byte, error) {
  3710. toSerialize := map[string]interface{}{}
  3711. if o.SubsidyReturnReceiptId == nil {
  3712. return nil, fmt.Errorf("field `SubsidyReturnReceiptId` is required and must be specified in ReturnReceiptInfoRequest")
  3713. }
  3714. toSerialize["subsidy_return_receipt_id"] = o.SubsidyReturnReceiptId
  3715. return json.Marshal(toSerialize)
  3716. }
  3717. func (o ReturnReceiptInfoRequest) String() string {
  3718. var ret string
  3719. if o.SubsidyReturnReceiptId == nil {
  3720. ret += "SubsidyReturnReceiptId:<nil>"
  3721. } else {
  3722. ret += fmt.Sprintf("SubsidyReturnReceiptId:%v", *o.SubsidyReturnReceiptId)
  3723. }
  3724. return fmt.Sprintf("ReturnReceiptInfoRequest{%s}", ret)
  3725. }
  3726. func (o ReturnReceiptInfoRequest) Clone() *ReturnReceiptInfoRequest {
  3727. ret := ReturnReceiptInfoRequest{}
  3728. if o.SubsidyReturnReceiptId != nil {
  3729. ret.SubsidyReturnReceiptId = new(string)
  3730. *ret.SubsidyReturnReceiptId = *o.SubsidyReturnReceiptId
  3731. }
  3732. return &ret
  3733. }
  3734. // SendCount
  3735. type SendCount struct {
  3736. // 批次已发放的券数量,满减、折扣、换购类型会返回该字段
  3737. TotalSendNum *int64 `json:"total_send_num,omitempty"`
  3738. // 批次已发放的预算金额,满减券类型会返回该字段
  3739. TotalSendAmount *int64 `json:"total_send_amount,omitempty"`
  3740. // 批次当天已发放的券数量,设置了单天发放上限的满减、折扣、换购类型返回该字段
  3741. TodaySendNum *int64 `json:"today_send_num,omitempty"`
  3742. // 批次当天已发放的预算金额,设置了当天发放上限的满减券类型返回该字段
  3743. TodaySendAmount *int64 `json:"today_send_amount,omitempty"`
  3744. }
  3745. func (o SendCount) MarshalJSON() ([]byte, error) {
  3746. toSerialize := map[string]interface{}{}
  3747. if o.TotalSendNum != nil {
  3748. toSerialize["total_send_num"] = o.TotalSendNum
  3749. }
  3750. if o.TotalSendAmount != nil {
  3751. toSerialize["total_send_amount"] = o.TotalSendAmount
  3752. }
  3753. if o.TodaySendNum != nil {
  3754. toSerialize["today_send_num"] = o.TodaySendNum
  3755. }
  3756. if o.TodaySendAmount != nil {
  3757. toSerialize["today_send_amount"] = o.TodaySendAmount
  3758. }
  3759. return json.Marshal(toSerialize)
  3760. }
  3761. func (o SendCount) String() string {
  3762. var ret string
  3763. if o.TotalSendNum == nil {
  3764. ret += "TotalSendNum:<nil>, "
  3765. } else {
  3766. ret += fmt.Sprintf("TotalSendNum:%v, ", *o.TotalSendNum)
  3767. }
  3768. if o.TotalSendAmount == nil {
  3769. ret += "TotalSendAmount:<nil>, "
  3770. } else {
  3771. ret += fmt.Sprintf("TotalSendAmount:%v, ", *o.TotalSendAmount)
  3772. }
  3773. if o.TodaySendNum == nil {
  3774. ret += "TodaySendNum:<nil>, "
  3775. } else {
  3776. ret += fmt.Sprintf("TodaySendNum:%v, ", *o.TodaySendNum)
  3777. }
  3778. if o.TodaySendAmount == nil {
  3779. ret += "TodaySendAmount:<nil>"
  3780. } else {
  3781. ret += fmt.Sprintf("TodaySendAmount:%v", *o.TodaySendAmount)
  3782. }
  3783. return fmt.Sprintf("SendCount{%s}", ret)
  3784. }
  3785. func (o SendCount) Clone() *SendCount {
  3786. ret := SendCount{}
  3787. if o.TotalSendNum != nil {
  3788. ret.TotalSendNum = new(int64)
  3789. *ret.TotalSendNum = *o.TotalSendNum
  3790. }
  3791. if o.TotalSendAmount != nil {
  3792. ret.TotalSendAmount = new(int64)
  3793. *ret.TotalSendAmount = *o.TotalSendAmount
  3794. }
  3795. if o.TodaySendNum != nil {
  3796. ret.TodaySendNum = new(int64)
  3797. *ret.TodaySendNum = *o.TodaySendNum
  3798. }
  3799. if o.TodaySendAmount != nil {
  3800. ret.TodaySendAmount = new(int64)
  3801. *ret.TodaySendAmount = *o.TodaySendAmount
  3802. }
  3803. return &ret
  3804. }
  3805. // SendCouponRequest
  3806. type SendCouponRequest struct {
  3807. // 用户的唯一标识,必填
  3808. Openid *string `json:"openid"`
  3809. // 发券方AppID
  3810. Appid *string `json:"appid"`
  3811. // 批次号
  3812. StockId *string `json:"stock_id"`
  3813. // 发券凭证,可包含英文字母,数字,|,_,*,-等内容,不允许出现其他不合法符号,需在单个批次单个用户下确保唯一性
  3814. OutRequestNo *string `json:"out_request_no"`
  3815. // 要求接口指定code发券的批次必传
  3816. CouponCode *string `json:"coupon_code,omitempty"`
  3817. }
  3818. func (o SendCouponRequest) MarshalJSON() ([]byte, error) {
  3819. toSerialize := map[string]interface{}{}
  3820. if o.Openid == nil {
  3821. return nil, fmt.Errorf("field `Openid` is required and must be specified in SendCouponRequest")
  3822. }
  3823. toSerialize["openid"] = o.Openid
  3824. if o.Appid == nil {
  3825. return nil, fmt.Errorf("field `Appid` is required and must be specified in SendCouponRequest")
  3826. }
  3827. toSerialize["appid"] = o.Appid
  3828. if o.StockId == nil {
  3829. return nil, fmt.Errorf("field `StockId` is required and must be specified in SendCouponRequest")
  3830. }
  3831. toSerialize["stock_id"] = o.StockId
  3832. if o.OutRequestNo == nil {
  3833. return nil, fmt.Errorf("field `OutRequestNo` is required and must be specified in SendCouponRequest")
  3834. }
  3835. toSerialize["out_request_no"] = o.OutRequestNo
  3836. if o.CouponCode != nil {
  3837. toSerialize["coupon_code"] = o.CouponCode
  3838. }
  3839. return json.Marshal(toSerialize)
  3840. }
  3841. func (o SendCouponRequest) String() string {
  3842. var ret string
  3843. if o.Openid == nil {
  3844. ret += "Openid:<nil>, "
  3845. } else {
  3846. ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
  3847. }
  3848. if o.Appid == nil {
  3849. ret += "Appid:<nil>, "
  3850. } else {
  3851. ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
  3852. }
  3853. if o.StockId == nil {
  3854. ret += "StockId:<nil>, "
  3855. } else {
  3856. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  3857. }
  3858. if o.OutRequestNo == nil {
  3859. ret += "OutRequestNo:<nil>, "
  3860. } else {
  3861. ret += fmt.Sprintf("OutRequestNo:%v, ", *o.OutRequestNo)
  3862. }
  3863. if o.CouponCode == nil {
  3864. ret += "CouponCode:<nil>"
  3865. } else {
  3866. ret += fmt.Sprintf("CouponCode:%v", *o.CouponCode)
  3867. }
  3868. return fmt.Sprintf("SendCouponRequest{%s}", ret)
  3869. }
  3870. func (o SendCouponRequest) Clone() *SendCouponRequest {
  3871. ret := SendCouponRequest{}
  3872. if o.Openid != nil {
  3873. ret.Openid = new(string)
  3874. *ret.Openid = *o.Openid
  3875. }
  3876. if o.Appid != nil {
  3877. ret.Appid = new(string)
  3878. *ret.Appid = *o.Appid
  3879. }
  3880. if o.StockId != nil {
  3881. ret.StockId = new(string)
  3882. *ret.StockId = *o.StockId
  3883. }
  3884. if o.OutRequestNo != nil {
  3885. ret.OutRequestNo = new(string)
  3886. *ret.OutRequestNo = *o.OutRequestNo
  3887. }
  3888. if o.CouponCode != nil {
  3889. ret.CouponCode = new(string)
  3890. *ret.CouponCode = *o.CouponCode
  3891. }
  3892. return &ret
  3893. }
  3894. // SendCouponResponse
  3895. type SendCouponResponse struct {
  3896. // 发券结果
  3897. SendCouponResult *SendCouponResult `json:"send_coupon_result,omitempty"`
  3898. }
  3899. func (o SendCouponResponse) MarshalJSON() ([]byte, error) {
  3900. toSerialize := map[string]interface{}{}
  3901. if o.SendCouponResult != nil {
  3902. toSerialize["send_coupon_result"] = o.SendCouponResult
  3903. }
  3904. return json.Marshal(toSerialize)
  3905. }
  3906. func (o SendCouponResponse) String() string {
  3907. var ret string
  3908. ret += fmt.Sprintf("SendCouponResult:%v", o.SendCouponResult)
  3909. return fmt.Sprintf("SendCouponResponse{%s}", ret)
  3910. }
  3911. func (o SendCouponResponse) Clone() *SendCouponResponse {
  3912. ret := SendCouponResponse{}
  3913. if o.SendCouponResult != nil {
  3914. ret.SendCouponResult = o.SendCouponResult.Clone()
  3915. }
  3916. return &ret
  3917. }
  3918. // SendCouponResult
  3919. type SendCouponResult struct {
  3920. // 微信支付券批次ID
  3921. StockId *string `json:"stock_id,omitempty"`
  3922. // 发券凭证,可包含英文字母,数字,|,_,*,-等内容,不允许出现其他不合法符号,需在单个批次单个用户下确保唯一性
  3923. OutRequestNo *string `json:"out_request_no,omitempty"`
  3924. // 券的唯一标识
  3925. CouponCode *string `json:"coupon_code,omitempty"`
  3926. }
  3927. func (o SendCouponResult) MarshalJSON() ([]byte, error) {
  3928. toSerialize := map[string]interface{}{}
  3929. if o.StockId != nil {
  3930. toSerialize["stock_id"] = o.StockId
  3931. }
  3932. if o.OutRequestNo != nil {
  3933. toSerialize["out_request_no"] = o.OutRequestNo
  3934. }
  3935. if o.CouponCode != nil {
  3936. toSerialize["coupon_code"] = o.CouponCode
  3937. }
  3938. return json.Marshal(toSerialize)
  3939. }
  3940. func (o SendCouponResult) String() string {
  3941. var ret string
  3942. if o.StockId == nil {
  3943. ret += "StockId:<nil>, "
  3944. } else {
  3945. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  3946. }
  3947. if o.OutRequestNo == nil {
  3948. ret += "OutRequestNo:<nil>, "
  3949. } else {
  3950. ret += fmt.Sprintf("OutRequestNo:%v, ", *o.OutRequestNo)
  3951. }
  3952. if o.CouponCode == nil {
  3953. ret += "CouponCode:<nil>"
  3954. } else {
  3955. ret += fmt.Sprintf("CouponCode:%v", *o.CouponCode)
  3956. }
  3957. return fmt.Sprintf("SendCouponResult{%s}", ret)
  3958. }
  3959. func (o SendCouponResult) Clone() *SendCouponResult {
  3960. ret := SendCouponResult{}
  3961. if o.StockId != nil {
  3962. ret.StockId = new(string)
  3963. *ret.StockId = *o.StockId
  3964. }
  3965. if o.OutRequestNo != nil {
  3966. ret.OutRequestNo = new(string)
  3967. *ret.OutRequestNo = *o.OutRequestNo
  3968. }
  3969. if o.CouponCode != nil {
  3970. ret.CouponCode = new(string)
  3971. *ret.CouponCode = *o.CouponCode
  3972. }
  3973. return &ret
  3974. }
  3975. // SendGovCardRequest
  3976. type SendGovCardRequest struct {
  3977. // 消费券通用卡卡包card_id
  3978. CardId *string `json:"card_id"`
  3979. // 消费卡cardi\\_d创建方的AppID,需与API调用方商户号有绑定关系,入参中的用户OpenID也需用此AppID生成
  3980. Appid *string `json:"appid"`
  3981. // 待发券用户的OpenID,需为消费卡创建方AppID生成的OpenID
  3982. Openid *string `json:"openid"`
  3983. // 商户此次发放凭据号。推荐使用大小写字母和数字,不同添加请求发放凭据号不同,商户侧需保证同一发券请求的out_request_no+send_time唯一性
  3984. OutRequestNo *string `json:"out_request_no"`
  3985. // 单次请求发卡时间,消费卡在商户系统的实际发放时间,为东八区标准时间(UTC+8)。商户需保证同一次请求的out_request_no+send_time唯一。由于系统限制,暂不支持传入早于当前时间24小时以上的时间进行发券请求。
  3986. SendTime *string `json:"send_time"`
  3987. }
  3988. func (o SendGovCardRequest) MarshalJSON() ([]byte, error) {
  3989. toSerialize := map[string]interface{}{}
  3990. if o.CardId == nil {
  3991. return nil, fmt.Errorf("field `CardId` is required and must be specified in SendGovCardRequest")
  3992. }
  3993. toSerialize["card_id"] = o.CardId
  3994. if o.Appid == nil {
  3995. return nil, fmt.Errorf("field `Appid` is required and must be specified in SendGovCardRequest")
  3996. }
  3997. toSerialize["appid"] = o.Appid
  3998. if o.Openid == nil {
  3999. return nil, fmt.Errorf("field `Openid` is required and must be specified in SendGovCardRequest")
  4000. }
  4001. toSerialize["openid"] = o.Openid
  4002. if o.OutRequestNo == nil {
  4003. return nil, fmt.Errorf("field `OutRequestNo` is required and must be specified in SendGovCardRequest")
  4004. }
  4005. toSerialize["out_request_no"] = o.OutRequestNo
  4006. if o.SendTime == nil {
  4007. return nil, fmt.Errorf("field `SendTime` is required and must be specified in SendGovCardRequest")
  4008. }
  4009. toSerialize["send_time"] = o.SendTime
  4010. return json.Marshal(toSerialize)
  4011. }
  4012. func (o SendGovCardRequest) String() string {
  4013. var ret string
  4014. if o.CardId == nil {
  4015. ret += "CardId:<nil>, "
  4016. } else {
  4017. ret += fmt.Sprintf("CardId:%v, ", *o.CardId)
  4018. }
  4019. if o.Appid == nil {
  4020. ret += "Appid:<nil>, "
  4021. } else {
  4022. ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
  4023. }
  4024. if o.Openid == nil {
  4025. ret += "Openid:<nil>, "
  4026. } else {
  4027. ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
  4028. }
  4029. if o.OutRequestNo == nil {
  4030. ret += "OutRequestNo:<nil>, "
  4031. } else {
  4032. ret += fmt.Sprintf("OutRequestNo:%v, ", *o.OutRequestNo)
  4033. }
  4034. if o.SendTime == nil {
  4035. ret += "SendTime:<nil>"
  4036. } else {
  4037. ret += fmt.Sprintf("SendTime:%v", *o.SendTime)
  4038. }
  4039. return fmt.Sprintf("SendGovCardRequest{%s}", ret)
  4040. }
  4041. func (o SendGovCardRequest) Clone() *SendGovCardRequest {
  4042. ret := SendGovCardRequest{}
  4043. if o.CardId != nil {
  4044. ret.CardId = new(string)
  4045. *ret.CardId = *o.CardId
  4046. }
  4047. if o.Appid != nil {
  4048. ret.Appid = new(string)
  4049. *ret.Appid = *o.Appid
  4050. }
  4051. if o.Openid != nil {
  4052. ret.Openid = new(string)
  4053. *ret.Openid = *o.Openid
  4054. }
  4055. if o.OutRequestNo != nil {
  4056. ret.OutRequestNo = new(string)
  4057. *ret.OutRequestNo = *o.OutRequestNo
  4058. }
  4059. if o.SendTime != nil {
  4060. ret.SendTime = new(string)
  4061. *ret.SendTime = *o.SendTime
  4062. }
  4063. return &ret
  4064. }
  4065. // SetCouponNotifyRequest
  4066. type SetCouponNotifyRequest struct {
  4067. // 商户号,不填默认查询调用方商户号
  4068. Mchid *string `json:"mchid,omitempty"`
  4069. // 商户提供的用于接收商家券事件通知的URL地址,必须支持HTTPS。
  4070. NotifyUrl *string `json:"notify_url"`
  4071. }
  4072. func (o SetCouponNotifyRequest) MarshalJSON() ([]byte, error) {
  4073. toSerialize := map[string]interface{}{}
  4074. if o.Mchid != nil {
  4075. toSerialize["mchid"] = o.Mchid
  4076. }
  4077. if o.NotifyUrl == nil {
  4078. return nil, fmt.Errorf("field `NotifyUrl` is required and must be specified in SetCouponNotifyRequest")
  4079. }
  4080. toSerialize["notify_url"] = o.NotifyUrl
  4081. return json.Marshal(toSerialize)
  4082. }
  4083. func (o SetCouponNotifyRequest) String() string {
  4084. var ret string
  4085. if o.Mchid == nil {
  4086. ret += "Mchid:<nil>, "
  4087. } else {
  4088. ret += fmt.Sprintf("Mchid:%v, ", *o.Mchid)
  4089. }
  4090. if o.NotifyUrl == nil {
  4091. ret += "NotifyUrl:<nil>"
  4092. } else {
  4093. ret += fmt.Sprintf("NotifyUrl:%v", *o.NotifyUrl)
  4094. }
  4095. return fmt.Sprintf("SetCouponNotifyRequest{%s}", ret)
  4096. }
  4097. func (o SetCouponNotifyRequest) Clone() *SetCouponNotifyRequest {
  4098. ret := SetCouponNotifyRequest{}
  4099. if o.Mchid != nil {
  4100. ret.Mchid = new(string)
  4101. *ret.Mchid = *o.Mchid
  4102. }
  4103. if o.NotifyUrl != nil {
  4104. ret.NotifyUrl = new(string)
  4105. *ret.NotifyUrl = *o.NotifyUrl
  4106. }
  4107. return &ret
  4108. }
  4109. // SetCouponNotifyResponse
  4110. type SetCouponNotifyResponse struct {
  4111. // 修改时间,遵循[rfc3339](https://datatracker.ietf.org/doc/html/rfc3339)标准格式,格式为yyyy-MM-DDTHH:mm:ss+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秒。
  4112. UpdateTime *string `json:"update_time"`
  4113. // 商户提供的用于接收商家券事件通知的URL地址,必须支持HTTPS。
  4114. NotifyUrl *string `json:"notify_url"`
  4115. // 商户号
  4116. Mchid *string `json:"mchid"`
  4117. }
  4118. func (o SetCouponNotifyResponse) MarshalJSON() ([]byte, error) {
  4119. toSerialize := map[string]interface{}{}
  4120. if o.UpdateTime == nil {
  4121. return nil, fmt.Errorf("field `UpdateTime` is required and must be specified in SetCouponNotifyResponse")
  4122. }
  4123. toSerialize["update_time"] = o.UpdateTime
  4124. if o.NotifyUrl == nil {
  4125. return nil, fmt.Errorf("field `NotifyUrl` is required and must be specified in SetCouponNotifyResponse")
  4126. }
  4127. toSerialize["notify_url"] = o.NotifyUrl
  4128. if o.Mchid == nil {
  4129. return nil, fmt.Errorf("field `Mchid` is required and must be specified in SetCouponNotifyResponse")
  4130. }
  4131. toSerialize["mchid"] = o.Mchid
  4132. return json.Marshal(toSerialize)
  4133. }
  4134. func (o SetCouponNotifyResponse) String() string {
  4135. var ret string
  4136. if o.UpdateTime == nil {
  4137. ret += "UpdateTime:<nil>, "
  4138. } else {
  4139. ret += fmt.Sprintf("UpdateTime:%v, ", *o.UpdateTime)
  4140. }
  4141. if o.NotifyUrl == nil {
  4142. ret += "NotifyUrl:<nil>, "
  4143. } else {
  4144. ret += fmt.Sprintf("NotifyUrl:%v, ", *o.NotifyUrl)
  4145. }
  4146. if o.Mchid == nil {
  4147. ret += "Mchid:<nil>"
  4148. } else {
  4149. ret += fmt.Sprintf("Mchid:%v", *o.Mchid)
  4150. }
  4151. return fmt.Sprintf("SetCouponNotifyResponse{%s}", ret)
  4152. }
  4153. func (o SetCouponNotifyResponse) Clone() *SetCouponNotifyResponse {
  4154. ret := SetCouponNotifyResponse{}
  4155. if o.UpdateTime != nil {
  4156. ret.UpdateTime = new(string)
  4157. *ret.UpdateTime = *o.UpdateTime
  4158. }
  4159. if o.NotifyUrl != nil {
  4160. ret.NotifyUrl = new(string)
  4161. *ret.NotifyUrl = *o.NotifyUrl
  4162. }
  4163. if o.Mchid != nil {
  4164. ret.Mchid = new(string)
  4165. *ret.Mchid = *o.Mchid
  4166. }
  4167. return &ret
  4168. }
  4169. // StockGetResponse
  4170. type StockGetResponse struct {
  4171. // 批次名称,字数上限为21个,一个中文汉字/英文字母/数字均占用一个字数。
  4172. StockName *string `json:"stock_name"`
  4173. // 批次是归属于哪个商户 注: 普通直连模式,该参数为直连商户号; 服务商模式,该参数为子商户号; 间连模式,该参数为子商户号。
  4174. BelongMerchant *string `json:"belong_merchant"`
  4175. // 仅配置商户可见,用于自定义信息。字数上限为20个,一个中文汉字/英文字母/数字均占用一个字数。
  4176. Comment *string `json:"comment,omitempty"`
  4177. // 用来描述批次在哪些商品可用,会显示在微信卡包中。字数上限为15个,一个中文汉字/英文字母/数字均占用一个字数。
  4178. GoodsName *string `json:"goods_name"`
  4179. // 批次类型
  4180. StockType *BusiFavorStockType `json:"stock_type"`
  4181. // 核销规则
  4182. CouponUseRule *CouponUseRule `json:"coupon_use_rule"`
  4183. // 发放规则
  4184. StockSendRule *StockSendRule `json:"stock_send_rule"`
  4185. // 卡详情页面,可选择多种入口引导用户
  4186. CustomEntrance *CustomEntrance `json:"custom_entrance,omitempty"`
  4187. // 创建批次时的样式信息
  4188. DisplayPatternInfo *DisplayPatternInfo `json:"display_pattern_info,omitempty"`
  4189. // 批次状态
  4190. StockState *StockStatus `json:"stock_state"`
  4191. // 券code模式
  4192. CouponCodeMode *CouponCodeMode `json:"coupon_code_mode"`
  4193. // 批次唯一标识
  4194. StockId *string `json:"stock_id"`
  4195. // 当且仅当coupon_code_mode(券code模式)为MERCHANT_UPLOAD(商户上传自定义code)模式时,返回该字段;返回内容为商户上传code的数量信息
  4196. CouponCodeCount *CouponCodeCount `json:"coupon_code_count,omitempty"`
  4197. // 事件回调通知商户的配置
  4198. NotifyConfig *NotifyConfig `json:"notify_config,omitempty"`
  4199. // 批次发放情况
  4200. SendCountInformation *SendCount `json:"send_count_information,omitempty"`
  4201. // 该批次发放的券是否允许进行补差 注:该字段暂未开放
  4202. Subsidy *bool `json:"subsidy,omitempty"`
  4203. }
  4204. func (o StockGetResponse) MarshalJSON() ([]byte, error) {
  4205. toSerialize := map[string]interface{}{}
  4206. if o.StockName == nil {
  4207. return nil, fmt.Errorf("field `StockName` is required and must be specified in StockGetResponse")
  4208. }
  4209. toSerialize["stock_name"] = o.StockName
  4210. if o.BelongMerchant == nil {
  4211. return nil, fmt.Errorf("field `BelongMerchant` is required and must be specified in StockGetResponse")
  4212. }
  4213. toSerialize["belong_merchant"] = o.BelongMerchant
  4214. if o.Comment != nil {
  4215. toSerialize["comment"] = o.Comment
  4216. }
  4217. if o.GoodsName == nil {
  4218. return nil, fmt.Errorf("field `GoodsName` is required and must be specified in StockGetResponse")
  4219. }
  4220. toSerialize["goods_name"] = o.GoodsName
  4221. if o.StockType == nil {
  4222. return nil, fmt.Errorf("field `StockType` is required and must be specified in StockGetResponse")
  4223. }
  4224. toSerialize["stock_type"] = o.StockType
  4225. if o.CouponUseRule == nil {
  4226. return nil, fmt.Errorf("field `CouponUseRule` is required and must be specified in StockGetResponse")
  4227. }
  4228. toSerialize["coupon_use_rule"] = o.CouponUseRule
  4229. if o.StockSendRule == nil {
  4230. return nil, fmt.Errorf("field `StockSendRule` is required and must be specified in StockGetResponse")
  4231. }
  4232. toSerialize["stock_send_rule"] = o.StockSendRule
  4233. if o.CustomEntrance != nil {
  4234. toSerialize["custom_entrance"] = o.CustomEntrance
  4235. }
  4236. if o.DisplayPatternInfo != nil {
  4237. toSerialize["display_pattern_info"] = o.DisplayPatternInfo
  4238. }
  4239. if o.StockState == nil {
  4240. return nil, fmt.Errorf("field `StockState` is required and must be specified in StockGetResponse")
  4241. }
  4242. toSerialize["stock_state"] = o.StockState
  4243. if o.CouponCodeMode == nil {
  4244. return nil, fmt.Errorf("field `CouponCodeMode` is required and must be specified in StockGetResponse")
  4245. }
  4246. toSerialize["coupon_code_mode"] = o.CouponCodeMode
  4247. if o.StockId == nil {
  4248. return nil, fmt.Errorf("field `StockId` is required and must be specified in StockGetResponse")
  4249. }
  4250. toSerialize["stock_id"] = o.StockId
  4251. if o.CouponCodeCount != nil {
  4252. toSerialize["coupon_code_count"] = o.CouponCodeCount
  4253. }
  4254. if o.NotifyConfig != nil {
  4255. toSerialize["notify_config"] = o.NotifyConfig
  4256. }
  4257. if o.SendCountInformation != nil {
  4258. toSerialize["send_count_information"] = o.SendCountInformation
  4259. }
  4260. if o.Subsidy != nil {
  4261. toSerialize["subsidy"] = o.Subsidy
  4262. }
  4263. return json.Marshal(toSerialize)
  4264. }
  4265. func (o StockGetResponse) String() string {
  4266. var ret string
  4267. if o.StockName == nil {
  4268. ret += "StockName:<nil>, "
  4269. } else {
  4270. ret += fmt.Sprintf("StockName:%v, ", *o.StockName)
  4271. }
  4272. if o.BelongMerchant == nil {
  4273. ret += "BelongMerchant:<nil>, "
  4274. } else {
  4275. ret += fmt.Sprintf("BelongMerchant:%v, ", *o.BelongMerchant)
  4276. }
  4277. if o.Comment == nil {
  4278. ret += "Comment:<nil>, "
  4279. } else {
  4280. ret += fmt.Sprintf("Comment:%v, ", *o.Comment)
  4281. }
  4282. if o.GoodsName == nil {
  4283. ret += "GoodsName:<nil>, "
  4284. } else {
  4285. ret += fmt.Sprintf("GoodsName:%v, ", *o.GoodsName)
  4286. }
  4287. if o.StockType == nil {
  4288. ret += "StockType:<nil>, "
  4289. } else {
  4290. ret += fmt.Sprintf("StockType:%v, ", *o.StockType)
  4291. }
  4292. ret += fmt.Sprintf("CouponUseRule:%v, ", o.CouponUseRule)
  4293. ret += fmt.Sprintf("StockSendRule:%v, ", o.StockSendRule)
  4294. ret += fmt.Sprintf("CustomEntrance:%v, ", o.CustomEntrance)
  4295. ret += fmt.Sprintf("DisplayPatternInfo:%v, ", o.DisplayPatternInfo)
  4296. if o.StockState == nil {
  4297. ret += "StockState:<nil>, "
  4298. } else {
  4299. ret += fmt.Sprintf("StockState:%v, ", *o.StockState)
  4300. }
  4301. if o.CouponCodeMode == nil {
  4302. ret += "CouponCodeMode:<nil>, "
  4303. } else {
  4304. ret += fmt.Sprintf("CouponCodeMode:%v, ", *o.CouponCodeMode)
  4305. }
  4306. if o.StockId == nil {
  4307. ret += "StockId:<nil>, "
  4308. } else {
  4309. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  4310. }
  4311. ret += fmt.Sprintf("CouponCodeCount:%v, ", o.CouponCodeCount)
  4312. ret += fmt.Sprintf("NotifyConfig:%v, ", o.NotifyConfig)
  4313. ret += fmt.Sprintf("SendCountInformation:%v, ", o.SendCountInformation)
  4314. if o.Subsidy == nil {
  4315. ret += "Subsidy:<nil>"
  4316. } else {
  4317. ret += fmt.Sprintf("Subsidy:%v", *o.Subsidy)
  4318. }
  4319. return fmt.Sprintf("StockGetResponse{%s}", ret)
  4320. }
  4321. func (o StockGetResponse) Clone() *StockGetResponse {
  4322. ret := StockGetResponse{}
  4323. if o.StockName != nil {
  4324. ret.StockName = new(string)
  4325. *ret.StockName = *o.StockName
  4326. }
  4327. if o.BelongMerchant != nil {
  4328. ret.BelongMerchant = new(string)
  4329. *ret.BelongMerchant = *o.BelongMerchant
  4330. }
  4331. if o.Comment != nil {
  4332. ret.Comment = new(string)
  4333. *ret.Comment = *o.Comment
  4334. }
  4335. if o.GoodsName != nil {
  4336. ret.GoodsName = new(string)
  4337. *ret.GoodsName = *o.GoodsName
  4338. }
  4339. if o.StockType != nil {
  4340. ret.StockType = new(BusiFavorStockType)
  4341. *ret.StockType = *o.StockType
  4342. }
  4343. if o.CouponUseRule != nil {
  4344. ret.CouponUseRule = o.CouponUseRule.Clone()
  4345. }
  4346. if o.StockSendRule != nil {
  4347. ret.StockSendRule = o.StockSendRule.Clone()
  4348. }
  4349. if o.CustomEntrance != nil {
  4350. ret.CustomEntrance = o.CustomEntrance.Clone()
  4351. }
  4352. if o.DisplayPatternInfo != nil {
  4353. ret.DisplayPatternInfo = o.DisplayPatternInfo.Clone()
  4354. }
  4355. if o.StockState != nil {
  4356. ret.StockState = new(StockStatus)
  4357. *ret.StockState = *o.StockState
  4358. }
  4359. if o.CouponCodeMode != nil {
  4360. ret.CouponCodeMode = new(CouponCodeMode)
  4361. *ret.CouponCodeMode = *o.CouponCodeMode
  4362. }
  4363. if o.StockId != nil {
  4364. ret.StockId = new(string)
  4365. *ret.StockId = *o.StockId
  4366. }
  4367. if o.CouponCodeCount != nil {
  4368. ret.CouponCodeCount = o.CouponCodeCount.Clone()
  4369. }
  4370. if o.NotifyConfig != nil {
  4371. ret.NotifyConfig = o.NotifyConfig.Clone()
  4372. }
  4373. if o.SendCountInformation != nil {
  4374. ret.SendCountInformation = o.SendCountInformation.Clone()
  4375. }
  4376. if o.Subsidy != nil {
  4377. ret.Subsidy = new(bool)
  4378. *ret.Subsidy = *o.Subsidy
  4379. }
  4380. return &ret
  4381. }
  4382. // StockSendRule
  4383. type StockSendRule struct {
  4384. // 总预算金额,单位分 注:该字段暂未开放
  4385. MaxAmount *int64 `json:"max_amount,omitempty"`
  4386. // 批次最大可发放个数限制 特殊规则:取值范围 1 ≤ value ≤ 1000000000
  4387. MaxCoupons *int64 `json:"max_coupons,omitempty"`
  4388. // 用户可领个数,每个用户最多100张券。
  4389. MaxCouponsPerUser *int64 `json:"max_coupons_per_user"`
  4390. // 单天发放上限金额 注:该字段暂未开放
  4391. MaxAmountByDay *int64 `json:"max_amount_by_day,omitempty"`
  4392. // 单天发放上限个数(stock\\_type为DISCOUNT或EXCHANGE时可传入此字段控制单天发放上限)。 特殊规则:取值范围 1 ≤ value ≤ 1000000000
  4393. MaxCouponsByDay *int64 `json:"max_coupons_by_day,omitempty"`
  4394. // 不填默认否,枚举值: true:是 false:否 注:自然人防刷即同证件号下的所有账户合并计算的限领次数(限领次数指的是参数字段“用户最大领取个数”填写的值)
  4395. NaturalPersonLimit *bool `json:"natural_person_limit,omitempty"`
  4396. // true-是;false-否,不填默认否
  4397. PreventApiAbuse *bool `json:"prevent_api_abuse,omitempty"`
  4398. // 不填默认否,枚举值: true:是 false:否 该字段暂未开放
  4399. Transferable *bool `json:"transferable,omitempty"`
  4400. // 不填默认否,枚举值: true:是 false:否 该字段暂未开放
  4401. Shareable *bool `json:"shareable,omitempty"`
  4402. }
  4403. func (o StockSendRule) MarshalJSON() ([]byte, error) {
  4404. toSerialize := map[string]interface{}{}
  4405. if o.MaxAmount != nil {
  4406. toSerialize["max_amount"] = o.MaxAmount
  4407. }
  4408. if o.MaxCoupons != nil {
  4409. toSerialize["max_coupons"] = o.MaxCoupons
  4410. }
  4411. if o.MaxCouponsPerUser == nil {
  4412. return nil, fmt.Errorf("field `MaxCouponsPerUser` is required and must be specified in StockSendRule")
  4413. }
  4414. toSerialize["max_coupons_per_user"] = o.MaxCouponsPerUser
  4415. if o.MaxAmountByDay != nil {
  4416. toSerialize["max_amount_by_day"] = o.MaxAmountByDay
  4417. }
  4418. if o.MaxCouponsByDay != nil {
  4419. toSerialize["max_coupons_by_day"] = o.MaxCouponsByDay
  4420. }
  4421. if o.NaturalPersonLimit != nil {
  4422. toSerialize["natural_person_limit"] = o.NaturalPersonLimit
  4423. }
  4424. if o.PreventApiAbuse != nil {
  4425. toSerialize["prevent_api_abuse"] = o.PreventApiAbuse
  4426. }
  4427. if o.Transferable != nil {
  4428. toSerialize["transferable"] = o.Transferable
  4429. }
  4430. if o.Shareable != nil {
  4431. toSerialize["shareable"] = o.Shareable
  4432. }
  4433. return json.Marshal(toSerialize)
  4434. }
  4435. func (o StockSendRule) String() string {
  4436. var ret string
  4437. if o.MaxAmount == nil {
  4438. ret += "MaxAmount:<nil>, "
  4439. } else {
  4440. ret += fmt.Sprintf("MaxAmount:%v, ", *o.MaxAmount)
  4441. }
  4442. if o.MaxCoupons == nil {
  4443. ret += "MaxCoupons:<nil>, "
  4444. } else {
  4445. ret += fmt.Sprintf("MaxCoupons:%v, ", *o.MaxCoupons)
  4446. }
  4447. if o.MaxCouponsPerUser == nil {
  4448. ret += "MaxCouponsPerUser:<nil>, "
  4449. } else {
  4450. ret += fmt.Sprintf("MaxCouponsPerUser:%v, ", *o.MaxCouponsPerUser)
  4451. }
  4452. if o.MaxAmountByDay == nil {
  4453. ret += "MaxAmountByDay:<nil>, "
  4454. } else {
  4455. ret += fmt.Sprintf("MaxAmountByDay:%v, ", *o.MaxAmountByDay)
  4456. }
  4457. if o.MaxCouponsByDay == nil {
  4458. ret += "MaxCouponsByDay:<nil>, "
  4459. } else {
  4460. ret += fmt.Sprintf("MaxCouponsByDay:%v, ", *o.MaxCouponsByDay)
  4461. }
  4462. if o.NaturalPersonLimit == nil {
  4463. ret += "NaturalPersonLimit:<nil>, "
  4464. } else {
  4465. ret += fmt.Sprintf("NaturalPersonLimit:%v, ", *o.NaturalPersonLimit)
  4466. }
  4467. if o.PreventApiAbuse == nil {
  4468. ret += "PreventApiAbuse:<nil>, "
  4469. } else {
  4470. ret += fmt.Sprintf("PreventApiAbuse:%v, ", *o.PreventApiAbuse)
  4471. }
  4472. if o.Transferable == nil {
  4473. ret += "Transferable:<nil>, "
  4474. } else {
  4475. ret += fmt.Sprintf("Transferable:%v, ", *o.Transferable)
  4476. }
  4477. if o.Shareable == nil {
  4478. ret += "Shareable:<nil>"
  4479. } else {
  4480. ret += fmt.Sprintf("Shareable:%v", *o.Shareable)
  4481. }
  4482. return fmt.Sprintf("StockSendRule{%s}", ret)
  4483. }
  4484. func (o StockSendRule) Clone() *StockSendRule {
  4485. ret := StockSendRule{}
  4486. if o.MaxAmount != nil {
  4487. ret.MaxAmount = new(int64)
  4488. *ret.MaxAmount = *o.MaxAmount
  4489. }
  4490. if o.MaxCoupons != nil {
  4491. ret.MaxCoupons = new(int64)
  4492. *ret.MaxCoupons = *o.MaxCoupons
  4493. }
  4494. if o.MaxCouponsPerUser != nil {
  4495. ret.MaxCouponsPerUser = new(int64)
  4496. *ret.MaxCouponsPerUser = *o.MaxCouponsPerUser
  4497. }
  4498. if o.MaxAmountByDay != nil {
  4499. ret.MaxAmountByDay = new(int64)
  4500. *ret.MaxAmountByDay = *o.MaxAmountByDay
  4501. }
  4502. if o.MaxCouponsByDay != nil {
  4503. ret.MaxCouponsByDay = new(int64)
  4504. *ret.MaxCouponsByDay = *o.MaxCouponsByDay
  4505. }
  4506. if o.NaturalPersonLimit != nil {
  4507. ret.NaturalPersonLimit = new(bool)
  4508. *ret.NaturalPersonLimit = *o.NaturalPersonLimit
  4509. }
  4510. if o.PreventApiAbuse != nil {
  4511. ret.PreventApiAbuse = new(bool)
  4512. *ret.PreventApiAbuse = *o.PreventApiAbuse
  4513. }
  4514. if o.Transferable != nil {
  4515. ret.Transferable = new(bool)
  4516. *ret.Transferable = *o.Transferable
  4517. }
  4518. if o.Shareable != nil {
  4519. ret.Shareable = new(bool)
  4520. *ret.Shareable = *o.Shareable
  4521. }
  4522. return &ret
  4523. }
  4524. // StockStatus
  4525. type StockStatus string
  4526. func (e StockStatus) Ptr() *StockStatus {
  4527. return &e
  4528. }
  4529. // Enums of StockStatus
  4530. const (
  4531. STOCKSTATUS_UNAUDIT StockStatus = "UNAUDIT"
  4532. STOCKSTATUS_RUNNING StockStatus = "RUNNING"
  4533. STOCKSTATUS_STOPED StockStatus = "STOPED"
  4534. STOCKSTATUS_PAUSED StockStatus = "PAUSED"
  4535. )
  4536. // SubsidyPayReceipt
  4537. type SubsidyPayReceipt struct {
  4538. // 补差付款唯一单号,由微信支付生成,仅在补差付款成功后有返回
  4539. SubsidyReceiptId *string `json:"subsidy_receipt_id"`
  4540. // 由微信支付生成,调用创建商家券API成功时返回的唯一批次ID
  4541. StockId *string `json:"stock_id"`
  4542. // 券的唯一标识
  4543. CouponCode *string `json:"coupon_code"`
  4544. // 微信支付下单支付成功返回的订单号
  4545. TransactionId *string `json:"transaction_id"`
  4546. // 营销补差扣款商户号
  4547. PayerMerchant *string `json:"payer_merchant"`
  4548. // 营销补差入账商户号
  4549. PayeeMerchant *string `json:"payee_merchant"`
  4550. // 单位为分,单笔订单补差金额不得超过券的优惠金额,最高补差金额为5000元 > 券的优惠金额定义: 满减券:满减金额即为优惠金额 折扣券:优惠金额 = 微信支付订单金额 ÷ 折扣比例 × (1 - 折扣比例) 换购券:不支持
  4551. Amount *int64 `json:"amount"`
  4552. // 付款备注描述,查询的时候原样带回
  4553. Description *string `json:"description"`
  4554. // 补差付款单据状态
  4555. Status *SubsidyPayReceiptStatus `json:"status"`
  4556. // 仅在补差付款失败时,返回告知对应失败的原因
  4557. FailReason *SubsidyPayReceiptFailReason `json:"fail_reason,omitempty"`
  4558. // 仅在补差付款成功时,返回完成时间。遵循[rfc3339](https://datatracker.ietf.org/doc/html/rfc3339)标准格式,格式为yyyy-MM-DDTHH:mm:ss+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秒。
  4559. SuccessTime *time.Time `json:"success_time,omitempty"`
  4560. // 商户侧需保证唯一性。可包含英文字母,数字,|,_,*,-等内容,不允许出现其他不合法符号
  4561. OutSubsidyNo *string `json:"out_subsidy_no"`
  4562. // 补差付款单据创建时间。遵循rfc3339标准格式,格式为yyyy-MM-DDTHH:mm:ss+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秒。
  4563. CreateTime *time.Time `json:"create_time,omitempty"`
  4564. }
  4565. func (o SubsidyPayReceipt) MarshalJSON() ([]byte, error) {
  4566. toSerialize := map[string]interface{}{}
  4567. if o.SubsidyReceiptId == nil {
  4568. return nil, fmt.Errorf("field `SubsidyReceiptId` is required and must be specified in SubsidyPayReceipt")
  4569. }
  4570. toSerialize["subsidy_receipt_id"] = o.SubsidyReceiptId
  4571. if o.StockId == nil {
  4572. return nil, fmt.Errorf("field `StockId` is required and must be specified in SubsidyPayReceipt")
  4573. }
  4574. toSerialize["stock_id"] = o.StockId
  4575. if o.CouponCode == nil {
  4576. return nil, fmt.Errorf("field `CouponCode` is required and must be specified in SubsidyPayReceipt")
  4577. }
  4578. toSerialize["coupon_code"] = o.CouponCode
  4579. if o.TransactionId == nil {
  4580. return nil, fmt.Errorf("field `TransactionId` is required and must be specified in SubsidyPayReceipt")
  4581. }
  4582. toSerialize["transaction_id"] = o.TransactionId
  4583. if o.PayerMerchant == nil {
  4584. return nil, fmt.Errorf("field `PayerMerchant` is required and must be specified in SubsidyPayReceipt")
  4585. }
  4586. toSerialize["payer_merchant"] = o.PayerMerchant
  4587. if o.PayeeMerchant == nil {
  4588. return nil, fmt.Errorf("field `PayeeMerchant` is required and must be specified in SubsidyPayReceipt")
  4589. }
  4590. toSerialize["payee_merchant"] = o.PayeeMerchant
  4591. if o.Amount == nil {
  4592. return nil, fmt.Errorf("field `Amount` is required and must be specified in SubsidyPayReceipt")
  4593. }
  4594. toSerialize["amount"] = o.Amount
  4595. if o.Description == nil {
  4596. return nil, fmt.Errorf("field `Description` is required and must be specified in SubsidyPayReceipt")
  4597. }
  4598. toSerialize["description"] = o.Description
  4599. if o.Status == nil {
  4600. return nil, fmt.Errorf("field `Status` is required and must be specified in SubsidyPayReceipt")
  4601. }
  4602. toSerialize["status"] = o.Status
  4603. if o.FailReason != nil {
  4604. toSerialize["fail_reason"] = o.FailReason
  4605. }
  4606. if o.SuccessTime != nil {
  4607. toSerialize["success_time"] = o.SuccessTime.Format(time.RFC3339)
  4608. }
  4609. if o.OutSubsidyNo == nil {
  4610. return nil, fmt.Errorf("field `OutSubsidyNo` is required and must be specified in SubsidyPayReceipt")
  4611. }
  4612. toSerialize["out_subsidy_no"] = o.OutSubsidyNo
  4613. if o.CreateTime != nil {
  4614. toSerialize["create_time"] = o.CreateTime.Format(time.RFC3339)
  4615. }
  4616. return json.Marshal(toSerialize)
  4617. }
  4618. func (o SubsidyPayReceipt) String() string {
  4619. var ret string
  4620. if o.SubsidyReceiptId == nil {
  4621. ret += "SubsidyReceiptId:<nil>, "
  4622. } else {
  4623. ret += fmt.Sprintf("SubsidyReceiptId:%v, ", *o.SubsidyReceiptId)
  4624. }
  4625. if o.StockId == nil {
  4626. ret += "StockId:<nil>, "
  4627. } else {
  4628. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  4629. }
  4630. if o.CouponCode == nil {
  4631. ret += "CouponCode:<nil>, "
  4632. } else {
  4633. ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
  4634. }
  4635. if o.TransactionId == nil {
  4636. ret += "TransactionId:<nil>, "
  4637. } else {
  4638. ret += fmt.Sprintf("TransactionId:%v, ", *o.TransactionId)
  4639. }
  4640. if o.PayerMerchant == nil {
  4641. ret += "PayerMerchant:<nil>, "
  4642. } else {
  4643. ret += fmt.Sprintf("PayerMerchant:%v, ", *o.PayerMerchant)
  4644. }
  4645. if o.PayeeMerchant == nil {
  4646. ret += "PayeeMerchant:<nil>, "
  4647. } else {
  4648. ret += fmt.Sprintf("PayeeMerchant:%v, ", *o.PayeeMerchant)
  4649. }
  4650. if o.Amount == nil {
  4651. ret += "Amount:<nil>, "
  4652. } else {
  4653. ret += fmt.Sprintf("Amount:%v, ", *o.Amount)
  4654. }
  4655. if o.Description == nil {
  4656. ret += "Description:<nil>, "
  4657. } else {
  4658. ret += fmt.Sprintf("Description:%v, ", *o.Description)
  4659. }
  4660. if o.Status == nil {
  4661. ret += "Status:<nil>, "
  4662. } else {
  4663. ret += fmt.Sprintf("Status:%v, ", *o.Status)
  4664. }
  4665. if o.FailReason == nil {
  4666. ret += "FailReason:<nil>, "
  4667. } else {
  4668. ret += fmt.Sprintf("FailReason:%v, ", *o.FailReason)
  4669. }
  4670. if o.SuccessTime == nil {
  4671. ret += "SuccessTime:<nil>, "
  4672. } else {
  4673. ret += fmt.Sprintf("SuccessTime:%v, ", *o.SuccessTime)
  4674. }
  4675. if o.OutSubsidyNo == nil {
  4676. ret += "OutSubsidyNo:<nil>, "
  4677. } else {
  4678. ret += fmt.Sprintf("OutSubsidyNo:%v, ", *o.OutSubsidyNo)
  4679. }
  4680. if o.CreateTime == nil {
  4681. ret += "CreateTime:<nil>"
  4682. } else {
  4683. ret += fmt.Sprintf("CreateTime:%v", *o.CreateTime)
  4684. }
  4685. return fmt.Sprintf("SubsidyPayReceipt{%s}", ret)
  4686. }
  4687. func (o SubsidyPayReceipt) Clone() *SubsidyPayReceipt {
  4688. ret := SubsidyPayReceipt{}
  4689. if o.SubsidyReceiptId != nil {
  4690. ret.SubsidyReceiptId = new(string)
  4691. *ret.SubsidyReceiptId = *o.SubsidyReceiptId
  4692. }
  4693. if o.StockId != nil {
  4694. ret.StockId = new(string)
  4695. *ret.StockId = *o.StockId
  4696. }
  4697. if o.CouponCode != nil {
  4698. ret.CouponCode = new(string)
  4699. *ret.CouponCode = *o.CouponCode
  4700. }
  4701. if o.TransactionId != nil {
  4702. ret.TransactionId = new(string)
  4703. *ret.TransactionId = *o.TransactionId
  4704. }
  4705. if o.PayerMerchant != nil {
  4706. ret.PayerMerchant = new(string)
  4707. *ret.PayerMerchant = *o.PayerMerchant
  4708. }
  4709. if o.PayeeMerchant != nil {
  4710. ret.PayeeMerchant = new(string)
  4711. *ret.PayeeMerchant = *o.PayeeMerchant
  4712. }
  4713. if o.Amount != nil {
  4714. ret.Amount = new(int64)
  4715. *ret.Amount = *o.Amount
  4716. }
  4717. if o.Description != nil {
  4718. ret.Description = new(string)
  4719. *ret.Description = *o.Description
  4720. }
  4721. if o.Status != nil {
  4722. ret.Status = new(SubsidyPayReceiptStatus)
  4723. *ret.Status = *o.Status
  4724. }
  4725. if o.FailReason != nil {
  4726. ret.FailReason = new(SubsidyPayReceiptFailReason)
  4727. *ret.FailReason = *o.FailReason
  4728. }
  4729. if o.SuccessTime != nil {
  4730. ret.SuccessTime = new(time.Time)
  4731. *ret.SuccessTime = *o.SuccessTime
  4732. }
  4733. if o.OutSubsidyNo != nil {
  4734. ret.OutSubsidyNo = new(string)
  4735. *ret.OutSubsidyNo = *o.OutSubsidyNo
  4736. }
  4737. if o.CreateTime != nil {
  4738. ret.CreateTime = new(time.Time)
  4739. *ret.CreateTime = *o.CreateTime
  4740. }
  4741. return &ret
  4742. }
  4743. // SubsidyPayReceiptFailReason
  4744. type SubsidyPayReceiptFailReason string
  4745. func (e SubsidyPayReceiptFailReason) Ptr() *SubsidyPayReceiptFailReason {
  4746. return &e
  4747. }
  4748. // Enums of SubsidyPayReceiptFailReason
  4749. const (
  4750. SUBSIDYPAYRECEIPTFAILREASON_PAY_RECEIPT_INSUFFICIENT_BALANCE SubsidyPayReceiptFailReason = "PAY_RECEIPT_INSUFFICIENT_BALANCE"
  4751. SUBSIDYPAYRECEIPTFAILREASON_PAY_RECEIPT_NOT_INCOMESPLIT_ORDER SubsidyPayReceiptFailReason = "PAY_RECEIPT_NOT_INCOMESPLIT_ORDER"
  4752. SUBSIDYPAYRECEIPTFAILREASON_PAY_RECEIPT_EXCEED_SUBSIDY_AMOUNT_QUOTA SubsidyPayReceiptFailReason = "PAY_RECEIPT_EXCEED_SUBSIDY_AMOUNT_QUOTA"
  4753. SUBSIDYPAYRECEIPTFAILREASON_PAY_RECEIPT_EXCEED_SUBSIDY_COUNT_QUOTA SubsidyPayReceiptFailReason = "PAY_RECEIPT_EXCEED_SUBSIDY_COUNT_QUOTA"
  4754. SUBSIDYPAYRECEIPTFAILREASON_PAY_RECEIPT_OTHER SubsidyPayReceiptFailReason = "PAY_RECEIPT_OTHER"
  4755. )
  4756. // SubsidyPayReceiptListResponse
  4757. type SubsidyPayReceiptListResponse struct {
  4758. // 如果这张券发生过补差付款,会有补差单据信息返回
  4759. PayReceiptList []SubsidyPayReceipt `json:"pay_receipt_list,omitempty"`
  4760. }
  4761. func (o SubsidyPayReceiptListResponse) MarshalJSON() ([]byte, error) {
  4762. toSerialize := map[string]interface{}{}
  4763. if o.PayReceiptList != nil {
  4764. toSerialize["pay_receipt_list"] = o.PayReceiptList
  4765. }
  4766. return json.Marshal(toSerialize)
  4767. }
  4768. func (o SubsidyPayReceiptListResponse) String() string {
  4769. var ret string
  4770. ret += fmt.Sprintf("PayReceiptList:%v", o.PayReceiptList)
  4771. return fmt.Sprintf("SubsidyPayReceiptListResponse{%s}", ret)
  4772. }
  4773. func (o SubsidyPayReceiptListResponse) Clone() *SubsidyPayReceiptListResponse {
  4774. ret := SubsidyPayReceiptListResponse{}
  4775. if o.PayReceiptList != nil {
  4776. ret.PayReceiptList = make([]SubsidyPayReceipt, len(o.PayReceiptList))
  4777. for i, item := range o.PayReceiptList {
  4778. ret.PayReceiptList[i] = *item.Clone()
  4779. }
  4780. }
  4781. return &ret
  4782. }
  4783. // SubsidyPayReceiptStatus
  4784. type SubsidyPayReceiptStatus string
  4785. func (e SubsidyPayReceiptStatus) Ptr() *SubsidyPayReceiptStatus {
  4786. return &e
  4787. }
  4788. // Enums of SubsidyPayReceiptStatus
  4789. const (
  4790. SUBSIDYPAYRECEIPTSTATUS_PAY_RECEIPT_UNKNOWN SubsidyPayReceiptStatus = "PAY_RECEIPT_UNKNOWN"
  4791. SUBSIDYPAYRECEIPTSTATUS_PAY_RECEIPT_ACCEPTED SubsidyPayReceiptStatus = "PAY_RECEIPT_ACCEPTED"
  4792. SUBSIDYPAYRECEIPTSTATUS_PAY_RECEIPT_SUCCESS SubsidyPayReceiptStatus = "PAY_RECEIPT_SUCCESS"
  4793. SUBSIDYPAYRECEIPTSTATUS_PAY_RECEIPT_FAIL SubsidyPayReceiptStatus = "PAY_RECEIPT_FAIL"
  4794. SUBSIDYPAYRECEIPTSTATUS_PAY_RECEIPT_RETURNING SubsidyPayReceiptStatus = "PAY_RECEIPT_RETURNING"
  4795. SUBSIDYPAYRECEIPTSTATUS_PAY_RECEIPT_PARTIAL_RETURN SubsidyPayReceiptStatus = "PAY_RECEIPT_PARTIAL_RETURN"
  4796. SUBSIDYPAYRECEIPTSTATUS_PAY_RECEIPT_FULL_RETURN SubsidyPayReceiptStatus = "PAY_RECEIPT_FULL_RETURN"
  4797. )
  4798. // SubsidyPayRequest
  4799. type SubsidyPayRequest struct {
  4800. // 由微信支付生成,调用创建商家券API成功时返回的唯一批次ID 仅支持“满减券”和“折扣券”的批次,“换购券”批次不支持
  4801. StockId *string `json:"stock_id"`
  4802. // 券的唯一标识。 在WECHATPAY\\_MODE的券code模式下,商家券code是由微信支付生成的唯一ID; 在MERCHANT\\_UPLOAD、MERCHANT\\_API的券code模式下,商家券code是由商户上传或指定,在批次下保证唯一;
  4803. CouponCode *string `json:"coupon_code"`
  4804. // 微信支付下单支付成功返回的订单号
  4805. TransactionId *string `json:"transaction_id"`
  4806. // 营销补差扣款商户号 注:补差扣款商户号 = 制券商户号 或 补差扣款商户号 = 归属商户号
  4807. PayerMerchant *string `json:"payer_merchant"`
  4808. // 营销补差入账商户号 注:补差入账商户号 = 券归属商户号 或者和 券归属商户号有连锁品牌关系
  4809. PayeeMerchant *string `json:"payee_merchant"`
  4810. // 单位为分,单笔订单补差金额不得超过券的优惠金额,最高补差金额为5000元 > 券的优惠金额定义: 满减券:满减金额即为优惠金额 折扣券:优惠金额 = 微信支付订单金额 ÷ 折扣比例 × (1 - 折扣比例) 换购券:不支持
  4811. Amount *int64 `json:"amount"`
  4812. // 付款备注描述,查询的时候原样带回
  4813. Description *string `json:"description"`
  4814. // 商户侧需保证唯一性,可包含英文字母,数字,|,_,*,-等内容,不允许出现其他不合法符号
  4815. OutSubsidyNo *string `json:"out_subsidy_no"`
  4816. }
  4817. func (o SubsidyPayRequest) MarshalJSON() ([]byte, error) {
  4818. toSerialize := map[string]interface{}{}
  4819. if o.StockId == nil {
  4820. return nil, fmt.Errorf("field `StockId` is required and must be specified in SubsidyPayRequest")
  4821. }
  4822. toSerialize["stock_id"] = o.StockId
  4823. if o.CouponCode == nil {
  4824. return nil, fmt.Errorf("field `CouponCode` is required and must be specified in SubsidyPayRequest")
  4825. }
  4826. toSerialize["coupon_code"] = o.CouponCode
  4827. if o.TransactionId == nil {
  4828. return nil, fmt.Errorf("field `TransactionId` is required and must be specified in SubsidyPayRequest")
  4829. }
  4830. toSerialize["transaction_id"] = o.TransactionId
  4831. if o.PayerMerchant == nil {
  4832. return nil, fmt.Errorf("field `PayerMerchant` is required and must be specified in SubsidyPayRequest")
  4833. }
  4834. toSerialize["payer_merchant"] = o.PayerMerchant
  4835. if o.PayeeMerchant == nil {
  4836. return nil, fmt.Errorf("field `PayeeMerchant` is required and must be specified in SubsidyPayRequest")
  4837. }
  4838. toSerialize["payee_merchant"] = o.PayeeMerchant
  4839. if o.Amount == nil {
  4840. return nil, fmt.Errorf("field `Amount` is required and must be specified in SubsidyPayRequest")
  4841. }
  4842. toSerialize["amount"] = o.Amount
  4843. if o.Description == nil {
  4844. return nil, fmt.Errorf("field `Description` is required and must be specified in SubsidyPayRequest")
  4845. }
  4846. toSerialize["description"] = o.Description
  4847. if o.OutSubsidyNo == nil {
  4848. return nil, fmt.Errorf("field `OutSubsidyNo` is required and must be specified in SubsidyPayRequest")
  4849. }
  4850. toSerialize["out_subsidy_no"] = o.OutSubsidyNo
  4851. return json.Marshal(toSerialize)
  4852. }
  4853. func (o SubsidyPayRequest) String() string {
  4854. var ret string
  4855. if o.StockId == nil {
  4856. ret += "StockId:<nil>, "
  4857. } else {
  4858. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  4859. }
  4860. if o.CouponCode == nil {
  4861. ret += "CouponCode:<nil>, "
  4862. } else {
  4863. ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
  4864. }
  4865. if o.TransactionId == nil {
  4866. ret += "TransactionId:<nil>, "
  4867. } else {
  4868. ret += fmt.Sprintf("TransactionId:%v, ", *o.TransactionId)
  4869. }
  4870. if o.PayerMerchant == nil {
  4871. ret += "PayerMerchant:<nil>, "
  4872. } else {
  4873. ret += fmt.Sprintf("PayerMerchant:%v, ", *o.PayerMerchant)
  4874. }
  4875. if o.PayeeMerchant == nil {
  4876. ret += "PayeeMerchant:<nil>, "
  4877. } else {
  4878. ret += fmt.Sprintf("PayeeMerchant:%v, ", *o.PayeeMerchant)
  4879. }
  4880. if o.Amount == nil {
  4881. ret += "Amount:<nil>, "
  4882. } else {
  4883. ret += fmt.Sprintf("Amount:%v, ", *o.Amount)
  4884. }
  4885. if o.Description == nil {
  4886. ret += "Description:<nil>, "
  4887. } else {
  4888. ret += fmt.Sprintf("Description:%v, ", *o.Description)
  4889. }
  4890. if o.OutSubsidyNo == nil {
  4891. ret += "OutSubsidyNo:<nil>"
  4892. } else {
  4893. ret += fmt.Sprintf("OutSubsidyNo:%v", *o.OutSubsidyNo)
  4894. }
  4895. return fmt.Sprintf("SubsidyPayRequest{%s}", ret)
  4896. }
  4897. func (o SubsidyPayRequest) Clone() *SubsidyPayRequest {
  4898. ret := SubsidyPayRequest{}
  4899. if o.StockId != nil {
  4900. ret.StockId = new(string)
  4901. *ret.StockId = *o.StockId
  4902. }
  4903. if o.CouponCode != nil {
  4904. ret.CouponCode = new(string)
  4905. *ret.CouponCode = *o.CouponCode
  4906. }
  4907. if o.TransactionId != nil {
  4908. ret.TransactionId = new(string)
  4909. *ret.TransactionId = *o.TransactionId
  4910. }
  4911. if o.PayerMerchant != nil {
  4912. ret.PayerMerchant = new(string)
  4913. *ret.PayerMerchant = *o.PayerMerchant
  4914. }
  4915. if o.PayeeMerchant != nil {
  4916. ret.PayeeMerchant = new(string)
  4917. *ret.PayeeMerchant = *o.PayeeMerchant
  4918. }
  4919. if o.Amount != nil {
  4920. ret.Amount = new(int64)
  4921. *ret.Amount = *o.Amount
  4922. }
  4923. if o.Description != nil {
  4924. ret.Description = new(string)
  4925. *ret.Description = *o.Description
  4926. }
  4927. if o.OutSubsidyNo != nil {
  4928. ret.OutSubsidyNo = new(string)
  4929. *ret.OutSubsidyNo = *o.OutSubsidyNo
  4930. }
  4931. return &ret
  4932. }
  4933. // SubsidyReturnReceipt
  4934. type SubsidyReturnReceipt struct {
  4935. // 补差回退唯一单号,由微信支付生成,仅在补差回退成功后有返回
  4936. SubsidyReturnReceiptId *string `json:"subsidy_return_receipt_id,omitempty"`
  4937. // 由微信支付生成,调用创建商家券API成功时返回的唯一批次ID
  4938. StockId *string `json:"stock_id"`
  4939. // 券的唯一标识
  4940. CouponCode *string `json:"coupon_code"`
  4941. // 微信支付下单支付成功返回的订单号
  4942. TransactionId *string `json:"transaction_id"`
  4943. // 微信支付退款单号
  4944. RefundId *string `json:"refund_id"`
  4945. // 原营销补差扣款商户号,即回退资金收款商户号
  4946. PayerMerchant *string `json:"payer_merchant"`
  4947. // 原营销补差入账商户号,即回退资金扣款商户号
  4948. PayeeMerchant *string `json:"payee_merchant"`
  4949. // 本次补差回退金额,单位为分。单个券code回退总金额不能超过补差金额
  4950. Amount *int64 `json:"amount"`
  4951. // 回退备注描述,查询的时候原样带回
  4952. Description *string `json:"description"`
  4953. // 补差付款单据状态
  4954. Status *SubsidyReturnReceiptStatus `json:"status"`
  4955. // 仅在补差回退失败时,返回告知对应失败的原因
  4956. FailReason *SubsidyReturnReceiptFailReason `json:"fail_reason,omitempty"`
  4957. // 仅在补差回退成功时,返回完成时间
  4958. ReturnDoneTime *time.Time `json:"return_done_time,omitempty"`
  4959. // 此次补差回退操作对应的补差付款单号
  4960. SubsidyReceiptId *string `json:"subsidy_receipt_id"`
  4961. // 商户侧需保证唯一性。可包含英文字母,数字,|,_,*,-等内容,不允许出现其他不合法符号
  4962. OutSubsidyReturnNo *string `json:"out_subsidy_return_no"`
  4963. // 补差回退单据创建时间
  4964. ReturnCreateTime *time.Time `json:"return_create_time,omitempty"`
  4965. }
  4966. func (o SubsidyReturnReceipt) MarshalJSON() ([]byte, error) {
  4967. toSerialize := map[string]interface{}{}
  4968. if o.SubsidyReturnReceiptId != nil {
  4969. toSerialize["subsidy_return_receipt_id"] = o.SubsidyReturnReceiptId
  4970. }
  4971. if o.StockId == nil {
  4972. return nil, fmt.Errorf("field `StockId` is required and must be specified in SubsidyReturnReceipt")
  4973. }
  4974. toSerialize["stock_id"] = o.StockId
  4975. if o.CouponCode == nil {
  4976. return nil, fmt.Errorf("field `CouponCode` is required and must be specified in SubsidyReturnReceipt")
  4977. }
  4978. toSerialize["coupon_code"] = o.CouponCode
  4979. if o.TransactionId == nil {
  4980. return nil, fmt.Errorf("field `TransactionId` is required and must be specified in SubsidyReturnReceipt")
  4981. }
  4982. toSerialize["transaction_id"] = o.TransactionId
  4983. if o.RefundId == nil {
  4984. return nil, fmt.Errorf("field `RefundId` is required and must be specified in SubsidyReturnReceipt")
  4985. }
  4986. toSerialize["refund_id"] = o.RefundId
  4987. if o.PayerMerchant == nil {
  4988. return nil, fmt.Errorf("field `PayerMerchant` is required and must be specified in SubsidyReturnReceipt")
  4989. }
  4990. toSerialize["payer_merchant"] = o.PayerMerchant
  4991. if o.PayeeMerchant == nil {
  4992. return nil, fmt.Errorf("field `PayeeMerchant` is required and must be specified in SubsidyReturnReceipt")
  4993. }
  4994. toSerialize["payee_merchant"] = o.PayeeMerchant
  4995. if o.Amount == nil {
  4996. return nil, fmt.Errorf("field `Amount` is required and must be specified in SubsidyReturnReceipt")
  4997. }
  4998. toSerialize["amount"] = o.Amount
  4999. if o.Description == nil {
  5000. return nil, fmt.Errorf("field `Description` is required and must be specified in SubsidyReturnReceipt")
  5001. }
  5002. toSerialize["description"] = o.Description
  5003. if o.Status == nil {
  5004. return nil, fmt.Errorf("field `Status` is required and must be specified in SubsidyReturnReceipt")
  5005. }
  5006. toSerialize["status"] = o.Status
  5007. if o.FailReason != nil {
  5008. toSerialize["fail_reason"] = o.FailReason
  5009. }
  5010. if o.ReturnDoneTime != nil {
  5011. toSerialize["return_done_time"] = o.ReturnDoneTime.Format(time.RFC3339)
  5012. }
  5013. if o.SubsidyReceiptId == nil {
  5014. return nil, fmt.Errorf("field `SubsidyReceiptId` is required and must be specified in SubsidyReturnReceipt")
  5015. }
  5016. toSerialize["subsidy_receipt_id"] = o.SubsidyReceiptId
  5017. if o.OutSubsidyReturnNo == nil {
  5018. return nil, fmt.Errorf("field `OutSubsidyReturnNo` is required and must be specified in SubsidyReturnReceipt")
  5019. }
  5020. toSerialize["out_subsidy_return_no"] = o.OutSubsidyReturnNo
  5021. if o.ReturnCreateTime != nil {
  5022. toSerialize["return_create_time"] = o.ReturnCreateTime.Format(time.RFC3339)
  5023. }
  5024. return json.Marshal(toSerialize)
  5025. }
  5026. func (o SubsidyReturnReceipt) String() string {
  5027. var ret string
  5028. if o.SubsidyReturnReceiptId == nil {
  5029. ret += "SubsidyReturnReceiptId:<nil>, "
  5030. } else {
  5031. ret += fmt.Sprintf("SubsidyReturnReceiptId:%v, ", *o.SubsidyReturnReceiptId)
  5032. }
  5033. if o.StockId == nil {
  5034. ret += "StockId:<nil>, "
  5035. } else {
  5036. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  5037. }
  5038. if o.CouponCode == nil {
  5039. ret += "CouponCode:<nil>, "
  5040. } else {
  5041. ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
  5042. }
  5043. if o.TransactionId == nil {
  5044. ret += "TransactionId:<nil>, "
  5045. } else {
  5046. ret += fmt.Sprintf("TransactionId:%v, ", *o.TransactionId)
  5047. }
  5048. if o.RefundId == nil {
  5049. ret += "RefundId:<nil>, "
  5050. } else {
  5051. ret += fmt.Sprintf("RefundId:%v, ", *o.RefundId)
  5052. }
  5053. if o.PayerMerchant == nil {
  5054. ret += "PayerMerchant:<nil>, "
  5055. } else {
  5056. ret += fmt.Sprintf("PayerMerchant:%v, ", *o.PayerMerchant)
  5057. }
  5058. if o.PayeeMerchant == nil {
  5059. ret += "PayeeMerchant:<nil>, "
  5060. } else {
  5061. ret += fmt.Sprintf("PayeeMerchant:%v, ", *o.PayeeMerchant)
  5062. }
  5063. if o.Amount == nil {
  5064. ret += "Amount:<nil>, "
  5065. } else {
  5066. ret += fmt.Sprintf("Amount:%v, ", *o.Amount)
  5067. }
  5068. if o.Description == nil {
  5069. ret += "Description:<nil>, "
  5070. } else {
  5071. ret += fmt.Sprintf("Description:%v, ", *o.Description)
  5072. }
  5073. if o.Status == nil {
  5074. ret += "Status:<nil>, "
  5075. } else {
  5076. ret += fmt.Sprintf("Status:%v, ", *o.Status)
  5077. }
  5078. if o.FailReason == nil {
  5079. ret += "FailReason:<nil>, "
  5080. } else {
  5081. ret += fmt.Sprintf("FailReason:%v, ", *o.FailReason)
  5082. }
  5083. if o.ReturnDoneTime == nil {
  5084. ret += "ReturnDoneTime:<nil>, "
  5085. } else {
  5086. ret += fmt.Sprintf("ReturnDoneTime:%v, ", *o.ReturnDoneTime)
  5087. }
  5088. if o.SubsidyReceiptId == nil {
  5089. ret += "SubsidyReceiptId:<nil>, "
  5090. } else {
  5091. ret += fmt.Sprintf("SubsidyReceiptId:%v, ", *o.SubsidyReceiptId)
  5092. }
  5093. if o.OutSubsidyReturnNo == nil {
  5094. ret += "OutSubsidyReturnNo:<nil>, "
  5095. } else {
  5096. ret += fmt.Sprintf("OutSubsidyReturnNo:%v, ", *o.OutSubsidyReturnNo)
  5097. }
  5098. if o.ReturnCreateTime == nil {
  5099. ret += "ReturnCreateTime:<nil>"
  5100. } else {
  5101. ret += fmt.Sprintf("ReturnCreateTime:%v", *o.ReturnCreateTime)
  5102. }
  5103. return fmt.Sprintf("SubsidyReturnReceipt{%s}", ret)
  5104. }
  5105. func (o SubsidyReturnReceipt) Clone() *SubsidyReturnReceipt {
  5106. ret := SubsidyReturnReceipt{}
  5107. if o.SubsidyReturnReceiptId != nil {
  5108. ret.SubsidyReturnReceiptId = new(string)
  5109. *ret.SubsidyReturnReceiptId = *o.SubsidyReturnReceiptId
  5110. }
  5111. if o.StockId != nil {
  5112. ret.StockId = new(string)
  5113. *ret.StockId = *o.StockId
  5114. }
  5115. if o.CouponCode != nil {
  5116. ret.CouponCode = new(string)
  5117. *ret.CouponCode = *o.CouponCode
  5118. }
  5119. if o.TransactionId != nil {
  5120. ret.TransactionId = new(string)
  5121. *ret.TransactionId = *o.TransactionId
  5122. }
  5123. if o.RefundId != nil {
  5124. ret.RefundId = new(string)
  5125. *ret.RefundId = *o.RefundId
  5126. }
  5127. if o.PayerMerchant != nil {
  5128. ret.PayerMerchant = new(string)
  5129. *ret.PayerMerchant = *o.PayerMerchant
  5130. }
  5131. if o.PayeeMerchant != nil {
  5132. ret.PayeeMerchant = new(string)
  5133. *ret.PayeeMerchant = *o.PayeeMerchant
  5134. }
  5135. if o.Amount != nil {
  5136. ret.Amount = new(int64)
  5137. *ret.Amount = *o.Amount
  5138. }
  5139. if o.Description != nil {
  5140. ret.Description = new(string)
  5141. *ret.Description = *o.Description
  5142. }
  5143. if o.Status != nil {
  5144. ret.Status = new(SubsidyReturnReceiptStatus)
  5145. *ret.Status = *o.Status
  5146. }
  5147. if o.FailReason != nil {
  5148. ret.FailReason = new(SubsidyReturnReceiptFailReason)
  5149. *ret.FailReason = *o.FailReason
  5150. }
  5151. if o.ReturnDoneTime != nil {
  5152. ret.ReturnDoneTime = new(time.Time)
  5153. *ret.ReturnDoneTime = *o.ReturnDoneTime
  5154. }
  5155. if o.SubsidyReceiptId != nil {
  5156. ret.SubsidyReceiptId = new(string)
  5157. *ret.SubsidyReceiptId = *o.SubsidyReceiptId
  5158. }
  5159. if o.OutSubsidyReturnNo != nil {
  5160. ret.OutSubsidyReturnNo = new(string)
  5161. *ret.OutSubsidyReturnNo = *o.OutSubsidyReturnNo
  5162. }
  5163. if o.ReturnCreateTime != nil {
  5164. ret.ReturnCreateTime = new(time.Time)
  5165. *ret.ReturnCreateTime = *o.ReturnCreateTime
  5166. }
  5167. return &ret
  5168. }
  5169. // SubsidyReturnReceiptFailReason
  5170. type SubsidyReturnReceiptFailReason string
  5171. func (e SubsidyReturnReceiptFailReason) Ptr() *SubsidyReturnReceiptFailReason {
  5172. return &e
  5173. }
  5174. // Enums of SubsidyReturnReceiptFailReason
  5175. const (
  5176. SUBSIDYRETURNRECEIPTFAILREASON_RETURN_RECEIPT_INSUFFICIENT_BALANCE SubsidyReturnReceiptFailReason = "RETURN_RECEIPT_INSUFFICIENT_BALANCE"
  5177. SUBSIDYRETURNRECEIPTFAILREASON_RETURN_RECEIPT_OTHER SubsidyReturnReceiptFailReason = "RETURN_RECEIPT_OTHER"
  5178. )
  5179. // SubsidyReturnReceiptStatus
  5180. type SubsidyReturnReceiptStatus string
  5181. func (e SubsidyReturnReceiptStatus) Ptr() *SubsidyReturnReceiptStatus {
  5182. return &e
  5183. }
  5184. // Enums of SubsidyReturnReceiptStatus
  5185. const (
  5186. SUBSIDYRETURNRECEIPTSTATUS_RETURN_RECEIPT_UNKNOWN SubsidyReturnReceiptStatus = "RETURN_RECEIPT_UNKNOWN"
  5187. SUBSIDYRETURNRECEIPTSTATUS_RETURN_RECEIPT_ACCEPTED SubsidyReturnReceiptStatus = "RETURN_RECEIPT_ACCEPTED"
  5188. SUBSIDYRETURNRECEIPTSTATUS_RETURN_RECEIPT_SUCCESS SubsidyReturnReceiptStatus = "RETURN_RECEIPT_SUCCESS"
  5189. SUBSIDYRETURNRECEIPTSTATUS_RETURN_RECEIPT_FAIL SubsidyReturnReceiptStatus = "RETURN_RECEIPT_FAIL"
  5190. )
  5191. // SubsidyReturnRequest
  5192. type SubsidyReturnRequest struct {
  5193. // 由微信支付生成,调用创建商家券API成功时返回的唯一批次ID 仅支持“满减券”和“折扣券”的批次,“换购券”批次不支持
  5194. StockId *string `json:"stock_id"`
  5195. // 券的唯一标识。 在WECHATPAY\\_MODE的券code模式下,商家券code是由微信支付生成的唯一ID; 在MERCHANT\\_UPLOAD、MERCHANT\\_API的券code模式下,商家券code是由商户上传或指定,在批次下保证唯一;
  5196. CouponCode *string `json:"coupon_code"`
  5197. // 微信支付下单支付成功返回的订单号
  5198. TransactionId *string `json:"transaction_id"`
  5199. // 微信支付退款单号
  5200. RefundId *string `json:"refund_id"`
  5201. // 原营销补差扣款商户号,即回退资金收款商户号
  5202. PayerMerchant *string `json:"payer_merchant"`
  5203. // 原营销补差入账商户号,即回退资金扣款商户号
  5204. PayeeMerchant *string `json:"payee_merchant"`
  5205. // 本次补差回退金额,单位为分。单个券Code回退总金额不能超过补差金额
  5206. Amount *int64 `json:"amount"`
  5207. // 回退备注描述,查询的时候原样带回
  5208. Description *string `json:"description"`
  5209. // 商户侧需保证唯一性,可包含英文字母,数字,|,_,*,-等内容,不允许出现其他不合法符号
  5210. OutSubsidyReturnNo *string `json:"out_subsidy_return_no"`
  5211. }
  5212. func (o SubsidyReturnRequest) MarshalJSON() ([]byte, error) {
  5213. toSerialize := map[string]interface{}{}
  5214. if o.StockId == nil {
  5215. return nil, fmt.Errorf("field `StockId` is required and must be specified in SubsidyReturnRequest")
  5216. }
  5217. toSerialize["stock_id"] = o.StockId
  5218. if o.CouponCode == nil {
  5219. return nil, fmt.Errorf("field `CouponCode` is required and must be specified in SubsidyReturnRequest")
  5220. }
  5221. toSerialize["coupon_code"] = o.CouponCode
  5222. if o.TransactionId == nil {
  5223. return nil, fmt.Errorf("field `TransactionId` is required and must be specified in SubsidyReturnRequest")
  5224. }
  5225. toSerialize["transaction_id"] = o.TransactionId
  5226. if o.RefundId == nil {
  5227. return nil, fmt.Errorf("field `RefundId` is required and must be specified in SubsidyReturnRequest")
  5228. }
  5229. toSerialize["refund_id"] = o.RefundId
  5230. if o.PayerMerchant == nil {
  5231. return nil, fmt.Errorf("field `PayerMerchant` is required and must be specified in SubsidyReturnRequest")
  5232. }
  5233. toSerialize["payer_merchant"] = o.PayerMerchant
  5234. if o.PayeeMerchant == nil {
  5235. return nil, fmt.Errorf("field `PayeeMerchant` is required and must be specified in SubsidyReturnRequest")
  5236. }
  5237. toSerialize["payee_merchant"] = o.PayeeMerchant
  5238. if o.Amount == nil {
  5239. return nil, fmt.Errorf("field `Amount` is required and must be specified in SubsidyReturnRequest")
  5240. }
  5241. toSerialize["amount"] = o.Amount
  5242. if o.Description == nil {
  5243. return nil, fmt.Errorf("field `Description` is required and must be specified in SubsidyReturnRequest")
  5244. }
  5245. toSerialize["description"] = o.Description
  5246. if o.OutSubsidyReturnNo == nil {
  5247. return nil, fmt.Errorf("field `OutSubsidyReturnNo` is required and must be specified in SubsidyReturnRequest")
  5248. }
  5249. toSerialize["out_subsidy_return_no"] = o.OutSubsidyReturnNo
  5250. return json.Marshal(toSerialize)
  5251. }
  5252. func (o SubsidyReturnRequest) String() string {
  5253. var ret string
  5254. if o.StockId == nil {
  5255. ret += "StockId:<nil>, "
  5256. } else {
  5257. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  5258. }
  5259. if o.CouponCode == nil {
  5260. ret += "CouponCode:<nil>, "
  5261. } else {
  5262. ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
  5263. }
  5264. if o.TransactionId == nil {
  5265. ret += "TransactionId:<nil>, "
  5266. } else {
  5267. ret += fmt.Sprintf("TransactionId:%v, ", *o.TransactionId)
  5268. }
  5269. if o.RefundId == nil {
  5270. ret += "RefundId:<nil>, "
  5271. } else {
  5272. ret += fmt.Sprintf("RefundId:%v, ", *o.RefundId)
  5273. }
  5274. if o.PayerMerchant == nil {
  5275. ret += "PayerMerchant:<nil>, "
  5276. } else {
  5277. ret += fmt.Sprintf("PayerMerchant:%v, ", *o.PayerMerchant)
  5278. }
  5279. if o.PayeeMerchant == nil {
  5280. ret += "PayeeMerchant:<nil>, "
  5281. } else {
  5282. ret += fmt.Sprintf("PayeeMerchant:%v, ", *o.PayeeMerchant)
  5283. }
  5284. if o.Amount == nil {
  5285. ret += "Amount:<nil>, "
  5286. } else {
  5287. ret += fmt.Sprintf("Amount:%v, ", *o.Amount)
  5288. }
  5289. if o.Description == nil {
  5290. ret += "Description:<nil>, "
  5291. } else {
  5292. ret += fmt.Sprintf("Description:%v, ", *o.Description)
  5293. }
  5294. if o.OutSubsidyReturnNo == nil {
  5295. ret += "OutSubsidyReturnNo:<nil>"
  5296. } else {
  5297. ret += fmt.Sprintf("OutSubsidyReturnNo:%v", *o.OutSubsidyReturnNo)
  5298. }
  5299. return fmt.Sprintf("SubsidyReturnRequest{%s}", ret)
  5300. }
  5301. func (o SubsidyReturnRequest) Clone() *SubsidyReturnRequest {
  5302. ret := SubsidyReturnRequest{}
  5303. if o.StockId != nil {
  5304. ret.StockId = new(string)
  5305. *ret.StockId = *o.StockId
  5306. }
  5307. if o.CouponCode != nil {
  5308. ret.CouponCode = new(string)
  5309. *ret.CouponCode = *o.CouponCode
  5310. }
  5311. if o.TransactionId != nil {
  5312. ret.TransactionId = new(string)
  5313. *ret.TransactionId = *o.TransactionId
  5314. }
  5315. if o.RefundId != nil {
  5316. ret.RefundId = new(string)
  5317. *ret.RefundId = *o.RefundId
  5318. }
  5319. if o.PayerMerchant != nil {
  5320. ret.PayerMerchant = new(string)
  5321. *ret.PayerMerchant = *o.PayerMerchant
  5322. }
  5323. if o.PayeeMerchant != nil {
  5324. ret.PayeeMerchant = new(string)
  5325. *ret.PayeeMerchant = *o.PayeeMerchant
  5326. }
  5327. if o.Amount != nil {
  5328. ret.Amount = new(int64)
  5329. *ret.Amount = *o.Amount
  5330. }
  5331. if o.Description != nil {
  5332. ret.Description = new(string)
  5333. *ret.Description = *o.Description
  5334. }
  5335. if o.OutSubsidyReturnNo != nil {
  5336. ret.OutSubsidyReturnNo = new(string)
  5337. *ret.OutSubsidyReturnNo = *o.OutSubsidyReturnNo
  5338. }
  5339. return &ret
  5340. }
  5341. // UploadCouponCodeBody
  5342. type UploadCouponCodeBody struct {
  5343. // 商户上传的券code列表;code允许包含的字符有 0-9 a-z A-Z 空格(仅含空格,不含制表符、换行符、换页符等) 中划线- 下划线_ 反斜线\\ 斜线/ 等号= 竖线|
  5344. CouponCodeList []string `json:"coupon_code_list"`
  5345. // 商户上传code的凭据号,商户侧需保持唯一性
  5346. UploadRequestNo *string `json:"upload_request_no"`
  5347. }
  5348. func (o UploadCouponCodeBody) MarshalJSON() ([]byte, error) {
  5349. toSerialize := map[string]interface{}{}
  5350. if o.CouponCodeList == nil {
  5351. return nil, fmt.Errorf("field `CouponCodeList` is required and must be specified in UploadCouponCodeBody")
  5352. }
  5353. toSerialize["coupon_code_list"] = o.CouponCodeList
  5354. if o.UploadRequestNo == nil {
  5355. return nil, fmt.Errorf("field `UploadRequestNo` is required and must be specified in UploadCouponCodeBody")
  5356. }
  5357. toSerialize["upload_request_no"] = o.UploadRequestNo
  5358. return json.Marshal(toSerialize)
  5359. }
  5360. func (o UploadCouponCodeBody) String() string {
  5361. var ret string
  5362. ret += fmt.Sprintf("CouponCodeList:%v, ", o.CouponCodeList)
  5363. if o.UploadRequestNo == nil {
  5364. ret += "UploadRequestNo:<nil>"
  5365. } else {
  5366. ret += fmt.Sprintf("UploadRequestNo:%v", *o.UploadRequestNo)
  5367. }
  5368. return fmt.Sprintf("UploadCouponCodeBody{%s}", ret)
  5369. }
  5370. func (o UploadCouponCodeBody) Clone() *UploadCouponCodeBody {
  5371. ret := UploadCouponCodeBody{}
  5372. if o.CouponCodeList != nil {
  5373. ret.CouponCodeList = make([]string, len(o.CouponCodeList))
  5374. for i, item := range o.CouponCodeList {
  5375. ret.CouponCodeList[i] = item
  5376. }
  5377. }
  5378. if o.UploadRequestNo != nil {
  5379. ret.UploadRequestNo = new(string)
  5380. *ret.UploadRequestNo = *o.UploadRequestNo
  5381. }
  5382. return &ret
  5383. }
  5384. // UploadCouponCodeFailReason
  5385. type UploadCouponCodeFailReason struct {
  5386. // 商户通过API上传的券code
  5387. CouponCode *string `json:"coupon_code"`
  5388. // 对应券code上传失败的错误码
  5389. Code *string `json:"code"`
  5390. // 上传失败的错误信息描述
  5391. Message *string `json:"message"`
  5392. }
  5393. func (o UploadCouponCodeFailReason) MarshalJSON() ([]byte, error) {
  5394. toSerialize := map[string]interface{}{}
  5395. if o.CouponCode == nil {
  5396. return nil, fmt.Errorf("field `CouponCode` is required and must be specified in UploadCouponCodeFailReason")
  5397. }
  5398. toSerialize["coupon_code"] = o.CouponCode
  5399. if o.Code == nil {
  5400. return nil, fmt.Errorf("field `Code` is required and must be specified in UploadCouponCodeFailReason")
  5401. }
  5402. toSerialize["code"] = o.Code
  5403. if o.Message == nil {
  5404. return nil, fmt.Errorf("field `Message` is required and must be specified in UploadCouponCodeFailReason")
  5405. }
  5406. toSerialize["message"] = o.Message
  5407. return json.Marshal(toSerialize)
  5408. }
  5409. func (o UploadCouponCodeFailReason) String() string {
  5410. var ret string
  5411. if o.CouponCode == nil {
  5412. ret += "CouponCode:<nil>, "
  5413. } else {
  5414. ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
  5415. }
  5416. if o.Code == nil {
  5417. ret += "Code:<nil>, "
  5418. } else {
  5419. ret += fmt.Sprintf("Code:%v, ", *o.Code)
  5420. }
  5421. if o.Message == nil {
  5422. ret += "Message:<nil>"
  5423. } else {
  5424. ret += fmt.Sprintf("Message:%v", *o.Message)
  5425. }
  5426. return fmt.Sprintf("UploadCouponCodeFailReason{%s}", ret)
  5427. }
  5428. func (o UploadCouponCodeFailReason) Clone() *UploadCouponCodeFailReason {
  5429. ret := UploadCouponCodeFailReason{}
  5430. if o.CouponCode != nil {
  5431. ret.CouponCode = new(string)
  5432. *ret.CouponCode = *o.CouponCode
  5433. }
  5434. if o.Code != nil {
  5435. ret.Code = new(string)
  5436. *ret.Code = *o.Code
  5437. }
  5438. if o.Message != nil {
  5439. ret.Message = new(string)
  5440. *ret.Message = *o.Message
  5441. }
  5442. return &ret
  5443. }
  5444. // UploadCouponCodeRequest
  5445. type UploadCouponCodeRequest struct {
  5446. // 商家券批次号
  5447. StockId *string `json:"stock_id"`
  5448. // 商户上传的券code列表;code允许包含的字符有 0-9 a-z A-Z 空格(仅含空格,不含制表符、换行符、换页符等) 中划线- 下划线_ 反斜线\\ 斜线/ 等号= 竖线|
  5449. CouponCodeList []string `json:"coupon_code_list"`
  5450. // 商户上传code的凭据号,商户侧需保持唯一性
  5451. UploadRequestNo *string `json:"upload_request_no"`
  5452. }
  5453. func (o UploadCouponCodeRequest) MarshalJSON() ([]byte, error) {
  5454. toSerialize := map[string]interface{}{}
  5455. if o.StockId == nil {
  5456. return nil, fmt.Errorf("field `StockId` is required and must be specified in UploadCouponCodeRequest")
  5457. }
  5458. toSerialize["stock_id"] = o.StockId
  5459. if o.CouponCodeList == nil {
  5460. return nil, fmt.Errorf("field `CouponCodeList` is required and must be specified in UploadCouponCodeRequest")
  5461. }
  5462. toSerialize["coupon_code_list"] = o.CouponCodeList
  5463. if o.UploadRequestNo == nil {
  5464. return nil, fmt.Errorf("field `UploadRequestNo` is required and must be specified in UploadCouponCodeRequest")
  5465. }
  5466. toSerialize["upload_request_no"] = o.UploadRequestNo
  5467. return json.Marshal(toSerialize)
  5468. }
  5469. func (o UploadCouponCodeRequest) String() string {
  5470. var ret string
  5471. if o.StockId == nil {
  5472. ret += "StockId:<nil>, "
  5473. } else {
  5474. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  5475. }
  5476. ret += fmt.Sprintf("CouponCodeList:%v, ", o.CouponCodeList)
  5477. if o.UploadRequestNo == nil {
  5478. ret += "UploadRequestNo:<nil>"
  5479. } else {
  5480. ret += fmt.Sprintf("UploadRequestNo:%v", *o.UploadRequestNo)
  5481. }
  5482. return fmt.Sprintf("UploadCouponCodeRequest{%s}", ret)
  5483. }
  5484. func (o UploadCouponCodeRequest) Clone() *UploadCouponCodeRequest {
  5485. ret := UploadCouponCodeRequest{}
  5486. if o.StockId != nil {
  5487. ret.StockId = new(string)
  5488. *ret.StockId = *o.StockId
  5489. }
  5490. if o.CouponCodeList != nil {
  5491. ret.CouponCodeList = make([]string, len(o.CouponCodeList))
  5492. for i, item := range o.CouponCodeList {
  5493. ret.CouponCodeList[i] = item
  5494. }
  5495. }
  5496. if o.UploadRequestNo != nil {
  5497. ret.UploadRequestNo = new(string)
  5498. *ret.UploadRequestNo = *o.UploadRequestNo
  5499. }
  5500. return &ret
  5501. }
  5502. // UploadCouponCodeResponse
  5503. type UploadCouponCodeResponse struct {
  5504. // 商家券批次号
  5505. StockId *string `json:"stock_id"`
  5506. // 本次上传操作,去重后实际上传的code数目
  5507. TotalCount *int64 `json:"total_count"`
  5508. // 本次上传操作上传成功个数
  5509. SuccessCount *int64 `json:"success_count"`
  5510. // 本次新增上传成功的code信息。 特殊规则:单个券code长度为【1,32】,条目个数限制为【1,200】。
  5511. SuccessCodes []string `json:"success_codes,omitempty"`
  5512. // 上传操作完成时间,遵循[rfc3339](https://datatracker.ietf.org/doc/html/rfc3339)标准格式,格式为yyyy-MM-DDTHH:mm:ss+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秒。
  5513. SuccessTime *string `json:"success_time"`
  5514. // 本次上传操作上传失败的code数
  5515. FailCount *int64 `json:"fail_count,omitempty"`
  5516. // 本次导入失败的code信息,请参照错误信息,修改后重试
  5517. FailCodes []UploadCouponCodeFailReason `json:"fail_codes,omitempty"`
  5518. // 历史已存在的code列表,本次不会重复导入。 特殊规则:单个券code长度为【1,32】,条目个数限制为【1,200】。
  5519. ExistCodes []string `json:"exist_codes,omitempty"`
  5520. // 本次重复导入的code会被自动过滤,仅保留一个做导入,如满足要求则成功;如不满足要求,则失败;请参照报错提示修改重试。 特殊规则:单个券code长度为【1,32】,条目个数限制为【1,200】。
  5521. DuplicateCodes []string `json:"duplicate_codes,omitempty"`
  5522. }
  5523. func (o UploadCouponCodeResponse) MarshalJSON() ([]byte, error) {
  5524. toSerialize := map[string]interface{}{}
  5525. if o.StockId == nil {
  5526. return nil, fmt.Errorf("field `StockId` is required and must be specified in UploadCouponCodeResponse")
  5527. }
  5528. toSerialize["stock_id"] = o.StockId
  5529. if o.TotalCount == nil {
  5530. return nil, fmt.Errorf("field `TotalCount` is required and must be specified in UploadCouponCodeResponse")
  5531. }
  5532. toSerialize["total_count"] = o.TotalCount
  5533. if o.SuccessCount == nil {
  5534. return nil, fmt.Errorf("field `SuccessCount` is required and must be specified in UploadCouponCodeResponse")
  5535. }
  5536. toSerialize["success_count"] = o.SuccessCount
  5537. if o.SuccessCodes != nil {
  5538. toSerialize["success_codes"] = o.SuccessCodes
  5539. }
  5540. if o.SuccessTime == nil {
  5541. return nil, fmt.Errorf("field `SuccessTime` is required and must be specified in UploadCouponCodeResponse")
  5542. }
  5543. toSerialize["success_time"] = o.SuccessTime
  5544. if o.FailCount != nil {
  5545. toSerialize["fail_count"] = o.FailCount
  5546. }
  5547. if o.FailCodes != nil {
  5548. toSerialize["fail_codes"] = o.FailCodes
  5549. }
  5550. if o.ExistCodes != nil {
  5551. toSerialize["exist_codes"] = o.ExistCodes
  5552. }
  5553. if o.DuplicateCodes != nil {
  5554. toSerialize["duplicate_codes"] = o.DuplicateCodes
  5555. }
  5556. return json.Marshal(toSerialize)
  5557. }
  5558. func (o UploadCouponCodeResponse) String() string {
  5559. var ret string
  5560. if o.StockId == nil {
  5561. ret += "StockId:<nil>, "
  5562. } else {
  5563. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  5564. }
  5565. if o.TotalCount == nil {
  5566. ret += "TotalCount:<nil>, "
  5567. } else {
  5568. ret += fmt.Sprintf("TotalCount:%v, ", *o.TotalCount)
  5569. }
  5570. if o.SuccessCount == nil {
  5571. ret += "SuccessCount:<nil>, "
  5572. } else {
  5573. ret += fmt.Sprintf("SuccessCount:%v, ", *o.SuccessCount)
  5574. }
  5575. ret += fmt.Sprintf("SuccessCodes:%v, ", o.SuccessCodes)
  5576. if o.SuccessTime == nil {
  5577. ret += "SuccessTime:<nil>, "
  5578. } else {
  5579. ret += fmt.Sprintf("SuccessTime:%v, ", *o.SuccessTime)
  5580. }
  5581. if o.FailCount == nil {
  5582. ret += "FailCount:<nil>, "
  5583. } else {
  5584. ret += fmt.Sprintf("FailCount:%v, ", *o.FailCount)
  5585. }
  5586. ret += fmt.Sprintf("FailCodes:%v, ", o.FailCodes)
  5587. ret += fmt.Sprintf("ExistCodes:%v, ", o.ExistCodes)
  5588. ret += fmt.Sprintf("DuplicateCodes:%v", o.DuplicateCodes)
  5589. return fmt.Sprintf("UploadCouponCodeResponse{%s}", ret)
  5590. }
  5591. func (o UploadCouponCodeResponse) Clone() *UploadCouponCodeResponse {
  5592. ret := UploadCouponCodeResponse{}
  5593. if o.StockId != nil {
  5594. ret.StockId = new(string)
  5595. *ret.StockId = *o.StockId
  5596. }
  5597. if o.TotalCount != nil {
  5598. ret.TotalCount = new(int64)
  5599. *ret.TotalCount = *o.TotalCount
  5600. }
  5601. if o.SuccessCount != nil {
  5602. ret.SuccessCount = new(int64)
  5603. *ret.SuccessCount = *o.SuccessCount
  5604. }
  5605. if o.SuccessCodes != nil {
  5606. ret.SuccessCodes = make([]string, len(o.SuccessCodes))
  5607. for i, item := range o.SuccessCodes {
  5608. ret.SuccessCodes[i] = item
  5609. }
  5610. }
  5611. if o.SuccessTime != nil {
  5612. ret.SuccessTime = new(string)
  5613. *ret.SuccessTime = *o.SuccessTime
  5614. }
  5615. if o.FailCount != nil {
  5616. ret.FailCount = new(int64)
  5617. *ret.FailCount = *o.FailCount
  5618. }
  5619. if o.FailCodes != nil {
  5620. ret.FailCodes = make([]UploadCouponCodeFailReason, len(o.FailCodes))
  5621. for i, item := range o.FailCodes {
  5622. ret.FailCodes[i] = *item.Clone()
  5623. }
  5624. }
  5625. if o.ExistCodes != nil {
  5626. ret.ExistCodes = make([]string, len(o.ExistCodes))
  5627. for i, item := range o.ExistCodes {
  5628. ret.ExistCodes[i] = item
  5629. }
  5630. }
  5631. if o.DuplicateCodes != nil {
  5632. ret.DuplicateCodes = make([]string, len(o.DuplicateCodes))
  5633. for i, item := range o.DuplicateCodes {
  5634. ret.DuplicateCodes[i] = item
  5635. }
  5636. }
  5637. return &ret
  5638. }
  5639. // UseCouponRequest
  5640. type UseCouponRequest struct {
  5641. // 券的唯一标识
  5642. CouponCode *string `json:"coupon_code"`
  5643. // 微信为每个商家券批次分配的唯一ID,当你在创建商家券接口中的coupon\\_code\\_mode参数传值为MERCHANT\\_API或者MERCHANT\\_UPLOAD时,则核销接口中该字段必传,否则该字段可不传
  5644. StockId *string `json:"stock_id,omitempty"`
  5645. // 支持传入与当前调用接口商户号有绑定关系的AppID。支持小程序AppID与公众号AppID。核销接口返回的OpenID会在该传入AppID下进行计算获得。 校验规则:传入的AppID得是与调用方商户号(即请求头里面的商户号)有绑定关系的AppID或传入的AppID得是归属商户号有绑定关系的AppID
  5646. Appid *string `json:"appid"`
  5647. // 商户请求核销用户券的时间。 遵循[rfc3339](https://datatracker.ietf.org/doc/html/rfc3339)标准格式,格式为yyyy-MM-DDTHH:mm:ss+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秒。
  5648. UseTime *string `json:"use_time"`
  5649. // 每次核销请求的唯一标识,商户需保证唯一
  5650. UseRequestNo *string `json:"use_request_no"`
  5651. // 用户的唯一标识,做安全校验使用,非必填。 校验规则:传入的OpenID得是调用方商户号(即请求头里面的商户号)有绑定关系的AppID获取的OpenID或传入的OpenID得是归属商户号有绑定关系的AppID获取的OpenID。[获取OpenID文档](https://pay.weixin.qq.com/wiki/doc/apiv3/terms_definition/chapter1_1_3.shtml#part-3)
  5652. Openid *string `json:"openid,omitempty"`
  5653. }
  5654. func (o UseCouponRequest) MarshalJSON() ([]byte, error) {
  5655. toSerialize := map[string]interface{}{}
  5656. if o.CouponCode == nil {
  5657. return nil, fmt.Errorf("field `CouponCode` is required and must be specified in UseCouponRequest")
  5658. }
  5659. toSerialize["coupon_code"] = o.CouponCode
  5660. if o.StockId != nil {
  5661. toSerialize["stock_id"] = o.StockId
  5662. }
  5663. if o.Appid == nil {
  5664. return nil, fmt.Errorf("field `Appid` is required and must be specified in UseCouponRequest")
  5665. }
  5666. toSerialize["appid"] = o.Appid
  5667. if o.UseTime == nil {
  5668. return nil, fmt.Errorf("field `UseTime` is required and must be specified in UseCouponRequest")
  5669. }
  5670. toSerialize["use_time"] = o.UseTime
  5671. if o.UseRequestNo == nil {
  5672. return nil, fmt.Errorf("field `UseRequestNo` is required and must be specified in UseCouponRequest")
  5673. }
  5674. toSerialize["use_request_no"] = o.UseRequestNo
  5675. if o.Openid != nil {
  5676. toSerialize["openid"] = o.Openid
  5677. }
  5678. return json.Marshal(toSerialize)
  5679. }
  5680. func (o UseCouponRequest) String() string {
  5681. var ret string
  5682. if o.CouponCode == nil {
  5683. ret += "CouponCode:<nil>, "
  5684. } else {
  5685. ret += fmt.Sprintf("CouponCode:%v, ", *o.CouponCode)
  5686. }
  5687. if o.StockId == nil {
  5688. ret += "StockId:<nil>, "
  5689. } else {
  5690. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  5691. }
  5692. if o.Appid == nil {
  5693. ret += "Appid:<nil>, "
  5694. } else {
  5695. ret += fmt.Sprintf("Appid:%v, ", *o.Appid)
  5696. }
  5697. if o.UseTime == nil {
  5698. ret += "UseTime:<nil>, "
  5699. } else {
  5700. ret += fmt.Sprintf("UseTime:%v, ", *o.UseTime)
  5701. }
  5702. if o.UseRequestNo == nil {
  5703. ret += "UseRequestNo:<nil>, "
  5704. } else {
  5705. ret += fmt.Sprintf("UseRequestNo:%v, ", *o.UseRequestNo)
  5706. }
  5707. if o.Openid == nil {
  5708. ret += "Openid:<nil>"
  5709. } else {
  5710. ret += fmt.Sprintf("Openid:%v", *o.Openid)
  5711. }
  5712. return fmt.Sprintf("UseCouponRequest{%s}", ret)
  5713. }
  5714. func (o UseCouponRequest) Clone() *UseCouponRequest {
  5715. ret := UseCouponRequest{}
  5716. if o.CouponCode != nil {
  5717. ret.CouponCode = new(string)
  5718. *ret.CouponCode = *o.CouponCode
  5719. }
  5720. if o.StockId != nil {
  5721. ret.StockId = new(string)
  5722. *ret.StockId = *o.StockId
  5723. }
  5724. if o.Appid != nil {
  5725. ret.Appid = new(string)
  5726. *ret.Appid = *o.Appid
  5727. }
  5728. if o.UseTime != nil {
  5729. ret.UseTime = new(string)
  5730. *ret.UseTime = *o.UseTime
  5731. }
  5732. if o.UseRequestNo != nil {
  5733. ret.UseRequestNo = new(string)
  5734. *ret.UseRequestNo = *o.UseRequestNo
  5735. }
  5736. if o.Openid != nil {
  5737. ret.Openid = new(string)
  5738. *ret.Openid = *o.Openid
  5739. }
  5740. return &ret
  5741. }
  5742. // UseCouponResponse
  5743. type UseCouponResponse struct {
  5744. // 批次ID
  5745. StockId *string `json:"stock_id"`
  5746. // 用户在该公众号内的唯一身份标识。
  5747. Openid *string `json:"openid"`
  5748. // 系统成功核销券的时间,遵循[rfc3339](https://datatracker.ietf.org/doc/html/rfc3339)标准格式,格式为yyyy-MM-DDTHH:mm:ss+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秒。
  5749. WechatpayUseTime *string `json:"wechatpay_use_time"`
  5750. }
  5751. func (o UseCouponResponse) MarshalJSON() ([]byte, error) {
  5752. toSerialize := map[string]interface{}{}
  5753. if o.StockId == nil {
  5754. return nil, fmt.Errorf("field `StockId` is required and must be specified in UseCouponResponse")
  5755. }
  5756. toSerialize["stock_id"] = o.StockId
  5757. if o.Openid == nil {
  5758. return nil, fmt.Errorf("field `Openid` is required and must be specified in UseCouponResponse")
  5759. }
  5760. toSerialize["openid"] = o.Openid
  5761. if o.WechatpayUseTime == nil {
  5762. return nil, fmt.Errorf("field `WechatpayUseTime` is required and must be specified in UseCouponResponse")
  5763. }
  5764. toSerialize["wechatpay_use_time"] = o.WechatpayUseTime
  5765. return json.Marshal(toSerialize)
  5766. }
  5767. func (o UseCouponResponse) String() string {
  5768. var ret string
  5769. if o.StockId == nil {
  5770. ret += "StockId:<nil>, "
  5771. } else {
  5772. ret += fmt.Sprintf("StockId:%v, ", *o.StockId)
  5773. }
  5774. if o.Openid == nil {
  5775. ret += "Openid:<nil>, "
  5776. } else {
  5777. ret += fmt.Sprintf("Openid:%v, ", *o.Openid)
  5778. }
  5779. if o.WechatpayUseTime == nil {
  5780. ret += "WechatpayUseTime:<nil>"
  5781. } else {
  5782. ret += fmt.Sprintf("WechatpayUseTime:%v", *o.WechatpayUseTime)
  5783. }
  5784. return fmt.Sprintf("UseCouponResponse{%s}", ret)
  5785. }
  5786. func (o UseCouponResponse) Clone() *UseCouponResponse {
  5787. ret := UseCouponResponse{}
  5788. if o.StockId != nil {
  5789. ret.StockId = new(string)
  5790. *ret.StockId = *o.StockId
  5791. }
  5792. if o.Openid != nil {
  5793. ret.Openid = new(string)
  5794. *ret.Openid = *o.Openid
  5795. }
  5796. if o.WechatpayUseTime != nil {
  5797. ret.WechatpayUseTime = new(string)
  5798. *ret.WechatpayUseTime = *o.WechatpayUseTime
  5799. }
  5800. return &ret
  5801. }