1 Star 0 Fork 0

zhuhukun/oapi-sdk-go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
model.go 186.44 KB
一键复制 编辑 原始数据 按行查看 历史
Lakers 提交于 2024-12-25 16:44 . feat: github->gitee
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257
// Package sheets code generated by oapi sdk gen
/*
* MIT License
*
* Copyright (c) 2022 Lark Technologies Pte. Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice, shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package larksheets
import (
"fmt"
"gitee.com/zhuhukun/oapi-sdk-go/v3/core"
)
const (
UserIdTypeUserId = "user_id" // 以user_id来识别用户
UserIdTypeUnionId = "union_id" // 以union_id来识别用户
UserIdTypeOpenId = "open_id" // 以open_id来识别用户
)
type AddSheet struct {
Title *string `json:"title,omitempty"` // 工作表标题
Index *int `json:"index,omitempty"` // 工作表位置
}
type AddSheetBuilder struct {
title string // 工作表标题
titleFlag bool
index int // 工作表位置
indexFlag bool
}
func NewAddSheetBuilder() *AddSheetBuilder {
builder := &AddSheetBuilder{}
return builder
}
// 工作表标题
//
// 示例值:abc
func (builder *AddSheetBuilder) Title(title string) *AddSheetBuilder {
builder.title = title
builder.titleFlag = true
return builder
}
// 工作表位置
//
// 示例值:0
func (builder *AddSheetBuilder) Index(index int) *AddSheetBuilder {
builder.index = index
builder.indexFlag = true
return builder
}
func (builder *AddSheetBuilder) Build() *AddSheet {
req := &AddSheet{}
if builder.titleFlag {
req.Title = &builder.title
}
if builder.indexFlag {
req.Index = &builder.index
}
return req
}
type AlignmentStyle struct {
HorizontalAlignment *string `json:"horizontal_alignment,omitempty"` // 水平对齐策略
VerticalAlignment *string `json:"vertical_alignment,omitempty"` // 垂直对齐策略
}
type AlignmentStyleBuilder struct {
horizontalAlignment string // 水平对齐策略
horizontalAlignmentFlag bool
verticalAlignment string // 垂直对齐策略
verticalAlignmentFlag bool
}
func NewAlignmentStyleBuilder() *AlignmentStyleBuilder {
builder := &AlignmentStyleBuilder{}
return builder
}
// 水平对齐策略
//
// 示例值:Left
func (builder *AlignmentStyleBuilder) HorizontalAlignment(horizontalAlignment string) *AlignmentStyleBuilder {
builder.horizontalAlignment = horizontalAlignment
builder.horizontalAlignmentFlag = true
return builder
}
// 垂直对齐策略
//
// 示例值:Top
func (builder *AlignmentStyleBuilder) VerticalAlignment(verticalAlignment string) *AlignmentStyleBuilder {
builder.verticalAlignment = verticalAlignment
builder.verticalAlignmentFlag = true
return builder
}
func (builder *AlignmentStyleBuilder) Build() *AlignmentStyle {
req := &AlignmentStyle{}
if builder.horizontalAlignmentFlag {
req.HorizontalAlignment = &builder.horizontalAlignment
}
if builder.verticalAlignmentFlag {
req.VerticalAlignment = &builder.verticalAlignment
}
return req
}
type AppendDimension struct {
MajorDimension *string `json:"major_dimension,omitempty"` // 操作行还是列,取值:ROWS、COLUMNS
Length *int `json:"length,omitempty"` // 数量
InheritFromBefore *bool `json:"inherit_from_before,omitempty"` // 是否继承上一行/列的样式
}
type AppendDimensionBuilder struct {
majorDimension string // 操作行还是列,取值:ROWS、COLUMNS
majorDimensionFlag bool
length int // 数量
lengthFlag bool
inheritFromBefore bool // 是否继承上一行/列的样式
inheritFromBeforeFlag bool
}
func NewAppendDimensionBuilder() *AppendDimensionBuilder {
builder := &AppendDimensionBuilder{}
return builder
}
// 操作行还是列,取值:ROWS、COLUMNS
//
// 示例值:ROWS
func (builder *AppendDimensionBuilder) MajorDimension(majorDimension string) *AppendDimensionBuilder {
builder.majorDimension = majorDimension
builder.majorDimensionFlag = true
return builder
}
// 数量
//
// 示例值:10
func (builder *AppendDimensionBuilder) Length(length int) *AppendDimensionBuilder {
builder.length = length
builder.lengthFlag = true
return builder
}
// 是否继承上一行/列的样式
//
// 示例值:false
func (builder *AppendDimensionBuilder) InheritFromBefore(inheritFromBefore bool) *AppendDimensionBuilder {
builder.inheritFromBefore = inheritFromBefore
builder.inheritFromBeforeFlag = true
return builder
}
func (builder *AppendDimensionBuilder) Build() *AppendDimension {
req := &AppendDimension{}
if builder.majorDimensionFlag {
req.MajorDimension = &builder.majorDimension
}
if builder.lengthFlag {
req.Length = &builder.length
}
if builder.inheritFromBeforeFlag {
req.InheritFromBefore = &builder.inheritFromBefore
}
return req
}
type BitableProperties struct {
BitableToken *string `json:"bitable_token,omitempty"` // 多维表格token
TableId *string `json:"table_id,omitempty"` // 数据表id
}
type BitablePropertiesBuilder struct {
bitableToken string // 多维表格token
bitableTokenFlag bool
tableId string // 数据表id
tableIdFlag bool
}
func NewBitablePropertiesBuilder() *BitablePropertiesBuilder {
builder := &BitablePropertiesBuilder{}
return builder
}
// 多维表格token
//
// 示例值:basxxxxxxxxxxxxxxxx
func (builder *BitablePropertiesBuilder) BitableToken(bitableToken string) *BitablePropertiesBuilder {
builder.bitableToken = bitableToken
builder.bitableTokenFlag = true
return builder
}
// 数据表id
//
// 示例值:tblxxxxxxxxxx
func (builder *BitablePropertiesBuilder) TableId(tableId string) *BitablePropertiesBuilder {
builder.tableId = tableId
builder.tableIdFlag = true
return builder
}
func (builder *BitablePropertiesBuilder) Build() *BitableProperties {
req := &BitableProperties{}
if builder.bitableTokenFlag {
req.BitableToken = &builder.bitableToken
}
if builder.tableIdFlag {
req.TableId = &builder.tableId
}
return req
}
type BoolRuleValue struct {
Type *string `json:"type,omitempty"` // 条件值类型
Number *string `json:"number,omitempty"` // 数值,当type=Number时必须有
Text *string `json:"text,omitempty"` // 文本,当type=Text时必须有
TimePeriod *string `json:"time_period,omitempty"` // 时间区间
}
type BoolRuleValueBuilder struct {
type_ string // 条件值类型
typeFlag bool
number string // 数值,当type=Number时必须有
numberFlag bool
text string // 文本,当type=Text时必须有
textFlag bool
timePeriod string // 时间区间
timePeriodFlag bool
}
func NewBoolRuleValueBuilder() *BoolRuleValueBuilder {
builder := &BoolRuleValueBuilder{}
return builder
}
// 条件值类型
//
// 示例值:Number
func (builder *BoolRuleValueBuilder) Type(type_ string) *BoolRuleValueBuilder {
builder.type_ = type_
builder.typeFlag = true
return builder
}
// 数值,当type=Number时必须有
//
// 示例值:12
func (builder *BoolRuleValueBuilder) Number(number string) *BoolRuleValueBuilder {
builder.number = number
builder.numberFlag = true
return builder
}
// 文本,当type=Text时必须有
//
// 示例值:abc
func (builder *BoolRuleValueBuilder) Text(text string) *BoolRuleValueBuilder {
builder.text = text
builder.textFlag = true
return builder
}
// 时间区间
//
// 示例值:Today
func (builder *BoolRuleValueBuilder) TimePeriod(timePeriod string) *BoolRuleValueBuilder {
builder.timePeriod = timePeriod
builder.timePeriodFlag = true
return builder
}
func (builder *BoolRuleValueBuilder) Build() *BoolRuleValue {
req := &BoolRuleValue{}
if builder.typeFlag {
req.Type = &builder.type_
}
if builder.numberFlag {
req.Number = &builder.number
}
if builder.textFlag {
req.Text = &builder.text
}
if builder.timePeriodFlag {
req.TimePeriod = &builder.timePeriod
}
return req
}
type BooleanRuleCondition struct {
Type *string `json:"type,omitempty"` // 条件格式类型
BooleanConditionalValues []*BoolRuleValue `json:"boolean_conditional_values,omitempty"` // 条件格式值,根据条件格式类型传入相应的值
}
type BooleanRuleConditionBuilder struct {
type_ string // 条件格式类型
typeFlag bool
booleanConditionalValues []*BoolRuleValue // 条件格式值,根据条件格式类型传入相应的值
booleanConditionalValuesFlag bool
}
func NewBooleanRuleConditionBuilder() *BooleanRuleConditionBuilder {
builder := &BooleanRuleConditionBuilder{}
return builder
}
// 条件格式类型
//
// 示例值:CellEqual
func (builder *BooleanRuleConditionBuilder) Type(type_ string) *BooleanRuleConditionBuilder {
builder.type_ = type_
builder.typeFlag = true
return builder
}
// 条件格式值,根据条件格式类型传入相应的值
//
// 示例值:
func (builder *BooleanRuleConditionBuilder) BooleanConditionalValues(booleanConditionalValues []*BoolRuleValue) *BooleanRuleConditionBuilder {
builder.booleanConditionalValues = booleanConditionalValues
builder.booleanConditionalValuesFlag = true
return builder
}
func (builder *BooleanRuleConditionBuilder) Build() *BooleanRuleCondition {
req := &BooleanRuleCondition{}
if builder.typeFlag {
req.Type = &builder.type_
}
if builder.booleanConditionalValuesFlag {
req.BooleanConditionalValues = builder.booleanConditionalValues
}
return req
}
type BorderStyle struct {
Top *TopBorderStyle `json:"top,omitempty"` // 上边框样式
Left *LeftBorderStyle `json:"left,omitempty"` // 左边框样式
Right *RightBorderStyle `json:"right,omitempty"` // 右边框样式
Bottom *BottomBorderStyle `json:"bottom,omitempty"` // 下边框样式
}
type BorderStyleBuilder struct {
top *TopBorderStyle // 上边框样式
topFlag bool
left *LeftBorderStyle // 左边框样式
leftFlag bool
right *RightBorderStyle // 右边框样式
rightFlag bool
bottom *BottomBorderStyle // 下边框样式
bottomFlag bool
}
func NewBorderStyleBuilder() *BorderStyleBuilder {
builder := &BorderStyleBuilder{}
return builder
}
// 上边框样式
//
// 示例值:
func (builder *BorderStyleBuilder) Top(top *TopBorderStyle) *BorderStyleBuilder {
builder.top = top
builder.topFlag = true
return builder
}
// 左边框样式
//
// 示例值:
func (builder *BorderStyleBuilder) Left(left *LeftBorderStyle) *BorderStyleBuilder {
builder.left = left
builder.leftFlag = true
return builder
}
// 右边框样式
//
// 示例值:
func (builder *BorderStyleBuilder) Right(right *RightBorderStyle) *BorderStyleBuilder {
builder.right = right
builder.rightFlag = true
return builder
}
// 下边框样式
//
// 示例值:
func (builder *BorderStyleBuilder) Bottom(bottom *BottomBorderStyle) *BorderStyleBuilder {
builder.bottom = bottom
builder.bottomFlag = true
return builder
}
func (builder *BorderStyleBuilder) Build() *BorderStyle {
req := &BorderStyle{}
if builder.topFlag {
req.Top = builder.top
}
if builder.leftFlag {
req.Left = builder.left
}
if builder.rightFlag {
req.Right = builder.right
}
if builder.bottomFlag {
req.Bottom = builder.bottom
}
return req
}
type BottomBorderStyle struct {
Style *string `json:"style,omitempty"` // 边框样式
Color *string `json:"color,omitempty"` // 边框颜色
}
type BottomBorderStyleBuilder struct {
style string // 边框样式
styleFlag bool
color string // 边框颜色
colorFlag bool
}
func NewBottomBorderStyleBuilder() *BottomBorderStyleBuilder {
builder := &BottomBorderStyleBuilder{}
return builder
}
// 边框样式
//
// 示例值:
func (builder *BottomBorderStyleBuilder) Style(style string) *BottomBorderStyleBuilder {
builder.style = style
builder.styleFlag = true
return builder
}
// 边框颜色
//
// 示例值:#ff00ff
func (builder *BottomBorderStyleBuilder) Color(color string) *BottomBorderStyleBuilder {
builder.color = color
builder.colorFlag = true
return builder
}
func (builder *BottomBorderStyleBuilder) Build() *BottomBorderStyle {
req := &BottomBorderStyle{}
if builder.styleFlag {
req.Style = &builder.style
}
if builder.colorFlag {
req.Color = &builder.color
}
return req
}
type CellFontStyle struct {
Bold *bool `json:"bold,omitempty"` // 是否加粗
Italic *bool `json:"italic,omitempty"` // 是否斜体
Strikethrough *bool `json:"strikethrough,omitempty"` // 是否设置删除线
Underline *bool `json:"underline,omitempty"` // 是否展示下划线
ForegroundColor *string `json:"foreground_color,omitempty"` // 字体颜色
BackgroundColor *string `json:"background_color,omitempty"` // 背景颜色
}
type CellFontStyleBuilder struct {
bold bool // 是否加粗
boldFlag bool
italic bool // 是否斜体
italicFlag bool
strikethrough bool // 是否设置删除线
strikethroughFlag bool
underline bool // 是否展示下划线
underlineFlag bool
foregroundColor string // 字体颜色
foregroundColorFlag bool
backgroundColor string // 背景颜色
backgroundColorFlag bool
}
func NewCellFontStyleBuilder() *CellFontStyleBuilder {
builder := &CellFontStyleBuilder{}
return builder
}
// 是否加粗
//
// 示例值:true
func (builder *CellFontStyleBuilder) Bold(bold bool) *CellFontStyleBuilder {
builder.bold = bold
builder.boldFlag = true
return builder
}
// 是否斜体
//
// 示例值:true
func (builder *CellFontStyleBuilder) Italic(italic bool) *CellFontStyleBuilder {
builder.italic = italic
builder.italicFlag = true
return builder
}
// 是否设置删除线
//
// 示例值:true
func (builder *CellFontStyleBuilder) Strikethrough(strikethrough bool) *CellFontStyleBuilder {
builder.strikethrough = strikethrough
builder.strikethroughFlag = true
return builder
}
// 是否展示下划线
//
// 示例值:true
func (builder *CellFontStyleBuilder) Underline(underline bool) *CellFontStyleBuilder {
builder.underline = underline
builder.underlineFlag = true
return builder
}
// 字体颜色
//
// 示例值:#ff00ff
func (builder *CellFontStyleBuilder) ForegroundColor(foregroundColor string) *CellFontStyleBuilder {
builder.foregroundColor = foregroundColor
builder.foregroundColorFlag = true
return builder
}
// 背景颜色
//
// 示例值:#ff00ff
func (builder *CellFontStyleBuilder) BackgroundColor(backgroundColor string) *CellFontStyleBuilder {
builder.backgroundColor = backgroundColor
builder.backgroundColorFlag = true
return builder
}
func (builder *CellFontStyleBuilder) Build() *CellFontStyle {
req := &CellFontStyle{}
if builder.boldFlag {
req.Bold = &builder.bold
}
if builder.italicFlag {
req.Italic = &builder.italic
}
if builder.strikethroughFlag {
req.Strikethrough = &builder.strikethrough
}
if builder.underlineFlag {
req.Underline = &builder.underline
}
if builder.foregroundColorFlag {
req.ForegroundColor = &builder.foregroundColor
}
if builder.backgroundColorFlag {
req.BackgroundColor = &builder.backgroundColor
}
return req
}
type CellStyle struct {
FontStyle *CellFontStyle `json:"font_style,omitempty"` // 字体样式
BorderStyle *BorderStyle `json:"border_style,omitempty"` // 边框颜色
AlignmentStyle *AlignmentStyle `json:"alignment_style,omitempty"` // 对齐方式
WrapStrategy *string `json:"wrap_strategy,omitempty"` // 文本换行
Format *string `json:"format,omitempty"` // 数字格式
}
type CellStyleBuilder struct {
fontStyle *CellFontStyle // 字体样式
fontStyleFlag bool
borderStyle *BorderStyle // 边框颜色
borderStyleFlag bool
alignmentStyle *AlignmentStyle // 对齐方式
alignmentStyleFlag bool
wrapStrategy string // 文本换行
wrapStrategyFlag bool
format string // 数字格式
formatFlag bool
}
func NewCellStyleBuilder() *CellStyleBuilder {
builder := &CellStyleBuilder{}
return builder
}
// 字体样式
//
// 示例值:
func (builder *CellStyleBuilder) FontStyle(fontStyle *CellFontStyle) *CellStyleBuilder {
builder.fontStyle = fontStyle
builder.fontStyleFlag = true
return builder
}
// 边框颜色
//
// 示例值:
func (builder *CellStyleBuilder) BorderStyle(borderStyle *BorderStyle) *CellStyleBuilder {
builder.borderStyle = borderStyle
builder.borderStyleFlag = true
return builder
}
// 对齐方式
//
// 示例值:
func (builder *CellStyleBuilder) AlignmentStyle(alignmentStyle *AlignmentStyle) *CellStyleBuilder {
builder.alignmentStyle = alignmentStyle
builder.alignmentStyleFlag = true
return builder
}
// 文本换行
//
// 示例值:Overflow
func (builder *CellStyleBuilder) WrapStrategy(wrapStrategy string) *CellStyleBuilder {
builder.wrapStrategy = wrapStrategy
builder.wrapStrategyFlag = true
return builder
}
// 数字格式
//
// 示例值:yyyy/MM/dd
func (builder *CellStyleBuilder) Format(format string) *CellStyleBuilder {
builder.format = format
builder.formatFlag = true
return builder
}
func (builder *CellStyleBuilder) Build() *CellStyle {
req := &CellStyle{}
if builder.fontStyleFlag {
req.FontStyle = builder.fontStyle
}
if builder.borderStyleFlag {
req.BorderStyle = builder.borderStyle
}
if builder.alignmentStyleFlag {
req.AlignmentStyle = builder.alignmentStyle
}
if builder.wrapStrategyFlag {
req.WrapStrategy = &builder.wrapStrategy
}
if builder.formatFlag {
req.Format = &builder.format
}
return req
}
type CellValue struct {
Type *string `json:"type,omitempty"` // 元素类型
Text *Text `json:"text,omitempty"` //
MentionUser *MentionUser `json:"mention_user,omitempty"` //
MentionDocument *MentionDocument `json:"mention_document,omitempty"` //
Value *ValueElement `json:"value,omitempty"` //
DateTime *DateTime `json:"date_time,omitempty"` //
File *File `json:"file,omitempty"` //
Image *Image `json:"image,omitempty"` //
Link *Link `json:"link,omitempty"` //
Reminder *Reminder `json:"reminder,omitempty"` //
Formula *Formula `json:"formula,omitempty"` //
}
type CellValueBuilder struct {
type_ string // 元素类型
typeFlag bool
text *Text //
textFlag bool
mentionUser *MentionUser //
mentionUserFlag bool
mentionDocument *MentionDocument //
mentionDocumentFlag bool
value *ValueElement //
valueFlag bool
dateTime *DateTime //
dateTimeFlag bool
file *File //
fileFlag bool
image *Image //
imageFlag bool
link *Link //
linkFlag bool
reminder *Reminder //
reminderFlag bool
formula *Formula //
formulaFlag bool
}
func NewCellValueBuilder() *CellValueBuilder {
builder := &CellValueBuilder{}
return builder
}
// 元素类型
//
// 示例值:text
func (builder *CellValueBuilder) Type(type_ string) *CellValueBuilder {
builder.type_ = type_
builder.typeFlag = true
return builder
}
// 示例值:
func (builder *CellValueBuilder) Text(text *Text) *CellValueBuilder {
builder.text = text
builder.textFlag = true
return builder
}
// 示例值:
func (builder *CellValueBuilder) MentionUser(mentionUser *MentionUser) *CellValueBuilder {
builder.mentionUser = mentionUser
builder.mentionUserFlag = true
return builder
}
// 示例值:
func (builder *CellValueBuilder) MentionDocument(mentionDocument *MentionDocument) *CellValueBuilder {
builder.mentionDocument = mentionDocument
builder.mentionDocumentFlag = true
return builder
}
// 示例值:
func (builder *CellValueBuilder) Value(value *ValueElement) *CellValueBuilder {
builder.value = value
builder.valueFlag = true
return builder
}
// 示例值:
func (builder *CellValueBuilder) DateTime(dateTime *DateTime) *CellValueBuilder {
builder.dateTime = dateTime
builder.dateTimeFlag = true
return builder
}
// 示例值:
func (builder *CellValueBuilder) File(file *File) *CellValueBuilder {
builder.file = file
builder.fileFlag = true
return builder
}
// 示例值:
func (builder *CellValueBuilder) Image(image *Image) *CellValueBuilder {
builder.image = image
builder.imageFlag = true
return builder
}
// 示例值:
func (builder *CellValueBuilder) Link(link *Link) *CellValueBuilder {
builder.link = link
builder.linkFlag = true
return builder
}
// 示例值:
func (builder *CellValueBuilder) Reminder(reminder *Reminder) *CellValueBuilder {
builder.reminder = reminder
builder.reminderFlag = true
return builder
}
// 示例值:
func (builder *CellValueBuilder) Formula(formula *Formula) *CellValueBuilder {
builder.formula = formula
builder.formulaFlag = true
return builder
}
func (builder *CellValueBuilder) Build() *CellValue {
req := &CellValue{}
if builder.typeFlag {
req.Type = &builder.type_
}
if builder.textFlag {
req.Text = builder.text
}
if builder.mentionUserFlag {
req.MentionUser = builder.mentionUser
}
if builder.mentionDocumentFlag {
req.MentionDocument = builder.mentionDocument
}
if builder.valueFlag {
req.Value = builder.value
}
if builder.dateTimeFlag {
req.DateTime = builder.dateTime
}
if builder.fileFlag {
req.File = builder.file
}
if builder.imageFlag {
req.Image = builder.image
}
if builder.linkFlag {
req.Link = builder.link
}
if builder.reminderFlag {
req.Reminder = builder.reminder
}
if builder.formulaFlag {
req.Formula = builder.formula
}
return req
}
type Checkbox struct {
DataValidationId *int `json:"data_validation_id,omitempty"` // 数据校验ID
DataValiditonValue *string `json:"data_validiton_value,omitempty"` // 复选框值
}
type CheckboxBuilder struct {
dataValidationId int // 数据校验ID
dataValidationIdFlag bool
dataValiditonValue string // 复选框值
dataValiditonValueFlag bool
}
func NewCheckboxBuilder() *CheckboxBuilder {
builder := &CheckboxBuilder{}
return builder
}
// 数据校验ID
//
// 示例值:1
func (builder *CheckboxBuilder) DataValidationId(dataValidationId int) *CheckboxBuilder {
builder.dataValidationId = dataValidationId
builder.dataValidationIdFlag = true
return builder
}
// 复选框值
//
// 示例值:TRUE
func (builder *CheckboxBuilder) DataValiditonValue(dataValiditonValue string) *CheckboxBuilder {
builder.dataValiditonValue = dataValiditonValue
builder.dataValiditonValueFlag = true
return builder
}
func (builder *CheckboxBuilder) Build() *Checkbox {
req := &Checkbox{}
if builder.dataValidationIdFlag {
req.DataValidationId = &builder.dataValidationId
}
if builder.dataValiditonValueFlag {
req.DataValiditonValue = &builder.dataValiditonValue
}
return req
}
type ClearDataValidation struct {
Ranges []string `json:"ranges,omitempty"` // 清除数据检验的范围
}
type ClearDataValidationBuilder struct {
ranges []string // 清除数据检验的范围
rangesFlag bool
}
func NewClearDataValidationBuilder() *ClearDataValidationBuilder {
builder := &ClearDataValidationBuilder{}
return builder
}
// 清除数据检验的范围
//
// 示例值:
func (builder *ClearDataValidationBuilder) Ranges(ranges []string) *ClearDataValidationBuilder {
builder.ranges = ranges
builder.rangesFlag = true
return builder
}
func (builder *ClearDataValidationBuilder) Build() *ClearDataValidation {
req := &ClearDataValidation{}
if builder.rangesFlag {
req.Ranges = builder.ranges
}
return req
}
type ClearStyleMultiRange struct {
Ranges []string `json:"ranges,omitempty"` // 范围
}
type ClearStyleMultiRangeBuilder struct {
ranges []string // 范围
rangesFlag bool
}
func NewClearStyleMultiRangeBuilder() *ClearStyleMultiRangeBuilder {
builder := &ClearStyleMultiRangeBuilder{}
return builder
}
// 范围
//
// 示例值:
func (builder *ClearStyleMultiRangeBuilder) Ranges(ranges []string) *ClearStyleMultiRangeBuilder {
builder.ranges = ranges
builder.rangesFlag = true
return builder
}
func (builder *ClearStyleMultiRangeBuilder) Build() *ClearStyleMultiRange {
req := &ClearStyleMultiRange{}
if builder.rangesFlag {
req.Ranges = builder.ranges
}
return req
}
type ClearStyleRanges struct {
Ranges []string `json:"ranges,omitempty"` // 范围
}
type ClearStyleRangesBuilder struct {
ranges []string // 范围
rangesFlag bool
}
func NewClearStyleRangesBuilder() *ClearStyleRangesBuilder {
builder := &ClearStyleRangesBuilder{}
return builder
}
// 范围
//
// 示例值:["sheet1!A1:A1"]
func (builder *ClearStyleRangesBuilder) Ranges(ranges []string) *ClearStyleRangesBuilder {
builder.ranges = ranges
builder.rangesFlag = true
return builder
}
func (builder *ClearStyleRangesBuilder) Build() *ClearStyleRanges {
req := &ClearStyleRanges{}
if builder.rangesFlag {
req.Ranges = builder.ranges
}
return req
}
type Condition struct {
FilterType *string `json:"filter_type,omitempty"` // 筛选类型
CompareType *string `json:"compare_type,omitempty"` // 比较类型
Expected []string `json:"expected,omitempty"` // 筛选参数
}
type ConditionBuilder struct {
filterType string // 筛选类型
filterTypeFlag bool
compareType string // 比较类型
compareTypeFlag bool
expected []string // 筛选参数
expectedFlag bool
}
func NewConditionBuilder() *ConditionBuilder {
builder := &ConditionBuilder{}
return builder
}
// 筛选类型
//
// 示例值:number
func (builder *ConditionBuilder) FilterType(filterType string) *ConditionBuilder {
builder.filterType = filterType
builder.filterTypeFlag = true
return builder
}
// 比较类型
//
// 示例值:less
func (builder *ConditionBuilder) CompareType(compareType string) *ConditionBuilder {
builder.compareType = compareType
builder.compareTypeFlag = true
return builder
}
// 筛选参数
//
// 示例值:6
func (builder *ConditionBuilder) Expected(expected []string) *ConditionBuilder {
builder.expected = expected
builder.expectedFlag = true
return builder
}
func (builder *ConditionBuilder) Build() *Condition {
req := &Condition{}
if builder.filterTypeFlag {
req.FilterType = &builder.filterType
}
if builder.compareTypeFlag {
req.CompareType = &builder.compareType
}
if builder.expectedFlag {
req.Expected = builder.expected
}
return req
}
type ConditionalFormat struct {
ConditionalFormatId *string `json:"conditional_format_id,omitempty"` // 条件格式ID
ConditionalFormatRule *ConditionalFormatRule `json:"conditional_format_rule,omitempty"` // 条件格式
Index *int `json:"index,omitempty"` // 规则索引位置,默认为最后一个
Ranges *ConditionalFormatRange `json:"ranges,omitempty"` // 条件格式应用范围
}
type ConditionalFormatBuilder struct {
conditionalFormatId string // 条件格式ID
conditionalFormatIdFlag bool
conditionalFormatRule *ConditionalFormatRule // 条件格式
conditionalFormatRuleFlag bool
index int // 规则索引位置,默认为最后一个
indexFlag bool
ranges *ConditionalFormatRange // 条件格式应用范围
rangesFlag bool
}
func NewConditionalFormatBuilder() *ConditionalFormatBuilder {
builder := &ConditionalFormatBuilder{}
return builder
}
// 条件格式ID
//
// 示例值:hKc9HDZhrJ
func (builder *ConditionalFormatBuilder) ConditionalFormatId(conditionalFormatId string) *ConditionalFormatBuilder {
builder.conditionalFormatId = conditionalFormatId
builder.conditionalFormatIdFlag = true
return builder
}
// 条件格式
//
// 示例值:
func (builder *ConditionalFormatBuilder) ConditionalFormatRule(conditionalFormatRule *ConditionalFormatRule) *ConditionalFormatBuilder {
builder.conditionalFormatRule = conditionalFormatRule
builder.conditionalFormatRuleFlag = true
return builder
}
// 规则索引位置,默认为最后一个
//
// 示例值:
func (builder *ConditionalFormatBuilder) Index(index int) *ConditionalFormatBuilder {
builder.index = index
builder.indexFlag = true
return builder
}
// 条件格式应用范围
//
// 示例值:
func (builder *ConditionalFormatBuilder) Ranges(ranges *ConditionalFormatRange) *ConditionalFormatBuilder {
builder.ranges = ranges
builder.rangesFlag = true
return builder
}
func (builder *ConditionalFormatBuilder) Build() *ConditionalFormat {
req := &ConditionalFormat{}
if builder.conditionalFormatIdFlag {
req.ConditionalFormatId = &builder.conditionalFormatId
}
if builder.conditionalFormatRuleFlag {
req.ConditionalFormatRule = builder.conditionalFormatRule
}
if builder.indexFlag {
req.Index = &builder.index
}
if builder.rangesFlag {
req.Ranges = builder.ranges
}
return req
}
type ConditionalFormatRange struct {
SheetId *string `json:"sheet_id,omitempty"` // 工作表ID
StartRowIndex *int `json:"start_row_index,omitempty"` // 起始行索引
EndRowIndex *int `json:"end_row_index,omitempty"` // 结束行索引
StartColumnIndex *int `json:"start_column_index,omitempty"` // 起始列索引
EndColumnIndex *int `json:"end_column_index,omitempty"` // 结束列索引
}
type ConditionalFormatRangeBuilder struct {
sheetId string // 工作表ID
sheetIdFlag bool
startRowIndex int // 起始行索引
startRowIndexFlag bool
endRowIndex int // 结束行索引
endRowIndexFlag bool
startColumnIndex int // 起始列索引
startColumnIndexFlag bool
endColumnIndex int // 结束列索引
endColumnIndexFlag bool
}
func NewConditionalFormatRangeBuilder() *ConditionalFormatRangeBuilder {
builder := &ConditionalFormatRangeBuilder{}
return builder
}
// 工作表ID
//
// 示例值:
func (builder *ConditionalFormatRangeBuilder) SheetId(sheetId string) *ConditionalFormatRangeBuilder {
builder.sheetId = sheetId
builder.sheetIdFlag = true
return builder
}
// 起始行索引
//
// 示例值:0
func (builder *ConditionalFormatRangeBuilder) StartRowIndex(startRowIndex int) *ConditionalFormatRangeBuilder {
builder.startRowIndex = startRowIndex
builder.startRowIndexFlag = true
return builder
}
// 结束行索引
//
// 示例值:0
func (builder *ConditionalFormatRangeBuilder) EndRowIndex(endRowIndex int) *ConditionalFormatRangeBuilder {
builder.endRowIndex = endRowIndex
builder.endRowIndexFlag = true
return builder
}
// 起始列索引
//
// 示例值:0
func (builder *ConditionalFormatRangeBuilder) StartColumnIndex(startColumnIndex int) *ConditionalFormatRangeBuilder {
builder.startColumnIndex = startColumnIndex
builder.startColumnIndexFlag = true
return builder
}
// 结束列索引
//
// 示例值:0
func (builder *ConditionalFormatRangeBuilder) EndColumnIndex(endColumnIndex int) *ConditionalFormatRangeBuilder {
builder.endColumnIndex = endColumnIndex
builder.endColumnIndexFlag = true
return builder
}
func (builder *ConditionalFormatRangeBuilder) Build() *ConditionalFormatRange {
req := &ConditionalFormatRange{}
if builder.sheetIdFlag {
req.SheetId = &builder.sheetId
}
if builder.startRowIndexFlag {
req.StartRowIndex = &builder.startRowIndex
}
if builder.endRowIndexFlag {
req.EndRowIndex = &builder.endRowIndex
}
if builder.startColumnIndexFlag {
req.StartColumnIndex = &builder.startColumnIndex
}
if builder.endColumnIndexFlag {
req.EndColumnIndex = &builder.endColumnIndex
}
return req
}
type ConditionalFormatRule struct {
BooleanRule *BooleanRuleCondition `json:"boolean_rule,omitempty"` // 布尔类型条件格式
Type *string `json:"type,omitempty"` // 条件格式类型
}
type ConditionalFormatRuleBuilder struct {
booleanRule *BooleanRuleCondition // 布尔类型条件格式
booleanRuleFlag bool
type_ string // 条件格式类型
typeFlag bool
}
func NewConditionalFormatRuleBuilder() *ConditionalFormatRuleBuilder {
builder := &ConditionalFormatRuleBuilder{}
return builder
}
// 布尔类型条件格式
//
// 示例值:
func (builder *ConditionalFormatRuleBuilder) BooleanRule(booleanRule *BooleanRuleCondition) *ConditionalFormatRuleBuilder {
builder.booleanRule = booleanRule
builder.booleanRuleFlag = true
return builder
}
// 条件格式类型
//
// 示例值:BooleanRuleCondition
func (builder *ConditionalFormatRuleBuilder) Type(type_ string) *ConditionalFormatRuleBuilder {
builder.type_ = type_
builder.typeFlag = true
return builder
}
func (builder *ConditionalFormatRuleBuilder) Build() *ConditionalFormatRule {
req := &ConditionalFormatRule{}
if builder.booleanRuleFlag {
req.BooleanRule = builder.booleanRule
}
if builder.typeFlag {
req.Type = &builder.type_
}
return req
}
type ConditionalFormatStyle struct {
BackgroundColor *string `json:"background_color,omitempty"` // 背景颜色
ForegroundColor *string `json:"foreground_color,omitempty"` // 字体颜色
Underline *bool `json:"underline,omitempty"` // 是否设置下划线
Bold *bool `json:"bold,omitempty"` // 是否加粗
Italic *bool `json:"italic,omitempty"` // 是否设置斜体
Strikethrough *bool `json:"strikethrough,omitempty"` // 是否设置删除线
}
type ConditionalFormatStyleBuilder struct {
backgroundColor string // 背景颜色
backgroundColorFlag bool
foregroundColor string // 字体颜色
foregroundColorFlag bool
underline bool // 是否设置下划线
underlineFlag bool
bold bool // 是否加粗
boldFlag bool
italic bool // 是否设置斜体
italicFlag bool
strikethrough bool // 是否设置删除线
strikethroughFlag bool
}
func NewConditionalFormatStyleBuilder() *ConditionalFormatStyleBuilder {
builder := &ConditionalFormatStyleBuilder{}
return builder
}
// 背景颜色
//
// 示例值:#ff00ff
func (builder *ConditionalFormatStyleBuilder) BackgroundColor(backgroundColor string) *ConditionalFormatStyleBuilder {
builder.backgroundColor = backgroundColor
builder.backgroundColorFlag = true
return builder
}
// 字体颜色
//
// 示例值:#ff00ff
func (builder *ConditionalFormatStyleBuilder) ForegroundColor(foregroundColor string) *ConditionalFormatStyleBuilder {
builder.foregroundColor = foregroundColor
builder.foregroundColorFlag = true
return builder
}
// 是否设置下划线
//
// 示例值:true
func (builder *ConditionalFormatStyleBuilder) Underline(underline bool) *ConditionalFormatStyleBuilder {
builder.underline = underline
builder.underlineFlag = true
return builder
}
// 是否加粗
//
// 示例值:true
func (builder *ConditionalFormatStyleBuilder) Bold(bold bool) *ConditionalFormatStyleBuilder {
builder.bold = bold
builder.boldFlag = true
return builder
}
// 是否设置斜体
//
// 示例值:true
func (builder *ConditionalFormatStyleBuilder) Italic(italic bool) *ConditionalFormatStyleBuilder {
builder.italic = italic
builder.italicFlag = true
return builder
}
// 是否设置删除线
//
// 示例值:true
func (builder *ConditionalFormatStyleBuilder) Strikethrough(strikethrough bool) *ConditionalFormatStyleBuilder {
builder.strikethrough = strikethrough
builder.strikethroughFlag = true
return builder
}
func (builder *ConditionalFormatStyleBuilder) Build() *ConditionalFormatStyle {
req := &ConditionalFormatStyle{}
if builder.backgroundColorFlag {
req.BackgroundColor = &builder.backgroundColor
}
if builder.foregroundColorFlag {
req.ForegroundColor = &builder.foregroundColor
}
if builder.underlineFlag {
req.Underline = &builder.underline
}
if builder.boldFlag {
req.Bold = &builder.bold
}
if builder.italicFlag {
req.Italic = &builder.italic
}
if builder.strikethroughFlag {
req.Strikethrough = &builder.strikethrough
}
return req
}
type CreateDataValidation struct {
Range *string `json:"range,omitempty"` // 数据校验设置的范围
Rule *DataValidation `json:"rule,omitempty"` // 数据校验规则
}
type CreateDataValidationBuilder struct {
range_ string // 数据校验设置的范围
rangeFlag bool
rule *DataValidation // 数据校验规则
ruleFlag bool
}
func NewCreateDataValidationBuilder() *CreateDataValidationBuilder {
builder := &CreateDataValidationBuilder{}
return builder
}
// 数据校验设置的范围
//
// 示例值:sjls29!A1:B2
func (builder *CreateDataValidationBuilder) Range(range_ string) *CreateDataValidationBuilder {
builder.range_ = range_
builder.rangeFlag = true
return builder
}
// 数据校验规则
//
// 示例值:
func (builder *CreateDataValidationBuilder) Rule(rule *DataValidation) *CreateDataValidationBuilder {
builder.rule = rule
builder.ruleFlag = true
return builder
}
func (builder *CreateDataValidationBuilder) Build() *CreateDataValidation {
req := &CreateDataValidation{}
if builder.rangeFlag {
req.Range = &builder.range_
}
if builder.ruleFlag {
req.Rule = builder.rule
}
return req
}
type CreateSheetFilter struct {
Range *string `json:"range,omitempty"` // 筛选应用范围
Col *string `json:"col,omitempty"` // 设置筛选条件的列
Condition *Condition `json:"condition,omitempty"` // 筛选的条件
}
type CreateSheetFilterBuilder struct {
range_ string // 筛选应用范围
rangeFlag bool
col string // 设置筛选条件的列
colFlag bool
condition *Condition // 筛选的条件
conditionFlag bool
}
func NewCreateSheetFilterBuilder() *CreateSheetFilterBuilder {
builder := &CreateSheetFilterBuilder{}
return builder
}
// 筛选应用范围
//
// 示例值:xxxxxx!C1:H14
func (builder *CreateSheetFilterBuilder) Range(range_ string) *CreateSheetFilterBuilder {
builder.range_ = range_
builder.rangeFlag = true
return builder
}
// 设置筛选条件的列
//
// 示例值:E
func (builder *CreateSheetFilterBuilder) Col(col string) *CreateSheetFilterBuilder {
builder.col = col
builder.colFlag = true
return builder
}
// 筛选的条件
//
// 示例值:
func (builder *CreateSheetFilterBuilder) Condition(condition *Condition) *CreateSheetFilterBuilder {
builder.condition = condition
builder.conditionFlag = true
return builder
}
func (builder *CreateSheetFilterBuilder) Build() *CreateSheetFilter {
req := &CreateSheetFilter{}
if builder.rangeFlag {
req.Range = &builder.range_
}
if builder.colFlag {
req.Col = &builder.col
}
if builder.conditionFlag {
req.Condition = builder.condition
}
return req
}
type DataValidation struct {
DataValidationId *int `json:"data_validation_id,omitempty"` // 数据校验ID
DataValidationRule *DataValidationRule `json:"data_validation_rule,omitempty"` // 数据校验规则
Strict *string `json:"strict,omitempty"` // 校验模式,数据非法时是否拒绝输入
HelpText *string `json:"help_text,omitempty"` // 输入提示
}
type DataValidationBuilder struct {
dataValidationId int // 数据校验ID
dataValidationIdFlag bool
dataValidationRule *DataValidationRule // 数据校验规则
dataValidationRuleFlag bool
strict string // 校验模式,数据非法时是否拒绝输入
strictFlag bool
helpText string // 输入提示
helpTextFlag bool
}
func NewDataValidationBuilder() *DataValidationBuilder {
builder := &DataValidationBuilder{}
return builder
}
// 数据校验ID
//
// 示例值:1
func (builder *DataValidationBuilder) DataValidationId(dataValidationId int) *DataValidationBuilder {
builder.dataValidationId = dataValidationId
builder.dataValidationIdFlag = true
return builder
}
// 数据校验规则
//
// 示例值:
func (builder *DataValidationBuilder) DataValidationRule(dataValidationRule *DataValidationRule) *DataValidationBuilder {
builder.dataValidationRule = dataValidationRule
builder.dataValidationRuleFlag = true
return builder
}
// 校验模式,数据非法时是否拒绝输入
//
// 示例值:true
func (builder *DataValidationBuilder) Strict(strict string) *DataValidationBuilder {
builder.strict = strict
builder.strictFlag = true
return builder
}
// 输入提示
//
// 示例值:number between 1 and 2
func (builder *DataValidationBuilder) HelpText(helpText string) *DataValidationBuilder {
builder.helpText = helpText
builder.helpTextFlag = true
return builder
}
func (builder *DataValidationBuilder) Build() *DataValidation {
req := &DataValidation{}
if builder.dataValidationIdFlag {
req.DataValidationId = &builder.dataValidationId
}
if builder.dataValidationRuleFlag {
req.DataValidationRule = builder.dataValidationRule
}
if builder.strictFlag {
req.Strict = &builder.strict
}
if builder.helpTextFlag {
req.HelpText = &builder.helpText
}
return req
}
type DataValidationRule struct {
Type *string `json:"type,omitempty"` // 数据校验类型
SingleOption *SingleOption `json:"single_option,omitempty"` // 单选
MultipleOption *MultipleOption `json:"multiple_option,omitempty"` // 多选
}
type DataValidationRuleBuilder struct {
type_ string // 数据校验类型
typeFlag bool
singleOption *SingleOption // 单选
singleOptionFlag bool
multipleOption *MultipleOption // 多选
multipleOptionFlag bool
}
func NewDataValidationRuleBuilder() *DataValidationRuleBuilder {
builder := &DataValidationRuleBuilder{}
return builder
}
// 数据校验类型
//
// 示例值:SingleOption
func (builder *DataValidationRuleBuilder) Type(type_ string) *DataValidationRuleBuilder {
builder.type_ = type_
builder.typeFlag = true
return builder
}
// 单选
//
// 示例值:
func (builder *DataValidationRuleBuilder) SingleOption(singleOption *SingleOption) *DataValidationRuleBuilder {
builder.singleOption = singleOption
builder.singleOptionFlag = true
return builder
}
// 多选
//
// 示例值:
func (builder *DataValidationRuleBuilder) MultipleOption(multipleOption *MultipleOption) *DataValidationRuleBuilder {
builder.multipleOption = multipleOption
builder.multipleOptionFlag = true
return builder
}
func (builder *DataValidationRuleBuilder) Build() *DataValidationRule {
req := &DataValidationRule{}
if builder.typeFlag {
req.Type = &builder.type_
}
if builder.singleOptionFlag {
req.SingleOption = builder.singleOption
}
if builder.multipleOptionFlag {
req.MultipleOption = builder.multipleOption
}
return req
}
type DataValidationValue struct {
OptionValue *string `json:"option_value,omitempty"` // 选项值
OptionColor *string `json:"option_color,omitempty"` // 选项颜色
}
type DataValidationValueBuilder struct {
optionValue string // 选项值
optionValueFlag bool
optionColor string // 选项颜色
optionColorFlag bool
}
func NewDataValidationValueBuilder() *DataValidationValueBuilder {
builder := &DataValidationValueBuilder{}
return builder
}
// 选项值
//
// 示例值:Option1
func (builder *DataValidationValueBuilder) OptionValue(optionValue string) *DataValidationValueBuilder {
builder.optionValue = optionValue
builder.optionValueFlag = true
return builder
}
// 选项颜色
//
// 示例值:#ff00ff
func (builder *DataValidationValueBuilder) OptionColor(optionColor string) *DataValidationValueBuilder {
builder.optionColor = optionColor
builder.optionColorFlag = true
return builder
}
func (builder *DataValidationValueBuilder) Build() *DataValidationValue {
req := &DataValidationValue{}
if builder.optionValueFlag {
req.OptionValue = &builder.optionValue
}
if builder.optionColorFlag {
req.OptionColor = &builder.optionColor
}
return req
}
type DateTime struct {
DateTime *string `json:"date_time,omitempty"` // 时间日期
}
type DateTimeBuilder struct {
dateTime string // 时间日期
dateTimeFlag bool
}
func NewDateTimeBuilder() *DateTimeBuilder {
builder := &DateTimeBuilder{}
return builder
}
// 时间日期
//
// 示例值:2022/02/22
func (builder *DateTimeBuilder) DateTime(dateTime string) *DateTimeBuilder {
builder.dateTime = dateTime
builder.dateTimeFlag = true
return builder
}
func (builder *DateTimeBuilder) Build() *DateTime {
req := &DateTime{}
if builder.dateTimeFlag {
req.DateTime = &builder.dateTime
}
return req
}
type DepartmentId struct {
DepartmentId *string `json:"department_id,omitempty"` //
OpenDepartmentId *string `json:"open_department_id,omitempty"` //
}
type DepartmentIdBuilder struct {
departmentId string //
departmentIdFlag bool
openDepartmentId string //
openDepartmentIdFlag bool
}
func NewDepartmentIdBuilder() *DepartmentIdBuilder {
builder := &DepartmentIdBuilder{}
return builder
}
// 示例值:
func (builder *DepartmentIdBuilder) DepartmentId(departmentId string) *DepartmentIdBuilder {
builder.departmentId = departmentId
builder.departmentIdFlag = true
return builder
}
// 示例值:
func (builder *DepartmentIdBuilder) OpenDepartmentId(openDepartmentId string) *DepartmentIdBuilder {
builder.openDepartmentId = openDepartmentId
builder.openDepartmentIdFlag = true
return builder
}
func (builder *DepartmentIdBuilder) Build() *DepartmentId {
req := &DepartmentId{}
if builder.departmentIdFlag {
req.DepartmentId = &builder.departmentId
}
if builder.openDepartmentIdFlag {
req.OpenDepartmentId = &builder.openDepartmentId
}
return req
}
type Dimension struct {
MajorDimension *string `json:"major_dimension,omitempty"` // 操作行还是列,取值:ROWS、COLUMNS
StartIndex *int `json:"start_index,omitempty"` // 起始行或者列号
EndIndex *int `json:"end_index,omitempty"` // 结束行或者列号
}
type DimensionBuilder struct {
majorDimension string // 操作行还是列,取值:ROWS、COLUMNS
majorDimensionFlag bool
startIndex int // 起始行或者列号
startIndexFlag bool
endIndex int // 结束行或者列号
endIndexFlag bool
}
func NewDimensionBuilder() *DimensionBuilder {
builder := &DimensionBuilder{}
return builder
}
// 操作行还是列,取值:ROWS、COLUMNS
//
// 示例值:ROWS
func (builder *DimensionBuilder) MajorDimension(majorDimension string) *DimensionBuilder {
builder.majorDimension = majorDimension
builder.majorDimensionFlag = true
return builder
}
// 起始行或者列号
//
// 示例值:0
func (builder *DimensionBuilder) StartIndex(startIndex int) *DimensionBuilder {
builder.startIndex = startIndex
builder.startIndexFlag = true
return builder
}
// 结束行或者列号
//
// 示例值:1
func (builder *DimensionBuilder) EndIndex(endIndex int) *DimensionBuilder {
builder.endIndex = endIndex
builder.endIndexFlag = true
return builder
}
func (builder *DimensionBuilder) Build() *Dimension {
req := &Dimension{}
if builder.majorDimensionFlag {
req.MajorDimension = &builder.majorDimension
}
if builder.startIndexFlag {
req.StartIndex = &builder.startIndex
}
if builder.endIndexFlag {
req.EndIndex = &builder.endIndex
}
return req
}
type DimensionProperties struct {
Hidden *bool `json:"hidden,omitempty"` // 是否隐藏
PixelSize *int `json:"pixel_size,omitempty"` // 行/列像素大小
}
type DimensionPropertiesBuilder struct {
hidden bool // 是否隐藏
hiddenFlag bool
pixelSize int // 行/列像素大小
pixelSizeFlag bool
}
func NewDimensionPropertiesBuilder() *DimensionPropertiesBuilder {
builder := &DimensionPropertiesBuilder{}
return builder
}
// 是否隐藏
//
// 示例值:false
func (builder *DimensionPropertiesBuilder) Hidden(hidden bool) *DimensionPropertiesBuilder {
builder.hidden = hidden
builder.hiddenFlag = true
return builder
}
// 行/列像素大小
//
// 示例值:100
func (builder *DimensionPropertiesBuilder) PixelSize(pixelSize int) *DimensionPropertiesBuilder {
builder.pixelSize = pixelSize
builder.pixelSizeFlag = true
return builder
}
func (builder *DimensionPropertiesBuilder) Build() *DimensionProperties {
req := &DimensionProperties{}
if builder.hiddenFlag {
req.Hidden = &builder.hidden
}
if builder.pixelSizeFlag {
req.PixelSize = &builder.pixelSize
}
return req
}
type File struct {
FileToken *string `json:"file_token,omitempty"` // 附件token
Name *string `json:"name,omitempty"` // 附件名称
SegmentStyle *SegmentStyle `json:"segment_style,omitempty"` //
}
type FileBuilder struct {
fileToken string // 附件token
fileTokenFlag bool
name string // 附件名称
nameFlag bool
segmentStyle *SegmentStyle //
segmentStyleFlag bool
}
func NewFileBuilder() *FileBuilder {
builder := &FileBuilder{}
return builder
}
// 附件token
//
// 示例值:boxxxxxxx
func (builder *FileBuilder) FileToken(fileToken string) *FileBuilder {
builder.fileToken = fileToken
builder.fileTokenFlag = true
return builder
}
// 附件名称
//
// 示例值:a.png
func (builder *FileBuilder) Name(name string) *FileBuilder {
builder.name = name
builder.nameFlag = true
return builder
}
// 示例值:
func (builder *FileBuilder) SegmentStyle(segmentStyle *SegmentStyle) *FileBuilder {
builder.segmentStyle = segmentStyle
builder.segmentStyleFlag = true
return builder
}
func (builder *FileBuilder) Build() *File {
req := &File{}
if builder.fileTokenFlag {
req.FileToken = &builder.fileToken
}
if builder.nameFlag {
req.Name = &builder.name
}
if builder.segmentStyleFlag {
req.SegmentStyle = builder.segmentStyle
}
return req
}
type FilterInfo struct {
Col *string `json:"col,omitempty"` // 设置了筛选条件的列
Conditions []*Condition `json:"conditions,omitempty"` // 筛选条件
}
type FilterInfoBuilder struct {
col string // 设置了筛选条件的列
colFlag bool
conditions []*Condition // 筛选条件
conditionsFlag bool
}
func NewFilterInfoBuilder() *FilterInfoBuilder {
builder := &FilterInfoBuilder{}
return builder
}
// 设置了筛选条件的列
//
// 示例值:E
func (builder *FilterInfoBuilder) Col(col string) *FilterInfoBuilder {
builder.col = col
builder.colFlag = true
return builder
}
// 筛选条件
//
// 示例值:
func (builder *FilterInfoBuilder) Conditions(conditions []*Condition) *FilterInfoBuilder {
builder.conditions = conditions
builder.conditionsFlag = true
return builder
}
func (builder *FilterInfoBuilder) Build() *FilterInfo {
req := &FilterInfo{}
if builder.colFlag {
req.Col = &builder.col
}
if builder.conditionsFlag {
req.Conditions = builder.conditions
}
return req
}
type FilterView struct {
FilterViewId *string `json:"filter_view_id,omitempty"` // 筛选视图 id
FilterViewName *string `json:"filter_view_name,omitempty"` // 筛选视图名字
Range *string `json:"range,omitempty"` // 筛选视图的筛选范围
}
type FilterViewBuilder struct {
filterViewId string // 筛选视图 id
filterViewIdFlag bool
filterViewName string // 筛选视图名字
filterViewNameFlag bool
range_ string // 筛选视图的筛选范围
rangeFlag bool
}
func NewFilterViewBuilder() *FilterViewBuilder {
builder := &FilterViewBuilder{}
return builder
}
// 筛选视图 id
//
// 示例值:pH9hbVcCXA
func (builder *FilterViewBuilder) FilterViewId(filterViewId string) *FilterViewBuilder {
builder.filterViewId = filterViewId
builder.filterViewIdFlag = true
return builder
}
// 筛选视图名字
//
// 示例值:筛选视图 1
func (builder *FilterViewBuilder) FilterViewName(filterViewName string) *FilterViewBuilder {
builder.filterViewName = filterViewName
builder.filterViewNameFlag = true
return builder
}
// 筛选视图的筛选范围
//
// 示例值:0b**12!C1:H14
func (builder *FilterViewBuilder) Range(range_ string) *FilterViewBuilder {
builder.range_ = range_
builder.rangeFlag = true
return builder
}
func (builder *FilterViewBuilder) Build() *FilterView {
req := &FilterView{}
if builder.filterViewIdFlag {
req.FilterViewId = &builder.filterViewId
}
if builder.filterViewNameFlag {
req.FilterViewName = &builder.filterViewName
}
if builder.rangeFlag {
req.Range = &builder.range_
}
return req
}
type FilterViewCondition struct {
ConditionId *string `json:"condition_id,omitempty"` // 设置筛选条件的列,使用字母号
FilterType *string `json:"filter_type,omitempty"` // 筛选类型
CompareType *string `json:"compare_type,omitempty"` // 比较类型
Expected []string `json:"expected,omitempty"` // 筛选参数
}
type FilterViewConditionBuilder struct {
conditionId string // 设置筛选条件的列,使用字母号
conditionIdFlag bool
filterType string // 筛选类型
filterTypeFlag bool
compareType string // 比较类型
compareTypeFlag bool
expected []string // 筛选参数
expectedFlag bool
}
func NewFilterViewConditionBuilder() *FilterViewConditionBuilder {
builder := &FilterViewConditionBuilder{}
return builder
}
// 设置筛选条件的列,使用字母号
//
// 示例值:E
func (builder *FilterViewConditionBuilder) ConditionId(conditionId string) *FilterViewConditionBuilder {
builder.conditionId = conditionId
builder.conditionIdFlag = true
return builder
}
// 筛选类型
//
// 示例值:number
func (builder *FilterViewConditionBuilder) FilterType(filterType string) *FilterViewConditionBuilder {
builder.filterType = filterType
builder.filterTypeFlag = true
return builder
}
// 比较类型
//
// 示例值:less
func (builder *FilterViewConditionBuilder) CompareType(compareType string) *FilterViewConditionBuilder {
builder.compareType = compareType
builder.compareTypeFlag = true
return builder
}
// 筛选参数
//
// 示例值:6
func (builder *FilterViewConditionBuilder) Expected(expected []string) *FilterViewConditionBuilder {
builder.expected = expected
builder.expectedFlag = true
return builder
}
func (builder *FilterViewConditionBuilder) Build() *FilterViewCondition {
req := &FilterViewCondition{}
if builder.conditionIdFlag {
req.ConditionId = &builder.conditionId
}
if builder.filterTypeFlag {
req.FilterType = &builder.filterType
}
if builder.compareTypeFlag {
req.CompareType = &builder.compareType
}
if builder.expectedFlag {
req.Expected = builder.expected
}
return req
}
type Find struct {
FindCondition *FindCondition `json:"find_condition,omitempty"` // 查找条件
Find *string `json:"find,omitempty"` // 查找的字符串,当`search_by_regex`字段为 true 时,该字段为正则表达式
}
type FindBuilder struct {
findCondition *FindCondition // 查找条件
findConditionFlag bool
find string // 查找的字符串,当`search_by_regex`字段为 true 时,该字段为正则表达式
findFlag bool
}
func NewFindBuilder() *FindBuilder {
builder := &FindBuilder{}
return builder
}
// 查找条件
//
// 示例值:
func (builder *FindBuilder) FindCondition(findCondition *FindCondition) *FindBuilder {
builder.findCondition = findCondition
builder.findConditionFlag = true
return builder
}
// 查找的字符串,当`search_by_regex`字段为 true 时,该字段为正则表达式
//
// 示例值:如下;;- 普通查找示例: "hello";- 正则查找示例: "[A-Z]\w+"
func (builder *FindBuilder) Find(find string) *FindBuilder {
builder.find = find
builder.findFlag = true
return builder
}
func (builder *FindBuilder) Build() *Find {
req := &Find{}
if builder.findConditionFlag {
req.FindCondition = builder.findCondition
}
if builder.findFlag {
req.Find = &builder.find
}
return req
}
type FindCondition struct {
Range *string `json:"range,omitempty"` // 查找范围,参考 [名词解释 Range](https://open.feishu.cn/document/ukTMukTMukTM/uATMzUjLwEzM14CMxMTN/overview)
MatchCase *bool `json:"match_case,omitempty"` // 是否忽略大小写,默认为 false;- `true`:表示忽略字符串中字母大小写差异;- `false`:表示区分字符串中字母大小写
MatchEntireCell *bool `json:"match_entire_cell,omitempty"` // 是否完全匹配整个单元格,默认值为 false;- `true`:表示完全匹配单元格,比如 find 取值为 "hello",则单元格中的内容必须为 "hello";- `false`:表示允许部分匹配单元格,比如 find 取值为 "hello",则单元格中的内容包含 "hello" 即可
SearchByRegex *bool `json:"search_by_regex,omitempty"` // 是否为正则匹配,默认值为 false;- `true`:表示使用正则匹配;- `false`:表示不使用正则匹配
IncludeFormulas *bool `json:"include_formulas,omitempty"` // 是否仅搜索单元格公式,默认值为 false;- `true`:表示仅搜索单元格公式;- `false`:表示仅搜索单元格内容
}
type FindConditionBuilder struct {
range_ string // 查找范围,参考 [名词解释 Range](https://open.feishu.cn/document/ukTMukTMukTM/uATMzUjLwEzM14CMxMTN/overview)
rangeFlag bool
matchCase bool // 是否忽略大小写,默认为 false;- `true`:表示忽略字符串中字母大小写差异;- `false`:表示区分字符串中字母大小写
matchCaseFlag bool
matchEntireCell bool // 是否完全匹配整个单元格,默认值为 false;- `true`:表示完全匹配单元格,比如 find 取值为 "hello",则单元格中的内容必须为 "hello";- `false`:表示允许部分匹配单元格,比如 find 取值为 "hello",则单元格中的内容包含 "hello" 即可
matchEntireCellFlag bool
searchByRegex bool // 是否为正则匹配,默认值为 false;- `true`:表示使用正则匹配;- `false`:表示不使用正则匹配
searchByRegexFlag bool
includeFormulas bool // 是否仅搜索单元格公式,默认值为 false;- `true`:表示仅搜索单元格公式;- `false`:表示仅搜索单元格内容
includeFormulasFlag bool
}
func NewFindConditionBuilder() *FindConditionBuilder {
builder := &FindConditionBuilder{}
return builder
}
// 查找范围,参考 [名词解释 Range](https://open.feishu.cn/document/ukTMukTMukTM/uATMzUjLwEzM14CMxMTN/overview)
//
// 示例值:PNIfrm!A1:C5
func (builder *FindConditionBuilder) Range(range_ string) *FindConditionBuilder {
builder.range_ = range_
builder.rangeFlag = true
return builder
}
// 是否忽略大小写,默认为 false;- `true`:表示忽略字符串中字母大小写差异;- `false`:表示区分字符串中字母大小写
//
// 示例值:true
func (builder *FindConditionBuilder) MatchCase(matchCase bool) *FindConditionBuilder {
builder.matchCase = matchCase
builder.matchCaseFlag = true
return builder
}
// 是否完全匹配整个单元格,默认值为 false;- `true`:表示完全匹配单元格,比如 find 取值为 "hello",则单元格中的内容必须为 "hello";- `false`:表示允许部分匹配单元格,比如 find 取值为 "hello",则单元格中的内容包含 "hello" 即可
//
// 示例值:false
func (builder *FindConditionBuilder) MatchEntireCell(matchEntireCell bool) *FindConditionBuilder {
builder.matchEntireCell = matchEntireCell
builder.matchEntireCellFlag = true
return builder
}
// 是否为正则匹配,默认值为 false;- `true`:表示使用正则匹配;- `false`:表示不使用正则匹配
//
// 示例值:false
func (builder *FindConditionBuilder) SearchByRegex(searchByRegex bool) *FindConditionBuilder {
builder.searchByRegex = searchByRegex
builder.searchByRegexFlag = true
return builder
}
// 是否仅搜索单元格公式,默认值为 false;- `true`:表示仅搜索单元格公式;- `false`:表示仅搜索单元格内容
//
// 示例值:false
func (builder *FindConditionBuilder) IncludeFormulas(includeFormulas bool) *FindConditionBuilder {
builder.includeFormulas = includeFormulas
builder.includeFormulasFlag = true
return builder
}
func (builder *FindConditionBuilder) Build() *FindCondition {
req := &FindCondition{}
if builder.rangeFlag {
req.Range = &builder.range_
}
if builder.matchCaseFlag {
req.MatchCase = &builder.matchCase
}
if builder.matchEntireCellFlag {
req.MatchEntireCell = &builder.matchEntireCell
}
if builder.searchByRegexFlag {
req.SearchByRegex = &builder.searchByRegex
}
if builder.includeFormulasFlag {
req.IncludeFormulas = &builder.includeFormulas
}
return req
}
type FindReplaceResult struct {
MatchedCells []string `json:"matched_cells,omitempty"` // 符合查找条件的单元格数组,不包含公式,例如["A1", "A2"...]
MatchedFormulaCells []string `json:"matched_formula_cells,omitempty"` // 符合查找条件的含有公式的单元格数组,例如["B3", "H7"...]
RowsCount *int `json:"rows_count,omitempty"` // 符合查找条件的总行数
}
type FindReplaceResultBuilder struct {
matchedCells []string // 符合查找条件的单元格数组,不包含公式,例如["A1", "A2"...]
matchedCellsFlag bool
matchedFormulaCells []string // 符合查找条件的含有公式的单元格数组,例如["B3", "H7"...]
matchedFormulaCellsFlag bool
rowsCount int // 符合查找条件的总行数
rowsCountFlag bool
}
func NewFindReplaceResultBuilder() *FindReplaceResultBuilder {
builder := &FindReplaceResultBuilder{}
return builder
}
// 符合查找条件的单元格数组,不包含公式,例如["A1", "A2"...]
//
// 示例值:
func (builder *FindReplaceResultBuilder) MatchedCells(matchedCells []string) *FindReplaceResultBuilder {
builder.matchedCells = matchedCells
builder.matchedCellsFlag = true
return builder
}
// 符合查找条件的含有公式的单元格数组,例如["B3", "H7"...]
//
// 示例值:
func (builder *FindReplaceResultBuilder) MatchedFormulaCells(matchedFormulaCells []string) *FindReplaceResultBuilder {
builder.matchedFormulaCells = matchedFormulaCells
builder.matchedFormulaCellsFlag = true
return builder
}
// 符合查找条件的总行数
//
// 示例值:2
func (builder *FindReplaceResultBuilder) RowsCount(rowsCount int) *FindReplaceResultBuilder {
builder.rowsCount = rowsCount
builder.rowsCountFlag = true
return builder
}
func (builder *FindReplaceResultBuilder) Build() *FindReplaceResult {
req := &FindReplaceResult{}
if builder.matchedCellsFlag {
req.MatchedCells = builder.matchedCells
}
if builder.matchedFormulaCellsFlag {
req.MatchedFormulaCells = builder.matchedFormulaCells
}
if builder.rowsCountFlag {
req.RowsCount = &builder.rowsCount
}
return req
}
type FloatImage struct {
FloatImageId *string `json:"float_image_id,omitempty"` // 浮动图片 id
FloatImageToken *string `json:"float_image_token,omitempty"` // 【更新时不用传,创建需要】浮动图片 token,需要先上传图片到表格获得此 token 之后再进行浮动图片的相关操作
Range *string `json:"range,omitempty"` // 浮动图片的左上角单元格定位,只支持一个单元格
Width *float64 `json:"width,omitempty"` // 浮动图片的宽度,大于等于 20px
Height *float64 `json:"height,omitempty"` // 浮动图片的高度,大于等于 20px
OffsetX *float64 `json:"offset_x,omitempty"` // 浮动图片左上角所在位置相对于所在单元格左上角的横向偏移,大于等于0且小于所在单元格的宽度
OffsetY *float64 `json:"offset_y,omitempty"` // 浮动图片左上角所在位置相对于所在单元格左上角的纵向偏移,大于等于0且小于所在单元格的高度
}
type FloatImageBuilder struct {
floatImageId string // 浮动图片 id
floatImageIdFlag bool
floatImageToken string // 【更新时不用传,创建需要】浮动图片 token,需要先上传图片到表格获得此 token 之后再进行浮动图片的相关操作
floatImageTokenFlag bool
range_ string // 浮动图片的左上角单元格定位,只支持一个单元格
rangeFlag bool
width float64 // 浮动图片的宽度,大于等于 20px
widthFlag bool
height float64 // 浮动图片的高度,大于等于 20px
heightFlag bool
offsetX float64 // 浮动图片左上角所在位置相对于所在单元格左上角的横向偏移,大于等于0且小于所在单元格的宽度
offsetXFlag bool
offsetY float64 // 浮动图片左上角所在位置相对于所在单元格左上角的纵向偏移,大于等于0且小于所在单元格的高度
offsetYFlag bool
}
func NewFloatImageBuilder() *FloatImageBuilder {
builder := &FloatImageBuilder{}
return builder
}
// 浮动图片 id
//
// 示例值:ye06SS14ph
func (builder *FloatImageBuilder) FloatImageId(floatImageId string) *FloatImageBuilder {
builder.floatImageId = floatImageId
builder.floatImageIdFlag = true
return builder
}
// 【更新时不用传,创建需要】浮动图片 token,需要先上传图片到表格获得此 token 之后再进行浮动图片的相关操作
//
// 示例值:boxbcbQsaSqIXsxxxxx1HCPJFbh
func (builder *FloatImageBuilder) FloatImageToken(floatImageToken string) *FloatImageBuilder {
builder.floatImageToken = floatImageToken
builder.floatImageTokenFlag = true
return builder
}
// 浮动图片的左上角单元格定位,只支持一个单元格
//
// 示例值:0b**12!A1:A1
func (builder *FloatImageBuilder) Range(range_ string) *FloatImageBuilder {
builder.range_ = range_
builder.rangeFlag = true
return builder
}
// 浮动图片的宽度,大于等于 20px
//
// 示例值:100
func (builder *FloatImageBuilder) Width(width float64) *FloatImageBuilder {
builder.width = width
builder.widthFlag = true
return builder
}
// 浮动图片的高度,大于等于 20px
//
// 示例值:100
func (builder *FloatImageBuilder) Height(height float64) *FloatImageBuilder {
builder.height = height
builder.heightFlag = true
return builder
}
// 浮动图片左上角所在位置相对于所在单元格左上角的横向偏移,大于等于0且小于所在单元格的宽度
//
// 示例值:0
func (builder *FloatImageBuilder) OffsetX(offsetX float64) *FloatImageBuilder {
builder.offsetX = offsetX
builder.offsetXFlag = true
return builder
}
// 浮动图片左上角所在位置相对于所在单元格左上角的纵向偏移,大于等于0且小于所在单元格的高度
//
// 示例值:0
func (builder *FloatImageBuilder) OffsetY(offsetY float64) *FloatImageBuilder {
builder.offsetY = offsetY
builder.offsetYFlag = true
return builder
}
func (builder *FloatImageBuilder) Build() *FloatImage {
req := &FloatImage{}
if builder.floatImageIdFlag {
req.FloatImageId = &builder.floatImageId
}
if builder.floatImageTokenFlag {
req.FloatImageToken = &builder.floatImageToken
}
if builder.rangeFlag {
req.Range = &builder.range_
}
if builder.widthFlag {
req.Width = &builder.width
}
if builder.heightFlag {
req.Height = &builder.height
}
if builder.offsetXFlag {
req.OffsetX = &builder.offsetX
}
if builder.offsetYFlag {
req.OffsetY = &builder.offsetY
}
return req
}
type Formula struct {
Formula *string `json:"formula,omitempty"` // 公式
FormulaValue *string `json:"formula_value,omitempty"` // 公式结果
AffectedRange *string `json:"affected_range,omitempty"` // 公式影响的范围
}
type FormulaBuilder struct {
formula string // 公式
formulaFlag bool
formulaValue string // 公式结果
formulaValueFlag bool
affectedRange string // 公式影响的范围
affectedRangeFlag bool
}
func NewFormulaBuilder() *FormulaBuilder {
builder := &FormulaBuilder{}
return builder
}
// 公式
//
// 示例值:=SUM(A:A)
func (builder *FormulaBuilder) Formula(formula string) *FormulaBuilder {
builder.formula = formula
builder.formulaFlag = true
return builder
}
// 公式结果
//
// 示例值:123
func (builder *FormulaBuilder) FormulaValue(formulaValue string) *FormulaBuilder {
builder.formulaValue = formulaValue
builder.formulaValueFlag = true
return builder
}
// 公式影响的范围
//
// 示例值:Xkhr2d!A1:B2
func (builder *FormulaBuilder) AffectedRange(affectedRange string) *FormulaBuilder {
builder.affectedRange = affectedRange
builder.affectedRangeFlag = true
return builder
}
func (builder *FormulaBuilder) Build() *Formula {
req := &Formula{}
if builder.formulaFlag {
req.Formula = &builder.formula
}
if builder.formulaValueFlag {
req.FormulaValue = &builder.formulaValue
}
if builder.affectedRangeFlag {
req.AffectedRange = &builder.affectedRange
}
return req
}
type GetSpreadsheet struct {
Title *string `json:"title,omitempty"` // 电子表格标题
OwnerId *string `json:"owner_id,omitempty"` // 电子表格owner
Token *string `json:"token,omitempty"` // 电子表格token
Url *string `json:"url,omitempty"` // 电子表格url
}
type GetSpreadsheetBuilder struct {
title string // 电子表格标题
titleFlag bool
ownerId string // 电子表格owner
ownerIdFlag bool
token string // 电子表格token
tokenFlag bool
url string // 电子表格url
urlFlag bool
}
func NewGetSpreadsheetBuilder() *GetSpreadsheetBuilder {
builder := &GetSpreadsheetBuilder{}
return builder
}
// 电子表格标题
//
// 示例值:title
func (builder *GetSpreadsheetBuilder) Title(title string) *GetSpreadsheetBuilder {
builder.title = title
builder.titleFlag = true
return builder
}
// 电子表格owner
//
// 示例值:ou_xxxxxxxxxxxx
func (builder *GetSpreadsheetBuilder) OwnerId(ownerId string) *GetSpreadsheetBuilder {
builder.ownerId = ownerId
builder.ownerIdFlag = true
return builder
}
// 电子表格token
//
// 示例值:shtxxxxxxxxxxxxxx
func (builder *GetSpreadsheetBuilder) Token(token string) *GetSpreadsheetBuilder {
builder.token = token
builder.tokenFlag = true
return builder
}
// 电子表格url
//
// 示例值:https://bytedance.feishu.cn/sheets/shtcnmBA*****yGehy8
func (builder *GetSpreadsheetBuilder) Url(url string) *GetSpreadsheetBuilder {
builder.url = url
builder.urlFlag = true
return builder
}
func (builder *GetSpreadsheetBuilder) Build() *GetSpreadsheet {
req := &GetSpreadsheet{}
if builder.titleFlag {
req.Title = &builder.title
}
if builder.ownerIdFlag {
req.OwnerId = &builder.ownerId
}
if builder.tokenFlag {
req.Token = &builder.token
}
if builder.urlFlag {
req.Url = &builder.url
}
return req
}
type GridProperties struct {
FrozenRowCount *int `json:"frozen_row_count,omitempty"` // 冻结的行数量
FrozenColumnCount *int `json:"frozen_column_count,omitempty"` // 冻结的列数量
RowCount *int `json:"row_count,omitempty"` // 工作表的行数
ColumnCount *int `json:"column_count,omitempty"` // 工作表的列数量
}
type GridPropertiesBuilder struct {
frozenRowCount int // 冻结的行数量
frozenRowCountFlag bool
frozenColumnCount int // 冻结的列数量
frozenColumnCountFlag bool
rowCount int // 工作表的行数
rowCountFlag bool
columnCount int // 工作表的列数量
columnCountFlag bool
}
func NewGridPropertiesBuilder() *GridPropertiesBuilder {
builder := &GridPropertiesBuilder{}
return builder
}
// 冻结的行数量
//
// 示例值:0
func (builder *GridPropertiesBuilder) FrozenRowCount(frozenRowCount int) *GridPropertiesBuilder {
builder.frozenRowCount = frozenRowCount
builder.frozenRowCountFlag = true
return builder
}
// 冻结的列数量
//
// 示例值:0
func (builder *GridPropertiesBuilder) FrozenColumnCount(frozenColumnCount int) *GridPropertiesBuilder {
builder.frozenColumnCount = frozenColumnCount
builder.frozenColumnCountFlag = true
return builder
}
// 工作表的行数
//
// 示例值:200
func (builder *GridPropertiesBuilder) RowCount(rowCount int) *GridPropertiesBuilder {
builder.rowCount = rowCount
builder.rowCountFlag = true
return builder
}
// 工作表的列数量
//
// 示例值:20
func (builder *GridPropertiesBuilder) ColumnCount(columnCount int) *GridPropertiesBuilder {
builder.columnCount = columnCount
builder.columnCountFlag = true
return builder
}
func (builder *GridPropertiesBuilder) Build() *GridProperties {
req := &GridProperties{}
if builder.frozenRowCountFlag {
req.FrozenRowCount = &builder.frozenRowCount
}
if builder.frozenColumnCountFlag {
req.FrozenColumnCount = &builder.frozenColumnCount
}
if builder.rowCountFlag {
req.RowCount = &builder.rowCount
}
if builder.columnCountFlag {
req.ColumnCount = &builder.columnCount
}
return req
}
type Image struct {
ImageToken *string `json:"image_token,omitempty"` // 图片token
}
type ImageBuilder struct {
imageToken string // 图片token
imageTokenFlag bool
}
func NewImageBuilder() *ImageBuilder {
builder := &ImageBuilder{}
return builder
}
// 图片token
//
// 示例值:boxxxxxxxxxx
func (builder *ImageBuilder) ImageToken(imageToken string) *ImageBuilder {
builder.imageToken = imageToken
builder.imageTokenFlag = true
return builder
}
func (builder *ImageBuilder) Build() *Image {
req := &Image{}
if builder.imageTokenFlag {
req.ImageToken = &builder.imageToken
}
return req
}
type InsertDimension struct {
DimensionRange *Dimension `json:"dimension_range,omitempty"` // 行列操作的维度
InheritFrom *string `json:"inherit_from,omitempty"` // 是否继承上/下一行/列样式
}
type InsertDimensionBuilder struct {
dimensionRange *Dimension // 行列操作的维度
dimensionRangeFlag bool
inheritFrom string // 是否继承上/下一行/列样式
inheritFromFlag bool
}
func NewInsertDimensionBuilder() *InsertDimensionBuilder {
builder := &InsertDimensionBuilder{}
return builder
}
// 行列操作的维度
//
// 示例值:
func (builder *InsertDimensionBuilder) DimensionRange(dimensionRange *Dimension) *InsertDimensionBuilder {
builder.dimensionRange = dimensionRange
builder.dimensionRangeFlag = true
return builder
}
// 是否继承上/下一行/列样式
//
// 示例值:Before
func (builder *InsertDimensionBuilder) InheritFrom(inheritFrom string) *InsertDimensionBuilder {
builder.inheritFrom = inheritFrom
builder.inheritFromFlag = true
return builder
}
func (builder *InsertDimensionBuilder) Build() *InsertDimension {
req := &InsertDimension{}
if builder.dimensionRangeFlag {
req.DimensionRange = builder.dimensionRange
}
if builder.inheritFromFlag {
req.InheritFrom = &builder.inheritFrom
}
return req
}
type LeftBorderStyle struct {
Style *string `json:"style,omitempty"` // 边框样式
Color *string `json:"color,omitempty"` // 边框颜色
}
type LeftBorderStyleBuilder struct {
style string // 边框样式
styleFlag bool
color string // 边框颜色
colorFlag bool
}
func NewLeftBorderStyleBuilder() *LeftBorderStyleBuilder {
builder := &LeftBorderStyleBuilder{}
return builder
}
// 边框样式
//
// 示例值:
func (builder *LeftBorderStyleBuilder) Style(style string) *LeftBorderStyleBuilder {
builder.style = style
builder.styleFlag = true
return builder
}
// 边框颜色
//
// 示例值:#ff00ff
func (builder *LeftBorderStyleBuilder) Color(color string) *LeftBorderStyleBuilder {
builder.color = color
builder.colorFlag = true
return builder
}
func (builder *LeftBorderStyleBuilder) Build() *LeftBorderStyle {
req := &LeftBorderStyle{}
if builder.styleFlag {
req.Style = &builder.style
}
if builder.colorFlag {
req.Color = &builder.color
}
return req
}
type Link struct {
Text *string `json:"text,omitempty"` // 文本
Link *string `json:"link,omitempty"` // 链接
SegmentStyles []*SegmentStyle `json:"segment_styles,omitempty"` //
}
type LinkBuilder struct {
text string // 文本
textFlag bool
link string // 链接
linkFlag bool
segmentStyles []*SegmentStyle //
segmentStylesFlag bool
}
func NewLinkBuilder() *LinkBuilder {
builder := &LinkBuilder{}
return builder
}
// 文本
//
// 示例值:text
func (builder *LinkBuilder) Text(text string) *LinkBuilder {
builder.text = text
builder.textFlag = true
return builder
}
// 链接
//
// 示例值:www.xxxx.cn
func (builder *LinkBuilder) Link(link string) *LinkBuilder {
builder.link = link
builder.linkFlag = true
return builder
}
// 示例值:
func (builder *LinkBuilder) SegmentStyles(segmentStyles []*SegmentStyle) *LinkBuilder {
builder.segmentStyles = segmentStyles
builder.segmentStylesFlag = true
return builder
}
func (builder *LinkBuilder) Build() *Link {
req := &Link{}
if builder.textFlag {
req.Text = &builder.text
}
if builder.linkFlag {
req.Link = &builder.link
}
if builder.segmentStylesFlag {
req.SegmentStyles = builder.segmentStyles
}
return req
}
type MentionDocument struct {
Title *string `json:"title,omitempty"` // 文档标题
ObjectType *string `json:"object_type,omitempty"` // 文档类型
Token *string `json:"token,omitempty"` // 文档token
SegmentStyle *SegmentStyle `json:"segment_style,omitempty"` //
}
type MentionDocumentBuilder struct {
title string // 文档标题
titleFlag bool
objectType string // 文档类型
objectTypeFlag bool
token string // 文档token
tokenFlag bool
segmentStyle *SegmentStyle //
segmentStyleFlag bool
}
func NewMentionDocumentBuilder() *MentionDocumentBuilder {
builder := &MentionDocumentBuilder{}
return builder
}
// 文档标题
//
// 示例值:abc
func (builder *MentionDocumentBuilder) Title(title string) *MentionDocumentBuilder {
builder.title = title
builder.titleFlag = true
return builder
}
// 文档类型
//
// 示例值:sheet
func (builder *MentionDocumentBuilder) ObjectType(objectType string) *MentionDocumentBuilder {
builder.objectType = objectType
builder.objectTypeFlag = true
return builder
}
// 文档token
//
// 示例值:shtxxxxxxxxx
func (builder *MentionDocumentBuilder) Token(token string) *MentionDocumentBuilder {
builder.token = token
builder.tokenFlag = true
return builder
}
// 示例值:
func (builder *MentionDocumentBuilder) SegmentStyle(segmentStyle *SegmentStyle) *MentionDocumentBuilder {
builder.segmentStyle = segmentStyle
builder.segmentStyleFlag = true
return builder
}
func (builder *MentionDocumentBuilder) Build() *MentionDocument {
req := &MentionDocument{}
if builder.titleFlag {
req.Title = &builder.title
}
if builder.objectTypeFlag {
req.ObjectType = &builder.objectType
}
if builder.tokenFlag {
req.Token = &builder.token
}
if builder.segmentStyleFlag {
req.SegmentStyle = builder.segmentStyle
}
return req
}
type MentionUser struct {
Name *string `json:"name,omitempty"` // 用户名
UserId *string `json:"user_id,omitempty"` // 用户id
Notify *bool `json:"notify,omitempty"` // 是否通知用户
SegmentStyle *SegmentStyle `json:"segment_style,omitempty"` // 局部样式
}
type MentionUserBuilder struct {
name string // 用户名
nameFlag bool
userId string // 用户id
userIdFlag bool
notify bool // 是否通知用户
notifyFlag bool
segmentStyle *SegmentStyle // 局部样式
segmentStyleFlag bool
}
func NewMentionUserBuilder() *MentionUserBuilder {
builder := &MentionUserBuilder{}
return builder
}
// 用户名
//
// 示例值:李四
func (builder *MentionUserBuilder) Name(name string) *MentionUserBuilder {
builder.name = name
builder.nameFlag = true
return builder
}
// 用户id
//
// 示例值:ou_xxxxxxx
func (builder *MentionUserBuilder) UserId(userId string) *MentionUserBuilder {
builder.userId = userId
builder.userIdFlag = true
return builder
}
// 是否通知用户
//
// 示例值:true
func (builder *MentionUserBuilder) Notify(notify bool) *MentionUserBuilder {
builder.notify = notify
builder.notifyFlag = true
return builder
}
// 局部样式
//
// 示例值:
func (builder *MentionUserBuilder) SegmentStyle(segmentStyle *SegmentStyle) *MentionUserBuilder {
builder.segmentStyle = segmentStyle
builder.segmentStyleFlag = true
return builder
}
func (builder *MentionUserBuilder) Build() *MentionUser {
req := &MentionUser{}
if builder.nameFlag {
req.Name = &builder.name
}
if builder.userIdFlag {
req.UserId = &builder.userId
}
if builder.notifyFlag {
req.Notify = &builder.notify
}
if builder.segmentStyleFlag {
req.SegmentStyle = builder.segmentStyle
}
return req
}
type MergeCell struct {
Range *MergeRange `json:"range,omitempty"` // 合并单元格的范围
MergeType *string `json:"merge_type,omitempty"` // 合并单元格类型
}
type MergeCellBuilder struct {
range_ *MergeRange // 合并单元格的范围
rangeFlag bool
mergeType string // 合并单元格类型
mergeTypeFlag bool
}
func NewMergeCellBuilder() *MergeCellBuilder {
builder := &MergeCellBuilder{}
return builder
}
// 合并单元格的范围
//
// 示例值:Zj2ts!A1:B2
func (builder *MergeCellBuilder) Range(range_ *MergeRange) *MergeCellBuilder {
builder.range_ = range_
builder.rangeFlag = true
return builder
}
// 合并单元格类型
//
// 示例值:MergeAll
func (builder *MergeCellBuilder) MergeType(mergeType string) *MergeCellBuilder {
builder.mergeType = mergeType
builder.mergeTypeFlag = true
return builder
}
func (builder *MergeCellBuilder) Build() *MergeCell {
req := &MergeCell{}
if builder.rangeFlag {
req.Range = builder.range_
}
if builder.mergeTypeFlag {
req.MergeType = &builder.mergeType
}
return req
}
type MergeRange struct {
StartRowIndex *int `json:"start_row_index,omitempty"` // 起始行
EndRowIndex *int `json:"end_row_index,omitempty"` // 结束行
StartColumnIndex *int `json:"start_column_index,omitempty"` // 起始列
EndColumnIndex *int `json:"end_column_index,omitempty"` // 结束列
}
type MergeRangeBuilder struct {
startRowIndex int // 起始行
startRowIndexFlag bool
endRowIndex int // 结束行
endRowIndexFlag bool
startColumnIndex int // 起始列
startColumnIndexFlag bool
endColumnIndex int // 结束列
endColumnIndexFlag bool
}
func NewMergeRangeBuilder() *MergeRangeBuilder {
builder := &MergeRangeBuilder{}
return builder
}
// 起始行
//
// 示例值:0
func (builder *MergeRangeBuilder) StartRowIndex(startRowIndex int) *MergeRangeBuilder {
builder.startRowIndex = startRowIndex
builder.startRowIndexFlag = true
return builder
}
// 结束行
//
// 示例值:0
func (builder *MergeRangeBuilder) EndRowIndex(endRowIndex int) *MergeRangeBuilder {
builder.endRowIndex = endRowIndex
builder.endRowIndexFlag = true
return builder
}
// 起始列
//
// 示例值:0
func (builder *MergeRangeBuilder) StartColumnIndex(startColumnIndex int) *MergeRangeBuilder {
builder.startColumnIndex = startColumnIndex
builder.startColumnIndexFlag = true
return builder
}
// 结束列
//
// 示例值:0
func (builder *MergeRangeBuilder) EndColumnIndex(endColumnIndex int) *MergeRangeBuilder {
builder.endColumnIndex = endColumnIndex
builder.endColumnIndexFlag = true
return builder
}
func (builder *MergeRangeBuilder) Build() *MergeRange {
req := &MergeRange{}
if builder.startRowIndexFlag {
req.StartRowIndex = &builder.startRowIndex
}
if builder.endRowIndexFlag {
req.EndRowIndex = &builder.endRowIndex
}
if builder.startColumnIndexFlag {
req.StartColumnIndex = &builder.startColumnIndex
}
if builder.endColumnIndexFlag {
req.EndColumnIndex = &builder.endColumnIndex
}
return req
}
type MoveDimension struct {
Source *Dimension `json:"source,omitempty"` // 移动源位置参数
DestinationIndex *int `json:"destination_index,omitempty"` // 移动的目标位置行或者列号
}
type MoveDimensionBuilder struct {
source *Dimension // 移动源位置参数
sourceFlag bool
destinationIndex int // 移动的目标位置行或者列号
destinationIndexFlag bool
}
func NewMoveDimensionBuilder() *MoveDimensionBuilder {
builder := &MoveDimensionBuilder{}
return builder
}
// 移动源位置参数
//
// 示例值:
func (builder *MoveDimensionBuilder) Source(source *Dimension) *MoveDimensionBuilder {
builder.source = source
builder.sourceFlag = true
return builder
}
// 移动的目标位置行或者列号
//
// 示例值:4
func (builder *MoveDimensionBuilder) DestinationIndex(destinationIndex int) *MoveDimensionBuilder {
builder.destinationIndex = destinationIndex
builder.destinationIndexFlag = true
return builder
}
func (builder *MoveDimensionBuilder) Build() *MoveDimension {
req := &MoveDimension{}
if builder.sourceFlag {
req.Source = builder.source
}
if builder.destinationIndexFlag {
req.DestinationIndex = &builder.destinationIndex
}
return req
}
type MultiRange struct {
Ranges []string `json:"ranges,omitempty"` // 同一个工作表的多个范围
}
type MultiRangeBuilder struct {
ranges []string // 同一个工作表的多个范围
rangesFlag bool
}
func NewMultiRangeBuilder() *MultiRangeBuilder {
builder := &MultiRangeBuilder{}
return builder
}
// 同一个工作表的多个范围
//
// 示例值:Sheet1!A1:B2
func (builder *MultiRangeBuilder) Ranges(ranges []string) *MultiRangeBuilder {
builder.ranges = ranges
builder.rangesFlag = true
return builder
}
func (builder *MultiRangeBuilder) Build() *MultiRange {
req := &MultiRange{}
if builder.rangesFlag {
req.Ranges = builder.ranges
}
return req
}
type MultipleOption struct {
Type *string `json:"type,omitempty"` // 多选类型
Range *string `json:"range,omitempty"` // 数据引用范围,当type=MultipleOfRange时必须有
DataValidationValues []*DataValidationValue `json:"data_validation_values,omitempty"` // 多选列表,当type=MultipleOfList时必须有
Properties *OptionProperties `json:"properties,omitempty"` // 属性
}
type MultipleOptionBuilder struct {
type_ string // 多选类型
typeFlag bool
range_ string // 数据引用范围,当type=MultipleOfRange时必须有
rangeFlag bool
dataValidationValues []*DataValidationValue // 多选列表,当type=MultipleOfList时必须有
dataValidationValuesFlag bool
properties *OptionProperties // 属性
propertiesFlag bool
}
func NewMultipleOptionBuilder() *MultipleOptionBuilder {
builder := &MultipleOptionBuilder{}
return builder
}
// 多选类型
//
// 示例值:OneOfList
func (builder *MultipleOptionBuilder) Type(type_ string) *MultipleOptionBuilder {
builder.type_ = type_
builder.typeFlag = true
return builder
}
// 数据引用范围,当type=MultipleOfRange时必须有
//
// 示例值:a8KL0B!A2:B3
func (builder *MultipleOptionBuilder) Range(range_ string) *MultipleOptionBuilder {
builder.range_ = range_
builder.rangeFlag = true
return builder
}
// 多选列表,当type=MultipleOfList时必须有
//
// 示例值:
func (builder *MultipleOptionBuilder) DataValidationValues(dataValidationValues []*DataValidationValue) *MultipleOptionBuilder {
builder.dataValidationValues = dataValidationValues
builder.dataValidationValuesFlag = true
return builder
}
// 属性
//
// 示例值:
func (builder *MultipleOptionBuilder) Properties(properties *OptionProperties) *MultipleOptionBuilder {
builder.properties = properties
builder.propertiesFlag = true
return builder
}
func (builder *MultipleOptionBuilder) Build() *MultipleOption {
req := &MultipleOption{}
if builder.typeFlag {
req.Type = &builder.type_
}
if builder.rangeFlag {
req.Range = &builder.range_
}
if builder.dataValidationValuesFlag {
req.DataValidationValues = builder.dataValidationValues
}
if builder.propertiesFlag {
req.Properties = builder.properties
}
return req
}
type OptionProperties struct {
ShowDropdownIcon *bool `json:"show_dropdown_icon,omitempty"` // 是否展示下拉按钮
}
type OptionPropertiesBuilder struct {
showDropdownIcon bool // 是否展示下拉按钮
showDropdownIconFlag bool
}
func NewOptionPropertiesBuilder() *OptionPropertiesBuilder {
builder := &OptionPropertiesBuilder{}
return builder
}
// 是否展示下拉按钮
//
// 示例值:true
func (builder *OptionPropertiesBuilder) ShowDropdownIcon(showDropdownIcon bool) *OptionPropertiesBuilder {
builder.showDropdownIcon = showDropdownIcon
builder.showDropdownIconFlag = true
return builder
}
func (builder *OptionPropertiesBuilder) Build() *OptionProperties {
req := &OptionProperties{}
if builder.showDropdownIconFlag {
req.ShowDropdownIcon = &builder.showDropdownIcon
}
return req
}
type PatchConditionalFormat struct {
Ranges []*ConditionalFormatRange `json:"ranges,omitempty"` // 条件格式应用范围
ConditionalFormatRule *ConditionalFormatRule `json:"conditional_format_rule,omitempty"` // 条件格式规则
Index *int `json:"index,omitempty"` // 条件格式索引位置
}
type PatchConditionalFormatBuilder struct {
ranges []*ConditionalFormatRange // 条件格式应用范围
rangesFlag bool
conditionalFormatRule *ConditionalFormatRule // 条件格式规则
conditionalFormatRuleFlag bool
index int // 条件格式索引位置
indexFlag bool
}
func NewPatchConditionalFormatBuilder() *PatchConditionalFormatBuilder {
builder := &PatchConditionalFormatBuilder{}
return builder
}
// 条件格式应用范围
//
// 示例值:
func (builder *PatchConditionalFormatBuilder) Ranges(ranges []*ConditionalFormatRange) *PatchConditionalFormatBuilder {
builder.ranges = ranges
builder.rangesFlag = true
return builder
}
// 条件格式规则
//
// 示例值:
func (builder *PatchConditionalFormatBuilder) ConditionalFormatRule(conditionalFormatRule *ConditionalFormatRule) *PatchConditionalFormatBuilder {
builder.conditionalFormatRule = conditionalFormatRule
builder.conditionalFormatRuleFlag = true
return builder
}
// 条件格式索引位置
//
// 示例值:0
func (builder *PatchConditionalFormatBuilder) Index(index int) *PatchConditionalFormatBuilder {
builder.index = index
builder.indexFlag = true
return builder
}
func (builder *PatchConditionalFormatBuilder) Build() *PatchConditionalFormat {
req := &PatchConditionalFormat{}
if builder.rangesFlag {
req.Ranges = builder.ranges
}
if builder.conditionalFormatRuleFlag {
req.ConditionalFormatRule = builder.conditionalFormatRule
}
if builder.indexFlag {
req.Index = &builder.index
}
return req
}
type PatchDataValidation struct {
DataValidationRule *DataValidationRule `json:"data_validation_rule,omitempty"` // 数据校验规则
Strict *bool `json:"strict,omitempty"` // 校验模式,数据非法时是否拒绝输入
HelpText *string `json:"help_text,omitempty"` // 帮助文本
}
type PatchDataValidationBuilder struct {
dataValidationRule *DataValidationRule // 数据校验规则
dataValidationRuleFlag bool
strict bool // 校验模式,数据非法时是否拒绝输入
strictFlag bool
helpText string // 帮助文本
helpTextFlag bool
}
func NewPatchDataValidationBuilder() *PatchDataValidationBuilder {
builder := &PatchDataValidationBuilder{}
return builder
}
// 数据校验规则
//
// 示例值:
func (builder *PatchDataValidationBuilder) DataValidationRule(dataValidationRule *DataValidationRule) *PatchDataValidationBuilder {
builder.dataValidationRule = dataValidationRule
builder.dataValidationRuleFlag = true
return builder
}
// 校验模式,数据非法时是否拒绝输入
//
// 示例值:true
func (builder *PatchDataValidationBuilder) Strict(strict bool) *PatchDataValidationBuilder {
builder.strict = strict
builder.strictFlag = true
return builder
}
// 帮助文本
//
// 示例值:
func (builder *PatchDataValidationBuilder) HelpText(helpText string) *PatchDataValidationBuilder {
builder.helpText = helpText
builder.helpTextFlag = true
return builder
}
func (builder *PatchDataValidationBuilder) Build() *PatchDataValidation {
req := &PatchDataValidation{}
if builder.dataValidationRuleFlag {
req.DataValidationRule = builder.dataValidationRule
}
if builder.strictFlag {
req.Strict = &builder.strict
}
if builder.helpTextFlag {
req.HelpText = &builder.helpText
}
return req
}
type PatchProtectedRange struct {
Description *string `json:"description,omitempty"` // 保护范围描述
ProtectedRows *ProtectedRows `json:"protected_rows,omitempty"` // 保护行范围
ProtectedColumns *ProtectedColumns `json:"protected_columns,omitempty"` // 保护列范围
}
type PatchProtectedRangeBuilder struct {
description string // 保护范围描述
descriptionFlag bool
protectedRows *ProtectedRows // 保护行范围
protectedRowsFlag bool
protectedColumns *ProtectedColumns // 保护列范围
protectedColumnsFlag bool
}
func NewPatchProtectedRangeBuilder() *PatchProtectedRangeBuilder {
builder := &PatchProtectedRangeBuilder{}
return builder
}
// 保护范围描述
//
// 示例值:这是一个保护范围
func (builder *PatchProtectedRangeBuilder) Description(description string) *PatchProtectedRangeBuilder {
builder.description = description
builder.descriptionFlag = true
return builder
}
// 保护行范围
//
// 示例值:
func (builder *PatchProtectedRangeBuilder) ProtectedRows(protectedRows *ProtectedRows) *PatchProtectedRangeBuilder {
builder.protectedRows = protectedRows
builder.protectedRowsFlag = true
return builder
}
// 保护列范围
//
// 示例值:
func (builder *PatchProtectedRangeBuilder) ProtectedColumns(protectedColumns *ProtectedColumns) *PatchProtectedRangeBuilder {
builder.protectedColumns = protectedColumns
builder.protectedColumnsFlag = true
return builder
}
func (builder *PatchProtectedRangeBuilder) Build() *PatchProtectedRange {
req := &PatchProtectedRange{}
if builder.descriptionFlag {
req.Description = &builder.description
}
if builder.protectedRowsFlag {
req.ProtectedRows = builder.protectedRows
}
if builder.protectedColumnsFlag {
req.ProtectedColumns = builder.protectedColumns
}
return req
}
type PatchProtectedRangeEditors struct {
Type *string `json:"type,omitempty"` // 修改类型
AddEditors *ProtectedRangeEditors `json:"add_editors,omitempty"` // 增加可编辑人员
RemoveEditors *ProtectedRangeEditors `json:"remove_editors,omitempty"` // 删除可编辑人员
}
type PatchProtectedRangeEditorsBuilder struct {
type_ string // 修改类型
typeFlag bool
addEditors *ProtectedRangeEditors // 增加可编辑人员
addEditorsFlag bool
removeEditors *ProtectedRangeEditors // 删除可编辑人员
removeEditorsFlag bool
}
func NewPatchProtectedRangeEditorsBuilder() *PatchProtectedRangeEditorsBuilder {
builder := &PatchProtectedRangeEditorsBuilder{}
return builder
}
// 修改类型
//
// 示例值:AddEditors
func (builder *PatchProtectedRangeEditorsBuilder) Type(type_ string) *PatchProtectedRangeEditorsBuilder {
builder.type_ = type_
builder.typeFlag = true
return builder
}
// 增加可编辑人员
//
// 示例值:
func (builder *PatchProtectedRangeEditorsBuilder) AddEditors(addEditors *ProtectedRangeEditors) *PatchProtectedRangeEditorsBuilder {
builder.addEditors = addEditors
builder.addEditorsFlag = true
return builder
}
// 删除可编辑人员
//
// 示例值:
func (builder *PatchProtectedRangeEditorsBuilder) RemoveEditors(removeEditors *ProtectedRangeEditors) *PatchProtectedRangeEditorsBuilder {
builder.removeEditors = removeEditors
builder.removeEditorsFlag = true
return builder
}
func (builder *PatchProtectedRangeEditorsBuilder) Build() *PatchProtectedRangeEditors {
req := &PatchProtectedRangeEditors{}
if builder.typeFlag {
req.Type = &builder.type_
}
if builder.addEditorsFlag {
req.AddEditors = builder.addEditors
}
if builder.removeEditorsFlag {
req.RemoveEditors = builder.removeEditors
}
return req
}
type PlainTextValueRange struct {
Range *string `json:"range,omitempty"` // 范围
Values [][]string `json:"values,omitempty"` // 数据
}
type PlainTextValueRangeBuilder struct {
range_ string // 范围
rangeFlag bool
values [][]string // 数据
valuesFlag bool
}
func NewPlainTextValueRangeBuilder() *PlainTextValueRangeBuilder {
builder := &PlainTextValueRangeBuilder{}
return builder
}
// 范围
//
// 示例值:Sheet1!A1:B2
func (builder *PlainTextValueRangeBuilder) Range(range_ string) *PlainTextValueRangeBuilder {
builder.range_ = range_
builder.rangeFlag = true
return builder
}
// 数据
//
// 示例值:
func (builder *PlainTextValueRangeBuilder) Values(values [][]string) *PlainTextValueRangeBuilder {
builder.values = values
builder.valuesFlag = true
return builder
}
func (builder *PlainTextValueRangeBuilder) Build() *PlainTextValueRange {
req := &PlainTextValueRange{}
if builder.rangeFlag {
req.Range = &builder.range_
}
if builder.valuesFlag {
req.Values = builder.values
}
return req
}
type ProtectedColumns struct {
SheetId *string `json:"sheet_id,omitempty"` // 工作表ID
StartIndex *int `json:"start_index,omitempty"` // 起始列
EndIndex *int `json:"end_index,omitempty"` // 结束列
}
type ProtectedColumnsBuilder struct {
sheetId string // 工作表ID
sheetIdFlag bool
startIndex int // 起始列
startIndexFlag bool
endIndex int // 结束列
endIndexFlag bool
}
func NewProtectedColumnsBuilder() *ProtectedColumnsBuilder {
builder := &ProtectedColumnsBuilder{}
return builder
}
// 工作表ID
//
// 示例值:ah9IJ2
func (builder *ProtectedColumnsBuilder) SheetId(sheetId string) *ProtectedColumnsBuilder {
builder.sheetId = sheetId
builder.sheetIdFlag = true
return builder
}
// 起始列
//
// 示例值:0
func (builder *ProtectedColumnsBuilder) StartIndex(startIndex int) *ProtectedColumnsBuilder {
builder.startIndex = startIndex
builder.startIndexFlag = true
return builder
}
// 结束列
//
// 示例值:2
func (builder *ProtectedColumnsBuilder) EndIndex(endIndex int) *ProtectedColumnsBuilder {
builder.endIndex = endIndex
builder.endIndexFlag = true
return builder
}
func (builder *ProtectedColumnsBuilder) Build() *ProtectedColumns {
req := &ProtectedColumns{}
if builder.sheetIdFlag {
req.SheetId = &builder.sheetId
}
if builder.startIndexFlag {
req.StartIndex = &builder.startIndex
}
if builder.endIndexFlag {
req.EndIndex = &builder.endIndex
}
return req
}
type ProtectedRange struct {
ProtectedId *string `json:"protected_id,omitempty"` // 保护范围ID
Description *string `json:"description,omitempty"` // 保护范围描述
ProtectedDimension *string `json:"protected_dimension,omitempty"` // 保护类型
ProtectedRows *ProtectedRows `json:"protected_rows,omitempty"` // 保护行范围
ProtectedColumns *ProtectedColumns `json:"protected_columns,omitempty"` // 保护列范围
ProtectedSheet *ProtectedSheet `json:"protected_sheet,omitempty"` // 保护工作表范围
Editors *ProtectedRangeEditors `json:"editors,omitempty"` // 保护范围可编辑用户
}
type ProtectedRangeBuilder struct {
protectedId string // 保护范围ID
protectedIdFlag bool
description string // 保护范围描述
descriptionFlag bool
protectedDimension string // 保护类型
protectedDimensionFlag bool
protectedRows *ProtectedRows // 保护行范围
protectedRowsFlag bool
protectedColumns *ProtectedColumns // 保护列范围
protectedColumnsFlag bool
protectedSheet *ProtectedSheet // 保护工作表范围
protectedSheetFlag bool
editors *ProtectedRangeEditors // 保护范围可编辑用户
editorsFlag bool
}
func NewProtectedRangeBuilder() *ProtectedRangeBuilder {
builder := &ProtectedRangeBuilder{}
return builder
}
// 保护范围ID
//
// 示例值:1650435126216662
func (builder *ProtectedRangeBuilder) ProtectedId(protectedId string) *ProtectedRangeBuilder {
builder.protectedId = protectedId
builder.protectedIdFlag = true
return builder
}
// 保护范围描述
//
// 示例值:这是一个保护范围
func (builder *ProtectedRangeBuilder) Description(description string) *ProtectedRangeBuilder {
builder.description = description
builder.descriptionFlag = true
return builder
}
// 保护类型
//
// 示例值:Rows
func (builder *ProtectedRangeBuilder) ProtectedDimension(protectedDimension string) *ProtectedRangeBuilder {
builder.protectedDimension = protectedDimension
builder.protectedDimensionFlag = true
return builder
}
// 保护行范围
//
// 示例值:
func (builder *ProtectedRangeBuilder) ProtectedRows(protectedRows *ProtectedRows) *ProtectedRangeBuilder {
builder.protectedRows = protectedRows
builder.protectedRowsFlag = true
return builder
}
// 保护列范围
//
// 示例值:
func (builder *ProtectedRangeBuilder) ProtectedColumns(protectedColumns *ProtectedColumns) *ProtectedRangeBuilder {
builder.protectedColumns = protectedColumns
builder.protectedColumnsFlag = true
return builder
}
// 保护工作表范围
//
// 示例值:
func (builder *ProtectedRangeBuilder) ProtectedSheet(protectedSheet *ProtectedSheet) *ProtectedRangeBuilder {
builder.protectedSheet = protectedSheet
builder.protectedSheetFlag = true
return builder
}
// 保护范围可编辑用户
//
// 示例值:
func (builder *ProtectedRangeBuilder) Editors(editors *ProtectedRangeEditors) *ProtectedRangeBuilder {
builder.editors = editors
builder.editorsFlag = true
return builder
}
func (builder *ProtectedRangeBuilder) Build() *ProtectedRange {
req := &ProtectedRange{}
if builder.protectedIdFlag {
req.ProtectedId = &builder.protectedId
}
if builder.descriptionFlag {
req.Description = &builder.description
}
if builder.protectedDimensionFlag {
req.ProtectedDimension = &builder.protectedDimension
}
if builder.protectedRowsFlag {
req.ProtectedRows = builder.protectedRows
}
if builder.protectedColumnsFlag {
req.ProtectedColumns = builder.protectedColumns
}
if builder.protectedSheetFlag {
req.ProtectedSheet = builder.protectedSheet
}
if builder.editorsFlag {
req.Editors = builder.editors
}
return req
}
type ProtectedRangeEditors struct {
Users []string `json:"users,omitempty"` // 可编辑人员
Departments []string `json:"departments,omitempty"` // 可编辑部门
Chats []string `json:"chats,omitempty"` // 可编辑群
}
type ProtectedRangeEditorsBuilder struct {
users []string // 可编辑人员
usersFlag bool
departments []string // 可编辑部门
departmentsFlag bool
chats []string // 可编辑群
chatsFlag bool
}
func NewProtectedRangeEditorsBuilder() *ProtectedRangeEditorsBuilder {
builder := &ProtectedRangeEditorsBuilder{}
return builder
}
// 可编辑人员
//
// 示例值:o
func (builder *ProtectedRangeEditorsBuilder) Users(users []string) *ProtectedRangeEditorsBuilder {
builder.users = users
builder.usersFlag = true
return builder
}
// 可编辑部门
//
// 示例值:
func (builder *ProtectedRangeEditorsBuilder) Departments(departments []string) *ProtectedRangeEditorsBuilder {
builder.departments = departments
builder.departmentsFlag = true
return builder
}
// 可编辑群
//
// 示例值:
func (builder *ProtectedRangeEditorsBuilder) Chats(chats []string) *ProtectedRangeEditorsBuilder {
builder.chats = chats
builder.chatsFlag = true
return builder
}
func (builder *ProtectedRangeEditorsBuilder) Build() *ProtectedRangeEditors {
req := &ProtectedRangeEditors{}
if builder.usersFlag {
req.Users = builder.users
}
if builder.departmentsFlag {
req.Departments = builder.departments
}
if builder.chatsFlag {
req.Chats = builder.chats
}
return req
}
type ProtectedRows struct {
SheetId *string `json:"sheet_id,omitempty"` // 工作表ID
StartIndex *int `json:"start_index,omitempty"` // 起始行
EndIndex *int `json:"end_index,omitempty"` // 结束行
}
type ProtectedRowsBuilder struct {
sheetId string // 工作表ID
sheetIdFlag bool
startIndex int // 起始行
startIndexFlag bool
endIndex int // 结束行
endIndexFlag bool
}
func NewProtectedRowsBuilder() *ProtectedRowsBuilder {
builder := &ProtectedRowsBuilder{}
return builder
}
// 工作表ID
//
// 示例值:s92jkL
func (builder *ProtectedRowsBuilder) SheetId(sheetId string) *ProtectedRowsBuilder {
builder.sheetId = sheetId
builder.sheetIdFlag = true
return builder
}
// 起始行
//
// 示例值:0
func (builder *ProtectedRowsBuilder) StartIndex(startIndex int) *ProtectedRowsBuilder {
builder.startIndex = startIndex
builder.startIndexFlag = true
return builder
}
// 结束行
//
// 示例值:0
func (builder *ProtectedRowsBuilder) EndIndex(endIndex int) *ProtectedRowsBuilder {
builder.endIndex = endIndex
builder.endIndexFlag = true
return builder
}
func (builder *ProtectedRowsBuilder) Build() *ProtectedRows {
req := &ProtectedRows{}
if builder.sheetIdFlag {
req.SheetId = &builder.sheetId
}
if builder.startIndexFlag {
req.StartIndex = &builder.startIndex
}
if builder.endIndexFlag {
req.EndIndex = &builder.endIndex
}
return req
}
type ProtectedSheet struct {
SheetId *string `json:"sheet_id,omitempty"` // 工作表ID
}
type ProtectedSheetBuilder struct {
sheetId string // 工作表ID
sheetIdFlag bool
}
func NewProtectedSheetBuilder() *ProtectedSheetBuilder {
builder := &ProtectedSheetBuilder{}
return builder
}
// 工作表ID
//
// 示例值:Kd7L09
func (builder *ProtectedSheetBuilder) SheetId(sheetId string) *ProtectedSheetBuilder {
builder.sheetId = sheetId
builder.sheetIdFlag = true
return builder
}
func (builder *ProtectedSheetBuilder) Build() *ProtectedSheet {
req := &ProtectedSheet{}
if builder.sheetIdFlag {
req.SheetId = &builder.sheetId
}
return req
}
type Reminder struct {
NotifyDateTime *string `json:"notify_date_time,omitempty"` // 时间日期
NotifyUserId []string `json:"notify_user_id,omitempty"` // 提醒人员
NotifyText *string `json:"notify_text,omitempty"` // 提醒内容
NotifyStrategy *string `json:"notify_strategy,omitempty"` // 提醒策略
}
type ReminderBuilder struct {
notifyDateTime string // 时间日期
notifyDateTimeFlag bool
notifyUserId []string // 提醒人员
notifyUserIdFlag bool
notifyText string // 提醒内容
notifyTextFlag bool
notifyStrategy string // 提醒策略
notifyStrategyFlag bool
}
func NewReminderBuilder() *ReminderBuilder {
builder := &ReminderBuilder{}
return builder
}
// 时间日期
//
// 示例值:2022/2/2 13:33
func (builder *ReminderBuilder) NotifyDateTime(notifyDateTime string) *ReminderBuilder {
builder.notifyDateTime = notifyDateTime
builder.notifyDateTimeFlag = true
return builder
}
// 提醒人员
//
// 示例值:ou_xxxxxx
func (builder *ReminderBuilder) NotifyUserId(notifyUserId []string) *ReminderBuilder {
builder.notifyUserId = notifyUserId
builder.notifyUserIdFlag = true
return builder
}
// 提醒内容
//
// 示例值:hello
func (builder *ReminderBuilder) NotifyText(notifyText string) *ReminderBuilder {
builder.notifyText = notifyText
builder.notifyTextFlag = true
return builder
}
// 提醒策略
//
// 示例值:AT_TIME
func (builder *ReminderBuilder) NotifyStrategy(notifyStrategy string) *ReminderBuilder {
builder.notifyStrategy = notifyStrategy
builder.notifyStrategyFlag = true
return builder
}
func (builder *ReminderBuilder) Build() *Reminder {
req := &Reminder{}
if builder.notifyDateTimeFlag {
req.NotifyDateTime = &builder.notifyDateTime
}
if builder.notifyUserIdFlag {
req.NotifyUserId = builder.notifyUserId
}
if builder.notifyTextFlag {
req.NotifyText = &builder.notifyText
}
if builder.notifyStrategyFlag {
req.NotifyStrategy = &builder.notifyStrategy
}
return req
}
type Replace struct {
FindCondition *FindCondition `json:"find_condition,omitempty"` // 查找条件
Find *string `json:"find,omitempty"` // 查找的字符串
Replacement *string `json:"replacement,omitempty"` // 替换的字符串
}
type ReplaceBuilder struct {
findCondition *FindCondition // 查找条件
findConditionFlag bool
find string // 查找的字符串
findFlag bool
replacement string // 替换的字符串
replacementFlag bool
}
func NewReplaceBuilder() *ReplaceBuilder {
builder := &ReplaceBuilder{}
return builder
}
// 查找条件
//
// 示例值:
func (builder *ReplaceBuilder) FindCondition(findCondition *FindCondition) *ReplaceBuilder {
builder.findCondition = findCondition
builder.findConditionFlag = true
return builder
}
// 查找的字符串
//
// 示例值:hello
func (builder *ReplaceBuilder) Find(find string) *ReplaceBuilder {
builder.find = find
builder.findFlag = true
return builder
}
// 替换的字符串
//
// 示例值:world
func (builder *ReplaceBuilder) Replacement(replacement string) *ReplaceBuilder {
builder.replacement = replacement
builder.replacementFlag = true
return builder
}
func (builder *ReplaceBuilder) Build() *Replace {
req := &Replace{}
if builder.findConditionFlag {
req.FindCondition = builder.findCondition
}
if builder.findFlag {
req.Find = &builder.find
}
if builder.replacementFlag {
req.Replacement = &builder.replacement
}
return req
}
type RichTextValueRange struct {
Range *string `json:"range,omitempty"` // 范围
Values [][][]*CellValue `json:"values,omitempty"` // 数据
}
type RichTextValueRangeBuilder struct {
range_ string // 范围
rangeFlag bool
values [][][]*CellValue // 数据
valuesFlag bool
}
func NewRichTextValueRangeBuilder() *RichTextValueRangeBuilder {
builder := &RichTextValueRangeBuilder{}
return builder
}
// 范围
//
// 示例值:Sheet1!A1:A2
func (builder *RichTextValueRangeBuilder) Range(range_ string) *RichTextValueRangeBuilder {
builder.range_ = range_
builder.rangeFlag = true
return builder
}
// 数据
//
// 示例值:
func (builder *RichTextValueRangeBuilder) Values(values [][][]*CellValue) *RichTextValueRangeBuilder {
builder.values = values
builder.valuesFlag = true
return builder
}
func (builder *RichTextValueRangeBuilder) Build() *RichTextValueRange {
req := &RichTextValueRange{}
if builder.rangeFlag {
req.Range = &builder.range_
}
if builder.valuesFlag {
req.Values = builder.values
}
return req
}
type RichValue struct {
Values [][][]*CellValue `json:"values,omitempty"` // 数据,数据结构参见[单元格数据结构](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-value/cell-data-structure)
}
type RichValueBuilder struct {
values [][][]*CellValue // 数据,数据结构参见[单元格数据结构](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-value/cell-data-structure)
valuesFlag bool
}
func NewRichValueBuilder() *RichValueBuilder {
builder := &RichValueBuilder{}
return builder
}
// 数据,数据结构参见[单元格数据结构](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-value/cell-data-structure)
//
// 示例值:数据
func (builder *RichValueBuilder) Values(values [][][]*CellValue) *RichValueBuilder {
builder.values = values
builder.valuesFlag = true
return builder
}
func (builder *RichValueBuilder) Build() *RichValue {
req := &RichValue{}
if builder.valuesFlag {
req.Values = builder.values
}
return req
}
type RightBorderStyle struct {
Style *string `json:"style,omitempty"` // 边框样式
Color *string `json:"color,omitempty"` // 边框颜色
}
type RightBorderStyleBuilder struct {
style string // 边框样式
styleFlag bool
color string // 边框颜色
colorFlag bool
}
func NewRightBorderStyleBuilder() *RightBorderStyleBuilder {
builder := &RightBorderStyleBuilder{}
return builder
}
// 边框样式
//
// 示例值:
func (builder *RightBorderStyleBuilder) Style(style string) *RightBorderStyleBuilder {
builder.style = style
builder.styleFlag = true
return builder
}
// 边框颜色
//
// 示例值:#ff00ff
func (builder *RightBorderStyleBuilder) Color(color string) *RightBorderStyleBuilder {
builder.color = color
builder.colorFlag = true
return builder
}
func (builder *RightBorderStyleBuilder) Build() *RightBorderStyle {
req := &RightBorderStyle{}
if builder.styleFlag {
req.Style = &builder.style
}
if builder.colorFlag {
req.Color = &builder.color
}
return req
}
type SegmentStyle struct {
AffectedText *string `json:"affected_text,omitempty"` // 影响的文本
Style *SegmentStyleStyle `json:"style,omitempty"` // 样式
}
type SegmentStyleBuilder struct {
affectedText string // 影响的文本
affectedTextFlag bool
style *SegmentStyleStyle // 样式
styleFlag bool
}
func NewSegmentStyleBuilder() *SegmentStyleBuilder {
builder := &SegmentStyleBuilder{}
return builder
}
// 影响的文本
//
// 示例值:a
func (builder *SegmentStyleBuilder) AffectedText(affectedText string) *SegmentStyleBuilder {
builder.affectedText = affectedText
builder.affectedTextFlag = true
return builder
}
// 样式
//
// 示例值:
func (builder *SegmentStyleBuilder) Style(style *SegmentStyleStyle) *SegmentStyleBuilder {
builder.style = style
builder.styleFlag = true
return builder
}
func (builder *SegmentStyleBuilder) Build() *SegmentStyle {
req := &SegmentStyle{}
if builder.affectedTextFlag {
req.AffectedText = &builder.affectedText
}
if builder.styleFlag {
req.Style = builder.style
}
return req
}
type SegmentStyleStyle struct {
Bold *bool `json:"bold,omitempty"` // 加粗
Italic *bool `json:"italic,omitempty"` // 斜体
StrikeThrough *bool `json:"strike_through,omitempty"` // 删除线
Underline *bool `json:"underline,omitempty"` // 下划线
ForeColor *string `json:"fore_color,omitempty"` // 字体颜色
FontSize *int `json:"font_size,omitempty"` // 字体大小
}
type SegmentStyleStyleBuilder struct {
bold bool // 加粗
boldFlag bool
italic bool // 斜体
italicFlag bool
strikeThrough bool // 删除线
strikeThroughFlag bool
underline bool // 下划线
underlineFlag bool
foreColor string // 字体颜色
foreColorFlag bool
fontSize int // 字体大小
fontSizeFlag bool
}
func NewSegmentStyleStyleBuilder() *SegmentStyleStyleBuilder {
builder := &SegmentStyleStyleBuilder{}
return builder
}
// 加粗
//
// 示例值:true
func (builder *SegmentStyleStyleBuilder) Bold(bold bool) *SegmentStyleStyleBuilder {
builder.bold = bold
builder.boldFlag = true
return builder
}
// 斜体
//
// 示例值:true
func (builder *SegmentStyleStyleBuilder) Italic(italic bool) *SegmentStyleStyleBuilder {
builder.italic = italic
builder.italicFlag = true
return builder
}
// 删除线
//
// 示例值:true
func (builder *SegmentStyleStyleBuilder) StrikeThrough(strikeThrough bool) *SegmentStyleStyleBuilder {
builder.strikeThrough = strikeThrough
builder.strikeThroughFlag = true
return builder
}
// 下划线
//
// 示例值:true
func (builder *SegmentStyleStyleBuilder) Underline(underline bool) *SegmentStyleStyleBuilder {
builder.underline = underline
builder.underlineFlag = true
return builder
}
// 字体颜色
//
// 示例值:#ff00ff
func (builder *SegmentStyleStyleBuilder) ForeColor(foreColor string) *SegmentStyleStyleBuilder {
builder.foreColor = foreColor
builder.foreColorFlag = true
return builder
}
// 字体大小
//
// 示例值:
func (builder *SegmentStyleStyleBuilder) FontSize(fontSize int) *SegmentStyleStyleBuilder {
builder.fontSize = fontSize
builder.fontSizeFlag = true
return builder
}
func (builder *SegmentStyleStyleBuilder) Build() *SegmentStyleStyle {
req := &SegmentStyleStyle{}
if builder.boldFlag {
req.Bold = &builder.bold
}
if builder.italicFlag {
req.Italic = &builder.italic
}
if builder.strikeThroughFlag {
req.StrikeThrough = &builder.strikeThrough
}
if builder.underlineFlag {
req.Underline = &builder.underline
}
if builder.foreColorFlag {
req.ForeColor = &builder.foreColor
}
if builder.fontSizeFlag {
req.FontSize = &builder.fontSize
}
return req
}
type Sheet struct {
SheetId *string `json:"sheet_id,omitempty"` // 工作表id
Title *string `json:"title,omitempty"` // 工作表标题
Index *int `json:"index,omitempty"` // 工作表索引位置,索引从 0 开始计数。
Hidden *bool `json:"hidden,omitempty"` // 工作表是否被隐藏;- `true`:表示被隐藏;- `false`:表示未被隐藏
GridProperties *GridProperties `json:"grid_properties,omitempty"` // 单元格属性
ResourceType *string `json:"resource_type,omitempty"` // 工作表类型;- `sheet`:工作表;- `bitable`:多维表格,[多维表格概述](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/bitable-overview);- `#UNSUPPORTED_TYPE`:不支持的类型
Merges []*MergeRange `json:"merges,omitempty"` // 合并单元格的相关信息
}
type SheetBuilder struct {
sheetId string // 工作表id
sheetIdFlag bool
title string // 工作表标题
titleFlag bool
index int // 工作表索引位置,索引从 0 开始计数。
indexFlag bool
hidden bool // 工作表是否被隐藏;- `true`:表示被隐藏;- `false`:表示未被隐藏
hiddenFlag bool
gridProperties *GridProperties // 单元格属性
gridPropertiesFlag bool
resourceType string // 工作表类型;- `sheet`:工作表;- `bitable`:多维表格,[多维表格概述](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/bitable-overview);- `#UNSUPPORTED_TYPE`:不支持的类型
resourceTypeFlag bool
merges []*MergeRange // 合并单元格的相关信息
mergesFlag bool
}
func NewSheetBuilder() *SheetBuilder {
builder := &SheetBuilder{}
return builder
}
// 工作表id
//
// 示例值:sxj5ws
func (builder *SheetBuilder) SheetId(sheetId string) *SheetBuilder {
builder.sheetId = sheetId
builder.sheetIdFlag = true
return builder
}
// 工作表标题
//
// 示例值:title
func (builder *SheetBuilder) Title(title string) *SheetBuilder {
builder.title = title
builder.titleFlag = true
return builder
}
// 工作表索引位置,索引从 0 开始计数。
//
// 示例值:0
func (builder *SheetBuilder) Index(index int) *SheetBuilder {
builder.index = index
builder.indexFlag = true
return builder
}
// 工作表是否被隐藏;- `true`:表示被隐藏;- `false`:表示未被隐藏
//
// 示例值:false
func (builder *SheetBuilder) Hidden(hidden bool) *SheetBuilder {
builder.hidden = hidden
builder.hiddenFlag = true
return builder
}
// 单元格属性
//
// 示例值:
func (builder *SheetBuilder) GridProperties(gridProperties *GridProperties) *SheetBuilder {
builder.gridProperties = gridProperties
builder.gridPropertiesFlag = true
return builder
}
// 工作表类型;- `sheet`:工作表;- `bitable`:多维表格,[多维表格概述](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/bitable-overview);- `#UNSUPPORTED_TYPE`:不支持的类型
//
// 示例值:sheet
func (builder *SheetBuilder) ResourceType(resourceType string) *SheetBuilder {
builder.resourceType = resourceType
builder.resourceTypeFlag = true
return builder
}
// 合并单元格的相关信息
//
// 示例值:
func (builder *SheetBuilder) Merges(merges []*MergeRange) *SheetBuilder {
builder.merges = merges
builder.mergesFlag = true
return builder
}
func (builder *SheetBuilder) Build() *Sheet {
req := &Sheet{}
if builder.sheetIdFlag {
req.SheetId = &builder.sheetId
}
if builder.titleFlag {
req.Title = &builder.title
}
if builder.indexFlag {
req.Index = &builder.index
}
if builder.hiddenFlag {
req.Hidden = &builder.hidden
}
if builder.gridPropertiesFlag {
req.GridProperties = builder.gridProperties
}
if builder.resourceTypeFlag {
req.ResourceType = &builder.resourceType
}
if builder.mergesFlag {
req.Merges = builder.merges
}
return req
}
type SheetFilterInfo struct {
Range *string `json:"range,omitempty"` // 筛选应用范围
FilteredOutRows []int `json:"filtered_out_rows,omitempty"` // 筛选出来隐藏的行
FilterInfos []*FilterInfo `json:"filter_infos,omitempty"` // sheet的筛选条件
}
type SheetFilterInfoBuilder struct {
range_ string // 筛选应用范围
rangeFlag bool
filteredOutRows []int // 筛选出来隐藏的行
filteredOutRowsFlag bool
filterInfos []*FilterInfo // sheet的筛选条件
filterInfosFlag bool
}
func NewSheetFilterInfoBuilder() *SheetFilterInfoBuilder {
builder := &SheetFilterInfoBuilder{}
return builder
}
// 筛选应用范围
//
// 示例值:xxxxxx!A1:H14
func (builder *SheetFilterInfoBuilder) Range(range_ string) *SheetFilterInfoBuilder {
builder.range_ = range_
builder.rangeFlag = true
return builder
}
// 筛选出来隐藏的行
//
// 示例值:
func (builder *SheetFilterInfoBuilder) FilteredOutRows(filteredOutRows []int) *SheetFilterInfoBuilder {
builder.filteredOutRows = filteredOutRows
builder.filteredOutRowsFlag = true
return builder
}
// sheet的筛选条件
//
// 示例值:
func (builder *SheetFilterInfoBuilder) FilterInfos(filterInfos []*FilterInfo) *SheetFilterInfoBuilder {
builder.filterInfos = filterInfos
builder.filterInfosFlag = true
return builder
}
func (builder *SheetFilterInfoBuilder) Build() *SheetFilterInfo {
req := &SheetFilterInfo{}
if builder.rangeFlag {
req.Range = &builder.range_
}
if builder.filteredOutRowsFlag {
req.FilteredOutRows = builder.filteredOutRows
}
if builder.filterInfosFlag {
req.FilterInfos = builder.filterInfos
}
return req
}
type SheetProperties struct {
RowCount *int `json:"row_count,omitempty"` // 工作表行数
ColumnCount *int `json:"column_count,omitempty"` // 工作表列数
FrozenRowCount *int `json:"frozen_row_count,omitempty"` // 冻结行数
FrozenColumnCount *int `json:"frozen_column_count,omitempty"` // 冻结列数
}
type SheetPropertiesBuilder struct {
rowCount int // 工作表行数
rowCountFlag bool
columnCount int // 工作表列数
columnCountFlag bool
frozenRowCount int // 冻结行数
frozenRowCountFlag bool
frozenColumnCount int // 冻结列数
frozenColumnCountFlag bool
}
func NewSheetPropertiesBuilder() *SheetPropertiesBuilder {
builder := &SheetPropertiesBuilder{}
return builder
}
// 工作表行数
//
// 示例值:1
func (builder *SheetPropertiesBuilder) RowCount(rowCount int) *SheetPropertiesBuilder {
builder.rowCount = rowCount
builder.rowCountFlag = true
return builder
}
// 工作表列数
//
// 示例值:1
func (builder *SheetPropertiesBuilder) ColumnCount(columnCount int) *SheetPropertiesBuilder {
builder.columnCount = columnCount
builder.columnCountFlag = true
return builder
}
// 冻结行数
//
// 示例值:1
func (builder *SheetPropertiesBuilder) FrozenRowCount(frozenRowCount int) *SheetPropertiesBuilder {
builder.frozenRowCount = frozenRowCount
builder.frozenRowCountFlag = true
return builder
}
// 冻结列数
//
// 示例值:1
func (builder *SheetPropertiesBuilder) FrozenColumnCount(frozenColumnCount int) *SheetPropertiesBuilder {
builder.frozenColumnCount = frozenColumnCount
builder.frozenColumnCountFlag = true
return builder
}
func (builder *SheetPropertiesBuilder) Build() *SheetProperties {
req := &SheetProperties{}
if builder.rowCountFlag {
req.RowCount = &builder.rowCount
}
if builder.columnCountFlag {
req.ColumnCount = &builder.columnCount
}
if builder.frozenRowCountFlag {
req.FrozenRowCount = &builder.frozenRowCount
}
if builder.frozenColumnCountFlag {
req.FrozenColumnCount = &builder.frozenColumnCount
}
return req
}
type SingleOption struct {
Type *string `json:"type,omitempty"` // 单选类型
Range *string `json:"range,omitempty"` // 引用数据的范围,当type=OneOfRange时必须存在
DataValidationValues []*DataValidationValue `json:"data_validation_values,omitempty"` // 选项
Properties *OptionProperties `json:"properties,omitempty"` // 属性
}
type SingleOptionBuilder struct {
type_ string // 单选类型
typeFlag bool
range_ string // 引用数据的范围,当type=OneOfRange时必须存在
rangeFlag bool
dataValidationValues []*DataValidationValue // 选项
dataValidationValuesFlag bool
properties *OptionProperties // 属性
propertiesFlag bool
}
func NewSingleOptionBuilder() *SingleOptionBuilder {
builder := &SingleOptionBuilder{}
return builder
}
// 单选类型
//
// 示例值:OneOfList
func (builder *SingleOptionBuilder) Type(type_ string) *SingleOptionBuilder {
builder.type_ = type_
builder.typeFlag = true
return builder
}
// 引用数据的范围,当type=OneOfRange时必须存在
//
// 示例值:as8jJ0!A1:B2
func (builder *SingleOptionBuilder) Range(range_ string) *SingleOptionBuilder {
builder.range_ = range_
builder.rangeFlag = true
return builder
}
// 选项
//
// 示例值:
func (builder *SingleOptionBuilder) DataValidationValues(dataValidationValues []*DataValidationValue) *SingleOptionBuilder {
builder.dataValidationValues = dataValidationValues
builder.dataValidationValuesFlag = true
return builder
}
// 属性
//
// 示例值:
func (builder *SingleOptionBuilder) Properties(properties *OptionProperties) *SingleOptionBuilder {
builder.properties = properties
builder.propertiesFlag = true
return builder
}
func (builder *SingleOptionBuilder) Build() *SingleOption {
req := &SingleOption{}
if builder.typeFlag {
req.Type = &builder.type_
}
if builder.rangeFlag {
req.Range = &builder.range_
}
if builder.dataValidationValuesFlag {
req.DataValidationValues = builder.dataValidationValues
}
if builder.propertiesFlag {
req.Properties = builder.properties
}
return req
}
type Spreadsheet struct {
Title *string `json:"title,omitempty"` // 表格标题
FolderToken *string `json:"folder_token,omitempty"` // 文件夹token,获取方式见[如何获取云文档资源相关 token](https://open.feishu.cn/document/ukTMukTMukTM/uczNzUjL3czM14yN3MTN)
Url *string `json:"url,omitempty"` // 文档url
SpreadsheetToken *string `json:"spreadsheet_token,omitempty"` // 表格token
}
type SpreadsheetBuilder struct {
title string // 表格标题
titleFlag bool
folderToken string // 文件夹token,获取方式见[如何获取云文档资源相关 token](https://open.feishu.cn/document/ukTMukTMukTM/uczNzUjL3czM14yN3MTN)
folderTokenFlag bool
url string // 文档url
urlFlag bool
spreadsheetToken string // 表格token
spreadsheetTokenFlag bool
}
func NewSpreadsheetBuilder() *SpreadsheetBuilder {
builder := &SpreadsheetBuilder{}
return builder
}
// 表格标题
//
// 示例值:title
func (builder *SpreadsheetBuilder) Title(title string) *SpreadsheetBuilder {
builder.title = title
builder.titleFlag = true
return builder
}
// 文件夹token,获取方式见[如何获取云文档资源相关 token](https://open.feishu.cn/document/ukTMukTMukTM/uczNzUjL3czM14yN3MTN)
//
// 示例值:fldcnMsNb*****hIW9IjG1LVswg
func (builder *SpreadsheetBuilder) FolderToken(folderToken string) *SpreadsheetBuilder {
builder.folderToken = folderToken
builder.folderTokenFlag = true
return builder
}
// 文档url
//
// 示例值:https://bytedance.feishu.cn/sheets/shtcnmBA*****yGehy8
func (builder *SpreadsheetBuilder) Url(url string) *SpreadsheetBuilder {
builder.url = url
builder.urlFlag = true
return builder
}
// 表格token
//
// 示例值:shtcnmBA*****yGehy8
func (builder *SpreadsheetBuilder) SpreadsheetToken(spreadsheetToken string) *SpreadsheetBuilder {
builder.spreadsheetToken = spreadsheetToken
builder.spreadsheetTokenFlag = true
return builder
}
func (builder *SpreadsheetBuilder) Build() *Spreadsheet {
req := &Spreadsheet{}
if builder.titleFlag {
req.Title = &builder.title
}
if builder.folderTokenFlag {
req.FolderToken = &builder.folderToken
}
if builder.urlFlag {
req.Url = &builder.url
}
if builder.spreadsheetTokenFlag {
req.SpreadsheetToken = &builder.spreadsheetToken
}
return req
}
type Style struct {
Range *string `json:"range,omitempty"` // 范围
Styles [][]*CellStyle `json:"styles,omitempty"` // 单元格样式
}
type StyleBuilder struct {
range_ string // 范围
rangeFlag bool
styles [][]*CellStyle // 单元格样式
stylesFlag bool
}
func NewStyleBuilder() *StyleBuilder {
builder := &StyleBuilder{}
return builder
}
// 范围
//
// 示例值:aokNvv
func (builder *StyleBuilder) Range(range_ string) *StyleBuilder {
builder.range_ = range_
builder.rangeFlag = true
return builder
}
// 单元格样式
//
// 示例值:
func (builder *StyleBuilder) Styles(styles [][]*CellStyle) *StyleBuilder {
builder.styles = styles
builder.stylesFlag = true
return builder
}
func (builder *StyleBuilder) Build() *Style {
req := &Style{}
if builder.rangeFlag {
req.Range = &builder.range_
}
if builder.stylesFlag {
req.Styles = builder.styles
}
return req
}
type StyleRanges struct {
StyleRanges []*Style `json:"style_ranges,omitempty"` // 单元格样式
}
type StyleRangesBuilder struct {
styleRanges []*Style // 单元格样式
styleRangesFlag bool
}
func NewStyleRangesBuilder() *StyleRangesBuilder {
builder := &StyleRangesBuilder{}
return builder
}
// 单元格样式
//
// 示例值:
func (builder *StyleRangesBuilder) StyleRanges(styleRanges []*Style) *StyleRangesBuilder {
builder.styleRanges = styleRanges
builder.styleRangesFlag = true
return builder
}
func (builder *StyleRangesBuilder) Build() *StyleRanges {
req := &StyleRanges{}
if builder.styleRangesFlag {
req.StyleRanges = builder.styleRanges
}
return req
}
type Text struct {
Text *string `json:"text,omitempty"` // 文本值
SegmentStyle *SegmentStyle `json:"segment_style,omitempty"` //
}
type TextBuilder struct {
text string // 文本值
textFlag bool
segmentStyle *SegmentStyle //
segmentStyleFlag bool
}
func NewTextBuilder() *TextBuilder {
builder := &TextBuilder{}
return builder
}
// 文本值
//
// 示例值:abc
func (builder *TextBuilder) Text(text string) *TextBuilder {
builder.text = text
builder.textFlag = true
return builder
}
// 示例值:
func (builder *TextBuilder) SegmentStyle(segmentStyle *SegmentStyle) *TextBuilder {
builder.segmentStyle = segmentStyle
builder.segmentStyleFlag = true
return builder
}
func (builder *TextBuilder) Build() *Text {
req := &Text{}
if builder.textFlag {
req.Text = &builder.text
}
if builder.segmentStyleFlag {
req.SegmentStyle = builder.segmentStyle
}
return req
}
type TopBorderStyle struct {
Style *string `json:"style,omitempty"` // 边框样式
Color *string `json:"color,omitempty"` // 边框颜色
}
type TopBorderStyleBuilder struct {
style string // 边框样式
styleFlag bool
color string // 边框颜色
colorFlag bool
}
func NewTopBorderStyleBuilder() *TopBorderStyleBuilder {
builder := &TopBorderStyleBuilder{}
return builder
}
// 边框样式
//
// 示例值:
func (builder *TopBorderStyleBuilder) Style(style string) *TopBorderStyleBuilder {
builder.style = style
builder.styleFlag = true
return builder
}
// 边框颜色
//
// 示例值:#ff00ff
func (builder *TopBorderStyleBuilder) Color(color string) *TopBorderStyleBuilder {
builder.color = color
builder.colorFlag = true
return builder
}
func (builder *TopBorderStyleBuilder) Build() *TopBorderStyle {
req := &TopBorderStyle{}
if builder.styleFlag {
req.Style = &builder.style
}
if builder.colorFlag {
req.Color = &builder.color
}
return req
}
type UpdateDimensionProperties struct {
DimensionRange *Dimension `json:"dimension_range,omitempty"` // 需要更新的行列信息
Properties *DimensionProperties `json:"properties,omitempty"` // 更新的属性
}
type UpdateDimensionPropertiesBuilder struct {
dimensionRange *Dimension // 需要更新的行列信息
dimensionRangeFlag bool
properties *DimensionProperties // 更新的属性
propertiesFlag bool
}
func NewUpdateDimensionPropertiesBuilder() *UpdateDimensionPropertiesBuilder {
builder := &UpdateDimensionPropertiesBuilder{}
return builder
}
// 需要更新的行列信息
//
// 示例值:
func (builder *UpdateDimensionPropertiesBuilder) DimensionRange(dimensionRange *Dimension) *UpdateDimensionPropertiesBuilder {
builder.dimensionRange = dimensionRange
builder.dimensionRangeFlag = true
return builder
}
// 更新的属性
//
// 示例值:
func (builder *UpdateDimensionPropertiesBuilder) Properties(properties *DimensionProperties) *UpdateDimensionPropertiesBuilder {
builder.properties = properties
builder.propertiesFlag = true
return builder
}
func (builder *UpdateDimensionPropertiesBuilder) Build() *UpdateDimensionProperties {
req := &UpdateDimensionProperties{}
if builder.dimensionRangeFlag {
req.DimensionRange = builder.dimensionRange
}
if builder.propertiesFlag {
req.Properties = builder.properties
}
return req
}
type UpdateGridProperties struct {
FrozenRowCount *int `json:"frozen_row_count,omitempty"` // 冻结行数
FrozenColumnCount *int `json:"frozen_column_count,omitempty"` // 冻结列数
}
type UpdateGridPropertiesBuilder struct {
frozenRowCount int // 冻结行数
frozenRowCountFlag bool
frozenColumnCount int // 冻结列数
frozenColumnCountFlag bool
}
func NewUpdateGridPropertiesBuilder() *UpdateGridPropertiesBuilder {
builder := &UpdateGridPropertiesBuilder{}
return builder
}
// 冻结行数
//
// 示例值:1
func (builder *UpdateGridPropertiesBuilder) FrozenRowCount(frozenRowCount int) *UpdateGridPropertiesBuilder {
builder.frozenRowCount = frozenRowCount
builder.frozenRowCountFlag = true
return builder
}
// 冻结列数
//
// 示例值:1
func (builder *UpdateGridPropertiesBuilder) FrozenColumnCount(frozenColumnCount int) *UpdateGridPropertiesBuilder {
builder.frozenColumnCount = frozenColumnCount
builder.frozenColumnCountFlag = true
return builder
}
func (builder *UpdateGridPropertiesBuilder) Build() *UpdateGridProperties {
req := &UpdateGridProperties{}
if builder.frozenRowCountFlag {
req.FrozenRowCount = &builder.frozenRowCount
}
if builder.frozenColumnCountFlag {
req.FrozenColumnCount = &builder.frozenColumnCount
}
return req
}
type UpdateSheetFilter struct {
Col *string `json:"col,omitempty"` // 更新筛选条件的列
Condition *Condition `json:"condition,omitempty"` // 筛选条件
}
type UpdateSheetFilterBuilder struct {
col string // 更新筛选条件的列
colFlag bool
condition *Condition // 筛选条件
conditionFlag bool
}
func NewUpdateSheetFilterBuilder() *UpdateSheetFilterBuilder {
builder := &UpdateSheetFilterBuilder{}
return builder
}
// 更新筛选条件的列
//
// 示例值:E
func (builder *UpdateSheetFilterBuilder) Col(col string) *UpdateSheetFilterBuilder {
builder.col = col
builder.colFlag = true
return builder
}
// 筛选条件
//
// 示例值:
func (builder *UpdateSheetFilterBuilder) Condition(condition *Condition) *UpdateSheetFilterBuilder {
builder.condition = condition
builder.conditionFlag = true
return builder
}
func (builder *UpdateSheetFilterBuilder) Build() *UpdateSheetFilter {
req := &UpdateSheetFilter{}
if builder.colFlag {
req.Col = &builder.col
}
if builder.conditionFlag {
req.Condition = builder.condition
}
return req
}
type UpdateSpreadsheetProperties struct {
Title *string `json:"title,omitempty"` // 表格标题
}
type UpdateSpreadsheetPropertiesBuilder struct {
title string // 表格标题
titleFlag bool
}
func NewUpdateSpreadsheetPropertiesBuilder() *UpdateSpreadsheetPropertiesBuilder {
builder := &UpdateSpreadsheetPropertiesBuilder{}
return builder
}
// 表格标题
//
// 示例值:title
func (builder *UpdateSpreadsheetPropertiesBuilder) Title(title string) *UpdateSpreadsheetPropertiesBuilder {
builder.title = title
builder.titleFlag = true
return builder
}
func (builder *UpdateSpreadsheetPropertiesBuilder) Build() *UpdateSpreadsheetProperties {
req := &UpdateSpreadsheetProperties{}
if builder.titleFlag {
req.Title = &builder.title
}
return req
}
type Value struct {
Range *string `json:"range,omitempty"` // 范围
Values [][][]*CellValue `json:"values,omitempty"` // 数据,数据结构参见[单元格数据结构](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-value/cell-data-structure)
}
type ValueBuilder struct {
range_ string // 范围
rangeFlag bool
values [][][]*CellValue // 数据,数据结构参见[单元格数据结构](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-value/cell-data-structure)
valuesFlag bool
}
func NewValueBuilder() *ValueBuilder {
builder := &ValueBuilder{}
return builder
}
// 范围
//
// 示例值:Sheet1!A1:A2
func (builder *ValueBuilder) Range(range_ string) *ValueBuilder {
builder.range_ = range_
builder.rangeFlag = true
return builder
}
// 数据,数据结构参见[单元格数据结构](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet-value/cell-data-structure)
//
// 示例值:[]
func (builder *ValueBuilder) Values(values [][][]*CellValue) *ValueBuilder {
builder.values = values
builder.valuesFlag = true
return builder
}
func (builder *ValueBuilder) Build() *Value {
req := &Value{}
if builder.rangeFlag {
req.Range = &builder.range_
}
if builder.valuesFlag {
req.Values = builder.values
}
return req
}
type ValueElement struct {
Value *string `json:"value,omitempty"` // 整型或浮点型数值
}
type ValueElementBuilder struct {
value string // 整型或浮点型数值
valueFlag bool
}
func NewValueElementBuilder() *ValueElementBuilder {
builder := &ValueElementBuilder{}
return builder
}
// 整型或浮点型数值
//
// 示例值:
func (builder *ValueElementBuilder) Value(value string) *ValueElementBuilder {
builder.value = value
builder.valueFlag = true
return builder
}
func (builder *ValueElementBuilder) Build() *ValueElement {
req := &ValueElement{}
if builder.valueFlag {
req.Value = &builder.value
}
return req
}
type ValueElementSingleOption struct {
DataValidationId *int `json:"data_validation_id,omitempty"` // 数据校验ID
DataValiditonValue *string `json:"data_validiton_value,omitempty"` // 选项值
}
type ValueElementSingleOptionBuilder struct {
dataValidationId int // 数据校验ID
dataValidationIdFlag bool
dataValiditonValue string // 选项值
dataValiditonValueFlag bool
}
func NewValueElementSingleOptionBuilder() *ValueElementSingleOptionBuilder {
builder := &ValueElementSingleOptionBuilder{}
return builder
}
// 数据校验ID
//
// 示例值:1
func (builder *ValueElementSingleOptionBuilder) DataValidationId(dataValidationId int) *ValueElementSingleOptionBuilder {
builder.dataValidationId = dataValidationId
builder.dataValidationIdFlag = true
return builder
}
// 选项值
//
// 示例值:option1
func (builder *ValueElementSingleOptionBuilder) DataValiditonValue(dataValiditonValue string) *ValueElementSingleOptionBuilder {
builder.dataValiditonValue = dataValiditonValue
builder.dataValiditonValueFlag = true
return builder
}
func (builder *ValueElementSingleOptionBuilder) Build() *ValueElementSingleOption {
req := &ValueElementSingleOption{}
if builder.dataValidationIdFlag {
req.DataValidationId = &builder.dataValidationId
}
if builder.dataValiditonValueFlag {
req.DataValiditonValue = &builder.dataValiditonValue
}
return req
}
type CreateSpreadsheetReqBuilder struct {
apiReq *larkcore.ApiReq
spreadsheet *Spreadsheet
}
func NewCreateSpreadsheetReqBuilder() *CreateSpreadsheetReqBuilder {
builder := &CreateSpreadsheetReqBuilder{}
builder.apiReq = &larkcore.ApiReq{
PathParams: larkcore.PathParams{},
QueryParams: larkcore.QueryParams{},
}
return builder
}
// 在指定目录下创建表格
func (builder *CreateSpreadsheetReqBuilder) Spreadsheet(spreadsheet *Spreadsheet) *CreateSpreadsheetReqBuilder {
builder.spreadsheet = spreadsheet
return builder
}
func (builder *CreateSpreadsheetReqBuilder) Build() *CreateSpreadsheetReq {
req := &CreateSpreadsheetReq{}
req.apiReq = &larkcore.ApiReq{}
req.apiReq.Body = builder.spreadsheet
return req
}
type CreateSpreadsheetReq struct {
apiReq *larkcore.ApiReq
Spreadsheet *Spreadsheet `body:""`
}
type CreateSpreadsheetRespData struct {
Spreadsheet *Spreadsheet `json:"spreadsheet,omitempty"` // 表格
}
type CreateSpreadsheetResp struct {
*larkcore.ApiResp `json:"-"`
larkcore.CodeError
Data *CreateSpreadsheetRespData `json:"data"` // 业务数据
}
func (resp *CreateSpreadsheetResp) Success() bool {
return resp.Code == 0
}
type GetSpreadsheetReqBuilder struct {
apiReq *larkcore.ApiReq
}
func NewGetSpreadsheetReqBuilder() *GetSpreadsheetReqBuilder {
builder := &GetSpreadsheetReqBuilder{}
builder.apiReq = &larkcore.ApiReq{
PathParams: larkcore.PathParams{},
QueryParams: larkcore.QueryParams{},
}
return builder
}
// 表格的token
//
// 示例值:shtxxxxxxxxxxxxxxx
func (builder *GetSpreadsheetReqBuilder) SpreadsheetToken(spreadsheetToken string) *GetSpreadsheetReqBuilder {
builder.apiReq.PathParams.Set("spreadsheet_token", fmt.Sprint(spreadsheetToken))
return builder
}
// 此次调用中使用的用户ID的类型
//
// 示例值:
func (builder *GetSpreadsheetReqBuilder) UserIdType(userIdType string) *GetSpreadsheetReqBuilder {
builder.apiReq.QueryParams.Set("user_id_type", fmt.Sprint(userIdType))
return builder
}
func (builder *GetSpreadsheetReqBuilder) Build() *GetSpreadsheetReq {
req := &GetSpreadsheetReq{}
req.apiReq = &larkcore.ApiReq{}
req.apiReq.PathParams = builder.apiReq.PathParams
req.apiReq.QueryParams = builder.apiReq.QueryParams
return req
}
type GetSpreadsheetReq struct {
apiReq *larkcore.ApiReq
}
type GetSpreadsheetRespData struct {
Spreadsheet *GetSpreadsheet `json:"spreadsheet,omitempty"` // 电子表格属性
}
type GetSpreadsheetResp struct {
*larkcore.ApiResp `json:"-"`
larkcore.CodeError
Data *GetSpreadsheetRespData `json:"data"` // 业务数据
}
func (resp *GetSpreadsheetResp) Success() bool {
return resp.Code == 0
}
type PatchSpreadsheetReqBuilder struct {
apiReq *larkcore.ApiReq
updateSpreadsheetProperties *UpdateSpreadsheetProperties
}
func NewPatchSpreadsheetReqBuilder() *PatchSpreadsheetReqBuilder {
builder := &PatchSpreadsheetReqBuilder{}
builder.apiReq = &larkcore.ApiReq{
PathParams: larkcore.PathParams{},
QueryParams: larkcore.QueryParams{},
}
return builder
}
// 表格的token
//
// 示例值:shtxxxxxxxxxxxxxxx
func (builder *PatchSpreadsheetReqBuilder) SpreadsheetToken(spreadsheetToken string) *PatchSpreadsheetReqBuilder {
builder.apiReq.PathParams.Set("spreadsheet_token", fmt.Sprint(spreadsheetToken))
return builder
}
// 该接口用于修改电子表格的属性
func (builder *PatchSpreadsheetReqBuilder) UpdateSpreadsheetProperties(updateSpreadsheetProperties *UpdateSpreadsheetProperties) *PatchSpreadsheetReqBuilder {
builder.updateSpreadsheetProperties = updateSpreadsheetProperties
return builder
}
func (builder *PatchSpreadsheetReqBuilder) Build() *PatchSpreadsheetReq {
req := &PatchSpreadsheetReq{}
req.apiReq = &larkcore.ApiReq{}
req.apiReq.PathParams = builder.apiReq.PathParams
req.apiReq.Body = builder.updateSpreadsheetProperties
return req
}
type PatchSpreadsheetReq struct {
apiReq *larkcore.ApiReq
UpdateSpreadsheetProperties *UpdateSpreadsheetProperties `body:""`
}
type PatchSpreadsheetResp struct {
*larkcore.ApiResp `json:"-"`
larkcore.CodeError
}
func (resp *PatchSpreadsheetResp) Success() bool {
return resp.Code == 0
}
type FindSpreadsheetSheetReqBuilder struct {
apiReq *larkcore.ApiReq
find *Find
}
func NewFindSpreadsheetSheetReqBuilder() *FindSpreadsheetSheetReqBuilder {
builder := &FindSpreadsheetSheetReqBuilder{}
builder.apiReq = &larkcore.ApiReq{
PathParams: larkcore.PathParams{},
QueryParams: larkcore.QueryParams{},
}
return builder
}
// 表格的token,获取方式见[如何获取云文档资源相关 token](https://open.feishu.cn/document/ukTMukTMukTM/uczNzUjL3czM14yN3MTN)
//
// 示例值:shtcnmBA*****yGehy8
func (builder *FindSpreadsheetSheetReqBuilder) SpreadsheetToken(spreadsheetToken string) *FindSpreadsheetSheetReqBuilder {
builder.apiReq.PathParams.Set("spreadsheet_token", fmt.Sprint(spreadsheetToken))
return builder
}
// 工作表的id,获取方式见[获取工作表](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/query)
//
// 示例值:0b**12
func (builder *FindSpreadsheetSheetReqBuilder) SheetId(sheetId string) *FindSpreadsheetSheetReqBuilder {
builder.apiReq.PathParams.Set("sheet_id", fmt.Sprint(sheetId))
return builder
}
// 在指定范围内查找符合查找条件的单元格。
func (builder *FindSpreadsheetSheetReqBuilder) Find(find *Find) *FindSpreadsheetSheetReqBuilder {
builder.find = find
return builder
}
func (builder *FindSpreadsheetSheetReqBuilder) Build() *FindSpreadsheetSheetReq {
req := &FindSpreadsheetSheetReq{}
req.apiReq = &larkcore.ApiReq{}
req.apiReq.PathParams = builder.apiReq.PathParams
req.apiReq.Body = builder.find
return req
}
type FindSpreadsheetSheetReq struct {
apiReq *larkcore.ApiReq
Find *Find `body:""`
}
type FindSpreadsheetSheetRespData struct {
FindResult *FindReplaceResult `json:"find_result,omitempty"` // 符合条件的信息
}
type FindSpreadsheetSheetResp struct {
*larkcore.ApiResp `json:"-"`
larkcore.CodeError
Data *FindSpreadsheetSheetRespData `json:"data"` // 业务数据
}
func (resp *FindSpreadsheetSheetResp) Success() bool {
return resp.Code == 0
}
type GetSpreadsheetSheetReqBuilder struct {
apiReq *larkcore.ApiReq
}
func NewGetSpreadsheetSheetReqBuilder() *GetSpreadsheetSheetReqBuilder {
builder := &GetSpreadsheetSheetReqBuilder{}
builder.apiReq = &larkcore.ApiReq{
PathParams: larkcore.PathParams{},
QueryParams: larkcore.QueryParams{},
}
return builder
}
// 表格的token,获取方式见[如何获取云文档资源相关 token](https://open.feishu.cn/document/ukTMukTMukTM/uczNzUjL3czM14yN3MTN)
//
// 示例值:shtxxxxxxxxxxxxxxx
func (builder *GetSpreadsheetSheetReqBuilder) SpreadsheetToken(spreadsheetToken string) *GetSpreadsheetSheetReqBuilder {
builder.apiReq.PathParams.Set("spreadsheet_token", fmt.Sprint(spreadsheetToken))
return builder
}
// 工作表的id,获取方式见[获取工作表](https://open.feishu.cn/document/ukTMukTMukTM/uUDN04SN0QjL1QDN/sheets-v3/spreadsheet-sheet/query)
//
// 示例值:giDk9k
func (builder *GetSpreadsheetSheetReqBuilder) SheetId(sheetId string) *GetSpreadsheetSheetReqBuilder {
builder.apiReq.PathParams.Set("sheet_id", fmt.Sprint(sheetId))
return builder
}
func (builder *GetSpreadsheetSheetReqBuilder) Build() *GetSpreadsheetSheetReq {
req := &GetSpreadsheetSheetReq{}
req.apiReq = &larkcore.ApiReq{}
req.apiReq.PathParams = builder.apiReq.PathParams
return req
}
type GetSpreadsheetSheetReq struct {
apiReq *larkcore.ApiReq
}
type GetSpreadsheetSheetRespData struct {
Sheet *Sheet `json:"sheet,omitempty"` // 工作表
}
type GetSpreadsheetSheetResp struct {
*larkcore.ApiResp `json:"-"`
larkcore.CodeError
Data *GetSpreadsheetSheetRespData `json:"data"` // 业务数据
}
func (resp *GetSpreadsheetSheetResp) Success() bool {
return resp.Code == 0
}
type MoveDimensionSpreadsheetSheetReqBuilder struct {
apiReq *larkcore.ApiReq
moveDimension *MoveDimension
}
func NewMoveDimensionSpreadsheetSheetReqBuilder() *MoveDimensionSpreadsheetSheetReqBuilder {
builder := &MoveDimensionSpreadsheetSheetReqBuilder{}
builder.apiReq = &larkcore.ApiReq{
PathParams: larkcore.PathParams{},
QueryParams: larkcore.QueryParams{},
}
return builder
}
// 表格 token
//
// 示例值:shtcnmBA\*****yGehy8
func (builder *MoveDimensionSpreadsheetSheetReqBuilder) SpreadsheetToken(spreadsheetToken string) *MoveDimensionSpreadsheetSheetReqBuilder {
builder.apiReq.PathParams.Set("spreadsheet_token", fmt.Sprint(spreadsheetToken))
return builder
}
// 子表 id
//
// 示例值:0b\**12
func (builder *MoveDimensionSpreadsheetSheetReqBuilder) SheetId(sheetId string) *MoveDimensionSpreadsheetSheetReqBuilder {
builder.apiReq.PathParams.Set("sheet_id", fmt.Sprint(sheetId))
return builder
}
// 该接口用于移动行列,行列被移动到目标位置后,原本在目标位置的行列会对应右移或下移。
func (builder *MoveDimensionSpreadsheetSheetReqBuilder) MoveDimension(moveDimension *MoveDimension) *MoveDimensionSpreadsheetSheetReqBuilder {
builder.moveDimension = moveDimension
return builder
}
func (builder *MoveDimensionSpreadsheetSheetReqBuilder) Build() *MoveDimensionSpreadsheetSheetReq {
req := &MoveDimensionSpreadsheetSheetReq{}
req.apiReq = &larkcore.ApiReq{}
req.apiReq.PathParams = builder.apiReq.PathParams
req.apiReq.Body = builder.moveDimension
return req
}
type MoveDimensionSpreadsheetSheetReq struct {
apiReq *larkcore.ApiReq
MoveDimension *MoveDimension `body:""`
}
type MoveDimensionSpreadsheetSheetResp struct {
*larkcore.ApiResp `json:"-"`
larkcore.CodeError
}
func (resp *MoveDimensionSpreadsheetSheetResp) Success() bool {
return resp.Code == 0
}
type QuerySpreadsheetSheetReqBuilder struct {
apiReq *larkcore.ApiReq
}
func NewQuerySpreadsheetSheetReqBuilder() *QuerySpreadsheetSheetReqBuilder {
builder := &QuerySpreadsheetSheetReqBuilder{}
builder.apiReq = &larkcore.ApiReq{
PathParams: larkcore.PathParams{},
QueryParams: larkcore.QueryParams{},
}
return builder
}
// 电子表格的token
//
// 示例值:shtxxxxxxxxxxxxxxxx
func (builder *QuerySpreadsheetSheetReqBuilder) SpreadsheetToken(spreadsheetToken string) *QuerySpreadsheetSheetReqBuilder {
builder.apiReq.PathParams.Set("spreadsheet_token", fmt.Sprint(spreadsheetToken))
return builder
}
func (builder *QuerySpreadsheetSheetReqBuilder) Build() *QuerySpreadsheetSheetReq {
req := &QuerySpreadsheetSheetReq{}
req.apiReq = &larkcore.ApiReq{}
req.apiReq.PathParams = builder.apiReq.PathParams
return req
}
type QuerySpreadsheetSheetReq struct {
apiReq *larkcore.ApiReq
}
type QuerySpreadsheetSheetRespData struct {
Sheets []*Sheet `json:"sheets,omitempty"` // 工作表列表
}
type QuerySpreadsheetSheetResp struct {
*larkcore.ApiResp `json:"-"`
larkcore.CodeError
Data *QuerySpreadsheetSheetRespData `json:"data"` // 业务数据
}
func (resp *QuerySpreadsheetSheetResp) Success() bool {
return resp.Code == 0
}
type ReplaceSpreadsheetSheetReqBuilder struct {
apiReq *larkcore.ApiReq
replace *Replace
}
func NewReplaceSpreadsheetSheetReqBuilder() *ReplaceSpreadsheetSheetReqBuilder {
builder := &ReplaceSpreadsheetSheetReqBuilder{}
builder.apiReq = &larkcore.ApiReq{
PathParams: larkcore.PathParams{},
QueryParams: larkcore.QueryParams{},
}
return builder
}
// Spreadsheet token
//
// 示例值:shtcnmBA*****yGehy8
func (builder *ReplaceSpreadsheetSheetReqBuilder) SpreadsheetToken(spreadsheetToken string) *ReplaceSpreadsheetSheetReqBuilder {
builder.apiReq.PathParams.Set("spreadsheet_token", fmt.Sprint(spreadsheetToken))
return builder
}
// Sheet id
//
// 示例值:0b**12
func (builder *ReplaceSpreadsheetSheetReqBuilder) SheetId(sheetId string) *ReplaceSpreadsheetSheetReqBuilder {
builder.apiReq.PathParams.Set("sheet_id", fmt.Sprint(sheetId))
return builder
}
// 按照指定的条件查找子表的某个范围内的数据符合条件的单元格并替换值,返回替换成功的单元格位置。一次请求最多允许替换5000个单元格,如果超过请将range缩小范围再操作。请求体中的 range、find、replaccement 字段必填。
func (builder *ReplaceSpreadsheetSheetReqBuilder) Replace(replace *Replace) *ReplaceSpreadsheetSheetReqBuilder {
builder.replace = replace
return builder
}
func (builder *ReplaceSpreadsheetSheetReqBuilder) Build() *ReplaceSpreadsheetSheetReq {
req := &ReplaceSpreadsheetSheetReq{}
req.apiReq = &larkcore.ApiReq{}
req.apiReq.PathParams = builder.apiReq.PathParams
req.apiReq.Body = builder.replace
return req
}
type ReplaceSpreadsheetSheetReq struct {
apiReq *larkcore.ApiReq
Replace *Replace `body:""`
}
type ReplaceSpreadsheetSheetRespData struct {
ReplaceResult *FindReplaceResult `json:"replace_result,omitempty"` // 符合查找条件并替换的单元格信息
}
type ReplaceSpreadsheetSheetResp struct {
*larkcore.ApiResp `json:"-"`
larkcore.CodeError
Data *ReplaceSpreadsheetSheetRespData `json:"data"` // 业务数据
}
func (resp *ReplaceSpreadsheetSheetResp) Success() bool {
return resp.Code == 0
}
type CreateSpreadsheetSheetFilterReqBuilder struct {
apiReq *larkcore.ApiReq
createSheetFilter *CreateSheetFilter
}
func NewCreateSpreadsheetSheetFilterReqBuilder() *CreateSpreadsheetSheetFilterReqBuilder {
builder := &CreateSpreadsheetSheetFilterReqBuilder{}
builder.apiReq = &larkcore.ApiReq{
PathParams: larkcore.PathParams{},
QueryParams: larkcore.QueryParams{},
}
return builder
}
// 表格 token
//
// 示例值:shtcnmBA\*****yGehy8
func (builder *CreateSpreadsheetSheetFilterReqBuilder) SpreadsheetToken(spreadsheetToken string) *CreateSpreadsheetSheetFilterReqBuilder {
builder.apiReq.PathParams.Set("spreadsheet_token", fmt.Sprint(spreadsheetToken))
return builder
}
// 子表 id
//
// 示例值:0b\**12
func (builder *CreateSpreadsheetSheetFilterReqBuilder) SheetId(sheetId string) *CreateSpreadsheetSheetFilterReqBuilder {
builder.apiReq.PathParams.Set("sheet_id", fmt.Sprint(sheetId))
return builder
}
// 在子表内创建筛选。
func (builder *CreateSpreadsheetSheetFilterReqBuilder) CreateSheetFilter(createSheetFilter *CreateSheetFilter) *CreateSpreadsheetSheetFilterReqBuilder {
builder.createSheetFilter = createSheetFilter
return builder
}
func (builder *CreateSpreadsheetSheetFilterReqBuilder) Build() *CreateSpreadsheetSheetFilterReq {
req := &CreateSpreadsheetSheetFilterReq{}
req.apiReq = &larkcore.ApiReq{}
req.apiReq.PathParams = builder.apiReq.PathParams
req.apiReq.Body = builder.createSheetFilter
return req
}
type CreateSpreadsheetSheetFilterReq struct {
apiReq *larkcore.ApiReq
CreateSheetFilter *CreateSheetFilter `body:""`
}
type CreateSpreadsheetSheetFilterResp struct {
*larkcore.ApiResp `json:"-"`
larkcore.CodeError
}
func (resp *CreateSpreadsheetSheetFilterResp) Success() bool {
return resp.Code == 0
}
type DeleteSpreadsheetSheetFilterReqBuilder struct {
apiReq *larkcore.ApiReq
}
func NewDeleteSpreadsheetSheetFilterReqBuilder() *DeleteSpreadsheetSheetFilterReqBuilder {
builder := &DeleteSpreadsheetSheetFilterReqBuilder{}
builder.apiReq = &larkcore.ApiReq{
PathParams: larkcore.PathParams{},
QueryParams: larkcore.QueryParams{},
}
return builder
}
// 表格 token
//
// 示例值:shtcnmBA\*****yGehy8
func (builder *DeleteSpreadsheetSheetFilterReqBuilder) SpreadsheetToken(spreadsheetToken string) *DeleteSpreadsheetSheetFilterReqBuilder {
builder.apiReq.PathParams.Set("spreadsheet_token", fmt.Sprint(spreadsheetToken))
return builder
}
// 子表 id
//
// 示例值:0b\**12
func (builder *DeleteSpreadsheetSheetFilterReqBuilder) SheetId(sheetId string) *DeleteSpreadsheetSheetFilterReqBuilder {
builder.apiReq.PathParams.Set("sheet_id", fmt.Sprint(sheetId))
return builder
}
func (builder *DeleteSpreadsheetSheetFilterReqBuilder) Build() *DeleteSpreadsheetSheetFilterReq {
req := &DeleteSpreadsheetSheetFilterReq{}
req.apiReq = &larkcore.ApiReq{}
req.apiReq.PathParams = builder.apiReq.PathParams
return req
}
type DeleteSpreadsheetSheetFilterReq struct {
apiReq *larkcore.ApiReq
}
type DeleteSpreadsheetSheetFilterResp struct {
*larkcore.ApiResp `json:"-"`
larkcore.CodeError
}
func (resp *DeleteSpreadsheetSheetFilterResp) Success() bool {
return resp.Code == 0
}
type GetSpreadsheetSheetFilterReqBuilder struct {
apiReq *larkcore.ApiReq
}
func NewGetSpreadsheetSheetFilterReqBuilder() *GetSpreadsheetSheetFilterReqBuilder {
builder := &GetSpreadsheetSheetFilterReqBuilder{}
builder.apiReq = &larkcore.ApiReq{
PathParams: larkcore.PathParams{},
QueryParams: larkcore.QueryParams{},
}
return builder
}
// 表格 token
//
// 示例值:shtcnmBA\*****yGehy8
func (builder *GetSpreadsheetSheetFilterReqBuilder) SpreadsheetToken(spreadsheetToken string) *GetSpreadsheetSheetFilterReqBuilder {
builder.apiReq.PathParams.Set("spreadsheet_token", fmt.Sprint(spreadsheetToken))
return builder
}
// 子表 id
//
// 示例值:0b\**12
func (builder *GetSpreadsheetSheetFilterReqBuilder) SheetId(sheetId string) *GetSpreadsheetSheetFilterReqBuilder {
builder.apiReq.PathParams.Set("sheet_id", fmt.Sprint(sheetId))
return builder
}
func (builder *GetSpreadsheetSheetFilterReqBuilder) Build() *GetSpreadsheetSheetFilterReq {
req := &GetSpreadsheetSheetFilterReq{}
req.apiReq = &larkcore.ApiReq{}
req.apiReq.PathParams = builder.apiReq.PathParams
return req
}
type GetSpreadsheetSheetFilterReq struct {
apiReq *larkcore.ApiReq
}
type GetSpreadsheetSheetFilterRespData struct {
SheetFilterInfo *SheetFilterInfo `json:"sheet_filter_info,omitempty"` // 筛选信息
}
type GetSpreadsheetSheetFilterResp struct {
*larkcore.ApiResp `json:"-"`
larkcore.CodeError
Data *GetSpreadsheetSheetFilterRespData `json:"data"` // 业务数据
}
func (resp *GetSpreadsheetSheetFilterResp) Success() bool {
return resp.Code == 0
}
type UpdateSpreadsheetSheetFilterReqBuilder struct {
apiReq *larkcore.ApiReq
updateSheetFilter *UpdateSheetFilter
}
func NewUpdateSpreadsheetSheetFilterReqBuilder() *UpdateSpreadsheetSheetFilterReqBuilder {
builder := &UpdateSpreadsheetSheetFilterReqBuilder{}
builder.apiReq = &larkcore.ApiReq{
PathParams: larkcore.PathParams{},
QueryParams: larkcore.QueryParams{},
}
return builder
}
// 表格 token
//
// 示例值:shtcnmBA\*****yGehy8
func (builder *UpdateSpreadsheetSheetFilterReqBuilder) SpreadsheetToken(spreadsheetToken string) *UpdateSpreadsheetSheetFilterReqBuilder {
builder.apiReq.PathParams.Set("spreadsheet_token", fmt.Sprint(spreadsheetToken))
return builder
}
// 子表 id
//
// 示例值:0b\**12
func (builder *UpdateSpreadsheetSheetFilterReqBuilder) SheetId(sheetId string) *UpdateSpreadsheetSheetFilterReqBuilder {
builder.apiReq.PathParams.Set("sheet_id", fmt.Sprint(sheetId))
return builder
}
// 更新子表筛选范围中的列筛选条件。
func (builder *UpdateSpreadsheetSheetFilterReqBuilder) UpdateSheetFilter(updateSheetFilter *UpdateSheetFilter) *UpdateSpreadsheetSheetFilterReqBuilder {
builder.updateSheetFilter = updateSheetFilter
return builder
}
func (builder *UpdateSpreadsheetSheetFilterReqBuilder) Build() *UpdateSpreadsheetSheetFilterReq {
req := &UpdateSpreadsheetSheetFilterReq{}
req.apiReq = &larkcore.ApiReq{}
req.apiReq.PathParams = builder.apiReq.PathParams
req.apiReq.Body = builder.updateSheetFilter
return req
}
type UpdateSpreadsheetSheetFilterReq struct {
apiReq *larkcore.ApiReq
UpdateSheetFilter *UpdateSheetFilter `body:""`
}
type UpdateSpreadsheetSheetFilterResp struct {
*larkcore.ApiResp `json:"-"`
larkcore.CodeError
}
func (resp *UpdateSpreadsheetSheetFilterResp) Success() bool {
return resp.Code == 0
}
type CreateSpreadsheetSheetFilterViewReqBuilder struct {
apiReq *larkcore.ApiReq
filterView *FilterView
}
func NewCreateSpreadsheetSheetFilterViewReqBuilder() *CreateSpreadsheetSheetFilterViewReqBuilder {
builder := &CreateSpreadsheetSheetFilterViewReqBuilder{}
builder.apiReq = &larkcore.ApiReq{
PathParams: larkcore.PathParams{},
QueryParams: larkcore.QueryParams{},
}
return builder
}
// 表格 token
//
// 示例值:shtcnmBA*****yGehy8
func (builder *CreateSpreadsheetSheetFilterViewReqBuilder) SpreadsheetToken(spreadsheetToken string) *CreateSpreadsheetSheetFilterViewReqBuilder {
builder.apiReq.PathParams.Set("spreadsheet_token", fmt.Sprint(spreadsheetToken))
return builder
}
// 子表 id
//
// 示例值:0b**12
func (builder *CreateSpreadsheetSheetFilterViewReqBuilder) SheetId(sheetId string) *CreateSpreadsheetSheetFilterViewReqBuilder {
builder.apiReq.PathParams.Set("sheet_id", fmt.Sprint(sheetId))
return builder
}
// 根据传入的参数创建一个筛选视图。Id 和 名字可选,不填的话会默认生成;range 必填。Id 长度为10,由 0-9、a-z、A-Z 组合生成。名字长度不超过100。单个子表内的筛选视图个数不超过 150。
func (builder *CreateSpreadsheetSheetFilterViewReqBuilder) FilterView(filterView *FilterView) *CreateSpreadsheetSheetFilterViewReqBuilder {
builder.filterView = filterView
return builder
}
func (builder *CreateSpreadsheetSheetFilterViewReqBuilder) Build() *CreateSpreadsheetSheetFilterViewReq {
req := &CreateSpreadsheetSheetFilterViewReq{}
req.apiReq = &larkcore.ApiReq{}
req.apiReq.PathParams = builder.apiReq.PathParams
req.apiReq.Body = builder.filterView
return req
}
type CreateSpreadsheetSheetFilterViewReq struct {
apiReq *larkcore.ApiReq
FilterView *FilterView `body:""`
}
type CreateSpreadsheetSheetFilterViewRespData struct {
FilterView *FilterView `json:"filter_view,omitempty"` // 创建的筛选视图的 id 、name、range
}
type CreateSpreadsheetSheetFilterViewResp struct {
*larkcore.ApiResp `json:"-"`
larkcore.CodeError
Data *CreateSpreadsheetSheetFilterViewRespData `json:"data"` // 业务数据
}
func (resp *CreateSpreadsheetSheetFilterViewResp) Success() bool {
return resp.Code == 0
}
type DeleteSpreadsheetSheetFilterViewReqBuilder struct {
apiReq *larkcore.ApiReq
}
func NewDeleteSpreadsheetSheetFilterViewReqBuilder() *DeleteSpreadsheetSheetFilterViewReqBuilder {
builder := &DeleteSpreadsheetSheetFilterViewReqBuilder{}
builder.apiReq = &larkcore.ApiReq{
PathParams: larkcore.PathParams{},
QueryParams: larkcore.QueryParams{},
}
return builder
}
// 表格 token
//
// 示例值:shtcnmBA*****yGehy8
func (builder *DeleteSpreadsheetSheetFilterViewReqBuilder) SpreadsheetToken(spreadsheetToken string) *DeleteSpreadsheetSheetFilterViewReqBuilder {
builder.apiReq.PathParams.Set("spreadsheet_token", fmt.Sprint(spreadsheetToken))
return builder
}
// 子表 id
//
// 示例值:0b**12
func (builder *DeleteSpreadsheetSheetFilterViewReqBuilder) SheetId(sheetId string) *DeleteSpreadsheetSheetFilterViewReqBuilder {
builder.apiReq.PathParams.Set("sheet_id", fmt.Sprint(sheetId))
return builder
}
// 筛选视图 id
//
// 示例值:pH9hbVcCXA
func (builder *DeleteSpreadsheetSheetFilterViewReqBuilder) FilterViewId(filterViewId string) *DeleteSpreadsheetSheetFilterViewReqBuilder {
builder.apiReq.PathParams.Set("filter_view_id", fmt.Sprint(filterViewId))
return builder
}
func (builder *DeleteSpreadsheetSheetFilterViewReqBuilder) Build() *DeleteSpreadsheetSheetFilterViewReq {
req := &DeleteSpreadsheetSheetFilterViewReq{}
req.apiReq = &larkcore.ApiReq{}
req.apiReq.PathParams = builder.apiReq.PathParams
return req
}
type DeleteSpreadsheetSheetFilterViewReq struct {
apiReq *larkcore.ApiReq
}
type DeleteSpreadsheetSheetFilterViewResp struct {
*larkcore.ApiResp `json:"-"`
larkcore.CodeError
}
func (resp *DeleteSpreadsheetSheetFilterViewResp) Success() bool {
return resp.Code == 0
}
type GetSpreadsheetSheetFilterViewReqBuilder struct {
apiReq *larkcore.ApiReq
}
func NewGetSpreadsheetSheetFilterViewReqBuilder() *GetSpreadsheetSheetFilterViewReqBuilder {
builder := &GetSpreadsheetSheetFilterViewReqBuilder{}
builder.apiReq = &larkcore.ApiReq{
PathParams: larkcore.PathParams{},
QueryParams: larkcore.QueryParams{},
}
return builder
}
// 表格 token
//
// 示例值:shtcnmBA*****yGehy8
func (builder *GetSpreadsheetSheetFilterViewReqBuilder) SpreadsheetToken(spreadsheetToken string) *GetSpreadsheetSheetFilterViewReqBuilder {
builder.apiReq.PathParams.Set("spreadsheet_token", fmt.Sprint(spreadsheetToken))
return builder
}
// 子表 id
//
// 示例值:0b**12
func (builder *GetSpreadsheetSheetFilterViewReqBuilder) SheetId(sheetId string) *GetSpreadsheetSheetFilterViewReqBuilder {
builder.apiReq.PathParams.Set("sheet_id", fmt.Sprint(sheetId))
return builder
}
// 筛选视图 id
//
// 示例值:pH9hbVcCXA
func (builder *GetSpreadsheetSheetFilterViewReqBuilder) FilterViewId(filterViewId string) *GetSpreadsheetSheetFilterViewReqBuilder {
builder.apiReq.PathParams.Set("filter_view_id", fmt.Sprint(filterViewId))
return builder
}
func (builder *GetSpreadsheetSheetFilterViewReqBuilder) Build() *GetSpreadsheetSheetFilterViewReq {
req := &GetSpreadsheetSheetFilterViewReq{}
req.apiReq = &larkcore.ApiReq{}
req.apiReq.PathParams = builder.apiReq.PathParams
return req
}
type GetSpreadsheetSheetFilterViewReq struct {
apiReq *larkcore.ApiReq
}
type GetSpreadsheetSheetFilterViewRespData struct {
FilterView *FilterView `json:"filter_view,omitempty"` // 筛选视图信息,包括 id、name、range
}
type GetSpreadsheetSheetFilterViewResp struct {
*larkcore.ApiResp `json:"-"`
larkcore.CodeError
Data *GetSpreadsheetSheetFilterViewRespData `json:"data"` // 业务数据
}
func (resp *GetSpreadsheetSheetFilterViewResp) Success() bool {
return resp.Code == 0
}
type PatchSpreadsheetSheetFilterViewReqBuilder struct {
apiReq *larkcore.ApiReq
filterView *FilterView
}
func NewPatchSpreadsheetSheetFilterViewReqBuilder() *PatchSpreadsheetSheetFilterViewReqBuilder {
builder := &PatchSpreadsheetSheetFilterViewReqBuilder{}
builder.apiReq = &larkcore.ApiReq{
PathParams: larkcore.PathParams{},
QueryParams: larkcore.QueryParams{},
}
return builder
}
// 表格 token
//
// 示例值:shtcnmBA*****yGehy8
func (builder *PatchSpreadsheetSheetFilterViewReqBuilder) SpreadsheetToken(spreadsheetToken string) *PatchSpreadsheetSheetFilterViewReqBuilder {
builder.apiReq.PathParams.Set("spreadsheet_token", fmt.Sprint(spreadsheetToken))
return builder
}
// 子表 id
//
// 示例值:0b**12
func (builder *PatchSpreadsheetSheetFilterViewReqBuilder) SheetId(sheetId string) *PatchSpreadsheetSheetFilterViewReqBuilder {
builder.apiReq.PathParams.Set("sheet_id", fmt.Sprint(sheetId))
return builder
}
// 筛选视图 id
//
// 示例值:pH9hbVcCXA
func (builder *PatchSpreadsheetSheetFilterViewReqBuilder) FilterViewId(filterViewId string) *PatchSpreadsheetSheetFilterViewReqBuilder {
builder.apiReq.PathParams.Set("filter_view_id", fmt.Sprint(filterViewId))
return builder
}
// 更新筛选视图的名字或者筛选范围。名字长度不超过100,不能重复即子表内唯一;筛选范围不超过子表的最大范围。
func (builder *PatchSpreadsheetSheetFilterViewReqBuilder) FilterView(filterView *FilterView) *PatchSpreadsheetSheetFilterViewReqBuilder {
builder.filterView = filterView
return builder
}
func (builder *PatchSpreadsheetSheetFilterViewReqBuilder) Build() *PatchSpreadsheetSheetFilterViewReq {
req := &PatchSpreadsheetSheetFilterViewReq{}
req.apiReq = &larkcore.ApiReq{}
req.apiReq.PathParams = builder.apiReq.PathParams
req.apiReq.Body = builder.filterView
return req
}
type PatchSpreadsheetSheetFilterViewReq struct {
apiReq *larkcore.ApiReq
FilterView *FilterView `body:""`
}
type PatchSpreadsheetSheetFilterViewRespData struct {
FilterView *FilterView `json:"filter_view,omitempty"` // 更新后的筛选视图的 id 、name、range
}
type PatchSpreadsheetSheetFilterViewResp struct {
*larkcore.ApiResp `json:"-"`
larkcore.CodeError
Data *PatchSpreadsheetSheetFilterViewRespData `json:"data"` // 业务数据
}
func (resp *PatchSpreadsheetSheetFilterViewResp) Success() bool {
return resp.Code == 0
}
type QuerySpreadsheetSheetFilterViewReqBuilder struct {
apiReq *larkcore.ApiReq
}
func NewQuerySpreadsheetSheetFilterViewReqBuilder() *QuerySpreadsheetSheetFilterViewReqBuilder {
builder := &QuerySpreadsheetSheetFilterViewReqBuilder{}
builder.apiReq = &larkcore.ApiReq{
PathParams: larkcore.PathParams{},
QueryParams: larkcore.QueryParams{},
}
return builder
}
// 表格 token
//
// 示例值:shtcnmBA*****yGehy8
func (builder *QuerySpreadsheetSheetFilterViewReqBuilder) SpreadsheetToken(spreadsheetToken string) *QuerySpreadsheetSheetFilterViewReqBuilder {
builder.apiReq.PathParams.Set("spreadsheet_token", fmt.Sprint(spreadsheetToken))
return builder
}
// 子表 id
//
// 示例值:0b**12
func (builder *QuerySpreadsheetSheetFilterViewReqBuilder) SheetId(sheetId string) *QuerySpreadsheetSheetFilterViewReqBuilder {
builder.apiReq.PathParams.Set("sheet_id", fmt.Sprint(sheetId))
return builder
}
func (builder *QuerySpreadsheetSheetFilterViewReqBuilder) Build() *QuerySpreadsheetSheetFilterViewReq {
req := &QuerySpreadsheetSheetFilterViewReq{}
req.apiReq = &larkcore.ApiReq{}
req.apiReq.PathParams = builder.apiReq.PathParams
return req
}
type QuerySpreadsheetSheetFilterViewReq struct {
apiReq *larkcore.ApiReq
}
type QuerySpreadsheetSheetFilterViewRespData struct {
Items []*FilterView `json:"items,omitempty"` // 子表的所有筛选视图信息,id、name、range
}
type QuerySpreadsheetSheetFilterViewResp struct {
*larkcore.ApiResp `json:"-"`
larkcore.CodeError
Data *QuerySpreadsheetSheetFilterViewRespData `json:"data"` // 业务数据
}
func (resp *QuerySpreadsheetSheetFilterViewResp) Success() bool {
return resp.Code == 0
}
type CreateSpreadsheetSheetFilterViewConditionReqBuilder struct {
apiReq *larkcore.ApiReq
filterViewCondition *FilterViewCondition
}
func NewCreateSpreadsheetSheetFilterViewConditionReqBuilder() *CreateSpreadsheetSheetFilterViewConditionReqBuilder {
builder := &CreateSpreadsheetSheetFilterViewConditionReqBuilder{}
builder.apiReq = &larkcore.ApiReq{
PathParams: larkcore.PathParams{},
QueryParams: larkcore.QueryParams{},
}
return builder
}
// 表格 token
//
// 示例值:shtcnmBA*****yGehy8
func (builder *CreateSpreadsheetSheetFilterViewConditionReqBuilder) SpreadsheetToken(spreadsheetToken string) *CreateSpreadsheetSheetFilterViewConditionReqBuilder {
builder.apiReq.PathParams.Set("spreadsheet_token", fmt.Sprint(spreadsheetToken))
return builder
}
// 子表 id
//
// 示例值:0b**12
func (builder *CreateSpreadsheetSheetFilterViewConditionReqBuilder) SheetId(sheetId string) *CreateSpreadsheetSheetFilterViewConditionReqBuilder {
builder.apiReq.PathParams.Set("sheet_id", fmt.Sprint(sheetId))
return builder
}
// 筛选视图 id
//
// 示例值:pH9hbVcCXA
func (builder *CreateSpreadsheetSheetFilterViewConditionReqBuilder) FilterViewId(filterViewId string) *CreateSpreadsheetSheetFilterViewConditionReqBuilder {
builder.apiReq.PathParams.Set("filter_view_id", fmt.Sprint(filterViewId))
return builder
}
// 在筛选视图的筛选范围的某一列创建筛选条件。
func (builder *CreateSpreadsheetSheetFilterViewConditionReqBuilder) FilterViewCondition(filterViewCondition *FilterViewCondition) *CreateSpreadsheetSheetFilterViewConditionReqBuilder {
builder.filterViewCondition = filterViewCondition
return builder
}
func (builder *CreateSpreadsheetSheetFilterViewConditionReqBuilder) Build() *CreateSpreadsheetSheetFilterViewConditionReq {
req := &CreateSpreadsheetSheetFilterViewConditionReq{}
req.apiReq = &larkcore.ApiReq{}
req.apiReq.PathParams = builder.apiReq.PathParams
req.apiReq.Body = builder.filterViewCondition
return req
}
type CreateSpreadsheetSheetFilterViewConditionReq struct {
apiReq *larkcore.ApiReq
FilterViewCondition *FilterViewCondition `body:""`
}
type CreateSpreadsheetSheetFilterViewConditionRespData struct {
Condition *FilterViewCondition `json:"condition,omitempty"` // 创建的筛选条件
}
type CreateSpreadsheetSheetFilterViewConditionResp struct {
*larkcore.ApiResp `json:"-"`
larkcore.CodeError
Data *CreateSpreadsheetSheetFilterViewConditionRespData `json:"data"` // 业务数据
}
func (resp *CreateSpreadsheetSheetFilterViewConditionResp) Success() bool {
return resp.Code == 0
}
type DeleteSpreadsheetSheetFilterViewConditionReqBuilder struct {
apiReq *larkcore.ApiReq
}
func NewDeleteSpreadsheetSheetFilterViewConditionReqBuilder() *DeleteSpreadsheetSheetFilterViewConditionReqBuilder {
builder := &DeleteSpreadsheetSheetFilterViewConditionReqBuilder{}
builder.apiReq = &larkcore.ApiReq{
PathParams: larkcore.PathParams{},
QueryParams: larkcore.QueryParams{},
}
return builder
}
// 表格 token
//
// 示例值:shtcnmBA*****yGehy8
func (builder *DeleteSpreadsheetSheetFilterViewConditionReqBuilder) SpreadsheetToken(spreadsheetToken string) *DeleteSpreadsheetSheetFilterViewConditionReqBuilder {
builder.apiReq.PathParams.Set("spreadsheet_token", fmt.Sprint(spreadsheetToken))
return builder
}
// 子表 id
//
// 示例值:0b**12
func (builder *DeleteSpreadsheetSheetFilterViewConditionReqBuilder) SheetId(sheetId string) *DeleteSpreadsheetSheetFilterViewConditionReqBuilder {
builder.apiReq.PathParams.Set("sheet_id", fmt.Sprint(sheetId))
return builder
}
// 筛选视图 id
//
// 示例值:pH9hbVcCXA
func (builder *DeleteSpreadsheetSheetFilterViewConditionReqBuilder) FilterViewId(filterViewId string) *DeleteSpreadsheetSheetFilterViewConditionReqBuilder {
builder.apiReq.PathParams.Set("filter_view_id", fmt.Sprint(filterViewId))
return builder
}
// 筛选范围内的某列字母号
//
// 示例值:E
func (builder *DeleteSpreadsheetSheetFilterViewConditionReqBuilder) ConditionId(conditionId string) *DeleteSpreadsheetSheetFilterViewConditionReqBuilder {
builder.apiReq.PathParams.Set("condition_id", fmt.Sprint(conditionId))
return builder
}
func (builder *DeleteSpreadsheetSheetFilterViewConditionReqBuilder) Build() *DeleteSpreadsheetSheetFilterViewConditionReq {
req := &DeleteSpreadsheetSheetFilterViewConditionReq{}
req.apiReq = &larkcore.ApiReq{}
req.apiReq.PathParams = builder.apiReq.PathParams
return req
}
type DeleteSpreadsheetSheetFilterViewConditionReq struct {
apiReq *larkcore.ApiReq
}
type DeleteSpreadsheetSheetFilterViewConditionResp struct {
*larkcore.ApiResp `json:"-"`
larkcore.CodeError
}
func (resp *DeleteSpreadsheetSheetFilterViewConditionResp) Success() bool {
return resp.Code == 0
}
type GetSpreadsheetSheetFilterViewConditionReqBuilder struct {
apiReq *larkcore.ApiReq
}
func NewGetSpreadsheetSheetFilterViewConditionReqBuilder() *GetSpreadsheetSheetFilterViewConditionReqBuilder {
builder := &GetSpreadsheetSheetFilterViewConditionReqBuilder{}
builder.apiReq = &larkcore.ApiReq{
PathParams: larkcore.PathParams{},
QueryParams: larkcore.QueryParams{},
}
return builder
}
// 表格 token
//
// 示例值:shtcnmBA*****yGehy8
func (builder *GetSpreadsheetSheetFilterViewConditionReqBuilder) SpreadsheetToken(spreadsheetToken string) *GetSpreadsheetSheetFilterViewConditionReqBuilder {
builder.apiReq.PathParams.Set("spreadsheet_token", fmt.Sprint(spreadsheetToken))
return builder
}
// 子表 id
//
// 示例值:0b**12
func (builder *GetSpreadsheetSheetFilterViewConditionReqBuilder) SheetId(sheetId string) *GetSpreadsheetSheetFilterViewConditionReqBuilder {
builder.apiReq.PathParams.Set("sheet_id", fmt.Sprint(sheetId))
return builder
}
// 筛选视图 id
//
// 示例值:pH9hbVcCXA
func (builder *GetSpreadsheetSheetFilterViewConditionReqBuilder) FilterViewId(filterViewId string) *GetSpreadsheetSheetFilterViewConditionReqBuilder {
builder.apiReq.PathParams.Set("filter_view_id", fmt.Sprint(filterViewId))
return builder
}
// 需要查询筛选条件的列字母号
//
// 示例值:E
func (builder *GetSpreadsheetSheetFilterViewConditionReqBuilder) ConditionId(conditionId string) *GetSpreadsheetSheetFilterViewConditionReqBuilder {
builder.apiReq.PathParams.Set("condition_id", fmt.Sprint(conditionId))
return builder
}
func (builder *GetSpreadsheetSheetFilterViewConditionReqBuilder) Build() *GetSpreadsheetSheetFilterViewConditionReq {
req := &GetSpreadsheetSheetFilterViewConditionReq{}
req.apiReq = &larkcore.ApiReq{}
req.apiReq.PathParams = builder.apiReq.PathParams
return req
}
type GetSpreadsheetSheetFilterViewConditionReq struct {
apiReq *larkcore.ApiReq
}
type GetSpreadsheetSheetFilterViewConditionRespData struct {
Condition *FilterViewCondition `json:"condition,omitempty"` // 筛选的条件
}
type GetSpreadsheetSheetFilterViewConditionResp struct {
*larkcore.ApiResp `json:"-"`
larkcore.CodeError
Data *GetSpreadsheetSheetFilterViewConditionRespData `json:"data"` // 业务数据
}
func (resp *GetSpreadsheetSheetFilterViewConditionResp) Success() bool {
return resp.Code == 0
}
type QuerySpreadsheetSheetFilterViewConditionReqBuilder struct {
apiReq *larkcore.ApiReq
}
func NewQuerySpreadsheetSheetFilterViewConditionReqBuilder() *QuerySpreadsheetSheetFilterViewConditionReqBuilder {
builder := &QuerySpreadsheetSheetFilterViewConditionReqBuilder{}
builder.apiReq = &larkcore.ApiReq{
PathParams: larkcore.PathParams{},
QueryParams: larkcore.QueryParams{},
}
return builder
}
// 表格 token
//
// 示例值:shtcnmBA*****yGehy8
func (builder *QuerySpreadsheetSheetFilterViewConditionReqBuilder) SpreadsheetToken(spreadsheetToken string) *QuerySpreadsheetSheetFilterViewConditionReqBuilder {
builder.apiReq.PathParams.Set("spreadsheet_token", fmt.Sprint(spreadsheetToken))
return builder
}
// 子表 id
//
// 示例值:0b**12
func (builder *QuerySpreadsheetSheetFilterViewConditionReqBuilder) SheetId(sheetId string) *QuerySpreadsheetSheetFilterViewConditionReqBuilder {
builder.apiReq.PathParams.Set("sheet_id", fmt.Sprint(sheetId))
return builder
}
// 筛选视图 id
//
// 示例值:pH9hbVcCXA
func (builder *QuerySpreadsheetSheetFilterViewConditionReqBuilder) FilterViewId(filterViewId string) *QuerySpreadsheetSheetFilterViewConditionReqBuilder {
builder.apiReq.PathParams.Set("filter_view_id", fmt.Sprint(filterViewId))
return builder
}
func (builder *QuerySpreadsheetSheetFilterViewConditionReqBuilder) Build() *QuerySpreadsheetSheetFilterViewConditionReq {
req := &QuerySpreadsheetSheetFilterViewConditionReq{}
req.apiReq = &larkcore.ApiReq{}
req.apiReq.PathParams = builder.apiReq.PathParams
return req
}
type QuerySpreadsheetSheetFilterViewConditionReq struct {
apiReq *larkcore.ApiReq
}
type QuerySpreadsheetSheetFilterViewConditionRespData struct {
Items []*FilterViewCondition `json:"items,omitempty"` // 筛选视图设置的所有筛选条件
}
type QuerySpreadsheetSheetFilterViewConditionResp struct {
*larkcore.ApiResp `json:"-"`
larkcore.CodeError
Data *QuerySpreadsheetSheetFilterViewConditionRespData `json:"data"` // 业务数据
}
func (resp *QuerySpreadsheetSheetFilterViewConditionResp) Success() bool {
return resp.Code == 0
}
type UpdateSpreadsheetSheetFilterViewConditionReqBuilder struct {
apiReq *larkcore.ApiReq
filterViewCondition *FilterViewCondition
}
func NewUpdateSpreadsheetSheetFilterViewConditionReqBuilder() *UpdateSpreadsheetSheetFilterViewConditionReqBuilder {
builder := &UpdateSpreadsheetSheetFilterViewConditionReqBuilder{}
builder.apiReq = &larkcore.ApiReq{
PathParams: larkcore.PathParams{},
QueryParams: larkcore.QueryParams{},
}
return builder
}
// 表格 token
//
// 示例值:shtcnmBA*****yGehy8
func (builder *UpdateSpreadsheetSheetFilterViewConditionReqBuilder) SpreadsheetToken(spreadsheetToken string) *UpdateSpreadsheetSheetFilterViewConditionReqBuilder {
builder.apiReq.PathParams.Set("spreadsheet_token", fmt.Sprint(spreadsheetToken))
return builder
}
// 子表 id
//
// 示例值:0b**12
func (builder *UpdateSpreadsheetSheetFilterViewConditionReqBuilder) SheetId(sheetId string) *UpdateSpreadsheetSheetFilterViewConditionReqBuilder {
builder.apiReq.PathParams.Set("sheet_id", fmt.Sprint(sheetId))
return builder
}
// 筛选视图 id
//
// 示例值:pH9hbVcCXA
func (builder *UpdateSpreadsheetSheetFilterViewConditionReqBuilder) FilterViewId(filterViewId string) *UpdateSpreadsheetSheetFilterViewConditionReqBuilder {
builder.apiReq.PathParams.Set("filter_view_id", fmt.Sprint(filterViewId))
return builder
}
// 列字母号
//
// 示例值:E
func (builder *UpdateSpreadsheetSheetFilterViewConditionReqBuilder) ConditionId(conditionId string) *UpdateSpreadsheetSheetFilterViewConditionReqBuilder {
builder.apiReq.PathParams.Set("condition_id", fmt.Sprint(conditionId))
return builder
}
// 更新筛选视图范围的某列的筛选条件,condition id 即为列的字母号。
func (builder *UpdateSpreadsheetSheetFilterViewConditionReqBuilder) FilterViewCondition(filterViewCondition *FilterViewCondition) *UpdateSpreadsheetSheetFilterViewConditionReqBuilder {
builder.filterViewCondition = filterViewCondition
return builder
}
func (builder *UpdateSpreadsheetSheetFilterViewConditionReqBuilder) Build() *UpdateSpreadsheetSheetFilterViewConditionReq {
req := &UpdateSpreadsheetSheetFilterViewConditionReq{}
req.apiReq = &larkcore.ApiReq{}
req.apiReq.PathParams = builder.apiReq.PathParams
req.apiReq.Body = builder.filterViewCondition
return req
}
type UpdateSpreadsheetSheetFilterViewConditionReq struct {
apiReq *larkcore.ApiReq
FilterViewCondition *FilterViewCondition `body:""`
}
type UpdateSpreadsheetSheetFilterViewConditionRespData struct {
Condition *FilterViewCondition `json:"condition,omitempty"` // 更新后的筛选条件
}
type UpdateSpreadsheetSheetFilterViewConditionResp struct {
*larkcore.ApiResp `json:"-"`
larkcore.CodeError
Data *UpdateSpreadsheetSheetFilterViewConditionRespData `json:"data"` // 业务数据
}
func (resp *UpdateSpreadsheetSheetFilterViewConditionResp) Success() bool {
return resp.Code == 0
}
type CreateSpreadsheetSheetFloatImageReqBuilder struct {
apiReq *larkcore.ApiReq
floatImage *FloatImage
}
func NewCreateSpreadsheetSheetFloatImageReqBuilder() *CreateSpreadsheetSheetFloatImageReqBuilder {
builder := &CreateSpreadsheetSheetFloatImageReqBuilder{}
builder.apiReq = &larkcore.ApiReq{
PathParams: larkcore.PathParams{},
QueryParams: larkcore.QueryParams{},
}
return builder
}
// 表格 token
//
// 示例值:shtcnmBA*****yGehy8
func (builder *CreateSpreadsheetSheetFloatImageReqBuilder) SpreadsheetToken(spreadsheetToken string) *CreateSpreadsheetSheetFloatImageReqBuilder {
builder.apiReq.PathParams.Set("spreadsheet_token", fmt.Sprint(spreadsheetToken))
return builder
}
// 子表 id
//
// 示例值:0b**12
func (builder *CreateSpreadsheetSheetFloatImageReqBuilder) SheetId(sheetId string) *CreateSpreadsheetSheetFloatImageReqBuilder {
builder.apiReq.PathParams.Set("sheet_id", fmt.Sprint(sheetId))
return builder
}
// 根据传入的参数创建一张浮动图片。Float_image_token ([上传图片至表格后得到](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_all))和range(只支持一个单元格) 必填。Float_image_id 可选,不填的话会默认生成,长度为10,由 0-9、a-z、A-Z 组合生成。表格内不重复的图片(浮动图片+单元格图片)总数不超过4000。width 和 height 为图片展示的宽高,可选,不填的话会使用图片的真实宽高。offset_x 和 offset_y 为图片左上角距离所在单元格左上角的偏移,可选,默认为 0。
func (builder *CreateSpreadsheetSheetFloatImageReqBuilder) FloatImage(floatImage *FloatImage) *CreateSpreadsheetSheetFloatImageReqBuilder {
builder.floatImage = floatImage
return builder
}
func (builder *CreateSpreadsheetSheetFloatImageReqBuilder) Build() *CreateSpreadsheetSheetFloatImageReq {
req := &CreateSpreadsheetSheetFloatImageReq{}
req.apiReq = &larkcore.ApiReq{}
req.apiReq.PathParams = builder.apiReq.PathParams
req.apiReq.Body = builder.floatImage
return req
}
type CreateSpreadsheetSheetFloatImageReq struct {
apiReq *larkcore.ApiReq
FloatImage *FloatImage `body:""`
}
type CreateSpreadsheetSheetFloatImageRespData struct {
FloatImage *FloatImage `json:"float_image,omitempty"` // 浮动图片返回值
}
type CreateSpreadsheetSheetFloatImageResp struct {
*larkcore.ApiResp `json:"-"`
larkcore.CodeError
Data *CreateSpreadsheetSheetFloatImageRespData `json:"data"` // 业务数据
}
func (resp *CreateSpreadsheetSheetFloatImageResp) Success() bool {
return resp.Code == 0
}
type DeleteSpreadsheetSheetFloatImageReqBuilder struct {
apiReq *larkcore.ApiReq
}
func NewDeleteSpreadsheetSheetFloatImageReqBuilder() *DeleteSpreadsheetSheetFloatImageReqBuilder {
builder := &DeleteSpreadsheetSheetFloatImageReqBuilder{}
builder.apiReq = &larkcore.ApiReq{
PathParams: larkcore.PathParams{},
QueryParams: larkcore.QueryParams{},
}
return builder
}
// 表格 token
//
// 示例值:shtcnmBA*****yGehy8
func (builder *DeleteSpreadsheetSheetFloatImageReqBuilder) SpreadsheetToken(spreadsheetToken string) *DeleteSpreadsheetSheetFloatImageReqBuilder {
builder.apiReq.PathParams.Set("spreadsheet_token", fmt.Sprint(spreadsheetToken))
return builder
}
// 子表 id
//
// 示例值:0b**12
func (builder *DeleteSpreadsheetSheetFloatImageReqBuilder) SheetId(sheetId string) *DeleteSpreadsheetSheetFloatImageReqBuilder {
builder.apiReq.PathParams.Set("sheet_id", fmt.Sprint(sheetId))
return builder
}
// 浮动图片 id
//
// 示例值:ye06SS14ph
func (builder *DeleteSpreadsheetSheetFloatImageReqBuilder) FloatImageId(floatImageId string) *DeleteSpreadsheetSheetFloatImageReqBuilder {
builder.apiReq.PathParams.Set("float_image_id", fmt.Sprint(floatImageId))
return builder
}
func (builder *DeleteSpreadsheetSheetFloatImageReqBuilder) Build() *DeleteSpreadsheetSheetFloatImageReq {
req := &DeleteSpreadsheetSheetFloatImageReq{}
req.apiReq = &larkcore.ApiReq{}
req.apiReq.PathParams = builder.apiReq.PathParams
return req
}
type DeleteSpreadsheetSheetFloatImageReq struct {
apiReq *larkcore.ApiReq
}
type DeleteSpreadsheetSheetFloatImageResp struct {
*larkcore.ApiResp `json:"-"`
larkcore.CodeError
}
func (resp *DeleteSpreadsheetSheetFloatImageResp) Success() bool {
return resp.Code == 0
}
type GetSpreadsheetSheetFloatImageReqBuilder struct {
apiReq *larkcore.ApiReq
}
func NewGetSpreadsheetSheetFloatImageReqBuilder() *GetSpreadsheetSheetFloatImageReqBuilder {
builder := &GetSpreadsheetSheetFloatImageReqBuilder{}
builder.apiReq = &larkcore.ApiReq{
PathParams: larkcore.PathParams{},
QueryParams: larkcore.QueryParams{},
}
return builder
}
// 表格 token
//
// 示例值:shtcnmBA*****yGehy8
func (builder *GetSpreadsheetSheetFloatImageReqBuilder) SpreadsheetToken(spreadsheetToken string) *GetSpreadsheetSheetFloatImageReqBuilder {
builder.apiReq.PathParams.Set("spreadsheet_token", fmt.Sprint(spreadsheetToken))
return builder
}
// 子表 id
//
// 示例值:0b**12
func (builder *GetSpreadsheetSheetFloatImageReqBuilder) SheetId(sheetId string) *GetSpreadsheetSheetFloatImageReqBuilder {
builder.apiReq.PathParams.Set("sheet_id", fmt.Sprint(sheetId))
return builder
}
// 浮动图片 id
//
// 示例值:ye06SS14ph
func (builder *GetSpreadsheetSheetFloatImageReqBuilder) FloatImageId(floatImageId string) *GetSpreadsheetSheetFloatImageReqBuilder {
builder.apiReq.PathParams.Set("float_image_id", fmt.Sprint(floatImageId))
return builder
}
func (builder *GetSpreadsheetSheetFloatImageReqBuilder) Build() *GetSpreadsheetSheetFloatImageReq {
req := &GetSpreadsheetSheetFloatImageReq{}
req.apiReq = &larkcore.ApiReq{}
req.apiReq.PathParams = builder.apiReq.PathParams
return req
}
type GetSpreadsheetSheetFloatImageReq struct {
apiReq *larkcore.ApiReq
}
type GetSpreadsheetSheetFloatImageRespData struct {
FloatImage *FloatImage `json:"float_image,omitempty"` // 浮动图片信息
}
type GetSpreadsheetSheetFloatImageResp struct {
*larkcore.ApiResp `json:"-"`
larkcore.CodeError
Data *GetSpreadsheetSheetFloatImageRespData `json:"data"` // 业务数据
}
func (resp *GetSpreadsheetSheetFloatImageResp) Success() bool {
return resp.Code == 0
}
type PatchSpreadsheetSheetFloatImageReqBuilder struct {
apiReq *larkcore.ApiReq
floatImage *FloatImage
}
func NewPatchSpreadsheetSheetFloatImageReqBuilder() *PatchSpreadsheetSheetFloatImageReqBuilder {
builder := &PatchSpreadsheetSheetFloatImageReqBuilder{}
builder.apiReq = &larkcore.ApiReq{
PathParams: larkcore.PathParams{},
QueryParams: larkcore.QueryParams{},
}
return builder
}
// 表格 token
//
// 示例值:shtcnmBA*****yGehy8
func (builder *PatchSpreadsheetSheetFloatImageReqBuilder) SpreadsheetToken(spreadsheetToken string) *PatchSpreadsheetSheetFloatImageReqBuilder {
builder.apiReq.PathParams.Set("spreadsheet_token", fmt.Sprint(spreadsheetToken))
return builder
}
// 子表 id
//
// 示例值:0b**12
func (builder *PatchSpreadsheetSheetFloatImageReqBuilder) SheetId(sheetId string) *PatchSpreadsheetSheetFloatImageReqBuilder {
builder.apiReq.PathParams.Set("sheet_id", fmt.Sprint(sheetId))
return builder
}
// 浮动图片 id
//
// 示例值:ye06SS14ph
func (builder *PatchSpreadsheetSheetFloatImageReqBuilder) FloatImageId(floatImageId string) *PatchSpreadsheetSheetFloatImageReqBuilder {
builder.apiReq.PathParams.Set("float_image_id", fmt.Sprint(floatImageId))
return builder
}
// 更新已有的浮动图片位置和宽高,包括 range、width、height、offset_x 和 offset_y,不包括 float_image_id 和 float_image_token。
func (builder *PatchSpreadsheetSheetFloatImageReqBuilder) FloatImage(floatImage *FloatImage) *PatchSpreadsheetSheetFloatImageReqBuilder {
builder.floatImage = floatImage
return builder
}
func (builder *PatchSpreadsheetSheetFloatImageReqBuilder) Build() *PatchSpreadsheetSheetFloatImageReq {
req := &PatchSpreadsheetSheetFloatImageReq{}
req.apiReq = &larkcore.ApiReq{}
req.apiReq.PathParams = builder.apiReq.PathParams
req.apiReq.Body = builder.floatImage
return req
}
type PatchSpreadsheetSheetFloatImageReq struct {
apiReq *larkcore.ApiReq
FloatImage *FloatImage `body:""`
}
type PatchSpreadsheetSheetFloatImageRespData struct {
FloatImage *FloatImage `json:"float_image,omitempty"` // 浮动图片信息
}
type PatchSpreadsheetSheetFloatImageResp struct {
*larkcore.ApiResp `json:"-"`
larkcore.CodeError
Data *PatchSpreadsheetSheetFloatImageRespData `json:"data"` // 业务数据
}
func (resp *PatchSpreadsheetSheetFloatImageResp) Success() bool {
return resp.Code == 0
}
type QuerySpreadsheetSheetFloatImageReqBuilder struct {
apiReq *larkcore.ApiReq
}
func NewQuerySpreadsheetSheetFloatImageReqBuilder() *QuerySpreadsheetSheetFloatImageReqBuilder {
builder := &QuerySpreadsheetSheetFloatImageReqBuilder{}
builder.apiReq = &larkcore.ApiReq{
PathParams: larkcore.PathParams{},
QueryParams: larkcore.QueryParams{},
}
return builder
}
// 表格 token
//
// 示例值:shtcnmBA*****yGehy8
func (builder *QuerySpreadsheetSheetFloatImageReqBuilder) SpreadsheetToken(spreadsheetToken string) *QuerySpreadsheetSheetFloatImageReqBuilder {
builder.apiReq.PathParams.Set("spreadsheet_token", fmt.Sprint(spreadsheetToken))
return builder
}
// 子表 id
//
// 示例值:0b**12
func (builder *QuerySpreadsheetSheetFloatImageReqBuilder) SheetId(sheetId string) *QuerySpreadsheetSheetFloatImageReqBuilder {
builder.apiReq.PathParams.Set("sheet_id", fmt.Sprint(sheetId))
return builder
}
func (builder *QuerySpreadsheetSheetFloatImageReqBuilder) Build() *QuerySpreadsheetSheetFloatImageReq {
req := &QuerySpreadsheetSheetFloatImageReq{}
req.apiReq = &larkcore.ApiReq{}
req.apiReq.PathParams = builder.apiReq.PathParams
return req
}
type QuerySpreadsheetSheetFloatImageReq struct {
apiReq *larkcore.ApiReq
}
type QuerySpreadsheetSheetFloatImageRespData struct {
Items []*FloatImage `json:"items,omitempty"` // 子表的所有浮动图片信息
}
type QuerySpreadsheetSheetFloatImageResp struct {
*larkcore.ApiResp `json:"-"`
larkcore.CodeError
Data *QuerySpreadsheetSheetFloatImageRespData `json:"data"` // 业务数据
}
func (resp *QuerySpreadsheetSheetFloatImageResp) Success() bool {
return resp.Code == 0
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhuhukun/oapi-sdk-go.git
git@gitee.com:zhuhukun/oapi-sdk-go.git
zhuhukun
oapi-sdk-go
oapi-sdk-go
v3.4.51

搜索帮助