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