| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871 |
- // Code generated by ent, DO NOT EDIT.
- package ent
- import (
- "context"
- "encoding/json/jsontext"
- "errors"
- "fmt"
- "time"
- "entgo.io/ent/dialect/sql"
- "entgo.io/ent/dialect/sql/sqlgraph"
- "entgo.io/ent/schema/field"
- "github.com/Wei-Shaw/sub2api/ent/account"
- "github.com/Wei-Shaw/sub2api/ent/apikey"
- "github.com/Wei-Shaw/sub2api/ent/group"
- "github.com/Wei-Shaw/sub2api/ent/redeemcode"
- "github.com/Wei-Shaw/sub2api/ent/usagelog"
- "github.com/Wei-Shaw/sub2api/ent/user"
- "github.com/Wei-Shaw/sub2api/ent/usersubscription"
- "github.com/Wei-Shaw/sub2api/internal/domain"
- )
- // GroupCreate is the builder for creating a Group entity.
- type GroupCreate struct {
- config
- mutation *GroupMutation
- hooks []Hook
- conflict []sql.ConflictOption
- }
- // SetCreatedAt sets the "created_at" field.
- func (_c *GroupCreate) SetCreatedAt(v time.Time) *GroupCreate {
- _c.mutation.SetCreatedAt(v)
- return _c
- }
- // SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableCreatedAt(v *time.Time) *GroupCreate {
- if v != nil {
- _c.SetCreatedAt(*v)
- }
- return _c
- }
- // SetUpdatedAt sets the "updated_at" field.
- func (_c *GroupCreate) SetUpdatedAt(v time.Time) *GroupCreate {
- _c.mutation.SetUpdatedAt(v)
- return _c
- }
- // SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableUpdatedAt(v *time.Time) *GroupCreate {
- if v != nil {
- _c.SetUpdatedAt(*v)
- }
- return _c
- }
- // SetDeletedAt sets the "deleted_at" field.
- func (_c *GroupCreate) SetDeletedAt(v time.Time) *GroupCreate {
- _c.mutation.SetDeletedAt(v)
- return _c
- }
- // SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableDeletedAt(v *time.Time) *GroupCreate {
- if v != nil {
- _c.SetDeletedAt(*v)
- }
- return _c
- }
- // SetName sets the "name" field.
- func (_c *GroupCreate) SetName(v string) *GroupCreate {
- _c.mutation.SetName(v)
- return _c
- }
- // SetDescription sets the "description" field.
- func (_c *GroupCreate) SetDescription(v string) *GroupCreate {
- _c.mutation.SetDescription(v)
- return _c
- }
- // SetNillableDescription sets the "description" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableDescription(v *string) *GroupCreate {
- if v != nil {
- _c.SetDescription(*v)
- }
- return _c
- }
- // SetRateMultiplier sets the "rate_multiplier" field.
- func (_c *GroupCreate) SetRateMultiplier(v float64) *GroupCreate {
- _c.mutation.SetRateMultiplier(v)
- return _c
- }
- // SetNillableRateMultiplier sets the "rate_multiplier" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableRateMultiplier(v *float64) *GroupCreate {
- if v != nil {
- _c.SetRateMultiplier(*v)
- }
- return _c
- }
- // SetPeakRateEnabled sets the "peak_rate_enabled" field.
- func (_c *GroupCreate) SetPeakRateEnabled(v bool) *GroupCreate {
- _c.mutation.SetPeakRateEnabled(v)
- return _c
- }
- // SetNillablePeakRateEnabled sets the "peak_rate_enabled" field if the given value is not nil.
- func (_c *GroupCreate) SetNillablePeakRateEnabled(v *bool) *GroupCreate {
- if v != nil {
- _c.SetPeakRateEnabled(*v)
- }
- return _c
- }
- // SetPeakStart sets the "peak_start" field.
- func (_c *GroupCreate) SetPeakStart(v string) *GroupCreate {
- _c.mutation.SetPeakStart(v)
- return _c
- }
- // SetNillablePeakStart sets the "peak_start" field if the given value is not nil.
- func (_c *GroupCreate) SetNillablePeakStart(v *string) *GroupCreate {
- if v != nil {
- _c.SetPeakStart(*v)
- }
- return _c
- }
- // SetPeakEnd sets the "peak_end" field.
- func (_c *GroupCreate) SetPeakEnd(v string) *GroupCreate {
- _c.mutation.SetPeakEnd(v)
- return _c
- }
- // SetNillablePeakEnd sets the "peak_end" field if the given value is not nil.
- func (_c *GroupCreate) SetNillablePeakEnd(v *string) *GroupCreate {
- if v != nil {
- _c.SetPeakEnd(*v)
- }
- return _c
- }
- // SetPeakRateMultiplier sets the "peak_rate_multiplier" field.
- func (_c *GroupCreate) SetPeakRateMultiplier(v float64) *GroupCreate {
- _c.mutation.SetPeakRateMultiplier(v)
- return _c
- }
- // SetNillablePeakRateMultiplier sets the "peak_rate_multiplier" field if the given value is not nil.
- func (_c *GroupCreate) SetNillablePeakRateMultiplier(v *float64) *GroupCreate {
- if v != nil {
- _c.SetPeakRateMultiplier(*v)
- }
- return _c
- }
- // SetIsExclusive sets the "is_exclusive" field.
- func (_c *GroupCreate) SetIsExclusive(v bool) *GroupCreate {
- _c.mutation.SetIsExclusive(v)
- return _c
- }
- // SetNillableIsExclusive sets the "is_exclusive" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableIsExclusive(v *bool) *GroupCreate {
- if v != nil {
- _c.SetIsExclusive(*v)
- }
- return _c
- }
- // SetSecurityPolicyEnabled sets the "security_policy_enabled" field.
- func (_c *GroupCreate) SetSecurityPolicyEnabled(v bool) *GroupCreate {
- _c.mutation.SetSecurityPolicyEnabled(v)
- return _c
- }
- // SetNillableSecurityPolicyEnabled sets the "security_policy_enabled" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableSecurityPolicyEnabled(v *bool) *GroupCreate {
- if v != nil {
- _c.SetSecurityPolicyEnabled(*v)
- }
- return _c
- }
- // SetSecurityPolicyMode sets the "security_policy_mode" field.
- func (_c *GroupCreate) SetSecurityPolicyMode(v string) *GroupCreate {
- _c.mutation.SetSecurityPolicyMode(v)
- return _c
- }
- // SetNillableSecurityPolicyMode sets the "security_policy_mode" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableSecurityPolicyMode(v *string) *GroupCreate {
- if v != nil {
- _c.SetSecurityPolicyMode(*v)
- }
- return _c
- }
- // SetSecurityPolicyEmailEnabled sets the "security_policy_email_enabled" field.
- func (_c *GroupCreate) SetSecurityPolicyEmailEnabled(v bool) *GroupCreate {
- _c.mutation.SetSecurityPolicyEmailEnabled(v)
- return _c
- }
- // SetNillableSecurityPolicyEmailEnabled sets the "security_policy_email_enabled" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableSecurityPolicyEmailEnabled(v *bool) *GroupCreate {
- if v != nil {
- _c.SetSecurityPolicyEmailEnabled(*v)
- }
- return _c
- }
- // SetStatus sets the "status" field.
- func (_c *GroupCreate) SetStatus(v string) *GroupCreate {
- _c.mutation.SetStatus(v)
- return _c
- }
- // SetNillableStatus sets the "status" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableStatus(v *string) *GroupCreate {
- if v != nil {
- _c.SetStatus(*v)
- }
- return _c
- }
- // SetDuplicateOperationID sets the "duplicate_operation_id" field.
- func (_c *GroupCreate) SetDuplicateOperationID(v string) *GroupCreate {
- _c.mutation.SetDuplicateOperationID(v)
- return _c
- }
- // SetNillableDuplicateOperationID sets the "duplicate_operation_id" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableDuplicateOperationID(v *string) *GroupCreate {
- if v != nil {
- _c.SetDuplicateOperationID(*v)
- }
- return _c
- }
- // SetPlatform sets the "platform" field.
- func (_c *GroupCreate) SetPlatform(v string) *GroupCreate {
- _c.mutation.SetPlatform(v)
- return _c
- }
- // SetNillablePlatform sets the "platform" field if the given value is not nil.
- func (_c *GroupCreate) SetNillablePlatform(v *string) *GroupCreate {
- if v != nil {
- _c.SetPlatform(*v)
- }
- return _c
- }
- // SetSubscriptionType sets the "subscription_type" field.
- func (_c *GroupCreate) SetSubscriptionType(v string) *GroupCreate {
- _c.mutation.SetSubscriptionType(v)
- return _c
- }
- // SetNillableSubscriptionType sets the "subscription_type" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableSubscriptionType(v *string) *GroupCreate {
- if v != nil {
- _c.SetSubscriptionType(*v)
- }
- return _c
- }
- // SetDailyLimitUsd sets the "daily_limit_usd" field.
- func (_c *GroupCreate) SetDailyLimitUsd(v float64) *GroupCreate {
- _c.mutation.SetDailyLimitUsd(v)
- return _c
- }
- // SetNillableDailyLimitUsd sets the "daily_limit_usd" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableDailyLimitUsd(v *float64) *GroupCreate {
- if v != nil {
- _c.SetDailyLimitUsd(*v)
- }
- return _c
- }
- // SetWeeklyLimitUsd sets the "weekly_limit_usd" field.
- func (_c *GroupCreate) SetWeeklyLimitUsd(v float64) *GroupCreate {
- _c.mutation.SetWeeklyLimitUsd(v)
- return _c
- }
- // SetNillableWeeklyLimitUsd sets the "weekly_limit_usd" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableWeeklyLimitUsd(v *float64) *GroupCreate {
- if v != nil {
- _c.SetWeeklyLimitUsd(*v)
- }
- return _c
- }
- // SetMonthlyLimitUsd sets the "monthly_limit_usd" field.
- func (_c *GroupCreate) SetMonthlyLimitUsd(v float64) *GroupCreate {
- _c.mutation.SetMonthlyLimitUsd(v)
- return _c
- }
- // SetNillableMonthlyLimitUsd sets the "monthly_limit_usd" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableMonthlyLimitUsd(v *float64) *GroupCreate {
- if v != nil {
- _c.SetMonthlyLimitUsd(*v)
- }
- return _c
- }
- // SetDefaultValidityDays sets the "default_validity_days" field.
- func (_c *GroupCreate) SetDefaultValidityDays(v int) *GroupCreate {
- _c.mutation.SetDefaultValidityDays(v)
- return _c
- }
- // SetNillableDefaultValidityDays sets the "default_validity_days" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableDefaultValidityDays(v *int) *GroupCreate {
- if v != nil {
- _c.SetDefaultValidityDays(*v)
- }
- return _c
- }
- // SetAllowImageGeneration sets the "allow_image_generation" field.
- func (_c *GroupCreate) SetAllowImageGeneration(v bool) *GroupCreate {
- _c.mutation.SetAllowImageGeneration(v)
- return _c
- }
- // SetNillableAllowImageGeneration sets the "allow_image_generation" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableAllowImageGeneration(v *bool) *GroupCreate {
- if v != nil {
- _c.SetAllowImageGeneration(*v)
- }
- return _c
- }
- // SetAllowBatchImageGeneration sets the "allow_batch_image_generation" field.
- func (_c *GroupCreate) SetAllowBatchImageGeneration(v bool) *GroupCreate {
- _c.mutation.SetAllowBatchImageGeneration(v)
- return _c
- }
- // SetNillableAllowBatchImageGeneration sets the "allow_batch_image_generation" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableAllowBatchImageGeneration(v *bool) *GroupCreate {
- if v != nil {
- _c.SetAllowBatchImageGeneration(*v)
- }
- return _c
- }
- // SetImageRateIndependent sets the "image_rate_independent" field.
- func (_c *GroupCreate) SetImageRateIndependent(v bool) *GroupCreate {
- _c.mutation.SetImageRateIndependent(v)
- return _c
- }
- // SetNillableImageRateIndependent sets the "image_rate_independent" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableImageRateIndependent(v *bool) *GroupCreate {
- if v != nil {
- _c.SetImageRateIndependent(*v)
- }
- return _c
- }
- // SetImageRateMultiplier sets the "image_rate_multiplier" field.
- func (_c *GroupCreate) SetImageRateMultiplier(v float64) *GroupCreate {
- _c.mutation.SetImageRateMultiplier(v)
- return _c
- }
- // SetNillableImageRateMultiplier sets the "image_rate_multiplier" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableImageRateMultiplier(v *float64) *GroupCreate {
- if v != nil {
- _c.SetImageRateMultiplier(*v)
- }
- return _c
- }
- // SetImagePrice1k sets the "image_price_1k" field.
- func (_c *GroupCreate) SetImagePrice1k(v float64) *GroupCreate {
- _c.mutation.SetImagePrice1k(v)
- return _c
- }
- // SetNillableImagePrice1k sets the "image_price_1k" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableImagePrice1k(v *float64) *GroupCreate {
- if v != nil {
- _c.SetImagePrice1k(*v)
- }
- return _c
- }
- // SetImagePrice2k sets the "image_price_2k" field.
- func (_c *GroupCreate) SetImagePrice2k(v float64) *GroupCreate {
- _c.mutation.SetImagePrice2k(v)
- return _c
- }
- // SetNillableImagePrice2k sets the "image_price_2k" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableImagePrice2k(v *float64) *GroupCreate {
- if v != nil {
- _c.SetImagePrice2k(*v)
- }
- return _c
- }
- // SetImagePrice4k sets the "image_price_4k" field.
- func (_c *GroupCreate) SetImagePrice4k(v float64) *GroupCreate {
- _c.mutation.SetImagePrice4k(v)
- return _c
- }
- // SetNillableImagePrice4k sets the "image_price_4k" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableImagePrice4k(v *float64) *GroupCreate {
- if v != nil {
- _c.SetImagePrice4k(*v)
- }
- return _c
- }
- // SetBatchImageDiscountMultiplier sets the "batch_image_discount_multiplier" field.
- func (_c *GroupCreate) SetBatchImageDiscountMultiplier(v float64) *GroupCreate {
- _c.mutation.SetBatchImageDiscountMultiplier(v)
- return _c
- }
- // SetNillableBatchImageDiscountMultiplier sets the "batch_image_discount_multiplier" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableBatchImageDiscountMultiplier(v *float64) *GroupCreate {
- if v != nil {
- _c.SetBatchImageDiscountMultiplier(*v)
- }
- return _c
- }
- // SetBatchImageHoldMultiplier sets the "batch_image_hold_multiplier" field.
- func (_c *GroupCreate) SetBatchImageHoldMultiplier(v float64) *GroupCreate {
- _c.mutation.SetBatchImageHoldMultiplier(v)
- return _c
- }
- // SetNillableBatchImageHoldMultiplier sets the "batch_image_hold_multiplier" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableBatchImageHoldMultiplier(v *float64) *GroupCreate {
- if v != nil {
- _c.SetBatchImageHoldMultiplier(*v)
- }
- return _c
- }
- // SetVideoRateIndependent sets the "video_rate_independent" field.
- func (_c *GroupCreate) SetVideoRateIndependent(v bool) *GroupCreate {
- _c.mutation.SetVideoRateIndependent(v)
- return _c
- }
- // SetNillableVideoRateIndependent sets the "video_rate_independent" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableVideoRateIndependent(v *bool) *GroupCreate {
- if v != nil {
- _c.SetVideoRateIndependent(*v)
- }
- return _c
- }
- // SetVideoRateMultiplier sets the "video_rate_multiplier" field.
- func (_c *GroupCreate) SetVideoRateMultiplier(v float64) *GroupCreate {
- _c.mutation.SetVideoRateMultiplier(v)
- return _c
- }
- // SetNillableVideoRateMultiplier sets the "video_rate_multiplier" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableVideoRateMultiplier(v *float64) *GroupCreate {
- if v != nil {
- _c.SetVideoRateMultiplier(*v)
- }
- return _c
- }
- // SetVideoPrice480p sets the "video_price_480p" field.
- func (_c *GroupCreate) SetVideoPrice480p(v float64) *GroupCreate {
- _c.mutation.SetVideoPrice480p(v)
- return _c
- }
- // SetNillableVideoPrice480p sets the "video_price_480p" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableVideoPrice480p(v *float64) *GroupCreate {
- if v != nil {
- _c.SetVideoPrice480p(*v)
- }
- return _c
- }
- // SetVideoPrice720p sets the "video_price_720p" field.
- func (_c *GroupCreate) SetVideoPrice720p(v float64) *GroupCreate {
- _c.mutation.SetVideoPrice720p(v)
- return _c
- }
- // SetNillableVideoPrice720p sets the "video_price_720p" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableVideoPrice720p(v *float64) *GroupCreate {
- if v != nil {
- _c.SetVideoPrice720p(*v)
- }
- return _c
- }
- // SetVideoPrice1080p sets the "video_price_1080p" field.
- func (_c *GroupCreate) SetVideoPrice1080p(v float64) *GroupCreate {
- _c.mutation.SetVideoPrice1080p(v)
- return _c
- }
- // SetNillableVideoPrice1080p sets the "video_price_1080p" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableVideoPrice1080p(v *float64) *GroupCreate {
- if v != nil {
- _c.SetVideoPrice1080p(*v)
- }
- return _c
- }
- // SetVideoModelPrices sets the "video_model_prices" field.
- func (_c *GroupCreate) SetVideoModelPrices(v map[string]map[string]float64) *GroupCreate {
- _c.mutation.SetVideoModelPrices(v)
- return _c
- }
- // SetWebSearchPricePerCall sets the "web_search_price_per_call" field.
- func (_c *GroupCreate) SetWebSearchPricePerCall(v float64) *GroupCreate {
- _c.mutation.SetWebSearchPricePerCall(v)
- return _c
- }
- // SetNillableWebSearchPricePerCall sets the "web_search_price_per_call" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableWebSearchPricePerCall(v *float64) *GroupCreate {
- if v != nil {
- _c.SetWebSearchPricePerCall(*v)
- }
- return _c
- }
- // SetSearchPricePer1k sets the "search_price_per_1k" field.
- func (_c *GroupCreate) SetSearchPricePer1k(v float64) *GroupCreate {
- _c.mutation.SetSearchPricePer1k(v)
- return _c
- }
- // SetNillableSearchPricePer1k sets the "search_price_per_1k" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableSearchPricePer1k(v *float64) *GroupCreate {
- if v != nil {
- _c.SetSearchPricePer1k(*v)
- }
- return _c
- }
- // SetAudioRealtimePricePerMin sets the "audio_realtime_price_per_min" field.
- func (_c *GroupCreate) SetAudioRealtimePricePerMin(v float64) *GroupCreate {
- _c.mutation.SetAudioRealtimePricePerMin(v)
- return _c
- }
- // SetNillableAudioRealtimePricePerMin sets the "audio_realtime_price_per_min" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableAudioRealtimePricePerMin(v *float64) *GroupCreate {
- if v != nil {
- _c.SetAudioRealtimePricePerMin(*v)
- }
- return _c
- }
- // SetAudioTtsPricePerMillionChars sets the "audio_tts_price_per_million_chars" field.
- func (_c *GroupCreate) SetAudioTtsPricePerMillionChars(v float64) *GroupCreate {
- _c.mutation.SetAudioTtsPricePerMillionChars(v)
- return _c
- }
- // SetNillableAudioTtsPricePerMillionChars sets the "audio_tts_price_per_million_chars" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableAudioTtsPricePerMillionChars(v *float64) *GroupCreate {
- if v != nil {
- _c.SetAudioTtsPricePerMillionChars(*v)
- }
- return _c
- }
- // SetAudioSttPricePerHour sets the "audio_stt_price_per_hour" field.
- func (_c *GroupCreate) SetAudioSttPricePerHour(v float64) *GroupCreate {
- _c.mutation.SetAudioSttPricePerHour(v)
- return _c
- }
- // SetNillableAudioSttPricePerHour sets the "audio_stt_price_per_hour" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableAudioSttPricePerHour(v *float64) *GroupCreate {
- if v != nil {
- _c.SetAudioSttPricePerHour(*v)
- }
- return _c
- }
- // SetLongContextPricingEnabled sets the "long_context_pricing_enabled" field.
- func (_c *GroupCreate) SetLongContextPricingEnabled(v bool) *GroupCreate {
- _c.mutation.SetLongContextPricingEnabled(v)
- return _c
- }
- // SetNillableLongContextPricingEnabled sets the "long_context_pricing_enabled" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableLongContextPricingEnabled(v *bool) *GroupCreate {
- if v != nil {
- _c.SetLongContextPricingEnabled(*v)
- }
- return _c
- }
- // SetModelPricing sets the "model_pricing" field.
- func (_c *GroupCreate) SetModelPricing(v jsontext.Value) *GroupCreate {
- _c.mutation.SetModelPricing(v)
- return _c
- }
- // SetClaudeCodeOnly sets the "claude_code_only" field.
- func (_c *GroupCreate) SetClaudeCodeOnly(v bool) *GroupCreate {
- _c.mutation.SetClaudeCodeOnly(v)
- return _c
- }
- // SetNillableClaudeCodeOnly sets the "claude_code_only" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableClaudeCodeOnly(v *bool) *GroupCreate {
- if v != nil {
- _c.SetClaudeCodeOnly(*v)
- }
- return _c
- }
- // SetFallbackGroupID sets the "fallback_group_id" field.
- func (_c *GroupCreate) SetFallbackGroupID(v int64) *GroupCreate {
- _c.mutation.SetFallbackGroupID(v)
- return _c
- }
- // SetNillableFallbackGroupID sets the "fallback_group_id" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableFallbackGroupID(v *int64) *GroupCreate {
- if v != nil {
- _c.SetFallbackGroupID(*v)
- }
- return _c
- }
- // SetFallbackGroupIDOnInvalidRequest sets the "fallback_group_id_on_invalid_request" field.
- func (_c *GroupCreate) SetFallbackGroupIDOnInvalidRequest(v int64) *GroupCreate {
- _c.mutation.SetFallbackGroupIDOnInvalidRequest(v)
- return _c
- }
- // SetNillableFallbackGroupIDOnInvalidRequest sets the "fallback_group_id_on_invalid_request" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableFallbackGroupIDOnInvalidRequest(v *int64) *GroupCreate {
- if v != nil {
- _c.SetFallbackGroupIDOnInvalidRequest(*v)
- }
- return _c
- }
- // SetModelRouting sets the "model_routing" field.
- func (_c *GroupCreate) SetModelRouting(v map[string][]int64) *GroupCreate {
- _c.mutation.SetModelRouting(v)
- return _c
- }
- // SetModelRoutingEnabled sets the "model_routing_enabled" field.
- func (_c *GroupCreate) SetModelRoutingEnabled(v bool) *GroupCreate {
- _c.mutation.SetModelRoutingEnabled(v)
- return _c
- }
- // SetNillableModelRoutingEnabled sets the "model_routing_enabled" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableModelRoutingEnabled(v *bool) *GroupCreate {
- if v != nil {
- _c.SetModelRoutingEnabled(*v)
- }
- return _c
- }
- // SetMcpXMLInject sets the "mcp_xml_inject" field.
- func (_c *GroupCreate) SetMcpXMLInject(v bool) *GroupCreate {
- _c.mutation.SetMcpXMLInject(v)
- return _c
- }
- // SetNillableMcpXMLInject sets the "mcp_xml_inject" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableMcpXMLInject(v *bool) *GroupCreate {
- if v != nil {
- _c.SetMcpXMLInject(*v)
- }
- return _c
- }
- // SetSupportedModelScopes sets the "supported_model_scopes" field.
- func (_c *GroupCreate) SetSupportedModelScopes(v []string) *GroupCreate {
- _c.mutation.SetSupportedModelScopes(v)
- return _c
- }
- // SetSortOrder sets the "sort_order" field.
- func (_c *GroupCreate) SetSortOrder(v int) *GroupCreate {
- _c.mutation.SetSortOrder(v)
- return _c
- }
- // SetNillableSortOrder sets the "sort_order" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableSortOrder(v *int) *GroupCreate {
- if v != nil {
- _c.SetSortOrder(*v)
- }
- return _c
- }
- // SetAllowMessagesDispatch sets the "allow_messages_dispatch" field.
- func (_c *GroupCreate) SetAllowMessagesDispatch(v bool) *GroupCreate {
- _c.mutation.SetAllowMessagesDispatch(v)
- return _c
- }
- // SetNillableAllowMessagesDispatch sets the "allow_messages_dispatch" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableAllowMessagesDispatch(v *bool) *GroupCreate {
- if v != nil {
- _c.SetAllowMessagesDispatch(*v)
- }
- return _c
- }
- // SetAllowLive sets the "allow_live" field.
- func (_c *GroupCreate) SetAllowLive(v bool) *GroupCreate {
- _c.mutation.SetAllowLive(v)
- return _c
- }
- // SetNillableAllowLive sets the "allow_live" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableAllowLive(v *bool) *GroupCreate {
- if v != nil {
- _c.SetAllowLive(*v)
- }
- return _c
- }
- // SetForceOpenaiFast sets the "force_openai_fast" field.
- func (_c *GroupCreate) SetForceOpenaiFast(v bool) *GroupCreate {
- _c.mutation.SetForceOpenaiFast(v)
- return _c
- }
- // SetNillableForceOpenaiFast sets the "force_openai_fast" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableForceOpenaiFast(v *bool) *GroupCreate {
- if v != nil {
- _c.SetForceOpenaiFast(*v)
- }
- return _c
- }
- // SetFreeOpenaiFast sets the "free_openai_fast" field.
- func (_c *GroupCreate) SetFreeOpenaiFast(v bool) *GroupCreate {
- _c.mutation.SetFreeOpenaiFast(v)
- return _c
- }
- // SetNillableFreeOpenaiFast sets the "free_openai_fast" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableFreeOpenaiFast(v *bool) *GroupCreate {
- if v != nil {
- _c.SetFreeOpenaiFast(*v)
- }
- return _c
- }
- // SetRequireOauthOnly sets the "require_oauth_only" field.
- func (_c *GroupCreate) SetRequireOauthOnly(v bool) *GroupCreate {
- _c.mutation.SetRequireOauthOnly(v)
- return _c
- }
- // SetNillableRequireOauthOnly sets the "require_oauth_only" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableRequireOauthOnly(v *bool) *GroupCreate {
- if v != nil {
- _c.SetRequireOauthOnly(*v)
- }
- return _c
- }
- // SetRequirePrivacySet sets the "require_privacy_set" field.
- func (_c *GroupCreate) SetRequirePrivacySet(v bool) *GroupCreate {
- _c.mutation.SetRequirePrivacySet(v)
- return _c
- }
- // SetNillableRequirePrivacySet sets the "require_privacy_set" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableRequirePrivacySet(v *bool) *GroupCreate {
- if v != nil {
- _c.SetRequirePrivacySet(*v)
- }
- return _c
- }
- // SetDefaultMappedModel sets the "default_mapped_model" field.
- func (_c *GroupCreate) SetDefaultMappedModel(v string) *GroupCreate {
- _c.mutation.SetDefaultMappedModel(v)
- return _c
- }
- // SetNillableDefaultMappedModel sets the "default_mapped_model" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableDefaultMappedModel(v *string) *GroupCreate {
- if v != nil {
- _c.SetDefaultMappedModel(*v)
- }
- return _c
- }
- // SetMessagesDispatchModelConfig sets the "messages_dispatch_model_config" field.
- func (_c *GroupCreate) SetMessagesDispatchModelConfig(v domain.OpenAIMessagesDispatchModelConfig) *GroupCreate {
- _c.mutation.SetMessagesDispatchModelConfig(v)
- return _c
- }
- // SetNillableMessagesDispatchModelConfig sets the "messages_dispatch_model_config" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableMessagesDispatchModelConfig(v *domain.OpenAIMessagesDispatchModelConfig) *GroupCreate {
- if v != nil {
- _c.SetMessagesDispatchModelConfig(*v)
- }
- return _c
- }
- // SetModelAllowlist sets the "model_allowlist" field.
- func (_c *GroupCreate) SetModelAllowlist(v domain.GroupModelAllowlist) *GroupCreate {
- _c.mutation.SetModelAllowlist(v)
- return _c
- }
- // SetNillableModelAllowlist sets the "model_allowlist" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableModelAllowlist(v *domain.GroupModelAllowlist) *GroupCreate {
- if v != nil {
- _c.SetModelAllowlist(*v)
- }
- return _c
- }
- // SetCodexModelsManifestConfig sets the "codex_models_manifest_config" field.
- func (_c *GroupCreate) SetCodexModelsManifestConfig(v domain.GroupCodexModelsManifestConfig) *GroupCreate {
- _c.mutation.SetCodexModelsManifestConfig(v)
- return _c
- }
- // SetNillableCodexModelsManifestConfig sets the "codex_models_manifest_config" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableCodexModelsManifestConfig(v *domain.GroupCodexModelsManifestConfig) *GroupCreate {
- if v != nil {
- _c.SetCodexModelsManifestConfig(*v)
- }
- return _c
- }
- // SetRpmLimit sets the "rpm_limit" field.
- func (_c *GroupCreate) SetRpmLimit(v int) *GroupCreate {
- _c.mutation.SetRpmLimit(v)
- return _c
- }
- // SetNillableRpmLimit sets the "rpm_limit" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableRpmLimit(v *int) *GroupCreate {
- if v != nil {
- _c.SetRpmLimit(*v)
- }
- return _c
- }
- // SetMaxReasoningEffort sets the "max_reasoning_effort" field.
- func (_c *GroupCreate) SetMaxReasoningEffort(v string) *GroupCreate {
- _c.mutation.SetMaxReasoningEffort(v)
- return _c
- }
- // SetNillableMaxReasoningEffort sets the "max_reasoning_effort" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableMaxReasoningEffort(v *string) *GroupCreate {
- if v != nil {
- _c.SetMaxReasoningEffort(*v)
- }
- return _c
- }
- // SetMaxReasoningEffortOverLimit sets the "max_reasoning_effort_over_limit" field.
- func (_c *GroupCreate) SetMaxReasoningEffortOverLimit(v string) *GroupCreate {
- _c.mutation.SetMaxReasoningEffortOverLimit(v)
- return _c
- }
- // SetNillableMaxReasoningEffortOverLimit sets the "max_reasoning_effort_over_limit" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableMaxReasoningEffortOverLimit(v *string) *GroupCreate {
- if v != nil {
- _c.SetMaxReasoningEffortOverLimit(*v)
- }
- return _c
- }
- // SetReasoningEffortMappings sets the "reasoning_effort_mappings" field.
- func (_c *GroupCreate) SetReasoningEffortMappings(v []domain.ReasoningEffortMapping) *GroupCreate {
- _c.mutation.SetReasoningEffortMappings(v)
- return _c
- }
- // SetProfitControlEnabled sets the "profit_control_enabled" field.
- func (_c *GroupCreate) SetProfitControlEnabled(v bool) *GroupCreate {
- _c.mutation.SetProfitControlEnabled(v)
- return _c
- }
- // SetNillableProfitControlEnabled sets the "profit_control_enabled" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableProfitControlEnabled(v *bool) *GroupCreate {
- if v != nil {
- _c.SetProfitControlEnabled(*v)
- }
- return _c
- }
- // SetProfitMinMargin sets the "profit_min_margin" field.
- func (_c *GroupCreate) SetProfitMinMargin(v float64) *GroupCreate {
- _c.mutation.SetProfitMinMargin(v)
- return _c
- }
- // SetNillableProfitMinMargin sets the "profit_min_margin" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableProfitMinMargin(v *float64) *GroupCreate {
- if v != nil {
- _c.SetProfitMinMargin(*v)
- }
- return _c
- }
- // SetProfitSafetyBuffer sets the "profit_safety_buffer" field.
- func (_c *GroupCreate) SetProfitSafetyBuffer(v float64) *GroupCreate {
- _c.mutation.SetProfitSafetyBuffer(v)
- return _c
- }
- // SetNillableProfitSafetyBuffer sets the "profit_safety_buffer" field if the given value is not nil.
- func (_c *GroupCreate) SetNillableProfitSafetyBuffer(v *float64) *GroupCreate {
- if v != nil {
- _c.SetProfitSafetyBuffer(*v)
- }
- return _c
- }
- // AddAPIKeyIDs adds the "api_keys" edge to the APIKey entity by IDs.
- func (_c *GroupCreate) AddAPIKeyIDs(ids ...int64) *GroupCreate {
- _c.mutation.AddAPIKeyIDs(ids...)
- return _c
- }
- // AddAPIKeys adds the "api_keys" edges to the APIKey entity.
- func (_c *GroupCreate) AddAPIKeys(v ...*APIKey) *GroupCreate {
- ids := make([]int64, len(v))
- for i := range v {
- ids[i] = v[i].ID
- }
- return _c.AddAPIKeyIDs(ids...)
- }
- // AddRedeemCodeIDs adds the "redeem_codes" edge to the RedeemCode entity by IDs.
- func (_c *GroupCreate) AddRedeemCodeIDs(ids ...int64) *GroupCreate {
- _c.mutation.AddRedeemCodeIDs(ids...)
- return _c
- }
- // AddRedeemCodes adds the "redeem_codes" edges to the RedeemCode entity.
- func (_c *GroupCreate) AddRedeemCodes(v ...*RedeemCode) *GroupCreate {
- ids := make([]int64, len(v))
- for i := range v {
- ids[i] = v[i].ID
- }
- return _c.AddRedeemCodeIDs(ids...)
- }
- // AddSubscriptionIDs adds the "subscriptions" edge to the UserSubscription entity by IDs.
- func (_c *GroupCreate) AddSubscriptionIDs(ids ...int64) *GroupCreate {
- _c.mutation.AddSubscriptionIDs(ids...)
- return _c
- }
- // AddSubscriptions adds the "subscriptions" edges to the UserSubscription entity.
- func (_c *GroupCreate) AddSubscriptions(v ...*UserSubscription) *GroupCreate {
- ids := make([]int64, len(v))
- for i := range v {
- ids[i] = v[i].ID
- }
- return _c.AddSubscriptionIDs(ids...)
- }
- // AddUsageLogIDs adds the "usage_logs" edge to the UsageLog entity by IDs.
- func (_c *GroupCreate) AddUsageLogIDs(ids ...int64) *GroupCreate {
- _c.mutation.AddUsageLogIDs(ids...)
- return _c
- }
- // AddUsageLogs adds the "usage_logs" edges to the UsageLog entity.
- func (_c *GroupCreate) AddUsageLogs(v ...*UsageLog) *GroupCreate {
- ids := make([]int64, len(v))
- for i := range v {
- ids[i] = v[i].ID
- }
- return _c.AddUsageLogIDs(ids...)
- }
- // AddAccountIDs adds the "accounts" edge to the Account entity by IDs.
- func (_c *GroupCreate) AddAccountIDs(ids ...int64) *GroupCreate {
- _c.mutation.AddAccountIDs(ids...)
- return _c
- }
- // AddAccounts adds the "accounts" edges to the Account entity.
- func (_c *GroupCreate) AddAccounts(v ...*Account) *GroupCreate {
- ids := make([]int64, len(v))
- for i := range v {
- ids[i] = v[i].ID
- }
- return _c.AddAccountIDs(ids...)
- }
- // AddAllowedUserIDs adds the "allowed_users" edge to the User entity by IDs.
- func (_c *GroupCreate) AddAllowedUserIDs(ids ...int64) *GroupCreate {
- _c.mutation.AddAllowedUserIDs(ids...)
- return _c
- }
- // AddAllowedUsers adds the "allowed_users" edges to the User entity.
- func (_c *GroupCreate) AddAllowedUsers(v ...*User) *GroupCreate {
- ids := make([]int64, len(v))
- for i := range v {
- ids[i] = v[i].ID
- }
- return _c.AddAllowedUserIDs(ids...)
- }
- // Mutation returns the GroupMutation object of the builder.
- func (_c *GroupCreate) Mutation() *GroupMutation {
- return _c.mutation
- }
- // Save creates the Group in the database.
- func (_c *GroupCreate) Save(ctx context.Context) (*Group, error) {
- if err := _c.defaults(); err != nil {
- return nil, err
- }
- return withHooks(ctx, _c.sqlSave, _c.mutation, _c.hooks)
- }
- // SaveX calls Save and panics if Save returns an error.
- func (_c *GroupCreate) SaveX(ctx context.Context) *Group {
- v, err := _c.Save(ctx)
- if err != nil {
- panic(err)
- }
- return v
- }
- // Exec executes the query.
- func (_c *GroupCreate) Exec(ctx context.Context) error {
- _, err := _c.Save(ctx)
- return err
- }
- // ExecX is like Exec, but panics if an error occurs.
- func (_c *GroupCreate) ExecX(ctx context.Context) {
- if err := _c.Exec(ctx); err != nil {
- panic(err)
- }
- }
- // defaults sets the default values of the builder before save.
- func (_c *GroupCreate) defaults() error {
- if _, ok := _c.mutation.CreatedAt(); !ok {
- if group.DefaultCreatedAt == nil {
- return fmt.Errorf("ent: uninitialized group.DefaultCreatedAt (forgotten import ent/runtime?)")
- }
- v := group.DefaultCreatedAt()
- _c.mutation.SetCreatedAt(v)
- }
- if _, ok := _c.mutation.UpdatedAt(); !ok {
- if group.DefaultUpdatedAt == nil {
- return fmt.Errorf("ent: uninitialized group.DefaultUpdatedAt (forgotten import ent/runtime?)")
- }
- v := group.DefaultUpdatedAt()
- _c.mutation.SetUpdatedAt(v)
- }
- if _, ok := _c.mutation.RateMultiplier(); !ok {
- v := group.DefaultRateMultiplier
- _c.mutation.SetRateMultiplier(v)
- }
- if _, ok := _c.mutation.PeakRateEnabled(); !ok {
- v := group.DefaultPeakRateEnabled
- _c.mutation.SetPeakRateEnabled(v)
- }
- if _, ok := _c.mutation.PeakStart(); !ok {
- v := group.DefaultPeakStart
- _c.mutation.SetPeakStart(v)
- }
- if _, ok := _c.mutation.PeakEnd(); !ok {
- v := group.DefaultPeakEnd
- _c.mutation.SetPeakEnd(v)
- }
- if _, ok := _c.mutation.PeakRateMultiplier(); !ok {
- v := group.DefaultPeakRateMultiplier
- _c.mutation.SetPeakRateMultiplier(v)
- }
- if _, ok := _c.mutation.IsExclusive(); !ok {
- v := group.DefaultIsExclusive
- _c.mutation.SetIsExclusive(v)
- }
- if _, ok := _c.mutation.SecurityPolicyEnabled(); !ok {
- v := group.DefaultSecurityPolicyEnabled
- _c.mutation.SetSecurityPolicyEnabled(v)
- }
- if _, ok := _c.mutation.SecurityPolicyMode(); !ok {
- v := group.DefaultSecurityPolicyMode
- _c.mutation.SetSecurityPolicyMode(v)
- }
- if _, ok := _c.mutation.SecurityPolicyEmailEnabled(); !ok {
- v := group.DefaultSecurityPolicyEmailEnabled
- _c.mutation.SetSecurityPolicyEmailEnabled(v)
- }
- if _, ok := _c.mutation.Status(); !ok {
- v := group.DefaultStatus
- _c.mutation.SetStatus(v)
- }
- if _, ok := _c.mutation.Platform(); !ok {
- v := group.DefaultPlatform
- _c.mutation.SetPlatform(v)
- }
- if _, ok := _c.mutation.SubscriptionType(); !ok {
- v := group.DefaultSubscriptionType
- _c.mutation.SetSubscriptionType(v)
- }
- if _, ok := _c.mutation.DefaultValidityDays(); !ok {
- v := group.DefaultDefaultValidityDays
- _c.mutation.SetDefaultValidityDays(v)
- }
- if _, ok := _c.mutation.AllowImageGeneration(); !ok {
- v := group.DefaultAllowImageGeneration
- _c.mutation.SetAllowImageGeneration(v)
- }
- if _, ok := _c.mutation.AllowBatchImageGeneration(); !ok {
- v := group.DefaultAllowBatchImageGeneration
- _c.mutation.SetAllowBatchImageGeneration(v)
- }
- if _, ok := _c.mutation.ImageRateIndependent(); !ok {
- v := group.DefaultImageRateIndependent
- _c.mutation.SetImageRateIndependent(v)
- }
- if _, ok := _c.mutation.ImageRateMultiplier(); !ok {
- v := group.DefaultImageRateMultiplier
- _c.mutation.SetImageRateMultiplier(v)
- }
- if _, ok := _c.mutation.BatchImageDiscountMultiplier(); !ok {
- v := group.DefaultBatchImageDiscountMultiplier
- _c.mutation.SetBatchImageDiscountMultiplier(v)
- }
- if _, ok := _c.mutation.BatchImageHoldMultiplier(); !ok {
- v := group.DefaultBatchImageHoldMultiplier
- _c.mutation.SetBatchImageHoldMultiplier(v)
- }
- if _, ok := _c.mutation.VideoRateIndependent(); !ok {
- v := group.DefaultVideoRateIndependent
- _c.mutation.SetVideoRateIndependent(v)
- }
- if _, ok := _c.mutation.VideoRateMultiplier(); !ok {
- v := group.DefaultVideoRateMultiplier
- _c.mutation.SetVideoRateMultiplier(v)
- }
- if _, ok := _c.mutation.LongContextPricingEnabled(); !ok {
- v := group.DefaultLongContextPricingEnabled
- _c.mutation.SetLongContextPricingEnabled(v)
- }
- if _, ok := _c.mutation.ClaudeCodeOnly(); !ok {
- v := group.DefaultClaudeCodeOnly
- _c.mutation.SetClaudeCodeOnly(v)
- }
- if _, ok := _c.mutation.ModelRoutingEnabled(); !ok {
- v := group.DefaultModelRoutingEnabled
- _c.mutation.SetModelRoutingEnabled(v)
- }
- if _, ok := _c.mutation.McpXMLInject(); !ok {
- v := group.DefaultMcpXMLInject
- _c.mutation.SetMcpXMLInject(v)
- }
- if _, ok := _c.mutation.SupportedModelScopes(); !ok {
- v := group.DefaultSupportedModelScopes
- _c.mutation.SetSupportedModelScopes(v)
- }
- if _, ok := _c.mutation.SortOrder(); !ok {
- v := group.DefaultSortOrder
- _c.mutation.SetSortOrder(v)
- }
- if _, ok := _c.mutation.AllowMessagesDispatch(); !ok {
- v := group.DefaultAllowMessagesDispatch
- _c.mutation.SetAllowMessagesDispatch(v)
- }
- if _, ok := _c.mutation.AllowLive(); !ok {
- v := group.DefaultAllowLive
- _c.mutation.SetAllowLive(v)
- }
- if _, ok := _c.mutation.ForceOpenaiFast(); !ok {
- v := group.DefaultForceOpenaiFast
- _c.mutation.SetForceOpenaiFast(v)
- }
- if _, ok := _c.mutation.FreeOpenaiFast(); !ok {
- v := group.DefaultFreeOpenaiFast
- _c.mutation.SetFreeOpenaiFast(v)
- }
- if _, ok := _c.mutation.RequireOauthOnly(); !ok {
- v := group.DefaultRequireOauthOnly
- _c.mutation.SetRequireOauthOnly(v)
- }
- if _, ok := _c.mutation.RequirePrivacySet(); !ok {
- v := group.DefaultRequirePrivacySet
- _c.mutation.SetRequirePrivacySet(v)
- }
- if _, ok := _c.mutation.DefaultMappedModel(); !ok {
- v := group.DefaultDefaultMappedModel
- _c.mutation.SetDefaultMappedModel(v)
- }
- if _, ok := _c.mutation.MessagesDispatchModelConfig(); !ok {
- v := group.DefaultMessagesDispatchModelConfig
- _c.mutation.SetMessagesDispatchModelConfig(v)
- }
- if _, ok := _c.mutation.ModelAllowlist(); !ok {
- v := group.DefaultModelAllowlist
- _c.mutation.SetModelAllowlist(v)
- }
- if _, ok := _c.mutation.CodexModelsManifestConfig(); !ok {
- v := group.DefaultCodexModelsManifestConfig
- _c.mutation.SetCodexModelsManifestConfig(v)
- }
- if _, ok := _c.mutation.RpmLimit(); !ok {
- v := group.DefaultRpmLimit
- _c.mutation.SetRpmLimit(v)
- }
- if _, ok := _c.mutation.MaxReasoningEffort(); !ok {
- v := group.DefaultMaxReasoningEffort
- _c.mutation.SetMaxReasoningEffort(v)
- }
- if _, ok := _c.mutation.MaxReasoningEffortOverLimit(); !ok {
- v := group.DefaultMaxReasoningEffortOverLimit
- _c.mutation.SetMaxReasoningEffortOverLimit(v)
- }
- if _, ok := _c.mutation.ReasoningEffortMappings(); !ok {
- v := group.DefaultReasoningEffortMappings
- _c.mutation.SetReasoningEffortMappings(v)
- }
- if _, ok := _c.mutation.ProfitControlEnabled(); !ok {
- v := group.DefaultProfitControlEnabled
- _c.mutation.SetProfitControlEnabled(v)
- }
- if _, ok := _c.mutation.ProfitMinMargin(); !ok {
- v := group.DefaultProfitMinMargin
- _c.mutation.SetProfitMinMargin(v)
- }
- if _, ok := _c.mutation.ProfitSafetyBuffer(); !ok {
- v := group.DefaultProfitSafetyBuffer
- _c.mutation.SetProfitSafetyBuffer(v)
- }
- return nil
- }
- // check runs all checks and user-defined validators on the builder.
- func (_c *GroupCreate) check() error {
- if _, ok := _c.mutation.CreatedAt(); !ok {
- return &ValidationError{Name: "created_at", err: errors.New(`ent: missing required field "Group.created_at"`)}
- }
- if _, ok := _c.mutation.UpdatedAt(); !ok {
- return &ValidationError{Name: "updated_at", err: errors.New(`ent: missing required field "Group.updated_at"`)}
- }
- if _, ok := _c.mutation.Name(); !ok {
- return &ValidationError{Name: "name", err: errors.New(`ent: missing required field "Group.name"`)}
- }
- if v, ok := _c.mutation.Name(); ok {
- if err := group.NameValidator(v); err != nil {
- return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "Group.name": %w`, err)}
- }
- }
- if _, ok := _c.mutation.RateMultiplier(); !ok {
- return &ValidationError{Name: "rate_multiplier", err: errors.New(`ent: missing required field "Group.rate_multiplier"`)}
- }
- if _, ok := _c.mutation.PeakRateEnabled(); !ok {
- return &ValidationError{Name: "peak_rate_enabled", err: errors.New(`ent: missing required field "Group.peak_rate_enabled"`)}
- }
- if _, ok := _c.mutation.PeakStart(); !ok {
- return &ValidationError{Name: "peak_start", err: errors.New(`ent: missing required field "Group.peak_start"`)}
- }
- if v, ok := _c.mutation.PeakStart(); ok {
- if err := group.PeakStartValidator(v); err != nil {
- return &ValidationError{Name: "peak_start", err: fmt.Errorf(`ent: validator failed for field "Group.peak_start": %w`, err)}
- }
- }
- if _, ok := _c.mutation.PeakEnd(); !ok {
- return &ValidationError{Name: "peak_end", err: errors.New(`ent: missing required field "Group.peak_end"`)}
- }
- if v, ok := _c.mutation.PeakEnd(); ok {
- if err := group.PeakEndValidator(v); err != nil {
- return &ValidationError{Name: "peak_end", err: fmt.Errorf(`ent: validator failed for field "Group.peak_end": %w`, err)}
- }
- }
- if _, ok := _c.mutation.PeakRateMultiplier(); !ok {
- return &ValidationError{Name: "peak_rate_multiplier", err: errors.New(`ent: missing required field "Group.peak_rate_multiplier"`)}
- }
- if _, ok := _c.mutation.IsExclusive(); !ok {
- return &ValidationError{Name: "is_exclusive", err: errors.New(`ent: missing required field "Group.is_exclusive"`)}
- }
- if _, ok := _c.mutation.SecurityPolicyEnabled(); !ok {
- return &ValidationError{Name: "security_policy_enabled", err: errors.New(`ent: missing required field "Group.security_policy_enabled"`)}
- }
- if _, ok := _c.mutation.SecurityPolicyMode(); !ok {
- return &ValidationError{Name: "security_policy_mode", err: errors.New(`ent: missing required field "Group.security_policy_mode"`)}
- }
- if v, ok := _c.mutation.SecurityPolicyMode(); ok {
- if err := group.SecurityPolicyModeValidator(v); err != nil {
- return &ValidationError{Name: "security_policy_mode", err: fmt.Errorf(`ent: validator failed for field "Group.security_policy_mode": %w`, err)}
- }
- }
- if _, ok := _c.mutation.SecurityPolicyEmailEnabled(); !ok {
- return &ValidationError{Name: "security_policy_email_enabled", err: errors.New(`ent: missing required field "Group.security_policy_email_enabled"`)}
- }
- if _, ok := _c.mutation.Status(); !ok {
- return &ValidationError{Name: "status", err: errors.New(`ent: missing required field "Group.status"`)}
- }
- if v, ok := _c.mutation.Status(); ok {
- if err := group.StatusValidator(v); err != nil {
- return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "Group.status": %w`, err)}
- }
- }
- if v, ok := _c.mutation.DuplicateOperationID(); ok {
- if err := group.DuplicateOperationIDValidator(v); err != nil {
- return &ValidationError{Name: "duplicate_operation_id", err: fmt.Errorf(`ent: validator failed for field "Group.duplicate_operation_id": %w`, err)}
- }
- }
- if _, ok := _c.mutation.Platform(); !ok {
- return &ValidationError{Name: "platform", err: errors.New(`ent: missing required field "Group.platform"`)}
- }
- if v, ok := _c.mutation.Platform(); ok {
- if err := group.PlatformValidator(v); err != nil {
- return &ValidationError{Name: "platform", err: fmt.Errorf(`ent: validator failed for field "Group.platform": %w`, err)}
- }
- }
- if _, ok := _c.mutation.SubscriptionType(); !ok {
- return &ValidationError{Name: "subscription_type", err: errors.New(`ent: missing required field "Group.subscription_type"`)}
- }
- if v, ok := _c.mutation.SubscriptionType(); ok {
- if err := group.SubscriptionTypeValidator(v); err != nil {
- return &ValidationError{Name: "subscription_type", err: fmt.Errorf(`ent: validator failed for field "Group.subscription_type": %w`, err)}
- }
- }
- if _, ok := _c.mutation.DefaultValidityDays(); !ok {
- return &ValidationError{Name: "default_validity_days", err: errors.New(`ent: missing required field "Group.default_validity_days"`)}
- }
- if _, ok := _c.mutation.AllowImageGeneration(); !ok {
- return &ValidationError{Name: "allow_image_generation", err: errors.New(`ent: missing required field "Group.allow_image_generation"`)}
- }
- if _, ok := _c.mutation.AllowBatchImageGeneration(); !ok {
- return &ValidationError{Name: "allow_batch_image_generation", err: errors.New(`ent: missing required field "Group.allow_batch_image_generation"`)}
- }
- if _, ok := _c.mutation.ImageRateIndependent(); !ok {
- return &ValidationError{Name: "image_rate_independent", err: errors.New(`ent: missing required field "Group.image_rate_independent"`)}
- }
- if _, ok := _c.mutation.ImageRateMultiplier(); !ok {
- return &ValidationError{Name: "image_rate_multiplier", err: errors.New(`ent: missing required field "Group.image_rate_multiplier"`)}
- }
- if _, ok := _c.mutation.BatchImageDiscountMultiplier(); !ok {
- return &ValidationError{Name: "batch_image_discount_multiplier", err: errors.New(`ent: missing required field "Group.batch_image_discount_multiplier"`)}
- }
- if _, ok := _c.mutation.BatchImageHoldMultiplier(); !ok {
- return &ValidationError{Name: "batch_image_hold_multiplier", err: errors.New(`ent: missing required field "Group.batch_image_hold_multiplier"`)}
- }
- if _, ok := _c.mutation.VideoRateIndependent(); !ok {
- return &ValidationError{Name: "video_rate_independent", err: errors.New(`ent: missing required field "Group.video_rate_independent"`)}
- }
- if _, ok := _c.mutation.VideoRateMultiplier(); !ok {
- return &ValidationError{Name: "video_rate_multiplier", err: errors.New(`ent: missing required field "Group.video_rate_multiplier"`)}
- }
- if v, ok := _c.mutation.SearchPricePer1k(); ok {
- if err := group.SearchPricePer1kValidator(v); err != nil {
- return &ValidationError{Name: "search_price_per_1k", err: fmt.Errorf(`ent: validator failed for field "Group.search_price_per_1k": %w`, err)}
- }
- }
- if v, ok := _c.mutation.AudioRealtimePricePerMin(); ok {
- if err := group.AudioRealtimePricePerMinValidator(v); err != nil {
- return &ValidationError{Name: "audio_realtime_price_per_min", err: fmt.Errorf(`ent: validator failed for field "Group.audio_realtime_price_per_min": %w`, err)}
- }
- }
- if v, ok := _c.mutation.AudioTtsPricePerMillionChars(); ok {
- if err := group.AudioTtsPricePerMillionCharsValidator(v); err != nil {
- return &ValidationError{Name: "audio_tts_price_per_million_chars", err: fmt.Errorf(`ent: validator failed for field "Group.audio_tts_price_per_million_chars": %w`, err)}
- }
- }
- if v, ok := _c.mutation.AudioSttPricePerHour(); ok {
- if err := group.AudioSttPricePerHourValidator(v); err != nil {
- return &ValidationError{Name: "audio_stt_price_per_hour", err: fmt.Errorf(`ent: validator failed for field "Group.audio_stt_price_per_hour": %w`, err)}
- }
- }
- if _, ok := _c.mutation.LongContextPricingEnabled(); !ok {
- return &ValidationError{Name: "long_context_pricing_enabled", err: errors.New(`ent: missing required field "Group.long_context_pricing_enabled"`)}
- }
- if _, ok := _c.mutation.ClaudeCodeOnly(); !ok {
- return &ValidationError{Name: "claude_code_only", err: errors.New(`ent: missing required field "Group.claude_code_only"`)}
- }
- if _, ok := _c.mutation.ModelRoutingEnabled(); !ok {
- return &ValidationError{Name: "model_routing_enabled", err: errors.New(`ent: missing required field "Group.model_routing_enabled"`)}
- }
- if _, ok := _c.mutation.McpXMLInject(); !ok {
- return &ValidationError{Name: "mcp_xml_inject", err: errors.New(`ent: missing required field "Group.mcp_xml_inject"`)}
- }
- if _, ok := _c.mutation.SupportedModelScopes(); !ok {
- return &ValidationError{Name: "supported_model_scopes", err: errors.New(`ent: missing required field "Group.supported_model_scopes"`)}
- }
- if _, ok := _c.mutation.SortOrder(); !ok {
- return &ValidationError{Name: "sort_order", err: errors.New(`ent: missing required field "Group.sort_order"`)}
- }
- if _, ok := _c.mutation.AllowMessagesDispatch(); !ok {
- return &ValidationError{Name: "allow_messages_dispatch", err: errors.New(`ent: missing required field "Group.allow_messages_dispatch"`)}
- }
- if _, ok := _c.mutation.AllowLive(); !ok {
- return &ValidationError{Name: "allow_live", err: errors.New(`ent: missing required field "Group.allow_live"`)}
- }
- if _, ok := _c.mutation.ForceOpenaiFast(); !ok {
- return &ValidationError{Name: "force_openai_fast", err: errors.New(`ent: missing required field "Group.force_openai_fast"`)}
- }
- if _, ok := _c.mutation.FreeOpenaiFast(); !ok {
- return &ValidationError{Name: "free_openai_fast", err: errors.New(`ent: missing required field "Group.free_openai_fast"`)}
- }
- if _, ok := _c.mutation.RequireOauthOnly(); !ok {
- return &ValidationError{Name: "require_oauth_only", err: errors.New(`ent: missing required field "Group.require_oauth_only"`)}
- }
- if _, ok := _c.mutation.RequirePrivacySet(); !ok {
- return &ValidationError{Name: "require_privacy_set", err: errors.New(`ent: missing required field "Group.require_privacy_set"`)}
- }
- if _, ok := _c.mutation.DefaultMappedModel(); !ok {
- return &ValidationError{Name: "default_mapped_model", err: errors.New(`ent: missing required field "Group.default_mapped_model"`)}
- }
- if v, ok := _c.mutation.DefaultMappedModel(); ok {
- if err := group.DefaultMappedModelValidator(v); err != nil {
- return &ValidationError{Name: "default_mapped_model", err: fmt.Errorf(`ent: validator failed for field "Group.default_mapped_model": %w`, err)}
- }
- }
- if _, ok := _c.mutation.MessagesDispatchModelConfig(); !ok {
- return &ValidationError{Name: "messages_dispatch_model_config", err: errors.New(`ent: missing required field "Group.messages_dispatch_model_config"`)}
- }
- if _, ok := _c.mutation.ModelAllowlist(); !ok {
- return &ValidationError{Name: "model_allowlist", err: errors.New(`ent: missing required field "Group.model_allowlist"`)}
- }
- if _, ok := _c.mutation.CodexModelsManifestConfig(); !ok {
- return &ValidationError{Name: "codex_models_manifest_config", err: errors.New(`ent: missing required field "Group.codex_models_manifest_config"`)}
- }
- if _, ok := _c.mutation.RpmLimit(); !ok {
- return &ValidationError{Name: "rpm_limit", err: errors.New(`ent: missing required field "Group.rpm_limit"`)}
- }
- if _, ok := _c.mutation.MaxReasoningEffort(); !ok {
- return &ValidationError{Name: "max_reasoning_effort", err: errors.New(`ent: missing required field "Group.max_reasoning_effort"`)}
- }
- if v, ok := _c.mutation.MaxReasoningEffort(); ok {
- if err := group.MaxReasoningEffortValidator(v); err != nil {
- return &ValidationError{Name: "max_reasoning_effort", err: fmt.Errorf(`ent: validator failed for field "Group.max_reasoning_effort": %w`, err)}
- }
- }
- if _, ok := _c.mutation.MaxReasoningEffortOverLimit(); !ok {
- return &ValidationError{Name: "max_reasoning_effort_over_limit", err: errors.New(`ent: missing required field "Group.max_reasoning_effort_over_limit"`)}
- }
- if v, ok := _c.mutation.MaxReasoningEffortOverLimit(); ok {
- if err := group.MaxReasoningEffortOverLimitValidator(v); err != nil {
- return &ValidationError{Name: "max_reasoning_effort_over_limit", err: fmt.Errorf(`ent: validator failed for field "Group.max_reasoning_effort_over_limit": %w`, err)}
- }
- }
- if _, ok := _c.mutation.ReasoningEffortMappings(); !ok {
- return &ValidationError{Name: "reasoning_effort_mappings", err: errors.New(`ent: missing required field "Group.reasoning_effort_mappings"`)}
- }
- if _, ok := _c.mutation.ProfitControlEnabled(); !ok {
- return &ValidationError{Name: "profit_control_enabled", err: errors.New(`ent: missing required field "Group.profit_control_enabled"`)}
- }
- if _, ok := _c.mutation.ProfitMinMargin(); !ok {
- return &ValidationError{Name: "profit_min_margin", err: errors.New(`ent: missing required field "Group.profit_min_margin"`)}
- }
- if _, ok := _c.mutation.ProfitSafetyBuffer(); !ok {
- return &ValidationError{Name: "profit_safety_buffer", err: errors.New(`ent: missing required field "Group.profit_safety_buffer"`)}
- }
- return nil
- }
- func (_c *GroupCreate) sqlSave(ctx context.Context) (*Group, error) {
- if err := _c.check(); err != nil {
- return nil, err
- }
- _node, _spec := _c.createSpec()
- if err := sqlgraph.CreateNode(ctx, _c.driver, _spec); err != nil {
- if sqlgraph.IsConstraintError(err) {
- err = &ConstraintError{msg: err.Error(), wrap: err}
- }
- return nil, err
- }
- id := _spec.ID.Value.(int64)
- _node.ID = int64(id)
- _c.mutation.id = &_node.ID
- _c.mutation.done = true
- return _node, nil
- }
- func (_c *GroupCreate) createSpec() (*Group, *sqlgraph.CreateSpec) {
- var (
- _node = &Group{config: _c.config}
- _spec = sqlgraph.NewCreateSpec(group.Table, sqlgraph.NewFieldSpec(group.FieldID, field.TypeInt64))
- )
- _spec.OnConflict = _c.conflict
- if value, ok := _c.mutation.CreatedAt(); ok {
- _spec.SetField(group.FieldCreatedAt, field.TypeTime, value)
- _node.CreatedAt = value
- }
- if value, ok := _c.mutation.UpdatedAt(); ok {
- _spec.SetField(group.FieldUpdatedAt, field.TypeTime, value)
- _node.UpdatedAt = value
- }
- if value, ok := _c.mutation.DeletedAt(); ok {
- _spec.SetField(group.FieldDeletedAt, field.TypeTime, value)
- _node.DeletedAt = &value
- }
- if value, ok := _c.mutation.Name(); ok {
- _spec.SetField(group.FieldName, field.TypeString, value)
- _node.Name = value
- }
- if value, ok := _c.mutation.Description(); ok {
- _spec.SetField(group.FieldDescription, field.TypeString, value)
- _node.Description = &value
- }
- if value, ok := _c.mutation.RateMultiplier(); ok {
- _spec.SetField(group.FieldRateMultiplier, field.TypeFloat64, value)
- _node.RateMultiplier = value
- }
- if value, ok := _c.mutation.PeakRateEnabled(); ok {
- _spec.SetField(group.FieldPeakRateEnabled, field.TypeBool, value)
- _node.PeakRateEnabled = value
- }
- if value, ok := _c.mutation.PeakStart(); ok {
- _spec.SetField(group.FieldPeakStart, field.TypeString, value)
- _node.PeakStart = value
- }
- if value, ok := _c.mutation.PeakEnd(); ok {
- _spec.SetField(group.FieldPeakEnd, field.TypeString, value)
- _node.PeakEnd = value
- }
- if value, ok := _c.mutation.PeakRateMultiplier(); ok {
- _spec.SetField(group.FieldPeakRateMultiplier, field.TypeFloat64, value)
- _node.PeakRateMultiplier = value
- }
- if value, ok := _c.mutation.IsExclusive(); ok {
- _spec.SetField(group.FieldIsExclusive, field.TypeBool, value)
- _node.IsExclusive = value
- }
- if value, ok := _c.mutation.SecurityPolicyEnabled(); ok {
- _spec.SetField(group.FieldSecurityPolicyEnabled, field.TypeBool, value)
- _node.SecurityPolicyEnabled = value
- }
- if value, ok := _c.mutation.SecurityPolicyMode(); ok {
- _spec.SetField(group.FieldSecurityPolicyMode, field.TypeString, value)
- _node.SecurityPolicyMode = value
- }
- if value, ok := _c.mutation.SecurityPolicyEmailEnabled(); ok {
- _spec.SetField(group.FieldSecurityPolicyEmailEnabled, field.TypeBool, value)
- _node.SecurityPolicyEmailEnabled = value
- }
- if value, ok := _c.mutation.Status(); ok {
- _spec.SetField(group.FieldStatus, field.TypeString, value)
- _node.Status = value
- }
- if value, ok := _c.mutation.DuplicateOperationID(); ok {
- _spec.SetField(group.FieldDuplicateOperationID, field.TypeString, value)
- _node.DuplicateOperationID = &value
- }
- if value, ok := _c.mutation.Platform(); ok {
- _spec.SetField(group.FieldPlatform, field.TypeString, value)
- _node.Platform = value
- }
- if value, ok := _c.mutation.SubscriptionType(); ok {
- _spec.SetField(group.FieldSubscriptionType, field.TypeString, value)
- _node.SubscriptionType = value
- }
- if value, ok := _c.mutation.DailyLimitUsd(); ok {
- _spec.SetField(group.FieldDailyLimitUsd, field.TypeFloat64, value)
- _node.DailyLimitUsd = &value
- }
- if value, ok := _c.mutation.WeeklyLimitUsd(); ok {
- _spec.SetField(group.FieldWeeklyLimitUsd, field.TypeFloat64, value)
- _node.WeeklyLimitUsd = &value
- }
- if value, ok := _c.mutation.MonthlyLimitUsd(); ok {
- _spec.SetField(group.FieldMonthlyLimitUsd, field.TypeFloat64, value)
- _node.MonthlyLimitUsd = &value
- }
- if value, ok := _c.mutation.DefaultValidityDays(); ok {
- _spec.SetField(group.FieldDefaultValidityDays, field.TypeInt, value)
- _node.DefaultValidityDays = value
- }
- if value, ok := _c.mutation.AllowImageGeneration(); ok {
- _spec.SetField(group.FieldAllowImageGeneration, field.TypeBool, value)
- _node.AllowImageGeneration = value
- }
- if value, ok := _c.mutation.AllowBatchImageGeneration(); ok {
- _spec.SetField(group.FieldAllowBatchImageGeneration, field.TypeBool, value)
- _node.AllowBatchImageGeneration = value
- }
- if value, ok := _c.mutation.ImageRateIndependent(); ok {
- _spec.SetField(group.FieldImageRateIndependent, field.TypeBool, value)
- _node.ImageRateIndependent = value
- }
- if value, ok := _c.mutation.ImageRateMultiplier(); ok {
- _spec.SetField(group.FieldImageRateMultiplier, field.TypeFloat64, value)
- _node.ImageRateMultiplier = value
- }
- if value, ok := _c.mutation.ImagePrice1k(); ok {
- _spec.SetField(group.FieldImagePrice1k, field.TypeFloat64, value)
- _node.ImagePrice1k = &value
- }
- if value, ok := _c.mutation.ImagePrice2k(); ok {
- _spec.SetField(group.FieldImagePrice2k, field.TypeFloat64, value)
- _node.ImagePrice2k = &value
- }
- if value, ok := _c.mutation.ImagePrice4k(); ok {
- _spec.SetField(group.FieldImagePrice4k, field.TypeFloat64, value)
- _node.ImagePrice4k = &value
- }
- if value, ok := _c.mutation.BatchImageDiscountMultiplier(); ok {
- _spec.SetField(group.FieldBatchImageDiscountMultiplier, field.TypeFloat64, value)
- _node.BatchImageDiscountMultiplier = value
- }
- if value, ok := _c.mutation.BatchImageHoldMultiplier(); ok {
- _spec.SetField(group.FieldBatchImageHoldMultiplier, field.TypeFloat64, value)
- _node.BatchImageHoldMultiplier = value
- }
- if value, ok := _c.mutation.VideoRateIndependent(); ok {
- _spec.SetField(group.FieldVideoRateIndependent, field.TypeBool, value)
- _node.VideoRateIndependent = value
- }
- if value, ok := _c.mutation.VideoRateMultiplier(); ok {
- _spec.SetField(group.FieldVideoRateMultiplier, field.TypeFloat64, value)
- _node.VideoRateMultiplier = value
- }
- if value, ok := _c.mutation.VideoPrice480p(); ok {
- _spec.SetField(group.FieldVideoPrice480p, field.TypeFloat64, value)
- _node.VideoPrice480p = &value
- }
- if value, ok := _c.mutation.VideoPrice720p(); ok {
- _spec.SetField(group.FieldVideoPrice720p, field.TypeFloat64, value)
- _node.VideoPrice720p = &value
- }
- if value, ok := _c.mutation.VideoPrice1080p(); ok {
- _spec.SetField(group.FieldVideoPrice1080p, field.TypeFloat64, value)
- _node.VideoPrice1080p = &value
- }
- if value, ok := _c.mutation.VideoModelPrices(); ok {
- _spec.SetField(group.FieldVideoModelPrices, field.TypeJSON, value)
- _node.VideoModelPrices = value
- }
- if value, ok := _c.mutation.WebSearchPricePerCall(); ok {
- _spec.SetField(group.FieldWebSearchPricePerCall, field.TypeFloat64, value)
- _node.WebSearchPricePerCall = &value
- }
- if value, ok := _c.mutation.SearchPricePer1k(); ok {
- _spec.SetField(group.FieldSearchPricePer1k, field.TypeFloat64, value)
- _node.SearchPricePer1k = &value
- }
- if value, ok := _c.mutation.AudioRealtimePricePerMin(); ok {
- _spec.SetField(group.FieldAudioRealtimePricePerMin, field.TypeFloat64, value)
- _node.AudioRealtimePricePerMin = &value
- }
- if value, ok := _c.mutation.AudioTtsPricePerMillionChars(); ok {
- _spec.SetField(group.FieldAudioTtsPricePerMillionChars, field.TypeFloat64, value)
- _node.AudioTtsPricePerMillionChars = &value
- }
- if value, ok := _c.mutation.AudioSttPricePerHour(); ok {
- _spec.SetField(group.FieldAudioSttPricePerHour, field.TypeFloat64, value)
- _node.AudioSttPricePerHour = &value
- }
- if value, ok := _c.mutation.LongContextPricingEnabled(); ok {
- _spec.SetField(group.FieldLongContextPricingEnabled, field.TypeBool, value)
- _node.LongContextPricingEnabled = value
- }
- if value, ok := _c.mutation.ModelPricing(); ok {
- _spec.SetField(group.FieldModelPricing, field.TypeJSON, value)
- _node.ModelPricing = value
- }
- if value, ok := _c.mutation.ClaudeCodeOnly(); ok {
- _spec.SetField(group.FieldClaudeCodeOnly, field.TypeBool, value)
- _node.ClaudeCodeOnly = value
- }
- if value, ok := _c.mutation.FallbackGroupID(); ok {
- _spec.SetField(group.FieldFallbackGroupID, field.TypeInt64, value)
- _node.FallbackGroupID = &value
- }
- if value, ok := _c.mutation.FallbackGroupIDOnInvalidRequest(); ok {
- _spec.SetField(group.FieldFallbackGroupIDOnInvalidRequest, field.TypeInt64, value)
- _node.FallbackGroupIDOnInvalidRequest = &value
- }
- if value, ok := _c.mutation.ModelRouting(); ok {
- _spec.SetField(group.FieldModelRouting, field.TypeJSON, value)
- _node.ModelRouting = value
- }
- if value, ok := _c.mutation.ModelRoutingEnabled(); ok {
- _spec.SetField(group.FieldModelRoutingEnabled, field.TypeBool, value)
- _node.ModelRoutingEnabled = value
- }
- if value, ok := _c.mutation.McpXMLInject(); ok {
- _spec.SetField(group.FieldMcpXMLInject, field.TypeBool, value)
- _node.McpXMLInject = value
- }
- if value, ok := _c.mutation.SupportedModelScopes(); ok {
- _spec.SetField(group.FieldSupportedModelScopes, field.TypeJSON, value)
- _node.SupportedModelScopes = value
- }
- if value, ok := _c.mutation.SortOrder(); ok {
- _spec.SetField(group.FieldSortOrder, field.TypeInt, value)
- _node.SortOrder = value
- }
- if value, ok := _c.mutation.AllowMessagesDispatch(); ok {
- _spec.SetField(group.FieldAllowMessagesDispatch, field.TypeBool, value)
- _node.AllowMessagesDispatch = value
- }
- if value, ok := _c.mutation.AllowLive(); ok {
- _spec.SetField(group.FieldAllowLive, field.TypeBool, value)
- _node.AllowLive = value
- }
- if value, ok := _c.mutation.ForceOpenaiFast(); ok {
- _spec.SetField(group.FieldForceOpenaiFast, field.TypeBool, value)
- _node.ForceOpenaiFast = value
- }
- if value, ok := _c.mutation.FreeOpenaiFast(); ok {
- _spec.SetField(group.FieldFreeOpenaiFast, field.TypeBool, value)
- _node.FreeOpenaiFast = value
- }
- if value, ok := _c.mutation.RequireOauthOnly(); ok {
- _spec.SetField(group.FieldRequireOauthOnly, field.TypeBool, value)
- _node.RequireOauthOnly = value
- }
- if value, ok := _c.mutation.RequirePrivacySet(); ok {
- _spec.SetField(group.FieldRequirePrivacySet, field.TypeBool, value)
- _node.RequirePrivacySet = value
- }
- if value, ok := _c.mutation.DefaultMappedModel(); ok {
- _spec.SetField(group.FieldDefaultMappedModel, field.TypeString, value)
- _node.DefaultMappedModel = value
- }
- if value, ok := _c.mutation.MessagesDispatchModelConfig(); ok {
- _spec.SetField(group.FieldMessagesDispatchModelConfig, field.TypeJSON, value)
- _node.MessagesDispatchModelConfig = value
- }
- if value, ok := _c.mutation.ModelAllowlist(); ok {
- _spec.SetField(group.FieldModelAllowlist, field.TypeJSON, value)
- _node.ModelAllowlist = value
- }
- if value, ok := _c.mutation.CodexModelsManifestConfig(); ok {
- _spec.SetField(group.FieldCodexModelsManifestConfig, field.TypeJSON, value)
- _node.CodexModelsManifestConfig = value
- }
- if value, ok := _c.mutation.RpmLimit(); ok {
- _spec.SetField(group.FieldRpmLimit, field.TypeInt, value)
- _node.RpmLimit = value
- }
- if value, ok := _c.mutation.MaxReasoningEffort(); ok {
- _spec.SetField(group.FieldMaxReasoningEffort, field.TypeString, value)
- _node.MaxReasoningEffort = value
- }
- if value, ok := _c.mutation.MaxReasoningEffortOverLimit(); ok {
- _spec.SetField(group.FieldMaxReasoningEffortOverLimit, field.TypeString, value)
- _node.MaxReasoningEffortOverLimit = value
- }
- if value, ok := _c.mutation.ReasoningEffortMappings(); ok {
- _spec.SetField(group.FieldReasoningEffortMappings, field.TypeJSON, value)
- _node.ReasoningEffortMappings = value
- }
- if value, ok := _c.mutation.ProfitControlEnabled(); ok {
- _spec.SetField(group.FieldProfitControlEnabled, field.TypeBool, value)
- _node.ProfitControlEnabled = value
- }
- if value, ok := _c.mutation.ProfitMinMargin(); ok {
- _spec.SetField(group.FieldProfitMinMargin, field.TypeFloat64, value)
- _node.ProfitMinMargin = value
- }
- if value, ok := _c.mutation.ProfitSafetyBuffer(); ok {
- _spec.SetField(group.FieldProfitSafetyBuffer, field.TypeFloat64, value)
- _node.ProfitSafetyBuffer = value
- }
- if nodes := _c.mutation.APIKeysIDs(); len(nodes) > 0 {
- edge := &sqlgraph.EdgeSpec{
- Rel: sqlgraph.O2M,
- Inverse: false,
- Table: group.APIKeysTable,
- Columns: []string{group.APIKeysColumn},
- Bidi: false,
- Target: &sqlgraph.EdgeTarget{
- IDSpec: sqlgraph.NewFieldSpec(apikey.FieldID, field.TypeInt64),
- },
- }
- for _, k := range nodes {
- edge.Target.Nodes = append(edge.Target.Nodes, k)
- }
- _spec.Edges = append(_spec.Edges, edge)
- }
- if nodes := _c.mutation.RedeemCodesIDs(); len(nodes) > 0 {
- edge := &sqlgraph.EdgeSpec{
- Rel: sqlgraph.O2M,
- Inverse: false,
- Table: group.RedeemCodesTable,
- Columns: []string{group.RedeemCodesColumn},
- Bidi: false,
- Target: &sqlgraph.EdgeTarget{
- IDSpec: sqlgraph.NewFieldSpec(redeemcode.FieldID, field.TypeInt64),
- },
- }
- for _, k := range nodes {
- edge.Target.Nodes = append(edge.Target.Nodes, k)
- }
- _spec.Edges = append(_spec.Edges, edge)
- }
- if nodes := _c.mutation.SubscriptionsIDs(); len(nodes) > 0 {
- edge := &sqlgraph.EdgeSpec{
- Rel: sqlgraph.O2M,
- Inverse: false,
- Table: group.SubscriptionsTable,
- Columns: []string{group.SubscriptionsColumn},
- Bidi: false,
- Target: &sqlgraph.EdgeTarget{
- IDSpec: sqlgraph.NewFieldSpec(usersubscription.FieldID, field.TypeInt64),
- },
- }
- for _, k := range nodes {
- edge.Target.Nodes = append(edge.Target.Nodes, k)
- }
- _spec.Edges = append(_spec.Edges, edge)
- }
- if nodes := _c.mutation.UsageLogsIDs(); len(nodes) > 0 {
- edge := &sqlgraph.EdgeSpec{
- Rel: sqlgraph.O2M,
- Inverse: false,
- Table: group.UsageLogsTable,
- Columns: []string{group.UsageLogsColumn},
- Bidi: false,
- Target: &sqlgraph.EdgeTarget{
- IDSpec: sqlgraph.NewFieldSpec(usagelog.FieldID, field.TypeInt64),
- },
- }
- for _, k := range nodes {
- edge.Target.Nodes = append(edge.Target.Nodes, k)
- }
- _spec.Edges = append(_spec.Edges, edge)
- }
- if nodes := _c.mutation.AccountsIDs(); len(nodes) > 0 {
- edge := &sqlgraph.EdgeSpec{
- Rel: sqlgraph.M2M,
- Inverse: true,
- Table: group.AccountsTable,
- Columns: group.AccountsPrimaryKey,
- Bidi: false,
- Target: &sqlgraph.EdgeTarget{
- IDSpec: sqlgraph.NewFieldSpec(account.FieldID, field.TypeInt64),
- },
- }
- for _, k := range nodes {
- edge.Target.Nodes = append(edge.Target.Nodes, k)
- }
- createE := &AccountGroupCreate{config: _c.config, mutation: newAccountGroupMutation(_c.config, OpCreate)}
- createE.defaults()
- _, specE := createE.createSpec()
- edge.Target.Fields = specE.Fields
- _spec.Edges = append(_spec.Edges, edge)
- }
- if nodes := _c.mutation.AllowedUsersIDs(); len(nodes) > 0 {
- edge := &sqlgraph.EdgeSpec{
- Rel: sqlgraph.M2M,
- Inverse: true,
- Table: group.AllowedUsersTable,
- Columns: group.AllowedUsersPrimaryKey,
- Bidi: false,
- Target: &sqlgraph.EdgeTarget{
- IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeInt64),
- },
- }
- for _, k := range nodes {
- edge.Target.Nodes = append(edge.Target.Nodes, k)
- }
- createE := &UserAllowedGroupCreate{config: _c.config, mutation: newUserAllowedGroupMutation(_c.config, OpCreate)}
- createE.defaults()
- _, specE := createE.createSpec()
- edge.Target.Fields = specE.Fields
- _spec.Edges = append(_spec.Edges, edge)
- }
- return _node, _spec
- }
- // OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
- // of the `INSERT` statement. For example:
- //
- // client.Group.Create().
- // SetCreatedAt(v).
- // OnConflict(
- // // Update the row with the new values
- // // the was proposed for insertion.
- // sql.ResolveWithNewValues(),
- // ).
- // // Override some of the fields with custom
- // // update values.
- // Update(func(u *ent.GroupUpsert) {
- // SetCreatedAt(v+v).
- // }).
- // Exec(ctx)
- func (_c *GroupCreate) OnConflict(opts ...sql.ConflictOption) *GroupUpsertOne {
- _c.conflict = opts
- return &GroupUpsertOne{
- create: _c,
- }
- }
- // OnConflictColumns calls `OnConflict` and configures the columns
- // as conflict target. Using this option is equivalent to using:
- //
- // client.Group.Create().
- // OnConflict(sql.ConflictColumns(columns...)).
- // Exec(ctx)
- func (_c *GroupCreate) OnConflictColumns(columns ...string) *GroupUpsertOne {
- _c.conflict = append(_c.conflict, sql.ConflictColumns(columns...))
- return &GroupUpsertOne{
- create: _c,
- }
- }
- type (
- // GroupUpsertOne is the builder for "upsert"-ing
- // one Group node.
- GroupUpsertOne struct {
- create *GroupCreate
- }
- // GroupUpsert is the "OnConflict" setter.
- GroupUpsert struct {
- *sql.UpdateSet
- }
- )
- // SetUpdatedAt sets the "updated_at" field.
- func (u *GroupUpsert) SetUpdatedAt(v time.Time) *GroupUpsert {
- u.Set(group.FieldUpdatedAt, v)
- return u
- }
- // UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateUpdatedAt() *GroupUpsert {
- u.SetExcluded(group.FieldUpdatedAt)
- return u
- }
- // SetDeletedAt sets the "deleted_at" field.
- func (u *GroupUpsert) SetDeletedAt(v time.Time) *GroupUpsert {
- u.Set(group.FieldDeletedAt, v)
- return u
- }
- // UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateDeletedAt() *GroupUpsert {
- u.SetExcluded(group.FieldDeletedAt)
- return u
- }
- // ClearDeletedAt clears the value of the "deleted_at" field.
- func (u *GroupUpsert) ClearDeletedAt() *GroupUpsert {
- u.SetNull(group.FieldDeletedAt)
- return u
- }
- // SetName sets the "name" field.
- func (u *GroupUpsert) SetName(v string) *GroupUpsert {
- u.Set(group.FieldName, v)
- return u
- }
- // UpdateName sets the "name" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateName() *GroupUpsert {
- u.SetExcluded(group.FieldName)
- return u
- }
- // SetDescription sets the "description" field.
- func (u *GroupUpsert) SetDescription(v string) *GroupUpsert {
- u.Set(group.FieldDescription, v)
- return u
- }
- // UpdateDescription sets the "description" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateDescription() *GroupUpsert {
- u.SetExcluded(group.FieldDescription)
- return u
- }
- // ClearDescription clears the value of the "description" field.
- func (u *GroupUpsert) ClearDescription() *GroupUpsert {
- u.SetNull(group.FieldDescription)
- return u
- }
- // SetRateMultiplier sets the "rate_multiplier" field.
- func (u *GroupUpsert) SetRateMultiplier(v float64) *GroupUpsert {
- u.Set(group.FieldRateMultiplier, v)
- return u
- }
- // UpdateRateMultiplier sets the "rate_multiplier" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateRateMultiplier() *GroupUpsert {
- u.SetExcluded(group.FieldRateMultiplier)
- return u
- }
- // AddRateMultiplier adds v to the "rate_multiplier" field.
- func (u *GroupUpsert) AddRateMultiplier(v float64) *GroupUpsert {
- u.Add(group.FieldRateMultiplier, v)
- return u
- }
- // SetPeakRateEnabled sets the "peak_rate_enabled" field.
- func (u *GroupUpsert) SetPeakRateEnabled(v bool) *GroupUpsert {
- u.Set(group.FieldPeakRateEnabled, v)
- return u
- }
- // UpdatePeakRateEnabled sets the "peak_rate_enabled" field to the value that was provided on create.
- func (u *GroupUpsert) UpdatePeakRateEnabled() *GroupUpsert {
- u.SetExcluded(group.FieldPeakRateEnabled)
- return u
- }
- // SetPeakStart sets the "peak_start" field.
- func (u *GroupUpsert) SetPeakStart(v string) *GroupUpsert {
- u.Set(group.FieldPeakStart, v)
- return u
- }
- // UpdatePeakStart sets the "peak_start" field to the value that was provided on create.
- func (u *GroupUpsert) UpdatePeakStart() *GroupUpsert {
- u.SetExcluded(group.FieldPeakStart)
- return u
- }
- // SetPeakEnd sets the "peak_end" field.
- func (u *GroupUpsert) SetPeakEnd(v string) *GroupUpsert {
- u.Set(group.FieldPeakEnd, v)
- return u
- }
- // UpdatePeakEnd sets the "peak_end" field to the value that was provided on create.
- func (u *GroupUpsert) UpdatePeakEnd() *GroupUpsert {
- u.SetExcluded(group.FieldPeakEnd)
- return u
- }
- // SetPeakRateMultiplier sets the "peak_rate_multiplier" field.
- func (u *GroupUpsert) SetPeakRateMultiplier(v float64) *GroupUpsert {
- u.Set(group.FieldPeakRateMultiplier, v)
- return u
- }
- // UpdatePeakRateMultiplier sets the "peak_rate_multiplier" field to the value that was provided on create.
- func (u *GroupUpsert) UpdatePeakRateMultiplier() *GroupUpsert {
- u.SetExcluded(group.FieldPeakRateMultiplier)
- return u
- }
- // AddPeakRateMultiplier adds v to the "peak_rate_multiplier" field.
- func (u *GroupUpsert) AddPeakRateMultiplier(v float64) *GroupUpsert {
- u.Add(group.FieldPeakRateMultiplier, v)
- return u
- }
- // SetIsExclusive sets the "is_exclusive" field.
- func (u *GroupUpsert) SetIsExclusive(v bool) *GroupUpsert {
- u.Set(group.FieldIsExclusive, v)
- return u
- }
- // UpdateIsExclusive sets the "is_exclusive" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateIsExclusive() *GroupUpsert {
- u.SetExcluded(group.FieldIsExclusive)
- return u
- }
- // SetSecurityPolicyEnabled sets the "security_policy_enabled" field.
- func (u *GroupUpsert) SetSecurityPolicyEnabled(v bool) *GroupUpsert {
- u.Set(group.FieldSecurityPolicyEnabled, v)
- return u
- }
- // UpdateSecurityPolicyEnabled sets the "security_policy_enabled" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateSecurityPolicyEnabled() *GroupUpsert {
- u.SetExcluded(group.FieldSecurityPolicyEnabled)
- return u
- }
- // SetSecurityPolicyMode sets the "security_policy_mode" field.
- func (u *GroupUpsert) SetSecurityPolicyMode(v string) *GroupUpsert {
- u.Set(group.FieldSecurityPolicyMode, v)
- return u
- }
- // UpdateSecurityPolicyMode sets the "security_policy_mode" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateSecurityPolicyMode() *GroupUpsert {
- u.SetExcluded(group.FieldSecurityPolicyMode)
- return u
- }
- // SetSecurityPolicyEmailEnabled sets the "security_policy_email_enabled" field.
- func (u *GroupUpsert) SetSecurityPolicyEmailEnabled(v bool) *GroupUpsert {
- u.Set(group.FieldSecurityPolicyEmailEnabled, v)
- return u
- }
- // UpdateSecurityPolicyEmailEnabled sets the "security_policy_email_enabled" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateSecurityPolicyEmailEnabled() *GroupUpsert {
- u.SetExcluded(group.FieldSecurityPolicyEmailEnabled)
- return u
- }
- // SetStatus sets the "status" field.
- func (u *GroupUpsert) SetStatus(v string) *GroupUpsert {
- u.Set(group.FieldStatus, v)
- return u
- }
- // UpdateStatus sets the "status" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateStatus() *GroupUpsert {
- u.SetExcluded(group.FieldStatus)
- return u
- }
- // SetPlatform sets the "platform" field.
- func (u *GroupUpsert) SetPlatform(v string) *GroupUpsert {
- u.Set(group.FieldPlatform, v)
- return u
- }
- // UpdatePlatform sets the "platform" field to the value that was provided on create.
- func (u *GroupUpsert) UpdatePlatform() *GroupUpsert {
- u.SetExcluded(group.FieldPlatform)
- return u
- }
- // SetSubscriptionType sets the "subscription_type" field.
- func (u *GroupUpsert) SetSubscriptionType(v string) *GroupUpsert {
- u.Set(group.FieldSubscriptionType, v)
- return u
- }
- // UpdateSubscriptionType sets the "subscription_type" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateSubscriptionType() *GroupUpsert {
- u.SetExcluded(group.FieldSubscriptionType)
- return u
- }
- // SetDailyLimitUsd sets the "daily_limit_usd" field.
- func (u *GroupUpsert) SetDailyLimitUsd(v float64) *GroupUpsert {
- u.Set(group.FieldDailyLimitUsd, v)
- return u
- }
- // UpdateDailyLimitUsd sets the "daily_limit_usd" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateDailyLimitUsd() *GroupUpsert {
- u.SetExcluded(group.FieldDailyLimitUsd)
- return u
- }
- // AddDailyLimitUsd adds v to the "daily_limit_usd" field.
- func (u *GroupUpsert) AddDailyLimitUsd(v float64) *GroupUpsert {
- u.Add(group.FieldDailyLimitUsd, v)
- return u
- }
- // ClearDailyLimitUsd clears the value of the "daily_limit_usd" field.
- func (u *GroupUpsert) ClearDailyLimitUsd() *GroupUpsert {
- u.SetNull(group.FieldDailyLimitUsd)
- return u
- }
- // SetWeeklyLimitUsd sets the "weekly_limit_usd" field.
- func (u *GroupUpsert) SetWeeklyLimitUsd(v float64) *GroupUpsert {
- u.Set(group.FieldWeeklyLimitUsd, v)
- return u
- }
- // UpdateWeeklyLimitUsd sets the "weekly_limit_usd" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateWeeklyLimitUsd() *GroupUpsert {
- u.SetExcluded(group.FieldWeeklyLimitUsd)
- return u
- }
- // AddWeeklyLimitUsd adds v to the "weekly_limit_usd" field.
- func (u *GroupUpsert) AddWeeklyLimitUsd(v float64) *GroupUpsert {
- u.Add(group.FieldWeeklyLimitUsd, v)
- return u
- }
- // ClearWeeklyLimitUsd clears the value of the "weekly_limit_usd" field.
- func (u *GroupUpsert) ClearWeeklyLimitUsd() *GroupUpsert {
- u.SetNull(group.FieldWeeklyLimitUsd)
- return u
- }
- // SetMonthlyLimitUsd sets the "monthly_limit_usd" field.
- func (u *GroupUpsert) SetMonthlyLimitUsd(v float64) *GroupUpsert {
- u.Set(group.FieldMonthlyLimitUsd, v)
- return u
- }
- // UpdateMonthlyLimitUsd sets the "monthly_limit_usd" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateMonthlyLimitUsd() *GroupUpsert {
- u.SetExcluded(group.FieldMonthlyLimitUsd)
- return u
- }
- // AddMonthlyLimitUsd adds v to the "monthly_limit_usd" field.
- func (u *GroupUpsert) AddMonthlyLimitUsd(v float64) *GroupUpsert {
- u.Add(group.FieldMonthlyLimitUsd, v)
- return u
- }
- // ClearMonthlyLimitUsd clears the value of the "monthly_limit_usd" field.
- func (u *GroupUpsert) ClearMonthlyLimitUsd() *GroupUpsert {
- u.SetNull(group.FieldMonthlyLimitUsd)
- return u
- }
- // SetDefaultValidityDays sets the "default_validity_days" field.
- func (u *GroupUpsert) SetDefaultValidityDays(v int) *GroupUpsert {
- u.Set(group.FieldDefaultValidityDays, v)
- return u
- }
- // UpdateDefaultValidityDays sets the "default_validity_days" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateDefaultValidityDays() *GroupUpsert {
- u.SetExcluded(group.FieldDefaultValidityDays)
- return u
- }
- // AddDefaultValidityDays adds v to the "default_validity_days" field.
- func (u *GroupUpsert) AddDefaultValidityDays(v int) *GroupUpsert {
- u.Add(group.FieldDefaultValidityDays, v)
- return u
- }
- // SetAllowImageGeneration sets the "allow_image_generation" field.
- func (u *GroupUpsert) SetAllowImageGeneration(v bool) *GroupUpsert {
- u.Set(group.FieldAllowImageGeneration, v)
- return u
- }
- // UpdateAllowImageGeneration sets the "allow_image_generation" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateAllowImageGeneration() *GroupUpsert {
- u.SetExcluded(group.FieldAllowImageGeneration)
- return u
- }
- // SetAllowBatchImageGeneration sets the "allow_batch_image_generation" field.
- func (u *GroupUpsert) SetAllowBatchImageGeneration(v bool) *GroupUpsert {
- u.Set(group.FieldAllowBatchImageGeneration, v)
- return u
- }
- // UpdateAllowBatchImageGeneration sets the "allow_batch_image_generation" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateAllowBatchImageGeneration() *GroupUpsert {
- u.SetExcluded(group.FieldAllowBatchImageGeneration)
- return u
- }
- // SetImageRateIndependent sets the "image_rate_independent" field.
- func (u *GroupUpsert) SetImageRateIndependent(v bool) *GroupUpsert {
- u.Set(group.FieldImageRateIndependent, v)
- return u
- }
- // UpdateImageRateIndependent sets the "image_rate_independent" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateImageRateIndependent() *GroupUpsert {
- u.SetExcluded(group.FieldImageRateIndependent)
- return u
- }
- // SetImageRateMultiplier sets the "image_rate_multiplier" field.
- func (u *GroupUpsert) SetImageRateMultiplier(v float64) *GroupUpsert {
- u.Set(group.FieldImageRateMultiplier, v)
- return u
- }
- // UpdateImageRateMultiplier sets the "image_rate_multiplier" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateImageRateMultiplier() *GroupUpsert {
- u.SetExcluded(group.FieldImageRateMultiplier)
- return u
- }
- // AddImageRateMultiplier adds v to the "image_rate_multiplier" field.
- func (u *GroupUpsert) AddImageRateMultiplier(v float64) *GroupUpsert {
- u.Add(group.FieldImageRateMultiplier, v)
- return u
- }
- // SetImagePrice1k sets the "image_price_1k" field.
- func (u *GroupUpsert) SetImagePrice1k(v float64) *GroupUpsert {
- u.Set(group.FieldImagePrice1k, v)
- return u
- }
- // UpdateImagePrice1k sets the "image_price_1k" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateImagePrice1k() *GroupUpsert {
- u.SetExcluded(group.FieldImagePrice1k)
- return u
- }
- // AddImagePrice1k adds v to the "image_price_1k" field.
- func (u *GroupUpsert) AddImagePrice1k(v float64) *GroupUpsert {
- u.Add(group.FieldImagePrice1k, v)
- return u
- }
- // ClearImagePrice1k clears the value of the "image_price_1k" field.
- func (u *GroupUpsert) ClearImagePrice1k() *GroupUpsert {
- u.SetNull(group.FieldImagePrice1k)
- return u
- }
- // SetImagePrice2k sets the "image_price_2k" field.
- func (u *GroupUpsert) SetImagePrice2k(v float64) *GroupUpsert {
- u.Set(group.FieldImagePrice2k, v)
- return u
- }
- // UpdateImagePrice2k sets the "image_price_2k" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateImagePrice2k() *GroupUpsert {
- u.SetExcluded(group.FieldImagePrice2k)
- return u
- }
- // AddImagePrice2k adds v to the "image_price_2k" field.
- func (u *GroupUpsert) AddImagePrice2k(v float64) *GroupUpsert {
- u.Add(group.FieldImagePrice2k, v)
- return u
- }
- // ClearImagePrice2k clears the value of the "image_price_2k" field.
- func (u *GroupUpsert) ClearImagePrice2k() *GroupUpsert {
- u.SetNull(group.FieldImagePrice2k)
- return u
- }
- // SetImagePrice4k sets the "image_price_4k" field.
- func (u *GroupUpsert) SetImagePrice4k(v float64) *GroupUpsert {
- u.Set(group.FieldImagePrice4k, v)
- return u
- }
- // UpdateImagePrice4k sets the "image_price_4k" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateImagePrice4k() *GroupUpsert {
- u.SetExcluded(group.FieldImagePrice4k)
- return u
- }
- // AddImagePrice4k adds v to the "image_price_4k" field.
- func (u *GroupUpsert) AddImagePrice4k(v float64) *GroupUpsert {
- u.Add(group.FieldImagePrice4k, v)
- return u
- }
- // ClearImagePrice4k clears the value of the "image_price_4k" field.
- func (u *GroupUpsert) ClearImagePrice4k() *GroupUpsert {
- u.SetNull(group.FieldImagePrice4k)
- return u
- }
- // SetBatchImageDiscountMultiplier sets the "batch_image_discount_multiplier" field.
- func (u *GroupUpsert) SetBatchImageDiscountMultiplier(v float64) *GroupUpsert {
- u.Set(group.FieldBatchImageDiscountMultiplier, v)
- return u
- }
- // UpdateBatchImageDiscountMultiplier sets the "batch_image_discount_multiplier" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateBatchImageDiscountMultiplier() *GroupUpsert {
- u.SetExcluded(group.FieldBatchImageDiscountMultiplier)
- return u
- }
- // AddBatchImageDiscountMultiplier adds v to the "batch_image_discount_multiplier" field.
- func (u *GroupUpsert) AddBatchImageDiscountMultiplier(v float64) *GroupUpsert {
- u.Add(group.FieldBatchImageDiscountMultiplier, v)
- return u
- }
- // SetBatchImageHoldMultiplier sets the "batch_image_hold_multiplier" field.
- func (u *GroupUpsert) SetBatchImageHoldMultiplier(v float64) *GroupUpsert {
- u.Set(group.FieldBatchImageHoldMultiplier, v)
- return u
- }
- // UpdateBatchImageHoldMultiplier sets the "batch_image_hold_multiplier" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateBatchImageHoldMultiplier() *GroupUpsert {
- u.SetExcluded(group.FieldBatchImageHoldMultiplier)
- return u
- }
- // AddBatchImageHoldMultiplier adds v to the "batch_image_hold_multiplier" field.
- func (u *GroupUpsert) AddBatchImageHoldMultiplier(v float64) *GroupUpsert {
- u.Add(group.FieldBatchImageHoldMultiplier, v)
- return u
- }
- // SetVideoRateIndependent sets the "video_rate_independent" field.
- func (u *GroupUpsert) SetVideoRateIndependent(v bool) *GroupUpsert {
- u.Set(group.FieldVideoRateIndependent, v)
- return u
- }
- // UpdateVideoRateIndependent sets the "video_rate_independent" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateVideoRateIndependent() *GroupUpsert {
- u.SetExcluded(group.FieldVideoRateIndependent)
- return u
- }
- // SetVideoRateMultiplier sets the "video_rate_multiplier" field.
- func (u *GroupUpsert) SetVideoRateMultiplier(v float64) *GroupUpsert {
- u.Set(group.FieldVideoRateMultiplier, v)
- return u
- }
- // UpdateVideoRateMultiplier sets the "video_rate_multiplier" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateVideoRateMultiplier() *GroupUpsert {
- u.SetExcluded(group.FieldVideoRateMultiplier)
- return u
- }
- // AddVideoRateMultiplier adds v to the "video_rate_multiplier" field.
- func (u *GroupUpsert) AddVideoRateMultiplier(v float64) *GroupUpsert {
- u.Add(group.FieldVideoRateMultiplier, v)
- return u
- }
- // SetVideoPrice480p sets the "video_price_480p" field.
- func (u *GroupUpsert) SetVideoPrice480p(v float64) *GroupUpsert {
- u.Set(group.FieldVideoPrice480p, v)
- return u
- }
- // UpdateVideoPrice480p sets the "video_price_480p" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateVideoPrice480p() *GroupUpsert {
- u.SetExcluded(group.FieldVideoPrice480p)
- return u
- }
- // AddVideoPrice480p adds v to the "video_price_480p" field.
- func (u *GroupUpsert) AddVideoPrice480p(v float64) *GroupUpsert {
- u.Add(group.FieldVideoPrice480p, v)
- return u
- }
- // ClearVideoPrice480p clears the value of the "video_price_480p" field.
- func (u *GroupUpsert) ClearVideoPrice480p() *GroupUpsert {
- u.SetNull(group.FieldVideoPrice480p)
- return u
- }
- // SetVideoPrice720p sets the "video_price_720p" field.
- func (u *GroupUpsert) SetVideoPrice720p(v float64) *GroupUpsert {
- u.Set(group.FieldVideoPrice720p, v)
- return u
- }
- // UpdateVideoPrice720p sets the "video_price_720p" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateVideoPrice720p() *GroupUpsert {
- u.SetExcluded(group.FieldVideoPrice720p)
- return u
- }
- // AddVideoPrice720p adds v to the "video_price_720p" field.
- func (u *GroupUpsert) AddVideoPrice720p(v float64) *GroupUpsert {
- u.Add(group.FieldVideoPrice720p, v)
- return u
- }
- // ClearVideoPrice720p clears the value of the "video_price_720p" field.
- func (u *GroupUpsert) ClearVideoPrice720p() *GroupUpsert {
- u.SetNull(group.FieldVideoPrice720p)
- return u
- }
- // SetVideoPrice1080p sets the "video_price_1080p" field.
- func (u *GroupUpsert) SetVideoPrice1080p(v float64) *GroupUpsert {
- u.Set(group.FieldVideoPrice1080p, v)
- return u
- }
- // UpdateVideoPrice1080p sets the "video_price_1080p" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateVideoPrice1080p() *GroupUpsert {
- u.SetExcluded(group.FieldVideoPrice1080p)
- return u
- }
- // AddVideoPrice1080p adds v to the "video_price_1080p" field.
- func (u *GroupUpsert) AddVideoPrice1080p(v float64) *GroupUpsert {
- u.Add(group.FieldVideoPrice1080p, v)
- return u
- }
- // ClearVideoPrice1080p clears the value of the "video_price_1080p" field.
- func (u *GroupUpsert) ClearVideoPrice1080p() *GroupUpsert {
- u.SetNull(group.FieldVideoPrice1080p)
- return u
- }
- // SetVideoModelPrices sets the "video_model_prices" field.
- func (u *GroupUpsert) SetVideoModelPrices(v map[string]map[string]float64) *GroupUpsert {
- u.Set(group.FieldVideoModelPrices, v)
- return u
- }
- // UpdateVideoModelPrices sets the "video_model_prices" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateVideoModelPrices() *GroupUpsert {
- u.SetExcluded(group.FieldVideoModelPrices)
- return u
- }
- // ClearVideoModelPrices clears the value of the "video_model_prices" field.
- func (u *GroupUpsert) ClearVideoModelPrices() *GroupUpsert {
- u.SetNull(group.FieldVideoModelPrices)
- return u
- }
- // SetWebSearchPricePerCall sets the "web_search_price_per_call" field.
- func (u *GroupUpsert) SetWebSearchPricePerCall(v float64) *GroupUpsert {
- u.Set(group.FieldWebSearchPricePerCall, v)
- return u
- }
- // UpdateWebSearchPricePerCall sets the "web_search_price_per_call" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateWebSearchPricePerCall() *GroupUpsert {
- u.SetExcluded(group.FieldWebSearchPricePerCall)
- return u
- }
- // AddWebSearchPricePerCall adds v to the "web_search_price_per_call" field.
- func (u *GroupUpsert) AddWebSearchPricePerCall(v float64) *GroupUpsert {
- u.Add(group.FieldWebSearchPricePerCall, v)
- return u
- }
- // ClearWebSearchPricePerCall clears the value of the "web_search_price_per_call" field.
- func (u *GroupUpsert) ClearWebSearchPricePerCall() *GroupUpsert {
- u.SetNull(group.FieldWebSearchPricePerCall)
- return u
- }
- // SetSearchPricePer1k sets the "search_price_per_1k" field.
- func (u *GroupUpsert) SetSearchPricePer1k(v float64) *GroupUpsert {
- u.Set(group.FieldSearchPricePer1k, v)
- return u
- }
- // UpdateSearchPricePer1k sets the "search_price_per_1k" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateSearchPricePer1k() *GroupUpsert {
- u.SetExcluded(group.FieldSearchPricePer1k)
- return u
- }
- // AddSearchPricePer1k adds v to the "search_price_per_1k" field.
- func (u *GroupUpsert) AddSearchPricePer1k(v float64) *GroupUpsert {
- u.Add(group.FieldSearchPricePer1k, v)
- return u
- }
- // ClearSearchPricePer1k clears the value of the "search_price_per_1k" field.
- func (u *GroupUpsert) ClearSearchPricePer1k() *GroupUpsert {
- u.SetNull(group.FieldSearchPricePer1k)
- return u
- }
- // SetAudioRealtimePricePerMin sets the "audio_realtime_price_per_min" field.
- func (u *GroupUpsert) SetAudioRealtimePricePerMin(v float64) *GroupUpsert {
- u.Set(group.FieldAudioRealtimePricePerMin, v)
- return u
- }
- // UpdateAudioRealtimePricePerMin sets the "audio_realtime_price_per_min" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateAudioRealtimePricePerMin() *GroupUpsert {
- u.SetExcluded(group.FieldAudioRealtimePricePerMin)
- return u
- }
- // AddAudioRealtimePricePerMin adds v to the "audio_realtime_price_per_min" field.
- func (u *GroupUpsert) AddAudioRealtimePricePerMin(v float64) *GroupUpsert {
- u.Add(group.FieldAudioRealtimePricePerMin, v)
- return u
- }
- // ClearAudioRealtimePricePerMin clears the value of the "audio_realtime_price_per_min" field.
- func (u *GroupUpsert) ClearAudioRealtimePricePerMin() *GroupUpsert {
- u.SetNull(group.FieldAudioRealtimePricePerMin)
- return u
- }
- // SetAudioTtsPricePerMillionChars sets the "audio_tts_price_per_million_chars" field.
- func (u *GroupUpsert) SetAudioTtsPricePerMillionChars(v float64) *GroupUpsert {
- u.Set(group.FieldAudioTtsPricePerMillionChars, v)
- return u
- }
- // UpdateAudioTtsPricePerMillionChars sets the "audio_tts_price_per_million_chars" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateAudioTtsPricePerMillionChars() *GroupUpsert {
- u.SetExcluded(group.FieldAudioTtsPricePerMillionChars)
- return u
- }
- // AddAudioTtsPricePerMillionChars adds v to the "audio_tts_price_per_million_chars" field.
- func (u *GroupUpsert) AddAudioTtsPricePerMillionChars(v float64) *GroupUpsert {
- u.Add(group.FieldAudioTtsPricePerMillionChars, v)
- return u
- }
- // ClearAudioTtsPricePerMillionChars clears the value of the "audio_tts_price_per_million_chars" field.
- func (u *GroupUpsert) ClearAudioTtsPricePerMillionChars() *GroupUpsert {
- u.SetNull(group.FieldAudioTtsPricePerMillionChars)
- return u
- }
- // SetAudioSttPricePerHour sets the "audio_stt_price_per_hour" field.
- func (u *GroupUpsert) SetAudioSttPricePerHour(v float64) *GroupUpsert {
- u.Set(group.FieldAudioSttPricePerHour, v)
- return u
- }
- // UpdateAudioSttPricePerHour sets the "audio_stt_price_per_hour" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateAudioSttPricePerHour() *GroupUpsert {
- u.SetExcluded(group.FieldAudioSttPricePerHour)
- return u
- }
- // AddAudioSttPricePerHour adds v to the "audio_stt_price_per_hour" field.
- func (u *GroupUpsert) AddAudioSttPricePerHour(v float64) *GroupUpsert {
- u.Add(group.FieldAudioSttPricePerHour, v)
- return u
- }
- // ClearAudioSttPricePerHour clears the value of the "audio_stt_price_per_hour" field.
- func (u *GroupUpsert) ClearAudioSttPricePerHour() *GroupUpsert {
- u.SetNull(group.FieldAudioSttPricePerHour)
- return u
- }
- // SetLongContextPricingEnabled sets the "long_context_pricing_enabled" field.
- func (u *GroupUpsert) SetLongContextPricingEnabled(v bool) *GroupUpsert {
- u.Set(group.FieldLongContextPricingEnabled, v)
- return u
- }
- // UpdateLongContextPricingEnabled sets the "long_context_pricing_enabled" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateLongContextPricingEnabled() *GroupUpsert {
- u.SetExcluded(group.FieldLongContextPricingEnabled)
- return u
- }
- // SetModelPricing sets the "model_pricing" field.
- func (u *GroupUpsert) SetModelPricing(v jsontext.Value) *GroupUpsert {
- u.Set(group.FieldModelPricing, v)
- return u
- }
- // UpdateModelPricing sets the "model_pricing" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateModelPricing() *GroupUpsert {
- u.SetExcluded(group.FieldModelPricing)
- return u
- }
- // ClearModelPricing clears the value of the "model_pricing" field.
- func (u *GroupUpsert) ClearModelPricing() *GroupUpsert {
- u.SetNull(group.FieldModelPricing)
- return u
- }
- // SetClaudeCodeOnly sets the "claude_code_only" field.
- func (u *GroupUpsert) SetClaudeCodeOnly(v bool) *GroupUpsert {
- u.Set(group.FieldClaudeCodeOnly, v)
- return u
- }
- // UpdateClaudeCodeOnly sets the "claude_code_only" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateClaudeCodeOnly() *GroupUpsert {
- u.SetExcluded(group.FieldClaudeCodeOnly)
- return u
- }
- // SetFallbackGroupID sets the "fallback_group_id" field.
- func (u *GroupUpsert) SetFallbackGroupID(v int64) *GroupUpsert {
- u.Set(group.FieldFallbackGroupID, v)
- return u
- }
- // UpdateFallbackGroupID sets the "fallback_group_id" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateFallbackGroupID() *GroupUpsert {
- u.SetExcluded(group.FieldFallbackGroupID)
- return u
- }
- // AddFallbackGroupID adds v to the "fallback_group_id" field.
- func (u *GroupUpsert) AddFallbackGroupID(v int64) *GroupUpsert {
- u.Add(group.FieldFallbackGroupID, v)
- return u
- }
- // ClearFallbackGroupID clears the value of the "fallback_group_id" field.
- func (u *GroupUpsert) ClearFallbackGroupID() *GroupUpsert {
- u.SetNull(group.FieldFallbackGroupID)
- return u
- }
- // SetFallbackGroupIDOnInvalidRequest sets the "fallback_group_id_on_invalid_request" field.
- func (u *GroupUpsert) SetFallbackGroupIDOnInvalidRequest(v int64) *GroupUpsert {
- u.Set(group.FieldFallbackGroupIDOnInvalidRequest, v)
- return u
- }
- // UpdateFallbackGroupIDOnInvalidRequest sets the "fallback_group_id_on_invalid_request" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateFallbackGroupIDOnInvalidRequest() *GroupUpsert {
- u.SetExcluded(group.FieldFallbackGroupIDOnInvalidRequest)
- return u
- }
- // AddFallbackGroupIDOnInvalidRequest adds v to the "fallback_group_id_on_invalid_request" field.
- func (u *GroupUpsert) AddFallbackGroupIDOnInvalidRequest(v int64) *GroupUpsert {
- u.Add(group.FieldFallbackGroupIDOnInvalidRequest, v)
- return u
- }
- // ClearFallbackGroupIDOnInvalidRequest clears the value of the "fallback_group_id_on_invalid_request" field.
- func (u *GroupUpsert) ClearFallbackGroupIDOnInvalidRequest() *GroupUpsert {
- u.SetNull(group.FieldFallbackGroupIDOnInvalidRequest)
- return u
- }
- // SetModelRouting sets the "model_routing" field.
- func (u *GroupUpsert) SetModelRouting(v map[string][]int64) *GroupUpsert {
- u.Set(group.FieldModelRouting, v)
- return u
- }
- // UpdateModelRouting sets the "model_routing" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateModelRouting() *GroupUpsert {
- u.SetExcluded(group.FieldModelRouting)
- return u
- }
- // ClearModelRouting clears the value of the "model_routing" field.
- func (u *GroupUpsert) ClearModelRouting() *GroupUpsert {
- u.SetNull(group.FieldModelRouting)
- return u
- }
- // SetModelRoutingEnabled sets the "model_routing_enabled" field.
- func (u *GroupUpsert) SetModelRoutingEnabled(v bool) *GroupUpsert {
- u.Set(group.FieldModelRoutingEnabled, v)
- return u
- }
- // UpdateModelRoutingEnabled sets the "model_routing_enabled" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateModelRoutingEnabled() *GroupUpsert {
- u.SetExcluded(group.FieldModelRoutingEnabled)
- return u
- }
- // SetMcpXMLInject sets the "mcp_xml_inject" field.
- func (u *GroupUpsert) SetMcpXMLInject(v bool) *GroupUpsert {
- u.Set(group.FieldMcpXMLInject, v)
- return u
- }
- // UpdateMcpXMLInject sets the "mcp_xml_inject" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateMcpXMLInject() *GroupUpsert {
- u.SetExcluded(group.FieldMcpXMLInject)
- return u
- }
- // SetSupportedModelScopes sets the "supported_model_scopes" field.
- func (u *GroupUpsert) SetSupportedModelScopes(v []string) *GroupUpsert {
- u.Set(group.FieldSupportedModelScopes, v)
- return u
- }
- // UpdateSupportedModelScopes sets the "supported_model_scopes" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateSupportedModelScopes() *GroupUpsert {
- u.SetExcluded(group.FieldSupportedModelScopes)
- return u
- }
- // SetSortOrder sets the "sort_order" field.
- func (u *GroupUpsert) SetSortOrder(v int) *GroupUpsert {
- u.Set(group.FieldSortOrder, v)
- return u
- }
- // UpdateSortOrder sets the "sort_order" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateSortOrder() *GroupUpsert {
- u.SetExcluded(group.FieldSortOrder)
- return u
- }
- // AddSortOrder adds v to the "sort_order" field.
- func (u *GroupUpsert) AddSortOrder(v int) *GroupUpsert {
- u.Add(group.FieldSortOrder, v)
- return u
- }
- // SetAllowMessagesDispatch sets the "allow_messages_dispatch" field.
- func (u *GroupUpsert) SetAllowMessagesDispatch(v bool) *GroupUpsert {
- u.Set(group.FieldAllowMessagesDispatch, v)
- return u
- }
- // UpdateAllowMessagesDispatch sets the "allow_messages_dispatch" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateAllowMessagesDispatch() *GroupUpsert {
- u.SetExcluded(group.FieldAllowMessagesDispatch)
- return u
- }
- // SetAllowLive sets the "allow_live" field.
- func (u *GroupUpsert) SetAllowLive(v bool) *GroupUpsert {
- u.Set(group.FieldAllowLive, v)
- return u
- }
- // UpdateAllowLive sets the "allow_live" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateAllowLive() *GroupUpsert {
- u.SetExcluded(group.FieldAllowLive)
- return u
- }
- // SetForceOpenaiFast sets the "force_openai_fast" field.
- func (u *GroupUpsert) SetForceOpenaiFast(v bool) *GroupUpsert {
- u.Set(group.FieldForceOpenaiFast, v)
- return u
- }
- // UpdateForceOpenaiFast sets the "force_openai_fast" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateForceOpenaiFast() *GroupUpsert {
- u.SetExcluded(group.FieldForceOpenaiFast)
- return u
- }
- // SetFreeOpenaiFast sets the "free_openai_fast" field.
- func (u *GroupUpsert) SetFreeOpenaiFast(v bool) *GroupUpsert {
- u.Set(group.FieldFreeOpenaiFast, v)
- return u
- }
- // UpdateFreeOpenaiFast sets the "free_openai_fast" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateFreeOpenaiFast() *GroupUpsert {
- u.SetExcluded(group.FieldFreeOpenaiFast)
- return u
- }
- // SetRequireOauthOnly sets the "require_oauth_only" field.
- func (u *GroupUpsert) SetRequireOauthOnly(v bool) *GroupUpsert {
- u.Set(group.FieldRequireOauthOnly, v)
- return u
- }
- // UpdateRequireOauthOnly sets the "require_oauth_only" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateRequireOauthOnly() *GroupUpsert {
- u.SetExcluded(group.FieldRequireOauthOnly)
- return u
- }
- // SetRequirePrivacySet sets the "require_privacy_set" field.
- func (u *GroupUpsert) SetRequirePrivacySet(v bool) *GroupUpsert {
- u.Set(group.FieldRequirePrivacySet, v)
- return u
- }
- // UpdateRequirePrivacySet sets the "require_privacy_set" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateRequirePrivacySet() *GroupUpsert {
- u.SetExcluded(group.FieldRequirePrivacySet)
- return u
- }
- // SetDefaultMappedModel sets the "default_mapped_model" field.
- func (u *GroupUpsert) SetDefaultMappedModel(v string) *GroupUpsert {
- u.Set(group.FieldDefaultMappedModel, v)
- return u
- }
- // UpdateDefaultMappedModel sets the "default_mapped_model" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateDefaultMappedModel() *GroupUpsert {
- u.SetExcluded(group.FieldDefaultMappedModel)
- return u
- }
- // SetMessagesDispatchModelConfig sets the "messages_dispatch_model_config" field.
- func (u *GroupUpsert) SetMessagesDispatchModelConfig(v domain.OpenAIMessagesDispatchModelConfig) *GroupUpsert {
- u.Set(group.FieldMessagesDispatchModelConfig, v)
- return u
- }
- // UpdateMessagesDispatchModelConfig sets the "messages_dispatch_model_config" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateMessagesDispatchModelConfig() *GroupUpsert {
- u.SetExcluded(group.FieldMessagesDispatchModelConfig)
- return u
- }
- // SetModelAllowlist sets the "model_allowlist" field.
- func (u *GroupUpsert) SetModelAllowlist(v domain.GroupModelAllowlist) *GroupUpsert {
- u.Set(group.FieldModelAllowlist, v)
- return u
- }
- // UpdateModelAllowlist sets the "model_allowlist" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateModelAllowlist() *GroupUpsert {
- u.SetExcluded(group.FieldModelAllowlist)
- return u
- }
- // SetCodexModelsManifestConfig sets the "codex_models_manifest_config" field.
- func (u *GroupUpsert) SetCodexModelsManifestConfig(v domain.GroupCodexModelsManifestConfig) *GroupUpsert {
- u.Set(group.FieldCodexModelsManifestConfig, v)
- return u
- }
- // UpdateCodexModelsManifestConfig sets the "codex_models_manifest_config" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateCodexModelsManifestConfig() *GroupUpsert {
- u.SetExcluded(group.FieldCodexModelsManifestConfig)
- return u
- }
- // SetRpmLimit sets the "rpm_limit" field.
- func (u *GroupUpsert) SetRpmLimit(v int) *GroupUpsert {
- u.Set(group.FieldRpmLimit, v)
- return u
- }
- // UpdateRpmLimit sets the "rpm_limit" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateRpmLimit() *GroupUpsert {
- u.SetExcluded(group.FieldRpmLimit)
- return u
- }
- // AddRpmLimit adds v to the "rpm_limit" field.
- func (u *GroupUpsert) AddRpmLimit(v int) *GroupUpsert {
- u.Add(group.FieldRpmLimit, v)
- return u
- }
- // SetMaxReasoningEffort sets the "max_reasoning_effort" field.
- func (u *GroupUpsert) SetMaxReasoningEffort(v string) *GroupUpsert {
- u.Set(group.FieldMaxReasoningEffort, v)
- return u
- }
- // UpdateMaxReasoningEffort sets the "max_reasoning_effort" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateMaxReasoningEffort() *GroupUpsert {
- u.SetExcluded(group.FieldMaxReasoningEffort)
- return u
- }
- // SetMaxReasoningEffortOverLimit sets the "max_reasoning_effort_over_limit" field.
- func (u *GroupUpsert) SetMaxReasoningEffortOverLimit(v string) *GroupUpsert {
- u.Set(group.FieldMaxReasoningEffortOverLimit, v)
- return u
- }
- // UpdateMaxReasoningEffortOverLimit sets the "max_reasoning_effort_over_limit" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateMaxReasoningEffortOverLimit() *GroupUpsert {
- u.SetExcluded(group.FieldMaxReasoningEffortOverLimit)
- return u
- }
- // SetReasoningEffortMappings sets the "reasoning_effort_mappings" field.
- func (u *GroupUpsert) SetReasoningEffortMappings(v []domain.ReasoningEffortMapping) *GroupUpsert {
- u.Set(group.FieldReasoningEffortMappings, v)
- return u
- }
- // UpdateReasoningEffortMappings sets the "reasoning_effort_mappings" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateReasoningEffortMappings() *GroupUpsert {
- u.SetExcluded(group.FieldReasoningEffortMappings)
- return u
- }
- // SetProfitControlEnabled sets the "profit_control_enabled" field.
- func (u *GroupUpsert) SetProfitControlEnabled(v bool) *GroupUpsert {
- u.Set(group.FieldProfitControlEnabled, v)
- return u
- }
- // UpdateProfitControlEnabled sets the "profit_control_enabled" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateProfitControlEnabled() *GroupUpsert {
- u.SetExcluded(group.FieldProfitControlEnabled)
- return u
- }
- // SetProfitMinMargin sets the "profit_min_margin" field.
- func (u *GroupUpsert) SetProfitMinMargin(v float64) *GroupUpsert {
- u.Set(group.FieldProfitMinMargin, v)
- return u
- }
- // UpdateProfitMinMargin sets the "profit_min_margin" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateProfitMinMargin() *GroupUpsert {
- u.SetExcluded(group.FieldProfitMinMargin)
- return u
- }
- // AddProfitMinMargin adds v to the "profit_min_margin" field.
- func (u *GroupUpsert) AddProfitMinMargin(v float64) *GroupUpsert {
- u.Add(group.FieldProfitMinMargin, v)
- return u
- }
- // SetProfitSafetyBuffer sets the "profit_safety_buffer" field.
- func (u *GroupUpsert) SetProfitSafetyBuffer(v float64) *GroupUpsert {
- u.Set(group.FieldProfitSafetyBuffer, v)
- return u
- }
- // UpdateProfitSafetyBuffer sets the "profit_safety_buffer" field to the value that was provided on create.
- func (u *GroupUpsert) UpdateProfitSafetyBuffer() *GroupUpsert {
- u.SetExcluded(group.FieldProfitSafetyBuffer)
- return u
- }
- // AddProfitSafetyBuffer adds v to the "profit_safety_buffer" field.
- func (u *GroupUpsert) AddProfitSafetyBuffer(v float64) *GroupUpsert {
- u.Add(group.FieldProfitSafetyBuffer, v)
- return u
- }
- // UpdateNewValues updates the mutable fields using the new values that were set on create.
- // Using this option is equivalent to using:
- //
- // client.Group.Create().
- // OnConflict(
- // sql.ResolveWithNewValues(),
- // ).
- // Exec(ctx)
- func (u *GroupUpsertOne) UpdateNewValues() *GroupUpsertOne {
- u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues())
- u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) {
- if _, exists := u.create.mutation.CreatedAt(); exists {
- s.SetIgnore(group.FieldCreatedAt)
- }
- if _, exists := u.create.mutation.DuplicateOperationID(); exists {
- s.SetIgnore(group.FieldDuplicateOperationID)
- }
- }))
- return u
- }
- // Ignore sets each column to itself in case of conflict.
- // Using this option is equivalent to using:
- //
- // client.Group.Create().
- // OnConflict(sql.ResolveWithIgnore()).
- // Exec(ctx)
- func (u *GroupUpsertOne) Ignore() *GroupUpsertOne {
- u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore())
- return u
- }
- // DoNothing configures the conflict_action to `DO NOTHING`.
- // Supported only by SQLite and PostgreSQL.
- func (u *GroupUpsertOne) DoNothing() *GroupUpsertOne {
- u.create.conflict = append(u.create.conflict, sql.DoNothing())
- return u
- }
- // Update allows overriding fields `UPDATE` values. See the GroupCreate.OnConflict
- // documentation for more info.
- func (u *GroupUpsertOne) Update(set func(*GroupUpsert)) *GroupUpsertOne {
- u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
- set(&GroupUpsert{UpdateSet: update})
- }))
- return u
- }
- // SetUpdatedAt sets the "updated_at" field.
- func (u *GroupUpsertOne) SetUpdatedAt(v time.Time) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetUpdatedAt(v)
- })
- }
- // UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateUpdatedAt() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateUpdatedAt()
- })
- }
- // SetDeletedAt sets the "deleted_at" field.
- func (u *GroupUpsertOne) SetDeletedAt(v time.Time) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetDeletedAt(v)
- })
- }
- // UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateDeletedAt() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateDeletedAt()
- })
- }
- // ClearDeletedAt clears the value of the "deleted_at" field.
- func (u *GroupUpsertOne) ClearDeletedAt() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.ClearDeletedAt()
- })
- }
- // SetName sets the "name" field.
- func (u *GroupUpsertOne) SetName(v string) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetName(v)
- })
- }
- // UpdateName sets the "name" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateName() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateName()
- })
- }
- // SetDescription sets the "description" field.
- func (u *GroupUpsertOne) SetDescription(v string) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetDescription(v)
- })
- }
- // UpdateDescription sets the "description" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateDescription() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateDescription()
- })
- }
- // ClearDescription clears the value of the "description" field.
- func (u *GroupUpsertOne) ClearDescription() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.ClearDescription()
- })
- }
- // SetRateMultiplier sets the "rate_multiplier" field.
- func (u *GroupUpsertOne) SetRateMultiplier(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetRateMultiplier(v)
- })
- }
- // AddRateMultiplier adds v to the "rate_multiplier" field.
- func (u *GroupUpsertOne) AddRateMultiplier(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.AddRateMultiplier(v)
- })
- }
- // UpdateRateMultiplier sets the "rate_multiplier" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateRateMultiplier() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateRateMultiplier()
- })
- }
- // SetPeakRateEnabled sets the "peak_rate_enabled" field.
- func (u *GroupUpsertOne) SetPeakRateEnabled(v bool) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetPeakRateEnabled(v)
- })
- }
- // UpdatePeakRateEnabled sets the "peak_rate_enabled" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdatePeakRateEnabled() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdatePeakRateEnabled()
- })
- }
- // SetPeakStart sets the "peak_start" field.
- func (u *GroupUpsertOne) SetPeakStart(v string) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetPeakStart(v)
- })
- }
- // UpdatePeakStart sets the "peak_start" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdatePeakStart() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdatePeakStart()
- })
- }
- // SetPeakEnd sets the "peak_end" field.
- func (u *GroupUpsertOne) SetPeakEnd(v string) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetPeakEnd(v)
- })
- }
- // UpdatePeakEnd sets the "peak_end" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdatePeakEnd() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdatePeakEnd()
- })
- }
- // SetPeakRateMultiplier sets the "peak_rate_multiplier" field.
- func (u *GroupUpsertOne) SetPeakRateMultiplier(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetPeakRateMultiplier(v)
- })
- }
- // AddPeakRateMultiplier adds v to the "peak_rate_multiplier" field.
- func (u *GroupUpsertOne) AddPeakRateMultiplier(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.AddPeakRateMultiplier(v)
- })
- }
- // UpdatePeakRateMultiplier sets the "peak_rate_multiplier" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdatePeakRateMultiplier() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdatePeakRateMultiplier()
- })
- }
- // SetIsExclusive sets the "is_exclusive" field.
- func (u *GroupUpsertOne) SetIsExclusive(v bool) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetIsExclusive(v)
- })
- }
- // UpdateIsExclusive sets the "is_exclusive" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateIsExclusive() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateIsExclusive()
- })
- }
- // SetSecurityPolicyEnabled sets the "security_policy_enabled" field.
- func (u *GroupUpsertOne) SetSecurityPolicyEnabled(v bool) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetSecurityPolicyEnabled(v)
- })
- }
- // UpdateSecurityPolicyEnabled sets the "security_policy_enabled" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateSecurityPolicyEnabled() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateSecurityPolicyEnabled()
- })
- }
- // SetSecurityPolicyMode sets the "security_policy_mode" field.
- func (u *GroupUpsertOne) SetSecurityPolicyMode(v string) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetSecurityPolicyMode(v)
- })
- }
- // UpdateSecurityPolicyMode sets the "security_policy_mode" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateSecurityPolicyMode() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateSecurityPolicyMode()
- })
- }
- // SetSecurityPolicyEmailEnabled sets the "security_policy_email_enabled" field.
- func (u *GroupUpsertOne) SetSecurityPolicyEmailEnabled(v bool) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetSecurityPolicyEmailEnabled(v)
- })
- }
- // UpdateSecurityPolicyEmailEnabled sets the "security_policy_email_enabled" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateSecurityPolicyEmailEnabled() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateSecurityPolicyEmailEnabled()
- })
- }
- // SetStatus sets the "status" field.
- func (u *GroupUpsertOne) SetStatus(v string) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetStatus(v)
- })
- }
- // UpdateStatus sets the "status" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateStatus() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateStatus()
- })
- }
- // SetPlatform sets the "platform" field.
- func (u *GroupUpsertOne) SetPlatform(v string) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetPlatform(v)
- })
- }
- // UpdatePlatform sets the "platform" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdatePlatform() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdatePlatform()
- })
- }
- // SetSubscriptionType sets the "subscription_type" field.
- func (u *GroupUpsertOne) SetSubscriptionType(v string) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetSubscriptionType(v)
- })
- }
- // UpdateSubscriptionType sets the "subscription_type" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateSubscriptionType() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateSubscriptionType()
- })
- }
- // SetDailyLimitUsd sets the "daily_limit_usd" field.
- func (u *GroupUpsertOne) SetDailyLimitUsd(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetDailyLimitUsd(v)
- })
- }
- // AddDailyLimitUsd adds v to the "daily_limit_usd" field.
- func (u *GroupUpsertOne) AddDailyLimitUsd(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.AddDailyLimitUsd(v)
- })
- }
- // UpdateDailyLimitUsd sets the "daily_limit_usd" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateDailyLimitUsd() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateDailyLimitUsd()
- })
- }
- // ClearDailyLimitUsd clears the value of the "daily_limit_usd" field.
- func (u *GroupUpsertOne) ClearDailyLimitUsd() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.ClearDailyLimitUsd()
- })
- }
- // SetWeeklyLimitUsd sets the "weekly_limit_usd" field.
- func (u *GroupUpsertOne) SetWeeklyLimitUsd(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetWeeklyLimitUsd(v)
- })
- }
- // AddWeeklyLimitUsd adds v to the "weekly_limit_usd" field.
- func (u *GroupUpsertOne) AddWeeklyLimitUsd(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.AddWeeklyLimitUsd(v)
- })
- }
- // UpdateWeeklyLimitUsd sets the "weekly_limit_usd" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateWeeklyLimitUsd() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateWeeklyLimitUsd()
- })
- }
- // ClearWeeklyLimitUsd clears the value of the "weekly_limit_usd" field.
- func (u *GroupUpsertOne) ClearWeeklyLimitUsd() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.ClearWeeklyLimitUsd()
- })
- }
- // SetMonthlyLimitUsd sets the "monthly_limit_usd" field.
- func (u *GroupUpsertOne) SetMonthlyLimitUsd(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetMonthlyLimitUsd(v)
- })
- }
- // AddMonthlyLimitUsd adds v to the "monthly_limit_usd" field.
- func (u *GroupUpsertOne) AddMonthlyLimitUsd(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.AddMonthlyLimitUsd(v)
- })
- }
- // UpdateMonthlyLimitUsd sets the "monthly_limit_usd" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateMonthlyLimitUsd() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateMonthlyLimitUsd()
- })
- }
- // ClearMonthlyLimitUsd clears the value of the "monthly_limit_usd" field.
- func (u *GroupUpsertOne) ClearMonthlyLimitUsd() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.ClearMonthlyLimitUsd()
- })
- }
- // SetDefaultValidityDays sets the "default_validity_days" field.
- func (u *GroupUpsertOne) SetDefaultValidityDays(v int) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetDefaultValidityDays(v)
- })
- }
- // AddDefaultValidityDays adds v to the "default_validity_days" field.
- func (u *GroupUpsertOne) AddDefaultValidityDays(v int) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.AddDefaultValidityDays(v)
- })
- }
- // UpdateDefaultValidityDays sets the "default_validity_days" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateDefaultValidityDays() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateDefaultValidityDays()
- })
- }
- // SetAllowImageGeneration sets the "allow_image_generation" field.
- func (u *GroupUpsertOne) SetAllowImageGeneration(v bool) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetAllowImageGeneration(v)
- })
- }
- // UpdateAllowImageGeneration sets the "allow_image_generation" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateAllowImageGeneration() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateAllowImageGeneration()
- })
- }
- // SetAllowBatchImageGeneration sets the "allow_batch_image_generation" field.
- func (u *GroupUpsertOne) SetAllowBatchImageGeneration(v bool) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetAllowBatchImageGeneration(v)
- })
- }
- // UpdateAllowBatchImageGeneration sets the "allow_batch_image_generation" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateAllowBatchImageGeneration() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateAllowBatchImageGeneration()
- })
- }
- // SetImageRateIndependent sets the "image_rate_independent" field.
- func (u *GroupUpsertOne) SetImageRateIndependent(v bool) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetImageRateIndependent(v)
- })
- }
- // UpdateImageRateIndependent sets the "image_rate_independent" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateImageRateIndependent() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateImageRateIndependent()
- })
- }
- // SetImageRateMultiplier sets the "image_rate_multiplier" field.
- func (u *GroupUpsertOne) SetImageRateMultiplier(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetImageRateMultiplier(v)
- })
- }
- // AddImageRateMultiplier adds v to the "image_rate_multiplier" field.
- func (u *GroupUpsertOne) AddImageRateMultiplier(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.AddImageRateMultiplier(v)
- })
- }
- // UpdateImageRateMultiplier sets the "image_rate_multiplier" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateImageRateMultiplier() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateImageRateMultiplier()
- })
- }
- // SetImagePrice1k sets the "image_price_1k" field.
- func (u *GroupUpsertOne) SetImagePrice1k(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetImagePrice1k(v)
- })
- }
- // AddImagePrice1k adds v to the "image_price_1k" field.
- func (u *GroupUpsertOne) AddImagePrice1k(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.AddImagePrice1k(v)
- })
- }
- // UpdateImagePrice1k sets the "image_price_1k" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateImagePrice1k() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateImagePrice1k()
- })
- }
- // ClearImagePrice1k clears the value of the "image_price_1k" field.
- func (u *GroupUpsertOne) ClearImagePrice1k() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.ClearImagePrice1k()
- })
- }
- // SetImagePrice2k sets the "image_price_2k" field.
- func (u *GroupUpsertOne) SetImagePrice2k(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetImagePrice2k(v)
- })
- }
- // AddImagePrice2k adds v to the "image_price_2k" field.
- func (u *GroupUpsertOne) AddImagePrice2k(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.AddImagePrice2k(v)
- })
- }
- // UpdateImagePrice2k sets the "image_price_2k" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateImagePrice2k() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateImagePrice2k()
- })
- }
- // ClearImagePrice2k clears the value of the "image_price_2k" field.
- func (u *GroupUpsertOne) ClearImagePrice2k() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.ClearImagePrice2k()
- })
- }
- // SetImagePrice4k sets the "image_price_4k" field.
- func (u *GroupUpsertOne) SetImagePrice4k(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetImagePrice4k(v)
- })
- }
- // AddImagePrice4k adds v to the "image_price_4k" field.
- func (u *GroupUpsertOne) AddImagePrice4k(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.AddImagePrice4k(v)
- })
- }
- // UpdateImagePrice4k sets the "image_price_4k" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateImagePrice4k() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateImagePrice4k()
- })
- }
- // ClearImagePrice4k clears the value of the "image_price_4k" field.
- func (u *GroupUpsertOne) ClearImagePrice4k() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.ClearImagePrice4k()
- })
- }
- // SetBatchImageDiscountMultiplier sets the "batch_image_discount_multiplier" field.
- func (u *GroupUpsertOne) SetBatchImageDiscountMultiplier(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetBatchImageDiscountMultiplier(v)
- })
- }
- // AddBatchImageDiscountMultiplier adds v to the "batch_image_discount_multiplier" field.
- func (u *GroupUpsertOne) AddBatchImageDiscountMultiplier(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.AddBatchImageDiscountMultiplier(v)
- })
- }
- // UpdateBatchImageDiscountMultiplier sets the "batch_image_discount_multiplier" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateBatchImageDiscountMultiplier() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateBatchImageDiscountMultiplier()
- })
- }
- // SetBatchImageHoldMultiplier sets the "batch_image_hold_multiplier" field.
- func (u *GroupUpsertOne) SetBatchImageHoldMultiplier(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetBatchImageHoldMultiplier(v)
- })
- }
- // AddBatchImageHoldMultiplier adds v to the "batch_image_hold_multiplier" field.
- func (u *GroupUpsertOne) AddBatchImageHoldMultiplier(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.AddBatchImageHoldMultiplier(v)
- })
- }
- // UpdateBatchImageHoldMultiplier sets the "batch_image_hold_multiplier" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateBatchImageHoldMultiplier() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateBatchImageHoldMultiplier()
- })
- }
- // SetVideoRateIndependent sets the "video_rate_independent" field.
- func (u *GroupUpsertOne) SetVideoRateIndependent(v bool) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetVideoRateIndependent(v)
- })
- }
- // UpdateVideoRateIndependent sets the "video_rate_independent" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateVideoRateIndependent() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateVideoRateIndependent()
- })
- }
- // SetVideoRateMultiplier sets the "video_rate_multiplier" field.
- func (u *GroupUpsertOne) SetVideoRateMultiplier(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetVideoRateMultiplier(v)
- })
- }
- // AddVideoRateMultiplier adds v to the "video_rate_multiplier" field.
- func (u *GroupUpsertOne) AddVideoRateMultiplier(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.AddVideoRateMultiplier(v)
- })
- }
- // UpdateVideoRateMultiplier sets the "video_rate_multiplier" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateVideoRateMultiplier() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateVideoRateMultiplier()
- })
- }
- // SetVideoPrice480p sets the "video_price_480p" field.
- func (u *GroupUpsertOne) SetVideoPrice480p(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetVideoPrice480p(v)
- })
- }
- // AddVideoPrice480p adds v to the "video_price_480p" field.
- func (u *GroupUpsertOne) AddVideoPrice480p(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.AddVideoPrice480p(v)
- })
- }
- // UpdateVideoPrice480p sets the "video_price_480p" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateVideoPrice480p() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateVideoPrice480p()
- })
- }
- // ClearVideoPrice480p clears the value of the "video_price_480p" field.
- func (u *GroupUpsertOne) ClearVideoPrice480p() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.ClearVideoPrice480p()
- })
- }
- // SetVideoPrice720p sets the "video_price_720p" field.
- func (u *GroupUpsertOne) SetVideoPrice720p(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetVideoPrice720p(v)
- })
- }
- // AddVideoPrice720p adds v to the "video_price_720p" field.
- func (u *GroupUpsertOne) AddVideoPrice720p(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.AddVideoPrice720p(v)
- })
- }
- // UpdateVideoPrice720p sets the "video_price_720p" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateVideoPrice720p() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateVideoPrice720p()
- })
- }
- // ClearVideoPrice720p clears the value of the "video_price_720p" field.
- func (u *GroupUpsertOne) ClearVideoPrice720p() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.ClearVideoPrice720p()
- })
- }
- // SetVideoPrice1080p sets the "video_price_1080p" field.
- func (u *GroupUpsertOne) SetVideoPrice1080p(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetVideoPrice1080p(v)
- })
- }
- // AddVideoPrice1080p adds v to the "video_price_1080p" field.
- func (u *GroupUpsertOne) AddVideoPrice1080p(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.AddVideoPrice1080p(v)
- })
- }
- // UpdateVideoPrice1080p sets the "video_price_1080p" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateVideoPrice1080p() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateVideoPrice1080p()
- })
- }
- // ClearVideoPrice1080p clears the value of the "video_price_1080p" field.
- func (u *GroupUpsertOne) ClearVideoPrice1080p() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.ClearVideoPrice1080p()
- })
- }
- // SetVideoModelPrices sets the "video_model_prices" field.
- func (u *GroupUpsertOne) SetVideoModelPrices(v map[string]map[string]float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetVideoModelPrices(v)
- })
- }
- // UpdateVideoModelPrices sets the "video_model_prices" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateVideoModelPrices() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateVideoModelPrices()
- })
- }
- // ClearVideoModelPrices clears the value of the "video_model_prices" field.
- func (u *GroupUpsertOne) ClearVideoModelPrices() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.ClearVideoModelPrices()
- })
- }
- // SetWebSearchPricePerCall sets the "web_search_price_per_call" field.
- func (u *GroupUpsertOne) SetWebSearchPricePerCall(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetWebSearchPricePerCall(v)
- })
- }
- // AddWebSearchPricePerCall adds v to the "web_search_price_per_call" field.
- func (u *GroupUpsertOne) AddWebSearchPricePerCall(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.AddWebSearchPricePerCall(v)
- })
- }
- // UpdateWebSearchPricePerCall sets the "web_search_price_per_call" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateWebSearchPricePerCall() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateWebSearchPricePerCall()
- })
- }
- // ClearWebSearchPricePerCall clears the value of the "web_search_price_per_call" field.
- func (u *GroupUpsertOne) ClearWebSearchPricePerCall() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.ClearWebSearchPricePerCall()
- })
- }
- // SetSearchPricePer1k sets the "search_price_per_1k" field.
- func (u *GroupUpsertOne) SetSearchPricePer1k(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetSearchPricePer1k(v)
- })
- }
- // AddSearchPricePer1k adds v to the "search_price_per_1k" field.
- func (u *GroupUpsertOne) AddSearchPricePer1k(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.AddSearchPricePer1k(v)
- })
- }
- // UpdateSearchPricePer1k sets the "search_price_per_1k" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateSearchPricePer1k() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateSearchPricePer1k()
- })
- }
- // ClearSearchPricePer1k clears the value of the "search_price_per_1k" field.
- func (u *GroupUpsertOne) ClearSearchPricePer1k() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.ClearSearchPricePer1k()
- })
- }
- // SetAudioRealtimePricePerMin sets the "audio_realtime_price_per_min" field.
- func (u *GroupUpsertOne) SetAudioRealtimePricePerMin(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetAudioRealtimePricePerMin(v)
- })
- }
- // AddAudioRealtimePricePerMin adds v to the "audio_realtime_price_per_min" field.
- func (u *GroupUpsertOne) AddAudioRealtimePricePerMin(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.AddAudioRealtimePricePerMin(v)
- })
- }
- // UpdateAudioRealtimePricePerMin sets the "audio_realtime_price_per_min" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateAudioRealtimePricePerMin() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateAudioRealtimePricePerMin()
- })
- }
- // ClearAudioRealtimePricePerMin clears the value of the "audio_realtime_price_per_min" field.
- func (u *GroupUpsertOne) ClearAudioRealtimePricePerMin() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.ClearAudioRealtimePricePerMin()
- })
- }
- // SetAudioTtsPricePerMillionChars sets the "audio_tts_price_per_million_chars" field.
- func (u *GroupUpsertOne) SetAudioTtsPricePerMillionChars(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetAudioTtsPricePerMillionChars(v)
- })
- }
- // AddAudioTtsPricePerMillionChars adds v to the "audio_tts_price_per_million_chars" field.
- func (u *GroupUpsertOne) AddAudioTtsPricePerMillionChars(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.AddAudioTtsPricePerMillionChars(v)
- })
- }
- // UpdateAudioTtsPricePerMillionChars sets the "audio_tts_price_per_million_chars" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateAudioTtsPricePerMillionChars() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateAudioTtsPricePerMillionChars()
- })
- }
- // ClearAudioTtsPricePerMillionChars clears the value of the "audio_tts_price_per_million_chars" field.
- func (u *GroupUpsertOne) ClearAudioTtsPricePerMillionChars() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.ClearAudioTtsPricePerMillionChars()
- })
- }
- // SetAudioSttPricePerHour sets the "audio_stt_price_per_hour" field.
- func (u *GroupUpsertOne) SetAudioSttPricePerHour(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetAudioSttPricePerHour(v)
- })
- }
- // AddAudioSttPricePerHour adds v to the "audio_stt_price_per_hour" field.
- func (u *GroupUpsertOne) AddAudioSttPricePerHour(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.AddAudioSttPricePerHour(v)
- })
- }
- // UpdateAudioSttPricePerHour sets the "audio_stt_price_per_hour" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateAudioSttPricePerHour() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateAudioSttPricePerHour()
- })
- }
- // ClearAudioSttPricePerHour clears the value of the "audio_stt_price_per_hour" field.
- func (u *GroupUpsertOne) ClearAudioSttPricePerHour() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.ClearAudioSttPricePerHour()
- })
- }
- // SetLongContextPricingEnabled sets the "long_context_pricing_enabled" field.
- func (u *GroupUpsertOne) SetLongContextPricingEnabled(v bool) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetLongContextPricingEnabled(v)
- })
- }
- // UpdateLongContextPricingEnabled sets the "long_context_pricing_enabled" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateLongContextPricingEnabled() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateLongContextPricingEnabled()
- })
- }
- // SetModelPricing sets the "model_pricing" field.
- func (u *GroupUpsertOne) SetModelPricing(v jsontext.Value) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetModelPricing(v)
- })
- }
- // UpdateModelPricing sets the "model_pricing" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateModelPricing() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateModelPricing()
- })
- }
- // ClearModelPricing clears the value of the "model_pricing" field.
- func (u *GroupUpsertOne) ClearModelPricing() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.ClearModelPricing()
- })
- }
- // SetClaudeCodeOnly sets the "claude_code_only" field.
- func (u *GroupUpsertOne) SetClaudeCodeOnly(v bool) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetClaudeCodeOnly(v)
- })
- }
- // UpdateClaudeCodeOnly sets the "claude_code_only" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateClaudeCodeOnly() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateClaudeCodeOnly()
- })
- }
- // SetFallbackGroupID sets the "fallback_group_id" field.
- func (u *GroupUpsertOne) SetFallbackGroupID(v int64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetFallbackGroupID(v)
- })
- }
- // AddFallbackGroupID adds v to the "fallback_group_id" field.
- func (u *GroupUpsertOne) AddFallbackGroupID(v int64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.AddFallbackGroupID(v)
- })
- }
- // UpdateFallbackGroupID sets the "fallback_group_id" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateFallbackGroupID() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateFallbackGroupID()
- })
- }
- // ClearFallbackGroupID clears the value of the "fallback_group_id" field.
- func (u *GroupUpsertOne) ClearFallbackGroupID() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.ClearFallbackGroupID()
- })
- }
- // SetFallbackGroupIDOnInvalidRequest sets the "fallback_group_id_on_invalid_request" field.
- func (u *GroupUpsertOne) SetFallbackGroupIDOnInvalidRequest(v int64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetFallbackGroupIDOnInvalidRequest(v)
- })
- }
- // AddFallbackGroupIDOnInvalidRequest adds v to the "fallback_group_id_on_invalid_request" field.
- func (u *GroupUpsertOne) AddFallbackGroupIDOnInvalidRequest(v int64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.AddFallbackGroupIDOnInvalidRequest(v)
- })
- }
- // UpdateFallbackGroupIDOnInvalidRequest sets the "fallback_group_id_on_invalid_request" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateFallbackGroupIDOnInvalidRequest() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateFallbackGroupIDOnInvalidRequest()
- })
- }
- // ClearFallbackGroupIDOnInvalidRequest clears the value of the "fallback_group_id_on_invalid_request" field.
- func (u *GroupUpsertOne) ClearFallbackGroupIDOnInvalidRequest() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.ClearFallbackGroupIDOnInvalidRequest()
- })
- }
- // SetModelRouting sets the "model_routing" field.
- func (u *GroupUpsertOne) SetModelRouting(v map[string][]int64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetModelRouting(v)
- })
- }
- // UpdateModelRouting sets the "model_routing" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateModelRouting() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateModelRouting()
- })
- }
- // ClearModelRouting clears the value of the "model_routing" field.
- func (u *GroupUpsertOne) ClearModelRouting() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.ClearModelRouting()
- })
- }
- // SetModelRoutingEnabled sets the "model_routing_enabled" field.
- func (u *GroupUpsertOne) SetModelRoutingEnabled(v bool) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetModelRoutingEnabled(v)
- })
- }
- // UpdateModelRoutingEnabled sets the "model_routing_enabled" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateModelRoutingEnabled() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateModelRoutingEnabled()
- })
- }
- // SetMcpXMLInject sets the "mcp_xml_inject" field.
- func (u *GroupUpsertOne) SetMcpXMLInject(v bool) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetMcpXMLInject(v)
- })
- }
- // UpdateMcpXMLInject sets the "mcp_xml_inject" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateMcpXMLInject() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateMcpXMLInject()
- })
- }
- // SetSupportedModelScopes sets the "supported_model_scopes" field.
- func (u *GroupUpsertOne) SetSupportedModelScopes(v []string) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetSupportedModelScopes(v)
- })
- }
- // UpdateSupportedModelScopes sets the "supported_model_scopes" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateSupportedModelScopes() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateSupportedModelScopes()
- })
- }
- // SetSortOrder sets the "sort_order" field.
- func (u *GroupUpsertOne) SetSortOrder(v int) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetSortOrder(v)
- })
- }
- // AddSortOrder adds v to the "sort_order" field.
- func (u *GroupUpsertOne) AddSortOrder(v int) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.AddSortOrder(v)
- })
- }
- // UpdateSortOrder sets the "sort_order" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateSortOrder() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateSortOrder()
- })
- }
- // SetAllowMessagesDispatch sets the "allow_messages_dispatch" field.
- func (u *GroupUpsertOne) SetAllowMessagesDispatch(v bool) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetAllowMessagesDispatch(v)
- })
- }
- // UpdateAllowMessagesDispatch sets the "allow_messages_dispatch" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateAllowMessagesDispatch() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateAllowMessagesDispatch()
- })
- }
- // SetAllowLive sets the "allow_live" field.
- func (u *GroupUpsertOne) SetAllowLive(v bool) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetAllowLive(v)
- })
- }
- // UpdateAllowLive sets the "allow_live" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateAllowLive() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateAllowLive()
- })
- }
- // SetForceOpenaiFast sets the "force_openai_fast" field.
- func (u *GroupUpsertOne) SetForceOpenaiFast(v bool) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetForceOpenaiFast(v)
- })
- }
- // UpdateForceOpenaiFast sets the "force_openai_fast" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateForceOpenaiFast() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateForceOpenaiFast()
- })
- }
- // SetFreeOpenaiFast sets the "free_openai_fast" field.
- func (u *GroupUpsertOne) SetFreeOpenaiFast(v bool) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetFreeOpenaiFast(v)
- })
- }
- // UpdateFreeOpenaiFast sets the "free_openai_fast" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateFreeOpenaiFast() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateFreeOpenaiFast()
- })
- }
- // SetRequireOauthOnly sets the "require_oauth_only" field.
- func (u *GroupUpsertOne) SetRequireOauthOnly(v bool) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetRequireOauthOnly(v)
- })
- }
- // UpdateRequireOauthOnly sets the "require_oauth_only" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateRequireOauthOnly() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateRequireOauthOnly()
- })
- }
- // SetRequirePrivacySet sets the "require_privacy_set" field.
- func (u *GroupUpsertOne) SetRequirePrivacySet(v bool) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetRequirePrivacySet(v)
- })
- }
- // UpdateRequirePrivacySet sets the "require_privacy_set" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateRequirePrivacySet() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateRequirePrivacySet()
- })
- }
- // SetDefaultMappedModel sets the "default_mapped_model" field.
- func (u *GroupUpsertOne) SetDefaultMappedModel(v string) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetDefaultMappedModel(v)
- })
- }
- // UpdateDefaultMappedModel sets the "default_mapped_model" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateDefaultMappedModel() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateDefaultMappedModel()
- })
- }
- // SetMessagesDispatchModelConfig sets the "messages_dispatch_model_config" field.
- func (u *GroupUpsertOne) SetMessagesDispatchModelConfig(v domain.OpenAIMessagesDispatchModelConfig) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetMessagesDispatchModelConfig(v)
- })
- }
- // UpdateMessagesDispatchModelConfig sets the "messages_dispatch_model_config" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateMessagesDispatchModelConfig() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateMessagesDispatchModelConfig()
- })
- }
- // SetModelAllowlist sets the "model_allowlist" field.
- func (u *GroupUpsertOne) SetModelAllowlist(v domain.GroupModelAllowlist) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetModelAllowlist(v)
- })
- }
- // UpdateModelAllowlist sets the "model_allowlist" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateModelAllowlist() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateModelAllowlist()
- })
- }
- // SetCodexModelsManifestConfig sets the "codex_models_manifest_config" field.
- func (u *GroupUpsertOne) SetCodexModelsManifestConfig(v domain.GroupCodexModelsManifestConfig) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetCodexModelsManifestConfig(v)
- })
- }
- // UpdateCodexModelsManifestConfig sets the "codex_models_manifest_config" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateCodexModelsManifestConfig() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateCodexModelsManifestConfig()
- })
- }
- // SetRpmLimit sets the "rpm_limit" field.
- func (u *GroupUpsertOne) SetRpmLimit(v int) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetRpmLimit(v)
- })
- }
- // AddRpmLimit adds v to the "rpm_limit" field.
- func (u *GroupUpsertOne) AddRpmLimit(v int) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.AddRpmLimit(v)
- })
- }
- // UpdateRpmLimit sets the "rpm_limit" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateRpmLimit() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateRpmLimit()
- })
- }
- // SetMaxReasoningEffort sets the "max_reasoning_effort" field.
- func (u *GroupUpsertOne) SetMaxReasoningEffort(v string) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetMaxReasoningEffort(v)
- })
- }
- // UpdateMaxReasoningEffort sets the "max_reasoning_effort" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateMaxReasoningEffort() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateMaxReasoningEffort()
- })
- }
- // SetMaxReasoningEffortOverLimit sets the "max_reasoning_effort_over_limit" field.
- func (u *GroupUpsertOne) SetMaxReasoningEffortOverLimit(v string) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetMaxReasoningEffortOverLimit(v)
- })
- }
- // UpdateMaxReasoningEffortOverLimit sets the "max_reasoning_effort_over_limit" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateMaxReasoningEffortOverLimit() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateMaxReasoningEffortOverLimit()
- })
- }
- // SetReasoningEffortMappings sets the "reasoning_effort_mappings" field.
- func (u *GroupUpsertOne) SetReasoningEffortMappings(v []domain.ReasoningEffortMapping) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetReasoningEffortMappings(v)
- })
- }
- // UpdateReasoningEffortMappings sets the "reasoning_effort_mappings" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateReasoningEffortMappings() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateReasoningEffortMappings()
- })
- }
- // SetProfitControlEnabled sets the "profit_control_enabled" field.
- func (u *GroupUpsertOne) SetProfitControlEnabled(v bool) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetProfitControlEnabled(v)
- })
- }
- // UpdateProfitControlEnabled sets the "profit_control_enabled" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateProfitControlEnabled() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateProfitControlEnabled()
- })
- }
- // SetProfitMinMargin sets the "profit_min_margin" field.
- func (u *GroupUpsertOne) SetProfitMinMargin(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetProfitMinMargin(v)
- })
- }
- // AddProfitMinMargin adds v to the "profit_min_margin" field.
- func (u *GroupUpsertOne) AddProfitMinMargin(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.AddProfitMinMargin(v)
- })
- }
- // UpdateProfitMinMargin sets the "profit_min_margin" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateProfitMinMargin() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateProfitMinMargin()
- })
- }
- // SetProfitSafetyBuffer sets the "profit_safety_buffer" field.
- func (u *GroupUpsertOne) SetProfitSafetyBuffer(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.SetProfitSafetyBuffer(v)
- })
- }
- // AddProfitSafetyBuffer adds v to the "profit_safety_buffer" field.
- func (u *GroupUpsertOne) AddProfitSafetyBuffer(v float64) *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.AddProfitSafetyBuffer(v)
- })
- }
- // UpdateProfitSafetyBuffer sets the "profit_safety_buffer" field to the value that was provided on create.
- func (u *GroupUpsertOne) UpdateProfitSafetyBuffer() *GroupUpsertOne {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateProfitSafetyBuffer()
- })
- }
- // Exec executes the query.
- func (u *GroupUpsertOne) Exec(ctx context.Context) error {
- if len(u.create.conflict) == 0 {
- return errors.New("ent: missing options for GroupCreate.OnConflict")
- }
- return u.create.Exec(ctx)
- }
- // ExecX is like Exec, but panics if an error occurs.
- func (u *GroupUpsertOne) ExecX(ctx context.Context) {
- if err := u.create.Exec(ctx); err != nil {
- panic(err)
- }
- }
- // Exec executes the UPSERT query and returns the inserted/updated ID.
- func (u *GroupUpsertOne) ID(ctx context.Context) (id int64, err error) {
- node, err := u.create.Save(ctx)
- if err != nil {
- return id, err
- }
- return node.ID, nil
- }
- // IDX is like ID, but panics if an error occurs.
- func (u *GroupUpsertOne) IDX(ctx context.Context) int64 {
- id, err := u.ID(ctx)
- if err != nil {
- panic(err)
- }
- return id
- }
- // GroupCreateBulk is the builder for creating many Group entities in bulk.
- type GroupCreateBulk struct {
- config
- err error
- builders []*GroupCreate
- conflict []sql.ConflictOption
- }
- // Save creates the Group entities in the database.
- func (_c *GroupCreateBulk) Save(ctx context.Context) ([]*Group, error) {
- if _c.err != nil {
- return nil, _c.err
- }
- specs := make([]*sqlgraph.CreateSpec, len(_c.builders))
- nodes := make([]*Group, len(_c.builders))
- mutators := make([]Mutator, len(_c.builders))
- for i := range _c.builders {
- func(i int, root context.Context) {
- builder := _c.builders[i]
- builder.defaults()
- var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
- mutation, ok := m.(*GroupMutation)
- if !ok {
- return nil, fmt.Errorf("unexpected mutation type %T", m)
- }
- if err := builder.check(); err != nil {
- return nil, err
- }
- builder.mutation = mutation
- var err error
- nodes[i], specs[i] = builder.createSpec()
- if i < len(mutators)-1 {
- _, err = mutators[i+1].Mutate(root, _c.builders[i+1].mutation)
- } else {
- spec := &sqlgraph.BatchCreateSpec{Nodes: specs}
- spec.OnConflict = _c.conflict
- // Invoke the actual operation on the latest mutation in the chain.
- if err = sqlgraph.BatchCreate(ctx, _c.driver, spec); err != nil {
- if sqlgraph.IsConstraintError(err) {
- err = &ConstraintError{msg: err.Error(), wrap: err}
- }
- }
- }
- if err != nil {
- return nil, err
- }
- mutation.id = &nodes[i].ID
- if specs[i].ID.Value != nil {
- id := specs[i].ID.Value.(int64)
- nodes[i].ID = int64(id)
- }
- mutation.done = true
- return nodes[i], nil
- })
- for i := len(builder.hooks) - 1; i >= 0; i-- {
- mut = builder.hooks[i](mut)
- }
- mutators[i] = mut
- }(i, ctx)
- }
- if len(mutators) > 0 {
- if _, err := mutators[0].Mutate(ctx, _c.builders[0].mutation); err != nil {
- return nil, err
- }
- }
- return nodes, nil
- }
- // SaveX is like Save, but panics if an error occurs.
- func (_c *GroupCreateBulk) SaveX(ctx context.Context) []*Group {
- v, err := _c.Save(ctx)
- if err != nil {
- panic(err)
- }
- return v
- }
- // Exec executes the query.
- func (_c *GroupCreateBulk) Exec(ctx context.Context) error {
- _, err := _c.Save(ctx)
- return err
- }
- // ExecX is like Exec, but panics if an error occurs.
- func (_c *GroupCreateBulk) ExecX(ctx context.Context) {
- if err := _c.Exec(ctx); err != nil {
- panic(err)
- }
- }
- // OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
- // of the `INSERT` statement. For example:
- //
- // client.Group.CreateBulk(builders...).
- // OnConflict(
- // // Update the row with the new values
- // // the was proposed for insertion.
- // sql.ResolveWithNewValues(),
- // ).
- // // Override some of the fields with custom
- // // update values.
- // Update(func(u *ent.GroupUpsert) {
- // SetCreatedAt(v+v).
- // }).
- // Exec(ctx)
- func (_c *GroupCreateBulk) OnConflict(opts ...sql.ConflictOption) *GroupUpsertBulk {
- _c.conflict = opts
- return &GroupUpsertBulk{
- create: _c,
- }
- }
- // OnConflictColumns calls `OnConflict` and configures the columns
- // as conflict target. Using this option is equivalent to using:
- //
- // client.Group.Create().
- // OnConflict(sql.ConflictColumns(columns...)).
- // Exec(ctx)
- func (_c *GroupCreateBulk) OnConflictColumns(columns ...string) *GroupUpsertBulk {
- _c.conflict = append(_c.conflict, sql.ConflictColumns(columns...))
- return &GroupUpsertBulk{
- create: _c,
- }
- }
- // GroupUpsertBulk is the builder for "upsert"-ing
- // a bulk of Group nodes.
- type GroupUpsertBulk struct {
- create *GroupCreateBulk
- }
- // UpdateNewValues updates the mutable fields using the new values that
- // were set on create. Using this option is equivalent to using:
- //
- // client.Group.Create().
- // OnConflict(
- // sql.ResolveWithNewValues(),
- // ).
- // Exec(ctx)
- func (u *GroupUpsertBulk) UpdateNewValues() *GroupUpsertBulk {
- u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues())
- u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) {
- for _, b := range u.create.builders {
- if _, exists := b.mutation.CreatedAt(); exists {
- s.SetIgnore(group.FieldCreatedAt)
- }
- if _, exists := b.mutation.DuplicateOperationID(); exists {
- s.SetIgnore(group.FieldDuplicateOperationID)
- }
- }
- }))
- return u
- }
- // Ignore sets each column to itself in case of conflict.
- // Using this option is equivalent to using:
- //
- // client.Group.Create().
- // OnConflict(sql.ResolveWithIgnore()).
- // Exec(ctx)
- func (u *GroupUpsertBulk) Ignore() *GroupUpsertBulk {
- u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore())
- return u
- }
- // DoNothing configures the conflict_action to `DO NOTHING`.
- // Supported only by SQLite and PostgreSQL.
- func (u *GroupUpsertBulk) DoNothing() *GroupUpsertBulk {
- u.create.conflict = append(u.create.conflict, sql.DoNothing())
- return u
- }
- // Update allows overriding fields `UPDATE` values. See the GroupCreateBulk.OnConflict
- // documentation for more info.
- func (u *GroupUpsertBulk) Update(set func(*GroupUpsert)) *GroupUpsertBulk {
- u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
- set(&GroupUpsert{UpdateSet: update})
- }))
- return u
- }
- // SetUpdatedAt sets the "updated_at" field.
- func (u *GroupUpsertBulk) SetUpdatedAt(v time.Time) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetUpdatedAt(v)
- })
- }
- // UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateUpdatedAt() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateUpdatedAt()
- })
- }
- // SetDeletedAt sets the "deleted_at" field.
- func (u *GroupUpsertBulk) SetDeletedAt(v time.Time) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetDeletedAt(v)
- })
- }
- // UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateDeletedAt() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateDeletedAt()
- })
- }
- // ClearDeletedAt clears the value of the "deleted_at" field.
- func (u *GroupUpsertBulk) ClearDeletedAt() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.ClearDeletedAt()
- })
- }
- // SetName sets the "name" field.
- func (u *GroupUpsertBulk) SetName(v string) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetName(v)
- })
- }
- // UpdateName sets the "name" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateName() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateName()
- })
- }
- // SetDescription sets the "description" field.
- func (u *GroupUpsertBulk) SetDescription(v string) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetDescription(v)
- })
- }
- // UpdateDescription sets the "description" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateDescription() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateDescription()
- })
- }
- // ClearDescription clears the value of the "description" field.
- func (u *GroupUpsertBulk) ClearDescription() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.ClearDescription()
- })
- }
- // SetRateMultiplier sets the "rate_multiplier" field.
- func (u *GroupUpsertBulk) SetRateMultiplier(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetRateMultiplier(v)
- })
- }
- // AddRateMultiplier adds v to the "rate_multiplier" field.
- func (u *GroupUpsertBulk) AddRateMultiplier(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.AddRateMultiplier(v)
- })
- }
- // UpdateRateMultiplier sets the "rate_multiplier" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateRateMultiplier() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateRateMultiplier()
- })
- }
- // SetPeakRateEnabled sets the "peak_rate_enabled" field.
- func (u *GroupUpsertBulk) SetPeakRateEnabled(v bool) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetPeakRateEnabled(v)
- })
- }
- // UpdatePeakRateEnabled sets the "peak_rate_enabled" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdatePeakRateEnabled() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdatePeakRateEnabled()
- })
- }
- // SetPeakStart sets the "peak_start" field.
- func (u *GroupUpsertBulk) SetPeakStart(v string) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetPeakStart(v)
- })
- }
- // UpdatePeakStart sets the "peak_start" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdatePeakStart() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdatePeakStart()
- })
- }
- // SetPeakEnd sets the "peak_end" field.
- func (u *GroupUpsertBulk) SetPeakEnd(v string) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetPeakEnd(v)
- })
- }
- // UpdatePeakEnd sets the "peak_end" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdatePeakEnd() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdatePeakEnd()
- })
- }
- // SetPeakRateMultiplier sets the "peak_rate_multiplier" field.
- func (u *GroupUpsertBulk) SetPeakRateMultiplier(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetPeakRateMultiplier(v)
- })
- }
- // AddPeakRateMultiplier adds v to the "peak_rate_multiplier" field.
- func (u *GroupUpsertBulk) AddPeakRateMultiplier(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.AddPeakRateMultiplier(v)
- })
- }
- // UpdatePeakRateMultiplier sets the "peak_rate_multiplier" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdatePeakRateMultiplier() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdatePeakRateMultiplier()
- })
- }
- // SetIsExclusive sets the "is_exclusive" field.
- func (u *GroupUpsertBulk) SetIsExclusive(v bool) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetIsExclusive(v)
- })
- }
- // UpdateIsExclusive sets the "is_exclusive" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateIsExclusive() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateIsExclusive()
- })
- }
- // SetSecurityPolicyEnabled sets the "security_policy_enabled" field.
- func (u *GroupUpsertBulk) SetSecurityPolicyEnabled(v bool) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetSecurityPolicyEnabled(v)
- })
- }
- // UpdateSecurityPolicyEnabled sets the "security_policy_enabled" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateSecurityPolicyEnabled() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateSecurityPolicyEnabled()
- })
- }
- // SetSecurityPolicyMode sets the "security_policy_mode" field.
- func (u *GroupUpsertBulk) SetSecurityPolicyMode(v string) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetSecurityPolicyMode(v)
- })
- }
- // UpdateSecurityPolicyMode sets the "security_policy_mode" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateSecurityPolicyMode() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateSecurityPolicyMode()
- })
- }
- // SetSecurityPolicyEmailEnabled sets the "security_policy_email_enabled" field.
- func (u *GroupUpsertBulk) SetSecurityPolicyEmailEnabled(v bool) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetSecurityPolicyEmailEnabled(v)
- })
- }
- // UpdateSecurityPolicyEmailEnabled sets the "security_policy_email_enabled" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateSecurityPolicyEmailEnabled() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateSecurityPolicyEmailEnabled()
- })
- }
- // SetStatus sets the "status" field.
- func (u *GroupUpsertBulk) SetStatus(v string) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetStatus(v)
- })
- }
- // UpdateStatus sets the "status" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateStatus() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateStatus()
- })
- }
- // SetPlatform sets the "platform" field.
- func (u *GroupUpsertBulk) SetPlatform(v string) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetPlatform(v)
- })
- }
- // UpdatePlatform sets the "platform" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdatePlatform() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdatePlatform()
- })
- }
- // SetSubscriptionType sets the "subscription_type" field.
- func (u *GroupUpsertBulk) SetSubscriptionType(v string) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetSubscriptionType(v)
- })
- }
- // UpdateSubscriptionType sets the "subscription_type" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateSubscriptionType() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateSubscriptionType()
- })
- }
- // SetDailyLimitUsd sets the "daily_limit_usd" field.
- func (u *GroupUpsertBulk) SetDailyLimitUsd(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetDailyLimitUsd(v)
- })
- }
- // AddDailyLimitUsd adds v to the "daily_limit_usd" field.
- func (u *GroupUpsertBulk) AddDailyLimitUsd(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.AddDailyLimitUsd(v)
- })
- }
- // UpdateDailyLimitUsd sets the "daily_limit_usd" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateDailyLimitUsd() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateDailyLimitUsd()
- })
- }
- // ClearDailyLimitUsd clears the value of the "daily_limit_usd" field.
- func (u *GroupUpsertBulk) ClearDailyLimitUsd() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.ClearDailyLimitUsd()
- })
- }
- // SetWeeklyLimitUsd sets the "weekly_limit_usd" field.
- func (u *GroupUpsertBulk) SetWeeklyLimitUsd(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetWeeklyLimitUsd(v)
- })
- }
- // AddWeeklyLimitUsd adds v to the "weekly_limit_usd" field.
- func (u *GroupUpsertBulk) AddWeeklyLimitUsd(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.AddWeeklyLimitUsd(v)
- })
- }
- // UpdateWeeklyLimitUsd sets the "weekly_limit_usd" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateWeeklyLimitUsd() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateWeeklyLimitUsd()
- })
- }
- // ClearWeeklyLimitUsd clears the value of the "weekly_limit_usd" field.
- func (u *GroupUpsertBulk) ClearWeeklyLimitUsd() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.ClearWeeklyLimitUsd()
- })
- }
- // SetMonthlyLimitUsd sets the "monthly_limit_usd" field.
- func (u *GroupUpsertBulk) SetMonthlyLimitUsd(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetMonthlyLimitUsd(v)
- })
- }
- // AddMonthlyLimitUsd adds v to the "monthly_limit_usd" field.
- func (u *GroupUpsertBulk) AddMonthlyLimitUsd(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.AddMonthlyLimitUsd(v)
- })
- }
- // UpdateMonthlyLimitUsd sets the "monthly_limit_usd" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateMonthlyLimitUsd() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateMonthlyLimitUsd()
- })
- }
- // ClearMonthlyLimitUsd clears the value of the "monthly_limit_usd" field.
- func (u *GroupUpsertBulk) ClearMonthlyLimitUsd() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.ClearMonthlyLimitUsd()
- })
- }
- // SetDefaultValidityDays sets the "default_validity_days" field.
- func (u *GroupUpsertBulk) SetDefaultValidityDays(v int) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetDefaultValidityDays(v)
- })
- }
- // AddDefaultValidityDays adds v to the "default_validity_days" field.
- func (u *GroupUpsertBulk) AddDefaultValidityDays(v int) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.AddDefaultValidityDays(v)
- })
- }
- // UpdateDefaultValidityDays sets the "default_validity_days" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateDefaultValidityDays() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateDefaultValidityDays()
- })
- }
- // SetAllowImageGeneration sets the "allow_image_generation" field.
- func (u *GroupUpsertBulk) SetAllowImageGeneration(v bool) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetAllowImageGeneration(v)
- })
- }
- // UpdateAllowImageGeneration sets the "allow_image_generation" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateAllowImageGeneration() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateAllowImageGeneration()
- })
- }
- // SetAllowBatchImageGeneration sets the "allow_batch_image_generation" field.
- func (u *GroupUpsertBulk) SetAllowBatchImageGeneration(v bool) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetAllowBatchImageGeneration(v)
- })
- }
- // UpdateAllowBatchImageGeneration sets the "allow_batch_image_generation" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateAllowBatchImageGeneration() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateAllowBatchImageGeneration()
- })
- }
- // SetImageRateIndependent sets the "image_rate_independent" field.
- func (u *GroupUpsertBulk) SetImageRateIndependent(v bool) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetImageRateIndependent(v)
- })
- }
- // UpdateImageRateIndependent sets the "image_rate_independent" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateImageRateIndependent() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateImageRateIndependent()
- })
- }
- // SetImageRateMultiplier sets the "image_rate_multiplier" field.
- func (u *GroupUpsertBulk) SetImageRateMultiplier(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetImageRateMultiplier(v)
- })
- }
- // AddImageRateMultiplier adds v to the "image_rate_multiplier" field.
- func (u *GroupUpsertBulk) AddImageRateMultiplier(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.AddImageRateMultiplier(v)
- })
- }
- // UpdateImageRateMultiplier sets the "image_rate_multiplier" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateImageRateMultiplier() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateImageRateMultiplier()
- })
- }
- // SetImagePrice1k sets the "image_price_1k" field.
- func (u *GroupUpsertBulk) SetImagePrice1k(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetImagePrice1k(v)
- })
- }
- // AddImagePrice1k adds v to the "image_price_1k" field.
- func (u *GroupUpsertBulk) AddImagePrice1k(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.AddImagePrice1k(v)
- })
- }
- // UpdateImagePrice1k sets the "image_price_1k" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateImagePrice1k() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateImagePrice1k()
- })
- }
- // ClearImagePrice1k clears the value of the "image_price_1k" field.
- func (u *GroupUpsertBulk) ClearImagePrice1k() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.ClearImagePrice1k()
- })
- }
- // SetImagePrice2k sets the "image_price_2k" field.
- func (u *GroupUpsertBulk) SetImagePrice2k(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetImagePrice2k(v)
- })
- }
- // AddImagePrice2k adds v to the "image_price_2k" field.
- func (u *GroupUpsertBulk) AddImagePrice2k(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.AddImagePrice2k(v)
- })
- }
- // UpdateImagePrice2k sets the "image_price_2k" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateImagePrice2k() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateImagePrice2k()
- })
- }
- // ClearImagePrice2k clears the value of the "image_price_2k" field.
- func (u *GroupUpsertBulk) ClearImagePrice2k() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.ClearImagePrice2k()
- })
- }
- // SetImagePrice4k sets the "image_price_4k" field.
- func (u *GroupUpsertBulk) SetImagePrice4k(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetImagePrice4k(v)
- })
- }
- // AddImagePrice4k adds v to the "image_price_4k" field.
- func (u *GroupUpsertBulk) AddImagePrice4k(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.AddImagePrice4k(v)
- })
- }
- // UpdateImagePrice4k sets the "image_price_4k" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateImagePrice4k() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateImagePrice4k()
- })
- }
- // ClearImagePrice4k clears the value of the "image_price_4k" field.
- func (u *GroupUpsertBulk) ClearImagePrice4k() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.ClearImagePrice4k()
- })
- }
- // SetBatchImageDiscountMultiplier sets the "batch_image_discount_multiplier" field.
- func (u *GroupUpsertBulk) SetBatchImageDiscountMultiplier(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetBatchImageDiscountMultiplier(v)
- })
- }
- // AddBatchImageDiscountMultiplier adds v to the "batch_image_discount_multiplier" field.
- func (u *GroupUpsertBulk) AddBatchImageDiscountMultiplier(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.AddBatchImageDiscountMultiplier(v)
- })
- }
- // UpdateBatchImageDiscountMultiplier sets the "batch_image_discount_multiplier" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateBatchImageDiscountMultiplier() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateBatchImageDiscountMultiplier()
- })
- }
- // SetBatchImageHoldMultiplier sets the "batch_image_hold_multiplier" field.
- func (u *GroupUpsertBulk) SetBatchImageHoldMultiplier(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetBatchImageHoldMultiplier(v)
- })
- }
- // AddBatchImageHoldMultiplier adds v to the "batch_image_hold_multiplier" field.
- func (u *GroupUpsertBulk) AddBatchImageHoldMultiplier(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.AddBatchImageHoldMultiplier(v)
- })
- }
- // UpdateBatchImageHoldMultiplier sets the "batch_image_hold_multiplier" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateBatchImageHoldMultiplier() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateBatchImageHoldMultiplier()
- })
- }
- // SetVideoRateIndependent sets the "video_rate_independent" field.
- func (u *GroupUpsertBulk) SetVideoRateIndependent(v bool) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetVideoRateIndependent(v)
- })
- }
- // UpdateVideoRateIndependent sets the "video_rate_independent" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateVideoRateIndependent() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateVideoRateIndependent()
- })
- }
- // SetVideoRateMultiplier sets the "video_rate_multiplier" field.
- func (u *GroupUpsertBulk) SetVideoRateMultiplier(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetVideoRateMultiplier(v)
- })
- }
- // AddVideoRateMultiplier adds v to the "video_rate_multiplier" field.
- func (u *GroupUpsertBulk) AddVideoRateMultiplier(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.AddVideoRateMultiplier(v)
- })
- }
- // UpdateVideoRateMultiplier sets the "video_rate_multiplier" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateVideoRateMultiplier() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateVideoRateMultiplier()
- })
- }
- // SetVideoPrice480p sets the "video_price_480p" field.
- func (u *GroupUpsertBulk) SetVideoPrice480p(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetVideoPrice480p(v)
- })
- }
- // AddVideoPrice480p adds v to the "video_price_480p" field.
- func (u *GroupUpsertBulk) AddVideoPrice480p(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.AddVideoPrice480p(v)
- })
- }
- // UpdateVideoPrice480p sets the "video_price_480p" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateVideoPrice480p() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateVideoPrice480p()
- })
- }
- // ClearVideoPrice480p clears the value of the "video_price_480p" field.
- func (u *GroupUpsertBulk) ClearVideoPrice480p() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.ClearVideoPrice480p()
- })
- }
- // SetVideoPrice720p sets the "video_price_720p" field.
- func (u *GroupUpsertBulk) SetVideoPrice720p(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetVideoPrice720p(v)
- })
- }
- // AddVideoPrice720p adds v to the "video_price_720p" field.
- func (u *GroupUpsertBulk) AddVideoPrice720p(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.AddVideoPrice720p(v)
- })
- }
- // UpdateVideoPrice720p sets the "video_price_720p" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateVideoPrice720p() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateVideoPrice720p()
- })
- }
- // ClearVideoPrice720p clears the value of the "video_price_720p" field.
- func (u *GroupUpsertBulk) ClearVideoPrice720p() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.ClearVideoPrice720p()
- })
- }
- // SetVideoPrice1080p sets the "video_price_1080p" field.
- func (u *GroupUpsertBulk) SetVideoPrice1080p(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetVideoPrice1080p(v)
- })
- }
- // AddVideoPrice1080p adds v to the "video_price_1080p" field.
- func (u *GroupUpsertBulk) AddVideoPrice1080p(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.AddVideoPrice1080p(v)
- })
- }
- // UpdateVideoPrice1080p sets the "video_price_1080p" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateVideoPrice1080p() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateVideoPrice1080p()
- })
- }
- // ClearVideoPrice1080p clears the value of the "video_price_1080p" field.
- func (u *GroupUpsertBulk) ClearVideoPrice1080p() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.ClearVideoPrice1080p()
- })
- }
- // SetVideoModelPrices sets the "video_model_prices" field.
- func (u *GroupUpsertBulk) SetVideoModelPrices(v map[string]map[string]float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetVideoModelPrices(v)
- })
- }
- // UpdateVideoModelPrices sets the "video_model_prices" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateVideoModelPrices() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateVideoModelPrices()
- })
- }
- // ClearVideoModelPrices clears the value of the "video_model_prices" field.
- func (u *GroupUpsertBulk) ClearVideoModelPrices() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.ClearVideoModelPrices()
- })
- }
- // SetWebSearchPricePerCall sets the "web_search_price_per_call" field.
- func (u *GroupUpsertBulk) SetWebSearchPricePerCall(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetWebSearchPricePerCall(v)
- })
- }
- // AddWebSearchPricePerCall adds v to the "web_search_price_per_call" field.
- func (u *GroupUpsertBulk) AddWebSearchPricePerCall(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.AddWebSearchPricePerCall(v)
- })
- }
- // UpdateWebSearchPricePerCall sets the "web_search_price_per_call" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateWebSearchPricePerCall() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateWebSearchPricePerCall()
- })
- }
- // ClearWebSearchPricePerCall clears the value of the "web_search_price_per_call" field.
- func (u *GroupUpsertBulk) ClearWebSearchPricePerCall() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.ClearWebSearchPricePerCall()
- })
- }
- // SetSearchPricePer1k sets the "search_price_per_1k" field.
- func (u *GroupUpsertBulk) SetSearchPricePer1k(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetSearchPricePer1k(v)
- })
- }
- // AddSearchPricePer1k adds v to the "search_price_per_1k" field.
- func (u *GroupUpsertBulk) AddSearchPricePer1k(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.AddSearchPricePer1k(v)
- })
- }
- // UpdateSearchPricePer1k sets the "search_price_per_1k" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateSearchPricePer1k() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateSearchPricePer1k()
- })
- }
- // ClearSearchPricePer1k clears the value of the "search_price_per_1k" field.
- func (u *GroupUpsertBulk) ClearSearchPricePer1k() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.ClearSearchPricePer1k()
- })
- }
- // SetAudioRealtimePricePerMin sets the "audio_realtime_price_per_min" field.
- func (u *GroupUpsertBulk) SetAudioRealtimePricePerMin(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetAudioRealtimePricePerMin(v)
- })
- }
- // AddAudioRealtimePricePerMin adds v to the "audio_realtime_price_per_min" field.
- func (u *GroupUpsertBulk) AddAudioRealtimePricePerMin(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.AddAudioRealtimePricePerMin(v)
- })
- }
- // UpdateAudioRealtimePricePerMin sets the "audio_realtime_price_per_min" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateAudioRealtimePricePerMin() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateAudioRealtimePricePerMin()
- })
- }
- // ClearAudioRealtimePricePerMin clears the value of the "audio_realtime_price_per_min" field.
- func (u *GroupUpsertBulk) ClearAudioRealtimePricePerMin() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.ClearAudioRealtimePricePerMin()
- })
- }
- // SetAudioTtsPricePerMillionChars sets the "audio_tts_price_per_million_chars" field.
- func (u *GroupUpsertBulk) SetAudioTtsPricePerMillionChars(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetAudioTtsPricePerMillionChars(v)
- })
- }
- // AddAudioTtsPricePerMillionChars adds v to the "audio_tts_price_per_million_chars" field.
- func (u *GroupUpsertBulk) AddAudioTtsPricePerMillionChars(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.AddAudioTtsPricePerMillionChars(v)
- })
- }
- // UpdateAudioTtsPricePerMillionChars sets the "audio_tts_price_per_million_chars" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateAudioTtsPricePerMillionChars() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateAudioTtsPricePerMillionChars()
- })
- }
- // ClearAudioTtsPricePerMillionChars clears the value of the "audio_tts_price_per_million_chars" field.
- func (u *GroupUpsertBulk) ClearAudioTtsPricePerMillionChars() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.ClearAudioTtsPricePerMillionChars()
- })
- }
- // SetAudioSttPricePerHour sets the "audio_stt_price_per_hour" field.
- func (u *GroupUpsertBulk) SetAudioSttPricePerHour(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetAudioSttPricePerHour(v)
- })
- }
- // AddAudioSttPricePerHour adds v to the "audio_stt_price_per_hour" field.
- func (u *GroupUpsertBulk) AddAudioSttPricePerHour(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.AddAudioSttPricePerHour(v)
- })
- }
- // UpdateAudioSttPricePerHour sets the "audio_stt_price_per_hour" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateAudioSttPricePerHour() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateAudioSttPricePerHour()
- })
- }
- // ClearAudioSttPricePerHour clears the value of the "audio_stt_price_per_hour" field.
- func (u *GroupUpsertBulk) ClearAudioSttPricePerHour() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.ClearAudioSttPricePerHour()
- })
- }
- // SetLongContextPricingEnabled sets the "long_context_pricing_enabled" field.
- func (u *GroupUpsertBulk) SetLongContextPricingEnabled(v bool) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetLongContextPricingEnabled(v)
- })
- }
- // UpdateLongContextPricingEnabled sets the "long_context_pricing_enabled" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateLongContextPricingEnabled() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateLongContextPricingEnabled()
- })
- }
- // SetModelPricing sets the "model_pricing" field.
- func (u *GroupUpsertBulk) SetModelPricing(v jsontext.Value) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetModelPricing(v)
- })
- }
- // UpdateModelPricing sets the "model_pricing" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateModelPricing() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateModelPricing()
- })
- }
- // ClearModelPricing clears the value of the "model_pricing" field.
- func (u *GroupUpsertBulk) ClearModelPricing() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.ClearModelPricing()
- })
- }
- // SetClaudeCodeOnly sets the "claude_code_only" field.
- func (u *GroupUpsertBulk) SetClaudeCodeOnly(v bool) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetClaudeCodeOnly(v)
- })
- }
- // UpdateClaudeCodeOnly sets the "claude_code_only" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateClaudeCodeOnly() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateClaudeCodeOnly()
- })
- }
- // SetFallbackGroupID sets the "fallback_group_id" field.
- func (u *GroupUpsertBulk) SetFallbackGroupID(v int64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetFallbackGroupID(v)
- })
- }
- // AddFallbackGroupID adds v to the "fallback_group_id" field.
- func (u *GroupUpsertBulk) AddFallbackGroupID(v int64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.AddFallbackGroupID(v)
- })
- }
- // UpdateFallbackGroupID sets the "fallback_group_id" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateFallbackGroupID() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateFallbackGroupID()
- })
- }
- // ClearFallbackGroupID clears the value of the "fallback_group_id" field.
- func (u *GroupUpsertBulk) ClearFallbackGroupID() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.ClearFallbackGroupID()
- })
- }
- // SetFallbackGroupIDOnInvalidRequest sets the "fallback_group_id_on_invalid_request" field.
- func (u *GroupUpsertBulk) SetFallbackGroupIDOnInvalidRequest(v int64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetFallbackGroupIDOnInvalidRequest(v)
- })
- }
- // AddFallbackGroupIDOnInvalidRequest adds v to the "fallback_group_id_on_invalid_request" field.
- func (u *GroupUpsertBulk) AddFallbackGroupIDOnInvalidRequest(v int64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.AddFallbackGroupIDOnInvalidRequest(v)
- })
- }
- // UpdateFallbackGroupIDOnInvalidRequest sets the "fallback_group_id_on_invalid_request" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateFallbackGroupIDOnInvalidRequest() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateFallbackGroupIDOnInvalidRequest()
- })
- }
- // ClearFallbackGroupIDOnInvalidRequest clears the value of the "fallback_group_id_on_invalid_request" field.
- func (u *GroupUpsertBulk) ClearFallbackGroupIDOnInvalidRequest() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.ClearFallbackGroupIDOnInvalidRequest()
- })
- }
- // SetModelRouting sets the "model_routing" field.
- func (u *GroupUpsertBulk) SetModelRouting(v map[string][]int64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetModelRouting(v)
- })
- }
- // UpdateModelRouting sets the "model_routing" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateModelRouting() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateModelRouting()
- })
- }
- // ClearModelRouting clears the value of the "model_routing" field.
- func (u *GroupUpsertBulk) ClearModelRouting() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.ClearModelRouting()
- })
- }
- // SetModelRoutingEnabled sets the "model_routing_enabled" field.
- func (u *GroupUpsertBulk) SetModelRoutingEnabled(v bool) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetModelRoutingEnabled(v)
- })
- }
- // UpdateModelRoutingEnabled sets the "model_routing_enabled" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateModelRoutingEnabled() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateModelRoutingEnabled()
- })
- }
- // SetMcpXMLInject sets the "mcp_xml_inject" field.
- func (u *GroupUpsertBulk) SetMcpXMLInject(v bool) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetMcpXMLInject(v)
- })
- }
- // UpdateMcpXMLInject sets the "mcp_xml_inject" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateMcpXMLInject() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateMcpXMLInject()
- })
- }
- // SetSupportedModelScopes sets the "supported_model_scopes" field.
- func (u *GroupUpsertBulk) SetSupportedModelScopes(v []string) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetSupportedModelScopes(v)
- })
- }
- // UpdateSupportedModelScopes sets the "supported_model_scopes" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateSupportedModelScopes() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateSupportedModelScopes()
- })
- }
- // SetSortOrder sets the "sort_order" field.
- func (u *GroupUpsertBulk) SetSortOrder(v int) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetSortOrder(v)
- })
- }
- // AddSortOrder adds v to the "sort_order" field.
- func (u *GroupUpsertBulk) AddSortOrder(v int) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.AddSortOrder(v)
- })
- }
- // UpdateSortOrder sets the "sort_order" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateSortOrder() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateSortOrder()
- })
- }
- // SetAllowMessagesDispatch sets the "allow_messages_dispatch" field.
- func (u *GroupUpsertBulk) SetAllowMessagesDispatch(v bool) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetAllowMessagesDispatch(v)
- })
- }
- // UpdateAllowMessagesDispatch sets the "allow_messages_dispatch" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateAllowMessagesDispatch() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateAllowMessagesDispatch()
- })
- }
- // SetAllowLive sets the "allow_live" field.
- func (u *GroupUpsertBulk) SetAllowLive(v bool) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetAllowLive(v)
- })
- }
- // UpdateAllowLive sets the "allow_live" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateAllowLive() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateAllowLive()
- })
- }
- // SetForceOpenaiFast sets the "force_openai_fast" field.
- func (u *GroupUpsertBulk) SetForceOpenaiFast(v bool) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetForceOpenaiFast(v)
- })
- }
- // UpdateForceOpenaiFast sets the "force_openai_fast" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateForceOpenaiFast() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateForceOpenaiFast()
- })
- }
- // SetFreeOpenaiFast sets the "free_openai_fast" field.
- func (u *GroupUpsertBulk) SetFreeOpenaiFast(v bool) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetFreeOpenaiFast(v)
- })
- }
- // UpdateFreeOpenaiFast sets the "free_openai_fast" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateFreeOpenaiFast() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateFreeOpenaiFast()
- })
- }
- // SetRequireOauthOnly sets the "require_oauth_only" field.
- func (u *GroupUpsertBulk) SetRequireOauthOnly(v bool) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetRequireOauthOnly(v)
- })
- }
- // UpdateRequireOauthOnly sets the "require_oauth_only" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateRequireOauthOnly() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateRequireOauthOnly()
- })
- }
- // SetRequirePrivacySet sets the "require_privacy_set" field.
- func (u *GroupUpsertBulk) SetRequirePrivacySet(v bool) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetRequirePrivacySet(v)
- })
- }
- // UpdateRequirePrivacySet sets the "require_privacy_set" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateRequirePrivacySet() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateRequirePrivacySet()
- })
- }
- // SetDefaultMappedModel sets the "default_mapped_model" field.
- func (u *GroupUpsertBulk) SetDefaultMappedModel(v string) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetDefaultMappedModel(v)
- })
- }
- // UpdateDefaultMappedModel sets the "default_mapped_model" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateDefaultMappedModel() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateDefaultMappedModel()
- })
- }
- // SetMessagesDispatchModelConfig sets the "messages_dispatch_model_config" field.
- func (u *GroupUpsertBulk) SetMessagesDispatchModelConfig(v domain.OpenAIMessagesDispatchModelConfig) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetMessagesDispatchModelConfig(v)
- })
- }
- // UpdateMessagesDispatchModelConfig sets the "messages_dispatch_model_config" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateMessagesDispatchModelConfig() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateMessagesDispatchModelConfig()
- })
- }
- // SetModelAllowlist sets the "model_allowlist" field.
- func (u *GroupUpsertBulk) SetModelAllowlist(v domain.GroupModelAllowlist) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetModelAllowlist(v)
- })
- }
- // UpdateModelAllowlist sets the "model_allowlist" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateModelAllowlist() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateModelAllowlist()
- })
- }
- // SetCodexModelsManifestConfig sets the "codex_models_manifest_config" field.
- func (u *GroupUpsertBulk) SetCodexModelsManifestConfig(v domain.GroupCodexModelsManifestConfig) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetCodexModelsManifestConfig(v)
- })
- }
- // UpdateCodexModelsManifestConfig sets the "codex_models_manifest_config" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateCodexModelsManifestConfig() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateCodexModelsManifestConfig()
- })
- }
- // SetRpmLimit sets the "rpm_limit" field.
- func (u *GroupUpsertBulk) SetRpmLimit(v int) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetRpmLimit(v)
- })
- }
- // AddRpmLimit adds v to the "rpm_limit" field.
- func (u *GroupUpsertBulk) AddRpmLimit(v int) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.AddRpmLimit(v)
- })
- }
- // UpdateRpmLimit sets the "rpm_limit" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateRpmLimit() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateRpmLimit()
- })
- }
- // SetMaxReasoningEffort sets the "max_reasoning_effort" field.
- func (u *GroupUpsertBulk) SetMaxReasoningEffort(v string) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetMaxReasoningEffort(v)
- })
- }
- // UpdateMaxReasoningEffort sets the "max_reasoning_effort" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateMaxReasoningEffort() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateMaxReasoningEffort()
- })
- }
- // SetMaxReasoningEffortOverLimit sets the "max_reasoning_effort_over_limit" field.
- func (u *GroupUpsertBulk) SetMaxReasoningEffortOverLimit(v string) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetMaxReasoningEffortOverLimit(v)
- })
- }
- // UpdateMaxReasoningEffortOverLimit sets the "max_reasoning_effort_over_limit" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateMaxReasoningEffortOverLimit() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateMaxReasoningEffortOverLimit()
- })
- }
- // SetReasoningEffortMappings sets the "reasoning_effort_mappings" field.
- func (u *GroupUpsertBulk) SetReasoningEffortMappings(v []domain.ReasoningEffortMapping) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetReasoningEffortMappings(v)
- })
- }
- // UpdateReasoningEffortMappings sets the "reasoning_effort_mappings" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateReasoningEffortMappings() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateReasoningEffortMappings()
- })
- }
- // SetProfitControlEnabled sets the "profit_control_enabled" field.
- func (u *GroupUpsertBulk) SetProfitControlEnabled(v bool) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetProfitControlEnabled(v)
- })
- }
- // UpdateProfitControlEnabled sets the "profit_control_enabled" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateProfitControlEnabled() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateProfitControlEnabled()
- })
- }
- // SetProfitMinMargin sets the "profit_min_margin" field.
- func (u *GroupUpsertBulk) SetProfitMinMargin(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetProfitMinMargin(v)
- })
- }
- // AddProfitMinMargin adds v to the "profit_min_margin" field.
- func (u *GroupUpsertBulk) AddProfitMinMargin(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.AddProfitMinMargin(v)
- })
- }
- // UpdateProfitMinMargin sets the "profit_min_margin" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateProfitMinMargin() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateProfitMinMargin()
- })
- }
- // SetProfitSafetyBuffer sets the "profit_safety_buffer" field.
- func (u *GroupUpsertBulk) SetProfitSafetyBuffer(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.SetProfitSafetyBuffer(v)
- })
- }
- // AddProfitSafetyBuffer adds v to the "profit_safety_buffer" field.
- func (u *GroupUpsertBulk) AddProfitSafetyBuffer(v float64) *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.AddProfitSafetyBuffer(v)
- })
- }
- // UpdateProfitSafetyBuffer sets the "profit_safety_buffer" field to the value that was provided on create.
- func (u *GroupUpsertBulk) UpdateProfitSafetyBuffer() *GroupUpsertBulk {
- return u.Update(func(s *GroupUpsert) {
- s.UpdateProfitSafetyBuffer()
- })
- }
- // Exec executes the query.
- func (u *GroupUpsertBulk) Exec(ctx context.Context) error {
- if u.create.err != nil {
- return u.create.err
- }
- for i, b := range u.create.builders {
- if len(b.conflict) != 0 {
- return fmt.Errorf("ent: OnConflict was set for builder %d. Set it on the GroupCreateBulk instead", i)
- }
- }
- if len(u.create.conflict) == 0 {
- return errors.New("ent: missing options for GroupCreateBulk.OnConflict")
- }
- return u.create.Exec(ctx)
- }
- // ExecX is like Exec, but panics if an error occurs.
- func (u *GroupUpsertBulk) ExecX(ctx context.Context) {
- if err := u.create.Exec(ctx); err != nil {
- panic(err)
- }
- }
|