| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518 |
- // Code generated by ent, DO NOT EDIT.
- package ent
- import (
- "context"
- "errors"
- "fmt"
- "time"
- "entgo.io/ent/dialect/sql"
- "entgo.io/ent/dialect/sql/sqlgraph"
- "entgo.io/ent/schema/field"
- "github.com/Wei-Shaw/sub2api/ent/batchimagejob"
- )
- // BatchImageJobCreate is the builder for creating a BatchImageJob entity.
- type BatchImageJobCreate struct {
- config
- mutation *BatchImageJobMutation
- hooks []Hook
- conflict []sql.ConflictOption
- }
- // SetBatchID sets the "batch_id" field.
- func (_c *BatchImageJobCreate) SetBatchID(v string) *BatchImageJobCreate {
- _c.mutation.SetBatchID(v)
- return _c
- }
- // SetUserID sets the "user_id" field.
- func (_c *BatchImageJobCreate) SetUserID(v int64) *BatchImageJobCreate {
- _c.mutation.SetUserID(v)
- return _c
- }
- // SetAPIKeyID sets the "api_key_id" field.
- func (_c *BatchImageJobCreate) SetAPIKeyID(v int64) *BatchImageJobCreate {
- _c.mutation.SetAPIKeyID(v)
- return _c
- }
- // SetNillableAPIKeyID sets the "api_key_id" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableAPIKeyID(v *int64) *BatchImageJobCreate {
- if v != nil {
- _c.SetAPIKeyID(*v)
- }
- return _c
- }
- // SetAccountID sets the "account_id" field.
- func (_c *BatchImageJobCreate) SetAccountID(v int64) *BatchImageJobCreate {
- _c.mutation.SetAccountID(v)
- return _c
- }
- // SetNillableAccountID sets the "account_id" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableAccountID(v *int64) *BatchImageJobCreate {
- if v != nil {
- _c.SetAccountID(*v)
- }
- return _c
- }
- // SetProvider sets the "provider" field.
- func (_c *BatchImageJobCreate) SetProvider(v string) *BatchImageJobCreate {
- _c.mutation.SetProvider(v)
- return _c
- }
- // SetModel sets the "model" field.
- func (_c *BatchImageJobCreate) SetModel(v string) *BatchImageJobCreate {
- _c.mutation.SetModel(v)
- return _c
- }
- // SetTaskName sets the "task_name" field.
- func (_c *BatchImageJobCreate) SetTaskName(v string) *BatchImageJobCreate {
- _c.mutation.SetTaskName(v)
- return _c
- }
- // SetNillableTaskName sets the "task_name" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableTaskName(v *string) *BatchImageJobCreate {
- if v != nil {
- _c.SetTaskName(*v)
- }
- return _c
- }
- // SetStatus sets the "status" field.
- func (_c *BatchImageJobCreate) SetStatus(v string) *BatchImageJobCreate {
- _c.mutation.SetStatus(v)
- return _c
- }
- // SetNillableStatus sets the "status" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableStatus(v *string) *BatchImageJobCreate {
- if v != nil {
- _c.SetStatus(*v)
- }
- return _c
- }
- // SetProviderJobName sets the "provider_job_name" field.
- func (_c *BatchImageJobCreate) SetProviderJobName(v string) *BatchImageJobCreate {
- _c.mutation.SetProviderJobName(v)
- return _c
- }
- // SetNillableProviderJobName sets the "provider_job_name" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableProviderJobName(v *string) *BatchImageJobCreate {
- if v != nil {
- _c.SetProviderJobName(*v)
- }
- return _c
- }
- // SetProviderInputRef sets the "provider_input_ref" field.
- func (_c *BatchImageJobCreate) SetProviderInputRef(v string) *BatchImageJobCreate {
- _c.mutation.SetProviderInputRef(v)
- return _c
- }
- // SetNillableProviderInputRef sets the "provider_input_ref" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableProviderInputRef(v *string) *BatchImageJobCreate {
- if v != nil {
- _c.SetProviderInputRef(*v)
- }
- return _c
- }
- // SetProviderOutputRef sets the "provider_output_ref" field.
- func (_c *BatchImageJobCreate) SetProviderOutputRef(v string) *BatchImageJobCreate {
- _c.mutation.SetProviderOutputRef(v)
- return _c
- }
- // SetNillableProviderOutputRef sets the "provider_output_ref" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableProviderOutputRef(v *string) *BatchImageJobCreate {
- if v != nil {
- _c.SetProviderOutputRef(*v)
- }
- return _c
- }
- // SetGcsInputURI sets the "gcs_input_uri" field.
- func (_c *BatchImageJobCreate) SetGcsInputURI(v string) *BatchImageJobCreate {
- _c.mutation.SetGcsInputURI(v)
- return _c
- }
- // SetNillableGcsInputURI sets the "gcs_input_uri" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableGcsInputURI(v *string) *BatchImageJobCreate {
- if v != nil {
- _c.SetGcsInputURI(*v)
- }
- return _c
- }
- // SetGcsOutputURI sets the "gcs_output_uri" field.
- func (_c *BatchImageJobCreate) SetGcsOutputURI(v string) *BatchImageJobCreate {
- _c.mutation.SetGcsOutputURI(v)
- return _c
- }
- // SetNillableGcsOutputURI sets the "gcs_output_uri" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableGcsOutputURI(v *string) *BatchImageJobCreate {
- if v != nil {
- _c.SetGcsOutputURI(*v)
- }
- return _c
- }
- // SetItemCount sets the "item_count" field.
- func (_c *BatchImageJobCreate) SetItemCount(v int) *BatchImageJobCreate {
- _c.mutation.SetItemCount(v)
- return _c
- }
- // SetSuccessCount sets the "success_count" field.
- func (_c *BatchImageJobCreate) SetSuccessCount(v int) *BatchImageJobCreate {
- _c.mutation.SetSuccessCount(v)
- return _c
- }
- // SetNillableSuccessCount sets the "success_count" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableSuccessCount(v *int) *BatchImageJobCreate {
- if v != nil {
- _c.SetSuccessCount(*v)
- }
- return _c
- }
- // SetFailCount sets the "fail_count" field.
- func (_c *BatchImageJobCreate) SetFailCount(v int) *BatchImageJobCreate {
- _c.mutation.SetFailCount(v)
- return _c
- }
- // SetNillableFailCount sets the "fail_count" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableFailCount(v *int) *BatchImageJobCreate {
- if v != nil {
- _c.SetFailCount(*v)
- }
- return _c
- }
- // SetCancelledCount sets the "cancelled_count" field.
- func (_c *BatchImageJobCreate) SetCancelledCount(v int) *BatchImageJobCreate {
- _c.mutation.SetCancelledCount(v)
- return _c
- }
- // SetNillableCancelledCount sets the "cancelled_count" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableCancelledCount(v *int) *BatchImageJobCreate {
- if v != nil {
- _c.SetCancelledCount(*v)
- }
- return _c
- }
- // SetEstimatedCost sets the "estimated_cost" field.
- func (_c *BatchImageJobCreate) SetEstimatedCost(v float64) *BatchImageJobCreate {
- _c.mutation.SetEstimatedCost(v)
- return _c
- }
- // SetNillableEstimatedCost sets the "estimated_cost" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableEstimatedCost(v *float64) *BatchImageJobCreate {
- if v != nil {
- _c.SetEstimatedCost(*v)
- }
- return _c
- }
- // SetHoldAmount sets the "hold_amount" field.
- func (_c *BatchImageJobCreate) SetHoldAmount(v float64) *BatchImageJobCreate {
- _c.mutation.SetHoldAmount(v)
- return _c
- }
- // SetNillableHoldAmount sets the "hold_amount" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableHoldAmount(v *float64) *BatchImageJobCreate {
- if v != nil {
- _c.SetHoldAmount(*v)
- }
- return _c
- }
- // SetActualCost sets the "actual_cost" field.
- func (_c *BatchImageJobCreate) SetActualCost(v float64) *BatchImageJobCreate {
- _c.mutation.SetActualCost(v)
- return _c
- }
- // SetNillableActualCost sets the "actual_cost" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableActualCost(v *float64) *BatchImageJobCreate {
- if v != nil {
- _c.SetActualCost(*v)
- }
- return _c
- }
- // SetCurrency sets the "currency" field.
- func (_c *BatchImageJobCreate) SetCurrency(v string) *BatchImageJobCreate {
- _c.mutation.SetCurrency(v)
- return _c
- }
- // SetNillableCurrency sets the "currency" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableCurrency(v *string) *BatchImageJobCreate {
- if v != nil {
- _c.SetCurrency(*v)
- }
- return _c
- }
- // SetHoldID sets the "hold_id" field.
- func (_c *BatchImageJobCreate) SetHoldID(v string) *BatchImageJobCreate {
- _c.mutation.SetHoldID(v)
- return _c
- }
- // SetNillableHoldID sets the "hold_id" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableHoldID(v *string) *BatchImageJobCreate {
- if v != nil {
- _c.SetHoldID(*v)
- }
- return _c
- }
- // SetIdempotencyKey sets the "idempotency_key" field.
- func (_c *BatchImageJobCreate) SetIdempotencyKey(v string) *BatchImageJobCreate {
- _c.mutation.SetIdempotencyKey(v)
- return _c
- }
- // SetNillableIdempotencyKey sets the "idempotency_key" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableIdempotencyKey(v *string) *BatchImageJobCreate {
- if v != nil {
- _c.SetIdempotencyKey(*v)
- }
- return _c
- }
- // SetRequestHash sets the "request_hash" field.
- func (_c *BatchImageJobCreate) SetRequestHash(v string) *BatchImageJobCreate {
- _c.mutation.SetRequestHash(v)
- return _c
- }
- // SetNillableRequestHash sets the "request_hash" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableRequestHash(v *string) *BatchImageJobCreate {
- if v != nil {
- _c.SetRequestHash(*v)
- }
- return _c
- }
- // SetManifestHash sets the "manifest_hash" field.
- func (_c *BatchImageJobCreate) SetManifestHash(v string) *BatchImageJobCreate {
- _c.mutation.SetManifestHash(v)
- return _c
- }
- // SetNillableManifestHash sets the "manifest_hash" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableManifestHash(v *string) *BatchImageJobCreate {
- if v != nil {
- _c.SetManifestHash(*v)
- }
- return _c
- }
- // SetRetryCount sets the "retry_count" field.
- func (_c *BatchImageJobCreate) SetRetryCount(v int) *BatchImageJobCreate {
- _c.mutation.SetRetryCount(v)
- return _c
- }
- // SetNillableRetryCount sets the "retry_count" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableRetryCount(v *int) *BatchImageJobCreate {
- if v != nil {
- _c.SetRetryCount(*v)
- }
- return _c
- }
- // SetVersion sets the "version" field.
- func (_c *BatchImageJobCreate) SetVersion(v int) *BatchImageJobCreate {
- _c.mutation.SetVersion(v)
- return _c
- }
- // SetNillableVersion sets the "version" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableVersion(v *int) *BatchImageJobCreate {
- if v != nil {
- _c.SetVersion(*v)
- }
- return _c
- }
- // SetOutputExpiresAt sets the "output_expires_at" field.
- func (_c *BatchImageJobCreate) SetOutputExpiresAt(v time.Time) *BatchImageJobCreate {
- _c.mutation.SetOutputExpiresAt(v)
- return _c
- }
- // SetNillableOutputExpiresAt sets the "output_expires_at" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableOutputExpiresAt(v *time.Time) *BatchImageJobCreate {
- if v != nil {
- _c.SetOutputExpiresAt(*v)
- }
- return _c
- }
- // SetInputDeletedAt sets the "input_deleted_at" field.
- func (_c *BatchImageJobCreate) SetInputDeletedAt(v time.Time) *BatchImageJobCreate {
- _c.mutation.SetInputDeletedAt(v)
- return _c
- }
- // SetNillableInputDeletedAt sets the "input_deleted_at" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableInputDeletedAt(v *time.Time) *BatchImageJobCreate {
- if v != nil {
- _c.SetInputDeletedAt(*v)
- }
- return _c
- }
- // SetOutputDeletedAt sets the "output_deleted_at" field.
- func (_c *BatchImageJobCreate) SetOutputDeletedAt(v time.Time) *BatchImageJobCreate {
- _c.mutation.SetOutputDeletedAt(v)
- return _c
- }
- // SetNillableOutputDeletedAt sets the "output_deleted_at" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableOutputDeletedAt(v *time.Time) *BatchImageJobCreate {
- if v != nil {
- _c.SetOutputDeletedAt(*v)
- }
- return _c
- }
- // SetDownloadedAt sets the "downloaded_at" field.
- func (_c *BatchImageJobCreate) SetDownloadedAt(v time.Time) *BatchImageJobCreate {
- _c.mutation.SetDownloadedAt(v)
- return _c
- }
- // SetNillableDownloadedAt sets the "downloaded_at" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableDownloadedAt(v *time.Time) *BatchImageJobCreate {
- if v != nil {
- _c.SetDownloadedAt(*v)
- }
- return _c
- }
- // SetUserDeletedAt sets the "user_deleted_at" field.
- func (_c *BatchImageJobCreate) SetUserDeletedAt(v time.Time) *BatchImageJobCreate {
- _c.mutation.SetUserDeletedAt(v)
- return _c
- }
- // SetNillableUserDeletedAt sets the "user_deleted_at" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableUserDeletedAt(v *time.Time) *BatchImageJobCreate {
- if v != nil {
- _c.SetUserDeletedAt(*v)
- }
- return _c
- }
- // SetLastErrorCode sets the "last_error_code" field.
- func (_c *BatchImageJobCreate) SetLastErrorCode(v string) *BatchImageJobCreate {
- _c.mutation.SetLastErrorCode(v)
- return _c
- }
- // SetNillableLastErrorCode sets the "last_error_code" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableLastErrorCode(v *string) *BatchImageJobCreate {
- if v != nil {
- _c.SetLastErrorCode(*v)
- }
- return _c
- }
- // SetLastErrorMessage sets the "last_error_message" field.
- func (_c *BatchImageJobCreate) SetLastErrorMessage(v string) *BatchImageJobCreate {
- _c.mutation.SetLastErrorMessage(v)
- return _c
- }
- // SetNillableLastErrorMessage sets the "last_error_message" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableLastErrorMessage(v *string) *BatchImageJobCreate {
- if v != nil {
- _c.SetLastErrorMessage(*v)
- }
- return _c
- }
- // SetCreatedAt sets the "created_at" field.
- func (_c *BatchImageJobCreate) SetCreatedAt(v time.Time) *BatchImageJobCreate {
- _c.mutation.SetCreatedAt(v)
- return _c
- }
- // SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableCreatedAt(v *time.Time) *BatchImageJobCreate {
- if v != nil {
- _c.SetCreatedAt(*v)
- }
- return _c
- }
- // SetUpdatedAt sets the "updated_at" field.
- func (_c *BatchImageJobCreate) SetUpdatedAt(v time.Time) *BatchImageJobCreate {
- _c.mutation.SetUpdatedAt(v)
- return _c
- }
- // SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableUpdatedAt(v *time.Time) *BatchImageJobCreate {
- if v != nil {
- _c.SetUpdatedAt(*v)
- }
- return _c
- }
- // SetSubmittedAt sets the "submitted_at" field.
- func (_c *BatchImageJobCreate) SetSubmittedAt(v time.Time) *BatchImageJobCreate {
- _c.mutation.SetSubmittedAt(v)
- return _c
- }
- // SetNillableSubmittedAt sets the "submitted_at" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableSubmittedAt(v *time.Time) *BatchImageJobCreate {
- if v != nil {
- _c.SetSubmittedAt(*v)
- }
- return _c
- }
- // SetStartedAt sets the "started_at" field.
- func (_c *BatchImageJobCreate) SetStartedAt(v time.Time) *BatchImageJobCreate {
- _c.mutation.SetStartedAt(v)
- return _c
- }
- // SetNillableStartedAt sets the "started_at" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableStartedAt(v *time.Time) *BatchImageJobCreate {
- if v != nil {
- _c.SetStartedAt(*v)
- }
- return _c
- }
- // SetFinishedAt sets the "finished_at" field.
- func (_c *BatchImageJobCreate) SetFinishedAt(v time.Time) *BatchImageJobCreate {
- _c.mutation.SetFinishedAt(v)
- return _c
- }
- // SetNillableFinishedAt sets the "finished_at" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableFinishedAt(v *time.Time) *BatchImageJobCreate {
- if v != nil {
- _c.SetFinishedAt(*v)
- }
- return _c
- }
- // SetSettledAt sets the "settled_at" field.
- func (_c *BatchImageJobCreate) SetSettledAt(v time.Time) *BatchImageJobCreate {
- _c.mutation.SetSettledAt(v)
- return _c
- }
- // SetNillableSettledAt sets the "settled_at" field if the given value is not nil.
- func (_c *BatchImageJobCreate) SetNillableSettledAt(v *time.Time) *BatchImageJobCreate {
- if v != nil {
- _c.SetSettledAt(*v)
- }
- return _c
- }
- // Mutation returns the BatchImageJobMutation object of the builder.
- func (_c *BatchImageJobCreate) Mutation() *BatchImageJobMutation {
- return _c.mutation
- }
- // Save creates the BatchImageJob in the database.
- func (_c *BatchImageJobCreate) Save(ctx context.Context) (*BatchImageJob, error) {
- _c.defaults()
- return withHooks(ctx, _c.sqlSave, _c.mutation, _c.hooks)
- }
- // SaveX calls Save and panics if Save returns an error.
- func (_c *BatchImageJobCreate) SaveX(ctx context.Context) *BatchImageJob {
- v, err := _c.Save(ctx)
- if err != nil {
- panic(err)
- }
- return v
- }
- // Exec executes the query.
- func (_c *BatchImageJobCreate) Exec(ctx context.Context) error {
- _, err := _c.Save(ctx)
- return err
- }
- // ExecX is like Exec, but panics if an error occurs.
- func (_c *BatchImageJobCreate) ExecX(ctx context.Context) {
- if err := _c.Exec(ctx); err != nil {
- panic(err)
- }
- }
- // defaults sets the default values of the builder before save.
- func (_c *BatchImageJobCreate) defaults() {
- if _, ok := _c.mutation.TaskName(); !ok {
- v := batchimagejob.DefaultTaskName
- _c.mutation.SetTaskName(v)
- }
- if _, ok := _c.mutation.Status(); !ok {
- v := batchimagejob.DefaultStatus
- _c.mutation.SetStatus(v)
- }
- if _, ok := _c.mutation.SuccessCount(); !ok {
- v := batchimagejob.DefaultSuccessCount
- _c.mutation.SetSuccessCount(v)
- }
- if _, ok := _c.mutation.FailCount(); !ok {
- v := batchimagejob.DefaultFailCount
- _c.mutation.SetFailCount(v)
- }
- if _, ok := _c.mutation.CancelledCount(); !ok {
- v := batchimagejob.DefaultCancelledCount
- _c.mutation.SetCancelledCount(v)
- }
- if _, ok := _c.mutation.EstimatedCost(); !ok {
- v := batchimagejob.DefaultEstimatedCost
- _c.mutation.SetEstimatedCost(v)
- }
- if _, ok := _c.mutation.Currency(); !ok {
- v := batchimagejob.DefaultCurrency
- _c.mutation.SetCurrency(v)
- }
- if _, ok := _c.mutation.RetryCount(); !ok {
- v := batchimagejob.DefaultRetryCount
- _c.mutation.SetRetryCount(v)
- }
- if _, ok := _c.mutation.Version(); !ok {
- v := batchimagejob.DefaultVersion
- _c.mutation.SetVersion(v)
- }
- if _, ok := _c.mutation.CreatedAt(); !ok {
- v := batchimagejob.DefaultCreatedAt()
- _c.mutation.SetCreatedAt(v)
- }
- if _, ok := _c.mutation.UpdatedAt(); !ok {
- v := batchimagejob.DefaultUpdatedAt()
- _c.mutation.SetUpdatedAt(v)
- }
- }
- // check runs all checks and user-defined validators on the builder.
- func (_c *BatchImageJobCreate) check() error {
- if _, ok := _c.mutation.BatchID(); !ok {
- return &ValidationError{Name: "batch_id", err: errors.New(`ent: missing required field "BatchImageJob.batch_id"`)}
- }
- if v, ok := _c.mutation.BatchID(); ok {
- if err := batchimagejob.BatchIDValidator(v); err != nil {
- return &ValidationError{Name: "batch_id", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.batch_id": %w`, err)}
- }
- }
- if _, ok := _c.mutation.UserID(); !ok {
- return &ValidationError{Name: "user_id", err: errors.New(`ent: missing required field "BatchImageJob.user_id"`)}
- }
- if _, ok := _c.mutation.Provider(); !ok {
- return &ValidationError{Name: "provider", err: errors.New(`ent: missing required field "BatchImageJob.provider"`)}
- }
- if v, ok := _c.mutation.Provider(); ok {
- if err := batchimagejob.ProviderValidator(v); err != nil {
- return &ValidationError{Name: "provider", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.provider": %w`, err)}
- }
- }
- if _, ok := _c.mutation.Model(); !ok {
- return &ValidationError{Name: "model", err: errors.New(`ent: missing required field "BatchImageJob.model"`)}
- }
- if v, ok := _c.mutation.Model(); ok {
- if err := batchimagejob.ModelValidator(v); err != nil {
- return &ValidationError{Name: "model", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.model": %w`, err)}
- }
- }
- if _, ok := _c.mutation.TaskName(); !ok {
- return &ValidationError{Name: "task_name", err: errors.New(`ent: missing required field "BatchImageJob.task_name"`)}
- }
- if v, ok := _c.mutation.TaskName(); ok {
- if err := batchimagejob.TaskNameValidator(v); err != nil {
- return &ValidationError{Name: "task_name", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.task_name": %w`, err)}
- }
- }
- if _, ok := _c.mutation.Status(); !ok {
- return &ValidationError{Name: "status", err: errors.New(`ent: missing required field "BatchImageJob.status"`)}
- }
- if v, ok := _c.mutation.Status(); ok {
- if err := batchimagejob.StatusValidator(v); err != nil {
- return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.status": %w`, err)}
- }
- }
- if v, ok := _c.mutation.ProviderJobName(); ok {
- if err := batchimagejob.ProviderJobNameValidator(v); err != nil {
- return &ValidationError{Name: "provider_job_name", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.provider_job_name": %w`, err)}
- }
- }
- if v, ok := _c.mutation.ProviderInputRef(); ok {
- if err := batchimagejob.ProviderInputRefValidator(v); err != nil {
- return &ValidationError{Name: "provider_input_ref", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.provider_input_ref": %w`, err)}
- }
- }
- if v, ok := _c.mutation.ProviderOutputRef(); ok {
- if err := batchimagejob.ProviderOutputRefValidator(v); err != nil {
- return &ValidationError{Name: "provider_output_ref", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.provider_output_ref": %w`, err)}
- }
- }
- if v, ok := _c.mutation.GcsInputURI(); ok {
- if err := batchimagejob.GcsInputURIValidator(v); err != nil {
- return &ValidationError{Name: "gcs_input_uri", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.gcs_input_uri": %w`, err)}
- }
- }
- if v, ok := _c.mutation.GcsOutputURI(); ok {
- if err := batchimagejob.GcsOutputURIValidator(v); err != nil {
- return &ValidationError{Name: "gcs_output_uri", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.gcs_output_uri": %w`, err)}
- }
- }
- if _, ok := _c.mutation.ItemCount(); !ok {
- return &ValidationError{Name: "item_count", err: errors.New(`ent: missing required field "BatchImageJob.item_count"`)}
- }
- if _, ok := _c.mutation.SuccessCount(); !ok {
- return &ValidationError{Name: "success_count", err: errors.New(`ent: missing required field "BatchImageJob.success_count"`)}
- }
- if _, ok := _c.mutation.FailCount(); !ok {
- return &ValidationError{Name: "fail_count", err: errors.New(`ent: missing required field "BatchImageJob.fail_count"`)}
- }
- if _, ok := _c.mutation.CancelledCount(); !ok {
- return &ValidationError{Name: "cancelled_count", err: errors.New(`ent: missing required field "BatchImageJob.cancelled_count"`)}
- }
- if _, ok := _c.mutation.EstimatedCost(); !ok {
- return &ValidationError{Name: "estimated_cost", err: errors.New(`ent: missing required field "BatchImageJob.estimated_cost"`)}
- }
- if _, ok := _c.mutation.Currency(); !ok {
- return &ValidationError{Name: "currency", err: errors.New(`ent: missing required field "BatchImageJob.currency"`)}
- }
- if v, ok := _c.mutation.Currency(); ok {
- if err := batchimagejob.CurrencyValidator(v); err != nil {
- return &ValidationError{Name: "currency", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.currency": %w`, err)}
- }
- }
- if v, ok := _c.mutation.HoldID(); ok {
- if err := batchimagejob.HoldIDValidator(v); err != nil {
- return &ValidationError{Name: "hold_id", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.hold_id": %w`, err)}
- }
- }
- if v, ok := _c.mutation.IdempotencyKey(); ok {
- if err := batchimagejob.IdempotencyKeyValidator(v); err != nil {
- return &ValidationError{Name: "idempotency_key", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.idempotency_key": %w`, err)}
- }
- }
- if v, ok := _c.mutation.RequestHash(); ok {
- if err := batchimagejob.RequestHashValidator(v); err != nil {
- return &ValidationError{Name: "request_hash", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.request_hash": %w`, err)}
- }
- }
- if v, ok := _c.mutation.ManifestHash(); ok {
- if err := batchimagejob.ManifestHashValidator(v); err != nil {
- return &ValidationError{Name: "manifest_hash", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.manifest_hash": %w`, err)}
- }
- }
- if _, ok := _c.mutation.RetryCount(); !ok {
- return &ValidationError{Name: "retry_count", err: errors.New(`ent: missing required field "BatchImageJob.retry_count"`)}
- }
- if _, ok := _c.mutation.Version(); !ok {
- return &ValidationError{Name: "version", err: errors.New(`ent: missing required field "BatchImageJob.version"`)}
- }
- if v, ok := _c.mutation.LastErrorCode(); ok {
- if err := batchimagejob.LastErrorCodeValidator(v); err != nil {
- return &ValidationError{Name: "last_error_code", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.last_error_code": %w`, err)}
- }
- }
- if _, ok := _c.mutation.CreatedAt(); !ok {
- return &ValidationError{Name: "created_at", err: errors.New(`ent: missing required field "BatchImageJob.created_at"`)}
- }
- if _, ok := _c.mutation.UpdatedAt(); !ok {
- return &ValidationError{Name: "updated_at", err: errors.New(`ent: missing required field "BatchImageJob.updated_at"`)}
- }
- return nil
- }
- func (_c *BatchImageJobCreate) sqlSave(ctx context.Context) (*BatchImageJob, error) {
- if err := _c.check(); err != nil {
- return nil, err
- }
- _node, _spec := _c.createSpec()
- if err := sqlgraph.CreateNode(ctx, _c.driver, _spec); err != nil {
- if sqlgraph.IsConstraintError(err) {
- err = &ConstraintError{msg: err.Error(), wrap: err}
- }
- return nil, err
- }
- id := _spec.ID.Value.(int64)
- _node.ID = int64(id)
- _c.mutation.id = &_node.ID
- _c.mutation.done = true
- return _node, nil
- }
- func (_c *BatchImageJobCreate) createSpec() (*BatchImageJob, *sqlgraph.CreateSpec) {
- var (
- _node = &BatchImageJob{config: _c.config}
- _spec = sqlgraph.NewCreateSpec(batchimagejob.Table, sqlgraph.NewFieldSpec(batchimagejob.FieldID, field.TypeInt64))
- )
- _spec.OnConflict = _c.conflict
- if value, ok := _c.mutation.BatchID(); ok {
- _spec.SetField(batchimagejob.FieldBatchID, field.TypeString, value)
- _node.BatchID = value
- }
- if value, ok := _c.mutation.UserID(); ok {
- _spec.SetField(batchimagejob.FieldUserID, field.TypeInt64, value)
- _node.UserID = value
- }
- if value, ok := _c.mutation.APIKeyID(); ok {
- _spec.SetField(batchimagejob.FieldAPIKeyID, field.TypeInt64, value)
- _node.APIKeyID = &value
- }
- if value, ok := _c.mutation.AccountID(); ok {
- _spec.SetField(batchimagejob.FieldAccountID, field.TypeInt64, value)
- _node.AccountID = &value
- }
- if value, ok := _c.mutation.Provider(); ok {
- _spec.SetField(batchimagejob.FieldProvider, field.TypeString, value)
- _node.Provider = value
- }
- if value, ok := _c.mutation.Model(); ok {
- _spec.SetField(batchimagejob.FieldModel, field.TypeString, value)
- _node.Model = value
- }
- if value, ok := _c.mutation.TaskName(); ok {
- _spec.SetField(batchimagejob.FieldTaskName, field.TypeString, value)
- _node.TaskName = value
- }
- if value, ok := _c.mutation.Status(); ok {
- _spec.SetField(batchimagejob.FieldStatus, field.TypeString, value)
- _node.Status = value
- }
- if value, ok := _c.mutation.ProviderJobName(); ok {
- _spec.SetField(batchimagejob.FieldProviderJobName, field.TypeString, value)
- _node.ProviderJobName = &value
- }
- if value, ok := _c.mutation.ProviderInputRef(); ok {
- _spec.SetField(batchimagejob.FieldProviderInputRef, field.TypeString, value)
- _node.ProviderInputRef = &value
- }
- if value, ok := _c.mutation.ProviderOutputRef(); ok {
- _spec.SetField(batchimagejob.FieldProviderOutputRef, field.TypeString, value)
- _node.ProviderOutputRef = &value
- }
- if value, ok := _c.mutation.GcsInputURI(); ok {
- _spec.SetField(batchimagejob.FieldGcsInputURI, field.TypeString, value)
- _node.GcsInputURI = &value
- }
- if value, ok := _c.mutation.GcsOutputURI(); ok {
- _spec.SetField(batchimagejob.FieldGcsOutputURI, field.TypeString, value)
- _node.GcsOutputURI = &value
- }
- if value, ok := _c.mutation.ItemCount(); ok {
- _spec.SetField(batchimagejob.FieldItemCount, field.TypeInt, value)
- _node.ItemCount = value
- }
- if value, ok := _c.mutation.SuccessCount(); ok {
- _spec.SetField(batchimagejob.FieldSuccessCount, field.TypeInt, value)
- _node.SuccessCount = value
- }
- if value, ok := _c.mutation.FailCount(); ok {
- _spec.SetField(batchimagejob.FieldFailCount, field.TypeInt, value)
- _node.FailCount = value
- }
- if value, ok := _c.mutation.CancelledCount(); ok {
- _spec.SetField(batchimagejob.FieldCancelledCount, field.TypeInt, value)
- _node.CancelledCount = value
- }
- if value, ok := _c.mutation.EstimatedCost(); ok {
- _spec.SetField(batchimagejob.FieldEstimatedCost, field.TypeFloat64, value)
- _node.EstimatedCost = value
- }
- if value, ok := _c.mutation.HoldAmount(); ok {
- _spec.SetField(batchimagejob.FieldHoldAmount, field.TypeFloat64, value)
- _node.HoldAmount = &value
- }
- if value, ok := _c.mutation.ActualCost(); ok {
- _spec.SetField(batchimagejob.FieldActualCost, field.TypeFloat64, value)
- _node.ActualCost = &value
- }
- if value, ok := _c.mutation.Currency(); ok {
- _spec.SetField(batchimagejob.FieldCurrency, field.TypeString, value)
- _node.Currency = value
- }
- if value, ok := _c.mutation.HoldID(); ok {
- _spec.SetField(batchimagejob.FieldHoldID, field.TypeString, value)
- _node.HoldID = &value
- }
- if value, ok := _c.mutation.IdempotencyKey(); ok {
- _spec.SetField(batchimagejob.FieldIdempotencyKey, field.TypeString, value)
- _node.IdempotencyKey = &value
- }
- if value, ok := _c.mutation.RequestHash(); ok {
- _spec.SetField(batchimagejob.FieldRequestHash, field.TypeString, value)
- _node.RequestHash = &value
- }
- if value, ok := _c.mutation.ManifestHash(); ok {
- _spec.SetField(batchimagejob.FieldManifestHash, field.TypeString, value)
- _node.ManifestHash = &value
- }
- if value, ok := _c.mutation.RetryCount(); ok {
- _spec.SetField(batchimagejob.FieldRetryCount, field.TypeInt, value)
- _node.RetryCount = value
- }
- if value, ok := _c.mutation.Version(); ok {
- _spec.SetField(batchimagejob.FieldVersion, field.TypeInt, value)
- _node.Version = value
- }
- if value, ok := _c.mutation.OutputExpiresAt(); ok {
- _spec.SetField(batchimagejob.FieldOutputExpiresAt, field.TypeTime, value)
- _node.OutputExpiresAt = &value
- }
- if value, ok := _c.mutation.InputDeletedAt(); ok {
- _spec.SetField(batchimagejob.FieldInputDeletedAt, field.TypeTime, value)
- _node.InputDeletedAt = &value
- }
- if value, ok := _c.mutation.OutputDeletedAt(); ok {
- _spec.SetField(batchimagejob.FieldOutputDeletedAt, field.TypeTime, value)
- _node.OutputDeletedAt = &value
- }
- if value, ok := _c.mutation.DownloadedAt(); ok {
- _spec.SetField(batchimagejob.FieldDownloadedAt, field.TypeTime, value)
- _node.DownloadedAt = &value
- }
- if value, ok := _c.mutation.UserDeletedAt(); ok {
- _spec.SetField(batchimagejob.FieldUserDeletedAt, field.TypeTime, value)
- _node.UserDeletedAt = &value
- }
- if value, ok := _c.mutation.LastErrorCode(); ok {
- _spec.SetField(batchimagejob.FieldLastErrorCode, field.TypeString, value)
- _node.LastErrorCode = &value
- }
- if value, ok := _c.mutation.LastErrorMessage(); ok {
- _spec.SetField(batchimagejob.FieldLastErrorMessage, field.TypeString, value)
- _node.LastErrorMessage = &value
- }
- if value, ok := _c.mutation.CreatedAt(); ok {
- _spec.SetField(batchimagejob.FieldCreatedAt, field.TypeTime, value)
- _node.CreatedAt = value
- }
- if value, ok := _c.mutation.UpdatedAt(); ok {
- _spec.SetField(batchimagejob.FieldUpdatedAt, field.TypeTime, value)
- _node.UpdatedAt = value
- }
- if value, ok := _c.mutation.SubmittedAt(); ok {
- _spec.SetField(batchimagejob.FieldSubmittedAt, field.TypeTime, value)
- _node.SubmittedAt = &value
- }
- if value, ok := _c.mutation.StartedAt(); ok {
- _spec.SetField(batchimagejob.FieldStartedAt, field.TypeTime, value)
- _node.StartedAt = &value
- }
- if value, ok := _c.mutation.FinishedAt(); ok {
- _spec.SetField(batchimagejob.FieldFinishedAt, field.TypeTime, value)
- _node.FinishedAt = &value
- }
- if value, ok := _c.mutation.SettledAt(); ok {
- _spec.SetField(batchimagejob.FieldSettledAt, field.TypeTime, value)
- _node.SettledAt = &value
- }
- return _node, _spec
- }
- // OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
- // of the `INSERT` statement. For example:
- //
- // client.BatchImageJob.Create().
- // SetBatchID(v).
- // OnConflict(
- // // Update the row with the new values
- // // the was proposed for insertion.
- // sql.ResolveWithNewValues(),
- // ).
- // // Override some of the fields with custom
- // // update values.
- // Update(func(u *ent.BatchImageJobUpsert) {
- // SetBatchID(v+v).
- // }).
- // Exec(ctx)
- func (_c *BatchImageJobCreate) OnConflict(opts ...sql.ConflictOption) *BatchImageJobUpsertOne {
- _c.conflict = opts
- return &BatchImageJobUpsertOne{
- create: _c,
- }
- }
- // OnConflictColumns calls `OnConflict` and configures the columns
- // as conflict target. Using this option is equivalent to using:
- //
- // client.BatchImageJob.Create().
- // OnConflict(sql.ConflictColumns(columns...)).
- // Exec(ctx)
- func (_c *BatchImageJobCreate) OnConflictColumns(columns ...string) *BatchImageJobUpsertOne {
- _c.conflict = append(_c.conflict, sql.ConflictColumns(columns...))
- return &BatchImageJobUpsertOne{
- create: _c,
- }
- }
- type (
- // BatchImageJobUpsertOne is the builder for "upsert"-ing
- // one BatchImageJob node.
- BatchImageJobUpsertOne struct {
- create *BatchImageJobCreate
- }
- // BatchImageJobUpsert is the "OnConflict" setter.
- BatchImageJobUpsert struct {
- *sql.UpdateSet
- }
- )
- // SetUserID sets the "user_id" field.
- func (u *BatchImageJobUpsert) SetUserID(v int64) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldUserID, v)
- return u
- }
- // UpdateUserID sets the "user_id" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateUserID() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldUserID)
- return u
- }
- // AddUserID adds v to the "user_id" field.
- func (u *BatchImageJobUpsert) AddUserID(v int64) *BatchImageJobUpsert {
- u.Add(batchimagejob.FieldUserID, v)
- return u
- }
- // SetAPIKeyID sets the "api_key_id" field.
- func (u *BatchImageJobUpsert) SetAPIKeyID(v int64) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldAPIKeyID, v)
- return u
- }
- // UpdateAPIKeyID sets the "api_key_id" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateAPIKeyID() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldAPIKeyID)
- return u
- }
- // AddAPIKeyID adds v to the "api_key_id" field.
- func (u *BatchImageJobUpsert) AddAPIKeyID(v int64) *BatchImageJobUpsert {
- u.Add(batchimagejob.FieldAPIKeyID, v)
- return u
- }
- // ClearAPIKeyID clears the value of the "api_key_id" field.
- func (u *BatchImageJobUpsert) ClearAPIKeyID() *BatchImageJobUpsert {
- u.SetNull(batchimagejob.FieldAPIKeyID)
- return u
- }
- // SetAccountID sets the "account_id" field.
- func (u *BatchImageJobUpsert) SetAccountID(v int64) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldAccountID, v)
- return u
- }
- // UpdateAccountID sets the "account_id" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateAccountID() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldAccountID)
- return u
- }
- // AddAccountID adds v to the "account_id" field.
- func (u *BatchImageJobUpsert) AddAccountID(v int64) *BatchImageJobUpsert {
- u.Add(batchimagejob.FieldAccountID, v)
- return u
- }
- // ClearAccountID clears the value of the "account_id" field.
- func (u *BatchImageJobUpsert) ClearAccountID() *BatchImageJobUpsert {
- u.SetNull(batchimagejob.FieldAccountID)
- return u
- }
- // SetProvider sets the "provider" field.
- func (u *BatchImageJobUpsert) SetProvider(v string) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldProvider, v)
- return u
- }
- // UpdateProvider sets the "provider" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateProvider() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldProvider)
- return u
- }
- // SetModel sets the "model" field.
- func (u *BatchImageJobUpsert) SetModel(v string) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldModel, v)
- return u
- }
- // UpdateModel sets the "model" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateModel() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldModel)
- return u
- }
- // SetTaskName sets the "task_name" field.
- func (u *BatchImageJobUpsert) SetTaskName(v string) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldTaskName, v)
- return u
- }
- // UpdateTaskName sets the "task_name" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateTaskName() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldTaskName)
- return u
- }
- // SetStatus sets the "status" field.
- func (u *BatchImageJobUpsert) SetStatus(v string) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldStatus, v)
- return u
- }
- // UpdateStatus sets the "status" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateStatus() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldStatus)
- return u
- }
- // SetProviderJobName sets the "provider_job_name" field.
- func (u *BatchImageJobUpsert) SetProviderJobName(v string) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldProviderJobName, v)
- return u
- }
- // UpdateProviderJobName sets the "provider_job_name" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateProviderJobName() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldProviderJobName)
- return u
- }
- // ClearProviderJobName clears the value of the "provider_job_name" field.
- func (u *BatchImageJobUpsert) ClearProviderJobName() *BatchImageJobUpsert {
- u.SetNull(batchimagejob.FieldProviderJobName)
- return u
- }
- // SetProviderInputRef sets the "provider_input_ref" field.
- func (u *BatchImageJobUpsert) SetProviderInputRef(v string) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldProviderInputRef, v)
- return u
- }
- // UpdateProviderInputRef sets the "provider_input_ref" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateProviderInputRef() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldProviderInputRef)
- return u
- }
- // ClearProviderInputRef clears the value of the "provider_input_ref" field.
- func (u *BatchImageJobUpsert) ClearProviderInputRef() *BatchImageJobUpsert {
- u.SetNull(batchimagejob.FieldProviderInputRef)
- return u
- }
- // SetProviderOutputRef sets the "provider_output_ref" field.
- func (u *BatchImageJobUpsert) SetProviderOutputRef(v string) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldProviderOutputRef, v)
- return u
- }
- // UpdateProviderOutputRef sets the "provider_output_ref" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateProviderOutputRef() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldProviderOutputRef)
- return u
- }
- // ClearProviderOutputRef clears the value of the "provider_output_ref" field.
- func (u *BatchImageJobUpsert) ClearProviderOutputRef() *BatchImageJobUpsert {
- u.SetNull(batchimagejob.FieldProviderOutputRef)
- return u
- }
- // SetGcsInputURI sets the "gcs_input_uri" field.
- func (u *BatchImageJobUpsert) SetGcsInputURI(v string) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldGcsInputURI, v)
- return u
- }
- // UpdateGcsInputURI sets the "gcs_input_uri" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateGcsInputURI() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldGcsInputURI)
- return u
- }
- // ClearGcsInputURI clears the value of the "gcs_input_uri" field.
- func (u *BatchImageJobUpsert) ClearGcsInputURI() *BatchImageJobUpsert {
- u.SetNull(batchimagejob.FieldGcsInputURI)
- return u
- }
- // SetGcsOutputURI sets the "gcs_output_uri" field.
- func (u *BatchImageJobUpsert) SetGcsOutputURI(v string) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldGcsOutputURI, v)
- return u
- }
- // UpdateGcsOutputURI sets the "gcs_output_uri" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateGcsOutputURI() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldGcsOutputURI)
- return u
- }
- // ClearGcsOutputURI clears the value of the "gcs_output_uri" field.
- func (u *BatchImageJobUpsert) ClearGcsOutputURI() *BatchImageJobUpsert {
- u.SetNull(batchimagejob.FieldGcsOutputURI)
- return u
- }
- // SetItemCount sets the "item_count" field.
- func (u *BatchImageJobUpsert) SetItemCount(v int) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldItemCount, v)
- return u
- }
- // UpdateItemCount sets the "item_count" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateItemCount() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldItemCount)
- return u
- }
- // AddItemCount adds v to the "item_count" field.
- func (u *BatchImageJobUpsert) AddItemCount(v int) *BatchImageJobUpsert {
- u.Add(batchimagejob.FieldItemCount, v)
- return u
- }
- // SetSuccessCount sets the "success_count" field.
- func (u *BatchImageJobUpsert) SetSuccessCount(v int) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldSuccessCount, v)
- return u
- }
- // UpdateSuccessCount sets the "success_count" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateSuccessCount() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldSuccessCount)
- return u
- }
- // AddSuccessCount adds v to the "success_count" field.
- func (u *BatchImageJobUpsert) AddSuccessCount(v int) *BatchImageJobUpsert {
- u.Add(batchimagejob.FieldSuccessCount, v)
- return u
- }
- // SetFailCount sets the "fail_count" field.
- func (u *BatchImageJobUpsert) SetFailCount(v int) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldFailCount, v)
- return u
- }
- // UpdateFailCount sets the "fail_count" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateFailCount() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldFailCount)
- return u
- }
- // AddFailCount adds v to the "fail_count" field.
- func (u *BatchImageJobUpsert) AddFailCount(v int) *BatchImageJobUpsert {
- u.Add(batchimagejob.FieldFailCount, v)
- return u
- }
- // SetCancelledCount sets the "cancelled_count" field.
- func (u *BatchImageJobUpsert) SetCancelledCount(v int) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldCancelledCount, v)
- return u
- }
- // UpdateCancelledCount sets the "cancelled_count" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateCancelledCount() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldCancelledCount)
- return u
- }
- // AddCancelledCount adds v to the "cancelled_count" field.
- func (u *BatchImageJobUpsert) AddCancelledCount(v int) *BatchImageJobUpsert {
- u.Add(batchimagejob.FieldCancelledCount, v)
- return u
- }
- // SetEstimatedCost sets the "estimated_cost" field.
- func (u *BatchImageJobUpsert) SetEstimatedCost(v float64) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldEstimatedCost, v)
- return u
- }
- // UpdateEstimatedCost sets the "estimated_cost" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateEstimatedCost() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldEstimatedCost)
- return u
- }
- // AddEstimatedCost adds v to the "estimated_cost" field.
- func (u *BatchImageJobUpsert) AddEstimatedCost(v float64) *BatchImageJobUpsert {
- u.Add(batchimagejob.FieldEstimatedCost, v)
- return u
- }
- // SetHoldAmount sets the "hold_amount" field.
- func (u *BatchImageJobUpsert) SetHoldAmount(v float64) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldHoldAmount, v)
- return u
- }
- // UpdateHoldAmount sets the "hold_amount" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateHoldAmount() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldHoldAmount)
- return u
- }
- // AddHoldAmount adds v to the "hold_amount" field.
- func (u *BatchImageJobUpsert) AddHoldAmount(v float64) *BatchImageJobUpsert {
- u.Add(batchimagejob.FieldHoldAmount, v)
- return u
- }
- // ClearHoldAmount clears the value of the "hold_amount" field.
- func (u *BatchImageJobUpsert) ClearHoldAmount() *BatchImageJobUpsert {
- u.SetNull(batchimagejob.FieldHoldAmount)
- return u
- }
- // SetActualCost sets the "actual_cost" field.
- func (u *BatchImageJobUpsert) SetActualCost(v float64) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldActualCost, v)
- return u
- }
- // UpdateActualCost sets the "actual_cost" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateActualCost() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldActualCost)
- return u
- }
- // AddActualCost adds v to the "actual_cost" field.
- func (u *BatchImageJobUpsert) AddActualCost(v float64) *BatchImageJobUpsert {
- u.Add(batchimagejob.FieldActualCost, v)
- return u
- }
- // ClearActualCost clears the value of the "actual_cost" field.
- func (u *BatchImageJobUpsert) ClearActualCost() *BatchImageJobUpsert {
- u.SetNull(batchimagejob.FieldActualCost)
- return u
- }
- // SetCurrency sets the "currency" field.
- func (u *BatchImageJobUpsert) SetCurrency(v string) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldCurrency, v)
- return u
- }
- // UpdateCurrency sets the "currency" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateCurrency() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldCurrency)
- return u
- }
- // SetHoldID sets the "hold_id" field.
- func (u *BatchImageJobUpsert) SetHoldID(v string) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldHoldID, v)
- return u
- }
- // UpdateHoldID sets the "hold_id" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateHoldID() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldHoldID)
- return u
- }
- // ClearHoldID clears the value of the "hold_id" field.
- func (u *BatchImageJobUpsert) ClearHoldID() *BatchImageJobUpsert {
- u.SetNull(batchimagejob.FieldHoldID)
- return u
- }
- // SetIdempotencyKey sets the "idempotency_key" field.
- func (u *BatchImageJobUpsert) SetIdempotencyKey(v string) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldIdempotencyKey, v)
- return u
- }
- // UpdateIdempotencyKey sets the "idempotency_key" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateIdempotencyKey() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldIdempotencyKey)
- return u
- }
- // ClearIdempotencyKey clears the value of the "idempotency_key" field.
- func (u *BatchImageJobUpsert) ClearIdempotencyKey() *BatchImageJobUpsert {
- u.SetNull(batchimagejob.FieldIdempotencyKey)
- return u
- }
- // SetRequestHash sets the "request_hash" field.
- func (u *BatchImageJobUpsert) SetRequestHash(v string) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldRequestHash, v)
- return u
- }
- // UpdateRequestHash sets the "request_hash" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateRequestHash() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldRequestHash)
- return u
- }
- // ClearRequestHash clears the value of the "request_hash" field.
- func (u *BatchImageJobUpsert) ClearRequestHash() *BatchImageJobUpsert {
- u.SetNull(batchimagejob.FieldRequestHash)
- return u
- }
- // SetManifestHash sets the "manifest_hash" field.
- func (u *BatchImageJobUpsert) SetManifestHash(v string) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldManifestHash, v)
- return u
- }
- // UpdateManifestHash sets the "manifest_hash" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateManifestHash() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldManifestHash)
- return u
- }
- // ClearManifestHash clears the value of the "manifest_hash" field.
- func (u *BatchImageJobUpsert) ClearManifestHash() *BatchImageJobUpsert {
- u.SetNull(batchimagejob.FieldManifestHash)
- return u
- }
- // SetRetryCount sets the "retry_count" field.
- func (u *BatchImageJobUpsert) SetRetryCount(v int) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldRetryCount, v)
- return u
- }
- // UpdateRetryCount sets the "retry_count" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateRetryCount() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldRetryCount)
- return u
- }
- // AddRetryCount adds v to the "retry_count" field.
- func (u *BatchImageJobUpsert) AddRetryCount(v int) *BatchImageJobUpsert {
- u.Add(batchimagejob.FieldRetryCount, v)
- return u
- }
- // SetVersion sets the "version" field.
- func (u *BatchImageJobUpsert) SetVersion(v int) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldVersion, v)
- return u
- }
- // UpdateVersion sets the "version" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateVersion() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldVersion)
- return u
- }
- // AddVersion adds v to the "version" field.
- func (u *BatchImageJobUpsert) AddVersion(v int) *BatchImageJobUpsert {
- u.Add(batchimagejob.FieldVersion, v)
- return u
- }
- // SetOutputExpiresAt sets the "output_expires_at" field.
- func (u *BatchImageJobUpsert) SetOutputExpiresAt(v time.Time) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldOutputExpiresAt, v)
- return u
- }
- // UpdateOutputExpiresAt sets the "output_expires_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateOutputExpiresAt() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldOutputExpiresAt)
- return u
- }
- // ClearOutputExpiresAt clears the value of the "output_expires_at" field.
- func (u *BatchImageJobUpsert) ClearOutputExpiresAt() *BatchImageJobUpsert {
- u.SetNull(batchimagejob.FieldOutputExpiresAt)
- return u
- }
- // SetInputDeletedAt sets the "input_deleted_at" field.
- func (u *BatchImageJobUpsert) SetInputDeletedAt(v time.Time) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldInputDeletedAt, v)
- return u
- }
- // UpdateInputDeletedAt sets the "input_deleted_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateInputDeletedAt() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldInputDeletedAt)
- return u
- }
- // ClearInputDeletedAt clears the value of the "input_deleted_at" field.
- func (u *BatchImageJobUpsert) ClearInputDeletedAt() *BatchImageJobUpsert {
- u.SetNull(batchimagejob.FieldInputDeletedAt)
- return u
- }
- // SetOutputDeletedAt sets the "output_deleted_at" field.
- func (u *BatchImageJobUpsert) SetOutputDeletedAt(v time.Time) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldOutputDeletedAt, v)
- return u
- }
- // UpdateOutputDeletedAt sets the "output_deleted_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateOutputDeletedAt() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldOutputDeletedAt)
- return u
- }
- // ClearOutputDeletedAt clears the value of the "output_deleted_at" field.
- func (u *BatchImageJobUpsert) ClearOutputDeletedAt() *BatchImageJobUpsert {
- u.SetNull(batchimagejob.FieldOutputDeletedAt)
- return u
- }
- // SetDownloadedAt sets the "downloaded_at" field.
- func (u *BatchImageJobUpsert) SetDownloadedAt(v time.Time) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldDownloadedAt, v)
- return u
- }
- // UpdateDownloadedAt sets the "downloaded_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateDownloadedAt() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldDownloadedAt)
- return u
- }
- // ClearDownloadedAt clears the value of the "downloaded_at" field.
- func (u *BatchImageJobUpsert) ClearDownloadedAt() *BatchImageJobUpsert {
- u.SetNull(batchimagejob.FieldDownloadedAt)
- return u
- }
- // SetUserDeletedAt sets the "user_deleted_at" field.
- func (u *BatchImageJobUpsert) SetUserDeletedAt(v time.Time) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldUserDeletedAt, v)
- return u
- }
- // UpdateUserDeletedAt sets the "user_deleted_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateUserDeletedAt() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldUserDeletedAt)
- return u
- }
- // ClearUserDeletedAt clears the value of the "user_deleted_at" field.
- func (u *BatchImageJobUpsert) ClearUserDeletedAt() *BatchImageJobUpsert {
- u.SetNull(batchimagejob.FieldUserDeletedAt)
- return u
- }
- // SetLastErrorCode sets the "last_error_code" field.
- func (u *BatchImageJobUpsert) SetLastErrorCode(v string) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldLastErrorCode, v)
- return u
- }
- // UpdateLastErrorCode sets the "last_error_code" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateLastErrorCode() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldLastErrorCode)
- return u
- }
- // ClearLastErrorCode clears the value of the "last_error_code" field.
- func (u *BatchImageJobUpsert) ClearLastErrorCode() *BatchImageJobUpsert {
- u.SetNull(batchimagejob.FieldLastErrorCode)
- return u
- }
- // SetLastErrorMessage sets the "last_error_message" field.
- func (u *BatchImageJobUpsert) SetLastErrorMessage(v string) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldLastErrorMessage, v)
- return u
- }
- // UpdateLastErrorMessage sets the "last_error_message" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateLastErrorMessage() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldLastErrorMessage)
- return u
- }
- // ClearLastErrorMessage clears the value of the "last_error_message" field.
- func (u *BatchImageJobUpsert) ClearLastErrorMessage() *BatchImageJobUpsert {
- u.SetNull(batchimagejob.FieldLastErrorMessage)
- return u
- }
- // SetUpdatedAt sets the "updated_at" field.
- func (u *BatchImageJobUpsert) SetUpdatedAt(v time.Time) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldUpdatedAt, v)
- return u
- }
- // UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateUpdatedAt() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldUpdatedAt)
- return u
- }
- // SetSubmittedAt sets the "submitted_at" field.
- func (u *BatchImageJobUpsert) SetSubmittedAt(v time.Time) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldSubmittedAt, v)
- return u
- }
- // UpdateSubmittedAt sets the "submitted_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateSubmittedAt() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldSubmittedAt)
- return u
- }
- // ClearSubmittedAt clears the value of the "submitted_at" field.
- func (u *BatchImageJobUpsert) ClearSubmittedAt() *BatchImageJobUpsert {
- u.SetNull(batchimagejob.FieldSubmittedAt)
- return u
- }
- // SetStartedAt sets the "started_at" field.
- func (u *BatchImageJobUpsert) SetStartedAt(v time.Time) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldStartedAt, v)
- return u
- }
- // UpdateStartedAt sets the "started_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateStartedAt() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldStartedAt)
- return u
- }
- // ClearStartedAt clears the value of the "started_at" field.
- func (u *BatchImageJobUpsert) ClearStartedAt() *BatchImageJobUpsert {
- u.SetNull(batchimagejob.FieldStartedAt)
- return u
- }
- // SetFinishedAt sets the "finished_at" field.
- func (u *BatchImageJobUpsert) SetFinishedAt(v time.Time) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldFinishedAt, v)
- return u
- }
- // UpdateFinishedAt sets the "finished_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateFinishedAt() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldFinishedAt)
- return u
- }
- // ClearFinishedAt clears the value of the "finished_at" field.
- func (u *BatchImageJobUpsert) ClearFinishedAt() *BatchImageJobUpsert {
- u.SetNull(batchimagejob.FieldFinishedAt)
- return u
- }
- // SetSettledAt sets the "settled_at" field.
- func (u *BatchImageJobUpsert) SetSettledAt(v time.Time) *BatchImageJobUpsert {
- u.Set(batchimagejob.FieldSettledAt, v)
- return u
- }
- // UpdateSettledAt sets the "settled_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsert) UpdateSettledAt() *BatchImageJobUpsert {
- u.SetExcluded(batchimagejob.FieldSettledAt)
- return u
- }
- // ClearSettledAt clears the value of the "settled_at" field.
- func (u *BatchImageJobUpsert) ClearSettledAt() *BatchImageJobUpsert {
- u.SetNull(batchimagejob.FieldSettledAt)
- return u
- }
- // UpdateNewValues updates the mutable fields using the new values that were set on create.
- // Using this option is equivalent to using:
- //
- // client.BatchImageJob.Create().
- // OnConflict(
- // sql.ResolveWithNewValues(),
- // ).
- // Exec(ctx)
- func (u *BatchImageJobUpsertOne) UpdateNewValues() *BatchImageJobUpsertOne {
- u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues())
- u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) {
- if _, exists := u.create.mutation.BatchID(); exists {
- s.SetIgnore(batchimagejob.FieldBatchID)
- }
- if _, exists := u.create.mutation.CreatedAt(); exists {
- s.SetIgnore(batchimagejob.FieldCreatedAt)
- }
- }))
- return u
- }
- // Ignore sets each column to itself in case of conflict.
- // Using this option is equivalent to using:
- //
- // client.BatchImageJob.Create().
- // OnConflict(sql.ResolveWithIgnore()).
- // Exec(ctx)
- func (u *BatchImageJobUpsertOne) Ignore() *BatchImageJobUpsertOne {
- u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore())
- return u
- }
- // DoNothing configures the conflict_action to `DO NOTHING`.
- // Supported only by SQLite and PostgreSQL.
- func (u *BatchImageJobUpsertOne) DoNothing() *BatchImageJobUpsertOne {
- u.create.conflict = append(u.create.conflict, sql.DoNothing())
- return u
- }
- // Update allows overriding fields `UPDATE` values. See the BatchImageJobCreate.OnConflict
- // documentation for more info.
- func (u *BatchImageJobUpsertOne) Update(set func(*BatchImageJobUpsert)) *BatchImageJobUpsertOne {
- u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
- set(&BatchImageJobUpsert{UpdateSet: update})
- }))
- return u
- }
- // SetUserID sets the "user_id" field.
- func (u *BatchImageJobUpsertOne) SetUserID(v int64) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetUserID(v)
- })
- }
- // AddUserID adds v to the "user_id" field.
- func (u *BatchImageJobUpsertOne) AddUserID(v int64) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.AddUserID(v)
- })
- }
- // UpdateUserID sets the "user_id" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateUserID() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateUserID()
- })
- }
- // SetAPIKeyID sets the "api_key_id" field.
- func (u *BatchImageJobUpsertOne) SetAPIKeyID(v int64) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetAPIKeyID(v)
- })
- }
- // AddAPIKeyID adds v to the "api_key_id" field.
- func (u *BatchImageJobUpsertOne) AddAPIKeyID(v int64) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.AddAPIKeyID(v)
- })
- }
- // UpdateAPIKeyID sets the "api_key_id" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateAPIKeyID() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateAPIKeyID()
- })
- }
- // ClearAPIKeyID clears the value of the "api_key_id" field.
- func (u *BatchImageJobUpsertOne) ClearAPIKeyID() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearAPIKeyID()
- })
- }
- // SetAccountID sets the "account_id" field.
- func (u *BatchImageJobUpsertOne) SetAccountID(v int64) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetAccountID(v)
- })
- }
- // AddAccountID adds v to the "account_id" field.
- func (u *BatchImageJobUpsertOne) AddAccountID(v int64) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.AddAccountID(v)
- })
- }
- // UpdateAccountID sets the "account_id" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateAccountID() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateAccountID()
- })
- }
- // ClearAccountID clears the value of the "account_id" field.
- func (u *BatchImageJobUpsertOne) ClearAccountID() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearAccountID()
- })
- }
- // SetProvider sets the "provider" field.
- func (u *BatchImageJobUpsertOne) SetProvider(v string) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetProvider(v)
- })
- }
- // UpdateProvider sets the "provider" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateProvider() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateProvider()
- })
- }
- // SetModel sets the "model" field.
- func (u *BatchImageJobUpsertOne) SetModel(v string) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetModel(v)
- })
- }
- // UpdateModel sets the "model" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateModel() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateModel()
- })
- }
- // SetTaskName sets the "task_name" field.
- func (u *BatchImageJobUpsertOne) SetTaskName(v string) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetTaskName(v)
- })
- }
- // UpdateTaskName sets the "task_name" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateTaskName() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateTaskName()
- })
- }
- // SetStatus sets the "status" field.
- func (u *BatchImageJobUpsertOne) SetStatus(v string) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetStatus(v)
- })
- }
- // UpdateStatus sets the "status" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateStatus() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateStatus()
- })
- }
- // SetProviderJobName sets the "provider_job_name" field.
- func (u *BatchImageJobUpsertOne) SetProviderJobName(v string) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetProviderJobName(v)
- })
- }
- // UpdateProviderJobName sets the "provider_job_name" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateProviderJobName() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateProviderJobName()
- })
- }
- // ClearProviderJobName clears the value of the "provider_job_name" field.
- func (u *BatchImageJobUpsertOne) ClearProviderJobName() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearProviderJobName()
- })
- }
- // SetProviderInputRef sets the "provider_input_ref" field.
- func (u *BatchImageJobUpsertOne) SetProviderInputRef(v string) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetProviderInputRef(v)
- })
- }
- // UpdateProviderInputRef sets the "provider_input_ref" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateProviderInputRef() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateProviderInputRef()
- })
- }
- // ClearProviderInputRef clears the value of the "provider_input_ref" field.
- func (u *BatchImageJobUpsertOne) ClearProviderInputRef() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearProviderInputRef()
- })
- }
- // SetProviderOutputRef sets the "provider_output_ref" field.
- func (u *BatchImageJobUpsertOne) SetProviderOutputRef(v string) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetProviderOutputRef(v)
- })
- }
- // UpdateProviderOutputRef sets the "provider_output_ref" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateProviderOutputRef() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateProviderOutputRef()
- })
- }
- // ClearProviderOutputRef clears the value of the "provider_output_ref" field.
- func (u *BatchImageJobUpsertOne) ClearProviderOutputRef() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearProviderOutputRef()
- })
- }
- // SetGcsInputURI sets the "gcs_input_uri" field.
- func (u *BatchImageJobUpsertOne) SetGcsInputURI(v string) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetGcsInputURI(v)
- })
- }
- // UpdateGcsInputURI sets the "gcs_input_uri" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateGcsInputURI() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateGcsInputURI()
- })
- }
- // ClearGcsInputURI clears the value of the "gcs_input_uri" field.
- func (u *BatchImageJobUpsertOne) ClearGcsInputURI() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearGcsInputURI()
- })
- }
- // SetGcsOutputURI sets the "gcs_output_uri" field.
- func (u *BatchImageJobUpsertOne) SetGcsOutputURI(v string) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetGcsOutputURI(v)
- })
- }
- // UpdateGcsOutputURI sets the "gcs_output_uri" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateGcsOutputURI() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateGcsOutputURI()
- })
- }
- // ClearGcsOutputURI clears the value of the "gcs_output_uri" field.
- func (u *BatchImageJobUpsertOne) ClearGcsOutputURI() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearGcsOutputURI()
- })
- }
- // SetItemCount sets the "item_count" field.
- func (u *BatchImageJobUpsertOne) SetItemCount(v int) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetItemCount(v)
- })
- }
- // AddItemCount adds v to the "item_count" field.
- func (u *BatchImageJobUpsertOne) AddItemCount(v int) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.AddItemCount(v)
- })
- }
- // UpdateItemCount sets the "item_count" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateItemCount() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateItemCount()
- })
- }
- // SetSuccessCount sets the "success_count" field.
- func (u *BatchImageJobUpsertOne) SetSuccessCount(v int) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetSuccessCount(v)
- })
- }
- // AddSuccessCount adds v to the "success_count" field.
- func (u *BatchImageJobUpsertOne) AddSuccessCount(v int) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.AddSuccessCount(v)
- })
- }
- // UpdateSuccessCount sets the "success_count" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateSuccessCount() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateSuccessCount()
- })
- }
- // SetFailCount sets the "fail_count" field.
- func (u *BatchImageJobUpsertOne) SetFailCount(v int) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetFailCount(v)
- })
- }
- // AddFailCount adds v to the "fail_count" field.
- func (u *BatchImageJobUpsertOne) AddFailCount(v int) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.AddFailCount(v)
- })
- }
- // UpdateFailCount sets the "fail_count" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateFailCount() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateFailCount()
- })
- }
- // SetCancelledCount sets the "cancelled_count" field.
- func (u *BatchImageJobUpsertOne) SetCancelledCount(v int) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetCancelledCount(v)
- })
- }
- // AddCancelledCount adds v to the "cancelled_count" field.
- func (u *BatchImageJobUpsertOne) AddCancelledCount(v int) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.AddCancelledCount(v)
- })
- }
- // UpdateCancelledCount sets the "cancelled_count" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateCancelledCount() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateCancelledCount()
- })
- }
- // SetEstimatedCost sets the "estimated_cost" field.
- func (u *BatchImageJobUpsertOne) SetEstimatedCost(v float64) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetEstimatedCost(v)
- })
- }
- // AddEstimatedCost adds v to the "estimated_cost" field.
- func (u *BatchImageJobUpsertOne) AddEstimatedCost(v float64) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.AddEstimatedCost(v)
- })
- }
- // UpdateEstimatedCost sets the "estimated_cost" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateEstimatedCost() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateEstimatedCost()
- })
- }
- // SetHoldAmount sets the "hold_amount" field.
- func (u *BatchImageJobUpsertOne) SetHoldAmount(v float64) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetHoldAmount(v)
- })
- }
- // AddHoldAmount adds v to the "hold_amount" field.
- func (u *BatchImageJobUpsertOne) AddHoldAmount(v float64) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.AddHoldAmount(v)
- })
- }
- // UpdateHoldAmount sets the "hold_amount" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateHoldAmount() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateHoldAmount()
- })
- }
- // ClearHoldAmount clears the value of the "hold_amount" field.
- func (u *BatchImageJobUpsertOne) ClearHoldAmount() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearHoldAmount()
- })
- }
- // SetActualCost sets the "actual_cost" field.
- func (u *BatchImageJobUpsertOne) SetActualCost(v float64) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetActualCost(v)
- })
- }
- // AddActualCost adds v to the "actual_cost" field.
- func (u *BatchImageJobUpsertOne) AddActualCost(v float64) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.AddActualCost(v)
- })
- }
- // UpdateActualCost sets the "actual_cost" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateActualCost() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateActualCost()
- })
- }
- // ClearActualCost clears the value of the "actual_cost" field.
- func (u *BatchImageJobUpsertOne) ClearActualCost() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearActualCost()
- })
- }
- // SetCurrency sets the "currency" field.
- func (u *BatchImageJobUpsertOne) SetCurrency(v string) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetCurrency(v)
- })
- }
- // UpdateCurrency sets the "currency" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateCurrency() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateCurrency()
- })
- }
- // SetHoldID sets the "hold_id" field.
- func (u *BatchImageJobUpsertOne) SetHoldID(v string) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetHoldID(v)
- })
- }
- // UpdateHoldID sets the "hold_id" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateHoldID() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateHoldID()
- })
- }
- // ClearHoldID clears the value of the "hold_id" field.
- func (u *BatchImageJobUpsertOne) ClearHoldID() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearHoldID()
- })
- }
- // SetIdempotencyKey sets the "idempotency_key" field.
- func (u *BatchImageJobUpsertOne) SetIdempotencyKey(v string) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetIdempotencyKey(v)
- })
- }
- // UpdateIdempotencyKey sets the "idempotency_key" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateIdempotencyKey() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateIdempotencyKey()
- })
- }
- // ClearIdempotencyKey clears the value of the "idempotency_key" field.
- func (u *BatchImageJobUpsertOne) ClearIdempotencyKey() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearIdempotencyKey()
- })
- }
- // SetRequestHash sets the "request_hash" field.
- func (u *BatchImageJobUpsertOne) SetRequestHash(v string) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetRequestHash(v)
- })
- }
- // UpdateRequestHash sets the "request_hash" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateRequestHash() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateRequestHash()
- })
- }
- // ClearRequestHash clears the value of the "request_hash" field.
- func (u *BatchImageJobUpsertOne) ClearRequestHash() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearRequestHash()
- })
- }
- // SetManifestHash sets the "manifest_hash" field.
- func (u *BatchImageJobUpsertOne) SetManifestHash(v string) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetManifestHash(v)
- })
- }
- // UpdateManifestHash sets the "manifest_hash" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateManifestHash() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateManifestHash()
- })
- }
- // ClearManifestHash clears the value of the "manifest_hash" field.
- func (u *BatchImageJobUpsertOne) ClearManifestHash() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearManifestHash()
- })
- }
- // SetRetryCount sets the "retry_count" field.
- func (u *BatchImageJobUpsertOne) SetRetryCount(v int) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetRetryCount(v)
- })
- }
- // AddRetryCount adds v to the "retry_count" field.
- func (u *BatchImageJobUpsertOne) AddRetryCount(v int) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.AddRetryCount(v)
- })
- }
- // UpdateRetryCount sets the "retry_count" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateRetryCount() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateRetryCount()
- })
- }
- // SetVersion sets the "version" field.
- func (u *BatchImageJobUpsertOne) SetVersion(v int) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetVersion(v)
- })
- }
- // AddVersion adds v to the "version" field.
- func (u *BatchImageJobUpsertOne) AddVersion(v int) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.AddVersion(v)
- })
- }
- // UpdateVersion sets the "version" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateVersion() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateVersion()
- })
- }
- // SetOutputExpiresAt sets the "output_expires_at" field.
- func (u *BatchImageJobUpsertOne) SetOutputExpiresAt(v time.Time) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetOutputExpiresAt(v)
- })
- }
- // UpdateOutputExpiresAt sets the "output_expires_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateOutputExpiresAt() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateOutputExpiresAt()
- })
- }
- // ClearOutputExpiresAt clears the value of the "output_expires_at" field.
- func (u *BatchImageJobUpsertOne) ClearOutputExpiresAt() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearOutputExpiresAt()
- })
- }
- // SetInputDeletedAt sets the "input_deleted_at" field.
- func (u *BatchImageJobUpsertOne) SetInputDeletedAt(v time.Time) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetInputDeletedAt(v)
- })
- }
- // UpdateInputDeletedAt sets the "input_deleted_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateInputDeletedAt() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateInputDeletedAt()
- })
- }
- // ClearInputDeletedAt clears the value of the "input_deleted_at" field.
- func (u *BatchImageJobUpsertOne) ClearInputDeletedAt() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearInputDeletedAt()
- })
- }
- // SetOutputDeletedAt sets the "output_deleted_at" field.
- func (u *BatchImageJobUpsertOne) SetOutputDeletedAt(v time.Time) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetOutputDeletedAt(v)
- })
- }
- // UpdateOutputDeletedAt sets the "output_deleted_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateOutputDeletedAt() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateOutputDeletedAt()
- })
- }
- // ClearOutputDeletedAt clears the value of the "output_deleted_at" field.
- func (u *BatchImageJobUpsertOne) ClearOutputDeletedAt() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearOutputDeletedAt()
- })
- }
- // SetDownloadedAt sets the "downloaded_at" field.
- func (u *BatchImageJobUpsertOne) SetDownloadedAt(v time.Time) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetDownloadedAt(v)
- })
- }
- // UpdateDownloadedAt sets the "downloaded_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateDownloadedAt() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateDownloadedAt()
- })
- }
- // ClearDownloadedAt clears the value of the "downloaded_at" field.
- func (u *BatchImageJobUpsertOne) ClearDownloadedAt() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearDownloadedAt()
- })
- }
- // SetUserDeletedAt sets the "user_deleted_at" field.
- func (u *BatchImageJobUpsertOne) SetUserDeletedAt(v time.Time) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetUserDeletedAt(v)
- })
- }
- // UpdateUserDeletedAt sets the "user_deleted_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateUserDeletedAt() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateUserDeletedAt()
- })
- }
- // ClearUserDeletedAt clears the value of the "user_deleted_at" field.
- func (u *BatchImageJobUpsertOne) ClearUserDeletedAt() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearUserDeletedAt()
- })
- }
- // SetLastErrorCode sets the "last_error_code" field.
- func (u *BatchImageJobUpsertOne) SetLastErrorCode(v string) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetLastErrorCode(v)
- })
- }
- // UpdateLastErrorCode sets the "last_error_code" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateLastErrorCode() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateLastErrorCode()
- })
- }
- // ClearLastErrorCode clears the value of the "last_error_code" field.
- func (u *BatchImageJobUpsertOne) ClearLastErrorCode() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearLastErrorCode()
- })
- }
- // SetLastErrorMessage sets the "last_error_message" field.
- func (u *BatchImageJobUpsertOne) SetLastErrorMessage(v string) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetLastErrorMessage(v)
- })
- }
- // UpdateLastErrorMessage sets the "last_error_message" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateLastErrorMessage() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateLastErrorMessage()
- })
- }
- // ClearLastErrorMessage clears the value of the "last_error_message" field.
- func (u *BatchImageJobUpsertOne) ClearLastErrorMessage() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearLastErrorMessage()
- })
- }
- // SetUpdatedAt sets the "updated_at" field.
- func (u *BatchImageJobUpsertOne) SetUpdatedAt(v time.Time) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetUpdatedAt(v)
- })
- }
- // UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateUpdatedAt() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateUpdatedAt()
- })
- }
- // SetSubmittedAt sets the "submitted_at" field.
- func (u *BatchImageJobUpsertOne) SetSubmittedAt(v time.Time) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetSubmittedAt(v)
- })
- }
- // UpdateSubmittedAt sets the "submitted_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateSubmittedAt() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateSubmittedAt()
- })
- }
- // ClearSubmittedAt clears the value of the "submitted_at" field.
- func (u *BatchImageJobUpsertOne) ClearSubmittedAt() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearSubmittedAt()
- })
- }
- // SetStartedAt sets the "started_at" field.
- func (u *BatchImageJobUpsertOne) SetStartedAt(v time.Time) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetStartedAt(v)
- })
- }
- // UpdateStartedAt sets the "started_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateStartedAt() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateStartedAt()
- })
- }
- // ClearStartedAt clears the value of the "started_at" field.
- func (u *BatchImageJobUpsertOne) ClearStartedAt() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearStartedAt()
- })
- }
- // SetFinishedAt sets the "finished_at" field.
- func (u *BatchImageJobUpsertOne) SetFinishedAt(v time.Time) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetFinishedAt(v)
- })
- }
- // UpdateFinishedAt sets the "finished_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateFinishedAt() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateFinishedAt()
- })
- }
- // ClearFinishedAt clears the value of the "finished_at" field.
- func (u *BatchImageJobUpsertOne) ClearFinishedAt() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearFinishedAt()
- })
- }
- // SetSettledAt sets the "settled_at" field.
- func (u *BatchImageJobUpsertOne) SetSettledAt(v time.Time) *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetSettledAt(v)
- })
- }
- // UpdateSettledAt sets the "settled_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsertOne) UpdateSettledAt() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateSettledAt()
- })
- }
- // ClearSettledAt clears the value of the "settled_at" field.
- func (u *BatchImageJobUpsertOne) ClearSettledAt() *BatchImageJobUpsertOne {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearSettledAt()
- })
- }
- // Exec executes the query.
- func (u *BatchImageJobUpsertOne) Exec(ctx context.Context) error {
- if len(u.create.conflict) == 0 {
- return errors.New("ent: missing options for BatchImageJobCreate.OnConflict")
- }
- return u.create.Exec(ctx)
- }
- // ExecX is like Exec, but panics if an error occurs.
- func (u *BatchImageJobUpsertOne) ExecX(ctx context.Context) {
- if err := u.create.Exec(ctx); err != nil {
- panic(err)
- }
- }
- // Exec executes the UPSERT query and returns the inserted/updated ID.
- func (u *BatchImageJobUpsertOne) ID(ctx context.Context) (id int64, err error) {
- node, err := u.create.Save(ctx)
- if err != nil {
- return id, err
- }
- return node.ID, nil
- }
- // IDX is like ID, but panics if an error occurs.
- func (u *BatchImageJobUpsertOne) IDX(ctx context.Context) int64 {
- id, err := u.ID(ctx)
- if err != nil {
- panic(err)
- }
- return id
- }
- // BatchImageJobCreateBulk is the builder for creating many BatchImageJob entities in bulk.
- type BatchImageJobCreateBulk struct {
- config
- err error
- builders []*BatchImageJobCreate
- conflict []sql.ConflictOption
- }
- // Save creates the BatchImageJob entities in the database.
- func (_c *BatchImageJobCreateBulk) Save(ctx context.Context) ([]*BatchImageJob, error) {
- if _c.err != nil {
- return nil, _c.err
- }
- specs := make([]*sqlgraph.CreateSpec, len(_c.builders))
- nodes := make([]*BatchImageJob, len(_c.builders))
- mutators := make([]Mutator, len(_c.builders))
- for i := range _c.builders {
- func(i int, root context.Context) {
- builder := _c.builders[i]
- builder.defaults()
- var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
- mutation, ok := m.(*BatchImageJobMutation)
- if !ok {
- return nil, fmt.Errorf("unexpected mutation type %T", m)
- }
- if err := builder.check(); err != nil {
- return nil, err
- }
- builder.mutation = mutation
- var err error
- nodes[i], specs[i] = builder.createSpec()
- if i < len(mutators)-1 {
- _, err = mutators[i+1].Mutate(root, _c.builders[i+1].mutation)
- } else {
- spec := &sqlgraph.BatchCreateSpec{Nodes: specs}
- spec.OnConflict = _c.conflict
- // Invoke the actual operation on the latest mutation in the chain.
- if err = sqlgraph.BatchCreate(ctx, _c.driver, spec); err != nil {
- if sqlgraph.IsConstraintError(err) {
- err = &ConstraintError{msg: err.Error(), wrap: err}
- }
- }
- }
- if err != nil {
- return nil, err
- }
- mutation.id = &nodes[i].ID
- if specs[i].ID.Value != nil {
- id := specs[i].ID.Value.(int64)
- nodes[i].ID = int64(id)
- }
- mutation.done = true
- return nodes[i], nil
- })
- for i := len(builder.hooks) - 1; i >= 0; i-- {
- mut = builder.hooks[i](mut)
- }
- mutators[i] = mut
- }(i, ctx)
- }
- if len(mutators) > 0 {
- if _, err := mutators[0].Mutate(ctx, _c.builders[0].mutation); err != nil {
- return nil, err
- }
- }
- return nodes, nil
- }
- // SaveX is like Save, but panics if an error occurs.
- func (_c *BatchImageJobCreateBulk) SaveX(ctx context.Context) []*BatchImageJob {
- v, err := _c.Save(ctx)
- if err != nil {
- panic(err)
- }
- return v
- }
- // Exec executes the query.
- func (_c *BatchImageJobCreateBulk) Exec(ctx context.Context) error {
- _, err := _c.Save(ctx)
- return err
- }
- // ExecX is like Exec, but panics if an error occurs.
- func (_c *BatchImageJobCreateBulk) ExecX(ctx context.Context) {
- if err := _c.Exec(ctx); err != nil {
- panic(err)
- }
- }
- // OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
- // of the `INSERT` statement. For example:
- //
- // client.BatchImageJob.CreateBulk(builders...).
- // OnConflict(
- // // Update the row with the new values
- // // the was proposed for insertion.
- // sql.ResolveWithNewValues(),
- // ).
- // // Override some of the fields with custom
- // // update values.
- // Update(func(u *ent.BatchImageJobUpsert) {
- // SetBatchID(v+v).
- // }).
- // Exec(ctx)
- func (_c *BatchImageJobCreateBulk) OnConflict(opts ...sql.ConflictOption) *BatchImageJobUpsertBulk {
- _c.conflict = opts
- return &BatchImageJobUpsertBulk{
- create: _c,
- }
- }
- // OnConflictColumns calls `OnConflict` and configures the columns
- // as conflict target. Using this option is equivalent to using:
- //
- // client.BatchImageJob.Create().
- // OnConflict(sql.ConflictColumns(columns...)).
- // Exec(ctx)
- func (_c *BatchImageJobCreateBulk) OnConflictColumns(columns ...string) *BatchImageJobUpsertBulk {
- _c.conflict = append(_c.conflict, sql.ConflictColumns(columns...))
- return &BatchImageJobUpsertBulk{
- create: _c,
- }
- }
- // BatchImageJobUpsertBulk is the builder for "upsert"-ing
- // a bulk of BatchImageJob nodes.
- type BatchImageJobUpsertBulk struct {
- create *BatchImageJobCreateBulk
- }
- // UpdateNewValues updates the mutable fields using the new values that
- // were set on create. Using this option is equivalent to using:
- //
- // client.BatchImageJob.Create().
- // OnConflict(
- // sql.ResolveWithNewValues(),
- // ).
- // Exec(ctx)
- func (u *BatchImageJobUpsertBulk) UpdateNewValues() *BatchImageJobUpsertBulk {
- u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues())
- u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) {
- for _, b := range u.create.builders {
- if _, exists := b.mutation.BatchID(); exists {
- s.SetIgnore(batchimagejob.FieldBatchID)
- }
- if _, exists := b.mutation.CreatedAt(); exists {
- s.SetIgnore(batchimagejob.FieldCreatedAt)
- }
- }
- }))
- return u
- }
- // Ignore sets each column to itself in case of conflict.
- // Using this option is equivalent to using:
- //
- // client.BatchImageJob.Create().
- // OnConflict(sql.ResolveWithIgnore()).
- // Exec(ctx)
- func (u *BatchImageJobUpsertBulk) Ignore() *BatchImageJobUpsertBulk {
- u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore())
- return u
- }
- // DoNothing configures the conflict_action to `DO NOTHING`.
- // Supported only by SQLite and PostgreSQL.
- func (u *BatchImageJobUpsertBulk) DoNothing() *BatchImageJobUpsertBulk {
- u.create.conflict = append(u.create.conflict, sql.DoNothing())
- return u
- }
- // Update allows overriding fields `UPDATE` values. See the BatchImageJobCreateBulk.OnConflict
- // documentation for more info.
- func (u *BatchImageJobUpsertBulk) Update(set func(*BatchImageJobUpsert)) *BatchImageJobUpsertBulk {
- u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
- set(&BatchImageJobUpsert{UpdateSet: update})
- }))
- return u
- }
- // SetUserID sets the "user_id" field.
- func (u *BatchImageJobUpsertBulk) SetUserID(v int64) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetUserID(v)
- })
- }
- // AddUserID adds v to the "user_id" field.
- func (u *BatchImageJobUpsertBulk) AddUserID(v int64) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.AddUserID(v)
- })
- }
- // UpdateUserID sets the "user_id" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateUserID() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateUserID()
- })
- }
- // SetAPIKeyID sets the "api_key_id" field.
- func (u *BatchImageJobUpsertBulk) SetAPIKeyID(v int64) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetAPIKeyID(v)
- })
- }
- // AddAPIKeyID adds v to the "api_key_id" field.
- func (u *BatchImageJobUpsertBulk) AddAPIKeyID(v int64) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.AddAPIKeyID(v)
- })
- }
- // UpdateAPIKeyID sets the "api_key_id" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateAPIKeyID() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateAPIKeyID()
- })
- }
- // ClearAPIKeyID clears the value of the "api_key_id" field.
- func (u *BatchImageJobUpsertBulk) ClearAPIKeyID() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearAPIKeyID()
- })
- }
- // SetAccountID sets the "account_id" field.
- func (u *BatchImageJobUpsertBulk) SetAccountID(v int64) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetAccountID(v)
- })
- }
- // AddAccountID adds v to the "account_id" field.
- func (u *BatchImageJobUpsertBulk) AddAccountID(v int64) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.AddAccountID(v)
- })
- }
- // UpdateAccountID sets the "account_id" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateAccountID() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateAccountID()
- })
- }
- // ClearAccountID clears the value of the "account_id" field.
- func (u *BatchImageJobUpsertBulk) ClearAccountID() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearAccountID()
- })
- }
- // SetProvider sets the "provider" field.
- func (u *BatchImageJobUpsertBulk) SetProvider(v string) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetProvider(v)
- })
- }
- // UpdateProvider sets the "provider" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateProvider() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateProvider()
- })
- }
- // SetModel sets the "model" field.
- func (u *BatchImageJobUpsertBulk) SetModel(v string) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetModel(v)
- })
- }
- // UpdateModel sets the "model" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateModel() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateModel()
- })
- }
- // SetTaskName sets the "task_name" field.
- func (u *BatchImageJobUpsertBulk) SetTaskName(v string) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetTaskName(v)
- })
- }
- // UpdateTaskName sets the "task_name" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateTaskName() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateTaskName()
- })
- }
- // SetStatus sets the "status" field.
- func (u *BatchImageJobUpsertBulk) SetStatus(v string) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetStatus(v)
- })
- }
- // UpdateStatus sets the "status" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateStatus() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateStatus()
- })
- }
- // SetProviderJobName sets the "provider_job_name" field.
- func (u *BatchImageJobUpsertBulk) SetProviderJobName(v string) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetProviderJobName(v)
- })
- }
- // UpdateProviderJobName sets the "provider_job_name" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateProviderJobName() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateProviderJobName()
- })
- }
- // ClearProviderJobName clears the value of the "provider_job_name" field.
- func (u *BatchImageJobUpsertBulk) ClearProviderJobName() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearProviderJobName()
- })
- }
- // SetProviderInputRef sets the "provider_input_ref" field.
- func (u *BatchImageJobUpsertBulk) SetProviderInputRef(v string) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetProviderInputRef(v)
- })
- }
- // UpdateProviderInputRef sets the "provider_input_ref" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateProviderInputRef() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateProviderInputRef()
- })
- }
- // ClearProviderInputRef clears the value of the "provider_input_ref" field.
- func (u *BatchImageJobUpsertBulk) ClearProviderInputRef() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearProviderInputRef()
- })
- }
- // SetProviderOutputRef sets the "provider_output_ref" field.
- func (u *BatchImageJobUpsertBulk) SetProviderOutputRef(v string) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetProviderOutputRef(v)
- })
- }
- // UpdateProviderOutputRef sets the "provider_output_ref" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateProviderOutputRef() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateProviderOutputRef()
- })
- }
- // ClearProviderOutputRef clears the value of the "provider_output_ref" field.
- func (u *BatchImageJobUpsertBulk) ClearProviderOutputRef() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearProviderOutputRef()
- })
- }
- // SetGcsInputURI sets the "gcs_input_uri" field.
- func (u *BatchImageJobUpsertBulk) SetGcsInputURI(v string) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetGcsInputURI(v)
- })
- }
- // UpdateGcsInputURI sets the "gcs_input_uri" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateGcsInputURI() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateGcsInputURI()
- })
- }
- // ClearGcsInputURI clears the value of the "gcs_input_uri" field.
- func (u *BatchImageJobUpsertBulk) ClearGcsInputURI() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearGcsInputURI()
- })
- }
- // SetGcsOutputURI sets the "gcs_output_uri" field.
- func (u *BatchImageJobUpsertBulk) SetGcsOutputURI(v string) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetGcsOutputURI(v)
- })
- }
- // UpdateGcsOutputURI sets the "gcs_output_uri" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateGcsOutputURI() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateGcsOutputURI()
- })
- }
- // ClearGcsOutputURI clears the value of the "gcs_output_uri" field.
- func (u *BatchImageJobUpsertBulk) ClearGcsOutputURI() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearGcsOutputURI()
- })
- }
- // SetItemCount sets the "item_count" field.
- func (u *BatchImageJobUpsertBulk) SetItemCount(v int) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetItemCount(v)
- })
- }
- // AddItemCount adds v to the "item_count" field.
- func (u *BatchImageJobUpsertBulk) AddItemCount(v int) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.AddItemCount(v)
- })
- }
- // UpdateItemCount sets the "item_count" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateItemCount() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateItemCount()
- })
- }
- // SetSuccessCount sets the "success_count" field.
- func (u *BatchImageJobUpsertBulk) SetSuccessCount(v int) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetSuccessCount(v)
- })
- }
- // AddSuccessCount adds v to the "success_count" field.
- func (u *BatchImageJobUpsertBulk) AddSuccessCount(v int) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.AddSuccessCount(v)
- })
- }
- // UpdateSuccessCount sets the "success_count" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateSuccessCount() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateSuccessCount()
- })
- }
- // SetFailCount sets the "fail_count" field.
- func (u *BatchImageJobUpsertBulk) SetFailCount(v int) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetFailCount(v)
- })
- }
- // AddFailCount adds v to the "fail_count" field.
- func (u *BatchImageJobUpsertBulk) AddFailCount(v int) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.AddFailCount(v)
- })
- }
- // UpdateFailCount sets the "fail_count" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateFailCount() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateFailCount()
- })
- }
- // SetCancelledCount sets the "cancelled_count" field.
- func (u *BatchImageJobUpsertBulk) SetCancelledCount(v int) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetCancelledCount(v)
- })
- }
- // AddCancelledCount adds v to the "cancelled_count" field.
- func (u *BatchImageJobUpsertBulk) AddCancelledCount(v int) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.AddCancelledCount(v)
- })
- }
- // UpdateCancelledCount sets the "cancelled_count" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateCancelledCount() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateCancelledCount()
- })
- }
- // SetEstimatedCost sets the "estimated_cost" field.
- func (u *BatchImageJobUpsertBulk) SetEstimatedCost(v float64) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetEstimatedCost(v)
- })
- }
- // AddEstimatedCost adds v to the "estimated_cost" field.
- func (u *BatchImageJobUpsertBulk) AddEstimatedCost(v float64) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.AddEstimatedCost(v)
- })
- }
- // UpdateEstimatedCost sets the "estimated_cost" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateEstimatedCost() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateEstimatedCost()
- })
- }
- // SetHoldAmount sets the "hold_amount" field.
- func (u *BatchImageJobUpsertBulk) SetHoldAmount(v float64) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetHoldAmount(v)
- })
- }
- // AddHoldAmount adds v to the "hold_amount" field.
- func (u *BatchImageJobUpsertBulk) AddHoldAmount(v float64) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.AddHoldAmount(v)
- })
- }
- // UpdateHoldAmount sets the "hold_amount" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateHoldAmount() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateHoldAmount()
- })
- }
- // ClearHoldAmount clears the value of the "hold_amount" field.
- func (u *BatchImageJobUpsertBulk) ClearHoldAmount() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearHoldAmount()
- })
- }
- // SetActualCost sets the "actual_cost" field.
- func (u *BatchImageJobUpsertBulk) SetActualCost(v float64) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetActualCost(v)
- })
- }
- // AddActualCost adds v to the "actual_cost" field.
- func (u *BatchImageJobUpsertBulk) AddActualCost(v float64) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.AddActualCost(v)
- })
- }
- // UpdateActualCost sets the "actual_cost" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateActualCost() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateActualCost()
- })
- }
- // ClearActualCost clears the value of the "actual_cost" field.
- func (u *BatchImageJobUpsertBulk) ClearActualCost() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearActualCost()
- })
- }
- // SetCurrency sets the "currency" field.
- func (u *BatchImageJobUpsertBulk) SetCurrency(v string) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetCurrency(v)
- })
- }
- // UpdateCurrency sets the "currency" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateCurrency() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateCurrency()
- })
- }
- // SetHoldID sets the "hold_id" field.
- func (u *BatchImageJobUpsertBulk) SetHoldID(v string) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetHoldID(v)
- })
- }
- // UpdateHoldID sets the "hold_id" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateHoldID() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateHoldID()
- })
- }
- // ClearHoldID clears the value of the "hold_id" field.
- func (u *BatchImageJobUpsertBulk) ClearHoldID() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearHoldID()
- })
- }
- // SetIdempotencyKey sets the "idempotency_key" field.
- func (u *BatchImageJobUpsertBulk) SetIdempotencyKey(v string) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetIdempotencyKey(v)
- })
- }
- // UpdateIdempotencyKey sets the "idempotency_key" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateIdempotencyKey() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateIdempotencyKey()
- })
- }
- // ClearIdempotencyKey clears the value of the "idempotency_key" field.
- func (u *BatchImageJobUpsertBulk) ClearIdempotencyKey() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearIdempotencyKey()
- })
- }
- // SetRequestHash sets the "request_hash" field.
- func (u *BatchImageJobUpsertBulk) SetRequestHash(v string) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetRequestHash(v)
- })
- }
- // UpdateRequestHash sets the "request_hash" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateRequestHash() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateRequestHash()
- })
- }
- // ClearRequestHash clears the value of the "request_hash" field.
- func (u *BatchImageJobUpsertBulk) ClearRequestHash() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearRequestHash()
- })
- }
- // SetManifestHash sets the "manifest_hash" field.
- func (u *BatchImageJobUpsertBulk) SetManifestHash(v string) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetManifestHash(v)
- })
- }
- // UpdateManifestHash sets the "manifest_hash" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateManifestHash() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateManifestHash()
- })
- }
- // ClearManifestHash clears the value of the "manifest_hash" field.
- func (u *BatchImageJobUpsertBulk) ClearManifestHash() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearManifestHash()
- })
- }
- // SetRetryCount sets the "retry_count" field.
- func (u *BatchImageJobUpsertBulk) SetRetryCount(v int) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetRetryCount(v)
- })
- }
- // AddRetryCount adds v to the "retry_count" field.
- func (u *BatchImageJobUpsertBulk) AddRetryCount(v int) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.AddRetryCount(v)
- })
- }
- // UpdateRetryCount sets the "retry_count" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateRetryCount() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateRetryCount()
- })
- }
- // SetVersion sets the "version" field.
- func (u *BatchImageJobUpsertBulk) SetVersion(v int) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetVersion(v)
- })
- }
- // AddVersion adds v to the "version" field.
- func (u *BatchImageJobUpsertBulk) AddVersion(v int) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.AddVersion(v)
- })
- }
- // UpdateVersion sets the "version" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateVersion() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateVersion()
- })
- }
- // SetOutputExpiresAt sets the "output_expires_at" field.
- func (u *BatchImageJobUpsertBulk) SetOutputExpiresAt(v time.Time) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetOutputExpiresAt(v)
- })
- }
- // UpdateOutputExpiresAt sets the "output_expires_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateOutputExpiresAt() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateOutputExpiresAt()
- })
- }
- // ClearOutputExpiresAt clears the value of the "output_expires_at" field.
- func (u *BatchImageJobUpsertBulk) ClearOutputExpiresAt() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearOutputExpiresAt()
- })
- }
- // SetInputDeletedAt sets the "input_deleted_at" field.
- func (u *BatchImageJobUpsertBulk) SetInputDeletedAt(v time.Time) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetInputDeletedAt(v)
- })
- }
- // UpdateInputDeletedAt sets the "input_deleted_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateInputDeletedAt() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateInputDeletedAt()
- })
- }
- // ClearInputDeletedAt clears the value of the "input_deleted_at" field.
- func (u *BatchImageJobUpsertBulk) ClearInputDeletedAt() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearInputDeletedAt()
- })
- }
- // SetOutputDeletedAt sets the "output_deleted_at" field.
- func (u *BatchImageJobUpsertBulk) SetOutputDeletedAt(v time.Time) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetOutputDeletedAt(v)
- })
- }
- // UpdateOutputDeletedAt sets the "output_deleted_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateOutputDeletedAt() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateOutputDeletedAt()
- })
- }
- // ClearOutputDeletedAt clears the value of the "output_deleted_at" field.
- func (u *BatchImageJobUpsertBulk) ClearOutputDeletedAt() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearOutputDeletedAt()
- })
- }
- // SetDownloadedAt sets the "downloaded_at" field.
- func (u *BatchImageJobUpsertBulk) SetDownloadedAt(v time.Time) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetDownloadedAt(v)
- })
- }
- // UpdateDownloadedAt sets the "downloaded_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateDownloadedAt() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateDownloadedAt()
- })
- }
- // ClearDownloadedAt clears the value of the "downloaded_at" field.
- func (u *BatchImageJobUpsertBulk) ClearDownloadedAt() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearDownloadedAt()
- })
- }
- // SetUserDeletedAt sets the "user_deleted_at" field.
- func (u *BatchImageJobUpsertBulk) SetUserDeletedAt(v time.Time) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetUserDeletedAt(v)
- })
- }
- // UpdateUserDeletedAt sets the "user_deleted_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateUserDeletedAt() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateUserDeletedAt()
- })
- }
- // ClearUserDeletedAt clears the value of the "user_deleted_at" field.
- func (u *BatchImageJobUpsertBulk) ClearUserDeletedAt() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearUserDeletedAt()
- })
- }
- // SetLastErrorCode sets the "last_error_code" field.
- func (u *BatchImageJobUpsertBulk) SetLastErrorCode(v string) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetLastErrorCode(v)
- })
- }
- // UpdateLastErrorCode sets the "last_error_code" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateLastErrorCode() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateLastErrorCode()
- })
- }
- // ClearLastErrorCode clears the value of the "last_error_code" field.
- func (u *BatchImageJobUpsertBulk) ClearLastErrorCode() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearLastErrorCode()
- })
- }
- // SetLastErrorMessage sets the "last_error_message" field.
- func (u *BatchImageJobUpsertBulk) SetLastErrorMessage(v string) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetLastErrorMessage(v)
- })
- }
- // UpdateLastErrorMessage sets the "last_error_message" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateLastErrorMessage() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateLastErrorMessage()
- })
- }
- // ClearLastErrorMessage clears the value of the "last_error_message" field.
- func (u *BatchImageJobUpsertBulk) ClearLastErrorMessage() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearLastErrorMessage()
- })
- }
- // SetUpdatedAt sets the "updated_at" field.
- func (u *BatchImageJobUpsertBulk) SetUpdatedAt(v time.Time) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetUpdatedAt(v)
- })
- }
- // UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateUpdatedAt() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateUpdatedAt()
- })
- }
- // SetSubmittedAt sets the "submitted_at" field.
- func (u *BatchImageJobUpsertBulk) SetSubmittedAt(v time.Time) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetSubmittedAt(v)
- })
- }
- // UpdateSubmittedAt sets the "submitted_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateSubmittedAt() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateSubmittedAt()
- })
- }
- // ClearSubmittedAt clears the value of the "submitted_at" field.
- func (u *BatchImageJobUpsertBulk) ClearSubmittedAt() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearSubmittedAt()
- })
- }
- // SetStartedAt sets the "started_at" field.
- func (u *BatchImageJobUpsertBulk) SetStartedAt(v time.Time) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetStartedAt(v)
- })
- }
- // UpdateStartedAt sets the "started_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateStartedAt() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateStartedAt()
- })
- }
- // ClearStartedAt clears the value of the "started_at" field.
- func (u *BatchImageJobUpsertBulk) ClearStartedAt() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearStartedAt()
- })
- }
- // SetFinishedAt sets the "finished_at" field.
- func (u *BatchImageJobUpsertBulk) SetFinishedAt(v time.Time) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetFinishedAt(v)
- })
- }
- // UpdateFinishedAt sets the "finished_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateFinishedAt() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateFinishedAt()
- })
- }
- // ClearFinishedAt clears the value of the "finished_at" field.
- func (u *BatchImageJobUpsertBulk) ClearFinishedAt() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearFinishedAt()
- })
- }
- // SetSettledAt sets the "settled_at" field.
- func (u *BatchImageJobUpsertBulk) SetSettledAt(v time.Time) *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.SetSettledAt(v)
- })
- }
- // UpdateSettledAt sets the "settled_at" field to the value that was provided on create.
- func (u *BatchImageJobUpsertBulk) UpdateSettledAt() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.UpdateSettledAt()
- })
- }
- // ClearSettledAt clears the value of the "settled_at" field.
- func (u *BatchImageJobUpsertBulk) ClearSettledAt() *BatchImageJobUpsertBulk {
- return u.Update(func(s *BatchImageJobUpsert) {
- s.ClearSettledAt()
- })
- }
- // Exec executes the query.
- func (u *BatchImageJobUpsertBulk) Exec(ctx context.Context) error {
- if u.create.err != nil {
- return u.create.err
- }
- for i, b := range u.create.builders {
- if len(b.conflict) != 0 {
- return fmt.Errorf("ent: OnConflict was set for builder %d. Set it on the BatchImageJobCreateBulk instead", i)
- }
- }
- if len(u.create.conflict) == 0 {
- return errors.New("ent: missing options for BatchImageJobCreateBulk.OnConflict")
- }
- return u.create.Exec(ctx)
- }
- // ExecX is like Exec, but panics if an error occurs.
- func (u *BatchImageJobUpsertBulk) ExecX(ctx context.Context) {
- if err := u.create.Exec(ctx); err != nil {
- panic(err)
- }
- }
|