group_create.go 191 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871
  1. // Code generated by ent, DO NOT EDIT.
  2. package ent
  3. import (
  4. "context"
  5. "encoding/json/jsontext"
  6. "errors"
  7. "fmt"
  8. "time"
  9. "entgo.io/ent/dialect/sql"
  10. "entgo.io/ent/dialect/sql/sqlgraph"
  11. "entgo.io/ent/schema/field"
  12. "github.com/Wei-Shaw/sub2api/ent/account"
  13. "github.com/Wei-Shaw/sub2api/ent/apikey"
  14. "github.com/Wei-Shaw/sub2api/ent/group"
  15. "github.com/Wei-Shaw/sub2api/ent/redeemcode"
  16. "github.com/Wei-Shaw/sub2api/ent/usagelog"
  17. "github.com/Wei-Shaw/sub2api/ent/user"
  18. "github.com/Wei-Shaw/sub2api/ent/usersubscription"
  19. "github.com/Wei-Shaw/sub2api/internal/domain"
  20. )
  21. // GroupCreate is the builder for creating a Group entity.
  22. type GroupCreate struct {
  23. config
  24. mutation *GroupMutation
  25. hooks []Hook
  26. conflict []sql.ConflictOption
  27. }
  28. // SetCreatedAt sets the "created_at" field.
  29. func (_c *GroupCreate) SetCreatedAt(v time.Time) *GroupCreate {
  30. _c.mutation.SetCreatedAt(v)
  31. return _c
  32. }
  33. // SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
  34. func (_c *GroupCreate) SetNillableCreatedAt(v *time.Time) *GroupCreate {
  35. if v != nil {
  36. _c.SetCreatedAt(*v)
  37. }
  38. return _c
  39. }
  40. // SetUpdatedAt sets the "updated_at" field.
  41. func (_c *GroupCreate) SetUpdatedAt(v time.Time) *GroupCreate {
  42. _c.mutation.SetUpdatedAt(v)
  43. return _c
  44. }
  45. // SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
  46. func (_c *GroupCreate) SetNillableUpdatedAt(v *time.Time) *GroupCreate {
  47. if v != nil {
  48. _c.SetUpdatedAt(*v)
  49. }
  50. return _c
  51. }
  52. // SetDeletedAt sets the "deleted_at" field.
  53. func (_c *GroupCreate) SetDeletedAt(v time.Time) *GroupCreate {
  54. _c.mutation.SetDeletedAt(v)
  55. return _c
  56. }
  57. // SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
  58. func (_c *GroupCreate) SetNillableDeletedAt(v *time.Time) *GroupCreate {
  59. if v != nil {
  60. _c.SetDeletedAt(*v)
  61. }
  62. return _c
  63. }
  64. // SetName sets the "name" field.
  65. func (_c *GroupCreate) SetName(v string) *GroupCreate {
  66. _c.mutation.SetName(v)
  67. return _c
  68. }
  69. // SetDescription sets the "description" field.
  70. func (_c *GroupCreate) SetDescription(v string) *GroupCreate {
  71. _c.mutation.SetDescription(v)
  72. return _c
  73. }
  74. // SetNillableDescription sets the "description" field if the given value is not nil.
  75. func (_c *GroupCreate) SetNillableDescription(v *string) *GroupCreate {
  76. if v != nil {
  77. _c.SetDescription(*v)
  78. }
  79. return _c
  80. }
  81. // SetRateMultiplier sets the "rate_multiplier" field.
  82. func (_c *GroupCreate) SetRateMultiplier(v float64) *GroupCreate {
  83. _c.mutation.SetRateMultiplier(v)
  84. return _c
  85. }
  86. // SetNillableRateMultiplier sets the "rate_multiplier" field if the given value is not nil.
  87. func (_c *GroupCreate) SetNillableRateMultiplier(v *float64) *GroupCreate {
  88. if v != nil {
  89. _c.SetRateMultiplier(*v)
  90. }
  91. return _c
  92. }
  93. // SetPeakRateEnabled sets the "peak_rate_enabled" field.
  94. func (_c *GroupCreate) SetPeakRateEnabled(v bool) *GroupCreate {
  95. _c.mutation.SetPeakRateEnabled(v)
  96. return _c
  97. }
  98. // SetNillablePeakRateEnabled sets the "peak_rate_enabled" field if the given value is not nil.
  99. func (_c *GroupCreate) SetNillablePeakRateEnabled(v *bool) *GroupCreate {
  100. if v != nil {
  101. _c.SetPeakRateEnabled(*v)
  102. }
  103. return _c
  104. }
  105. // SetPeakStart sets the "peak_start" field.
  106. func (_c *GroupCreate) SetPeakStart(v string) *GroupCreate {
  107. _c.mutation.SetPeakStart(v)
  108. return _c
  109. }
  110. // SetNillablePeakStart sets the "peak_start" field if the given value is not nil.
  111. func (_c *GroupCreate) SetNillablePeakStart(v *string) *GroupCreate {
  112. if v != nil {
  113. _c.SetPeakStart(*v)
  114. }
  115. return _c
  116. }
  117. // SetPeakEnd sets the "peak_end" field.
  118. func (_c *GroupCreate) SetPeakEnd(v string) *GroupCreate {
  119. _c.mutation.SetPeakEnd(v)
  120. return _c
  121. }
  122. // SetNillablePeakEnd sets the "peak_end" field if the given value is not nil.
  123. func (_c *GroupCreate) SetNillablePeakEnd(v *string) *GroupCreate {
  124. if v != nil {
  125. _c.SetPeakEnd(*v)
  126. }
  127. return _c
  128. }
  129. // SetPeakRateMultiplier sets the "peak_rate_multiplier" field.
  130. func (_c *GroupCreate) SetPeakRateMultiplier(v float64) *GroupCreate {
  131. _c.mutation.SetPeakRateMultiplier(v)
  132. return _c
  133. }
  134. // SetNillablePeakRateMultiplier sets the "peak_rate_multiplier" field if the given value is not nil.
  135. func (_c *GroupCreate) SetNillablePeakRateMultiplier(v *float64) *GroupCreate {
  136. if v != nil {
  137. _c.SetPeakRateMultiplier(*v)
  138. }
  139. return _c
  140. }
  141. // SetIsExclusive sets the "is_exclusive" field.
  142. func (_c *GroupCreate) SetIsExclusive(v bool) *GroupCreate {
  143. _c.mutation.SetIsExclusive(v)
  144. return _c
  145. }
  146. // SetNillableIsExclusive sets the "is_exclusive" field if the given value is not nil.
  147. func (_c *GroupCreate) SetNillableIsExclusive(v *bool) *GroupCreate {
  148. if v != nil {
  149. _c.SetIsExclusive(*v)
  150. }
  151. return _c
  152. }
  153. // SetSecurityPolicyEnabled sets the "security_policy_enabled" field.
  154. func (_c *GroupCreate) SetSecurityPolicyEnabled(v bool) *GroupCreate {
  155. _c.mutation.SetSecurityPolicyEnabled(v)
  156. return _c
  157. }
  158. // SetNillableSecurityPolicyEnabled sets the "security_policy_enabled" field if the given value is not nil.
  159. func (_c *GroupCreate) SetNillableSecurityPolicyEnabled(v *bool) *GroupCreate {
  160. if v != nil {
  161. _c.SetSecurityPolicyEnabled(*v)
  162. }
  163. return _c
  164. }
  165. // SetSecurityPolicyMode sets the "security_policy_mode" field.
  166. func (_c *GroupCreate) SetSecurityPolicyMode(v string) *GroupCreate {
  167. _c.mutation.SetSecurityPolicyMode(v)
  168. return _c
  169. }
  170. // SetNillableSecurityPolicyMode sets the "security_policy_mode" field if the given value is not nil.
  171. func (_c *GroupCreate) SetNillableSecurityPolicyMode(v *string) *GroupCreate {
  172. if v != nil {
  173. _c.SetSecurityPolicyMode(*v)
  174. }
  175. return _c
  176. }
  177. // SetSecurityPolicyEmailEnabled sets the "security_policy_email_enabled" field.
  178. func (_c *GroupCreate) SetSecurityPolicyEmailEnabled(v bool) *GroupCreate {
  179. _c.mutation.SetSecurityPolicyEmailEnabled(v)
  180. return _c
  181. }
  182. // SetNillableSecurityPolicyEmailEnabled sets the "security_policy_email_enabled" field if the given value is not nil.
  183. func (_c *GroupCreate) SetNillableSecurityPolicyEmailEnabled(v *bool) *GroupCreate {
  184. if v != nil {
  185. _c.SetSecurityPolicyEmailEnabled(*v)
  186. }
  187. return _c
  188. }
  189. // SetStatus sets the "status" field.
  190. func (_c *GroupCreate) SetStatus(v string) *GroupCreate {
  191. _c.mutation.SetStatus(v)
  192. return _c
  193. }
  194. // SetNillableStatus sets the "status" field if the given value is not nil.
  195. func (_c *GroupCreate) SetNillableStatus(v *string) *GroupCreate {
  196. if v != nil {
  197. _c.SetStatus(*v)
  198. }
  199. return _c
  200. }
  201. // SetDuplicateOperationID sets the "duplicate_operation_id" field.
  202. func (_c *GroupCreate) SetDuplicateOperationID(v string) *GroupCreate {
  203. _c.mutation.SetDuplicateOperationID(v)
  204. return _c
  205. }
  206. // SetNillableDuplicateOperationID sets the "duplicate_operation_id" field if the given value is not nil.
  207. func (_c *GroupCreate) SetNillableDuplicateOperationID(v *string) *GroupCreate {
  208. if v != nil {
  209. _c.SetDuplicateOperationID(*v)
  210. }
  211. return _c
  212. }
  213. // SetPlatform sets the "platform" field.
  214. func (_c *GroupCreate) SetPlatform(v string) *GroupCreate {
  215. _c.mutation.SetPlatform(v)
  216. return _c
  217. }
  218. // SetNillablePlatform sets the "platform" field if the given value is not nil.
  219. func (_c *GroupCreate) SetNillablePlatform(v *string) *GroupCreate {
  220. if v != nil {
  221. _c.SetPlatform(*v)
  222. }
  223. return _c
  224. }
  225. // SetSubscriptionType sets the "subscription_type" field.
  226. func (_c *GroupCreate) SetSubscriptionType(v string) *GroupCreate {
  227. _c.mutation.SetSubscriptionType(v)
  228. return _c
  229. }
  230. // SetNillableSubscriptionType sets the "subscription_type" field if the given value is not nil.
  231. func (_c *GroupCreate) SetNillableSubscriptionType(v *string) *GroupCreate {
  232. if v != nil {
  233. _c.SetSubscriptionType(*v)
  234. }
  235. return _c
  236. }
  237. // SetDailyLimitUsd sets the "daily_limit_usd" field.
  238. func (_c *GroupCreate) SetDailyLimitUsd(v float64) *GroupCreate {
  239. _c.mutation.SetDailyLimitUsd(v)
  240. return _c
  241. }
  242. // SetNillableDailyLimitUsd sets the "daily_limit_usd" field if the given value is not nil.
  243. func (_c *GroupCreate) SetNillableDailyLimitUsd(v *float64) *GroupCreate {
  244. if v != nil {
  245. _c.SetDailyLimitUsd(*v)
  246. }
  247. return _c
  248. }
  249. // SetWeeklyLimitUsd sets the "weekly_limit_usd" field.
  250. func (_c *GroupCreate) SetWeeklyLimitUsd(v float64) *GroupCreate {
  251. _c.mutation.SetWeeklyLimitUsd(v)
  252. return _c
  253. }
  254. // SetNillableWeeklyLimitUsd sets the "weekly_limit_usd" field if the given value is not nil.
  255. func (_c *GroupCreate) SetNillableWeeklyLimitUsd(v *float64) *GroupCreate {
  256. if v != nil {
  257. _c.SetWeeklyLimitUsd(*v)
  258. }
  259. return _c
  260. }
  261. // SetMonthlyLimitUsd sets the "monthly_limit_usd" field.
  262. func (_c *GroupCreate) SetMonthlyLimitUsd(v float64) *GroupCreate {
  263. _c.mutation.SetMonthlyLimitUsd(v)
  264. return _c
  265. }
  266. // SetNillableMonthlyLimitUsd sets the "monthly_limit_usd" field if the given value is not nil.
  267. func (_c *GroupCreate) SetNillableMonthlyLimitUsd(v *float64) *GroupCreate {
  268. if v != nil {
  269. _c.SetMonthlyLimitUsd(*v)
  270. }
  271. return _c
  272. }
  273. // SetDefaultValidityDays sets the "default_validity_days" field.
  274. func (_c *GroupCreate) SetDefaultValidityDays(v int) *GroupCreate {
  275. _c.mutation.SetDefaultValidityDays(v)
  276. return _c
  277. }
  278. // SetNillableDefaultValidityDays sets the "default_validity_days" field if the given value is not nil.
  279. func (_c *GroupCreate) SetNillableDefaultValidityDays(v *int) *GroupCreate {
  280. if v != nil {
  281. _c.SetDefaultValidityDays(*v)
  282. }
  283. return _c
  284. }
  285. // SetAllowImageGeneration sets the "allow_image_generation" field.
  286. func (_c *GroupCreate) SetAllowImageGeneration(v bool) *GroupCreate {
  287. _c.mutation.SetAllowImageGeneration(v)
  288. return _c
  289. }
  290. // SetNillableAllowImageGeneration sets the "allow_image_generation" field if the given value is not nil.
  291. func (_c *GroupCreate) SetNillableAllowImageGeneration(v *bool) *GroupCreate {
  292. if v != nil {
  293. _c.SetAllowImageGeneration(*v)
  294. }
  295. return _c
  296. }
  297. // SetAllowBatchImageGeneration sets the "allow_batch_image_generation" field.
  298. func (_c *GroupCreate) SetAllowBatchImageGeneration(v bool) *GroupCreate {
  299. _c.mutation.SetAllowBatchImageGeneration(v)
  300. return _c
  301. }
  302. // SetNillableAllowBatchImageGeneration sets the "allow_batch_image_generation" field if the given value is not nil.
  303. func (_c *GroupCreate) SetNillableAllowBatchImageGeneration(v *bool) *GroupCreate {
  304. if v != nil {
  305. _c.SetAllowBatchImageGeneration(*v)
  306. }
  307. return _c
  308. }
  309. // SetImageRateIndependent sets the "image_rate_independent" field.
  310. func (_c *GroupCreate) SetImageRateIndependent(v bool) *GroupCreate {
  311. _c.mutation.SetImageRateIndependent(v)
  312. return _c
  313. }
  314. // SetNillableImageRateIndependent sets the "image_rate_independent" field if the given value is not nil.
  315. func (_c *GroupCreate) SetNillableImageRateIndependent(v *bool) *GroupCreate {
  316. if v != nil {
  317. _c.SetImageRateIndependent(*v)
  318. }
  319. return _c
  320. }
  321. // SetImageRateMultiplier sets the "image_rate_multiplier" field.
  322. func (_c *GroupCreate) SetImageRateMultiplier(v float64) *GroupCreate {
  323. _c.mutation.SetImageRateMultiplier(v)
  324. return _c
  325. }
  326. // SetNillableImageRateMultiplier sets the "image_rate_multiplier" field if the given value is not nil.
  327. func (_c *GroupCreate) SetNillableImageRateMultiplier(v *float64) *GroupCreate {
  328. if v != nil {
  329. _c.SetImageRateMultiplier(*v)
  330. }
  331. return _c
  332. }
  333. // SetImagePrice1k sets the "image_price_1k" field.
  334. func (_c *GroupCreate) SetImagePrice1k(v float64) *GroupCreate {
  335. _c.mutation.SetImagePrice1k(v)
  336. return _c
  337. }
  338. // SetNillableImagePrice1k sets the "image_price_1k" field if the given value is not nil.
  339. func (_c *GroupCreate) SetNillableImagePrice1k(v *float64) *GroupCreate {
  340. if v != nil {
  341. _c.SetImagePrice1k(*v)
  342. }
  343. return _c
  344. }
  345. // SetImagePrice2k sets the "image_price_2k" field.
  346. func (_c *GroupCreate) SetImagePrice2k(v float64) *GroupCreate {
  347. _c.mutation.SetImagePrice2k(v)
  348. return _c
  349. }
  350. // SetNillableImagePrice2k sets the "image_price_2k" field if the given value is not nil.
  351. func (_c *GroupCreate) SetNillableImagePrice2k(v *float64) *GroupCreate {
  352. if v != nil {
  353. _c.SetImagePrice2k(*v)
  354. }
  355. return _c
  356. }
  357. // SetImagePrice4k sets the "image_price_4k" field.
  358. func (_c *GroupCreate) SetImagePrice4k(v float64) *GroupCreate {
  359. _c.mutation.SetImagePrice4k(v)
  360. return _c
  361. }
  362. // SetNillableImagePrice4k sets the "image_price_4k" field if the given value is not nil.
  363. func (_c *GroupCreate) SetNillableImagePrice4k(v *float64) *GroupCreate {
  364. if v != nil {
  365. _c.SetImagePrice4k(*v)
  366. }
  367. return _c
  368. }
  369. // SetBatchImageDiscountMultiplier sets the "batch_image_discount_multiplier" field.
  370. func (_c *GroupCreate) SetBatchImageDiscountMultiplier(v float64) *GroupCreate {
  371. _c.mutation.SetBatchImageDiscountMultiplier(v)
  372. return _c
  373. }
  374. // SetNillableBatchImageDiscountMultiplier sets the "batch_image_discount_multiplier" field if the given value is not nil.
  375. func (_c *GroupCreate) SetNillableBatchImageDiscountMultiplier(v *float64) *GroupCreate {
  376. if v != nil {
  377. _c.SetBatchImageDiscountMultiplier(*v)
  378. }
  379. return _c
  380. }
  381. // SetBatchImageHoldMultiplier sets the "batch_image_hold_multiplier" field.
  382. func (_c *GroupCreate) SetBatchImageHoldMultiplier(v float64) *GroupCreate {
  383. _c.mutation.SetBatchImageHoldMultiplier(v)
  384. return _c
  385. }
  386. // SetNillableBatchImageHoldMultiplier sets the "batch_image_hold_multiplier" field if the given value is not nil.
  387. func (_c *GroupCreate) SetNillableBatchImageHoldMultiplier(v *float64) *GroupCreate {
  388. if v != nil {
  389. _c.SetBatchImageHoldMultiplier(*v)
  390. }
  391. return _c
  392. }
  393. // SetVideoRateIndependent sets the "video_rate_independent" field.
  394. func (_c *GroupCreate) SetVideoRateIndependent(v bool) *GroupCreate {
  395. _c.mutation.SetVideoRateIndependent(v)
  396. return _c
  397. }
  398. // SetNillableVideoRateIndependent sets the "video_rate_independent" field if the given value is not nil.
  399. func (_c *GroupCreate) SetNillableVideoRateIndependent(v *bool) *GroupCreate {
  400. if v != nil {
  401. _c.SetVideoRateIndependent(*v)
  402. }
  403. return _c
  404. }
  405. // SetVideoRateMultiplier sets the "video_rate_multiplier" field.
  406. func (_c *GroupCreate) SetVideoRateMultiplier(v float64) *GroupCreate {
  407. _c.mutation.SetVideoRateMultiplier(v)
  408. return _c
  409. }
  410. // SetNillableVideoRateMultiplier sets the "video_rate_multiplier" field if the given value is not nil.
  411. func (_c *GroupCreate) SetNillableVideoRateMultiplier(v *float64) *GroupCreate {
  412. if v != nil {
  413. _c.SetVideoRateMultiplier(*v)
  414. }
  415. return _c
  416. }
  417. // SetVideoPrice480p sets the "video_price_480p" field.
  418. func (_c *GroupCreate) SetVideoPrice480p(v float64) *GroupCreate {
  419. _c.mutation.SetVideoPrice480p(v)
  420. return _c
  421. }
  422. // SetNillableVideoPrice480p sets the "video_price_480p" field if the given value is not nil.
  423. func (_c *GroupCreate) SetNillableVideoPrice480p(v *float64) *GroupCreate {
  424. if v != nil {
  425. _c.SetVideoPrice480p(*v)
  426. }
  427. return _c
  428. }
  429. // SetVideoPrice720p sets the "video_price_720p" field.
  430. func (_c *GroupCreate) SetVideoPrice720p(v float64) *GroupCreate {
  431. _c.mutation.SetVideoPrice720p(v)
  432. return _c
  433. }
  434. // SetNillableVideoPrice720p sets the "video_price_720p" field if the given value is not nil.
  435. func (_c *GroupCreate) SetNillableVideoPrice720p(v *float64) *GroupCreate {
  436. if v != nil {
  437. _c.SetVideoPrice720p(*v)
  438. }
  439. return _c
  440. }
  441. // SetVideoPrice1080p sets the "video_price_1080p" field.
  442. func (_c *GroupCreate) SetVideoPrice1080p(v float64) *GroupCreate {
  443. _c.mutation.SetVideoPrice1080p(v)
  444. return _c
  445. }
  446. // SetNillableVideoPrice1080p sets the "video_price_1080p" field if the given value is not nil.
  447. func (_c *GroupCreate) SetNillableVideoPrice1080p(v *float64) *GroupCreate {
  448. if v != nil {
  449. _c.SetVideoPrice1080p(*v)
  450. }
  451. return _c
  452. }
  453. // SetVideoModelPrices sets the "video_model_prices" field.
  454. func (_c *GroupCreate) SetVideoModelPrices(v map[string]map[string]float64) *GroupCreate {
  455. _c.mutation.SetVideoModelPrices(v)
  456. return _c
  457. }
  458. // SetWebSearchPricePerCall sets the "web_search_price_per_call" field.
  459. func (_c *GroupCreate) SetWebSearchPricePerCall(v float64) *GroupCreate {
  460. _c.mutation.SetWebSearchPricePerCall(v)
  461. return _c
  462. }
  463. // SetNillableWebSearchPricePerCall sets the "web_search_price_per_call" field if the given value is not nil.
  464. func (_c *GroupCreate) SetNillableWebSearchPricePerCall(v *float64) *GroupCreate {
  465. if v != nil {
  466. _c.SetWebSearchPricePerCall(*v)
  467. }
  468. return _c
  469. }
  470. // SetSearchPricePer1k sets the "search_price_per_1k" field.
  471. func (_c *GroupCreate) SetSearchPricePer1k(v float64) *GroupCreate {
  472. _c.mutation.SetSearchPricePer1k(v)
  473. return _c
  474. }
  475. // SetNillableSearchPricePer1k sets the "search_price_per_1k" field if the given value is not nil.
  476. func (_c *GroupCreate) SetNillableSearchPricePer1k(v *float64) *GroupCreate {
  477. if v != nil {
  478. _c.SetSearchPricePer1k(*v)
  479. }
  480. return _c
  481. }
  482. // SetAudioRealtimePricePerMin sets the "audio_realtime_price_per_min" field.
  483. func (_c *GroupCreate) SetAudioRealtimePricePerMin(v float64) *GroupCreate {
  484. _c.mutation.SetAudioRealtimePricePerMin(v)
  485. return _c
  486. }
  487. // SetNillableAudioRealtimePricePerMin sets the "audio_realtime_price_per_min" field if the given value is not nil.
  488. func (_c *GroupCreate) SetNillableAudioRealtimePricePerMin(v *float64) *GroupCreate {
  489. if v != nil {
  490. _c.SetAudioRealtimePricePerMin(*v)
  491. }
  492. return _c
  493. }
  494. // SetAudioTtsPricePerMillionChars sets the "audio_tts_price_per_million_chars" field.
  495. func (_c *GroupCreate) SetAudioTtsPricePerMillionChars(v float64) *GroupCreate {
  496. _c.mutation.SetAudioTtsPricePerMillionChars(v)
  497. return _c
  498. }
  499. // SetNillableAudioTtsPricePerMillionChars sets the "audio_tts_price_per_million_chars" field if the given value is not nil.
  500. func (_c *GroupCreate) SetNillableAudioTtsPricePerMillionChars(v *float64) *GroupCreate {
  501. if v != nil {
  502. _c.SetAudioTtsPricePerMillionChars(*v)
  503. }
  504. return _c
  505. }
  506. // SetAudioSttPricePerHour sets the "audio_stt_price_per_hour" field.
  507. func (_c *GroupCreate) SetAudioSttPricePerHour(v float64) *GroupCreate {
  508. _c.mutation.SetAudioSttPricePerHour(v)
  509. return _c
  510. }
  511. // SetNillableAudioSttPricePerHour sets the "audio_stt_price_per_hour" field if the given value is not nil.
  512. func (_c *GroupCreate) SetNillableAudioSttPricePerHour(v *float64) *GroupCreate {
  513. if v != nil {
  514. _c.SetAudioSttPricePerHour(*v)
  515. }
  516. return _c
  517. }
  518. // SetLongContextPricingEnabled sets the "long_context_pricing_enabled" field.
  519. func (_c *GroupCreate) SetLongContextPricingEnabled(v bool) *GroupCreate {
  520. _c.mutation.SetLongContextPricingEnabled(v)
  521. return _c
  522. }
  523. // SetNillableLongContextPricingEnabled sets the "long_context_pricing_enabled" field if the given value is not nil.
  524. func (_c *GroupCreate) SetNillableLongContextPricingEnabled(v *bool) *GroupCreate {
  525. if v != nil {
  526. _c.SetLongContextPricingEnabled(*v)
  527. }
  528. return _c
  529. }
  530. // SetModelPricing sets the "model_pricing" field.
  531. func (_c *GroupCreate) SetModelPricing(v jsontext.Value) *GroupCreate {
  532. _c.mutation.SetModelPricing(v)
  533. return _c
  534. }
  535. // SetClaudeCodeOnly sets the "claude_code_only" field.
  536. func (_c *GroupCreate) SetClaudeCodeOnly(v bool) *GroupCreate {
  537. _c.mutation.SetClaudeCodeOnly(v)
  538. return _c
  539. }
  540. // SetNillableClaudeCodeOnly sets the "claude_code_only" field if the given value is not nil.
  541. func (_c *GroupCreate) SetNillableClaudeCodeOnly(v *bool) *GroupCreate {
  542. if v != nil {
  543. _c.SetClaudeCodeOnly(*v)
  544. }
  545. return _c
  546. }
  547. // SetFallbackGroupID sets the "fallback_group_id" field.
  548. func (_c *GroupCreate) SetFallbackGroupID(v int64) *GroupCreate {
  549. _c.mutation.SetFallbackGroupID(v)
  550. return _c
  551. }
  552. // SetNillableFallbackGroupID sets the "fallback_group_id" field if the given value is not nil.
  553. func (_c *GroupCreate) SetNillableFallbackGroupID(v *int64) *GroupCreate {
  554. if v != nil {
  555. _c.SetFallbackGroupID(*v)
  556. }
  557. return _c
  558. }
  559. // SetFallbackGroupIDOnInvalidRequest sets the "fallback_group_id_on_invalid_request" field.
  560. func (_c *GroupCreate) SetFallbackGroupIDOnInvalidRequest(v int64) *GroupCreate {
  561. _c.mutation.SetFallbackGroupIDOnInvalidRequest(v)
  562. return _c
  563. }
  564. // SetNillableFallbackGroupIDOnInvalidRequest sets the "fallback_group_id_on_invalid_request" field if the given value is not nil.
  565. func (_c *GroupCreate) SetNillableFallbackGroupIDOnInvalidRequest(v *int64) *GroupCreate {
  566. if v != nil {
  567. _c.SetFallbackGroupIDOnInvalidRequest(*v)
  568. }
  569. return _c
  570. }
  571. // SetModelRouting sets the "model_routing" field.
  572. func (_c *GroupCreate) SetModelRouting(v map[string][]int64) *GroupCreate {
  573. _c.mutation.SetModelRouting(v)
  574. return _c
  575. }
  576. // SetModelRoutingEnabled sets the "model_routing_enabled" field.
  577. func (_c *GroupCreate) SetModelRoutingEnabled(v bool) *GroupCreate {
  578. _c.mutation.SetModelRoutingEnabled(v)
  579. return _c
  580. }
  581. // SetNillableModelRoutingEnabled sets the "model_routing_enabled" field if the given value is not nil.
  582. func (_c *GroupCreate) SetNillableModelRoutingEnabled(v *bool) *GroupCreate {
  583. if v != nil {
  584. _c.SetModelRoutingEnabled(*v)
  585. }
  586. return _c
  587. }
  588. // SetMcpXMLInject sets the "mcp_xml_inject" field.
  589. func (_c *GroupCreate) SetMcpXMLInject(v bool) *GroupCreate {
  590. _c.mutation.SetMcpXMLInject(v)
  591. return _c
  592. }
  593. // SetNillableMcpXMLInject sets the "mcp_xml_inject" field if the given value is not nil.
  594. func (_c *GroupCreate) SetNillableMcpXMLInject(v *bool) *GroupCreate {
  595. if v != nil {
  596. _c.SetMcpXMLInject(*v)
  597. }
  598. return _c
  599. }
  600. // SetSupportedModelScopes sets the "supported_model_scopes" field.
  601. func (_c *GroupCreate) SetSupportedModelScopes(v []string) *GroupCreate {
  602. _c.mutation.SetSupportedModelScopes(v)
  603. return _c
  604. }
  605. // SetSortOrder sets the "sort_order" field.
  606. func (_c *GroupCreate) SetSortOrder(v int) *GroupCreate {
  607. _c.mutation.SetSortOrder(v)
  608. return _c
  609. }
  610. // SetNillableSortOrder sets the "sort_order" field if the given value is not nil.
  611. func (_c *GroupCreate) SetNillableSortOrder(v *int) *GroupCreate {
  612. if v != nil {
  613. _c.SetSortOrder(*v)
  614. }
  615. return _c
  616. }
  617. // SetAllowMessagesDispatch sets the "allow_messages_dispatch" field.
  618. func (_c *GroupCreate) SetAllowMessagesDispatch(v bool) *GroupCreate {
  619. _c.mutation.SetAllowMessagesDispatch(v)
  620. return _c
  621. }
  622. // SetNillableAllowMessagesDispatch sets the "allow_messages_dispatch" field if the given value is not nil.
  623. func (_c *GroupCreate) SetNillableAllowMessagesDispatch(v *bool) *GroupCreate {
  624. if v != nil {
  625. _c.SetAllowMessagesDispatch(*v)
  626. }
  627. return _c
  628. }
  629. // SetAllowLive sets the "allow_live" field.
  630. func (_c *GroupCreate) SetAllowLive(v bool) *GroupCreate {
  631. _c.mutation.SetAllowLive(v)
  632. return _c
  633. }
  634. // SetNillableAllowLive sets the "allow_live" field if the given value is not nil.
  635. func (_c *GroupCreate) SetNillableAllowLive(v *bool) *GroupCreate {
  636. if v != nil {
  637. _c.SetAllowLive(*v)
  638. }
  639. return _c
  640. }
  641. // SetForceOpenaiFast sets the "force_openai_fast" field.
  642. func (_c *GroupCreate) SetForceOpenaiFast(v bool) *GroupCreate {
  643. _c.mutation.SetForceOpenaiFast(v)
  644. return _c
  645. }
  646. // SetNillableForceOpenaiFast sets the "force_openai_fast" field if the given value is not nil.
  647. func (_c *GroupCreate) SetNillableForceOpenaiFast(v *bool) *GroupCreate {
  648. if v != nil {
  649. _c.SetForceOpenaiFast(*v)
  650. }
  651. return _c
  652. }
  653. // SetFreeOpenaiFast sets the "free_openai_fast" field.
  654. func (_c *GroupCreate) SetFreeOpenaiFast(v bool) *GroupCreate {
  655. _c.mutation.SetFreeOpenaiFast(v)
  656. return _c
  657. }
  658. // SetNillableFreeOpenaiFast sets the "free_openai_fast" field if the given value is not nil.
  659. func (_c *GroupCreate) SetNillableFreeOpenaiFast(v *bool) *GroupCreate {
  660. if v != nil {
  661. _c.SetFreeOpenaiFast(*v)
  662. }
  663. return _c
  664. }
  665. // SetRequireOauthOnly sets the "require_oauth_only" field.
  666. func (_c *GroupCreate) SetRequireOauthOnly(v bool) *GroupCreate {
  667. _c.mutation.SetRequireOauthOnly(v)
  668. return _c
  669. }
  670. // SetNillableRequireOauthOnly sets the "require_oauth_only" field if the given value is not nil.
  671. func (_c *GroupCreate) SetNillableRequireOauthOnly(v *bool) *GroupCreate {
  672. if v != nil {
  673. _c.SetRequireOauthOnly(*v)
  674. }
  675. return _c
  676. }
  677. // SetRequirePrivacySet sets the "require_privacy_set" field.
  678. func (_c *GroupCreate) SetRequirePrivacySet(v bool) *GroupCreate {
  679. _c.mutation.SetRequirePrivacySet(v)
  680. return _c
  681. }
  682. // SetNillableRequirePrivacySet sets the "require_privacy_set" field if the given value is not nil.
  683. func (_c *GroupCreate) SetNillableRequirePrivacySet(v *bool) *GroupCreate {
  684. if v != nil {
  685. _c.SetRequirePrivacySet(*v)
  686. }
  687. return _c
  688. }
  689. // SetDefaultMappedModel sets the "default_mapped_model" field.
  690. func (_c *GroupCreate) SetDefaultMappedModel(v string) *GroupCreate {
  691. _c.mutation.SetDefaultMappedModel(v)
  692. return _c
  693. }
  694. // SetNillableDefaultMappedModel sets the "default_mapped_model" field if the given value is not nil.
  695. func (_c *GroupCreate) SetNillableDefaultMappedModel(v *string) *GroupCreate {
  696. if v != nil {
  697. _c.SetDefaultMappedModel(*v)
  698. }
  699. return _c
  700. }
  701. // SetMessagesDispatchModelConfig sets the "messages_dispatch_model_config" field.
  702. func (_c *GroupCreate) SetMessagesDispatchModelConfig(v domain.OpenAIMessagesDispatchModelConfig) *GroupCreate {
  703. _c.mutation.SetMessagesDispatchModelConfig(v)
  704. return _c
  705. }
  706. // SetNillableMessagesDispatchModelConfig sets the "messages_dispatch_model_config" field if the given value is not nil.
  707. func (_c *GroupCreate) SetNillableMessagesDispatchModelConfig(v *domain.OpenAIMessagesDispatchModelConfig) *GroupCreate {
  708. if v != nil {
  709. _c.SetMessagesDispatchModelConfig(*v)
  710. }
  711. return _c
  712. }
  713. // SetModelAllowlist sets the "model_allowlist" field.
  714. func (_c *GroupCreate) SetModelAllowlist(v domain.GroupModelAllowlist) *GroupCreate {
  715. _c.mutation.SetModelAllowlist(v)
  716. return _c
  717. }
  718. // SetNillableModelAllowlist sets the "model_allowlist" field if the given value is not nil.
  719. func (_c *GroupCreate) SetNillableModelAllowlist(v *domain.GroupModelAllowlist) *GroupCreate {
  720. if v != nil {
  721. _c.SetModelAllowlist(*v)
  722. }
  723. return _c
  724. }
  725. // SetCodexModelsManifestConfig sets the "codex_models_manifest_config" field.
  726. func (_c *GroupCreate) SetCodexModelsManifestConfig(v domain.GroupCodexModelsManifestConfig) *GroupCreate {
  727. _c.mutation.SetCodexModelsManifestConfig(v)
  728. return _c
  729. }
  730. // SetNillableCodexModelsManifestConfig sets the "codex_models_manifest_config" field if the given value is not nil.
  731. func (_c *GroupCreate) SetNillableCodexModelsManifestConfig(v *domain.GroupCodexModelsManifestConfig) *GroupCreate {
  732. if v != nil {
  733. _c.SetCodexModelsManifestConfig(*v)
  734. }
  735. return _c
  736. }
  737. // SetRpmLimit sets the "rpm_limit" field.
  738. func (_c *GroupCreate) SetRpmLimit(v int) *GroupCreate {
  739. _c.mutation.SetRpmLimit(v)
  740. return _c
  741. }
  742. // SetNillableRpmLimit sets the "rpm_limit" field if the given value is not nil.
  743. func (_c *GroupCreate) SetNillableRpmLimit(v *int) *GroupCreate {
  744. if v != nil {
  745. _c.SetRpmLimit(*v)
  746. }
  747. return _c
  748. }
  749. // SetMaxReasoningEffort sets the "max_reasoning_effort" field.
  750. func (_c *GroupCreate) SetMaxReasoningEffort(v string) *GroupCreate {
  751. _c.mutation.SetMaxReasoningEffort(v)
  752. return _c
  753. }
  754. // SetNillableMaxReasoningEffort sets the "max_reasoning_effort" field if the given value is not nil.
  755. func (_c *GroupCreate) SetNillableMaxReasoningEffort(v *string) *GroupCreate {
  756. if v != nil {
  757. _c.SetMaxReasoningEffort(*v)
  758. }
  759. return _c
  760. }
  761. // SetMaxReasoningEffortOverLimit sets the "max_reasoning_effort_over_limit" field.
  762. func (_c *GroupCreate) SetMaxReasoningEffortOverLimit(v string) *GroupCreate {
  763. _c.mutation.SetMaxReasoningEffortOverLimit(v)
  764. return _c
  765. }
  766. // SetNillableMaxReasoningEffortOverLimit sets the "max_reasoning_effort_over_limit" field if the given value is not nil.
  767. func (_c *GroupCreate) SetNillableMaxReasoningEffortOverLimit(v *string) *GroupCreate {
  768. if v != nil {
  769. _c.SetMaxReasoningEffortOverLimit(*v)
  770. }
  771. return _c
  772. }
  773. // SetReasoningEffortMappings sets the "reasoning_effort_mappings" field.
  774. func (_c *GroupCreate) SetReasoningEffortMappings(v []domain.ReasoningEffortMapping) *GroupCreate {
  775. _c.mutation.SetReasoningEffortMappings(v)
  776. return _c
  777. }
  778. // SetProfitControlEnabled sets the "profit_control_enabled" field.
  779. func (_c *GroupCreate) SetProfitControlEnabled(v bool) *GroupCreate {
  780. _c.mutation.SetProfitControlEnabled(v)
  781. return _c
  782. }
  783. // SetNillableProfitControlEnabled sets the "profit_control_enabled" field if the given value is not nil.
  784. func (_c *GroupCreate) SetNillableProfitControlEnabled(v *bool) *GroupCreate {
  785. if v != nil {
  786. _c.SetProfitControlEnabled(*v)
  787. }
  788. return _c
  789. }
  790. // SetProfitMinMargin sets the "profit_min_margin" field.
  791. func (_c *GroupCreate) SetProfitMinMargin(v float64) *GroupCreate {
  792. _c.mutation.SetProfitMinMargin(v)
  793. return _c
  794. }
  795. // SetNillableProfitMinMargin sets the "profit_min_margin" field if the given value is not nil.
  796. func (_c *GroupCreate) SetNillableProfitMinMargin(v *float64) *GroupCreate {
  797. if v != nil {
  798. _c.SetProfitMinMargin(*v)
  799. }
  800. return _c
  801. }
  802. // SetProfitSafetyBuffer sets the "profit_safety_buffer" field.
  803. func (_c *GroupCreate) SetProfitSafetyBuffer(v float64) *GroupCreate {
  804. _c.mutation.SetProfitSafetyBuffer(v)
  805. return _c
  806. }
  807. // SetNillableProfitSafetyBuffer sets the "profit_safety_buffer" field if the given value is not nil.
  808. func (_c *GroupCreate) SetNillableProfitSafetyBuffer(v *float64) *GroupCreate {
  809. if v != nil {
  810. _c.SetProfitSafetyBuffer(*v)
  811. }
  812. return _c
  813. }
  814. // AddAPIKeyIDs adds the "api_keys" edge to the APIKey entity by IDs.
  815. func (_c *GroupCreate) AddAPIKeyIDs(ids ...int64) *GroupCreate {
  816. _c.mutation.AddAPIKeyIDs(ids...)
  817. return _c
  818. }
  819. // AddAPIKeys adds the "api_keys" edges to the APIKey entity.
  820. func (_c *GroupCreate) AddAPIKeys(v ...*APIKey) *GroupCreate {
  821. ids := make([]int64, len(v))
  822. for i := range v {
  823. ids[i] = v[i].ID
  824. }
  825. return _c.AddAPIKeyIDs(ids...)
  826. }
  827. // AddRedeemCodeIDs adds the "redeem_codes" edge to the RedeemCode entity by IDs.
  828. func (_c *GroupCreate) AddRedeemCodeIDs(ids ...int64) *GroupCreate {
  829. _c.mutation.AddRedeemCodeIDs(ids...)
  830. return _c
  831. }
  832. // AddRedeemCodes adds the "redeem_codes" edges to the RedeemCode entity.
  833. func (_c *GroupCreate) AddRedeemCodes(v ...*RedeemCode) *GroupCreate {
  834. ids := make([]int64, len(v))
  835. for i := range v {
  836. ids[i] = v[i].ID
  837. }
  838. return _c.AddRedeemCodeIDs(ids...)
  839. }
  840. // AddSubscriptionIDs adds the "subscriptions" edge to the UserSubscription entity by IDs.
  841. func (_c *GroupCreate) AddSubscriptionIDs(ids ...int64) *GroupCreate {
  842. _c.mutation.AddSubscriptionIDs(ids...)
  843. return _c
  844. }
  845. // AddSubscriptions adds the "subscriptions" edges to the UserSubscription entity.
  846. func (_c *GroupCreate) AddSubscriptions(v ...*UserSubscription) *GroupCreate {
  847. ids := make([]int64, len(v))
  848. for i := range v {
  849. ids[i] = v[i].ID
  850. }
  851. return _c.AddSubscriptionIDs(ids...)
  852. }
  853. // AddUsageLogIDs adds the "usage_logs" edge to the UsageLog entity by IDs.
  854. func (_c *GroupCreate) AddUsageLogIDs(ids ...int64) *GroupCreate {
  855. _c.mutation.AddUsageLogIDs(ids...)
  856. return _c
  857. }
  858. // AddUsageLogs adds the "usage_logs" edges to the UsageLog entity.
  859. func (_c *GroupCreate) AddUsageLogs(v ...*UsageLog) *GroupCreate {
  860. ids := make([]int64, len(v))
  861. for i := range v {
  862. ids[i] = v[i].ID
  863. }
  864. return _c.AddUsageLogIDs(ids...)
  865. }
  866. // AddAccountIDs adds the "accounts" edge to the Account entity by IDs.
  867. func (_c *GroupCreate) AddAccountIDs(ids ...int64) *GroupCreate {
  868. _c.mutation.AddAccountIDs(ids...)
  869. return _c
  870. }
  871. // AddAccounts adds the "accounts" edges to the Account entity.
  872. func (_c *GroupCreate) AddAccounts(v ...*Account) *GroupCreate {
  873. ids := make([]int64, len(v))
  874. for i := range v {
  875. ids[i] = v[i].ID
  876. }
  877. return _c.AddAccountIDs(ids...)
  878. }
  879. // AddAllowedUserIDs adds the "allowed_users" edge to the User entity by IDs.
  880. func (_c *GroupCreate) AddAllowedUserIDs(ids ...int64) *GroupCreate {
  881. _c.mutation.AddAllowedUserIDs(ids...)
  882. return _c
  883. }
  884. // AddAllowedUsers adds the "allowed_users" edges to the User entity.
  885. func (_c *GroupCreate) AddAllowedUsers(v ...*User) *GroupCreate {
  886. ids := make([]int64, len(v))
  887. for i := range v {
  888. ids[i] = v[i].ID
  889. }
  890. return _c.AddAllowedUserIDs(ids...)
  891. }
  892. // Mutation returns the GroupMutation object of the builder.
  893. func (_c *GroupCreate) Mutation() *GroupMutation {
  894. return _c.mutation
  895. }
  896. // Save creates the Group in the database.
  897. func (_c *GroupCreate) Save(ctx context.Context) (*Group, error) {
  898. if err := _c.defaults(); err != nil {
  899. return nil, err
  900. }
  901. return withHooks(ctx, _c.sqlSave, _c.mutation, _c.hooks)
  902. }
  903. // SaveX calls Save and panics if Save returns an error.
  904. func (_c *GroupCreate) SaveX(ctx context.Context) *Group {
  905. v, err := _c.Save(ctx)
  906. if err != nil {
  907. panic(err)
  908. }
  909. return v
  910. }
  911. // Exec executes the query.
  912. func (_c *GroupCreate) Exec(ctx context.Context) error {
  913. _, err := _c.Save(ctx)
  914. return err
  915. }
  916. // ExecX is like Exec, but panics if an error occurs.
  917. func (_c *GroupCreate) ExecX(ctx context.Context) {
  918. if err := _c.Exec(ctx); err != nil {
  919. panic(err)
  920. }
  921. }
  922. // defaults sets the default values of the builder before save.
  923. func (_c *GroupCreate) defaults() error {
  924. if _, ok := _c.mutation.CreatedAt(); !ok {
  925. if group.DefaultCreatedAt == nil {
  926. return fmt.Errorf("ent: uninitialized group.DefaultCreatedAt (forgotten import ent/runtime?)")
  927. }
  928. v := group.DefaultCreatedAt()
  929. _c.mutation.SetCreatedAt(v)
  930. }
  931. if _, ok := _c.mutation.UpdatedAt(); !ok {
  932. if group.DefaultUpdatedAt == nil {
  933. return fmt.Errorf("ent: uninitialized group.DefaultUpdatedAt (forgotten import ent/runtime?)")
  934. }
  935. v := group.DefaultUpdatedAt()
  936. _c.mutation.SetUpdatedAt(v)
  937. }
  938. if _, ok := _c.mutation.RateMultiplier(); !ok {
  939. v := group.DefaultRateMultiplier
  940. _c.mutation.SetRateMultiplier(v)
  941. }
  942. if _, ok := _c.mutation.PeakRateEnabled(); !ok {
  943. v := group.DefaultPeakRateEnabled
  944. _c.mutation.SetPeakRateEnabled(v)
  945. }
  946. if _, ok := _c.mutation.PeakStart(); !ok {
  947. v := group.DefaultPeakStart
  948. _c.mutation.SetPeakStart(v)
  949. }
  950. if _, ok := _c.mutation.PeakEnd(); !ok {
  951. v := group.DefaultPeakEnd
  952. _c.mutation.SetPeakEnd(v)
  953. }
  954. if _, ok := _c.mutation.PeakRateMultiplier(); !ok {
  955. v := group.DefaultPeakRateMultiplier
  956. _c.mutation.SetPeakRateMultiplier(v)
  957. }
  958. if _, ok := _c.mutation.IsExclusive(); !ok {
  959. v := group.DefaultIsExclusive
  960. _c.mutation.SetIsExclusive(v)
  961. }
  962. if _, ok := _c.mutation.SecurityPolicyEnabled(); !ok {
  963. v := group.DefaultSecurityPolicyEnabled
  964. _c.mutation.SetSecurityPolicyEnabled(v)
  965. }
  966. if _, ok := _c.mutation.SecurityPolicyMode(); !ok {
  967. v := group.DefaultSecurityPolicyMode
  968. _c.mutation.SetSecurityPolicyMode(v)
  969. }
  970. if _, ok := _c.mutation.SecurityPolicyEmailEnabled(); !ok {
  971. v := group.DefaultSecurityPolicyEmailEnabled
  972. _c.mutation.SetSecurityPolicyEmailEnabled(v)
  973. }
  974. if _, ok := _c.mutation.Status(); !ok {
  975. v := group.DefaultStatus
  976. _c.mutation.SetStatus(v)
  977. }
  978. if _, ok := _c.mutation.Platform(); !ok {
  979. v := group.DefaultPlatform
  980. _c.mutation.SetPlatform(v)
  981. }
  982. if _, ok := _c.mutation.SubscriptionType(); !ok {
  983. v := group.DefaultSubscriptionType
  984. _c.mutation.SetSubscriptionType(v)
  985. }
  986. if _, ok := _c.mutation.DefaultValidityDays(); !ok {
  987. v := group.DefaultDefaultValidityDays
  988. _c.mutation.SetDefaultValidityDays(v)
  989. }
  990. if _, ok := _c.mutation.AllowImageGeneration(); !ok {
  991. v := group.DefaultAllowImageGeneration
  992. _c.mutation.SetAllowImageGeneration(v)
  993. }
  994. if _, ok := _c.mutation.AllowBatchImageGeneration(); !ok {
  995. v := group.DefaultAllowBatchImageGeneration
  996. _c.mutation.SetAllowBatchImageGeneration(v)
  997. }
  998. if _, ok := _c.mutation.ImageRateIndependent(); !ok {
  999. v := group.DefaultImageRateIndependent
  1000. _c.mutation.SetImageRateIndependent(v)
  1001. }
  1002. if _, ok := _c.mutation.ImageRateMultiplier(); !ok {
  1003. v := group.DefaultImageRateMultiplier
  1004. _c.mutation.SetImageRateMultiplier(v)
  1005. }
  1006. if _, ok := _c.mutation.BatchImageDiscountMultiplier(); !ok {
  1007. v := group.DefaultBatchImageDiscountMultiplier
  1008. _c.mutation.SetBatchImageDiscountMultiplier(v)
  1009. }
  1010. if _, ok := _c.mutation.BatchImageHoldMultiplier(); !ok {
  1011. v := group.DefaultBatchImageHoldMultiplier
  1012. _c.mutation.SetBatchImageHoldMultiplier(v)
  1013. }
  1014. if _, ok := _c.mutation.VideoRateIndependent(); !ok {
  1015. v := group.DefaultVideoRateIndependent
  1016. _c.mutation.SetVideoRateIndependent(v)
  1017. }
  1018. if _, ok := _c.mutation.VideoRateMultiplier(); !ok {
  1019. v := group.DefaultVideoRateMultiplier
  1020. _c.mutation.SetVideoRateMultiplier(v)
  1021. }
  1022. if _, ok := _c.mutation.LongContextPricingEnabled(); !ok {
  1023. v := group.DefaultLongContextPricingEnabled
  1024. _c.mutation.SetLongContextPricingEnabled(v)
  1025. }
  1026. if _, ok := _c.mutation.ClaudeCodeOnly(); !ok {
  1027. v := group.DefaultClaudeCodeOnly
  1028. _c.mutation.SetClaudeCodeOnly(v)
  1029. }
  1030. if _, ok := _c.mutation.ModelRoutingEnabled(); !ok {
  1031. v := group.DefaultModelRoutingEnabled
  1032. _c.mutation.SetModelRoutingEnabled(v)
  1033. }
  1034. if _, ok := _c.mutation.McpXMLInject(); !ok {
  1035. v := group.DefaultMcpXMLInject
  1036. _c.mutation.SetMcpXMLInject(v)
  1037. }
  1038. if _, ok := _c.mutation.SupportedModelScopes(); !ok {
  1039. v := group.DefaultSupportedModelScopes
  1040. _c.mutation.SetSupportedModelScopes(v)
  1041. }
  1042. if _, ok := _c.mutation.SortOrder(); !ok {
  1043. v := group.DefaultSortOrder
  1044. _c.mutation.SetSortOrder(v)
  1045. }
  1046. if _, ok := _c.mutation.AllowMessagesDispatch(); !ok {
  1047. v := group.DefaultAllowMessagesDispatch
  1048. _c.mutation.SetAllowMessagesDispatch(v)
  1049. }
  1050. if _, ok := _c.mutation.AllowLive(); !ok {
  1051. v := group.DefaultAllowLive
  1052. _c.mutation.SetAllowLive(v)
  1053. }
  1054. if _, ok := _c.mutation.ForceOpenaiFast(); !ok {
  1055. v := group.DefaultForceOpenaiFast
  1056. _c.mutation.SetForceOpenaiFast(v)
  1057. }
  1058. if _, ok := _c.mutation.FreeOpenaiFast(); !ok {
  1059. v := group.DefaultFreeOpenaiFast
  1060. _c.mutation.SetFreeOpenaiFast(v)
  1061. }
  1062. if _, ok := _c.mutation.RequireOauthOnly(); !ok {
  1063. v := group.DefaultRequireOauthOnly
  1064. _c.mutation.SetRequireOauthOnly(v)
  1065. }
  1066. if _, ok := _c.mutation.RequirePrivacySet(); !ok {
  1067. v := group.DefaultRequirePrivacySet
  1068. _c.mutation.SetRequirePrivacySet(v)
  1069. }
  1070. if _, ok := _c.mutation.DefaultMappedModel(); !ok {
  1071. v := group.DefaultDefaultMappedModel
  1072. _c.mutation.SetDefaultMappedModel(v)
  1073. }
  1074. if _, ok := _c.mutation.MessagesDispatchModelConfig(); !ok {
  1075. v := group.DefaultMessagesDispatchModelConfig
  1076. _c.mutation.SetMessagesDispatchModelConfig(v)
  1077. }
  1078. if _, ok := _c.mutation.ModelAllowlist(); !ok {
  1079. v := group.DefaultModelAllowlist
  1080. _c.mutation.SetModelAllowlist(v)
  1081. }
  1082. if _, ok := _c.mutation.CodexModelsManifestConfig(); !ok {
  1083. v := group.DefaultCodexModelsManifestConfig
  1084. _c.mutation.SetCodexModelsManifestConfig(v)
  1085. }
  1086. if _, ok := _c.mutation.RpmLimit(); !ok {
  1087. v := group.DefaultRpmLimit
  1088. _c.mutation.SetRpmLimit(v)
  1089. }
  1090. if _, ok := _c.mutation.MaxReasoningEffort(); !ok {
  1091. v := group.DefaultMaxReasoningEffort
  1092. _c.mutation.SetMaxReasoningEffort(v)
  1093. }
  1094. if _, ok := _c.mutation.MaxReasoningEffortOverLimit(); !ok {
  1095. v := group.DefaultMaxReasoningEffortOverLimit
  1096. _c.mutation.SetMaxReasoningEffortOverLimit(v)
  1097. }
  1098. if _, ok := _c.mutation.ReasoningEffortMappings(); !ok {
  1099. v := group.DefaultReasoningEffortMappings
  1100. _c.mutation.SetReasoningEffortMappings(v)
  1101. }
  1102. if _, ok := _c.mutation.ProfitControlEnabled(); !ok {
  1103. v := group.DefaultProfitControlEnabled
  1104. _c.mutation.SetProfitControlEnabled(v)
  1105. }
  1106. if _, ok := _c.mutation.ProfitMinMargin(); !ok {
  1107. v := group.DefaultProfitMinMargin
  1108. _c.mutation.SetProfitMinMargin(v)
  1109. }
  1110. if _, ok := _c.mutation.ProfitSafetyBuffer(); !ok {
  1111. v := group.DefaultProfitSafetyBuffer
  1112. _c.mutation.SetProfitSafetyBuffer(v)
  1113. }
  1114. return nil
  1115. }
  1116. // check runs all checks and user-defined validators on the builder.
  1117. func (_c *GroupCreate) check() error {
  1118. if _, ok := _c.mutation.CreatedAt(); !ok {
  1119. return &ValidationError{Name: "created_at", err: errors.New(`ent: missing required field "Group.created_at"`)}
  1120. }
  1121. if _, ok := _c.mutation.UpdatedAt(); !ok {
  1122. return &ValidationError{Name: "updated_at", err: errors.New(`ent: missing required field "Group.updated_at"`)}
  1123. }
  1124. if _, ok := _c.mutation.Name(); !ok {
  1125. return &ValidationError{Name: "name", err: errors.New(`ent: missing required field "Group.name"`)}
  1126. }
  1127. if v, ok := _c.mutation.Name(); ok {
  1128. if err := group.NameValidator(v); err != nil {
  1129. return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "Group.name": %w`, err)}
  1130. }
  1131. }
  1132. if _, ok := _c.mutation.RateMultiplier(); !ok {
  1133. return &ValidationError{Name: "rate_multiplier", err: errors.New(`ent: missing required field "Group.rate_multiplier"`)}
  1134. }
  1135. if _, ok := _c.mutation.PeakRateEnabled(); !ok {
  1136. return &ValidationError{Name: "peak_rate_enabled", err: errors.New(`ent: missing required field "Group.peak_rate_enabled"`)}
  1137. }
  1138. if _, ok := _c.mutation.PeakStart(); !ok {
  1139. return &ValidationError{Name: "peak_start", err: errors.New(`ent: missing required field "Group.peak_start"`)}
  1140. }
  1141. if v, ok := _c.mutation.PeakStart(); ok {
  1142. if err := group.PeakStartValidator(v); err != nil {
  1143. return &ValidationError{Name: "peak_start", err: fmt.Errorf(`ent: validator failed for field "Group.peak_start": %w`, err)}
  1144. }
  1145. }
  1146. if _, ok := _c.mutation.PeakEnd(); !ok {
  1147. return &ValidationError{Name: "peak_end", err: errors.New(`ent: missing required field "Group.peak_end"`)}
  1148. }
  1149. if v, ok := _c.mutation.PeakEnd(); ok {
  1150. if err := group.PeakEndValidator(v); err != nil {
  1151. return &ValidationError{Name: "peak_end", err: fmt.Errorf(`ent: validator failed for field "Group.peak_end": %w`, err)}
  1152. }
  1153. }
  1154. if _, ok := _c.mutation.PeakRateMultiplier(); !ok {
  1155. return &ValidationError{Name: "peak_rate_multiplier", err: errors.New(`ent: missing required field "Group.peak_rate_multiplier"`)}
  1156. }
  1157. if _, ok := _c.mutation.IsExclusive(); !ok {
  1158. return &ValidationError{Name: "is_exclusive", err: errors.New(`ent: missing required field "Group.is_exclusive"`)}
  1159. }
  1160. if _, ok := _c.mutation.SecurityPolicyEnabled(); !ok {
  1161. return &ValidationError{Name: "security_policy_enabled", err: errors.New(`ent: missing required field "Group.security_policy_enabled"`)}
  1162. }
  1163. if _, ok := _c.mutation.SecurityPolicyMode(); !ok {
  1164. return &ValidationError{Name: "security_policy_mode", err: errors.New(`ent: missing required field "Group.security_policy_mode"`)}
  1165. }
  1166. if v, ok := _c.mutation.SecurityPolicyMode(); ok {
  1167. if err := group.SecurityPolicyModeValidator(v); err != nil {
  1168. return &ValidationError{Name: "security_policy_mode", err: fmt.Errorf(`ent: validator failed for field "Group.security_policy_mode": %w`, err)}
  1169. }
  1170. }
  1171. if _, ok := _c.mutation.SecurityPolicyEmailEnabled(); !ok {
  1172. return &ValidationError{Name: "security_policy_email_enabled", err: errors.New(`ent: missing required field "Group.security_policy_email_enabled"`)}
  1173. }
  1174. if _, ok := _c.mutation.Status(); !ok {
  1175. return &ValidationError{Name: "status", err: errors.New(`ent: missing required field "Group.status"`)}
  1176. }
  1177. if v, ok := _c.mutation.Status(); ok {
  1178. if err := group.StatusValidator(v); err != nil {
  1179. return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "Group.status": %w`, err)}
  1180. }
  1181. }
  1182. if v, ok := _c.mutation.DuplicateOperationID(); ok {
  1183. if err := group.DuplicateOperationIDValidator(v); err != nil {
  1184. return &ValidationError{Name: "duplicate_operation_id", err: fmt.Errorf(`ent: validator failed for field "Group.duplicate_operation_id": %w`, err)}
  1185. }
  1186. }
  1187. if _, ok := _c.mutation.Platform(); !ok {
  1188. return &ValidationError{Name: "platform", err: errors.New(`ent: missing required field "Group.platform"`)}
  1189. }
  1190. if v, ok := _c.mutation.Platform(); ok {
  1191. if err := group.PlatformValidator(v); err != nil {
  1192. return &ValidationError{Name: "platform", err: fmt.Errorf(`ent: validator failed for field "Group.platform": %w`, err)}
  1193. }
  1194. }
  1195. if _, ok := _c.mutation.SubscriptionType(); !ok {
  1196. return &ValidationError{Name: "subscription_type", err: errors.New(`ent: missing required field "Group.subscription_type"`)}
  1197. }
  1198. if v, ok := _c.mutation.SubscriptionType(); ok {
  1199. if err := group.SubscriptionTypeValidator(v); err != nil {
  1200. return &ValidationError{Name: "subscription_type", err: fmt.Errorf(`ent: validator failed for field "Group.subscription_type": %w`, err)}
  1201. }
  1202. }
  1203. if _, ok := _c.mutation.DefaultValidityDays(); !ok {
  1204. return &ValidationError{Name: "default_validity_days", err: errors.New(`ent: missing required field "Group.default_validity_days"`)}
  1205. }
  1206. if _, ok := _c.mutation.AllowImageGeneration(); !ok {
  1207. return &ValidationError{Name: "allow_image_generation", err: errors.New(`ent: missing required field "Group.allow_image_generation"`)}
  1208. }
  1209. if _, ok := _c.mutation.AllowBatchImageGeneration(); !ok {
  1210. return &ValidationError{Name: "allow_batch_image_generation", err: errors.New(`ent: missing required field "Group.allow_batch_image_generation"`)}
  1211. }
  1212. if _, ok := _c.mutation.ImageRateIndependent(); !ok {
  1213. return &ValidationError{Name: "image_rate_independent", err: errors.New(`ent: missing required field "Group.image_rate_independent"`)}
  1214. }
  1215. if _, ok := _c.mutation.ImageRateMultiplier(); !ok {
  1216. return &ValidationError{Name: "image_rate_multiplier", err: errors.New(`ent: missing required field "Group.image_rate_multiplier"`)}
  1217. }
  1218. if _, ok := _c.mutation.BatchImageDiscountMultiplier(); !ok {
  1219. return &ValidationError{Name: "batch_image_discount_multiplier", err: errors.New(`ent: missing required field "Group.batch_image_discount_multiplier"`)}
  1220. }
  1221. if _, ok := _c.mutation.BatchImageHoldMultiplier(); !ok {
  1222. return &ValidationError{Name: "batch_image_hold_multiplier", err: errors.New(`ent: missing required field "Group.batch_image_hold_multiplier"`)}
  1223. }
  1224. if _, ok := _c.mutation.VideoRateIndependent(); !ok {
  1225. return &ValidationError{Name: "video_rate_independent", err: errors.New(`ent: missing required field "Group.video_rate_independent"`)}
  1226. }
  1227. if _, ok := _c.mutation.VideoRateMultiplier(); !ok {
  1228. return &ValidationError{Name: "video_rate_multiplier", err: errors.New(`ent: missing required field "Group.video_rate_multiplier"`)}
  1229. }
  1230. if v, ok := _c.mutation.SearchPricePer1k(); ok {
  1231. if err := group.SearchPricePer1kValidator(v); err != nil {
  1232. return &ValidationError{Name: "search_price_per_1k", err: fmt.Errorf(`ent: validator failed for field "Group.search_price_per_1k": %w`, err)}
  1233. }
  1234. }
  1235. if v, ok := _c.mutation.AudioRealtimePricePerMin(); ok {
  1236. if err := group.AudioRealtimePricePerMinValidator(v); err != nil {
  1237. return &ValidationError{Name: "audio_realtime_price_per_min", err: fmt.Errorf(`ent: validator failed for field "Group.audio_realtime_price_per_min": %w`, err)}
  1238. }
  1239. }
  1240. if v, ok := _c.mutation.AudioTtsPricePerMillionChars(); ok {
  1241. if err := group.AudioTtsPricePerMillionCharsValidator(v); err != nil {
  1242. 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)}
  1243. }
  1244. }
  1245. if v, ok := _c.mutation.AudioSttPricePerHour(); ok {
  1246. if err := group.AudioSttPricePerHourValidator(v); err != nil {
  1247. return &ValidationError{Name: "audio_stt_price_per_hour", err: fmt.Errorf(`ent: validator failed for field "Group.audio_stt_price_per_hour": %w`, err)}
  1248. }
  1249. }
  1250. if _, ok := _c.mutation.LongContextPricingEnabled(); !ok {
  1251. return &ValidationError{Name: "long_context_pricing_enabled", err: errors.New(`ent: missing required field "Group.long_context_pricing_enabled"`)}
  1252. }
  1253. if _, ok := _c.mutation.ClaudeCodeOnly(); !ok {
  1254. return &ValidationError{Name: "claude_code_only", err: errors.New(`ent: missing required field "Group.claude_code_only"`)}
  1255. }
  1256. if _, ok := _c.mutation.ModelRoutingEnabled(); !ok {
  1257. return &ValidationError{Name: "model_routing_enabled", err: errors.New(`ent: missing required field "Group.model_routing_enabled"`)}
  1258. }
  1259. if _, ok := _c.mutation.McpXMLInject(); !ok {
  1260. return &ValidationError{Name: "mcp_xml_inject", err: errors.New(`ent: missing required field "Group.mcp_xml_inject"`)}
  1261. }
  1262. if _, ok := _c.mutation.SupportedModelScopes(); !ok {
  1263. return &ValidationError{Name: "supported_model_scopes", err: errors.New(`ent: missing required field "Group.supported_model_scopes"`)}
  1264. }
  1265. if _, ok := _c.mutation.SortOrder(); !ok {
  1266. return &ValidationError{Name: "sort_order", err: errors.New(`ent: missing required field "Group.sort_order"`)}
  1267. }
  1268. if _, ok := _c.mutation.AllowMessagesDispatch(); !ok {
  1269. return &ValidationError{Name: "allow_messages_dispatch", err: errors.New(`ent: missing required field "Group.allow_messages_dispatch"`)}
  1270. }
  1271. if _, ok := _c.mutation.AllowLive(); !ok {
  1272. return &ValidationError{Name: "allow_live", err: errors.New(`ent: missing required field "Group.allow_live"`)}
  1273. }
  1274. if _, ok := _c.mutation.ForceOpenaiFast(); !ok {
  1275. return &ValidationError{Name: "force_openai_fast", err: errors.New(`ent: missing required field "Group.force_openai_fast"`)}
  1276. }
  1277. if _, ok := _c.mutation.FreeOpenaiFast(); !ok {
  1278. return &ValidationError{Name: "free_openai_fast", err: errors.New(`ent: missing required field "Group.free_openai_fast"`)}
  1279. }
  1280. if _, ok := _c.mutation.RequireOauthOnly(); !ok {
  1281. return &ValidationError{Name: "require_oauth_only", err: errors.New(`ent: missing required field "Group.require_oauth_only"`)}
  1282. }
  1283. if _, ok := _c.mutation.RequirePrivacySet(); !ok {
  1284. return &ValidationError{Name: "require_privacy_set", err: errors.New(`ent: missing required field "Group.require_privacy_set"`)}
  1285. }
  1286. if _, ok := _c.mutation.DefaultMappedModel(); !ok {
  1287. return &ValidationError{Name: "default_mapped_model", err: errors.New(`ent: missing required field "Group.default_mapped_model"`)}
  1288. }
  1289. if v, ok := _c.mutation.DefaultMappedModel(); ok {
  1290. if err := group.DefaultMappedModelValidator(v); err != nil {
  1291. return &ValidationError{Name: "default_mapped_model", err: fmt.Errorf(`ent: validator failed for field "Group.default_mapped_model": %w`, err)}
  1292. }
  1293. }
  1294. if _, ok := _c.mutation.MessagesDispatchModelConfig(); !ok {
  1295. return &ValidationError{Name: "messages_dispatch_model_config", err: errors.New(`ent: missing required field "Group.messages_dispatch_model_config"`)}
  1296. }
  1297. if _, ok := _c.mutation.ModelAllowlist(); !ok {
  1298. return &ValidationError{Name: "model_allowlist", err: errors.New(`ent: missing required field "Group.model_allowlist"`)}
  1299. }
  1300. if _, ok := _c.mutation.CodexModelsManifestConfig(); !ok {
  1301. return &ValidationError{Name: "codex_models_manifest_config", err: errors.New(`ent: missing required field "Group.codex_models_manifest_config"`)}
  1302. }
  1303. if _, ok := _c.mutation.RpmLimit(); !ok {
  1304. return &ValidationError{Name: "rpm_limit", err: errors.New(`ent: missing required field "Group.rpm_limit"`)}
  1305. }
  1306. if _, ok := _c.mutation.MaxReasoningEffort(); !ok {
  1307. return &ValidationError{Name: "max_reasoning_effort", err: errors.New(`ent: missing required field "Group.max_reasoning_effort"`)}
  1308. }
  1309. if v, ok := _c.mutation.MaxReasoningEffort(); ok {
  1310. if err := group.MaxReasoningEffortValidator(v); err != nil {
  1311. return &ValidationError{Name: "max_reasoning_effort", err: fmt.Errorf(`ent: validator failed for field "Group.max_reasoning_effort": %w`, err)}
  1312. }
  1313. }
  1314. if _, ok := _c.mutation.MaxReasoningEffortOverLimit(); !ok {
  1315. return &ValidationError{Name: "max_reasoning_effort_over_limit", err: errors.New(`ent: missing required field "Group.max_reasoning_effort_over_limit"`)}
  1316. }
  1317. if v, ok := _c.mutation.MaxReasoningEffortOverLimit(); ok {
  1318. if err := group.MaxReasoningEffortOverLimitValidator(v); err != nil {
  1319. return &ValidationError{Name: "max_reasoning_effort_over_limit", err: fmt.Errorf(`ent: validator failed for field "Group.max_reasoning_effort_over_limit": %w`, err)}
  1320. }
  1321. }
  1322. if _, ok := _c.mutation.ReasoningEffortMappings(); !ok {
  1323. return &ValidationError{Name: "reasoning_effort_mappings", err: errors.New(`ent: missing required field "Group.reasoning_effort_mappings"`)}
  1324. }
  1325. if _, ok := _c.mutation.ProfitControlEnabled(); !ok {
  1326. return &ValidationError{Name: "profit_control_enabled", err: errors.New(`ent: missing required field "Group.profit_control_enabled"`)}
  1327. }
  1328. if _, ok := _c.mutation.ProfitMinMargin(); !ok {
  1329. return &ValidationError{Name: "profit_min_margin", err: errors.New(`ent: missing required field "Group.profit_min_margin"`)}
  1330. }
  1331. if _, ok := _c.mutation.ProfitSafetyBuffer(); !ok {
  1332. return &ValidationError{Name: "profit_safety_buffer", err: errors.New(`ent: missing required field "Group.profit_safety_buffer"`)}
  1333. }
  1334. return nil
  1335. }
  1336. func (_c *GroupCreate) sqlSave(ctx context.Context) (*Group, error) {
  1337. if err := _c.check(); err != nil {
  1338. return nil, err
  1339. }
  1340. _node, _spec := _c.createSpec()
  1341. if err := sqlgraph.CreateNode(ctx, _c.driver, _spec); err != nil {
  1342. if sqlgraph.IsConstraintError(err) {
  1343. err = &ConstraintError{msg: err.Error(), wrap: err}
  1344. }
  1345. return nil, err
  1346. }
  1347. id := _spec.ID.Value.(int64)
  1348. _node.ID = int64(id)
  1349. _c.mutation.id = &_node.ID
  1350. _c.mutation.done = true
  1351. return _node, nil
  1352. }
  1353. func (_c *GroupCreate) createSpec() (*Group, *sqlgraph.CreateSpec) {
  1354. var (
  1355. _node = &Group{config: _c.config}
  1356. _spec = sqlgraph.NewCreateSpec(group.Table, sqlgraph.NewFieldSpec(group.FieldID, field.TypeInt64))
  1357. )
  1358. _spec.OnConflict = _c.conflict
  1359. if value, ok := _c.mutation.CreatedAt(); ok {
  1360. _spec.SetField(group.FieldCreatedAt, field.TypeTime, value)
  1361. _node.CreatedAt = value
  1362. }
  1363. if value, ok := _c.mutation.UpdatedAt(); ok {
  1364. _spec.SetField(group.FieldUpdatedAt, field.TypeTime, value)
  1365. _node.UpdatedAt = value
  1366. }
  1367. if value, ok := _c.mutation.DeletedAt(); ok {
  1368. _spec.SetField(group.FieldDeletedAt, field.TypeTime, value)
  1369. _node.DeletedAt = &value
  1370. }
  1371. if value, ok := _c.mutation.Name(); ok {
  1372. _spec.SetField(group.FieldName, field.TypeString, value)
  1373. _node.Name = value
  1374. }
  1375. if value, ok := _c.mutation.Description(); ok {
  1376. _spec.SetField(group.FieldDescription, field.TypeString, value)
  1377. _node.Description = &value
  1378. }
  1379. if value, ok := _c.mutation.RateMultiplier(); ok {
  1380. _spec.SetField(group.FieldRateMultiplier, field.TypeFloat64, value)
  1381. _node.RateMultiplier = value
  1382. }
  1383. if value, ok := _c.mutation.PeakRateEnabled(); ok {
  1384. _spec.SetField(group.FieldPeakRateEnabled, field.TypeBool, value)
  1385. _node.PeakRateEnabled = value
  1386. }
  1387. if value, ok := _c.mutation.PeakStart(); ok {
  1388. _spec.SetField(group.FieldPeakStart, field.TypeString, value)
  1389. _node.PeakStart = value
  1390. }
  1391. if value, ok := _c.mutation.PeakEnd(); ok {
  1392. _spec.SetField(group.FieldPeakEnd, field.TypeString, value)
  1393. _node.PeakEnd = value
  1394. }
  1395. if value, ok := _c.mutation.PeakRateMultiplier(); ok {
  1396. _spec.SetField(group.FieldPeakRateMultiplier, field.TypeFloat64, value)
  1397. _node.PeakRateMultiplier = value
  1398. }
  1399. if value, ok := _c.mutation.IsExclusive(); ok {
  1400. _spec.SetField(group.FieldIsExclusive, field.TypeBool, value)
  1401. _node.IsExclusive = value
  1402. }
  1403. if value, ok := _c.mutation.SecurityPolicyEnabled(); ok {
  1404. _spec.SetField(group.FieldSecurityPolicyEnabled, field.TypeBool, value)
  1405. _node.SecurityPolicyEnabled = value
  1406. }
  1407. if value, ok := _c.mutation.SecurityPolicyMode(); ok {
  1408. _spec.SetField(group.FieldSecurityPolicyMode, field.TypeString, value)
  1409. _node.SecurityPolicyMode = value
  1410. }
  1411. if value, ok := _c.mutation.SecurityPolicyEmailEnabled(); ok {
  1412. _spec.SetField(group.FieldSecurityPolicyEmailEnabled, field.TypeBool, value)
  1413. _node.SecurityPolicyEmailEnabled = value
  1414. }
  1415. if value, ok := _c.mutation.Status(); ok {
  1416. _spec.SetField(group.FieldStatus, field.TypeString, value)
  1417. _node.Status = value
  1418. }
  1419. if value, ok := _c.mutation.DuplicateOperationID(); ok {
  1420. _spec.SetField(group.FieldDuplicateOperationID, field.TypeString, value)
  1421. _node.DuplicateOperationID = &value
  1422. }
  1423. if value, ok := _c.mutation.Platform(); ok {
  1424. _spec.SetField(group.FieldPlatform, field.TypeString, value)
  1425. _node.Platform = value
  1426. }
  1427. if value, ok := _c.mutation.SubscriptionType(); ok {
  1428. _spec.SetField(group.FieldSubscriptionType, field.TypeString, value)
  1429. _node.SubscriptionType = value
  1430. }
  1431. if value, ok := _c.mutation.DailyLimitUsd(); ok {
  1432. _spec.SetField(group.FieldDailyLimitUsd, field.TypeFloat64, value)
  1433. _node.DailyLimitUsd = &value
  1434. }
  1435. if value, ok := _c.mutation.WeeklyLimitUsd(); ok {
  1436. _spec.SetField(group.FieldWeeklyLimitUsd, field.TypeFloat64, value)
  1437. _node.WeeklyLimitUsd = &value
  1438. }
  1439. if value, ok := _c.mutation.MonthlyLimitUsd(); ok {
  1440. _spec.SetField(group.FieldMonthlyLimitUsd, field.TypeFloat64, value)
  1441. _node.MonthlyLimitUsd = &value
  1442. }
  1443. if value, ok := _c.mutation.DefaultValidityDays(); ok {
  1444. _spec.SetField(group.FieldDefaultValidityDays, field.TypeInt, value)
  1445. _node.DefaultValidityDays = value
  1446. }
  1447. if value, ok := _c.mutation.AllowImageGeneration(); ok {
  1448. _spec.SetField(group.FieldAllowImageGeneration, field.TypeBool, value)
  1449. _node.AllowImageGeneration = value
  1450. }
  1451. if value, ok := _c.mutation.AllowBatchImageGeneration(); ok {
  1452. _spec.SetField(group.FieldAllowBatchImageGeneration, field.TypeBool, value)
  1453. _node.AllowBatchImageGeneration = value
  1454. }
  1455. if value, ok := _c.mutation.ImageRateIndependent(); ok {
  1456. _spec.SetField(group.FieldImageRateIndependent, field.TypeBool, value)
  1457. _node.ImageRateIndependent = value
  1458. }
  1459. if value, ok := _c.mutation.ImageRateMultiplier(); ok {
  1460. _spec.SetField(group.FieldImageRateMultiplier, field.TypeFloat64, value)
  1461. _node.ImageRateMultiplier = value
  1462. }
  1463. if value, ok := _c.mutation.ImagePrice1k(); ok {
  1464. _spec.SetField(group.FieldImagePrice1k, field.TypeFloat64, value)
  1465. _node.ImagePrice1k = &value
  1466. }
  1467. if value, ok := _c.mutation.ImagePrice2k(); ok {
  1468. _spec.SetField(group.FieldImagePrice2k, field.TypeFloat64, value)
  1469. _node.ImagePrice2k = &value
  1470. }
  1471. if value, ok := _c.mutation.ImagePrice4k(); ok {
  1472. _spec.SetField(group.FieldImagePrice4k, field.TypeFloat64, value)
  1473. _node.ImagePrice4k = &value
  1474. }
  1475. if value, ok := _c.mutation.BatchImageDiscountMultiplier(); ok {
  1476. _spec.SetField(group.FieldBatchImageDiscountMultiplier, field.TypeFloat64, value)
  1477. _node.BatchImageDiscountMultiplier = value
  1478. }
  1479. if value, ok := _c.mutation.BatchImageHoldMultiplier(); ok {
  1480. _spec.SetField(group.FieldBatchImageHoldMultiplier, field.TypeFloat64, value)
  1481. _node.BatchImageHoldMultiplier = value
  1482. }
  1483. if value, ok := _c.mutation.VideoRateIndependent(); ok {
  1484. _spec.SetField(group.FieldVideoRateIndependent, field.TypeBool, value)
  1485. _node.VideoRateIndependent = value
  1486. }
  1487. if value, ok := _c.mutation.VideoRateMultiplier(); ok {
  1488. _spec.SetField(group.FieldVideoRateMultiplier, field.TypeFloat64, value)
  1489. _node.VideoRateMultiplier = value
  1490. }
  1491. if value, ok := _c.mutation.VideoPrice480p(); ok {
  1492. _spec.SetField(group.FieldVideoPrice480p, field.TypeFloat64, value)
  1493. _node.VideoPrice480p = &value
  1494. }
  1495. if value, ok := _c.mutation.VideoPrice720p(); ok {
  1496. _spec.SetField(group.FieldVideoPrice720p, field.TypeFloat64, value)
  1497. _node.VideoPrice720p = &value
  1498. }
  1499. if value, ok := _c.mutation.VideoPrice1080p(); ok {
  1500. _spec.SetField(group.FieldVideoPrice1080p, field.TypeFloat64, value)
  1501. _node.VideoPrice1080p = &value
  1502. }
  1503. if value, ok := _c.mutation.VideoModelPrices(); ok {
  1504. _spec.SetField(group.FieldVideoModelPrices, field.TypeJSON, value)
  1505. _node.VideoModelPrices = value
  1506. }
  1507. if value, ok := _c.mutation.WebSearchPricePerCall(); ok {
  1508. _spec.SetField(group.FieldWebSearchPricePerCall, field.TypeFloat64, value)
  1509. _node.WebSearchPricePerCall = &value
  1510. }
  1511. if value, ok := _c.mutation.SearchPricePer1k(); ok {
  1512. _spec.SetField(group.FieldSearchPricePer1k, field.TypeFloat64, value)
  1513. _node.SearchPricePer1k = &value
  1514. }
  1515. if value, ok := _c.mutation.AudioRealtimePricePerMin(); ok {
  1516. _spec.SetField(group.FieldAudioRealtimePricePerMin, field.TypeFloat64, value)
  1517. _node.AudioRealtimePricePerMin = &value
  1518. }
  1519. if value, ok := _c.mutation.AudioTtsPricePerMillionChars(); ok {
  1520. _spec.SetField(group.FieldAudioTtsPricePerMillionChars, field.TypeFloat64, value)
  1521. _node.AudioTtsPricePerMillionChars = &value
  1522. }
  1523. if value, ok := _c.mutation.AudioSttPricePerHour(); ok {
  1524. _spec.SetField(group.FieldAudioSttPricePerHour, field.TypeFloat64, value)
  1525. _node.AudioSttPricePerHour = &value
  1526. }
  1527. if value, ok := _c.mutation.LongContextPricingEnabled(); ok {
  1528. _spec.SetField(group.FieldLongContextPricingEnabled, field.TypeBool, value)
  1529. _node.LongContextPricingEnabled = value
  1530. }
  1531. if value, ok := _c.mutation.ModelPricing(); ok {
  1532. _spec.SetField(group.FieldModelPricing, field.TypeJSON, value)
  1533. _node.ModelPricing = value
  1534. }
  1535. if value, ok := _c.mutation.ClaudeCodeOnly(); ok {
  1536. _spec.SetField(group.FieldClaudeCodeOnly, field.TypeBool, value)
  1537. _node.ClaudeCodeOnly = value
  1538. }
  1539. if value, ok := _c.mutation.FallbackGroupID(); ok {
  1540. _spec.SetField(group.FieldFallbackGroupID, field.TypeInt64, value)
  1541. _node.FallbackGroupID = &value
  1542. }
  1543. if value, ok := _c.mutation.FallbackGroupIDOnInvalidRequest(); ok {
  1544. _spec.SetField(group.FieldFallbackGroupIDOnInvalidRequest, field.TypeInt64, value)
  1545. _node.FallbackGroupIDOnInvalidRequest = &value
  1546. }
  1547. if value, ok := _c.mutation.ModelRouting(); ok {
  1548. _spec.SetField(group.FieldModelRouting, field.TypeJSON, value)
  1549. _node.ModelRouting = value
  1550. }
  1551. if value, ok := _c.mutation.ModelRoutingEnabled(); ok {
  1552. _spec.SetField(group.FieldModelRoutingEnabled, field.TypeBool, value)
  1553. _node.ModelRoutingEnabled = value
  1554. }
  1555. if value, ok := _c.mutation.McpXMLInject(); ok {
  1556. _spec.SetField(group.FieldMcpXMLInject, field.TypeBool, value)
  1557. _node.McpXMLInject = value
  1558. }
  1559. if value, ok := _c.mutation.SupportedModelScopes(); ok {
  1560. _spec.SetField(group.FieldSupportedModelScopes, field.TypeJSON, value)
  1561. _node.SupportedModelScopes = value
  1562. }
  1563. if value, ok := _c.mutation.SortOrder(); ok {
  1564. _spec.SetField(group.FieldSortOrder, field.TypeInt, value)
  1565. _node.SortOrder = value
  1566. }
  1567. if value, ok := _c.mutation.AllowMessagesDispatch(); ok {
  1568. _spec.SetField(group.FieldAllowMessagesDispatch, field.TypeBool, value)
  1569. _node.AllowMessagesDispatch = value
  1570. }
  1571. if value, ok := _c.mutation.AllowLive(); ok {
  1572. _spec.SetField(group.FieldAllowLive, field.TypeBool, value)
  1573. _node.AllowLive = value
  1574. }
  1575. if value, ok := _c.mutation.ForceOpenaiFast(); ok {
  1576. _spec.SetField(group.FieldForceOpenaiFast, field.TypeBool, value)
  1577. _node.ForceOpenaiFast = value
  1578. }
  1579. if value, ok := _c.mutation.FreeOpenaiFast(); ok {
  1580. _spec.SetField(group.FieldFreeOpenaiFast, field.TypeBool, value)
  1581. _node.FreeOpenaiFast = value
  1582. }
  1583. if value, ok := _c.mutation.RequireOauthOnly(); ok {
  1584. _spec.SetField(group.FieldRequireOauthOnly, field.TypeBool, value)
  1585. _node.RequireOauthOnly = value
  1586. }
  1587. if value, ok := _c.mutation.RequirePrivacySet(); ok {
  1588. _spec.SetField(group.FieldRequirePrivacySet, field.TypeBool, value)
  1589. _node.RequirePrivacySet = value
  1590. }
  1591. if value, ok := _c.mutation.DefaultMappedModel(); ok {
  1592. _spec.SetField(group.FieldDefaultMappedModel, field.TypeString, value)
  1593. _node.DefaultMappedModel = value
  1594. }
  1595. if value, ok := _c.mutation.MessagesDispatchModelConfig(); ok {
  1596. _spec.SetField(group.FieldMessagesDispatchModelConfig, field.TypeJSON, value)
  1597. _node.MessagesDispatchModelConfig = value
  1598. }
  1599. if value, ok := _c.mutation.ModelAllowlist(); ok {
  1600. _spec.SetField(group.FieldModelAllowlist, field.TypeJSON, value)
  1601. _node.ModelAllowlist = value
  1602. }
  1603. if value, ok := _c.mutation.CodexModelsManifestConfig(); ok {
  1604. _spec.SetField(group.FieldCodexModelsManifestConfig, field.TypeJSON, value)
  1605. _node.CodexModelsManifestConfig = value
  1606. }
  1607. if value, ok := _c.mutation.RpmLimit(); ok {
  1608. _spec.SetField(group.FieldRpmLimit, field.TypeInt, value)
  1609. _node.RpmLimit = value
  1610. }
  1611. if value, ok := _c.mutation.MaxReasoningEffort(); ok {
  1612. _spec.SetField(group.FieldMaxReasoningEffort, field.TypeString, value)
  1613. _node.MaxReasoningEffort = value
  1614. }
  1615. if value, ok := _c.mutation.MaxReasoningEffortOverLimit(); ok {
  1616. _spec.SetField(group.FieldMaxReasoningEffortOverLimit, field.TypeString, value)
  1617. _node.MaxReasoningEffortOverLimit = value
  1618. }
  1619. if value, ok := _c.mutation.ReasoningEffortMappings(); ok {
  1620. _spec.SetField(group.FieldReasoningEffortMappings, field.TypeJSON, value)
  1621. _node.ReasoningEffortMappings = value
  1622. }
  1623. if value, ok := _c.mutation.ProfitControlEnabled(); ok {
  1624. _spec.SetField(group.FieldProfitControlEnabled, field.TypeBool, value)
  1625. _node.ProfitControlEnabled = value
  1626. }
  1627. if value, ok := _c.mutation.ProfitMinMargin(); ok {
  1628. _spec.SetField(group.FieldProfitMinMargin, field.TypeFloat64, value)
  1629. _node.ProfitMinMargin = value
  1630. }
  1631. if value, ok := _c.mutation.ProfitSafetyBuffer(); ok {
  1632. _spec.SetField(group.FieldProfitSafetyBuffer, field.TypeFloat64, value)
  1633. _node.ProfitSafetyBuffer = value
  1634. }
  1635. if nodes := _c.mutation.APIKeysIDs(); len(nodes) > 0 {
  1636. edge := &sqlgraph.EdgeSpec{
  1637. Rel: sqlgraph.O2M,
  1638. Inverse: false,
  1639. Table: group.APIKeysTable,
  1640. Columns: []string{group.APIKeysColumn},
  1641. Bidi: false,
  1642. Target: &sqlgraph.EdgeTarget{
  1643. IDSpec: sqlgraph.NewFieldSpec(apikey.FieldID, field.TypeInt64),
  1644. },
  1645. }
  1646. for _, k := range nodes {
  1647. edge.Target.Nodes = append(edge.Target.Nodes, k)
  1648. }
  1649. _spec.Edges = append(_spec.Edges, edge)
  1650. }
  1651. if nodes := _c.mutation.RedeemCodesIDs(); len(nodes) > 0 {
  1652. edge := &sqlgraph.EdgeSpec{
  1653. Rel: sqlgraph.O2M,
  1654. Inverse: false,
  1655. Table: group.RedeemCodesTable,
  1656. Columns: []string{group.RedeemCodesColumn},
  1657. Bidi: false,
  1658. Target: &sqlgraph.EdgeTarget{
  1659. IDSpec: sqlgraph.NewFieldSpec(redeemcode.FieldID, field.TypeInt64),
  1660. },
  1661. }
  1662. for _, k := range nodes {
  1663. edge.Target.Nodes = append(edge.Target.Nodes, k)
  1664. }
  1665. _spec.Edges = append(_spec.Edges, edge)
  1666. }
  1667. if nodes := _c.mutation.SubscriptionsIDs(); len(nodes) > 0 {
  1668. edge := &sqlgraph.EdgeSpec{
  1669. Rel: sqlgraph.O2M,
  1670. Inverse: false,
  1671. Table: group.SubscriptionsTable,
  1672. Columns: []string{group.SubscriptionsColumn},
  1673. Bidi: false,
  1674. Target: &sqlgraph.EdgeTarget{
  1675. IDSpec: sqlgraph.NewFieldSpec(usersubscription.FieldID, field.TypeInt64),
  1676. },
  1677. }
  1678. for _, k := range nodes {
  1679. edge.Target.Nodes = append(edge.Target.Nodes, k)
  1680. }
  1681. _spec.Edges = append(_spec.Edges, edge)
  1682. }
  1683. if nodes := _c.mutation.UsageLogsIDs(); len(nodes) > 0 {
  1684. edge := &sqlgraph.EdgeSpec{
  1685. Rel: sqlgraph.O2M,
  1686. Inverse: false,
  1687. Table: group.UsageLogsTable,
  1688. Columns: []string{group.UsageLogsColumn},
  1689. Bidi: false,
  1690. Target: &sqlgraph.EdgeTarget{
  1691. IDSpec: sqlgraph.NewFieldSpec(usagelog.FieldID, field.TypeInt64),
  1692. },
  1693. }
  1694. for _, k := range nodes {
  1695. edge.Target.Nodes = append(edge.Target.Nodes, k)
  1696. }
  1697. _spec.Edges = append(_spec.Edges, edge)
  1698. }
  1699. if nodes := _c.mutation.AccountsIDs(); len(nodes) > 0 {
  1700. edge := &sqlgraph.EdgeSpec{
  1701. Rel: sqlgraph.M2M,
  1702. Inverse: true,
  1703. Table: group.AccountsTable,
  1704. Columns: group.AccountsPrimaryKey,
  1705. Bidi: false,
  1706. Target: &sqlgraph.EdgeTarget{
  1707. IDSpec: sqlgraph.NewFieldSpec(account.FieldID, field.TypeInt64),
  1708. },
  1709. }
  1710. for _, k := range nodes {
  1711. edge.Target.Nodes = append(edge.Target.Nodes, k)
  1712. }
  1713. createE := &AccountGroupCreate{config: _c.config, mutation: newAccountGroupMutation(_c.config, OpCreate)}
  1714. createE.defaults()
  1715. _, specE := createE.createSpec()
  1716. edge.Target.Fields = specE.Fields
  1717. _spec.Edges = append(_spec.Edges, edge)
  1718. }
  1719. if nodes := _c.mutation.AllowedUsersIDs(); len(nodes) > 0 {
  1720. edge := &sqlgraph.EdgeSpec{
  1721. Rel: sqlgraph.M2M,
  1722. Inverse: true,
  1723. Table: group.AllowedUsersTable,
  1724. Columns: group.AllowedUsersPrimaryKey,
  1725. Bidi: false,
  1726. Target: &sqlgraph.EdgeTarget{
  1727. IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeInt64),
  1728. },
  1729. }
  1730. for _, k := range nodes {
  1731. edge.Target.Nodes = append(edge.Target.Nodes, k)
  1732. }
  1733. createE := &UserAllowedGroupCreate{config: _c.config, mutation: newUserAllowedGroupMutation(_c.config, OpCreate)}
  1734. createE.defaults()
  1735. _, specE := createE.createSpec()
  1736. edge.Target.Fields = specE.Fields
  1737. _spec.Edges = append(_spec.Edges, edge)
  1738. }
  1739. return _node, _spec
  1740. }
  1741. // OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
  1742. // of the `INSERT` statement. For example:
  1743. //
  1744. // client.Group.Create().
  1745. // SetCreatedAt(v).
  1746. // OnConflict(
  1747. // // Update the row with the new values
  1748. // // the was proposed for insertion.
  1749. // sql.ResolveWithNewValues(),
  1750. // ).
  1751. // // Override some of the fields with custom
  1752. // // update values.
  1753. // Update(func(u *ent.GroupUpsert) {
  1754. // SetCreatedAt(v+v).
  1755. // }).
  1756. // Exec(ctx)
  1757. func (_c *GroupCreate) OnConflict(opts ...sql.ConflictOption) *GroupUpsertOne {
  1758. _c.conflict = opts
  1759. return &GroupUpsertOne{
  1760. create: _c,
  1761. }
  1762. }
  1763. // OnConflictColumns calls `OnConflict` and configures the columns
  1764. // as conflict target. Using this option is equivalent to using:
  1765. //
  1766. // client.Group.Create().
  1767. // OnConflict(sql.ConflictColumns(columns...)).
  1768. // Exec(ctx)
  1769. func (_c *GroupCreate) OnConflictColumns(columns ...string) *GroupUpsertOne {
  1770. _c.conflict = append(_c.conflict, sql.ConflictColumns(columns...))
  1771. return &GroupUpsertOne{
  1772. create: _c,
  1773. }
  1774. }
  1775. type (
  1776. // GroupUpsertOne is the builder for "upsert"-ing
  1777. // one Group node.
  1778. GroupUpsertOne struct {
  1779. create *GroupCreate
  1780. }
  1781. // GroupUpsert is the "OnConflict" setter.
  1782. GroupUpsert struct {
  1783. *sql.UpdateSet
  1784. }
  1785. )
  1786. // SetUpdatedAt sets the "updated_at" field.
  1787. func (u *GroupUpsert) SetUpdatedAt(v time.Time) *GroupUpsert {
  1788. u.Set(group.FieldUpdatedAt, v)
  1789. return u
  1790. }
  1791. // UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
  1792. func (u *GroupUpsert) UpdateUpdatedAt() *GroupUpsert {
  1793. u.SetExcluded(group.FieldUpdatedAt)
  1794. return u
  1795. }
  1796. // SetDeletedAt sets the "deleted_at" field.
  1797. func (u *GroupUpsert) SetDeletedAt(v time.Time) *GroupUpsert {
  1798. u.Set(group.FieldDeletedAt, v)
  1799. return u
  1800. }
  1801. // UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
  1802. func (u *GroupUpsert) UpdateDeletedAt() *GroupUpsert {
  1803. u.SetExcluded(group.FieldDeletedAt)
  1804. return u
  1805. }
  1806. // ClearDeletedAt clears the value of the "deleted_at" field.
  1807. func (u *GroupUpsert) ClearDeletedAt() *GroupUpsert {
  1808. u.SetNull(group.FieldDeletedAt)
  1809. return u
  1810. }
  1811. // SetName sets the "name" field.
  1812. func (u *GroupUpsert) SetName(v string) *GroupUpsert {
  1813. u.Set(group.FieldName, v)
  1814. return u
  1815. }
  1816. // UpdateName sets the "name" field to the value that was provided on create.
  1817. func (u *GroupUpsert) UpdateName() *GroupUpsert {
  1818. u.SetExcluded(group.FieldName)
  1819. return u
  1820. }
  1821. // SetDescription sets the "description" field.
  1822. func (u *GroupUpsert) SetDescription(v string) *GroupUpsert {
  1823. u.Set(group.FieldDescription, v)
  1824. return u
  1825. }
  1826. // UpdateDescription sets the "description" field to the value that was provided on create.
  1827. func (u *GroupUpsert) UpdateDescription() *GroupUpsert {
  1828. u.SetExcluded(group.FieldDescription)
  1829. return u
  1830. }
  1831. // ClearDescription clears the value of the "description" field.
  1832. func (u *GroupUpsert) ClearDescription() *GroupUpsert {
  1833. u.SetNull(group.FieldDescription)
  1834. return u
  1835. }
  1836. // SetRateMultiplier sets the "rate_multiplier" field.
  1837. func (u *GroupUpsert) SetRateMultiplier(v float64) *GroupUpsert {
  1838. u.Set(group.FieldRateMultiplier, v)
  1839. return u
  1840. }
  1841. // UpdateRateMultiplier sets the "rate_multiplier" field to the value that was provided on create.
  1842. func (u *GroupUpsert) UpdateRateMultiplier() *GroupUpsert {
  1843. u.SetExcluded(group.FieldRateMultiplier)
  1844. return u
  1845. }
  1846. // AddRateMultiplier adds v to the "rate_multiplier" field.
  1847. func (u *GroupUpsert) AddRateMultiplier(v float64) *GroupUpsert {
  1848. u.Add(group.FieldRateMultiplier, v)
  1849. return u
  1850. }
  1851. // SetPeakRateEnabled sets the "peak_rate_enabled" field.
  1852. func (u *GroupUpsert) SetPeakRateEnabled(v bool) *GroupUpsert {
  1853. u.Set(group.FieldPeakRateEnabled, v)
  1854. return u
  1855. }
  1856. // UpdatePeakRateEnabled sets the "peak_rate_enabled" field to the value that was provided on create.
  1857. func (u *GroupUpsert) UpdatePeakRateEnabled() *GroupUpsert {
  1858. u.SetExcluded(group.FieldPeakRateEnabled)
  1859. return u
  1860. }
  1861. // SetPeakStart sets the "peak_start" field.
  1862. func (u *GroupUpsert) SetPeakStart(v string) *GroupUpsert {
  1863. u.Set(group.FieldPeakStart, v)
  1864. return u
  1865. }
  1866. // UpdatePeakStart sets the "peak_start" field to the value that was provided on create.
  1867. func (u *GroupUpsert) UpdatePeakStart() *GroupUpsert {
  1868. u.SetExcluded(group.FieldPeakStart)
  1869. return u
  1870. }
  1871. // SetPeakEnd sets the "peak_end" field.
  1872. func (u *GroupUpsert) SetPeakEnd(v string) *GroupUpsert {
  1873. u.Set(group.FieldPeakEnd, v)
  1874. return u
  1875. }
  1876. // UpdatePeakEnd sets the "peak_end" field to the value that was provided on create.
  1877. func (u *GroupUpsert) UpdatePeakEnd() *GroupUpsert {
  1878. u.SetExcluded(group.FieldPeakEnd)
  1879. return u
  1880. }
  1881. // SetPeakRateMultiplier sets the "peak_rate_multiplier" field.
  1882. func (u *GroupUpsert) SetPeakRateMultiplier(v float64) *GroupUpsert {
  1883. u.Set(group.FieldPeakRateMultiplier, v)
  1884. return u
  1885. }
  1886. // UpdatePeakRateMultiplier sets the "peak_rate_multiplier" field to the value that was provided on create.
  1887. func (u *GroupUpsert) UpdatePeakRateMultiplier() *GroupUpsert {
  1888. u.SetExcluded(group.FieldPeakRateMultiplier)
  1889. return u
  1890. }
  1891. // AddPeakRateMultiplier adds v to the "peak_rate_multiplier" field.
  1892. func (u *GroupUpsert) AddPeakRateMultiplier(v float64) *GroupUpsert {
  1893. u.Add(group.FieldPeakRateMultiplier, v)
  1894. return u
  1895. }
  1896. // SetIsExclusive sets the "is_exclusive" field.
  1897. func (u *GroupUpsert) SetIsExclusive(v bool) *GroupUpsert {
  1898. u.Set(group.FieldIsExclusive, v)
  1899. return u
  1900. }
  1901. // UpdateIsExclusive sets the "is_exclusive" field to the value that was provided on create.
  1902. func (u *GroupUpsert) UpdateIsExclusive() *GroupUpsert {
  1903. u.SetExcluded(group.FieldIsExclusive)
  1904. return u
  1905. }
  1906. // SetSecurityPolicyEnabled sets the "security_policy_enabled" field.
  1907. func (u *GroupUpsert) SetSecurityPolicyEnabled(v bool) *GroupUpsert {
  1908. u.Set(group.FieldSecurityPolicyEnabled, v)
  1909. return u
  1910. }
  1911. // UpdateSecurityPolicyEnabled sets the "security_policy_enabled" field to the value that was provided on create.
  1912. func (u *GroupUpsert) UpdateSecurityPolicyEnabled() *GroupUpsert {
  1913. u.SetExcluded(group.FieldSecurityPolicyEnabled)
  1914. return u
  1915. }
  1916. // SetSecurityPolicyMode sets the "security_policy_mode" field.
  1917. func (u *GroupUpsert) SetSecurityPolicyMode(v string) *GroupUpsert {
  1918. u.Set(group.FieldSecurityPolicyMode, v)
  1919. return u
  1920. }
  1921. // UpdateSecurityPolicyMode sets the "security_policy_mode" field to the value that was provided on create.
  1922. func (u *GroupUpsert) UpdateSecurityPolicyMode() *GroupUpsert {
  1923. u.SetExcluded(group.FieldSecurityPolicyMode)
  1924. return u
  1925. }
  1926. // SetSecurityPolicyEmailEnabled sets the "security_policy_email_enabled" field.
  1927. func (u *GroupUpsert) SetSecurityPolicyEmailEnabled(v bool) *GroupUpsert {
  1928. u.Set(group.FieldSecurityPolicyEmailEnabled, v)
  1929. return u
  1930. }
  1931. // UpdateSecurityPolicyEmailEnabled sets the "security_policy_email_enabled" field to the value that was provided on create.
  1932. func (u *GroupUpsert) UpdateSecurityPolicyEmailEnabled() *GroupUpsert {
  1933. u.SetExcluded(group.FieldSecurityPolicyEmailEnabled)
  1934. return u
  1935. }
  1936. // SetStatus sets the "status" field.
  1937. func (u *GroupUpsert) SetStatus(v string) *GroupUpsert {
  1938. u.Set(group.FieldStatus, v)
  1939. return u
  1940. }
  1941. // UpdateStatus sets the "status" field to the value that was provided on create.
  1942. func (u *GroupUpsert) UpdateStatus() *GroupUpsert {
  1943. u.SetExcluded(group.FieldStatus)
  1944. return u
  1945. }
  1946. // SetPlatform sets the "platform" field.
  1947. func (u *GroupUpsert) SetPlatform(v string) *GroupUpsert {
  1948. u.Set(group.FieldPlatform, v)
  1949. return u
  1950. }
  1951. // UpdatePlatform sets the "platform" field to the value that was provided on create.
  1952. func (u *GroupUpsert) UpdatePlatform() *GroupUpsert {
  1953. u.SetExcluded(group.FieldPlatform)
  1954. return u
  1955. }
  1956. // SetSubscriptionType sets the "subscription_type" field.
  1957. func (u *GroupUpsert) SetSubscriptionType(v string) *GroupUpsert {
  1958. u.Set(group.FieldSubscriptionType, v)
  1959. return u
  1960. }
  1961. // UpdateSubscriptionType sets the "subscription_type" field to the value that was provided on create.
  1962. func (u *GroupUpsert) UpdateSubscriptionType() *GroupUpsert {
  1963. u.SetExcluded(group.FieldSubscriptionType)
  1964. return u
  1965. }
  1966. // SetDailyLimitUsd sets the "daily_limit_usd" field.
  1967. func (u *GroupUpsert) SetDailyLimitUsd(v float64) *GroupUpsert {
  1968. u.Set(group.FieldDailyLimitUsd, v)
  1969. return u
  1970. }
  1971. // UpdateDailyLimitUsd sets the "daily_limit_usd" field to the value that was provided on create.
  1972. func (u *GroupUpsert) UpdateDailyLimitUsd() *GroupUpsert {
  1973. u.SetExcluded(group.FieldDailyLimitUsd)
  1974. return u
  1975. }
  1976. // AddDailyLimitUsd adds v to the "daily_limit_usd" field.
  1977. func (u *GroupUpsert) AddDailyLimitUsd(v float64) *GroupUpsert {
  1978. u.Add(group.FieldDailyLimitUsd, v)
  1979. return u
  1980. }
  1981. // ClearDailyLimitUsd clears the value of the "daily_limit_usd" field.
  1982. func (u *GroupUpsert) ClearDailyLimitUsd() *GroupUpsert {
  1983. u.SetNull(group.FieldDailyLimitUsd)
  1984. return u
  1985. }
  1986. // SetWeeklyLimitUsd sets the "weekly_limit_usd" field.
  1987. func (u *GroupUpsert) SetWeeklyLimitUsd(v float64) *GroupUpsert {
  1988. u.Set(group.FieldWeeklyLimitUsd, v)
  1989. return u
  1990. }
  1991. // UpdateWeeklyLimitUsd sets the "weekly_limit_usd" field to the value that was provided on create.
  1992. func (u *GroupUpsert) UpdateWeeklyLimitUsd() *GroupUpsert {
  1993. u.SetExcluded(group.FieldWeeklyLimitUsd)
  1994. return u
  1995. }
  1996. // AddWeeklyLimitUsd adds v to the "weekly_limit_usd" field.
  1997. func (u *GroupUpsert) AddWeeklyLimitUsd(v float64) *GroupUpsert {
  1998. u.Add(group.FieldWeeklyLimitUsd, v)
  1999. return u
  2000. }
  2001. // ClearWeeklyLimitUsd clears the value of the "weekly_limit_usd" field.
  2002. func (u *GroupUpsert) ClearWeeklyLimitUsd() *GroupUpsert {
  2003. u.SetNull(group.FieldWeeklyLimitUsd)
  2004. return u
  2005. }
  2006. // SetMonthlyLimitUsd sets the "monthly_limit_usd" field.
  2007. func (u *GroupUpsert) SetMonthlyLimitUsd(v float64) *GroupUpsert {
  2008. u.Set(group.FieldMonthlyLimitUsd, v)
  2009. return u
  2010. }
  2011. // UpdateMonthlyLimitUsd sets the "monthly_limit_usd" field to the value that was provided on create.
  2012. func (u *GroupUpsert) UpdateMonthlyLimitUsd() *GroupUpsert {
  2013. u.SetExcluded(group.FieldMonthlyLimitUsd)
  2014. return u
  2015. }
  2016. // AddMonthlyLimitUsd adds v to the "monthly_limit_usd" field.
  2017. func (u *GroupUpsert) AddMonthlyLimitUsd(v float64) *GroupUpsert {
  2018. u.Add(group.FieldMonthlyLimitUsd, v)
  2019. return u
  2020. }
  2021. // ClearMonthlyLimitUsd clears the value of the "monthly_limit_usd" field.
  2022. func (u *GroupUpsert) ClearMonthlyLimitUsd() *GroupUpsert {
  2023. u.SetNull(group.FieldMonthlyLimitUsd)
  2024. return u
  2025. }
  2026. // SetDefaultValidityDays sets the "default_validity_days" field.
  2027. func (u *GroupUpsert) SetDefaultValidityDays(v int) *GroupUpsert {
  2028. u.Set(group.FieldDefaultValidityDays, v)
  2029. return u
  2030. }
  2031. // UpdateDefaultValidityDays sets the "default_validity_days" field to the value that was provided on create.
  2032. func (u *GroupUpsert) UpdateDefaultValidityDays() *GroupUpsert {
  2033. u.SetExcluded(group.FieldDefaultValidityDays)
  2034. return u
  2035. }
  2036. // AddDefaultValidityDays adds v to the "default_validity_days" field.
  2037. func (u *GroupUpsert) AddDefaultValidityDays(v int) *GroupUpsert {
  2038. u.Add(group.FieldDefaultValidityDays, v)
  2039. return u
  2040. }
  2041. // SetAllowImageGeneration sets the "allow_image_generation" field.
  2042. func (u *GroupUpsert) SetAllowImageGeneration(v bool) *GroupUpsert {
  2043. u.Set(group.FieldAllowImageGeneration, v)
  2044. return u
  2045. }
  2046. // UpdateAllowImageGeneration sets the "allow_image_generation" field to the value that was provided on create.
  2047. func (u *GroupUpsert) UpdateAllowImageGeneration() *GroupUpsert {
  2048. u.SetExcluded(group.FieldAllowImageGeneration)
  2049. return u
  2050. }
  2051. // SetAllowBatchImageGeneration sets the "allow_batch_image_generation" field.
  2052. func (u *GroupUpsert) SetAllowBatchImageGeneration(v bool) *GroupUpsert {
  2053. u.Set(group.FieldAllowBatchImageGeneration, v)
  2054. return u
  2055. }
  2056. // UpdateAllowBatchImageGeneration sets the "allow_batch_image_generation" field to the value that was provided on create.
  2057. func (u *GroupUpsert) UpdateAllowBatchImageGeneration() *GroupUpsert {
  2058. u.SetExcluded(group.FieldAllowBatchImageGeneration)
  2059. return u
  2060. }
  2061. // SetImageRateIndependent sets the "image_rate_independent" field.
  2062. func (u *GroupUpsert) SetImageRateIndependent(v bool) *GroupUpsert {
  2063. u.Set(group.FieldImageRateIndependent, v)
  2064. return u
  2065. }
  2066. // UpdateImageRateIndependent sets the "image_rate_independent" field to the value that was provided on create.
  2067. func (u *GroupUpsert) UpdateImageRateIndependent() *GroupUpsert {
  2068. u.SetExcluded(group.FieldImageRateIndependent)
  2069. return u
  2070. }
  2071. // SetImageRateMultiplier sets the "image_rate_multiplier" field.
  2072. func (u *GroupUpsert) SetImageRateMultiplier(v float64) *GroupUpsert {
  2073. u.Set(group.FieldImageRateMultiplier, v)
  2074. return u
  2075. }
  2076. // UpdateImageRateMultiplier sets the "image_rate_multiplier" field to the value that was provided on create.
  2077. func (u *GroupUpsert) UpdateImageRateMultiplier() *GroupUpsert {
  2078. u.SetExcluded(group.FieldImageRateMultiplier)
  2079. return u
  2080. }
  2081. // AddImageRateMultiplier adds v to the "image_rate_multiplier" field.
  2082. func (u *GroupUpsert) AddImageRateMultiplier(v float64) *GroupUpsert {
  2083. u.Add(group.FieldImageRateMultiplier, v)
  2084. return u
  2085. }
  2086. // SetImagePrice1k sets the "image_price_1k" field.
  2087. func (u *GroupUpsert) SetImagePrice1k(v float64) *GroupUpsert {
  2088. u.Set(group.FieldImagePrice1k, v)
  2089. return u
  2090. }
  2091. // UpdateImagePrice1k sets the "image_price_1k" field to the value that was provided on create.
  2092. func (u *GroupUpsert) UpdateImagePrice1k() *GroupUpsert {
  2093. u.SetExcluded(group.FieldImagePrice1k)
  2094. return u
  2095. }
  2096. // AddImagePrice1k adds v to the "image_price_1k" field.
  2097. func (u *GroupUpsert) AddImagePrice1k(v float64) *GroupUpsert {
  2098. u.Add(group.FieldImagePrice1k, v)
  2099. return u
  2100. }
  2101. // ClearImagePrice1k clears the value of the "image_price_1k" field.
  2102. func (u *GroupUpsert) ClearImagePrice1k() *GroupUpsert {
  2103. u.SetNull(group.FieldImagePrice1k)
  2104. return u
  2105. }
  2106. // SetImagePrice2k sets the "image_price_2k" field.
  2107. func (u *GroupUpsert) SetImagePrice2k(v float64) *GroupUpsert {
  2108. u.Set(group.FieldImagePrice2k, v)
  2109. return u
  2110. }
  2111. // UpdateImagePrice2k sets the "image_price_2k" field to the value that was provided on create.
  2112. func (u *GroupUpsert) UpdateImagePrice2k() *GroupUpsert {
  2113. u.SetExcluded(group.FieldImagePrice2k)
  2114. return u
  2115. }
  2116. // AddImagePrice2k adds v to the "image_price_2k" field.
  2117. func (u *GroupUpsert) AddImagePrice2k(v float64) *GroupUpsert {
  2118. u.Add(group.FieldImagePrice2k, v)
  2119. return u
  2120. }
  2121. // ClearImagePrice2k clears the value of the "image_price_2k" field.
  2122. func (u *GroupUpsert) ClearImagePrice2k() *GroupUpsert {
  2123. u.SetNull(group.FieldImagePrice2k)
  2124. return u
  2125. }
  2126. // SetImagePrice4k sets the "image_price_4k" field.
  2127. func (u *GroupUpsert) SetImagePrice4k(v float64) *GroupUpsert {
  2128. u.Set(group.FieldImagePrice4k, v)
  2129. return u
  2130. }
  2131. // UpdateImagePrice4k sets the "image_price_4k" field to the value that was provided on create.
  2132. func (u *GroupUpsert) UpdateImagePrice4k() *GroupUpsert {
  2133. u.SetExcluded(group.FieldImagePrice4k)
  2134. return u
  2135. }
  2136. // AddImagePrice4k adds v to the "image_price_4k" field.
  2137. func (u *GroupUpsert) AddImagePrice4k(v float64) *GroupUpsert {
  2138. u.Add(group.FieldImagePrice4k, v)
  2139. return u
  2140. }
  2141. // ClearImagePrice4k clears the value of the "image_price_4k" field.
  2142. func (u *GroupUpsert) ClearImagePrice4k() *GroupUpsert {
  2143. u.SetNull(group.FieldImagePrice4k)
  2144. return u
  2145. }
  2146. // SetBatchImageDiscountMultiplier sets the "batch_image_discount_multiplier" field.
  2147. func (u *GroupUpsert) SetBatchImageDiscountMultiplier(v float64) *GroupUpsert {
  2148. u.Set(group.FieldBatchImageDiscountMultiplier, v)
  2149. return u
  2150. }
  2151. // UpdateBatchImageDiscountMultiplier sets the "batch_image_discount_multiplier" field to the value that was provided on create.
  2152. func (u *GroupUpsert) UpdateBatchImageDiscountMultiplier() *GroupUpsert {
  2153. u.SetExcluded(group.FieldBatchImageDiscountMultiplier)
  2154. return u
  2155. }
  2156. // AddBatchImageDiscountMultiplier adds v to the "batch_image_discount_multiplier" field.
  2157. func (u *GroupUpsert) AddBatchImageDiscountMultiplier(v float64) *GroupUpsert {
  2158. u.Add(group.FieldBatchImageDiscountMultiplier, v)
  2159. return u
  2160. }
  2161. // SetBatchImageHoldMultiplier sets the "batch_image_hold_multiplier" field.
  2162. func (u *GroupUpsert) SetBatchImageHoldMultiplier(v float64) *GroupUpsert {
  2163. u.Set(group.FieldBatchImageHoldMultiplier, v)
  2164. return u
  2165. }
  2166. // UpdateBatchImageHoldMultiplier sets the "batch_image_hold_multiplier" field to the value that was provided on create.
  2167. func (u *GroupUpsert) UpdateBatchImageHoldMultiplier() *GroupUpsert {
  2168. u.SetExcluded(group.FieldBatchImageHoldMultiplier)
  2169. return u
  2170. }
  2171. // AddBatchImageHoldMultiplier adds v to the "batch_image_hold_multiplier" field.
  2172. func (u *GroupUpsert) AddBatchImageHoldMultiplier(v float64) *GroupUpsert {
  2173. u.Add(group.FieldBatchImageHoldMultiplier, v)
  2174. return u
  2175. }
  2176. // SetVideoRateIndependent sets the "video_rate_independent" field.
  2177. func (u *GroupUpsert) SetVideoRateIndependent(v bool) *GroupUpsert {
  2178. u.Set(group.FieldVideoRateIndependent, v)
  2179. return u
  2180. }
  2181. // UpdateVideoRateIndependent sets the "video_rate_independent" field to the value that was provided on create.
  2182. func (u *GroupUpsert) UpdateVideoRateIndependent() *GroupUpsert {
  2183. u.SetExcluded(group.FieldVideoRateIndependent)
  2184. return u
  2185. }
  2186. // SetVideoRateMultiplier sets the "video_rate_multiplier" field.
  2187. func (u *GroupUpsert) SetVideoRateMultiplier(v float64) *GroupUpsert {
  2188. u.Set(group.FieldVideoRateMultiplier, v)
  2189. return u
  2190. }
  2191. // UpdateVideoRateMultiplier sets the "video_rate_multiplier" field to the value that was provided on create.
  2192. func (u *GroupUpsert) UpdateVideoRateMultiplier() *GroupUpsert {
  2193. u.SetExcluded(group.FieldVideoRateMultiplier)
  2194. return u
  2195. }
  2196. // AddVideoRateMultiplier adds v to the "video_rate_multiplier" field.
  2197. func (u *GroupUpsert) AddVideoRateMultiplier(v float64) *GroupUpsert {
  2198. u.Add(group.FieldVideoRateMultiplier, v)
  2199. return u
  2200. }
  2201. // SetVideoPrice480p sets the "video_price_480p" field.
  2202. func (u *GroupUpsert) SetVideoPrice480p(v float64) *GroupUpsert {
  2203. u.Set(group.FieldVideoPrice480p, v)
  2204. return u
  2205. }
  2206. // UpdateVideoPrice480p sets the "video_price_480p" field to the value that was provided on create.
  2207. func (u *GroupUpsert) UpdateVideoPrice480p() *GroupUpsert {
  2208. u.SetExcluded(group.FieldVideoPrice480p)
  2209. return u
  2210. }
  2211. // AddVideoPrice480p adds v to the "video_price_480p" field.
  2212. func (u *GroupUpsert) AddVideoPrice480p(v float64) *GroupUpsert {
  2213. u.Add(group.FieldVideoPrice480p, v)
  2214. return u
  2215. }
  2216. // ClearVideoPrice480p clears the value of the "video_price_480p" field.
  2217. func (u *GroupUpsert) ClearVideoPrice480p() *GroupUpsert {
  2218. u.SetNull(group.FieldVideoPrice480p)
  2219. return u
  2220. }
  2221. // SetVideoPrice720p sets the "video_price_720p" field.
  2222. func (u *GroupUpsert) SetVideoPrice720p(v float64) *GroupUpsert {
  2223. u.Set(group.FieldVideoPrice720p, v)
  2224. return u
  2225. }
  2226. // UpdateVideoPrice720p sets the "video_price_720p" field to the value that was provided on create.
  2227. func (u *GroupUpsert) UpdateVideoPrice720p() *GroupUpsert {
  2228. u.SetExcluded(group.FieldVideoPrice720p)
  2229. return u
  2230. }
  2231. // AddVideoPrice720p adds v to the "video_price_720p" field.
  2232. func (u *GroupUpsert) AddVideoPrice720p(v float64) *GroupUpsert {
  2233. u.Add(group.FieldVideoPrice720p, v)
  2234. return u
  2235. }
  2236. // ClearVideoPrice720p clears the value of the "video_price_720p" field.
  2237. func (u *GroupUpsert) ClearVideoPrice720p() *GroupUpsert {
  2238. u.SetNull(group.FieldVideoPrice720p)
  2239. return u
  2240. }
  2241. // SetVideoPrice1080p sets the "video_price_1080p" field.
  2242. func (u *GroupUpsert) SetVideoPrice1080p(v float64) *GroupUpsert {
  2243. u.Set(group.FieldVideoPrice1080p, v)
  2244. return u
  2245. }
  2246. // UpdateVideoPrice1080p sets the "video_price_1080p" field to the value that was provided on create.
  2247. func (u *GroupUpsert) UpdateVideoPrice1080p() *GroupUpsert {
  2248. u.SetExcluded(group.FieldVideoPrice1080p)
  2249. return u
  2250. }
  2251. // AddVideoPrice1080p adds v to the "video_price_1080p" field.
  2252. func (u *GroupUpsert) AddVideoPrice1080p(v float64) *GroupUpsert {
  2253. u.Add(group.FieldVideoPrice1080p, v)
  2254. return u
  2255. }
  2256. // ClearVideoPrice1080p clears the value of the "video_price_1080p" field.
  2257. func (u *GroupUpsert) ClearVideoPrice1080p() *GroupUpsert {
  2258. u.SetNull(group.FieldVideoPrice1080p)
  2259. return u
  2260. }
  2261. // SetVideoModelPrices sets the "video_model_prices" field.
  2262. func (u *GroupUpsert) SetVideoModelPrices(v map[string]map[string]float64) *GroupUpsert {
  2263. u.Set(group.FieldVideoModelPrices, v)
  2264. return u
  2265. }
  2266. // UpdateVideoModelPrices sets the "video_model_prices" field to the value that was provided on create.
  2267. func (u *GroupUpsert) UpdateVideoModelPrices() *GroupUpsert {
  2268. u.SetExcluded(group.FieldVideoModelPrices)
  2269. return u
  2270. }
  2271. // ClearVideoModelPrices clears the value of the "video_model_prices" field.
  2272. func (u *GroupUpsert) ClearVideoModelPrices() *GroupUpsert {
  2273. u.SetNull(group.FieldVideoModelPrices)
  2274. return u
  2275. }
  2276. // SetWebSearchPricePerCall sets the "web_search_price_per_call" field.
  2277. func (u *GroupUpsert) SetWebSearchPricePerCall(v float64) *GroupUpsert {
  2278. u.Set(group.FieldWebSearchPricePerCall, v)
  2279. return u
  2280. }
  2281. // UpdateWebSearchPricePerCall sets the "web_search_price_per_call" field to the value that was provided on create.
  2282. func (u *GroupUpsert) UpdateWebSearchPricePerCall() *GroupUpsert {
  2283. u.SetExcluded(group.FieldWebSearchPricePerCall)
  2284. return u
  2285. }
  2286. // AddWebSearchPricePerCall adds v to the "web_search_price_per_call" field.
  2287. func (u *GroupUpsert) AddWebSearchPricePerCall(v float64) *GroupUpsert {
  2288. u.Add(group.FieldWebSearchPricePerCall, v)
  2289. return u
  2290. }
  2291. // ClearWebSearchPricePerCall clears the value of the "web_search_price_per_call" field.
  2292. func (u *GroupUpsert) ClearWebSearchPricePerCall() *GroupUpsert {
  2293. u.SetNull(group.FieldWebSearchPricePerCall)
  2294. return u
  2295. }
  2296. // SetSearchPricePer1k sets the "search_price_per_1k" field.
  2297. func (u *GroupUpsert) SetSearchPricePer1k(v float64) *GroupUpsert {
  2298. u.Set(group.FieldSearchPricePer1k, v)
  2299. return u
  2300. }
  2301. // UpdateSearchPricePer1k sets the "search_price_per_1k" field to the value that was provided on create.
  2302. func (u *GroupUpsert) UpdateSearchPricePer1k() *GroupUpsert {
  2303. u.SetExcluded(group.FieldSearchPricePer1k)
  2304. return u
  2305. }
  2306. // AddSearchPricePer1k adds v to the "search_price_per_1k" field.
  2307. func (u *GroupUpsert) AddSearchPricePer1k(v float64) *GroupUpsert {
  2308. u.Add(group.FieldSearchPricePer1k, v)
  2309. return u
  2310. }
  2311. // ClearSearchPricePer1k clears the value of the "search_price_per_1k" field.
  2312. func (u *GroupUpsert) ClearSearchPricePer1k() *GroupUpsert {
  2313. u.SetNull(group.FieldSearchPricePer1k)
  2314. return u
  2315. }
  2316. // SetAudioRealtimePricePerMin sets the "audio_realtime_price_per_min" field.
  2317. func (u *GroupUpsert) SetAudioRealtimePricePerMin(v float64) *GroupUpsert {
  2318. u.Set(group.FieldAudioRealtimePricePerMin, v)
  2319. return u
  2320. }
  2321. // UpdateAudioRealtimePricePerMin sets the "audio_realtime_price_per_min" field to the value that was provided on create.
  2322. func (u *GroupUpsert) UpdateAudioRealtimePricePerMin() *GroupUpsert {
  2323. u.SetExcluded(group.FieldAudioRealtimePricePerMin)
  2324. return u
  2325. }
  2326. // AddAudioRealtimePricePerMin adds v to the "audio_realtime_price_per_min" field.
  2327. func (u *GroupUpsert) AddAudioRealtimePricePerMin(v float64) *GroupUpsert {
  2328. u.Add(group.FieldAudioRealtimePricePerMin, v)
  2329. return u
  2330. }
  2331. // ClearAudioRealtimePricePerMin clears the value of the "audio_realtime_price_per_min" field.
  2332. func (u *GroupUpsert) ClearAudioRealtimePricePerMin() *GroupUpsert {
  2333. u.SetNull(group.FieldAudioRealtimePricePerMin)
  2334. return u
  2335. }
  2336. // SetAudioTtsPricePerMillionChars sets the "audio_tts_price_per_million_chars" field.
  2337. func (u *GroupUpsert) SetAudioTtsPricePerMillionChars(v float64) *GroupUpsert {
  2338. u.Set(group.FieldAudioTtsPricePerMillionChars, v)
  2339. return u
  2340. }
  2341. // UpdateAudioTtsPricePerMillionChars sets the "audio_tts_price_per_million_chars" field to the value that was provided on create.
  2342. func (u *GroupUpsert) UpdateAudioTtsPricePerMillionChars() *GroupUpsert {
  2343. u.SetExcluded(group.FieldAudioTtsPricePerMillionChars)
  2344. return u
  2345. }
  2346. // AddAudioTtsPricePerMillionChars adds v to the "audio_tts_price_per_million_chars" field.
  2347. func (u *GroupUpsert) AddAudioTtsPricePerMillionChars(v float64) *GroupUpsert {
  2348. u.Add(group.FieldAudioTtsPricePerMillionChars, v)
  2349. return u
  2350. }
  2351. // ClearAudioTtsPricePerMillionChars clears the value of the "audio_tts_price_per_million_chars" field.
  2352. func (u *GroupUpsert) ClearAudioTtsPricePerMillionChars() *GroupUpsert {
  2353. u.SetNull(group.FieldAudioTtsPricePerMillionChars)
  2354. return u
  2355. }
  2356. // SetAudioSttPricePerHour sets the "audio_stt_price_per_hour" field.
  2357. func (u *GroupUpsert) SetAudioSttPricePerHour(v float64) *GroupUpsert {
  2358. u.Set(group.FieldAudioSttPricePerHour, v)
  2359. return u
  2360. }
  2361. // UpdateAudioSttPricePerHour sets the "audio_stt_price_per_hour" field to the value that was provided on create.
  2362. func (u *GroupUpsert) UpdateAudioSttPricePerHour() *GroupUpsert {
  2363. u.SetExcluded(group.FieldAudioSttPricePerHour)
  2364. return u
  2365. }
  2366. // AddAudioSttPricePerHour adds v to the "audio_stt_price_per_hour" field.
  2367. func (u *GroupUpsert) AddAudioSttPricePerHour(v float64) *GroupUpsert {
  2368. u.Add(group.FieldAudioSttPricePerHour, v)
  2369. return u
  2370. }
  2371. // ClearAudioSttPricePerHour clears the value of the "audio_stt_price_per_hour" field.
  2372. func (u *GroupUpsert) ClearAudioSttPricePerHour() *GroupUpsert {
  2373. u.SetNull(group.FieldAudioSttPricePerHour)
  2374. return u
  2375. }
  2376. // SetLongContextPricingEnabled sets the "long_context_pricing_enabled" field.
  2377. func (u *GroupUpsert) SetLongContextPricingEnabled(v bool) *GroupUpsert {
  2378. u.Set(group.FieldLongContextPricingEnabled, v)
  2379. return u
  2380. }
  2381. // UpdateLongContextPricingEnabled sets the "long_context_pricing_enabled" field to the value that was provided on create.
  2382. func (u *GroupUpsert) UpdateLongContextPricingEnabled() *GroupUpsert {
  2383. u.SetExcluded(group.FieldLongContextPricingEnabled)
  2384. return u
  2385. }
  2386. // SetModelPricing sets the "model_pricing" field.
  2387. func (u *GroupUpsert) SetModelPricing(v jsontext.Value) *GroupUpsert {
  2388. u.Set(group.FieldModelPricing, v)
  2389. return u
  2390. }
  2391. // UpdateModelPricing sets the "model_pricing" field to the value that was provided on create.
  2392. func (u *GroupUpsert) UpdateModelPricing() *GroupUpsert {
  2393. u.SetExcluded(group.FieldModelPricing)
  2394. return u
  2395. }
  2396. // ClearModelPricing clears the value of the "model_pricing" field.
  2397. func (u *GroupUpsert) ClearModelPricing() *GroupUpsert {
  2398. u.SetNull(group.FieldModelPricing)
  2399. return u
  2400. }
  2401. // SetClaudeCodeOnly sets the "claude_code_only" field.
  2402. func (u *GroupUpsert) SetClaudeCodeOnly(v bool) *GroupUpsert {
  2403. u.Set(group.FieldClaudeCodeOnly, v)
  2404. return u
  2405. }
  2406. // UpdateClaudeCodeOnly sets the "claude_code_only" field to the value that was provided on create.
  2407. func (u *GroupUpsert) UpdateClaudeCodeOnly() *GroupUpsert {
  2408. u.SetExcluded(group.FieldClaudeCodeOnly)
  2409. return u
  2410. }
  2411. // SetFallbackGroupID sets the "fallback_group_id" field.
  2412. func (u *GroupUpsert) SetFallbackGroupID(v int64) *GroupUpsert {
  2413. u.Set(group.FieldFallbackGroupID, v)
  2414. return u
  2415. }
  2416. // UpdateFallbackGroupID sets the "fallback_group_id" field to the value that was provided on create.
  2417. func (u *GroupUpsert) UpdateFallbackGroupID() *GroupUpsert {
  2418. u.SetExcluded(group.FieldFallbackGroupID)
  2419. return u
  2420. }
  2421. // AddFallbackGroupID adds v to the "fallback_group_id" field.
  2422. func (u *GroupUpsert) AddFallbackGroupID(v int64) *GroupUpsert {
  2423. u.Add(group.FieldFallbackGroupID, v)
  2424. return u
  2425. }
  2426. // ClearFallbackGroupID clears the value of the "fallback_group_id" field.
  2427. func (u *GroupUpsert) ClearFallbackGroupID() *GroupUpsert {
  2428. u.SetNull(group.FieldFallbackGroupID)
  2429. return u
  2430. }
  2431. // SetFallbackGroupIDOnInvalidRequest sets the "fallback_group_id_on_invalid_request" field.
  2432. func (u *GroupUpsert) SetFallbackGroupIDOnInvalidRequest(v int64) *GroupUpsert {
  2433. u.Set(group.FieldFallbackGroupIDOnInvalidRequest, v)
  2434. return u
  2435. }
  2436. // UpdateFallbackGroupIDOnInvalidRequest sets the "fallback_group_id_on_invalid_request" field to the value that was provided on create.
  2437. func (u *GroupUpsert) UpdateFallbackGroupIDOnInvalidRequest() *GroupUpsert {
  2438. u.SetExcluded(group.FieldFallbackGroupIDOnInvalidRequest)
  2439. return u
  2440. }
  2441. // AddFallbackGroupIDOnInvalidRequest adds v to the "fallback_group_id_on_invalid_request" field.
  2442. func (u *GroupUpsert) AddFallbackGroupIDOnInvalidRequest(v int64) *GroupUpsert {
  2443. u.Add(group.FieldFallbackGroupIDOnInvalidRequest, v)
  2444. return u
  2445. }
  2446. // ClearFallbackGroupIDOnInvalidRequest clears the value of the "fallback_group_id_on_invalid_request" field.
  2447. func (u *GroupUpsert) ClearFallbackGroupIDOnInvalidRequest() *GroupUpsert {
  2448. u.SetNull(group.FieldFallbackGroupIDOnInvalidRequest)
  2449. return u
  2450. }
  2451. // SetModelRouting sets the "model_routing" field.
  2452. func (u *GroupUpsert) SetModelRouting(v map[string][]int64) *GroupUpsert {
  2453. u.Set(group.FieldModelRouting, v)
  2454. return u
  2455. }
  2456. // UpdateModelRouting sets the "model_routing" field to the value that was provided on create.
  2457. func (u *GroupUpsert) UpdateModelRouting() *GroupUpsert {
  2458. u.SetExcluded(group.FieldModelRouting)
  2459. return u
  2460. }
  2461. // ClearModelRouting clears the value of the "model_routing" field.
  2462. func (u *GroupUpsert) ClearModelRouting() *GroupUpsert {
  2463. u.SetNull(group.FieldModelRouting)
  2464. return u
  2465. }
  2466. // SetModelRoutingEnabled sets the "model_routing_enabled" field.
  2467. func (u *GroupUpsert) SetModelRoutingEnabled(v bool) *GroupUpsert {
  2468. u.Set(group.FieldModelRoutingEnabled, v)
  2469. return u
  2470. }
  2471. // UpdateModelRoutingEnabled sets the "model_routing_enabled" field to the value that was provided on create.
  2472. func (u *GroupUpsert) UpdateModelRoutingEnabled() *GroupUpsert {
  2473. u.SetExcluded(group.FieldModelRoutingEnabled)
  2474. return u
  2475. }
  2476. // SetMcpXMLInject sets the "mcp_xml_inject" field.
  2477. func (u *GroupUpsert) SetMcpXMLInject(v bool) *GroupUpsert {
  2478. u.Set(group.FieldMcpXMLInject, v)
  2479. return u
  2480. }
  2481. // UpdateMcpXMLInject sets the "mcp_xml_inject" field to the value that was provided on create.
  2482. func (u *GroupUpsert) UpdateMcpXMLInject() *GroupUpsert {
  2483. u.SetExcluded(group.FieldMcpXMLInject)
  2484. return u
  2485. }
  2486. // SetSupportedModelScopes sets the "supported_model_scopes" field.
  2487. func (u *GroupUpsert) SetSupportedModelScopes(v []string) *GroupUpsert {
  2488. u.Set(group.FieldSupportedModelScopes, v)
  2489. return u
  2490. }
  2491. // UpdateSupportedModelScopes sets the "supported_model_scopes" field to the value that was provided on create.
  2492. func (u *GroupUpsert) UpdateSupportedModelScopes() *GroupUpsert {
  2493. u.SetExcluded(group.FieldSupportedModelScopes)
  2494. return u
  2495. }
  2496. // SetSortOrder sets the "sort_order" field.
  2497. func (u *GroupUpsert) SetSortOrder(v int) *GroupUpsert {
  2498. u.Set(group.FieldSortOrder, v)
  2499. return u
  2500. }
  2501. // UpdateSortOrder sets the "sort_order" field to the value that was provided on create.
  2502. func (u *GroupUpsert) UpdateSortOrder() *GroupUpsert {
  2503. u.SetExcluded(group.FieldSortOrder)
  2504. return u
  2505. }
  2506. // AddSortOrder adds v to the "sort_order" field.
  2507. func (u *GroupUpsert) AddSortOrder(v int) *GroupUpsert {
  2508. u.Add(group.FieldSortOrder, v)
  2509. return u
  2510. }
  2511. // SetAllowMessagesDispatch sets the "allow_messages_dispatch" field.
  2512. func (u *GroupUpsert) SetAllowMessagesDispatch(v bool) *GroupUpsert {
  2513. u.Set(group.FieldAllowMessagesDispatch, v)
  2514. return u
  2515. }
  2516. // UpdateAllowMessagesDispatch sets the "allow_messages_dispatch" field to the value that was provided on create.
  2517. func (u *GroupUpsert) UpdateAllowMessagesDispatch() *GroupUpsert {
  2518. u.SetExcluded(group.FieldAllowMessagesDispatch)
  2519. return u
  2520. }
  2521. // SetAllowLive sets the "allow_live" field.
  2522. func (u *GroupUpsert) SetAllowLive(v bool) *GroupUpsert {
  2523. u.Set(group.FieldAllowLive, v)
  2524. return u
  2525. }
  2526. // UpdateAllowLive sets the "allow_live" field to the value that was provided on create.
  2527. func (u *GroupUpsert) UpdateAllowLive() *GroupUpsert {
  2528. u.SetExcluded(group.FieldAllowLive)
  2529. return u
  2530. }
  2531. // SetForceOpenaiFast sets the "force_openai_fast" field.
  2532. func (u *GroupUpsert) SetForceOpenaiFast(v bool) *GroupUpsert {
  2533. u.Set(group.FieldForceOpenaiFast, v)
  2534. return u
  2535. }
  2536. // UpdateForceOpenaiFast sets the "force_openai_fast" field to the value that was provided on create.
  2537. func (u *GroupUpsert) UpdateForceOpenaiFast() *GroupUpsert {
  2538. u.SetExcluded(group.FieldForceOpenaiFast)
  2539. return u
  2540. }
  2541. // SetFreeOpenaiFast sets the "free_openai_fast" field.
  2542. func (u *GroupUpsert) SetFreeOpenaiFast(v bool) *GroupUpsert {
  2543. u.Set(group.FieldFreeOpenaiFast, v)
  2544. return u
  2545. }
  2546. // UpdateFreeOpenaiFast sets the "free_openai_fast" field to the value that was provided on create.
  2547. func (u *GroupUpsert) UpdateFreeOpenaiFast() *GroupUpsert {
  2548. u.SetExcluded(group.FieldFreeOpenaiFast)
  2549. return u
  2550. }
  2551. // SetRequireOauthOnly sets the "require_oauth_only" field.
  2552. func (u *GroupUpsert) SetRequireOauthOnly(v bool) *GroupUpsert {
  2553. u.Set(group.FieldRequireOauthOnly, v)
  2554. return u
  2555. }
  2556. // UpdateRequireOauthOnly sets the "require_oauth_only" field to the value that was provided on create.
  2557. func (u *GroupUpsert) UpdateRequireOauthOnly() *GroupUpsert {
  2558. u.SetExcluded(group.FieldRequireOauthOnly)
  2559. return u
  2560. }
  2561. // SetRequirePrivacySet sets the "require_privacy_set" field.
  2562. func (u *GroupUpsert) SetRequirePrivacySet(v bool) *GroupUpsert {
  2563. u.Set(group.FieldRequirePrivacySet, v)
  2564. return u
  2565. }
  2566. // UpdateRequirePrivacySet sets the "require_privacy_set" field to the value that was provided on create.
  2567. func (u *GroupUpsert) UpdateRequirePrivacySet() *GroupUpsert {
  2568. u.SetExcluded(group.FieldRequirePrivacySet)
  2569. return u
  2570. }
  2571. // SetDefaultMappedModel sets the "default_mapped_model" field.
  2572. func (u *GroupUpsert) SetDefaultMappedModel(v string) *GroupUpsert {
  2573. u.Set(group.FieldDefaultMappedModel, v)
  2574. return u
  2575. }
  2576. // UpdateDefaultMappedModel sets the "default_mapped_model" field to the value that was provided on create.
  2577. func (u *GroupUpsert) UpdateDefaultMappedModel() *GroupUpsert {
  2578. u.SetExcluded(group.FieldDefaultMappedModel)
  2579. return u
  2580. }
  2581. // SetMessagesDispatchModelConfig sets the "messages_dispatch_model_config" field.
  2582. func (u *GroupUpsert) SetMessagesDispatchModelConfig(v domain.OpenAIMessagesDispatchModelConfig) *GroupUpsert {
  2583. u.Set(group.FieldMessagesDispatchModelConfig, v)
  2584. return u
  2585. }
  2586. // UpdateMessagesDispatchModelConfig sets the "messages_dispatch_model_config" field to the value that was provided on create.
  2587. func (u *GroupUpsert) UpdateMessagesDispatchModelConfig() *GroupUpsert {
  2588. u.SetExcluded(group.FieldMessagesDispatchModelConfig)
  2589. return u
  2590. }
  2591. // SetModelAllowlist sets the "model_allowlist" field.
  2592. func (u *GroupUpsert) SetModelAllowlist(v domain.GroupModelAllowlist) *GroupUpsert {
  2593. u.Set(group.FieldModelAllowlist, v)
  2594. return u
  2595. }
  2596. // UpdateModelAllowlist sets the "model_allowlist" field to the value that was provided on create.
  2597. func (u *GroupUpsert) UpdateModelAllowlist() *GroupUpsert {
  2598. u.SetExcluded(group.FieldModelAllowlist)
  2599. return u
  2600. }
  2601. // SetCodexModelsManifestConfig sets the "codex_models_manifest_config" field.
  2602. func (u *GroupUpsert) SetCodexModelsManifestConfig(v domain.GroupCodexModelsManifestConfig) *GroupUpsert {
  2603. u.Set(group.FieldCodexModelsManifestConfig, v)
  2604. return u
  2605. }
  2606. // UpdateCodexModelsManifestConfig sets the "codex_models_manifest_config" field to the value that was provided on create.
  2607. func (u *GroupUpsert) UpdateCodexModelsManifestConfig() *GroupUpsert {
  2608. u.SetExcluded(group.FieldCodexModelsManifestConfig)
  2609. return u
  2610. }
  2611. // SetRpmLimit sets the "rpm_limit" field.
  2612. func (u *GroupUpsert) SetRpmLimit(v int) *GroupUpsert {
  2613. u.Set(group.FieldRpmLimit, v)
  2614. return u
  2615. }
  2616. // UpdateRpmLimit sets the "rpm_limit" field to the value that was provided on create.
  2617. func (u *GroupUpsert) UpdateRpmLimit() *GroupUpsert {
  2618. u.SetExcluded(group.FieldRpmLimit)
  2619. return u
  2620. }
  2621. // AddRpmLimit adds v to the "rpm_limit" field.
  2622. func (u *GroupUpsert) AddRpmLimit(v int) *GroupUpsert {
  2623. u.Add(group.FieldRpmLimit, v)
  2624. return u
  2625. }
  2626. // SetMaxReasoningEffort sets the "max_reasoning_effort" field.
  2627. func (u *GroupUpsert) SetMaxReasoningEffort(v string) *GroupUpsert {
  2628. u.Set(group.FieldMaxReasoningEffort, v)
  2629. return u
  2630. }
  2631. // UpdateMaxReasoningEffort sets the "max_reasoning_effort" field to the value that was provided on create.
  2632. func (u *GroupUpsert) UpdateMaxReasoningEffort() *GroupUpsert {
  2633. u.SetExcluded(group.FieldMaxReasoningEffort)
  2634. return u
  2635. }
  2636. // SetMaxReasoningEffortOverLimit sets the "max_reasoning_effort_over_limit" field.
  2637. func (u *GroupUpsert) SetMaxReasoningEffortOverLimit(v string) *GroupUpsert {
  2638. u.Set(group.FieldMaxReasoningEffortOverLimit, v)
  2639. return u
  2640. }
  2641. // UpdateMaxReasoningEffortOverLimit sets the "max_reasoning_effort_over_limit" field to the value that was provided on create.
  2642. func (u *GroupUpsert) UpdateMaxReasoningEffortOverLimit() *GroupUpsert {
  2643. u.SetExcluded(group.FieldMaxReasoningEffortOverLimit)
  2644. return u
  2645. }
  2646. // SetReasoningEffortMappings sets the "reasoning_effort_mappings" field.
  2647. func (u *GroupUpsert) SetReasoningEffortMappings(v []domain.ReasoningEffortMapping) *GroupUpsert {
  2648. u.Set(group.FieldReasoningEffortMappings, v)
  2649. return u
  2650. }
  2651. // UpdateReasoningEffortMappings sets the "reasoning_effort_mappings" field to the value that was provided on create.
  2652. func (u *GroupUpsert) UpdateReasoningEffortMappings() *GroupUpsert {
  2653. u.SetExcluded(group.FieldReasoningEffortMappings)
  2654. return u
  2655. }
  2656. // SetProfitControlEnabled sets the "profit_control_enabled" field.
  2657. func (u *GroupUpsert) SetProfitControlEnabled(v bool) *GroupUpsert {
  2658. u.Set(group.FieldProfitControlEnabled, v)
  2659. return u
  2660. }
  2661. // UpdateProfitControlEnabled sets the "profit_control_enabled" field to the value that was provided on create.
  2662. func (u *GroupUpsert) UpdateProfitControlEnabled() *GroupUpsert {
  2663. u.SetExcluded(group.FieldProfitControlEnabled)
  2664. return u
  2665. }
  2666. // SetProfitMinMargin sets the "profit_min_margin" field.
  2667. func (u *GroupUpsert) SetProfitMinMargin(v float64) *GroupUpsert {
  2668. u.Set(group.FieldProfitMinMargin, v)
  2669. return u
  2670. }
  2671. // UpdateProfitMinMargin sets the "profit_min_margin" field to the value that was provided on create.
  2672. func (u *GroupUpsert) UpdateProfitMinMargin() *GroupUpsert {
  2673. u.SetExcluded(group.FieldProfitMinMargin)
  2674. return u
  2675. }
  2676. // AddProfitMinMargin adds v to the "profit_min_margin" field.
  2677. func (u *GroupUpsert) AddProfitMinMargin(v float64) *GroupUpsert {
  2678. u.Add(group.FieldProfitMinMargin, v)
  2679. return u
  2680. }
  2681. // SetProfitSafetyBuffer sets the "profit_safety_buffer" field.
  2682. func (u *GroupUpsert) SetProfitSafetyBuffer(v float64) *GroupUpsert {
  2683. u.Set(group.FieldProfitSafetyBuffer, v)
  2684. return u
  2685. }
  2686. // UpdateProfitSafetyBuffer sets the "profit_safety_buffer" field to the value that was provided on create.
  2687. func (u *GroupUpsert) UpdateProfitSafetyBuffer() *GroupUpsert {
  2688. u.SetExcluded(group.FieldProfitSafetyBuffer)
  2689. return u
  2690. }
  2691. // AddProfitSafetyBuffer adds v to the "profit_safety_buffer" field.
  2692. func (u *GroupUpsert) AddProfitSafetyBuffer(v float64) *GroupUpsert {
  2693. u.Add(group.FieldProfitSafetyBuffer, v)
  2694. return u
  2695. }
  2696. // UpdateNewValues updates the mutable fields using the new values that were set on create.
  2697. // Using this option is equivalent to using:
  2698. //
  2699. // client.Group.Create().
  2700. // OnConflict(
  2701. // sql.ResolveWithNewValues(),
  2702. // ).
  2703. // Exec(ctx)
  2704. func (u *GroupUpsertOne) UpdateNewValues() *GroupUpsertOne {
  2705. u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues())
  2706. u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) {
  2707. if _, exists := u.create.mutation.CreatedAt(); exists {
  2708. s.SetIgnore(group.FieldCreatedAt)
  2709. }
  2710. if _, exists := u.create.mutation.DuplicateOperationID(); exists {
  2711. s.SetIgnore(group.FieldDuplicateOperationID)
  2712. }
  2713. }))
  2714. return u
  2715. }
  2716. // Ignore sets each column to itself in case of conflict.
  2717. // Using this option is equivalent to using:
  2718. //
  2719. // client.Group.Create().
  2720. // OnConflict(sql.ResolveWithIgnore()).
  2721. // Exec(ctx)
  2722. func (u *GroupUpsertOne) Ignore() *GroupUpsertOne {
  2723. u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore())
  2724. return u
  2725. }
  2726. // DoNothing configures the conflict_action to `DO NOTHING`.
  2727. // Supported only by SQLite and PostgreSQL.
  2728. func (u *GroupUpsertOne) DoNothing() *GroupUpsertOne {
  2729. u.create.conflict = append(u.create.conflict, sql.DoNothing())
  2730. return u
  2731. }
  2732. // Update allows overriding fields `UPDATE` values. See the GroupCreate.OnConflict
  2733. // documentation for more info.
  2734. func (u *GroupUpsertOne) Update(set func(*GroupUpsert)) *GroupUpsertOne {
  2735. u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
  2736. set(&GroupUpsert{UpdateSet: update})
  2737. }))
  2738. return u
  2739. }
  2740. // SetUpdatedAt sets the "updated_at" field.
  2741. func (u *GroupUpsertOne) SetUpdatedAt(v time.Time) *GroupUpsertOne {
  2742. return u.Update(func(s *GroupUpsert) {
  2743. s.SetUpdatedAt(v)
  2744. })
  2745. }
  2746. // UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
  2747. func (u *GroupUpsertOne) UpdateUpdatedAt() *GroupUpsertOne {
  2748. return u.Update(func(s *GroupUpsert) {
  2749. s.UpdateUpdatedAt()
  2750. })
  2751. }
  2752. // SetDeletedAt sets the "deleted_at" field.
  2753. func (u *GroupUpsertOne) SetDeletedAt(v time.Time) *GroupUpsertOne {
  2754. return u.Update(func(s *GroupUpsert) {
  2755. s.SetDeletedAt(v)
  2756. })
  2757. }
  2758. // UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
  2759. func (u *GroupUpsertOne) UpdateDeletedAt() *GroupUpsertOne {
  2760. return u.Update(func(s *GroupUpsert) {
  2761. s.UpdateDeletedAt()
  2762. })
  2763. }
  2764. // ClearDeletedAt clears the value of the "deleted_at" field.
  2765. func (u *GroupUpsertOne) ClearDeletedAt() *GroupUpsertOne {
  2766. return u.Update(func(s *GroupUpsert) {
  2767. s.ClearDeletedAt()
  2768. })
  2769. }
  2770. // SetName sets the "name" field.
  2771. func (u *GroupUpsertOne) SetName(v string) *GroupUpsertOne {
  2772. return u.Update(func(s *GroupUpsert) {
  2773. s.SetName(v)
  2774. })
  2775. }
  2776. // UpdateName sets the "name" field to the value that was provided on create.
  2777. func (u *GroupUpsertOne) UpdateName() *GroupUpsertOne {
  2778. return u.Update(func(s *GroupUpsert) {
  2779. s.UpdateName()
  2780. })
  2781. }
  2782. // SetDescription sets the "description" field.
  2783. func (u *GroupUpsertOne) SetDescription(v string) *GroupUpsertOne {
  2784. return u.Update(func(s *GroupUpsert) {
  2785. s.SetDescription(v)
  2786. })
  2787. }
  2788. // UpdateDescription sets the "description" field to the value that was provided on create.
  2789. func (u *GroupUpsertOne) UpdateDescription() *GroupUpsertOne {
  2790. return u.Update(func(s *GroupUpsert) {
  2791. s.UpdateDescription()
  2792. })
  2793. }
  2794. // ClearDescription clears the value of the "description" field.
  2795. func (u *GroupUpsertOne) ClearDescription() *GroupUpsertOne {
  2796. return u.Update(func(s *GroupUpsert) {
  2797. s.ClearDescription()
  2798. })
  2799. }
  2800. // SetRateMultiplier sets the "rate_multiplier" field.
  2801. func (u *GroupUpsertOne) SetRateMultiplier(v float64) *GroupUpsertOne {
  2802. return u.Update(func(s *GroupUpsert) {
  2803. s.SetRateMultiplier(v)
  2804. })
  2805. }
  2806. // AddRateMultiplier adds v to the "rate_multiplier" field.
  2807. func (u *GroupUpsertOne) AddRateMultiplier(v float64) *GroupUpsertOne {
  2808. return u.Update(func(s *GroupUpsert) {
  2809. s.AddRateMultiplier(v)
  2810. })
  2811. }
  2812. // UpdateRateMultiplier sets the "rate_multiplier" field to the value that was provided on create.
  2813. func (u *GroupUpsertOne) UpdateRateMultiplier() *GroupUpsertOne {
  2814. return u.Update(func(s *GroupUpsert) {
  2815. s.UpdateRateMultiplier()
  2816. })
  2817. }
  2818. // SetPeakRateEnabled sets the "peak_rate_enabled" field.
  2819. func (u *GroupUpsertOne) SetPeakRateEnabled(v bool) *GroupUpsertOne {
  2820. return u.Update(func(s *GroupUpsert) {
  2821. s.SetPeakRateEnabled(v)
  2822. })
  2823. }
  2824. // UpdatePeakRateEnabled sets the "peak_rate_enabled" field to the value that was provided on create.
  2825. func (u *GroupUpsertOne) UpdatePeakRateEnabled() *GroupUpsertOne {
  2826. return u.Update(func(s *GroupUpsert) {
  2827. s.UpdatePeakRateEnabled()
  2828. })
  2829. }
  2830. // SetPeakStart sets the "peak_start" field.
  2831. func (u *GroupUpsertOne) SetPeakStart(v string) *GroupUpsertOne {
  2832. return u.Update(func(s *GroupUpsert) {
  2833. s.SetPeakStart(v)
  2834. })
  2835. }
  2836. // UpdatePeakStart sets the "peak_start" field to the value that was provided on create.
  2837. func (u *GroupUpsertOne) UpdatePeakStart() *GroupUpsertOne {
  2838. return u.Update(func(s *GroupUpsert) {
  2839. s.UpdatePeakStart()
  2840. })
  2841. }
  2842. // SetPeakEnd sets the "peak_end" field.
  2843. func (u *GroupUpsertOne) SetPeakEnd(v string) *GroupUpsertOne {
  2844. return u.Update(func(s *GroupUpsert) {
  2845. s.SetPeakEnd(v)
  2846. })
  2847. }
  2848. // UpdatePeakEnd sets the "peak_end" field to the value that was provided on create.
  2849. func (u *GroupUpsertOne) UpdatePeakEnd() *GroupUpsertOne {
  2850. return u.Update(func(s *GroupUpsert) {
  2851. s.UpdatePeakEnd()
  2852. })
  2853. }
  2854. // SetPeakRateMultiplier sets the "peak_rate_multiplier" field.
  2855. func (u *GroupUpsertOne) SetPeakRateMultiplier(v float64) *GroupUpsertOne {
  2856. return u.Update(func(s *GroupUpsert) {
  2857. s.SetPeakRateMultiplier(v)
  2858. })
  2859. }
  2860. // AddPeakRateMultiplier adds v to the "peak_rate_multiplier" field.
  2861. func (u *GroupUpsertOne) AddPeakRateMultiplier(v float64) *GroupUpsertOne {
  2862. return u.Update(func(s *GroupUpsert) {
  2863. s.AddPeakRateMultiplier(v)
  2864. })
  2865. }
  2866. // UpdatePeakRateMultiplier sets the "peak_rate_multiplier" field to the value that was provided on create.
  2867. func (u *GroupUpsertOne) UpdatePeakRateMultiplier() *GroupUpsertOne {
  2868. return u.Update(func(s *GroupUpsert) {
  2869. s.UpdatePeakRateMultiplier()
  2870. })
  2871. }
  2872. // SetIsExclusive sets the "is_exclusive" field.
  2873. func (u *GroupUpsertOne) SetIsExclusive(v bool) *GroupUpsertOne {
  2874. return u.Update(func(s *GroupUpsert) {
  2875. s.SetIsExclusive(v)
  2876. })
  2877. }
  2878. // UpdateIsExclusive sets the "is_exclusive" field to the value that was provided on create.
  2879. func (u *GroupUpsertOne) UpdateIsExclusive() *GroupUpsertOne {
  2880. return u.Update(func(s *GroupUpsert) {
  2881. s.UpdateIsExclusive()
  2882. })
  2883. }
  2884. // SetSecurityPolicyEnabled sets the "security_policy_enabled" field.
  2885. func (u *GroupUpsertOne) SetSecurityPolicyEnabled(v bool) *GroupUpsertOne {
  2886. return u.Update(func(s *GroupUpsert) {
  2887. s.SetSecurityPolicyEnabled(v)
  2888. })
  2889. }
  2890. // UpdateSecurityPolicyEnabled sets the "security_policy_enabled" field to the value that was provided on create.
  2891. func (u *GroupUpsertOne) UpdateSecurityPolicyEnabled() *GroupUpsertOne {
  2892. return u.Update(func(s *GroupUpsert) {
  2893. s.UpdateSecurityPolicyEnabled()
  2894. })
  2895. }
  2896. // SetSecurityPolicyMode sets the "security_policy_mode" field.
  2897. func (u *GroupUpsertOne) SetSecurityPolicyMode(v string) *GroupUpsertOne {
  2898. return u.Update(func(s *GroupUpsert) {
  2899. s.SetSecurityPolicyMode(v)
  2900. })
  2901. }
  2902. // UpdateSecurityPolicyMode sets the "security_policy_mode" field to the value that was provided on create.
  2903. func (u *GroupUpsertOne) UpdateSecurityPolicyMode() *GroupUpsertOne {
  2904. return u.Update(func(s *GroupUpsert) {
  2905. s.UpdateSecurityPolicyMode()
  2906. })
  2907. }
  2908. // SetSecurityPolicyEmailEnabled sets the "security_policy_email_enabled" field.
  2909. func (u *GroupUpsertOne) SetSecurityPolicyEmailEnabled(v bool) *GroupUpsertOne {
  2910. return u.Update(func(s *GroupUpsert) {
  2911. s.SetSecurityPolicyEmailEnabled(v)
  2912. })
  2913. }
  2914. // UpdateSecurityPolicyEmailEnabled sets the "security_policy_email_enabled" field to the value that was provided on create.
  2915. func (u *GroupUpsertOne) UpdateSecurityPolicyEmailEnabled() *GroupUpsertOne {
  2916. return u.Update(func(s *GroupUpsert) {
  2917. s.UpdateSecurityPolicyEmailEnabled()
  2918. })
  2919. }
  2920. // SetStatus sets the "status" field.
  2921. func (u *GroupUpsertOne) SetStatus(v string) *GroupUpsertOne {
  2922. return u.Update(func(s *GroupUpsert) {
  2923. s.SetStatus(v)
  2924. })
  2925. }
  2926. // UpdateStatus sets the "status" field to the value that was provided on create.
  2927. func (u *GroupUpsertOne) UpdateStatus() *GroupUpsertOne {
  2928. return u.Update(func(s *GroupUpsert) {
  2929. s.UpdateStatus()
  2930. })
  2931. }
  2932. // SetPlatform sets the "platform" field.
  2933. func (u *GroupUpsertOne) SetPlatform(v string) *GroupUpsertOne {
  2934. return u.Update(func(s *GroupUpsert) {
  2935. s.SetPlatform(v)
  2936. })
  2937. }
  2938. // UpdatePlatform sets the "platform" field to the value that was provided on create.
  2939. func (u *GroupUpsertOne) UpdatePlatform() *GroupUpsertOne {
  2940. return u.Update(func(s *GroupUpsert) {
  2941. s.UpdatePlatform()
  2942. })
  2943. }
  2944. // SetSubscriptionType sets the "subscription_type" field.
  2945. func (u *GroupUpsertOne) SetSubscriptionType(v string) *GroupUpsertOne {
  2946. return u.Update(func(s *GroupUpsert) {
  2947. s.SetSubscriptionType(v)
  2948. })
  2949. }
  2950. // UpdateSubscriptionType sets the "subscription_type" field to the value that was provided on create.
  2951. func (u *GroupUpsertOne) UpdateSubscriptionType() *GroupUpsertOne {
  2952. return u.Update(func(s *GroupUpsert) {
  2953. s.UpdateSubscriptionType()
  2954. })
  2955. }
  2956. // SetDailyLimitUsd sets the "daily_limit_usd" field.
  2957. func (u *GroupUpsertOne) SetDailyLimitUsd(v float64) *GroupUpsertOne {
  2958. return u.Update(func(s *GroupUpsert) {
  2959. s.SetDailyLimitUsd(v)
  2960. })
  2961. }
  2962. // AddDailyLimitUsd adds v to the "daily_limit_usd" field.
  2963. func (u *GroupUpsertOne) AddDailyLimitUsd(v float64) *GroupUpsertOne {
  2964. return u.Update(func(s *GroupUpsert) {
  2965. s.AddDailyLimitUsd(v)
  2966. })
  2967. }
  2968. // UpdateDailyLimitUsd sets the "daily_limit_usd" field to the value that was provided on create.
  2969. func (u *GroupUpsertOne) UpdateDailyLimitUsd() *GroupUpsertOne {
  2970. return u.Update(func(s *GroupUpsert) {
  2971. s.UpdateDailyLimitUsd()
  2972. })
  2973. }
  2974. // ClearDailyLimitUsd clears the value of the "daily_limit_usd" field.
  2975. func (u *GroupUpsertOne) ClearDailyLimitUsd() *GroupUpsertOne {
  2976. return u.Update(func(s *GroupUpsert) {
  2977. s.ClearDailyLimitUsd()
  2978. })
  2979. }
  2980. // SetWeeklyLimitUsd sets the "weekly_limit_usd" field.
  2981. func (u *GroupUpsertOne) SetWeeklyLimitUsd(v float64) *GroupUpsertOne {
  2982. return u.Update(func(s *GroupUpsert) {
  2983. s.SetWeeklyLimitUsd(v)
  2984. })
  2985. }
  2986. // AddWeeklyLimitUsd adds v to the "weekly_limit_usd" field.
  2987. func (u *GroupUpsertOne) AddWeeklyLimitUsd(v float64) *GroupUpsertOne {
  2988. return u.Update(func(s *GroupUpsert) {
  2989. s.AddWeeklyLimitUsd(v)
  2990. })
  2991. }
  2992. // UpdateWeeklyLimitUsd sets the "weekly_limit_usd" field to the value that was provided on create.
  2993. func (u *GroupUpsertOne) UpdateWeeklyLimitUsd() *GroupUpsertOne {
  2994. return u.Update(func(s *GroupUpsert) {
  2995. s.UpdateWeeklyLimitUsd()
  2996. })
  2997. }
  2998. // ClearWeeklyLimitUsd clears the value of the "weekly_limit_usd" field.
  2999. func (u *GroupUpsertOne) ClearWeeklyLimitUsd() *GroupUpsertOne {
  3000. return u.Update(func(s *GroupUpsert) {
  3001. s.ClearWeeklyLimitUsd()
  3002. })
  3003. }
  3004. // SetMonthlyLimitUsd sets the "monthly_limit_usd" field.
  3005. func (u *GroupUpsertOne) SetMonthlyLimitUsd(v float64) *GroupUpsertOne {
  3006. return u.Update(func(s *GroupUpsert) {
  3007. s.SetMonthlyLimitUsd(v)
  3008. })
  3009. }
  3010. // AddMonthlyLimitUsd adds v to the "monthly_limit_usd" field.
  3011. func (u *GroupUpsertOne) AddMonthlyLimitUsd(v float64) *GroupUpsertOne {
  3012. return u.Update(func(s *GroupUpsert) {
  3013. s.AddMonthlyLimitUsd(v)
  3014. })
  3015. }
  3016. // UpdateMonthlyLimitUsd sets the "monthly_limit_usd" field to the value that was provided on create.
  3017. func (u *GroupUpsertOne) UpdateMonthlyLimitUsd() *GroupUpsertOne {
  3018. return u.Update(func(s *GroupUpsert) {
  3019. s.UpdateMonthlyLimitUsd()
  3020. })
  3021. }
  3022. // ClearMonthlyLimitUsd clears the value of the "monthly_limit_usd" field.
  3023. func (u *GroupUpsertOne) ClearMonthlyLimitUsd() *GroupUpsertOne {
  3024. return u.Update(func(s *GroupUpsert) {
  3025. s.ClearMonthlyLimitUsd()
  3026. })
  3027. }
  3028. // SetDefaultValidityDays sets the "default_validity_days" field.
  3029. func (u *GroupUpsertOne) SetDefaultValidityDays(v int) *GroupUpsertOne {
  3030. return u.Update(func(s *GroupUpsert) {
  3031. s.SetDefaultValidityDays(v)
  3032. })
  3033. }
  3034. // AddDefaultValidityDays adds v to the "default_validity_days" field.
  3035. func (u *GroupUpsertOne) AddDefaultValidityDays(v int) *GroupUpsertOne {
  3036. return u.Update(func(s *GroupUpsert) {
  3037. s.AddDefaultValidityDays(v)
  3038. })
  3039. }
  3040. // UpdateDefaultValidityDays sets the "default_validity_days" field to the value that was provided on create.
  3041. func (u *GroupUpsertOne) UpdateDefaultValidityDays() *GroupUpsertOne {
  3042. return u.Update(func(s *GroupUpsert) {
  3043. s.UpdateDefaultValidityDays()
  3044. })
  3045. }
  3046. // SetAllowImageGeneration sets the "allow_image_generation" field.
  3047. func (u *GroupUpsertOne) SetAllowImageGeneration(v bool) *GroupUpsertOne {
  3048. return u.Update(func(s *GroupUpsert) {
  3049. s.SetAllowImageGeneration(v)
  3050. })
  3051. }
  3052. // UpdateAllowImageGeneration sets the "allow_image_generation" field to the value that was provided on create.
  3053. func (u *GroupUpsertOne) UpdateAllowImageGeneration() *GroupUpsertOne {
  3054. return u.Update(func(s *GroupUpsert) {
  3055. s.UpdateAllowImageGeneration()
  3056. })
  3057. }
  3058. // SetAllowBatchImageGeneration sets the "allow_batch_image_generation" field.
  3059. func (u *GroupUpsertOne) SetAllowBatchImageGeneration(v bool) *GroupUpsertOne {
  3060. return u.Update(func(s *GroupUpsert) {
  3061. s.SetAllowBatchImageGeneration(v)
  3062. })
  3063. }
  3064. // UpdateAllowBatchImageGeneration sets the "allow_batch_image_generation" field to the value that was provided on create.
  3065. func (u *GroupUpsertOne) UpdateAllowBatchImageGeneration() *GroupUpsertOne {
  3066. return u.Update(func(s *GroupUpsert) {
  3067. s.UpdateAllowBatchImageGeneration()
  3068. })
  3069. }
  3070. // SetImageRateIndependent sets the "image_rate_independent" field.
  3071. func (u *GroupUpsertOne) SetImageRateIndependent(v bool) *GroupUpsertOne {
  3072. return u.Update(func(s *GroupUpsert) {
  3073. s.SetImageRateIndependent(v)
  3074. })
  3075. }
  3076. // UpdateImageRateIndependent sets the "image_rate_independent" field to the value that was provided on create.
  3077. func (u *GroupUpsertOne) UpdateImageRateIndependent() *GroupUpsertOne {
  3078. return u.Update(func(s *GroupUpsert) {
  3079. s.UpdateImageRateIndependent()
  3080. })
  3081. }
  3082. // SetImageRateMultiplier sets the "image_rate_multiplier" field.
  3083. func (u *GroupUpsertOne) SetImageRateMultiplier(v float64) *GroupUpsertOne {
  3084. return u.Update(func(s *GroupUpsert) {
  3085. s.SetImageRateMultiplier(v)
  3086. })
  3087. }
  3088. // AddImageRateMultiplier adds v to the "image_rate_multiplier" field.
  3089. func (u *GroupUpsertOne) AddImageRateMultiplier(v float64) *GroupUpsertOne {
  3090. return u.Update(func(s *GroupUpsert) {
  3091. s.AddImageRateMultiplier(v)
  3092. })
  3093. }
  3094. // UpdateImageRateMultiplier sets the "image_rate_multiplier" field to the value that was provided on create.
  3095. func (u *GroupUpsertOne) UpdateImageRateMultiplier() *GroupUpsertOne {
  3096. return u.Update(func(s *GroupUpsert) {
  3097. s.UpdateImageRateMultiplier()
  3098. })
  3099. }
  3100. // SetImagePrice1k sets the "image_price_1k" field.
  3101. func (u *GroupUpsertOne) SetImagePrice1k(v float64) *GroupUpsertOne {
  3102. return u.Update(func(s *GroupUpsert) {
  3103. s.SetImagePrice1k(v)
  3104. })
  3105. }
  3106. // AddImagePrice1k adds v to the "image_price_1k" field.
  3107. func (u *GroupUpsertOne) AddImagePrice1k(v float64) *GroupUpsertOne {
  3108. return u.Update(func(s *GroupUpsert) {
  3109. s.AddImagePrice1k(v)
  3110. })
  3111. }
  3112. // UpdateImagePrice1k sets the "image_price_1k" field to the value that was provided on create.
  3113. func (u *GroupUpsertOne) UpdateImagePrice1k() *GroupUpsertOne {
  3114. return u.Update(func(s *GroupUpsert) {
  3115. s.UpdateImagePrice1k()
  3116. })
  3117. }
  3118. // ClearImagePrice1k clears the value of the "image_price_1k" field.
  3119. func (u *GroupUpsertOne) ClearImagePrice1k() *GroupUpsertOne {
  3120. return u.Update(func(s *GroupUpsert) {
  3121. s.ClearImagePrice1k()
  3122. })
  3123. }
  3124. // SetImagePrice2k sets the "image_price_2k" field.
  3125. func (u *GroupUpsertOne) SetImagePrice2k(v float64) *GroupUpsertOne {
  3126. return u.Update(func(s *GroupUpsert) {
  3127. s.SetImagePrice2k(v)
  3128. })
  3129. }
  3130. // AddImagePrice2k adds v to the "image_price_2k" field.
  3131. func (u *GroupUpsertOne) AddImagePrice2k(v float64) *GroupUpsertOne {
  3132. return u.Update(func(s *GroupUpsert) {
  3133. s.AddImagePrice2k(v)
  3134. })
  3135. }
  3136. // UpdateImagePrice2k sets the "image_price_2k" field to the value that was provided on create.
  3137. func (u *GroupUpsertOne) UpdateImagePrice2k() *GroupUpsertOne {
  3138. return u.Update(func(s *GroupUpsert) {
  3139. s.UpdateImagePrice2k()
  3140. })
  3141. }
  3142. // ClearImagePrice2k clears the value of the "image_price_2k" field.
  3143. func (u *GroupUpsertOne) ClearImagePrice2k() *GroupUpsertOne {
  3144. return u.Update(func(s *GroupUpsert) {
  3145. s.ClearImagePrice2k()
  3146. })
  3147. }
  3148. // SetImagePrice4k sets the "image_price_4k" field.
  3149. func (u *GroupUpsertOne) SetImagePrice4k(v float64) *GroupUpsertOne {
  3150. return u.Update(func(s *GroupUpsert) {
  3151. s.SetImagePrice4k(v)
  3152. })
  3153. }
  3154. // AddImagePrice4k adds v to the "image_price_4k" field.
  3155. func (u *GroupUpsertOne) AddImagePrice4k(v float64) *GroupUpsertOne {
  3156. return u.Update(func(s *GroupUpsert) {
  3157. s.AddImagePrice4k(v)
  3158. })
  3159. }
  3160. // UpdateImagePrice4k sets the "image_price_4k" field to the value that was provided on create.
  3161. func (u *GroupUpsertOne) UpdateImagePrice4k() *GroupUpsertOne {
  3162. return u.Update(func(s *GroupUpsert) {
  3163. s.UpdateImagePrice4k()
  3164. })
  3165. }
  3166. // ClearImagePrice4k clears the value of the "image_price_4k" field.
  3167. func (u *GroupUpsertOne) ClearImagePrice4k() *GroupUpsertOne {
  3168. return u.Update(func(s *GroupUpsert) {
  3169. s.ClearImagePrice4k()
  3170. })
  3171. }
  3172. // SetBatchImageDiscountMultiplier sets the "batch_image_discount_multiplier" field.
  3173. func (u *GroupUpsertOne) SetBatchImageDiscountMultiplier(v float64) *GroupUpsertOne {
  3174. return u.Update(func(s *GroupUpsert) {
  3175. s.SetBatchImageDiscountMultiplier(v)
  3176. })
  3177. }
  3178. // AddBatchImageDiscountMultiplier adds v to the "batch_image_discount_multiplier" field.
  3179. func (u *GroupUpsertOne) AddBatchImageDiscountMultiplier(v float64) *GroupUpsertOne {
  3180. return u.Update(func(s *GroupUpsert) {
  3181. s.AddBatchImageDiscountMultiplier(v)
  3182. })
  3183. }
  3184. // UpdateBatchImageDiscountMultiplier sets the "batch_image_discount_multiplier" field to the value that was provided on create.
  3185. func (u *GroupUpsertOne) UpdateBatchImageDiscountMultiplier() *GroupUpsertOne {
  3186. return u.Update(func(s *GroupUpsert) {
  3187. s.UpdateBatchImageDiscountMultiplier()
  3188. })
  3189. }
  3190. // SetBatchImageHoldMultiplier sets the "batch_image_hold_multiplier" field.
  3191. func (u *GroupUpsertOne) SetBatchImageHoldMultiplier(v float64) *GroupUpsertOne {
  3192. return u.Update(func(s *GroupUpsert) {
  3193. s.SetBatchImageHoldMultiplier(v)
  3194. })
  3195. }
  3196. // AddBatchImageHoldMultiplier adds v to the "batch_image_hold_multiplier" field.
  3197. func (u *GroupUpsertOne) AddBatchImageHoldMultiplier(v float64) *GroupUpsertOne {
  3198. return u.Update(func(s *GroupUpsert) {
  3199. s.AddBatchImageHoldMultiplier(v)
  3200. })
  3201. }
  3202. // UpdateBatchImageHoldMultiplier sets the "batch_image_hold_multiplier" field to the value that was provided on create.
  3203. func (u *GroupUpsertOne) UpdateBatchImageHoldMultiplier() *GroupUpsertOne {
  3204. return u.Update(func(s *GroupUpsert) {
  3205. s.UpdateBatchImageHoldMultiplier()
  3206. })
  3207. }
  3208. // SetVideoRateIndependent sets the "video_rate_independent" field.
  3209. func (u *GroupUpsertOne) SetVideoRateIndependent(v bool) *GroupUpsertOne {
  3210. return u.Update(func(s *GroupUpsert) {
  3211. s.SetVideoRateIndependent(v)
  3212. })
  3213. }
  3214. // UpdateVideoRateIndependent sets the "video_rate_independent" field to the value that was provided on create.
  3215. func (u *GroupUpsertOne) UpdateVideoRateIndependent() *GroupUpsertOne {
  3216. return u.Update(func(s *GroupUpsert) {
  3217. s.UpdateVideoRateIndependent()
  3218. })
  3219. }
  3220. // SetVideoRateMultiplier sets the "video_rate_multiplier" field.
  3221. func (u *GroupUpsertOne) SetVideoRateMultiplier(v float64) *GroupUpsertOne {
  3222. return u.Update(func(s *GroupUpsert) {
  3223. s.SetVideoRateMultiplier(v)
  3224. })
  3225. }
  3226. // AddVideoRateMultiplier adds v to the "video_rate_multiplier" field.
  3227. func (u *GroupUpsertOne) AddVideoRateMultiplier(v float64) *GroupUpsertOne {
  3228. return u.Update(func(s *GroupUpsert) {
  3229. s.AddVideoRateMultiplier(v)
  3230. })
  3231. }
  3232. // UpdateVideoRateMultiplier sets the "video_rate_multiplier" field to the value that was provided on create.
  3233. func (u *GroupUpsertOne) UpdateVideoRateMultiplier() *GroupUpsertOne {
  3234. return u.Update(func(s *GroupUpsert) {
  3235. s.UpdateVideoRateMultiplier()
  3236. })
  3237. }
  3238. // SetVideoPrice480p sets the "video_price_480p" field.
  3239. func (u *GroupUpsertOne) SetVideoPrice480p(v float64) *GroupUpsertOne {
  3240. return u.Update(func(s *GroupUpsert) {
  3241. s.SetVideoPrice480p(v)
  3242. })
  3243. }
  3244. // AddVideoPrice480p adds v to the "video_price_480p" field.
  3245. func (u *GroupUpsertOne) AddVideoPrice480p(v float64) *GroupUpsertOne {
  3246. return u.Update(func(s *GroupUpsert) {
  3247. s.AddVideoPrice480p(v)
  3248. })
  3249. }
  3250. // UpdateVideoPrice480p sets the "video_price_480p" field to the value that was provided on create.
  3251. func (u *GroupUpsertOne) UpdateVideoPrice480p() *GroupUpsertOne {
  3252. return u.Update(func(s *GroupUpsert) {
  3253. s.UpdateVideoPrice480p()
  3254. })
  3255. }
  3256. // ClearVideoPrice480p clears the value of the "video_price_480p" field.
  3257. func (u *GroupUpsertOne) ClearVideoPrice480p() *GroupUpsertOne {
  3258. return u.Update(func(s *GroupUpsert) {
  3259. s.ClearVideoPrice480p()
  3260. })
  3261. }
  3262. // SetVideoPrice720p sets the "video_price_720p" field.
  3263. func (u *GroupUpsertOne) SetVideoPrice720p(v float64) *GroupUpsertOne {
  3264. return u.Update(func(s *GroupUpsert) {
  3265. s.SetVideoPrice720p(v)
  3266. })
  3267. }
  3268. // AddVideoPrice720p adds v to the "video_price_720p" field.
  3269. func (u *GroupUpsertOne) AddVideoPrice720p(v float64) *GroupUpsertOne {
  3270. return u.Update(func(s *GroupUpsert) {
  3271. s.AddVideoPrice720p(v)
  3272. })
  3273. }
  3274. // UpdateVideoPrice720p sets the "video_price_720p" field to the value that was provided on create.
  3275. func (u *GroupUpsertOne) UpdateVideoPrice720p() *GroupUpsertOne {
  3276. return u.Update(func(s *GroupUpsert) {
  3277. s.UpdateVideoPrice720p()
  3278. })
  3279. }
  3280. // ClearVideoPrice720p clears the value of the "video_price_720p" field.
  3281. func (u *GroupUpsertOne) ClearVideoPrice720p() *GroupUpsertOne {
  3282. return u.Update(func(s *GroupUpsert) {
  3283. s.ClearVideoPrice720p()
  3284. })
  3285. }
  3286. // SetVideoPrice1080p sets the "video_price_1080p" field.
  3287. func (u *GroupUpsertOne) SetVideoPrice1080p(v float64) *GroupUpsertOne {
  3288. return u.Update(func(s *GroupUpsert) {
  3289. s.SetVideoPrice1080p(v)
  3290. })
  3291. }
  3292. // AddVideoPrice1080p adds v to the "video_price_1080p" field.
  3293. func (u *GroupUpsertOne) AddVideoPrice1080p(v float64) *GroupUpsertOne {
  3294. return u.Update(func(s *GroupUpsert) {
  3295. s.AddVideoPrice1080p(v)
  3296. })
  3297. }
  3298. // UpdateVideoPrice1080p sets the "video_price_1080p" field to the value that was provided on create.
  3299. func (u *GroupUpsertOne) UpdateVideoPrice1080p() *GroupUpsertOne {
  3300. return u.Update(func(s *GroupUpsert) {
  3301. s.UpdateVideoPrice1080p()
  3302. })
  3303. }
  3304. // ClearVideoPrice1080p clears the value of the "video_price_1080p" field.
  3305. func (u *GroupUpsertOne) ClearVideoPrice1080p() *GroupUpsertOne {
  3306. return u.Update(func(s *GroupUpsert) {
  3307. s.ClearVideoPrice1080p()
  3308. })
  3309. }
  3310. // SetVideoModelPrices sets the "video_model_prices" field.
  3311. func (u *GroupUpsertOne) SetVideoModelPrices(v map[string]map[string]float64) *GroupUpsertOne {
  3312. return u.Update(func(s *GroupUpsert) {
  3313. s.SetVideoModelPrices(v)
  3314. })
  3315. }
  3316. // UpdateVideoModelPrices sets the "video_model_prices" field to the value that was provided on create.
  3317. func (u *GroupUpsertOne) UpdateVideoModelPrices() *GroupUpsertOne {
  3318. return u.Update(func(s *GroupUpsert) {
  3319. s.UpdateVideoModelPrices()
  3320. })
  3321. }
  3322. // ClearVideoModelPrices clears the value of the "video_model_prices" field.
  3323. func (u *GroupUpsertOne) ClearVideoModelPrices() *GroupUpsertOne {
  3324. return u.Update(func(s *GroupUpsert) {
  3325. s.ClearVideoModelPrices()
  3326. })
  3327. }
  3328. // SetWebSearchPricePerCall sets the "web_search_price_per_call" field.
  3329. func (u *GroupUpsertOne) SetWebSearchPricePerCall(v float64) *GroupUpsertOne {
  3330. return u.Update(func(s *GroupUpsert) {
  3331. s.SetWebSearchPricePerCall(v)
  3332. })
  3333. }
  3334. // AddWebSearchPricePerCall adds v to the "web_search_price_per_call" field.
  3335. func (u *GroupUpsertOne) AddWebSearchPricePerCall(v float64) *GroupUpsertOne {
  3336. return u.Update(func(s *GroupUpsert) {
  3337. s.AddWebSearchPricePerCall(v)
  3338. })
  3339. }
  3340. // UpdateWebSearchPricePerCall sets the "web_search_price_per_call" field to the value that was provided on create.
  3341. func (u *GroupUpsertOne) UpdateWebSearchPricePerCall() *GroupUpsertOne {
  3342. return u.Update(func(s *GroupUpsert) {
  3343. s.UpdateWebSearchPricePerCall()
  3344. })
  3345. }
  3346. // ClearWebSearchPricePerCall clears the value of the "web_search_price_per_call" field.
  3347. func (u *GroupUpsertOne) ClearWebSearchPricePerCall() *GroupUpsertOne {
  3348. return u.Update(func(s *GroupUpsert) {
  3349. s.ClearWebSearchPricePerCall()
  3350. })
  3351. }
  3352. // SetSearchPricePer1k sets the "search_price_per_1k" field.
  3353. func (u *GroupUpsertOne) SetSearchPricePer1k(v float64) *GroupUpsertOne {
  3354. return u.Update(func(s *GroupUpsert) {
  3355. s.SetSearchPricePer1k(v)
  3356. })
  3357. }
  3358. // AddSearchPricePer1k adds v to the "search_price_per_1k" field.
  3359. func (u *GroupUpsertOne) AddSearchPricePer1k(v float64) *GroupUpsertOne {
  3360. return u.Update(func(s *GroupUpsert) {
  3361. s.AddSearchPricePer1k(v)
  3362. })
  3363. }
  3364. // UpdateSearchPricePer1k sets the "search_price_per_1k" field to the value that was provided on create.
  3365. func (u *GroupUpsertOne) UpdateSearchPricePer1k() *GroupUpsertOne {
  3366. return u.Update(func(s *GroupUpsert) {
  3367. s.UpdateSearchPricePer1k()
  3368. })
  3369. }
  3370. // ClearSearchPricePer1k clears the value of the "search_price_per_1k" field.
  3371. func (u *GroupUpsertOne) ClearSearchPricePer1k() *GroupUpsertOne {
  3372. return u.Update(func(s *GroupUpsert) {
  3373. s.ClearSearchPricePer1k()
  3374. })
  3375. }
  3376. // SetAudioRealtimePricePerMin sets the "audio_realtime_price_per_min" field.
  3377. func (u *GroupUpsertOne) SetAudioRealtimePricePerMin(v float64) *GroupUpsertOne {
  3378. return u.Update(func(s *GroupUpsert) {
  3379. s.SetAudioRealtimePricePerMin(v)
  3380. })
  3381. }
  3382. // AddAudioRealtimePricePerMin adds v to the "audio_realtime_price_per_min" field.
  3383. func (u *GroupUpsertOne) AddAudioRealtimePricePerMin(v float64) *GroupUpsertOne {
  3384. return u.Update(func(s *GroupUpsert) {
  3385. s.AddAudioRealtimePricePerMin(v)
  3386. })
  3387. }
  3388. // UpdateAudioRealtimePricePerMin sets the "audio_realtime_price_per_min" field to the value that was provided on create.
  3389. func (u *GroupUpsertOne) UpdateAudioRealtimePricePerMin() *GroupUpsertOne {
  3390. return u.Update(func(s *GroupUpsert) {
  3391. s.UpdateAudioRealtimePricePerMin()
  3392. })
  3393. }
  3394. // ClearAudioRealtimePricePerMin clears the value of the "audio_realtime_price_per_min" field.
  3395. func (u *GroupUpsertOne) ClearAudioRealtimePricePerMin() *GroupUpsertOne {
  3396. return u.Update(func(s *GroupUpsert) {
  3397. s.ClearAudioRealtimePricePerMin()
  3398. })
  3399. }
  3400. // SetAudioTtsPricePerMillionChars sets the "audio_tts_price_per_million_chars" field.
  3401. func (u *GroupUpsertOne) SetAudioTtsPricePerMillionChars(v float64) *GroupUpsertOne {
  3402. return u.Update(func(s *GroupUpsert) {
  3403. s.SetAudioTtsPricePerMillionChars(v)
  3404. })
  3405. }
  3406. // AddAudioTtsPricePerMillionChars adds v to the "audio_tts_price_per_million_chars" field.
  3407. func (u *GroupUpsertOne) AddAudioTtsPricePerMillionChars(v float64) *GroupUpsertOne {
  3408. return u.Update(func(s *GroupUpsert) {
  3409. s.AddAudioTtsPricePerMillionChars(v)
  3410. })
  3411. }
  3412. // UpdateAudioTtsPricePerMillionChars sets the "audio_tts_price_per_million_chars" field to the value that was provided on create.
  3413. func (u *GroupUpsertOne) UpdateAudioTtsPricePerMillionChars() *GroupUpsertOne {
  3414. return u.Update(func(s *GroupUpsert) {
  3415. s.UpdateAudioTtsPricePerMillionChars()
  3416. })
  3417. }
  3418. // ClearAudioTtsPricePerMillionChars clears the value of the "audio_tts_price_per_million_chars" field.
  3419. func (u *GroupUpsertOne) ClearAudioTtsPricePerMillionChars() *GroupUpsertOne {
  3420. return u.Update(func(s *GroupUpsert) {
  3421. s.ClearAudioTtsPricePerMillionChars()
  3422. })
  3423. }
  3424. // SetAudioSttPricePerHour sets the "audio_stt_price_per_hour" field.
  3425. func (u *GroupUpsertOne) SetAudioSttPricePerHour(v float64) *GroupUpsertOne {
  3426. return u.Update(func(s *GroupUpsert) {
  3427. s.SetAudioSttPricePerHour(v)
  3428. })
  3429. }
  3430. // AddAudioSttPricePerHour adds v to the "audio_stt_price_per_hour" field.
  3431. func (u *GroupUpsertOne) AddAudioSttPricePerHour(v float64) *GroupUpsertOne {
  3432. return u.Update(func(s *GroupUpsert) {
  3433. s.AddAudioSttPricePerHour(v)
  3434. })
  3435. }
  3436. // UpdateAudioSttPricePerHour sets the "audio_stt_price_per_hour" field to the value that was provided on create.
  3437. func (u *GroupUpsertOne) UpdateAudioSttPricePerHour() *GroupUpsertOne {
  3438. return u.Update(func(s *GroupUpsert) {
  3439. s.UpdateAudioSttPricePerHour()
  3440. })
  3441. }
  3442. // ClearAudioSttPricePerHour clears the value of the "audio_stt_price_per_hour" field.
  3443. func (u *GroupUpsertOne) ClearAudioSttPricePerHour() *GroupUpsertOne {
  3444. return u.Update(func(s *GroupUpsert) {
  3445. s.ClearAudioSttPricePerHour()
  3446. })
  3447. }
  3448. // SetLongContextPricingEnabled sets the "long_context_pricing_enabled" field.
  3449. func (u *GroupUpsertOne) SetLongContextPricingEnabled(v bool) *GroupUpsertOne {
  3450. return u.Update(func(s *GroupUpsert) {
  3451. s.SetLongContextPricingEnabled(v)
  3452. })
  3453. }
  3454. // UpdateLongContextPricingEnabled sets the "long_context_pricing_enabled" field to the value that was provided on create.
  3455. func (u *GroupUpsertOne) UpdateLongContextPricingEnabled() *GroupUpsertOne {
  3456. return u.Update(func(s *GroupUpsert) {
  3457. s.UpdateLongContextPricingEnabled()
  3458. })
  3459. }
  3460. // SetModelPricing sets the "model_pricing" field.
  3461. func (u *GroupUpsertOne) SetModelPricing(v jsontext.Value) *GroupUpsertOne {
  3462. return u.Update(func(s *GroupUpsert) {
  3463. s.SetModelPricing(v)
  3464. })
  3465. }
  3466. // UpdateModelPricing sets the "model_pricing" field to the value that was provided on create.
  3467. func (u *GroupUpsertOne) UpdateModelPricing() *GroupUpsertOne {
  3468. return u.Update(func(s *GroupUpsert) {
  3469. s.UpdateModelPricing()
  3470. })
  3471. }
  3472. // ClearModelPricing clears the value of the "model_pricing" field.
  3473. func (u *GroupUpsertOne) ClearModelPricing() *GroupUpsertOne {
  3474. return u.Update(func(s *GroupUpsert) {
  3475. s.ClearModelPricing()
  3476. })
  3477. }
  3478. // SetClaudeCodeOnly sets the "claude_code_only" field.
  3479. func (u *GroupUpsertOne) SetClaudeCodeOnly(v bool) *GroupUpsertOne {
  3480. return u.Update(func(s *GroupUpsert) {
  3481. s.SetClaudeCodeOnly(v)
  3482. })
  3483. }
  3484. // UpdateClaudeCodeOnly sets the "claude_code_only" field to the value that was provided on create.
  3485. func (u *GroupUpsertOne) UpdateClaudeCodeOnly() *GroupUpsertOne {
  3486. return u.Update(func(s *GroupUpsert) {
  3487. s.UpdateClaudeCodeOnly()
  3488. })
  3489. }
  3490. // SetFallbackGroupID sets the "fallback_group_id" field.
  3491. func (u *GroupUpsertOne) SetFallbackGroupID(v int64) *GroupUpsertOne {
  3492. return u.Update(func(s *GroupUpsert) {
  3493. s.SetFallbackGroupID(v)
  3494. })
  3495. }
  3496. // AddFallbackGroupID adds v to the "fallback_group_id" field.
  3497. func (u *GroupUpsertOne) AddFallbackGroupID(v int64) *GroupUpsertOne {
  3498. return u.Update(func(s *GroupUpsert) {
  3499. s.AddFallbackGroupID(v)
  3500. })
  3501. }
  3502. // UpdateFallbackGroupID sets the "fallback_group_id" field to the value that was provided on create.
  3503. func (u *GroupUpsertOne) UpdateFallbackGroupID() *GroupUpsertOne {
  3504. return u.Update(func(s *GroupUpsert) {
  3505. s.UpdateFallbackGroupID()
  3506. })
  3507. }
  3508. // ClearFallbackGroupID clears the value of the "fallback_group_id" field.
  3509. func (u *GroupUpsertOne) ClearFallbackGroupID() *GroupUpsertOne {
  3510. return u.Update(func(s *GroupUpsert) {
  3511. s.ClearFallbackGroupID()
  3512. })
  3513. }
  3514. // SetFallbackGroupIDOnInvalidRequest sets the "fallback_group_id_on_invalid_request" field.
  3515. func (u *GroupUpsertOne) SetFallbackGroupIDOnInvalidRequest(v int64) *GroupUpsertOne {
  3516. return u.Update(func(s *GroupUpsert) {
  3517. s.SetFallbackGroupIDOnInvalidRequest(v)
  3518. })
  3519. }
  3520. // AddFallbackGroupIDOnInvalidRequest adds v to the "fallback_group_id_on_invalid_request" field.
  3521. func (u *GroupUpsertOne) AddFallbackGroupIDOnInvalidRequest(v int64) *GroupUpsertOne {
  3522. return u.Update(func(s *GroupUpsert) {
  3523. s.AddFallbackGroupIDOnInvalidRequest(v)
  3524. })
  3525. }
  3526. // UpdateFallbackGroupIDOnInvalidRequest sets the "fallback_group_id_on_invalid_request" field to the value that was provided on create.
  3527. func (u *GroupUpsertOne) UpdateFallbackGroupIDOnInvalidRequest() *GroupUpsertOne {
  3528. return u.Update(func(s *GroupUpsert) {
  3529. s.UpdateFallbackGroupIDOnInvalidRequest()
  3530. })
  3531. }
  3532. // ClearFallbackGroupIDOnInvalidRequest clears the value of the "fallback_group_id_on_invalid_request" field.
  3533. func (u *GroupUpsertOne) ClearFallbackGroupIDOnInvalidRequest() *GroupUpsertOne {
  3534. return u.Update(func(s *GroupUpsert) {
  3535. s.ClearFallbackGroupIDOnInvalidRequest()
  3536. })
  3537. }
  3538. // SetModelRouting sets the "model_routing" field.
  3539. func (u *GroupUpsertOne) SetModelRouting(v map[string][]int64) *GroupUpsertOne {
  3540. return u.Update(func(s *GroupUpsert) {
  3541. s.SetModelRouting(v)
  3542. })
  3543. }
  3544. // UpdateModelRouting sets the "model_routing" field to the value that was provided on create.
  3545. func (u *GroupUpsertOne) UpdateModelRouting() *GroupUpsertOne {
  3546. return u.Update(func(s *GroupUpsert) {
  3547. s.UpdateModelRouting()
  3548. })
  3549. }
  3550. // ClearModelRouting clears the value of the "model_routing" field.
  3551. func (u *GroupUpsertOne) ClearModelRouting() *GroupUpsertOne {
  3552. return u.Update(func(s *GroupUpsert) {
  3553. s.ClearModelRouting()
  3554. })
  3555. }
  3556. // SetModelRoutingEnabled sets the "model_routing_enabled" field.
  3557. func (u *GroupUpsertOne) SetModelRoutingEnabled(v bool) *GroupUpsertOne {
  3558. return u.Update(func(s *GroupUpsert) {
  3559. s.SetModelRoutingEnabled(v)
  3560. })
  3561. }
  3562. // UpdateModelRoutingEnabled sets the "model_routing_enabled" field to the value that was provided on create.
  3563. func (u *GroupUpsertOne) UpdateModelRoutingEnabled() *GroupUpsertOne {
  3564. return u.Update(func(s *GroupUpsert) {
  3565. s.UpdateModelRoutingEnabled()
  3566. })
  3567. }
  3568. // SetMcpXMLInject sets the "mcp_xml_inject" field.
  3569. func (u *GroupUpsertOne) SetMcpXMLInject(v bool) *GroupUpsertOne {
  3570. return u.Update(func(s *GroupUpsert) {
  3571. s.SetMcpXMLInject(v)
  3572. })
  3573. }
  3574. // UpdateMcpXMLInject sets the "mcp_xml_inject" field to the value that was provided on create.
  3575. func (u *GroupUpsertOne) UpdateMcpXMLInject() *GroupUpsertOne {
  3576. return u.Update(func(s *GroupUpsert) {
  3577. s.UpdateMcpXMLInject()
  3578. })
  3579. }
  3580. // SetSupportedModelScopes sets the "supported_model_scopes" field.
  3581. func (u *GroupUpsertOne) SetSupportedModelScopes(v []string) *GroupUpsertOne {
  3582. return u.Update(func(s *GroupUpsert) {
  3583. s.SetSupportedModelScopes(v)
  3584. })
  3585. }
  3586. // UpdateSupportedModelScopes sets the "supported_model_scopes" field to the value that was provided on create.
  3587. func (u *GroupUpsertOne) UpdateSupportedModelScopes() *GroupUpsertOne {
  3588. return u.Update(func(s *GroupUpsert) {
  3589. s.UpdateSupportedModelScopes()
  3590. })
  3591. }
  3592. // SetSortOrder sets the "sort_order" field.
  3593. func (u *GroupUpsertOne) SetSortOrder(v int) *GroupUpsertOne {
  3594. return u.Update(func(s *GroupUpsert) {
  3595. s.SetSortOrder(v)
  3596. })
  3597. }
  3598. // AddSortOrder adds v to the "sort_order" field.
  3599. func (u *GroupUpsertOne) AddSortOrder(v int) *GroupUpsertOne {
  3600. return u.Update(func(s *GroupUpsert) {
  3601. s.AddSortOrder(v)
  3602. })
  3603. }
  3604. // UpdateSortOrder sets the "sort_order" field to the value that was provided on create.
  3605. func (u *GroupUpsertOne) UpdateSortOrder() *GroupUpsertOne {
  3606. return u.Update(func(s *GroupUpsert) {
  3607. s.UpdateSortOrder()
  3608. })
  3609. }
  3610. // SetAllowMessagesDispatch sets the "allow_messages_dispatch" field.
  3611. func (u *GroupUpsertOne) SetAllowMessagesDispatch(v bool) *GroupUpsertOne {
  3612. return u.Update(func(s *GroupUpsert) {
  3613. s.SetAllowMessagesDispatch(v)
  3614. })
  3615. }
  3616. // UpdateAllowMessagesDispatch sets the "allow_messages_dispatch" field to the value that was provided on create.
  3617. func (u *GroupUpsertOne) UpdateAllowMessagesDispatch() *GroupUpsertOne {
  3618. return u.Update(func(s *GroupUpsert) {
  3619. s.UpdateAllowMessagesDispatch()
  3620. })
  3621. }
  3622. // SetAllowLive sets the "allow_live" field.
  3623. func (u *GroupUpsertOne) SetAllowLive(v bool) *GroupUpsertOne {
  3624. return u.Update(func(s *GroupUpsert) {
  3625. s.SetAllowLive(v)
  3626. })
  3627. }
  3628. // UpdateAllowLive sets the "allow_live" field to the value that was provided on create.
  3629. func (u *GroupUpsertOne) UpdateAllowLive() *GroupUpsertOne {
  3630. return u.Update(func(s *GroupUpsert) {
  3631. s.UpdateAllowLive()
  3632. })
  3633. }
  3634. // SetForceOpenaiFast sets the "force_openai_fast" field.
  3635. func (u *GroupUpsertOne) SetForceOpenaiFast(v bool) *GroupUpsertOne {
  3636. return u.Update(func(s *GroupUpsert) {
  3637. s.SetForceOpenaiFast(v)
  3638. })
  3639. }
  3640. // UpdateForceOpenaiFast sets the "force_openai_fast" field to the value that was provided on create.
  3641. func (u *GroupUpsertOne) UpdateForceOpenaiFast() *GroupUpsertOne {
  3642. return u.Update(func(s *GroupUpsert) {
  3643. s.UpdateForceOpenaiFast()
  3644. })
  3645. }
  3646. // SetFreeOpenaiFast sets the "free_openai_fast" field.
  3647. func (u *GroupUpsertOne) SetFreeOpenaiFast(v bool) *GroupUpsertOne {
  3648. return u.Update(func(s *GroupUpsert) {
  3649. s.SetFreeOpenaiFast(v)
  3650. })
  3651. }
  3652. // UpdateFreeOpenaiFast sets the "free_openai_fast" field to the value that was provided on create.
  3653. func (u *GroupUpsertOne) UpdateFreeOpenaiFast() *GroupUpsertOne {
  3654. return u.Update(func(s *GroupUpsert) {
  3655. s.UpdateFreeOpenaiFast()
  3656. })
  3657. }
  3658. // SetRequireOauthOnly sets the "require_oauth_only" field.
  3659. func (u *GroupUpsertOne) SetRequireOauthOnly(v bool) *GroupUpsertOne {
  3660. return u.Update(func(s *GroupUpsert) {
  3661. s.SetRequireOauthOnly(v)
  3662. })
  3663. }
  3664. // UpdateRequireOauthOnly sets the "require_oauth_only" field to the value that was provided on create.
  3665. func (u *GroupUpsertOne) UpdateRequireOauthOnly() *GroupUpsertOne {
  3666. return u.Update(func(s *GroupUpsert) {
  3667. s.UpdateRequireOauthOnly()
  3668. })
  3669. }
  3670. // SetRequirePrivacySet sets the "require_privacy_set" field.
  3671. func (u *GroupUpsertOne) SetRequirePrivacySet(v bool) *GroupUpsertOne {
  3672. return u.Update(func(s *GroupUpsert) {
  3673. s.SetRequirePrivacySet(v)
  3674. })
  3675. }
  3676. // UpdateRequirePrivacySet sets the "require_privacy_set" field to the value that was provided on create.
  3677. func (u *GroupUpsertOne) UpdateRequirePrivacySet() *GroupUpsertOne {
  3678. return u.Update(func(s *GroupUpsert) {
  3679. s.UpdateRequirePrivacySet()
  3680. })
  3681. }
  3682. // SetDefaultMappedModel sets the "default_mapped_model" field.
  3683. func (u *GroupUpsertOne) SetDefaultMappedModel(v string) *GroupUpsertOne {
  3684. return u.Update(func(s *GroupUpsert) {
  3685. s.SetDefaultMappedModel(v)
  3686. })
  3687. }
  3688. // UpdateDefaultMappedModel sets the "default_mapped_model" field to the value that was provided on create.
  3689. func (u *GroupUpsertOne) UpdateDefaultMappedModel() *GroupUpsertOne {
  3690. return u.Update(func(s *GroupUpsert) {
  3691. s.UpdateDefaultMappedModel()
  3692. })
  3693. }
  3694. // SetMessagesDispatchModelConfig sets the "messages_dispatch_model_config" field.
  3695. func (u *GroupUpsertOne) SetMessagesDispatchModelConfig(v domain.OpenAIMessagesDispatchModelConfig) *GroupUpsertOne {
  3696. return u.Update(func(s *GroupUpsert) {
  3697. s.SetMessagesDispatchModelConfig(v)
  3698. })
  3699. }
  3700. // UpdateMessagesDispatchModelConfig sets the "messages_dispatch_model_config" field to the value that was provided on create.
  3701. func (u *GroupUpsertOne) UpdateMessagesDispatchModelConfig() *GroupUpsertOne {
  3702. return u.Update(func(s *GroupUpsert) {
  3703. s.UpdateMessagesDispatchModelConfig()
  3704. })
  3705. }
  3706. // SetModelAllowlist sets the "model_allowlist" field.
  3707. func (u *GroupUpsertOne) SetModelAllowlist(v domain.GroupModelAllowlist) *GroupUpsertOne {
  3708. return u.Update(func(s *GroupUpsert) {
  3709. s.SetModelAllowlist(v)
  3710. })
  3711. }
  3712. // UpdateModelAllowlist sets the "model_allowlist" field to the value that was provided on create.
  3713. func (u *GroupUpsertOne) UpdateModelAllowlist() *GroupUpsertOne {
  3714. return u.Update(func(s *GroupUpsert) {
  3715. s.UpdateModelAllowlist()
  3716. })
  3717. }
  3718. // SetCodexModelsManifestConfig sets the "codex_models_manifest_config" field.
  3719. func (u *GroupUpsertOne) SetCodexModelsManifestConfig(v domain.GroupCodexModelsManifestConfig) *GroupUpsertOne {
  3720. return u.Update(func(s *GroupUpsert) {
  3721. s.SetCodexModelsManifestConfig(v)
  3722. })
  3723. }
  3724. // UpdateCodexModelsManifestConfig sets the "codex_models_manifest_config" field to the value that was provided on create.
  3725. func (u *GroupUpsertOne) UpdateCodexModelsManifestConfig() *GroupUpsertOne {
  3726. return u.Update(func(s *GroupUpsert) {
  3727. s.UpdateCodexModelsManifestConfig()
  3728. })
  3729. }
  3730. // SetRpmLimit sets the "rpm_limit" field.
  3731. func (u *GroupUpsertOne) SetRpmLimit(v int) *GroupUpsertOne {
  3732. return u.Update(func(s *GroupUpsert) {
  3733. s.SetRpmLimit(v)
  3734. })
  3735. }
  3736. // AddRpmLimit adds v to the "rpm_limit" field.
  3737. func (u *GroupUpsertOne) AddRpmLimit(v int) *GroupUpsertOne {
  3738. return u.Update(func(s *GroupUpsert) {
  3739. s.AddRpmLimit(v)
  3740. })
  3741. }
  3742. // UpdateRpmLimit sets the "rpm_limit" field to the value that was provided on create.
  3743. func (u *GroupUpsertOne) UpdateRpmLimit() *GroupUpsertOne {
  3744. return u.Update(func(s *GroupUpsert) {
  3745. s.UpdateRpmLimit()
  3746. })
  3747. }
  3748. // SetMaxReasoningEffort sets the "max_reasoning_effort" field.
  3749. func (u *GroupUpsertOne) SetMaxReasoningEffort(v string) *GroupUpsertOne {
  3750. return u.Update(func(s *GroupUpsert) {
  3751. s.SetMaxReasoningEffort(v)
  3752. })
  3753. }
  3754. // UpdateMaxReasoningEffort sets the "max_reasoning_effort" field to the value that was provided on create.
  3755. func (u *GroupUpsertOne) UpdateMaxReasoningEffort() *GroupUpsertOne {
  3756. return u.Update(func(s *GroupUpsert) {
  3757. s.UpdateMaxReasoningEffort()
  3758. })
  3759. }
  3760. // SetMaxReasoningEffortOverLimit sets the "max_reasoning_effort_over_limit" field.
  3761. func (u *GroupUpsertOne) SetMaxReasoningEffortOverLimit(v string) *GroupUpsertOne {
  3762. return u.Update(func(s *GroupUpsert) {
  3763. s.SetMaxReasoningEffortOverLimit(v)
  3764. })
  3765. }
  3766. // UpdateMaxReasoningEffortOverLimit sets the "max_reasoning_effort_over_limit" field to the value that was provided on create.
  3767. func (u *GroupUpsertOne) UpdateMaxReasoningEffortOverLimit() *GroupUpsertOne {
  3768. return u.Update(func(s *GroupUpsert) {
  3769. s.UpdateMaxReasoningEffortOverLimit()
  3770. })
  3771. }
  3772. // SetReasoningEffortMappings sets the "reasoning_effort_mappings" field.
  3773. func (u *GroupUpsertOne) SetReasoningEffortMappings(v []domain.ReasoningEffortMapping) *GroupUpsertOne {
  3774. return u.Update(func(s *GroupUpsert) {
  3775. s.SetReasoningEffortMappings(v)
  3776. })
  3777. }
  3778. // UpdateReasoningEffortMappings sets the "reasoning_effort_mappings" field to the value that was provided on create.
  3779. func (u *GroupUpsertOne) UpdateReasoningEffortMappings() *GroupUpsertOne {
  3780. return u.Update(func(s *GroupUpsert) {
  3781. s.UpdateReasoningEffortMappings()
  3782. })
  3783. }
  3784. // SetProfitControlEnabled sets the "profit_control_enabled" field.
  3785. func (u *GroupUpsertOne) SetProfitControlEnabled(v bool) *GroupUpsertOne {
  3786. return u.Update(func(s *GroupUpsert) {
  3787. s.SetProfitControlEnabled(v)
  3788. })
  3789. }
  3790. // UpdateProfitControlEnabled sets the "profit_control_enabled" field to the value that was provided on create.
  3791. func (u *GroupUpsertOne) UpdateProfitControlEnabled() *GroupUpsertOne {
  3792. return u.Update(func(s *GroupUpsert) {
  3793. s.UpdateProfitControlEnabled()
  3794. })
  3795. }
  3796. // SetProfitMinMargin sets the "profit_min_margin" field.
  3797. func (u *GroupUpsertOne) SetProfitMinMargin(v float64) *GroupUpsertOne {
  3798. return u.Update(func(s *GroupUpsert) {
  3799. s.SetProfitMinMargin(v)
  3800. })
  3801. }
  3802. // AddProfitMinMargin adds v to the "profit_min_margin" field.
  3803. func (u *GroupUpsertOne) AddProfitMinMargin(v float64) *GroupUpsertOne {
  3804. return u.Update(func(s *GroupUpsert) {
  3805. s.AddProfitMinMargin(v)
  3806. })
  3807. }
  3808. // UpdateProfitMinMargin sets the "profit_min_margin" field to the value that was provided on create.
  3809. func (u *GroupUpsertOne) UpdateProfitMinMargin() *GroupUpsertOne {
  3810. return u.Update(func(s *GroupUpsert) {
  3811. s.UpdateProfitMinMargin()
  3812. })
  3813. }
  3814. // SetProfitSafetyBuffer sets the "profit_safety_buffer" field.
  3815. func (u *GroupUpsertOne) SetProfitSafetyBuffer(v float64) *GroupUpsertOne {
  3816. return u.Update(func(s *GroupUpsert) {
  3817. s.SetProfitSafetyBuffer(v)
  3818. })
  3819. }
  3820. // AddProfitSafetyBuffer adds v to the "profit_safety_buffer" field.
  3821. func (u *GroupUpsertOne) AddProfitSafetyBuffer(v float64) *GroupUpsertOne {
  3822. return u.Update(func(s *GroupUpsert) {
  3823. s.AddProfitSafetyBuffer(v)
  3824. })
  3825. }
  3826. // UpdateProfitSafetyBuffer sets the "profit_safety_buffer" field to the value that was provided on create.
  3827. func (u *GroupUpsertOne) UpdateProfitSafetyBuffer() *GroupUpsertOne {
  3828. return u.Update(func(s *GroupUpsert) {
  3829. s.UpdateProfitSafetyBuffer()
  3830. })
  3831. }
  3832. // Exec executes the query.
  3833. func (u *GroupUpsertOne) Exec(ctx context.Context) error {
  3834. if len(u.create.conflict) == 0 {
  3835. return errors.New("ent: missing options for GroupCreate.OnConflict")
  3836. }
  3837. return u.create.Exec(ctx)
  3838. }
  3839. // ExecX is like Exec, but panics if an error occurs.
  3840. func (u *GroupUpsertOne) ExecX(ctx context.Context) {
  3841. if err := u.create.Exec(ctx); err != nil {
  3842. panic(err)
  3843. }
  3844. }
  3845. // Exec executes the UPSERT query and returns the inserted/updated ID.
  3846. func (u *GroupUpsertOne) ID(ctx context.Context) (id int64, err error) {
  3847. node, err := u.create.Save(ctx)
  3848. if err != nil {
  3849. return id, err
  3850. }
  3851. return node.ID, nil
  3852. }
  3853. // IDX is like ID, but panics if an error occurs.
  3854. func (u *GroupUpsertOne) IDX(ctx context.Context) int64 {
  3855. id, err := u.ID(ctx)
  3856. if err != nil {
  3857. panic(err)
  3858. }
  3859. return id
  3860. }
  3861. // GroupCreateBulk is the builder for creating many Group entities in bulk.
  3862. type GroupCreateBulk struct {
  3863. config
  3864. err error
  3865. builders []*GroupCreate
  3866. conflict []sql.ConflictOption
  3867. }
  3868. // Save creates the Group entities in the database.
  3869. func (_c *GroupCreateBulk) Save(ctx context.Context) ([]*Group, error) {
  3870. if _c.err != nil {
  3871. return nil, _c.err
  3872. }
  3873. specs := make([]*sqlgraph.CreateSpec, len(_c.builders))
  3874. nodes := make([]*Group, len(_c.builders))
  3875. mutators := make([]Mutator, len(_c.builders))
  3876. for i := range _c.builders {
  3877. func(i int, root context.Context) {
  3878. builder := _c.builders[i]
  3879. builder.defaults()
  3880. var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
  3881. mutation, ok := m.(*GroupMutation)
  3882. if !ok {
  3883. return nil, fmt.Errorf("unexpected mutation type %T", m)
  3884. }
  3885. if err := builder.check(); err != nil {
  3886. return nil, err
  3887. }
  3888. builder.mutation = mutation
  3889. var err error
  3890. nodes[i], specs[i] = builder.createSpec()
  3891. if i < len(mutators)-1 {
  3892. _, err = mutators[i+1].Mutate(root, _c.builders[i+1].mutation)
  3893. } else {
  3894. spec := &sqlgraph.BatchCreateSpec{Nodes: specs}
  3895. spec.OnConflict = _c.conflict
  3896. // Invoke the actual operation on the latest mutation in the chain.
  3897. if err = sqlgraph.BatchCreate(ctx, _c.driver, spec); err != nil {
  3898. if sqlgraph.IsConstraintError(err) {
  3899. err = &ConstraintError{msg: err.Error(), wrap: err}
  3900. }
  3901. }
  3902. }
  3903. if err != nil {
  3904. return nil, err
  3905. }
  3906. mutation.id = &nodes[i].ID
  3907. if specs[i].ID.Value != nil {
  3908. id := specs[i].ID.Value.(int64)
  3909. nodes[i].ID = int64(id)
  3910. }
  3911. mutation.done = true
  3912. return nodes[i], nil
  3913. })
  3914. for i := len(builder.hooks) - 1; i >= 0; i-- {
  3915. mut = builder.hooks[i](mut)
  3916. }
  3917. mutators[i] = mut
  3918. }(i, ctx)
  3919. }
  3920. if len(mutators) > 0 {
  3921. if _, err := mutators[0].Mutate(ctx, _c.builders[0].mutation); err != nil {
  3922. return nil, err
  3923. }
  3924. }
  3925. return nodes, nil
  3926. }
  3927. // SaveX is like Save, but panics if an error occurs.
  3928. func (_c *GroupCreateBulk) SaveX(ctx context.Context) []*Group {
  3929. v, err := _c.Save(ctx)
  3930. if err != nil {
  3931. panic(err)
  3932. }
  3933. return v
  3934. }
  3935. // Exec executes the query.
  3936. func (_c *GroupCreateBulk) Exec(ctx context.Context) error {
  3937. _, err := _c.Save(ctx)
  3938. return err
  3939. }
  3940. // ExecX is like Exec, but panics if an error occurs.
  3941. func (_c *GroupCreateBulk) ExecX(ctx context.Context) {
  3942. if err := _c.Exec(ctx); err != nil {
  3943. panic(err)
  3944. }
  3945. }
  3946. // OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
  3947. // of the `INSERT` statement. For example:
  3948. //
  3949. // client.Group.CreateBulk(builders...).
  3950. // OnConflict(
  3951. // // Update the row with the new values
  3952. // // the was proposed for insertion.
  3953. // sql.ResolveWithNewValues(),
  3954. // ).
  3955. // // Override some of the fields with custom
  3956. // // update values.
  3957. // Update(func(u *ent.GroupUpsert) {
  3958. // SetCreatedAt(v+v).
  3959. // }).
  3960. // Exec(ctx)
  3961. func (_c *GroupCreateBulk) OnConflict(opts ...sql.ConflictOption) *GroupUpsertBulk {
  3962. _c.conflict = opts
  3963. return &GroupUpsertBulk{
  3964. create: _c,
  3965. }
  3966. }
  3967. // OnConflictColumns calls `OnConflict` and configures the columns
  3968. // as conflict target. Using this option is equivalent to using:
  3969. //
  3970. // client.Group.Create().
  3971. // OnConflict(sql.ConflictColumns(columns...)).
  3972. // Exec(ctx)
  3973. func (_c *GroupCreateBulk) OnConflictColumns(columns ...string) *GroupUpsertBulk {
  3974. _c.conflict = append(_c.conflict, sql.ConflictColumns(columns...))
  3975. return &GroupUpsertBulk{
  3976. create: _c,
  3977. }
  3978. }
  3979. // GroupUpsertBulk is the builder for "upsert"-ing
  3980. // a bulk of Group nodes.
  3981. type GroupUpsertBulk struct {
  3982. create *GroupCreateBulk
  3983. }
  3984. // UpdateNewValues updates the mutable fields using the new values that
  3985. // were set on create. Using this option is equivalent to using:
  3986. //
  3987. // client.Group.Create().
  3988. // OnConflict(
  3989. // sql.ResolveWithNewValues(),
  3990. // ).
  3991. // Exec(ctx)
  3992. func (u *GroupUpsertBulk) UpdateNewValues() *GroupUpsertBulk {
  3993. u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues())
  3994. u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) {
  3995. for _, b := range u.create.builders {
  3996. if _, exists := b.mutation.CreatedAt(); exists {
  3997. s.SetIgnore(group.FieldCreatedAt)
  3998. }
  3999. if _, exists := b.mutation.DuplicateOperationID(); exists {
  4000. s.SetIgnore(group.FieldDuplicateOperationID)
  4001. }
  4002. }
  4003. }))
  4004. return u
  4005. }
  4006. // Ignore sets each column to itself in case of conflict.
  4007. // Using this option is equivalent to using:
  4008. //
  4009. // client.Group.Create().
  4010. // OnConflict(sql.ResolveWithIgnore()).
  4011. // Exec(ctx)
  4012. func (u *GroupUpsertBulk) Ignore() *GroupUpsertBulk {
  4013. u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore())
  4014. return u
  4015. }
  4016. // DoNothing configures the conflict_action to `DO NOTHING`.
  4017. // Supported only by SQLite and PostgreSQL.
  4018. func (u *GroupUpsertBulk) DoNothing() *GroupUpsertBulk {
  4019. u.create.conflict = append(u.create.conflict, sql.DoNothing())
  4020. return u
  4021. }
  4022. // Update allows overriding fields `UPDATE` values. See the GroupCreateBulk.OnConflict
  4023. // documentation for more info.
  4024. func (u *GroupUpsertBulk) Update(set func(*GroupUpsert)) *GroupUpsertBulk {
  4025. u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
  4026. set(&GroupUpsert{UpdateSet: update})
  4027. }))
  4028. return u
  4029. }
  4030. // SetUpdatedAt sets the "updated_at" field.
  4031. func (u *GroupUpsertBulk) SetUpdatedAt(v time.Time) *GroupUpsertBulk {
  4032. return u.Update(func(s *GroupUpsert) {
  4033. s.SetUpdatedAt(v)
  4034. })
  4035. }
  4036. // UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
  4037. func (u *GroupUpsertBulk) UpdateUpdatedAt() *GroupUpsertBulk {
  4038. return u.Update(func(s *GroupUpsert) {
  4039. s.UpdateUpdatedAt()
  4040. })
  4041. }
  4042. // SetDeletedAt sets the "deleted_at" field.
  4043. func (u *GroupUpsertBulk) SetDeletedAt(v time.Time) *GroupUpsertBulk {
  4044. return u.Update(func(s *GroupUpsert) {
  4045. s.SetDeletedAt(v)
  4046. })
  4047. }
  4048. // UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
  4049. func (u *GroupUpsertBulk) UpdateDeletedAt() *GroupUpsertBulk {
  4050. return u.Update(func(s *GroupUpsert) {
  4051. s.UpdateDeletedAt()
  4052. })
  4053. }
  4054. // ClearDeletedAt clears the value of the "deleted_at" field.
  4055. func (u *GroupUpsertBulk) ClearDeletedAt() *GroupUpsertBulk {
  4056. return u.Update(func(s *GroupUpsert) {
  4057. s.ClearDeletedAt()
  4058. })
  4059. }
  4060. // SetName sets the "name" field.
  4061. func (u *GroupUpsertBulk) SetName(v string) *GroupUpsertBulk {
  4062. return u.Update(func(s *GroupUpsert) {
  4063. s.SetName(v)
  4064. })
  4065. }
  4066. // UpdateName sets the "name" field to the value that was provided on create.
  4067. func (u *GroupUpsertBulk) UpdateName() *GroupUpsertBulk {
  4068. return u.Update(func(s *GroupUpsert) {
  4069. s.UpdateName()
  4070. })
  4071. }
  4072. // SetDescription sets the "description" field.
  4073. func (u *GroupUpsertBulk) SetDescription(v string) *GroupUpsertBulk {
  4074. return u.Update(func(s *GroupUpsert) {
  4075. s.SetDescription(v)
  4076. })
  4077. }
  4078. // UpdateDescription sets the "description" field to the value that was provided on create.
  4079. func (u *GroupUpsertBulk) UpdateDescription() *GroupUpsertBulk {
  4080. return u.Update(func(s *GroupUpsert) {
  4081. s.UpdateDescription()
  4082. })
  4083. }
  4084. // ClearDescription clears the value of the "description" field.
  4085. func (u *GroupUpsertBulk) ClearDescription() *GroupUpsertBulk {
  4086. return u.Update(func(s *GroupUpsert) {
  4087. s.ClearDescription()
  4088. })
  4089. }
  4090. // SetRateMultiplier sets the "rate_multiplier" field.
  4091. func (u *GroupUpsertBulk) SetRateMultiplier(v float64) *GroupUpsertBulk {
  4092. return u.Update(func(s *GroupUpsert) {
  4093. s.SetRateMultiplier(v)
  4094. })
  4095. }
  4096. // AddRateMultiplier adds v to the "rate_multiplier" field.
  4097. func (u *GroupUpsertBulk) AddRateMultiplier(v float64) *GroupUpsertBulk {
  4098. return u.Update(func(s *GroupUpsert) {
  4099. s.AddRateMultiplier(v)
  4100. })
  4101. }
  4102. // UpdateRateMultiplier sets the "rate_multiplier" field to the value that was provided on create.
  4103. func (u *GroupUpsertBulk) UpdateRateMultiplier() *GroupUpsertBulk {
  4104. return u.Update(func(s *GroupUpsert) {
  4105. s.UpdateRateMultiplier()
  4106. })
  4107. }
  4108. // SetPeakRateEnabled sets the "peak_rate_enabled" field.
  4109. func (u *GroupUpsertBulk) SetPeakRateEnabled(v bool) *GroupUpsertBulk {
  4110. return u.Update(func(s *GroupUpsert) {
  4111. s.SetPeakRateEnabled(v)
  4112. })
  4113. }
  4114. // UpdatePeakRateEnabled sets the "peak_rate_enabled" field to the value that was provided on create.
  4115. func (u *GroupUpsertBulk) UpdatePeakRateEnabled() *GroupUpsertBulk {
  4116. return u.Update(func(s *GroupUpsert) {
  4117. s.UpdatePeakRateEnabled()
  4118. })
  4119. }
  4120. // SetPeakStart sets the "peak_start" field.
  4121. func (u *GroupUpsertBulk) SetPeakStart(v string) *GroupUpsertBulk {
  4122. return u.Update(func(s *GroupUpsert) {
  4123. s.SetPeakStart(v)
  4124. })
  4125. }
  4126. // UpdatePeakStart sets the "peak_start" field to the value that was provided on create.
  4127. func (u *GroupUpsertBulk) UpdatePeakStart() *GroupUpsertBulk {
  4128. return u.Update(func(s *GroupUpsert) {
  4129. s.UpdatePeakStart()
  4130. })
  4131. }
  4132. // SetPeakEnd sets the "peak_end" field.
  4133. func (u *GroupUpsertBulk) SetPeakEnd(v string) *GroupUpsertBulk {
  4134. return u.Update(func(s *GroupUpsert) {
  4135. s.SetPeakEnd(v)
  4136. })
  4137. }
  4138. // UpdatePeakEnd sets the "peak_end" field to the value that was provided on create.
  4139. func (u *GroupUpsertBulk) UpdatePeakEnd() *GroupUpsertBulk {
  4140. return u.Update(func(s *GroupUpsert) {
  4141. s.UpdatePeakEnd()
  4142. })
  4143. }
  4144. // SetPeakRateMultiplier sets the "peak_rate_multiplier" field.
  4145. func (u *GroupUpsertBulk) SetPeakRateMultiplier(v float64) *GroupUpsertBulk {
  4146. return u.Update(func(s *GroupUpsert) {
  4147. s.SetPeakRateMultiplier(v)
  4148. })
  4149. }
  4150. // AddPeakRateMultiplier adds v to the "peak_rate_multiplier" field.
  4151. func (u *GroupUpsertBulk) AddPeakRateMultiplier(v float64) *GroupUpsertBulk {
  4152. return u.Update(func(s *GroupUpsert) {
  4153. s.AddPeakRateMultiplier(v)
  4154. })
  4155. }
  4156. // UpdatePeakRateMultiplier sets the "peak_rate_multiplier" field to the value that was provided on create.
  4157. func (u *GroupUpsertBulk) UpdatePeakRateMultiplier() *GroupUpsertBulk {
  4158. return u.Update(func(s *GroupUpsert) {
  4159. s.UpdatePeakRateMultiplier()
  4160. })
  4161. }
  4162. // SetIsExclusive sets the "is_exclusive" field.
  4163. func (u *GroupUpsertBulk) SetIsExclusive(v bool) *GroupUpsertBulk {
  4164. return u.Update(func(s *GroupUpsert) {
  4165. s.SetIsExclusive(v)
  4166. })
  4167. }
  4168. // UpdateIsExclusive sets the "is_exclusive" field to the value that was provided on create.
  4169. func (u *GroupUpsertBulk) UpdateIsExclusive() *GroupUpsertBulk {
  4170. return u.Update(func(s *GroupUpsert) {
  4171. s.UpdateIsExclusive()
  4172. })
  4173. }
  4174. // SetSecurityPolicyEnabled sets the "security_policy_enabled" field.
  4175. func (u *GroupUpsertBulk) SetSecurityPolicyEnabled(v bool) *GroupUpsertBulk {
  4176. return u.Update(func(s *GroupUpsert) {
  4177. s.SetSecurityPolicyEnabled(v)
  4178. })
  4179. }
  4180. // UpdateSecurityPolicyEnabled sets the "security_policy_enabled" field to the value that was provided on create.
  4181. func (u *GroupUpsertBulk) UpdateSecurityPolicyEnabled() *GroupUpsertBulk {
  4182. return u.Update(func(s *GroupUpsert) {
  4183. s.UpdateSecurityPolicyEnabled()
  4184. })
  4185. }
  4186. // SetSecurityPolicyMode sets the "security_policy_mode" field.
  4187. func (u *GroupUpsertBulk) SetSecurityPolicyMode(v string) *GroupUpsertBulk {
  4188. return u.Update(func(s *GroupUpsert) {
  4189. s.SetSecurityPolicyMode(v)
  4190. })
  4191. }
  4192. // UpdateSecurityPolicyMode sets the "security_policy_mode" field to the value that was provided on create.
  4193. func (u *GroupUpsertBulk) UpdateSecurityPolicyMode() *GroupUpsertBulk {
  4194. return u.Update(func(s *GroupUpsert) {
  4195. s.UpdateSecurityPolicyMode()
  4196. })
  4197. }
  4198. // SetSecurityPolicyEmailEnabled sets the "security_policy_email_enabled" field.
  4199. func (u *GroupUpsertBulk) SetSecurityPolicyEmailEnabled(v bool) *GroupUpsertBulk {
  4200. return u.Update(func(s *GroupUpsert) {
  4201. s.SetSecurityPolicyEmailEnabled(v)
  4202. })
  4203. }
  4204. // UpdateSecurityPolicyEmailEnabled sets the "security_policy_email_enabled" field to the value that was provided on create.
  4205. func (u *GroupUpsertBulk) UpdateSecurityPolicyEmailEnabled() *GroupUpsertBulk {
  4206. return u.Update(func(s *GroupUpsert) {
  4207. s.UpdateSecurityPolicyEmailEnabled()
  4208. })
  4209. }
  4210. // SetStatus sets the "status" field.
  4211. func (u *GroupUpsertBulk) SetStatus(v string) *GroupUpsertBulk {
  4212. return u.Update(func(s *GroupUpsert) {
  4213. s.SetStatus(v)
  4214. })
  4215. }
  4216. // UpdateStatus sets the "status" field to the value that was provided on create.
  4217. func (u *GroupUpsertBulk) UpdateStatus() *GroupUpsertBulk {
  4218. return u.Update(func(s *GroupUpsert) {
  4219. s.UpdateStatus()
  4220. })
  4221. }
  4222. // SetPlatform sets the "platform" field.
  4223. func (u *GroupUpsertBulk) SetPlatform(v string) *GroupUpsertBulk {
  4224. return u.Update(func(s *GroupUpsert) {
  4225. s.SetPlatform(v)
  4226. })
  4227. }
  4228. // UpdatePlatform sets the "platform" field to the value that was provided on create.
  4229. func (u *GroupUpsertBulk) UpdatePlatform() *GroupUpsertBulk {
  4230. return u.Update(func(s *GroupUpsert) {
  4231. s.UpdatePlatform()
  4232. })
  4233. }
  4234. // SetSubscriptionType sets the "subscription_type" field.
  4235. func (u *GroupUpsertBulk) SetSubscriptionType(v string) *GroupUpsertBulk {
  4236. return u.Update(func(s *GroupUpsert) {
  4237. s.SetSubscriptionType(v)
  4238. })
  4239. }
  4240. // UpdateSubscriptionType sets the "subscription_type" field to the value that was provided on create.
  4241. func (u *GroupUpsertBulk) UpdateSubscriptionType() *GroupUpsertBulk {
  4242. return u.Update(func(s *GroupUpsert) {
  4243. s.UpdateSubscriptionType()
  4244. })
  4245. }
  4246. // SetDailyLimitUsd sets the "daily_limit_usd" field.
  4247. func (u *GroupUpsertBulk) SetDailyLimitUsd(v float64) *GroupUpsertBulk {
  4248. return u.Update(func(s *GroupUpsert) {
  4249. s.SetDailyLimitUsd(v)
  4250. })
  4251. }
  4252. // AddDailyLimitUsd adds v to the "daily_limit_usd" field.
  4253. func (u *GroupUpsertBulk) AddDailyLimitUsd(v float64) *GroupUpsertBulk {
  4254. return u.Update(func(s *GroupUpsert) {
  4255. s.AddDailyLimitUsd(v)
  4256. })
  4257. }
  4258. // UpdateDailyLimitUsd sets the "daily_limit_usd" field to the value that was provided on create.
  4259. func (u *GroupUpsertBulk) UpdateDailyLimitUsd() *GroupUpsertBulk {
  4260. return u.Update(func(s *GroupUpsert) {
  4261. s.UpdateDailyLimitUsd()
  4262. })
  4263. }
  4264. // ClearDailyLimitUsd clears the value of the "daily_limit_usd" field.
  4265. func (u *GroupUpsertBulk) ClearDailyLimitUsd() *GroupUpsertBulk {
  4266. return u.Update(func(s *GroupUpsert) {
  4267. s.ClearDailyLimitUsd()
  4268. })
  4269. }
  4270. // SetWeeklyLimitUsd sets the "weekly_limit_usd" field.
  4271. func (u *GroupUpsertBulk) SetWeeklyLimitUsd(v float64) *GroupUpsertBulk {
  4272. return u.Update(func(s *GroupUpsert) {
  4273. s.SetWeeklyLimitUsd(v)
  4274. })
  4275. }
  4276. // AddWeeklyLimitUsd adds v to the "weekly_limit_usd" field.
  4277. func (u *GroupUpsertBulk) AddWeeklyLimitUsd(v float64) *GroupUpsertBulk {
  4278. return u.Update(func(s *GroupUpsert) {
  4279. s.AddWeeklyLimitUsd(v)
  4280. })
  4281. }
  4282. // UpdateWeeklyLimitUsd sets the "weekly_limit_usd" field to the value that was provided on create.
  4283. func (u *GroupUpsertBulk) UpdateWeeklyLimitUsd() *GroupUpsertBulk {
  4284. return u.Update(func(s *GroupUpsert) {
  4285. s.UpdateWeeklyLimitUsd()
  4286. })
  4287. }
  4288. // ClearWeeklyLimitUsd clears the value of the "weekly_limit_usd" field.
  4289. func (u *GroupUpsertBulk) ClearWeeklyLimitUsd() *GroupUpsertBulk {
  4290. return u.Update(func(s *GroupUpsert) {
  4291. s.ClearWeeklyLimitUsd()
  4292. })
  4293. }
  4294. // SetMonthlyLimitUsd sets the "monthly_limit_usd" field.
  4295. func (u *GroupUpsertBulk) SetMonthlyLimitUsd(v float64) *GroupUpsertBulk {
  4296. return u.Update(func(s *GroupUpsert) {
  4297. s.SetMonthlyLimitUsd(v)
  4298. })
  4299. }
  4300. // AddMonthlyLimitUsd adds v to the "monthly_limit_usd" field.
  4301. func (u *GroupUpsertBulk) AddMonthlyLimitUsd(v float64) *GroupUpsertBulk {
  4302. return u.Update(func(s *GroupUpsert) {
  4303. s.AddMonthlyLimitUsd(v)
  4304. })
  4305. }
  4306. // UpdateMonthlyLimitUsd sets the "monthly_limit_usd" field to the value that was provided on create.
  4307. func (u *GroupUpsertBulk) UpdateMonthlyLimitUsd() *GroupUpsertBulk {
  4308. return u.Update(func(s *GroupUpsert) {
  4309. s.UpdateMonthlyLimitUsd()
  4310. })
  4311. }
  4312. // ClearMonthlyLimitUsd clears the value of the "monthly_limit_usd" field.
  4313. func (u *GroupUpsertBulk) ClearMonthlyLimitUsd() *GroupUpsertBulk {
  4314. return u.Update(func(s *GroupUpsert) {
  4315. s.ClearMonthlyLimitUsd()
  4316. })
  4317. }
  4318. // SetDefaultValidityDays sets the "default_validity_days" field.
  4319. func (u *GroupUpsertBulk) SetDefaultValidityDays(v int) *GroupUpsertBulk {
  4320. return u.Update(func(s *GroupUpsert) {
  4321. s.SetDefaultValidityDays(v)
  4322. })
  4323. }
  4324. // AddDefaultValidityDays adds v to the "default_validity_days" field.
  4325. func (u *GroupUpsertBulk) AddDefaultValidityDays(v int) *GroupUpsertBulk {
  4326. return u.Update(func(s *GroupUpsert) {
  4327. s.AddDefaultValidityDays(v)
  4328. })
  4329. }
  4330. // UpdateDefaultValidityDays sets the "default_validity_days" field to the value that was provided on create.
  4331. func (u *GroupUpsertBulk) UpdateDefaultValidityDays() *GroupUpsertBulk {
  4332. return u.Update(func(s *GroupUpsert) {
  4333. s.UpdateDefaultValidityDays()
  4334. })
  4335. }
  4336. // SetAllowImageGeneration sets the "allow_image_generation" field.
  4337. func (u *GroupUpsertBulk) SetAllowImageGeneration(v bool) *GroupUpsertBulk {
  4338. return u.Update(func(s *GroupUpsert) {
  4339. s.SetAllowImageGeneration(v)
  4340. })
  4341. }
  4342. // UpdateAllowImageGeneration sets the "allow_image_generation" field to the value that was provided on create.
  4343. func (u *GroupUpsertBulk) UpdateAllowImageGeneration() *GroupUpsertBulk {
  4344. return u.Update(func(s *GroupUpsert) {
  4345. s.UpdateAllowImageGeneration()
  4346. })
  4347. }
  4348. // SetAllowBatchImageGeneration sets the "allow_batch_image_generation" field.
  4349. func (u *GroupUpsertBulk) SetAllowBatchImageGeneration(v bool) *GroupUpsertBulk {
  4350. return u.Update(func(s *GroupUpsert) {
  4351. s.SetAllowBatchImageGeneration(v)
  4352. })
  4353. }
  4354. // UpdateAllowBatchImageGeneration sets the "allow_batch_image_generation" field to the value that was provided on create.
  4355. func (u *GroupUpsertBulk) UpdateAllowBatchImageGeneration() *GroupUpsertBulk {
  4356. return u.Update(func(s *GroupUpsert) {
  4357. s.UpdateAllowBatchImageGeneration()
  4358. })
  4359. }
  4360. // SetImageRateIndependent sets the "image_rate_independent" field.
  4361. func (u *GroupUpsertBulk) SetImageRateIndependent(v bool) *GroupUpsertBulk {
  4362. return u.Update(func(s *GroupUpsert) {
  4363. s.SetImageRateIndependent(v)
  4364. })
  4365. }
  4366. // UpdateImageRateIndependent sets the "image_rate_independent" field to the value that was provided on create.
  4367. func (u *GroupUpsertBulk) UpdateImageRateIndependent() *GroupUpsertBulk {
  4368. return u.Update(func(s *GroupUpsert) {
  4369. s.UpdateImageRateIndependent()
  4370. })
  4371. }
  4372. // SetImageRateMultiplier sets the "image_rate_multiplier" field.
  4373. func (u *GroupUpsertBulk) SetImageRateMultiplier(v float64) *GroupUpsertBulk {
  4374. return u.Update(func(s *GroupUpsert) {
  4375. s.SetImageRateMultiplier(v)
  4376. })
  4377. }
  4378. // AddImageRateMultiplier adds v to the "image_rate_multiplier" field.
  4379. func (u *GroupUpsertBulk) AddImageRateMultiplier(v float64) *GroupUpsertBulk {
  4380. return u.Update(func(s *GroupUpsert) {
  4381. s.AddImageRateMultiplier(v)
  4382. })
  4383. }
  4384. // UpdateImageRateMultiplier sets the "image_rate_multiplier" field to the value that was provided on create.
  4385. func (u *GroupUpsertBulk) UpdateImageRateMultiplier() *GroupUpsertBulk {
  4386. return u.Update(func(s *GroupUpsert) {
  4387. s.UpdateImageRateMultiplier()
  4388. })
  4389. }
  4390. // SetImagePrice1k sets the "image_price_1k" field.
  4391. func (u *GroupUpsertBulk) SetImagePrice1k(v float64) *GroupUpsertBulk {
  4392. return u.Update(func(s *GroupUpsert) {
  4393. s.SetImagePrice1k(v)
  4394. })
  4395. }
  4396. // AddImagePrice1k adds v to the "image_price_1k" field.
  4397. func (u *GroupUpsertBulk) AddImagePrice1k(v float64) *GroupUpsertBulk {
  4398. return u.Update(func(s *GroupUpsert) {
  4399. s.AddImagePrice1k(v)
  4400. })
  4401. }
  4402. // UpdateImagePrice1k sets the "image_price_1k" field to the value that was provided on create.
  4403. func (u *GroupUpsertBulk) UpdateImagePrice1k() *GroupUpsertBulk {
  4404. return u.Update(func(s *GroupUpsert) {
  4405. s.UpdateImagePrice1k()
  4406. })
  4407. }
  4408. // ClearImagePrice1k clears the value of the "image_price_1k" field.
  4409. func (u *GroupUpsertBulk) ClearImagePrice1k() *GroupUpsertBulk {
  4410. return u.Update(func(s *GroupUpsert) {
  4411. s.ClearImagePrice1k()
  4412. })
  4413. }
  4414. // SetImagePrice2k sets the "image_price_2k" field.
  4415. func (u *GroupUpsertBulk) SetImagePrice2k(v float64) *GroupUpsertBulk {
  4416. return u.Update(func(s *GroupUpsert) {
  4417. s.SetImagePrice2k(v)
  4418. })
  4419. }
  4420. // AddImagePrice2k adds v to the "image_price_2k" field.
  4421. func (u *GroupUpsertBulk) AddImagePrice2k(v float64) *GroupUpsertBulk {
  4422. return u.Update(func(s *GroupUpsert) {
  4423. s.AddImagePrice2k(v)
  4424. })
  4425. }
  4426. // UpdateImagePrice2k sets the "image_price_2k" field to the value that was provided on create.
  4427. func (u *GroupUpsertBulk) UpdateImagePrice2k() *GroupUpsertBulk {
  4428. return u.Update(func(s *GroupUpsert) {
  4429. s.UpdateImagePrice2k()
  4430. })
  4431. }
  4432. // ClearImagePrice2k clears the value of the "image_price_2k" field.
  4433. func (u *GroupUpsertBulk) ClearImagePrice2k() *GroupUpsertBulk {
  4434. return u.Update(func(s *GroupUpsert) {
  4435. s.ClearImagePrice2k()
  4436. })
  4437. }
  4438. // SetImagePrice4k sets the "image_price_4k" field.
  4439. func (u *GroupUpsertBulk) SetImagePrice4k(v float64) *GroupUpsertBulk {
  4440. return u.Update(func(s *GroupUpsert) {
  4441. s.SetImagePrice4k(v)
  4442. })
  4443. }
  4444. // AddImagePrice4k adds v to the "image_price_4k" field.
  4445. func (u *GroupUpsertBulk) AddImagePrice4k(v float64) *GroupUpsertBulk {
  4446. return u.Update(func(s *GroupUpsert) {
  4447. s.AddImagePrice4k(v)
  4448. })
  4449. }
  4450. // UpdateImagePrice4k sets the "image_price_4k" field to the value that was provided on create.
  4451. func (u *GroupUpsertBulk) UpdateImagePrice4k() *GroupUpsertBulk {
  4452. return u.Update(func(s *GroupUpsert) {
  4453. s.UpdateImagePrice4k()
  4454. })
  4455. }
  4456. // ClearImagePrice4k clears the value of the "image_price_4k" field.
  4457. func (u *GroupUpsertBulk) ClearImagePrice4k() *GroupUpsertBulk {
  4458. return u.Update(func(s *GroupUpsert) {
  4459. s.ClearImagePrice4k()
  4460. })
  4461. }
  4462. // SetBatchImageDiscountMultiplier sets the "batch_image_discount_multiplier" field.
  4463. func (u *GroupUpsertBulk) SetBatchImageDiscountMultiplier(v float64) *GroupUpsertBulk {
  4464. return u.Update(func(s *GroupUpsert) {
  4465. s.SetBatchImageDiscountMultiplier(v)
  4466. })
  4467. }
  4468. // AddBatchImageDiscountMultiplier adds v to the "batch_image_discount_multiplier" field.
  4469. func (u *GroupUpsertBulk) AddBatchImageDiscountMultiplier(v float64) *GroupUpsertBulk {
  4470. return u.Update(func(s *GroupUpsert) {
  4471. s.AddBatchImageDiscountMultiplier(v)
  4472. })
  4473. }
  4474. // UpdateBatchImageDiscountMultiplier sets the "batch_image_discount_multiplier" field to the value that was provided on create.
  4475. func (u *GroupUpsertBulk) UpdateBatchImageDiscountMultiplier() *GroupUpsertBulk {
  4476. return u.Update(func(s *GroupUpsert) {
  4477. s.UpdateBatchImageDiscountMultiplier()
  4478. })
  4479. }
  4480. // SetBatchImageHoldMultiplier sets the "batch_image_hold_multiplier" field.
  4481. func (u *GroupUpsertBulk) SetBatchImageHoldMultiplier(v float64) *GroupUpsertBulk {
  4482. return u.Update(func(s *GroupUpsert) {
  4483. s.SetBatchImageHoldMultiplier(v)
  4484. })
  4485. }
  4486. // AddBatchImageHoldMultiplier adds v to the "batch_image_hold_multiplier" field.
  4487. func (u *GroupUpsertBulk) AddBatchImageHoldMultiplier(v float64) *GroupUpsertBulk {
  4488. return u.Update(func(s *GroupUpsert) {
  4489. s.AddBatchImageHoldMultiplier(v)
  4490. })
  4491. }
  4492. // UpdateBatchImageHoldMultiplier sets the "batch_image_hold_multiplier" field to the value that was provided on create.
  4493. func (u *GroupUpsertBulk) UpdateBatchImageHoldMultiplier() *GroupUpsertBulk {
  4494. return u.Update(func(s *GroupUpsert) {
  4495. s.UpdateBatchImageHoldMultiplier()
  4496. })
  4497. }
  4498. // SetVideoRateIndependent sets the "video_rate_independent" field.
  4499. func (u *GroupUpsertBulk) SetVideoRateIndependent(v bool) *GroupUpsertBulk {
  4500. return u.Update(func(s *GroupUpsert) {
  4501. s.SetVideoRateIndependent(v)
  4502. })
  4503. }
  4504. // UpdateVideoRateIndependent sets the "video_rate_independent" field to the value that was provided on create.
  4505. func (u *GroupUpsertBulk) UpdateVideoRateIndependent() *GroupUpsertBulk {
  4506. return u.Update(func(s *GroupUpsert) {
  4507. s.UpdateVideoRateIndependent()
  4508. })
  4509. }
  4510. // SetVideoRateMultiplier sets the "video_rate_multiplier" field.
  4511. func (u *GroupUpsertBulk) SetVideoRateMultiplier(v float64) *GroupUpsertBulk {
  4512. return u.Update(func(s *GroupUpsert) {
  4513. s.SetVideoRateMultiplier(v)
  4514. })
  4515. }
  4516. // AddVideoRateMultiplier adds v to the "video_rate_multiplier" field.
  4517. func (u *GroupUpsertBulk) AddVideoRateMultiplier(v float64) *GroupUpsertBulk {
  4518. return u.Update(func(s *GroupUpsert) {
  4519. s.AddVideoRateMultiplier(v)
  4520. })
  4521. }
  4522. // UpdateVideoRateMultiplier sets the "video_rate_multiplier" field to the value that was provided on create.
  4523. func (u *GroupUpsertBulk) UpdateVideoRateMultiplier() *GroupUpsertBulk {
  4524. return u.Update(func(s *GroupUpsert) {
  4525. s.UpdateVideoRateMultiplier()
  4526. })
  4527. }
  4528. // SetVideoPrice480p sets the "video_price_480p" field.
  4529. func (u *GroupUpsertBulk) SetVideoPrice480p(v float64) *GroupUpsertBulk {
  4530. return u.Update(func(s *GroupUpsert) {
  4531. s.SetVideoPrice480p(v)
  4532. })
  4533. }
  4534. // AddVideoPrice480p adds v to the "video_price_480p" field.
  4535. func (u *GroupUpsertBulk) AddVideoPrice480p(v float64) *GroupUpsertBulk {
  4536. return u.Update(func(s *GroupUpsert) {
  4537. s.AddVideoPrice480p(v)
  4538. })
  4539. }
  4540. // UpdateVideoPrice480p sets the "video_price_480p" field to the value that was provided on create.
  4541. func (u *GroupUpsertBulk) UpdateVideoPrice480p() *GroupUpsertBulk {
  4542. return u.Update(func(s *GroupUpsert) {
  4543. s.UpdateVideoPrice480p()
  4544. })
  4545. }
  4546. // ClearVideoPrice480p clears the value of the "video_price_480p" field.
  4547. func (u *GroupUpsertBulk) ClearVideoPrice480p() *GroupUpsertBulk {
  4548. return u.Update(func(s *GroupUpsert) {
  4549. s.ClearVideoPrice480p()
  4550. })
  4551. }
  4552. // SetVideoPrice720p sets the "video_price_720p" field.
  4553. func (u *GroupUpsertBulk) SetVideoPrice720p(v float64) *GroupUpsertBulk {
  4554. return u.Update(func(s *GroupUpsert) {
  4555. s.SetVideoPrice720p(v)
  4556. })
  4557. }
  4558. // AddVideoPrice720p adds v to the "video_price_720p" field.
  4559. func (u *GroupUpsertBulk) AddVideoPrice720p(v float64) *GroupUpsertBulk {
  4560. return u.Update(func(s *GroupUpsert) {
  4561. s.AddVideoPrice720p(v)
  4562. })
  4563. }
  4564. // UpdateVideoPrice720p sets the "video_price_720p" field to the value that was provided on create.
  4565. func (u *GroupUpsertBulk) UpdateVideoPrice720p() *GroupUpsertBulk {
  4566. return u.Update(func(s *GroupUpsert) {
  4567. s.UpdateVideoPrice720p()
  4568. })
  4569. }
  4570. // ClearVideoPrice720p clears the value of the "video_price_720p" field.
  4571. func (u *GroupUpsertBulk) ClearVideoPrice720p() *GroupUpsertBulk {
  4572. return u.Update(func(s *GroupUpsert) {
  4573. s.ClearVideoPrice720p()
  4574. })
  4575. }
  4576. // SetVideoPrice1080p sets the "video_price_1080p" field.
  4577. func (u *GroupUpsertBulk) SetVideoPrice1080p(v float64) *GroupUpsertBulk {
  4578. return u.Update(func(s *GroupUpsert) {
  4579. s.SetVideoPrice1080p(v)
  4580. })
  4581. }
  4582. // AddVideoPrice1080p adds v to the "video_price_1080p" field.
  4583. func (u *GroupUpsertBulk) AddVideoPrice1080p(v float64) *GroupUpsertBulk {
  4584. return u.Update(func(s *GroupUpsert) {
  4585. s.AddVideoPrice1080p(v)
  4586. })
  4587. }
  4588. // UpdateVideoPrice1080p sets the "video_price_1080p" field to the value that was provided on create.
  4589. func (u *GroupUpsertBulk) UpdateVideoPrice1080p() *GroupUpsertBulk {
  4590. return u.Update(func(s *GroupUpsert) {
  4591. s.UpdateVideoPrice1080p()
  4592. })
  4593. }
  4594. // ClearVideoPrice1080p clears the value of the "video_price_1080p" field.
  4595. func (u *GroupUpsertBulk) ClearVideoPrice1080p() *GroupUpsertBulk {
  4596. return u.Update(func(s *GroupUpsert) {
  4597. s.ClearVideoPrice1080p()
  4598. })
  4599. }
  4600. // SetVideoModelPrices sets the "video_model_prices" field.
  4601. func (u *GroupUpsertBulk) SetVideoModelPrices(v map[string]map[string]float64) *GroupUpsertBulk {
  4602. return u.Update(func(s *GroupUpsert) {
  4603. s.SetVideoModelPrices(v)
  4604. })
  4605. }
  4606. // UpdateVideoModelPrices sets the "video_model_prices" field to the value that was provided on create.
  4607. func (u *GroupUpsertBulk) UpdateVideoModelPrices() *GroupUpsertBulk {
  4608. return u.Update(func(s *GroupUpsert) {
  4609. s.UpdateVideoModelPrices()
  4610. })
  4611. }
  4612. // ClearVideoModelPrices clears the value of the "video_model_prices" field.
  4613. func (u *GroupUpsertBulk) ClearVideoModelPrices() *GroupUpsertBulk {
  4614. return u.Update(func(s *GroupUpsert) {
  4615. s.ClearVideoModelPrices()
  4616. })
  4617. }
  4618. // SetWebSearchPricePerCall sets the "web_search_price_per_call" field.
  4619. func (u *GroupUpsertBulk) SetWebSearchPricePerCall(v float64) *GroupUpsertBulk {
  4620. return u.Update(func(s *GroupUpsert) {
  4621. s.SetWebSearchPricePerCall(v)
  4622. })
  4623. }
  4624. // AddWebSearchPricePerCall adds v to the "web_search_price_per_call" field.
  4625. func (u *GroupUpsertBulk) AddWebSearchPricePerCall(v float64) *GroupUpsertBulk {
  4626. return u.Update(func(s *GroupUpsert) {
  4627. s.AddWebSearchPricePerCall(v)
  4628. })
  4629. }
  4630. // UpdateWebSearchPricePerCall sets the "web_search_price_per_call" field to the value that was provided on create.
  4631. func (u *GroupUpsertBulk) UpdateWebSearchPricePerCall() *GroupUpsertBulk {
  4632. return u.Update(func(s *GroupUpsert) {
  4633. s.UpdateWebSearchPricePerCall()
  4634. })
  4635. }
  4636. // ClearWebSearchPricePerCall clears the value of the "web_search_price_per_call" field.
  4637. func (u *GroupUpsertBulk) ClearWebSearchPricePerCall() *GroupUpsertBulk {
  4638. return u.Update(func(s *GroupUpsert) {
  4639. s.ClearWebSearchPricePerCall()
  4640. })
  4641. }
  4642. // SetSearchPricePer1k sets the "search_price_per_1k" field.
  4643. func (u *GroupUpsertBulk) SetSearchPricePer1k(v float64) *GroupUpsertBulk {
  4644. return u.Update(func(s *GroupUpsert) {
  4645. s.SetSearchPricePer1k(v)
  4646. })
  4647. }
  4648. // AddSearchPricePer1k adds v to the "search_price_per_1k" field.
  4649. func (u *GroupUpsertBulk) AddSearchPricePer1k(v float64) *GroupUpsertBulk {
  4650. return u.Update(func(s *GroupUpsert) {
  4651. s.AddSearchPricePer1k(v)
  4652. })
  4653. }
  4654. // UpdateSearchPricePer1k sets the "search_price_per_1k" field to the value that was provided on create.
  4655. func (u *GroupUpsertBulk) UpdateSearchPricePer1k() *GroupUpsertBulk {
  4656. return u.Update(func(s *GroupUpsert) {
  4657. s.UpdateSearchPricePer1k()
  4658. })
  4659. }
  4660. // ClearSearchPricePer1k clears the value of the "search_price_per_1k" field.
  4661. func (u *GroupUpsertBulk) ClearSearchPricePer1k() *GroupUpsertBulk {
  4662. return u.Update(func(s *GroupUpsert) {
  4663. s.ClearSearchPricePer1k()
  4664. })
  4665. }
  4666. // SetAudioRealtimePricePerMin sets the "audio_realtime_price_per_min" field.
  4667. func (u *GroupUpsertBulk) SetAudioRealtimePricePerMin(v float64) *GroupUpsertBulk {
  4668. return u.Update(func(s *GroupUpsert) {
  4669. s.SetAudioRealtimePricePerMin(v)
  4670. })
  4671. }
  4672. // AddAudioRealtimePricePerMin adds v to the "audio_realtime_price_per_min" field.
  4673. func (u *GroupUpsertBulk) AddAudioRealtimePricePerMin(v float64) *GroupUpsertBulk {
  4674. return u.Update(func(s *GroupUpsert) {
  4675. s.AddAudioRealtimePricePerMin(v)
  4676. })
  4677. }
  4678. // UpdateAudioRealtimePricePerMin sets the "audio_realtime_price_per_min" field to the value that was provided on create.
  4679. func (u *GroupUpsertBulk) UpdateAudioRealtimePricePerMin() *GroupUpsertBulk {
  4680. return u.Update(func(s *GroupUpsert) {
  4681. s.UpdateAudioRealtimePricePerMin()
  4682. })
  4683. }
  4684. // ClearAudioRealtimePricePerMin clears the value of the "audio_realtime_price_per_min" field.
  4685. func (u *GroupUpsertBulk) ClearAudioRealtimePricePerMin() *GroupUpsertBulk {
  4686. return u.Update(func(s *GroupUpsert) {
  4687. s.ClearAudioRealtimePricePerMin()
  4688. })
  4689. }
  4690. // SetAudioTtsPricePerMillionChars sets the "audio_tts_price_per_million_chars" field.
  4691. func (u *GroupUpsertBulk) SetAudioTtsPricePerMillionChars(v float64) *GroupUpsertBulk {
  4692. return u.Update(func(s *GroupUpsert) {
  4693. s.SetAudioTtsPricePerMillionChars(v)
  4694. })
  4695. }
  4696. // AddAudioTtsPricePerMillionChars adds v to the "audio_tts_price_per_million_chars" field.
  4697. func (u *GroupUpsertBulk) AddAudioTtsPricePerMillionChars(v float64) *GroupUpsertBulk {
  4698. return u.Update(func(s *GroupUpsert) {
  4699. s.AddAudioTtsPricePerMillionChars(v)
  4700. })
  4701. }
  4702. // UpdateAudioTtsPricePerMillionChars sets the "audio_tts_price_per_million_chars" field to the value that was provided on create.
  4703. func (u *GroupUpsertBulk) UpdateAudioTtsPricePerMillionChars() *GroupUpsertBulk {
  4704. return u.Update(func(s *GroupUpsert) {
  4705. s.UpdateAudioTtsPricePerMillionChars()
  4706. })
  4707. }
  4708. // ClearAudioTtsPricePerMillionChars clears the value of the "audio_tts_price_per_million_chars" field.
  4709. func (u *GroupUpsertBulk) ClearAudioTtsPricePerMillionChars() *GroupUpsertBulk {
  4710. return u.Update(func(s *GroupUpsert) {
  4711. s.ClearAudioTtsPricePerMillionChars()
  4712. })
  4713. }
  4714. // SetAudioSttPricePerHour sets the "audio_stt_price_per_hour" field.
  4715. func (u *GroupUpsertBulk) SetAudioSttPricePerHour(v float64) *GroupUpsertBulk {
  4716. return u.Update(func(s *GroupUpsert) {
  4717. s.SetAudioSttPricePerHour(v)
  4718. })
  4719. }
  4720. // AddAudioSttPricePerHour adds v to the "audio_stt_price_per_hour" field.
  4721. func (u *GroupUpsertBulk) AddAudioSttPricePerHour(v float64) *GroupUpsertBulk {
  4722. return u.Update(func(s *GroupUpsert) {
  4723. s.AddAudioSttPricePerHour(v)
  4724. })
  4725. }
  4726. // UpdateAudioSttPricePerHour sets the "audio_stt_price_per_hour" field to the value that was provided on create.
  4727. func (u *GroupUpsertBulk) UpdateAudioSttPricePerHour() *GroupUpsertBulk {
  4728. return u.Update(func(s *GroupUpsert) {
  4729. s.UpdateAudioSttPricePerHour()
  4730. })
  4731. }
  4732. // ClearAudioSttPricePerHour clears the value of the "audio_stt_price_per_hour" field.
  4733. func (u *GroupUpsertBulk) ClearAudioSttPricePerHour() *GroupUpsertBulk {
  4734. return u.Update(func(s *GroupUpsert) {
  4735. s.ClearAudioSttPricePerHour()
  4736. })
  4737. }
  4738. // SetLongContextPricingEnabled sets the "long_context_pricing_enabled" field.
  4739. func (u *GroupUpsertBulk) SetLongContextPricingEnabled(v bool) *GroupUpsertBulk {
  4740. return u.Update(func(s *GroupUpsert) {
  4741. s.SetLongContextPricingEnabled(v)
  4742. })
  4743. }
  4744. // UpdateLongContextPricingEnabled sets the "long_context_pricing_enabled" field to the value that was provided on create.
  4745. func (u *GroupUpsertBulk) UpdateLongContextPricingEnabled() *GroupUpsertBulk {
  4746. return u.Update(func(s *GroupUpsert) {
  4747. s.UpdateLongContextPricingEnabled()
  4748. })
  4749. }
  4750. // SetModelPricing sets the "model_pricing" field.
  4751. func (u *GroupUpsertBulk) SetModelPricing(v jsontext.Value) *GroupUpsertBulk {
  4752. return u.Update(func(s *GroupUpsert) {
  4753. s.SetModelPricing(v)
  4754. })
  4755. }
  4756. // UpdateModelPricing sets the "model_pricing" field to the value that was provided on create.
  4757. func (u *GroupUpsertBulk) UpdateModelPricing() *GroupUpsertBulk {
  4758. return u.Update(func(s *GroupUpsert) {
  4759. s.UpdateModelPricing()
  4760. })
  4761. }
  4762. // ClearModelPricing clears the value of the "model_pricing" field.
  4763. func (u *GroupUpsertBulk) ClearModelPricing() *GroupUpsertBulk {
  4764. return u.Update(func(s *GroupUpsert) {
  4765. s.ClearModelPricing()
  4766. })
  4767. }
  4768. // SetClaudeCodeOnly sets the "claude_code_only" field.
  4769. func (u *GroupUpsertBulk) SetClaudeCodeOnly(v bool) *GroupUpsertBulk {
  4770. return u.Update(func(s *GroupUpsert) {
  4771. s.SetClaudeCodeOnly(v)
  4772. })
  4773. }
  4774. // UpdateClaudeCodeOnly sets the "claude_code_only" field to the value that was provided on create.
  4775. func (u *GroupUpsertBulk) UpdateClaudeCodeOnly() *GroupUpsertBulk {
  4776. return u.Update(func(s *GroupUpsert) {
  4777. s.UpdateClaudeCodeOnly()
  4778. })
  4779. }
  4780. // SetFallbackGroupID sets the "fallback_group_id" field.
  4781. func (u *GroupUpsertBulk) SetFallbackGroupID(v int64) *GroupUpsertBulk {
  4782. return u.Update(func(s *GroupUpsert) {
  4783. s.SetFallbackGroupID(v)
  4784. })
  4785. }
  4786. // AddFallbackGroupID adds v to the "fallback_group_id" field.
  4787. func (u *GroupUpsertBulk) AddFallbackGroupID(v int64) *GroupUpsertBulk {
  4788. return u.Update(func(s *GroupUpsert) {
  4789. s.AddFallbackGroupID(v)
  4790. })
  4791. }
  4792. // UpdateFallbackGroupID sets the "fallback_group_id" field to the value that was provided on create.
  4793. func (u *GroupUpsertBulk) UpdateFallbackGroupID() *GroupUpsertBulk {
  4794. return u.Update(func(s *GroupUpsert) {
  4795. s.UpdateFallbackGroupID()
  4796. })
  4797. }
  4798. // ClearFallbackGroupID clears the value of the "fallback_group_id" field.
  4799. func (u *GroupUpsertBulk) ClearFallbackGroupID() *GroupUpsertBulk {
  4800. return u.Update(func(s *GroupUpsert) {
  4801. s.ClearFallbackGroupID()
  4802. })
  4803. }
  4804. // SetFallbackGroupIDOnInvalidRequest sets the "fallback_group_id_on_invalid_request" field.
  4805. func (u *GroupUpsertBulk) SetFallbackGroupIDOnInvalidRequest(v int64) *GroupUpsertBulk {
  4806. return u.Update(func(s *GroupUpsert) {
  4807. s.SetFallbackGroupIDOnInvalidRequest(v)
  4808. })
  4809. }
  4810. // AddFallbackGroupIDOnInvalidRequest adds v to the "fallback_group_id_on_invalid_request" field.
  4811. func (u *GroupUpsertBulk) AddFallbackGroupIDOnInvalidRequest(v int64) *GroupUpsertBulk {
  4812. return u.Update(func(s *GroupUpsert) {
  4813. s.AddFallbackGroupIDOnInvalidRequest(v)
  4814. })
  4815. }
  4816. // UpdateFallbackGroupIDOnInvalidRequest sets the "fallback_group_id_on_invalid_request" field to the value that was provided on create.
  4817. func (u *GroupUpsertBulk) UpdateFallbackGroupIDOnInvalidRequest() *GroupUpsertBulk {
  4818. return u.Update(func(s *GroupUpsert) {
  4819. s.UpdateFallbackGroupIDOnInvalidRequest()
  4820. })
  4821. }
  4822. // ClearFallbackGroupIDOnInvalidRequest clears the value of the "fallback_group_id_on_invalid_request" field.
  4823. func (u *GroupUpsertBulk) ClearFallbackGroupIDOnInvalidRequest() *GroupUpsertBulk {
  4824. return u.Update(func(s *GroupUpsert) {
  4825. s.ClearFallbackGroupIDOnInvalidRequest()
  4826. })
  4827. }
  4828. // SetModelRouting sets the "model_routing" field.
  4829. func (u *GroupUpsertBulk) SetModelRouting(v map[string][]int64) *GroupUpsertBulk {
  4830. return u.Update(func(s *GroupUpsert) {
  4831. s.SetModelRouting(v)
  4832. })
  4833. }
  4834. // UpdateModelRouting sets the "model_routing" field to the value that was provided on create.
  4835. func (u *GroupUpsertBulk) UpdateModelRouting() *GroupUpsertBulk {
  4836. return u.Update(func(s *GroupUpsert) {
  4837. s.UpdateModelRouting()
  4838. })
  4839. }
  4840. // ClearModelRouting clears the value of the "model_routing" field.
  4841. func (u *GroupUpsertBulk) ClearModelRouting() *GroupUpsertBulk {
  4842. return u.Update(func(s *GroupUpsert) {
  4843. s.ClearModelRouting()
  4844. })
  4845. }
  4846. // SetModelRoutingEnabled sets the "model_routing_enabled" field.
  4847. func (u *GroupUpsertBulk) SetModelRoutingEnabled(v bool) *GroupUpsertBulk {
  4848. return u.Update(func(s *GroupUpsert) {
  4849. s.SetModelRoutingEnabled(v)
  4850. })
  4851. }
  4852. // UpdateModelRoutingEnabled sets the "model_routing_enabled" field to the value that was provided on create.
  4853. func (u *GroupUpsertBulk) UpdateModelRoutingEnabled() *GroupUpsertBulk {
  4854. return u.Update(func(s *GroupUpsert) {
  4855. s.UpdateModelRoutingEnabled()
  4856. })
  4857. }
  4858. // SetMcpXMLInject sets the "mcp_xml_inject" field.
  4859. func (u *GroupUpsertBulk) SetMcpXMLInject(v bool) *GroupUpsertBulk {
  4860. return u.Update(func(s *GroupUpsert) {
  4861. s.SetMcpXMLInject(v)
  4862. })
  4863. }
  4864. // UpdateMcpXMLInject sets the "mcp_xml_inject" field to the value that was provided on create.
  4865. func (u *GroupUpsertBulk) UpdateMcpXMLInject() *GroupUpsertBulk {
  4866. return u.Update(func(s *GroupUpsert) {
  4867. s.UpdateMcpXMLInject()
  4868. })
  4869. }
  4870. // SetSupportedModelScopes sets the "supported_model_scopes" field.
  4871. func (u *GroupUpsertBulk) SetSupportedModelScopes(v []string) *GroupUpsertBulk {
  4872. return u.Update(func(s *GroupUpsert) {
  4873. s.SetSupportedModelScopes(v)
  4874. })
  4875. }
  4876. // UpdateSupportedModelScopes sets the "supported_model_scopes" field to the value that was provided on create.
  4877. func (u *GroupUpsertBulk) UpdateSupportedModelScopes() *GroupUpsertBulk {
  4878. return u.Update(func(s *GroupUpsert) {
  4879. s.UpdateSupportedModelScopes()
  4880. })
  4881. }
  4882. // SetSortOrder sets the "sort_order" field.
  4883. func (u *GroupUpsertBulk) SetSortOrder(v int) *GroupUpsertBulk {
  4884. return u.Update(func(s *GroupUpsert) {
  4885. s.SetSortOrder(v)
  4886. })
  4887. }
  4888. // AddSortOrder adds v to the "sort_order" field.
  4889. func (u *GroupUpsertBulk) AddSortOrder(v int) *GroupUpsertBulk {
  4890. return u.Update(func(s *GroupUpsert) {
  4891. s.AddSortOrder(v)
  4892. })
  4893. }
  4894. // UpdateSortOrder sets the "sort_order" field to the value that was provided on create.
  4895. func (u *GroupUpsertBulk) UpdateSortOrder() *GroupUpsertBulk {
  4896. return u.Update(func(s *GroupUpsert) {
  4897. s.UpdateSortOrder()
  4898. })
  4899. }
  4900. // SetAllowMessagesDispatch sets the "allow_messages_dispatch" field.
  4901. func (u *GroupUpsertBulk) SetAllowMessagesDispatch(v bool) *GroupUpsertBulk {
  4902. return u.Update(func(s *GroupUpsert) {
  4903. s.SetAllowMessagesDispatch(v)
  4904. })
  4905. }
  4906. // UpdateAllowMessagesDispatch sets the "allow_messages_dispatch" field to the value that was provided on create.
  4907. func (u *GroupUpsertBulk) UpdateAllowMessagesDispatch() *GroupUpsertBulk {
  4908. return u.Update(func(s *GroupUpsert) {
  4909. s.UpdateAllowMessagesDispatch()
  4910. })
  4911. }
  4912. // SetAllowLive sets the "allow_live" field.
  4913. func (u *GroupUpsertBulk) SetAllowLive(v bool) *GroupUpsertBulk {
  4914. return u.Update(func(s *GroupUpsert) {
  4915. s.SetAllowLive(v)
  4916. })
  4917. }
  4918. // UpdateAllowLive sets the "allow_live" field to the value that was provided on create.
  4919. func (u *GroupUpsertBulk) UpdateAllowLive() *GroupUpsertBulk {
  4920. return u.Update(func(s *GroupUpsert) {
  4921. s.UpdateAllowLive()
  4922. })
  4923. }
  4924. // SetForceOpenaiFast sets the "force_openai_fast" field.
  4925. func (u *GroupUpsertBulk) SetForceOpenaiFast(v bool) *GroupUpsertBulk {
  4926. return u.Update(func(s *GroupUpsert) {
  4927. s.SetForceOpenaiFast(v)
  4928. })
  4929. }
  4930. // UpdateForceOpenaiFast sets the "force_openai_fast" field to the value that was provided on create.
  4931. func (u *GroupUpsertBulk) UpdateForceOpenaiFast() *GroupUpsertBulk {
  4932. return u.Update(func(s *GroupUpsert) {
  4933. s.UpdateForceOpenaiFast()
  4934. })
  4935. }
  4936. // SetFreeOpenaiFast sets the "free_openai_fast" field.
  4937. func (u *GroupUpsertBulk) SetFreeOpenaiFast(v bool) *GroupUpsertBulk {
  4938. return u.Update(func(s *GroupUpsert) {
  4939. s.SetFreeOpenaiFast(v)
  4940. })
  4941. }
  4942. // UpdateFreeOpenaiFast sets the "free_openai_fast" field to the value that was provided on create.
  4943. func (u *GroupUpsertBulk) UpdateFreeOpenaiFast() *GroupUpsertBulk {
  4944. return u.Update(func(s *GroupUpsert) {
  4945. s.UpdateFreeOpenaiFast()
  4946. })
  4947. }
  4948. // SetRequireOauthOnly sets the "require_oauth_only" field.
  4949. func (u *GroupUpsertBulk) SetRequireOauthOnly(v bool) *GroupUpsertBulk {
  4950. return u.Update(func(s *GroupUpsert) {
  4951. s.SetRequireOauthOnly(v)
  4952. })
  4953. }
  4954. // UpdateRequireOauthOnly sets the "require_oauth_only" field to the value that was provided on create.
  4955. func (u *GroupUpsertBulk) UpdateRequireOauthOnly() *GroupUpsertBulk {
  4956. return u.Update(func(s *GroupUpsert) {
  4957. s.UpdateRequireOauthOnly()
  4958. })
  4959. }
  4960. // SetRequirePrivacySet sets the "require_privacy_set" field.
  4961. func (u *GroupUpsertBulk) SetRequirePrivacySet(v bool) *GroupUpsertBulk {
  4962. return u.Update(func(s *GroupUpsert) {
  4963. s.SetRequirePrivacySet(v)
  4964. })
  4965. }
  4966. // UpdateRequirePrivacySet sets the "require_privacy_set" field to the value that was provided on create.
  4967. func (u *GroupUpsertBulk) UpdateRequirePrivacySet() *GroupUpsertBulk {
  4968. return u.Update(func(s *GroupUpsert) {
  4969. s.UpdateRequirePrivacySet()
  4970. })
  4971. }
  4972. // SetDefaultMappedModel sets the "default_mapped_model" field.
  4973. func (u *GroupUpsertBulk) SetDefaultMappedModel(v string) *GroupUpsertBulk {
  4974. return u.Update(func(s *GroupUpsert) {
  4975. s.SetDefaultMappedModel(v)
  4976. })
  4977. }
  4978. // UpdateDefaultMappedModel sets the "default_mapped_model" field to the value that was provided on create.
  4979. func (u *GroupUpsertBulk) UpdateDefaultMappedModel() *GroupUpsertBulk {
  4980. return u.Update(func(s *GroupUpsert) {
  4981. s.UpdateDefaultMappedModel()
  4982. })
  4983. }
  4984. // SetMessagesDispatchModelConfig sets the "messages_dispatch_model_config" field.
  4985. func (u *GroupUpsertBulk) SetMessagesDispatchModelConfig(v domain.OpenAIMessagesDispatchModelConfig) *GroupUpsertBulk {
  4986. return u.Update(func(s *GroupUpsert) {
  4987. s.SetMessagesDispatchModelConfig(v)
  4988. })
  4989. }
  4990. // UpdateMessagesDispatchModelConfig sets the "messages_dispatch_model_config" field to the value that was provided on create.
  4991. func (u *GroupUpsertBulk) UpdateMessagesDispatchModelConfig() *GroupUpsertBulk {
  4992. return u.Update(func(s *GroupUpsert) {
  4993. s.UpdateMessagesDispatchModelConfig()
  4994. })
  4995. }
  4996. // SetModelAllowlist sets the "model_allowlist" field.
  4997. func (u *GroupUpsertBulk) SetModelAllowlist(v domain.GroupModelAllowlist) *GroupUpsertBulk {
  4998. return u.Update(func(s *GroupUpsert) {
  4999. s.SetModelAllowlist(v)
  5000. })
  5001. }
  5002. // UpdateModelAllowlist sets the "model_allowlist" field to the value that was provided on create.
  5003. func (u *GroupUpsertBulk) UpdateModelAllowlist() *GroupUpsertBulk {
  5004. return u.Update(func(s *GroupUpsert) {
  5005. s.UpdateModelAllowlist()
  5006. })
  5007. }
  5008. // SetCodexModelsManifestConfig sets the "codex_models_manifest_config" field.
  5009. func (u *GroupUpsertBulk) SetCodexModelsManifestConfig(v domain.GroupCodexModelsManifestConfig) *GroupUpsertBulk {
  5010. return u.Update(func(s *GroupUpsert) {
  5011. s.SetCodexModelsManifestConfig(v)
  5012. })
  5013. }
  5014. // UpdateCodexModelsManifestConfig sets the "codex_models_manifest_config" field to the value that was provided on create.
  5015. func (u *GroupUpsertBulk) UpdateCodexModelsManifestConfig() *GroupUpsertBulk {
  5016. return u.Update(func(s *GroupUpsert) {
  5017. s.UpdateCodexModelsManifestConfig()
  5018. })
  5019. }
  5020. // SetRpmLimit sets the "rpm_limit" field.
  5021. func (u *GroupUpsertBulk) SetRpmLimit(v int) *GroupUpsertBulk {
  5022. return u.Update(func(s *GroupUpsert) {
  5023. s.SetRpmLimit(v)
  5024. })
  5025. }
  5026. // AddRpmLimit adds v to the "rpm_limit" field.
  5027. func (u *GroupUpsertBulk) AddRpmLimit(v int) *GroupUpsertBulk {
  5028. return u.Update(func(s *GroupUpsert) {
  5029. s.AddRpmLimit(v)
  5030. })
  5031. }
  5032. // UpdateRpmLimit sets the "rpm_limit" field to the value that was provided on create.
  5033. func (u *GroupUpsertBulk) UpdateRpmLimit() *GroupUpsertBulk {
  5034. return u.Update(func(s *GroupUpsert) {
  5035. s.UpdateRpmLimit()
  5036. })
  5037. }
  5038. // SetMaxReasoningEffort sets the "max_reasoning_effort" field.
  5039. func (u *GroupUpsertBulk) SetMaxReasoningEffort(v string) *GroupUpsertBulk {
  5040. return u.Update(func(s *GroupUpsert) {
  5041. s.SetMaxReasoningEffort(v)
  5042. })
  5043. }
  5044. // UpdateMaxReasoningEffort sets the "max_reasoning_effort" field to the value that was provided on create.
  5045. func (u *GroupUpsertBulk) UpdateMaxReasoningEffort() *GroupUpsertBulk {
  5046. return u.Update(func(s *GroupUpsert) {
  5047. s.UpdateMaxReasoningEffort()
  5048. })
  5049. }
  5050. // SetMaxReasoningEffortOverLimit sets the "max_reasoning_effort_over_limit" field.
  5051. func (u *GroupUpsertBulk) SetMaxReasoningEffortOverLimit(v string) *GroupUpsertBulk {
  5052. return u.Update(func(s *GroupUpsert) {
  5053. s.SetMaxReasoningEffortOverLimit(v)
  5054. })
  5055. }
  5056. // UpdateMaxReasoningEffortOverLimit sets the "max_reasoning_effort_over_limit" field to the value that was provided on create.
  5057. func (u *GroupUpsertBulk) UpdateMaxReasoningEffortOverLimit() *GroupUpsertBulk {
  5058. return u.Update(func(s *GroupUpsert) {
  5059. s.UpdateMaxReasoningEffortOverLimit()
  5060. })
  5061. }
  5062. // SetReasoningEffortMappings sets the "reasoning_effort_mappings" field.
  5063. func (u *GroupUpsertBulk) SetReasoningEffortMappings(v []domain.ReasoningEffortMapping) *GroupUpsertBulk {
  5064. return u.Update(func(s *GroupUpsert) {
  5065. s.SetReasoningEffortMappings(v)
  5066. })
  5067. }
  5068. // UpdateReasoningEffortMappings sets the "reasoning_effort_mappings" field to the value that was provided on create.
  5069. func (u *GroupUpsertBulk) UpdateReasoningEffortMappings() *GroupUpsertBulk {
  5070. return u.Update(func(s *GroupUpsert) {
  5071. s.UpdateReasoningEffortMappings()
  5072. })
  5073. }
  5074. // SetProfitControlEnabled sets the "profit_control_enabled" field.
  5075. func (u *GroupUpsertBulk) SetProfitControlEnabled(v bool) *GroupUpsertBulk {
  5076. return u.Update(func(s *GroupUpsert) {
  5077. s.SetProfitControlEnabled(v)
  5078. })
  5079. }
  5080. // UpdateProfitControlEnabled sets the "profit_control_enabled" field to the value that was provided on create.
  5081. func (u *GroupUpsertBulk) UpdateProfitControlEnabled() *GroupUpsertBulk {
  5082. return u.Update(func(s *GroupUpsert) {
  5083. s.UpdateProfitControlEnabled()
  5084. })
  5085. }
  5086. // SetProfitMinMargin sets the "profit_min_margin" field.
  5087. func (u *GroupUpsertBulk) SetProfitMinMargin(v float64) *GroupUpsertBulk {
  5088. return u.Update(func(s *GroupUpsert) {
  5089. s.SetProfitMinMargin(v)
  5090. })
  5091. }
  5092. // AddProfitMinMargin adds v to the "profit_min_margin" field.
  5093. func (u *GroupUpsertBulk) AddProfitMinMargin(v float64) *GroupUpsertBulk {
  5094. return u.Update(func(s *GroupUpsert) {
  5095. s.AddProfitMinMargin(v)
  5096. })
  5097. }
  5098. // UpdateProfitMinMargin sets the "profit_min_margin" field to the value that was provided on create.
  5099. func (u *GroupUpsertBulk) UpdateProfitMinMargin() *GroupUpsertBulk {
  5100. return u.Update(func(s *GroupUpsert) {
  5101. s.UpdateProfitMinMargin()
  5102. })
  5103. }
  5104. // SetProfitSafetyBuffer sets the "profit_safety_buffer" field.
  5105. func (u *GroupUpsertBulk) SetProfitSafetyBuffer(v float64) *GroupUpsertBulk {
  5106. return u.Update(func(s *GroupUpsert) {
  5107. s.SetProfitSafetyBuffer(v)
  5108. })
  5109. }
  5110. // AddProfitSafetyBuffer adds v to the "profit_safety_buffer" field.
  5111. func (u *GroupUpsertBulk) AddProfitSafetyBuffer(v float64) *GroupUpsertBulk {
  5112. return u.Update(func(s *GroupUpsert) {
  5113. s.AddProfitSafetyBuffer(v)
  5114. })
  5115. }
  5116. // UpdateProfitSafetyBuffer sets the "profit_safety_buffer" field to the value that was provided on create.
  5117. func (u *GroupUpsertBulk) UpdateProfitSafetyBuffer() *GroupUpsertBulk {
  5118. return u.Update(func(s *GroupUpsert) {
  5119. s.UpdateProfitSafetyBuffer()
  5120. })
  5121. }
  5122. // Exec executes the query.
  5123. func (u *GroupUpsertBulk) Exec(ctx context.Context) error {
  5124. if u.create.err != nil {
  5125. return u.create.err
  5126. }
  5127. for i, b := range u.create.builders {
  5128. if len(b.conflict) != 0 {
  5129. return fmt.Errorf("ent: OnConflict was set for builder %d. Set it on the GroupCreateBulk instead", i)
  5130. }
  5131. }
  5132. if len(u.create.conflict) == 0 {
  5133. return errors.New("ent: missing options for GroupCreateBulk.OnConflict")
  5134. }
  5135. return u.create.Exec(ctx)
  5136. }
  5137. // ExecX is like Exec, but panics if an error occurs.
  5138. func (u *GroupUpsertBulk) ExecX(ctx context.Context) {
  5139. if err := u.create.Exec(ctx); err != nil {
  5140. panic(err)
  5141. }
  5142. }