batchimagejob_create.go 112 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518
  1. // Code generated by ent, DO NOT EDIT.
  2. package ent
  3. import (
  4. "context"
  5. "errors"
  6. "fmt"
  7. "time"
  8. "entgo.io/ent/dialect/sql"
  9. "entgo.io/ent/dialect/sql/sqlgraph"
  10. "entgo.io/ent/schema/field"
  11. "github.com/Wei-Shaw/sub2api/ent/batchimagejob"
  12. )
  13. // BatchImageJobCreate is the builder for creating a BatchImageJob entity.
  14. type BatchImageJobCreate struct {
  15. config
  16. mutation *BatchImageJobMutation
  17. hooks []Hook
  18. conflict []sql.ConflictOption
  19. }
  20. // SetBatchID sets the "batch_id" field.
  21. func (_c *BatchImageJobCreate) SetBatchID(v string) *BatchImageJobCreate {
  22. _c.mutation.SetBatchID(v)
  23. return _c
  24. }
  25. // SetUserID sets the "user_id" field.
  26. func (_c *BatchImageJobCreate) SetUserID(v int64) *BatchImageJobCreate {
  27. _c.mutation.SetUserID(v)
  28. return _c
  29. }
  30. // SetAPIKeyID sets the "api_key_id" field.
  31. func (_c *BatchImageJobCreate) SetAPIKeyID(v int64) *BatchImageJobCreate {
  32. _c.mutation.SetAPIKeyID(v)
  33. return _c
  34. }
  35. // SetNillableAPIKeyID sets the "api_key_id" field if the given value is not nil.
  36. func (_c *BatchImageJobCreate) SetNillableAPIKeyID(v *int64) *BatchImageJobCreate {
  37. if v != nil {
  38. _c.SetAPIKeyID(*v)
  39. }
  40. return _c
  41. }
  42. // SetAccountID sets the "account_id" field.
  43. func (_c *BatchImageJobCreate) SetAccountID(v int64) *BatchImageJobCreate {
  44. _c.mutation.SetAccountID(v)
  45. return _c
  46. }
  47. // SetNillableAccountID sets the "account_id" field if the given value is not nil.
  48. func (_c *BatchImageJobCreate) SetNillableAccountID(v *int64) *BatchImageJobCreate {
  49. if v != nil {
  50. _c.SetAccountID(*v)
  51. }
  52. return _c
  53. }
  54. // SetProvider sets the "provider" field.
  55. func (_c *BatchImageJobCreate) SetProvider(v string) *BatchImageJobCreate {
  56. _c.mutation.SetProvider(v)
  57. return _c
  58. }
  59. // SetModel sets the "model" field.
  60. func (_c *BatchImageJobCreate) SetModel(v string) *BatchImageJobCreate {
  61. _c.mutation.SetModel(v)
  62. return _c
  63. }
  64. // SetTaskName sets the "task_name" field.
  65. func (_c *BatchImageJobCreate) SetTaskName(v string) *BatchImageJobCreate {
  66. _c.mutation.SetTaskName(v)
  67. return _c
  68. }
  69. // SetNillableTaskName sets the "task_name" field if the given value is not nil.
  70. func (_c *BatchImageJobCreate) SetNillableTaskName(v *string) *BatchImageJobCreate {
  71. if v != nil {
  72. _c.SetTaskName(*v)
  73. }
  74. return _c
  75. }
  76. // SetStatus sets the "status" field.
  77. func (_c *BatchImageJobCreate) SetStatus(v string) *BatchImageJobCreate {
  78. _c.mutation.SetStatus(v)
  79. return _c
  80. }
  81. // SetNillableStatus sets the "status" field if the given value is not nil.
  82. func (_c *BatchImageJobCreate) SetNillableStatus(v *string) *BatchImageJobCreate {
  83. if v != nil {
  84. _c.SetStatus(*v)
  85. }
  86. return _c
  87. }
  88. // SetProviderJobName sets the "provider_job_name" field.
  89. func (_c *BatchImageJobCreate) SetProviderJobName(v string) *BatchImageJobCreate {
  90. _c.mutation.SetProviderJobName(v)
  91. return _c
  92. }
  93. // SetNillableProviderJobName sets the "provider_job_name" field if the given value is not nil.
  94. func (_c *BatchImageJobCreate) SetNillableProviderJobName(v *string) *BatchImageJobCreate {
  95. if v != nil {
  96. _c.SetProviderJobName(*v)
  97. }
  98. return _c
  99. }
  100. // SetProviderInputRef sets the "provider_input_ref" field.
  101. func (_c *BatchImageJobCreate) SetProviderInputRef(v string) *BatchImageJobCreate {
  102. _c.mutation.SetProviderInputRef(v)
  103. return _c
  104. }
  105. // SetNillableProviderInputRef sets the "provider_input_ref" field if the given value is not nil.
  106. func (_c *BatchImageJobCreate) SetNillableProviderInputRef(v *string) *BatchImageJobCreate {
  107. if v != nil {
  108. _c.SetProviderInputRef(*v)
  109. }
  110. return _c
  111. }
  112. // SetProviderOutputRef sets the "provider_output_ref" field.
  113. func (_c *BatchImageJobCreate) SetProviderOutputRef(v string) *BatchImageJobCreate {
  114. _c.mutation.SetProviderOutputRef(v)
  115. return _c
  116. }
  117. // SetNillableProviderOutputRef sets the "provider_output_ref" field if the given value is not nil.
  118. func (_c *BatchImageJobCreate) SetNillableProviderOutputRef(v *string) *BatchImageJobCreate {
  119. if v != nil {
  120. _c.SetProviderOutputRef(*v)
  121. }
  122. return _c
  123. }
  124. // SetGcsInputURI sets the "gcs_input_uri" field.
  125. func (_c *BatchImageJobCreate) SetGcsInputURI(v string) *BatchImageJobCreate {
  126. _c.mutation.SetGcsInputURI(v)
  127. return _c
  128. }
  129. // SetNillableGcsInputURI sets the "gcs_input_uri" field if the given value is not nil.
  130. func (_c *BatchImageJobCreate) SetNillableGcsInputURI(v *string) *BatchImageJobCreate {
  131. if v != nil {
  132. _c.SetGcsInputURI(*v)
  133. }
  134. return _c
  135. }
  136. // SetGcsOutputURI sets the "gcs_output_uri" field.
  137. func (_c *BatchImageJobCreate) SetGcsOutputURI(v string) *BatchImageJobCreate {
  138. _c.mutation.SetGcsOutputURI(v)
  139. return _c
  140. }
  141. // SetNillableGcsOutputURI sets the "gcs_output_uri" field if the given value is not nil.
  142. func (_c *BatchImageJobCreate) SetNillableGcsOutputURI(v *string) *BatchImageJobCreate {
  143. if v != nil {
  144. _c.SetGcsOutputURI(*v)
  145. }
  146. return _c
  147. }
  148. // SetItemCount sets the "item_count" field.
  149. func (_c *BatchImageJobCreate) SetItemCount(v int) *BatchImageJobCreate {
  150. _c.mutation.SetItemCount(v)
  151. return _c
  152. }
  153. // SetSuccessCount sets the "success_count" field.
  154. func (_c *BatchImageJobCreate) SetSuccessCount(v int) *BatchImageJobCreate {
  155. _c.mutation.SetSuccessCount(v)
  156. return _c
  157. }
  158. // SetNillableSuccessCount sets the "success_count" field if the given value is not nil.
  159. func (_c *BatchImageJobCreate) SetNillableSuccessCount(v *int) *BatchImageJobCreate {
  160. if v != nil {
  161. _c.SetSuccessCount(*v)
  162. }
  163. return _c
  164. }
  165. // SetFailCount sets the "fail_count" field.
  166. func (_c *BatchImageJobCreate) SetFailCount(v int) *BatchImageJobCreate {
  167. _c.mutation.SetFailCount(v)
  168. return _c
  169. }
  170. // SetNillableFailCount sets the "fail_count" field if the given value is not nil.
  171. func (_c *BatchImageJobCreate) SetNillableFailCount(v *int) *BatchImageJobCreate {
  172. if v != nil {
  173. _c.SetFailCount(*v)
  174. }
  175. return _c
  176. }
  177. // SetCancelledCount sets the "cancelled_count" field.
  178. func (_c *BatchImageJobCreate) SetCancelledCount(v int) *BatchImageJobCreate {
  179. _c.mutation.SetCancelledCount(v)
  180. return _c
  181. }
  182. // SetNillableCancelledCount sets the "cancelled_count" field if the given value is not nil.
  183. func (_c *BatchImageJobCreate) SetNillableCancelledCount(v *int) *BatchImageJobCreate {
  184. if v != nil {
  185. _c.SetCancelledCount(*v)
  186. }
  187. return _c
  188. }
  189. // SetEstimatedCost sets the "estimated_cost" field.
  190. func (_c *BatchImageJobCreate) SetEstimatedCost(v float64) *BatchImageJobCreate {
  191. _c.mutation.SetEstimatedCost(v)
  192. return _c
  193. }
  194. // SetNillableEstimatedCost sets the "estimated_cost" field if the given value is not nil.
  195. func (_c *BatchImageJobCreate) SetNillableEstimatedCost(v *float64) *BatchImageJobCreate {
  196. if v != nil {
  197. _c.SetEstimatedCost(*v)
  198. }
  199. return _c
  200. }
  201. // SetHoldAmount sets the "hold_amount" field.
  202. func (_c *BatchImageJobCreate) SetHoldAmount(v float64) *BatchImageJobCreate {
  203. _c.mutation.SetHoldAmount(v)
  204. return _c
  205. }
  206. // SetNillableHoldAmount sets the "hold_amount" field if the given value is not nil.
  207. func (_c *BatchImageJobCreate) SetNillableHoldAmount(v *float64) *BatchImageJobCreate {
  208. if v != nil {
  209. _c.SetHoldAmount(*v)
  210. }
  211. return _c
  212. }
  213. // SetActualCost sets the "actual_cost" field.
  214. func (_c *BatchImageJobCreate) SetActualCost(v float64) *BatchImageJobCreate {
  215. _c.mutation.SetActualCost(v)
  216. return _c
  217. }
  218. // SetNillableActualCost sets the "actual_cost" field if the given value is not nil.
  219. func (_c *BatchImageJobCreate) SetNillableActualCost(v *float64) *BatchImageJobCreate {
  220. if v != nil {
  221. _c.SetActualCost(*v)
  222. }
  223. return _c
  224. }
  225. // SetCurrency sets the "currency" field.
  226. func (_c *BatchImageJobCreate) SetCurrency(v string) *BatchImageJobCreate {
  227. _c.mutation.SetCurrency(v)
  228. return _c
  229. }
  230. // SetNillableCurrency sets the "currency" field if the given value is not nil.
  231. func (_c *BatchImageJobCreate) SetNillableCurrency(v *string) *BatchImageJobCreate {
  232. if v != nil {
  233. _c.SetCurrency(*v)
  234. }
  235. return _c
  236. }
  237. // SetHoldID sets the "hold_id" field.
  238. func (_c *BatchImageJobCreate) SetHoldID(v string) *BatchImageJobCreate {
  239. _c.mutation.SetHoldID(v)
  240. return _c
  241. }
  242. // SetNillableHoldID sets the "hold_id" field if the given value is not nil.
  243. func (_c *BatchImageJobCreate) SetNillableHoldID(v *string) *BatchImageJobCreate {
  244. if v != nil {
  245. _c.SetHoldID(*v)
  246. }
  247. return _c
  248. }
  249. // SetIdempotencyKey sets the "idempotency_key" field.
  250. func (_c *BatchImageJobCreate) SetIdempotencyKey(v string) *BatchImageJobCreate {
  251. _c.mutation.SetIdempotencyKey(v)
  252. return _c
  253. }
  254. // SetNillableIdempotencyKey sets the "idempotency_key" field if the given value is not nil.
  255. func (_c *BatchImageJobCreate) SetNillableIdempotencyKey(v *string) *BatchImageJobCreate {
  256. if v != nil {
  257. _c.SetIdempotencyKey(*v)
  258. }
  259. return _c
  260. }
  261. // SetRequestHash sets the "request_hash" field.
  262. func (_c *BatchImageJobCreate) SetRequestHash(v string) *BatchImageJobCreate {
  263. _c.mutation.SetRequestHash(v)
  264. return _c
  265. }
  266. // SetNillableRequestHash sets the "request_hash" field if the given value is not nil.
  267. func (_c *BatchImageJobCreate) SetNillableRequestHash(v *string) *BatchImageJobCreate {
  268. if v != nil {
  269. _c.SetRequestHash(*v)
  270. }
  271. return _c
  272. }
  273. // SetManifestHash sets the "manifest_hash" field.
  274. func (_c *BatchImageJobCreate) SetManifestHash(v string) *BatchImageJobCreate {
  275. _c.mutation.SetManifestHash(v)
  276. return _c
  277. }
  278. // SetNillableManifestHash sets the "manifest_hash" field if the given value is not nil.
  279. func (_c *BatchImageJobCreate) SetNillableManifestHash(v *string) *BatchImageJobCreate {
  280. if v != nil {
  281. _c.SetManifestHash(*v)
  282. }
  283. return _c
  284. }
  285. // SetRetryCount sets the "retry_count" field.
  286. func (_c *BatchImageJobCreate) SetRetryCount(v int) *BatchImageJobCreate {
  287. _c.mutation.SetRetryCount(v)
  288. return _c
  289. }
  290. // SetNillableRetryCount sets the "retry_count" field if the given value is not nil.
  291. func (_c *BatchImageJobCreate) SetNillableRetryCount(v *int) *BatchImageJobCreate {
  292. if v != nil {
  293. _c.SetRetryCount(*v)
  294. }
  295. return _c
  296. }
  297. // SetVersion sets the "version" field.
  298. func (_c *BatchImageJobCreate) SetVersion(v int) *BatchImageJobCreate {
  299. _c.mutation.SetVersion(v)
  300. return _c
  301. }
  302. // SetNillableVersion sets the "version" field if the given value is not nil.
  303. func (_c *BatchImageJobCreate) SetNillableVersion(v *int) *BatchImageJobCreate {
  304. if v != nil {
  305. _c.SetVersion(*v)
  306. }
  307. return _c
  308. }
  309. // SetOutputExpiresAt sets the "output_expires_at" field.
  310. func (_c *BatchImageJobCreate) SetOutputExpiresAt(v time.Time) *BatchImageJobCreate {
  311. _c.mutation.SetOutputExpiresAt(v)
  312. return _c
  313. }
  314. // SetNillableOutputExpiresAt sets the "output_expires_at" field if the given value is not nil.
  315. func (_c *BatchImageJobCreate) SetNillableOutputExpiresAt(v *time.Time) *BatchImageJobCreate {
  316. if v != nil {
  317. _c.SetOutputExpiresAt(*v)
  318. }
  319. return _c
  320. }
  321. // SetInputDeletedAt sets the "input_deleted_at" field.
  322. func (_c *BatchImageJobCreate) SetInputDeletedAt(v time.Time) *BatchImageJobCreate {
  323. _c.mutation.SetInputDeletedAt(v)
  324. return _c
  325. }
  326. // SetNillableInputDeletedAt sets the "input_deleted_at" field if the given value is not nil.
  327. func (_c *BatchImageJobCreate) SetNillableInputDeletedAt(v *time.Time) *BatchImageJobCreate {
  328. if v != nil {
  329. _c.SetInputDeletedAt(*v)
  330. }
  331. return _c
  332. }
  333. // SetOutputDeletedAt sets the "output_deleted_at" field.
  334. func (_c *BatchImageJobCreate) SetOutputDeletedAt(v time.Time) *BatchImageJobCreate {
  335. _c.mutation.SetOutputDeletedAt(v)
  336. return _c
  337. }
  338. // SetNillableOutputDeletedAt sets the "output_deleted_at" field if the given value is not nil.
  339. func (_c *BatchImageJobCreate) SetNillableOutputDeletedAt(v *time.Time) *BatchImageJobCreate {
  340. if v != nil {
  341. _c.SetOutputDeletedAt(*v)
  342. }
  343. return _c
  344. }
  345. // SetDownloadedAt sets the "downloaded_at" field.
  346. func (_c *BatchImageJobCreate) SetDownloadedAt(v time.Time) *BatchImageJobCreate {
  347. _c.mutation.SetDownloadedAt(v)
  348. return _c
  349. }
  350. // SetNillableDownloadedAt sets the "downloaded_at" field if the given value is not nil.
  351. func (_c *BatchImageJobCreate) SetNillableDownloadedAt(v *time.Time) *BatchImageJobCreate {
  352. if v != nil {
  353. _c.SetDownloadedAt(*v)
  354. }
  355. return _c
  356. }
  357. // SetUserDeletedAt sets the "user_deleted_at" field.
  358. func (_c *BatchImageJobCreate) SetUserDeletedAt(v time.Time) *BatchImageJobCreate {
  359. _c.mutation.SetUserDeletedAt(v)
  360. return _c
  361. }
  362. // SetNillableUserDeletedAt sets the "user_deleted_at" field if the given value is not nil.
  363. func (_c *BatchImageJobCreate) SetNillableUserDeletedAt(v *time.Time) *BatchImageJobCreate {
  364. if v != nil {
  365. _c.SetUserDeletedAt(*v)
  366. }
  367. return _c
  368. }
  369. // SetLastErrorCode sets the "last_error_code" field.
  370. func (_c *BatchImageJobCreate) SetLastErrorCode(v string) *BatchImageJobCreate {
  371. _c.mutation.SetLastErrorCode(v)
  372. return _c
  373. }
  374. // SetNillableLastErrorCode sets the "last_error_code" field if the given value is not nil.
  375. func (_c *BatchImageJobCreate) SetNillableLastErrorCode(v *string) *BatchImageJobCreate {
  376. if v != nil {
  377. _c.SetLastErrorCode(*v)
  378. }
  379. return _c
  380. }
  381. // SetLastErrorMessage sets the "last_error_message" field.
  382. func (_c *BatchImageJobCreate) SetLastErrorMessage(v string) *BatchImageJobCreate {
  383. _c.mutation.SetLastErrorMessage(v)
  384. return _c
  385. }
  386. // SetNillableLastErrorMessage sets the "last_error_message" field if the given value is not nil.
  387. func (_c *BatchImageJobCreate) SetNillableLastErrorMessage(v *string) *BatchImageJobCreate {
  388. if v != nil {
  389. _c.SetLastErrorMessage(*v)
  390. }
  391. return _c
  392. }
  393. // SetCreatedAt sets the "created_at" field.
  394. func (_c *BatchImageJobCreate) SetCreatedAt(v time.Time) *BatchImageJobCreate {
  395. _c.mutation.SetCreatedAt(v)
  396. return _c
  397. }
  398. // SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
  399. func (_c *BatchImageJobCreate) SetNillableCreatedAt(v *time.Time) *BatchImageJobCreate {
  400. if v != nil {
  401. _c.SetCreatedAt(*v)
  402. }
  403. return _c
  404. }
  405. // SetUpdatedAt sets the "updated_at" field.
  406. func (_c *BatchImageJobCreate) SetUpdatedAt(v time.Time) *BatchImageJobCreate {
  407. _c.mutation.SetUpdatedAt(v)
  408. return _c
  409. }
  410. // SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
  411. func (_c *BatchImageJobCreate) SetNillableUpdatedAt(v *time.Time) *BatchImageJobCreate {
  412. if v != nil {
  413. _c.SetUpdatedAt(*v)
  414. }
  415. return _c
  416. }
  417. // SetSubmittedAt sets the "submitted_at" field.
  418. func (_c *BatchImageJobCreate) SetSubmittedAt(v time.Time) *BatchImageJobCreate {
  419. _c.mutation.SetSubmittedAt(v)
  420. return _c
  421. }
  422. // SetNillableSubmittedAt sets the "submitted_at" field if the given value is not nil.
  423. func (_c *BatchImageJobCreate) SetNillableSubmittedAt(v *time.Time) *BatchImageJobCreate {
  424. if v != nil {
  425. _c.SetSubmittedAt(*v)
  426. }
  427. return _c
  428. }
  429. // SetStartedAt sets the "started_at" field.
  430. func (_c *BatchImageJobCreate) SetStartedAt(v time.Time) *BatchImageJobCreate {
  431. _c.mutation.SetStartedAt(v)
  432. return _c
  433. }
  434. // SetNillableStartedAt sets the "started_at" field if the given value is not nil.
  435. func (_c *BatchImageJobCreate) SetNillableStartedAt(v *time.Time) *BatchImageJobCreate {
  436. if v != nil {
  437. _c.SetStartedAt(*v)
  438. }
  439. return _c
  440. }
  441. // SetFinishedAt sets the "finished_at" field.
  442. func (_c *BatchImageJobCreate) SetFinishedAt(v time.Time) *BatchImageJobCreate {
  443. _c.mutation.SetFinishedAt(v)
  444. return _c
  445. }
  446. // SetNillableFinishedAt sets the "finished_at" field if the given value is not nil.
  447. func (_c *BatchImageJobCreate) SetNillableFinishedAt(v *time.Time) *BatchImageJobCreate {
  448. if v != nil {
  449. _c.SetFinishedAt(*v)
  450. }
  451. return _c
  452. }
  453. // SetSettledAt sets the "settled_at" field.
  454. func (_c *BatchImageJobCreate) SetSettledAt(v time.Time) *BatchImageJobCreate {
  455. _c.mutation.SetSettledAt(v)
  456. return _c
  457. }
  458. // SetNillableSettledAt sets the "settled_at" field if the given value is not nil.
  459. func (_c *BatchImageJobCreate) SetNillableSettledAt(v *time.Time) *BatchImageJobCreate {
  460. if v != nil {
  461. _c.SetSettledAt(*v)
  462. }
  463. return _c
  464. }
  465. // Mutation returns the BatchImageJobMutation object of the builder.
  466. func (_c *BatchImageJobCreate) Mutation() *BatchImageJobMutation {
  467. return _c.mutation
  468. }
  469. // Save creates the BatchImageJob in the database.
  470. func (_c *BatchImageJobCreate) Save(ctx context.Context) (*BatchImageJob, error) {
  471. _c.defaults()
  472. return withHooks(ctx, _c.sqlSave, _c.mutation, _c.hooks)
  473. }
  474. // SaveX calls Save and panics if Save returns an error.
  475. func (_c *BatchImageJobCreate) SaveX(ctx context.Context) *BatchImageJob {
  476. v, err := _c.Save(ctx)
  477. if err != nil {
  478. panic(err)
  479. }
  480. return v
  481. }
  482. // Exec executes the query.
  483. func (_c *BatchImageJobCreate) Exec(ctx context.Context) error {
  484. _, err := _c.Save(ctx)
  485. return err
  486. }
  487. // ExecX is like Exec, but panics if an error occurs.
  488. func (_c *BatchImageJobCreate) ExecX(ctx context.Context) {
  489. if err := _c.Exec(ctx); err != nil {
  490. panic(err)
  491. }
  492. }
  493. // defaults sets the default values of the builder before save.
  494. func (_c *BatchImageJobCreate) defaults() {
  495. if _, ok := _c.mutation.TaskName(); !ok {
  496. v := batchimagejob.DefaultTaskName
  497. _c.mutation.SetTaskName(v)
  498. }
  499. if _, ok := _c.mutation.Status(); !ok {
  500. v := batchimagejob.DefaultStatus
  501. _c.mutation.SetStatus(v)
  502. }
  503. if _, ok := _c.mutation.SuccessCount(); !ok {
  504. v := batchimagejob.DefaultSuccessCount
  505. _c.mutation.SetSuccessCount(v)
  506. }
  507. if _, ok := _c.mutation.FailCount(); !ok {
  508. v := batchimagejob.DefaultFailCount
  509. _c.mutation.SetFailCount(v)
  510. }
  511. if _, ok := _c.mutation.CancelledCount(); !ok {
  512. v := batchimagejob.DefaultCancelledCount
  513. _c.mutation.SetCancelledCount(v)
  514. }
  515. if _, ok := _c.mutation.EstimatedCost(); !ok {
  516. v := batchimagejob.DefaultEstimatedCost
  517. _c.mutation.SetEstimatedCost(v)
  518. }
  519. if _, ok := _c.mutation.Currency(); !ok {
  520. v := batchimagejob.DefaultCurrency
  521. _c.mutation.SetCurrency(v)
  522. }
  523. if _, ok := _c.mutation.RetryCount(); !ok {
  524. v := batchimagejob.DefaultRetryCount
  525. _c.mutation.SetRetryCount(v)
  526. }
  527. if _, ok := _c.mutation.Version(); !ok {
  528. v := batchimagejob.DefaultVersion
  529. _c.mutation.SetVersion(v)
  530. }
  531. if _, ok := _c.mutation.CreatedAt(); !ok {
  532. v := batchimagejob.DefaultCreatedAt()
  533. _c.mutation.SetCreatedAt(v)
  534. }
  535. if _, ok := _c.mutation.UpdatedAt(); !ok {
  536. v := batchimagejob.DefaultUpdatedAt()
  537. _c.mutation.SetUpdatedAt(v)
  538. }
  539. }
  540. // check runs all checks and user-defined validators on the builder.
  541. func (_c *BatchImageJobCreate) check() error {
  542. if _, ok := _c.mutation.BatchID(); !ok {
  543. return &ValidationError{Name: "batch_id", err: errors.New(`ent: missing required field "BatchImageJob.batch_id"`)}
  544. }
  545. if v, ok := _c.mutation.BatchID(); ok {
  546. if err := batchimagejob.BatchIDValidator(v); err != nil {
  547. return &ValidationError{Name: "batch_id", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.batch_id": %w`, err)}
  548. }
  549. }
  550. if _, ok := _c.mutation.UserID(); !ok {
  551. return &ValidationError{Name: "user_id", err: errors.New(`ent: missing required field "BatchImageJob.user_id"`)}
  552. }
  553. if _, ok := _c.mutation.Provider(); !ok {
  554. return &ValidationError{Name: "provider", err: errors.New(`ent: missing required field "BatchImageJob.provider"`)}
  555. }
  556. if v, ok := _c.mutation.Provider(); ok {
  557. if err := batchimagejob.ProviderValidator(v); err != nil {
  558. return &ValidationError{Name: "provider", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.provider": %w`, err)}
  559. }
  560. }
  561. if _, ok := _c.mutation.Model(); !ok {
  562. return &ValidationError{Name: "model", err: errors.New(`ent: missing required field "BatchImageJob.model"`)}
  563. }
  564. if v, ok := _c.mutation.Model(); ok {
  565. if err := batchimagejob.ModelValidator(v); err != nil {
  566. return &ValidationError{Name: "model", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.model": %w`, err)}
  567. }
  568. }
  569. if _, ok := _c.mutation.TaskName(); !ok {
  570. return &ValidationError{Name: "task_name", err: errors.New(`ent: missing required field "BatchImageJob.task_name"`)}
  571. }
  572. if v, ok := _c.mutation.TaskName(); ok {
  573. if err := batchimagejob.TaskNameValidator(v); err != nil {
  574. return &ValidationError{Name: "task_name", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.task_name": %w`, err)}
  575. }
  576. }
  577. if _, ok := _c.mutation.Status(); !ok {
  578. return &ValidationError{Name: "status", err: errors.New(`ent: missing required field "BatchImageJob.status"`)}
  579. }
  580. if v, ok := _c.mutation.Status(); ok {
  581. if err := batchimagejob.StatusValidator(v); err != nil {
  582. return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.status": %w`, err)}
  583. }
  584. }
  585. if v, ok := _c.mutation.ProviderJobName(); ok {
  586. if err := batchimagejob.ProviderJobNameValidator(v); err != nil {
  587. return &ValidationError{Name: "provider_job_name", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.provider_job_name": %w`, err)}
  588. }
  589. }
  590. if v, ok := _c.mutation.ProviderInputRef(); ok {
  591. if err := batchimagejob.ProviderInputRefValidator(v); err != nil {
  592. return &ValidationError{Name: "provider_input_ref", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.provider_input_ref": %w`, err)}
  593. }
  594. }
  595. if v, ok := _c.mutation.ProviderOutputRef(); ok {
  596. if err := batchimagejob.ProviderOutputRefValidator(v); err != nil {
  597. return &ValidationError{Name: "provider_output_ref", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.provider_output_ref": %w`, err)}
  598. }
  599. }
  600. if v, ok := _c.mutation.GcsInputURI(); ok {
  601. if err := batchimagejob.GcsInputURIValidator(v); err != nil {
  602. return &ValidationError{Name: "gcs_input_uri", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.gcs_input_uri": %w`, err)}
  603. }
  604. }
  605. if v, ok := _c.mutation.GcsOutputURI(); ok {
  606. if err := batchimagejob.GcsOutputURIValidator(v); err != nil {
  607. return &ValidationError{Name: "gcs_output_uri", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.gcs_output_uri": %w`, err)}
  608. }
  609. }
  610. if _, ok := _c.mutation.ItemCount(); !ok {
  611. return &ValidationError{Name: "item_count", err: errors.New(`ent: missing required field "BatchImageJob.item_count"`)}
  612. }
  613. if _, ok := _c.mutation.SuccessCount(); !ok {
  614. return &ValidationError{Name: "success_count", err: errors.New(`ent: missing required field "BatchImageJob.success_count"`)}
  615. }
  616. if _, ok := _c.mutation.FailCount(); !ok {
  617. return &ValidationError{Name: "fail_count", err: errors.New(`ent: missing required field "BatchImageJob.fail_count"`)}
  618. }
  619. if _, ok := _c.mutation.CancelledCount(); !ok {
  620. return &ValidationError{Name: "cancelled_count", err: errors.New(`ent: missing required field "BatchImageJob.cancelled_count"`)}
  621. }
  622. if _, ok := _c.mutation.EstimatedCost(); !ok {
  623. return &ValidationError{Name: "estimated_cost", err: errors.New(`ent: missing required field "BatchImageJob.estimated_cost"`)}
  624. }
  625. if _, ok := _c.mutation.Currency(); !ok {
  626. return &ValidationError{Name: "currency", err: errors.New(`ent: missing required field "BatchImageJob.currency"`)}
  627. }
  628. if v, ok := _c.mutation.Currency(); ok {
  629. if err := batchimagejob.CurrencyValidator(v); err != nil {
  630. return &ValidationError{Name: "currency", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.currency": %w`, err)}
  631. }
  632. }
  633. if v, ok := _c.mutation.HoldID(); ok {
  634. if err := batchimagejob.HoldIDValidator(v); err != nil {
  635. return &ValidationError{Name: "hold_id", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.hold_id": %w`, err)}
  636. }
  637. }
  638. if v, ok := _c.mutation.IdempotencyKey(); ok {
  639. if err := batchimagejob.IdempotencyKeyValidator(v); err != nil {
  640. return &ValidationError{Name: "idempotency_key", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.idempotency_key": %w`, err)}
  641. }
  642. }
  643. if v, ok := _c.mutation.RequestHash(); ok {
  644. if err := batchimagejob.RequestHashValidator(v); err != nil {
  645. return &ValidationError{Name: "request_hash", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.request_hash": %w`, err)}
  646. }
  647. }
  648. if v, ok := _c.mutation.ManifestHash(); ok {
  649. if err := batchimagejob.ManifestHashValidator(v); err != nil {
  650. return &ValidationError{Name: "manifest_hash", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.manifest_hash": %w`, err)}
  651. }
  652. }
  653. if _, ok := _c.mutation.RetryCount(); !ok {
  654. return &ValidationError{Name: "retry_count", err: errors.New(`ent: missing required field "BatchImageJob.retry_count"`)}
  655. }
  656. if _, ok := _c.mutation.Version(); !ok {
  657. return &ValidationError{Name: "version", err: errors.New(`ent: missing required field "BatchImageJob.version"`)}
  658. }
  659. if v, ok := _c.mutation.LastErrorCode(); ok {
  660. if err := batchimagejob.LastErrorCodeValidator(v); err != nil {
  661. return &ValidationError{Name: "last_error_code", err: fmt.Errorf(`ent: validator failed for field "BatchImageJob.last_error_code": %w`, err)}
  662. }
  663. }
  664. if _, ok := _c.mutation.CreatedAt(); !ok {
  665. return &ValidationError{Name: "created_at", err: errors.New(`ent: missing required field "BatchImageJob.created_at"`)}
  666. }
  667. if _, ok := _c.mutation.UpdatedAt(); !ok {
  668. return &ValidationError{Name: "updated_at", err: errors.New(`ent: missing required field "BatchImageJob.updated_at"`)}
  669. }
  670. return nil
  671. }
  672. func (_c *BatchImageJobCreate) sqlSave(ctx context.Context) (*BatchImageJob, error) {
  673. if err := _c.check(); err != nil {
  674. return nil, err
  675. }
  676. _node, _spec := _c.createSpec()
  677. if err := sqlgraph.CreateNode(ctx, _c.driver, _spec); err != nil {
  678. if sqlgraph.IsConstraintError(err) {
  679. err = &ConstraintError{msg: err.Error(), wrap: err}
  680. }
  681. return nil, err
  682. }
  683. id := _spec.ID.Value.(int64)
  684. _node.ID = int64(id)
  685. _c.mutation.id = &_node.ID
  686. _c.mutation.done = true
  687. return _node, nil
  688. }
  689. func (_c *BatchImageJobCreate) createSpec() (*BatchImageJob, *sqlgraph.CreateSpec) {
  690. var (
  691. _node = &BatchImageJob{config: _c.config}
  692. _spec = sqlgraph.NewCreateSpec(batchimagejob.Table, sqlgraph.NewFieldSpec(batchimagejob.FieldID, field.TypeInt64))
  693. )
  694. _spec.OnConflict = _c.conflict
  695. if value, ok := _c.mutation.BatchID(); ok {
  696. _spec.SetField(batchimagejob.FieldBatchID, field.TypeString, value)
  697. _node.BatchID = value
  698. }
  699. if value, ok := _c.mutation.UserID(); ok {
  700. _spec.SetField(batchimagejob.FieldUserID, field.TypeInt64, value)
  701. _node.UserID = value
  702. }
  703. if value, ok := _c.mutation.APIKeyID(); ok {
  704. _spec.SetField(batchimagejob.FieldAPIKeyID, field.TypeInt64, value)
  705. _node.APIKeyID = &value
  706. }
  707. if value, ok := _c.mutation.AccountID(); ok {
  708. _spec.SetField(batchimagejob.FieldAccountID, field.TypeInt64, value)
  709. _node.AccountID = &value
  710. }
  711. if value, ok := _c.mutation.Provider(); ok {
  712. _spec.SetField(batchimagejob.FieldProvider, field.TypeString, value)
  713. _node.Provider = value
  714. }
  715. if value, ok := _c.mutation.Model(); ok {
  716. _spec.SetField(batchimagejob.FieldModel, field.TypeString, value)
  717. _node.Model = value
  718. }
  719. if value, ok := _c.mutation.TaskName(); ok {
  720. _spec.SetField(batchimagejob.FieldTaskName, field.TypeString, value)
  721. _node.TaskName = value
  722. }
  723. if value, ok := _c.mutation.Status(); ok {
  724. _spec.SetField(batchimagejob.FieldStatus, field.TypeString, value)
  725. _node.Status = value
  726. }
  727. if value, ok := _c.mutation.ProviderJobName(); ok {
  728. _spec.SetField(batchimagejob.FieldProviderJobName, field.TypeString, value)
  729. _node.ProviderJobName = &value
  730. }
  731. if value, ok := _c.mutation.ProviderInputRef(); ok {
  732. _spec.SetField(batchimagejob.FieldProviderInputRef, field.TypeString, value)
  733. _node.ProviderInputRef = &value
  734. }
  735. if value, ok := _c.mutation.ProviderOutputRef(); ok {
  736. _spec.SetField(batchimagejob.FieldProviderOutputRef, field.TypeString, value)
  737. _node.ProviderOutputRef = &value
  738. }
  739. if value, ok := _c.mutation.GcsInputURI(); ok {
  740. _spec.SetField(batchimagejob.FieldGcsInputURI, field.TypeString, value)
  741. _node.GcsInputURI = &value
  742. }
  743. if value, ok := _c.mutation.GcsOutputURI(); ok {
  744. _spec.SetField(batchimagejob.FieldGcsOutputURI, field.TypeString, value)
  745. _node.GcsOutputURI = &value
  746. }
  747. if value, ok := _c.mutation.ItemCount(); ok {
  748. _spec.SetField(batchimagejob.FieldItemCount, field.TypeInt, value)
  749. _node.ItemCount = value
  750. }
  751. if value, ok := _c.mutation.SuccessCount(); ok {
  752. _spec.SetField(batchimagejob.FieldSuccessCount, field.TypeInt, value)
  753. _node.SuccessCount = value
  754. }
  755. if value, ok := _c.mutation.FailCount(); ok {
  756. _spec.SetField(batchimagejob.FieldFailCount, field.TypeInt, value)
  757. _node.FailCount = value
  758. }
  759. if value, ok := _c.mutation.CancelledCount(); ok {
  760. _spec.SetField(batchimagejob.FieldCancelledCount, field.TypeInt, value)
  761. _node.CancelledCount = value
  762. }
  763. if value, ok := _c.mutation.EstimatedCost(); ok {
  764. _spec.SetField(batchimagejob.FieldEstimatedCost, field.TypeFloat64, value)
  765. _node.EstimatedCost = value
  766. }
  767. if value, ok := _c.mutation.HoldAmount(); ok {
  768. _spec.SetField(batchimagejob.FieldHoldAmount, field.TypeFloat64, value)
  769. _node.HoldAmount = &value
  770. }
  771. if value, ok := _c.mutation.ActualCost(); ok {
  772. _spec.SetField(batchimagejob.FieldActualCost, field.TypeFloat64, value)
  773. _node.ActualCost = &value
  774. }
  775. if value, ok := _c.mutation.Currency(); ok {
  776. _spec.SetField(batchimagejob.FieldCurrency, field.TypeString, value)
  777. _node.Currency = value
  778. }
  779. if value, ok := _c.mutation.HoldID(); ok {
  780. _spec.SetField(batchimagejob.FieldHoldID, field.TypeString, value)
  781. _node.HoldID = &value
  782. }
  783. if value, ok := _c.mutation.IdempotencyKey(); ok {
  784. _spec.SetField(batchimagejob.FieldIdempotencyKey, field.TypeString, value)
  785. _node.IdempotencyKey = &value
  786. }
  787. if value, ok := _c.mutation.RequestHash(); ok {
  788. _spec.SetField(batchimagejob.FieldRequestHash, field.TypeString, value)
  789. _node.RequestHash = &value
  790. }
  791. if value, ok := _c.mutation.ManifestHash(); ok {
  792. _spec.SetField(batchimagejob.FieldManifestHash, field.TypeString, value)
  793. _node.ManifestHash = &value
  794. }
  795. if value, ok := _c.mutation.RetryCount(); ok {
  796. _spec.SetField(batchimagejob.FieldRetryCount, field.TypeInt, value)
  797. _node.RetryCount = value
  798. }
  799. if value, ok := _c.mutation.Version(); ok {
  800. _spec.SetField(batchimagejob.FieldVersion, field.TypeInt, value)
  801. _node.Version = value
  802. }
  803. if value, ok := _c.mutation.OutputExpiresAt(); ok {
  804. _spec.SetField(batchimagejob.FieldOutputExpiresAt, field.TypeTime, value)
  805. _node.OutputExpiresAt = &value
  806. }
  807. if value, ok := _c.mutation.InputDeletedAt(); ok {
  808. _spec.SetField(batchimagejob.FieldInputDeletedAt, field.TypeTime, value)
  809. _node.InputDeletedAt = &value
  810. }
  811. if value, ok := _c.mutation.OutputDeletedAt(); ok {
  812. _spec.SetField(batchimagejob.FieldOutputDeletedAt, field.TypeTime, value)
  813. _node.OutputDeletedAt = &value
  814. }
  815. if value, ok := _c.mutation.DownloadedAt(); ok {
  816. _spec.SetField(batchimagejob.FieldDownloadedAt, field.TypeTime, value)
  817. _node.DownloadedAt = &value
  818. }
  819. if value, ok := _c.mutation.UserDeletedAt(); ok {
  820. _spec.SetField(batchimagejob.FieldUserDeletedAt, field.TypeTime, value)
  821. _node.UserDeletedAt = &value
  822. }
  823. if value, ok := _c.mutation.LastErrorCode(); ok {
  824. _spec.SetField(batchimagejob.FieldLastErrorCode, field.TypeString, value)
  825. _node.LastErrorCode = &value
  826. }
  827. if value, ok := _c.mutation.LastErrorMessage(); ok {
  828. _spec.SetField(batchimagejob.FieldLastErrorMessage, field.TypeString, value)
  829. _node.LastErrorMessage = &value
  830. }
  831. if value, ok := _c.mutation.CreatedAt(); ok {
  832. _spec.SetField(batchimagejob.FieldCreatedAt, field.TypeTime, value)
  833. _node.CreatedAt = value
  834. }
  835. if value, ok := _c.mutation.UpdatedAt(); ok {
  836. _spec.SetField(batchimagejob.FieldUpdatedAt, field.TypeTime, value)
  837. _node.UpdatedAt = value
  838. }
  839. if value, ok := _c.mutation.SubmittedAt(); ok {
  840. _spec.SetField(batchimagejob.FieldSubmittedAt, field.TypeTime, value)
  841. _node.SubmittedAt = &value
  842. }
  843. if value, ok := _c.mutation.StartedAt(); ok {
  844. _spec.SetField(batchimagejob.FieldStartedAt, field.TypeTime, value)
  845. _node.StartedAt = &value
  846. }
  847. if value, ok := _c.mutation.FinishedAt(); ok {
  848. _spec.SetField(batchimagejob.FieldFinishedAt, field.TypeTime, value)
  849. _node.FinishedAt = &value
  850. }
  851. if value, ok := _c.mutation.SettledAt(); ok {
  852. _spec.SetField(batchimagejob.FieldSettledAt, field.TypeTime, value)
  853. _node.SettledAt = &value
  854. }
  855. return _node, _spec
  856. }
  857. // OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
  858. // of the `INSERT` statement. For example:
  859. //
  860. // client.BatchImageJob.Create().
  861. // SetBatchID(v).
  862. // OnConflict(
  863. // // Update the row with the new values
  864. // // the was proposed for insertion.
  865. // sql.ResolveWithNewValues(),
  866. // ).
  867. // // Override some of the fields with custom
  868. // // update values.
  869. // Update(func(u *ent.BatchImageJobUpsert) {
  870. // SetBatchID(v+v).
  871. // }).
  872. // Exec(ctx)
  873. func (_c *BatchImageJobCreate) OnConflict(opts ...sql.ConflictOption) *BatchImageJobUpsertOne {
  874. _c.conflict = opts
  875. return &BatchImageJobUpsertOne{
  876. create: _c,
  877. }
  878. }
  879. // OnConflictColumns calls `OnConflict` and configures the columns
  880. // as conflict target. Using this option is equivalent to using:
  881. //
  882. // client.BatchImageJob.Create().
  883. // OnConflict(sql.ConflictColumns(columns...)).
  884. // Exec(ctx)
  885. func (_c *BatchImageJobCreate) OnConflictColumns(columns ...string) *BatchImageJobUpsertOne {
  886. _c.conflict = append(_c.conflict, sql.ConflictColumns(columns...))
  887. return &BatchImageJobUpsertOne{
  888. create: _c,
  889. }
  890. }
  891. type (
  892. // BatchImageJobUpsertOne is the builder for "upsert"-ing
  893. // one BatchImageJob node.
  894. BatchImageJobUpsertOne struct {
  895. create *BatchImageJobCreate
  896. }
  897. // BatchImageJobUpsert is the "OnConflict" setter.
  898. BatchImageJobUpsert struct {
  899. *sql.UpdateSet
  900. }
  901. )
  902. // SetUserID sets the "user_id" field.
  903. func (u *BatchImageJobUpsert) SetUserID(v int64) *BatchImageJobUpsert {
  904. u.Set(batchimagejob.FieldUserID, v)
  905. return u
  906. }
  907. // UpdateUserID sets the "user_id" field to the value that was provided on create.
  908. func (u *BatchImageJobUpsert) UpdateUserID() *BatchImageJobUpsert {
  909. u.SetExcluded(batchimagejob.FieldUserID)
  910. return u
  911. }
  912. // AddUserID adds v to the "user_id" field.
  913. func (u *BatchImageJobUpsert) AddUserID(v int64) *BatchImageJobUpsert {
  914. u.Add(batchimagejob.FieldUserID, v)
  915. return u
  916. }
  917. // SetAPIKeyID sets the "api_key_id" field.
  918. func (u *BatchImageJobUpsert) SetAPIKeyID(v int64) *BatchImageJobUpsert {
  919. u.Set(batchimagejob.FieldAPIKeyID, v)
  920. return u
  921. }
  922. // UpdateAPIKeyID sets the "api_key_id" field to the value that was provided on create.
  923. func (u *BatchImageJobUpsert) UpdateAPIKeyID() *BatchImageJobUpsert {
  924. u.SetExcluded(batchimagejob.FieldAPIKeyID)
  925. return u
  926. }
  927. // AddAPIKeyID adds v to the "api_key_id" field.
  928. func (u *BatchImageJobUpsert) AddAPIKeyID(v int64) *BatchImageJobUpsert {
  929. u.Add(batchimagejob.FieldAPIKeyID, v)
  930. return u
  931. }
  932. // ClearAPIKeyID clears the value of the "api_key_id" field.
  933. func (u *BatchImageJobUpsert) ClearAPIKeyID() *BatchImageJobUpsert {
  934. u.SetNull(batchimagejob.FieldAPIKeyID)
  935. return u
  936. }
  937. // SetAccountID sets the "account_id" field.
  938. func (u *BatchImageJobUpsert) SetAccountID(v int64) *BatchImageJobUpsert {
  939. u.Set(batchimagejob.FieldAccountID, v)
  940. return u
  941. }
  942. // UpdateAccountID sets the "account_id" field to the value that was provided on create.
  943. func (u *BatchImageJobUpsert) UpdateAccountID() *BatchImageJobUpsert {
  944. u.SetExcluded(batchimagejob.FieldAccountID)
  945. return u
  946. }
  947. // AddAccountID adds v to the "account_id" field.
  948. func (u *BatchImageJobUpsert) AddAccountID(v int64) *BatchImageJobUpsert {
  949. u.Add(batchimagejob.FieldAccountID, v)
  950. return u
  951. }
  952. // ClearAccountID clears the value of the "account_id" field.
  953. func (u *BatchImageJobUpsert) ClearAccountID() *BatchImageJobUpsert {
  954. u.SetNull(batchimagejob.FieldAccountID)
  955. return u
  956. }
  957. // SetProvider sets the "provider" field.
  958. func (u *BatchImageJobUpsert) SetProvider(v string) *BatchImageJobUpsert {
  959. u.Set(batchimagejob.FieldProvider, v)
  960. return u
  961. }
  962. // UpdateProvider sets the "provider" field to the value that was provided on create.
  963. func (u *BatchImageJobUpsert) UpdateProvider() *BatchImageJobUpsert {
  964. u.SetExcluded(batchimagejob.FieldProvider)
  965. return u
  966. }
  967. // SetModel sets the "model" field.
  968. func (u *BatchImageJobUpsert) SetModel(v string) *BatchImageJobUpsert {
  969. u.Set(batchimagejob.FieldModel, v)
  970. return u
  971. }
  972. // UpdateModel sets the "model" field to the value that was provided on create.
  973. func (u *BatchImageJobUpsert) UpdateModel() *BatchImageJobUpsert {
  974. u.SetExcluded(batchimagejob.FieldModel)
  975. return u
  976. }
  977. // SetTaskName sets the "task_name" field.
  978. func (u *BatchImageJobUpsert) SetTaskName(v string) *BatchImageJobUpsert {
  979. u.Set(batchimagejob.FieldTaskName, v)
  980. return u
  981. }
  982. // UpdateTaskName sets the "task_name" field to the value that was provided on create.
  983. func (u *BatchImageJobUpsert) UpdateTaskName() *BatchImageJobUpsert {
  984. u.SetExcluded(batchimagejob.FieldTaskName)
  985. return u
  986. }
  987. // SetStatus sets the "status" field.
  988. func (u *BatchImageJobUpsert) SetStatus(v string) *BatchImageJobUpsert {
  989. u.Set(batchimagejob.FieldStatus, v)
  990. return u
  991. }
  992. // UpdateStatus sets the "status" field to the value that was provided on create.
  993. func (u *BatchImageJobUpsert) UpdateStatus() *BatchImageJobUpsert {
  994. u.SetExcluded(batchimagejob.FieldStatus)
  995. return u
  996. }
  997. // SetProviderJobName sets the "provider_job_name" field.
  998. func (u *BatchImageJobUpsert) SetProviderJobName(v string) *BatchImageJobUpsert {
  999. u.Set(batchimagejob.FieldProviderJobName, v)
  1000. return u
  1001. }
  1002. // UpdateProviderJobName sets the "provider_job_name" field to the value that was provided on create.
  1003. func (u *BatchImageJobUpsert) UpdateProviderJobName() *BatchImageJobUpsert {
  1004. u.SetExcluded(batchimagejob.FieldProviderJobName)
  1005. return u
  1006. }
  1007. // ClearProviderJobName clears the value of the "provider_job_name" field.
  1008. func (u *BatchImageJobUpsert) ClearProviderJobName() *BatchImageJobUpsert {
  1009. u.SetNull(batchimagejob.FieldProviderJobName)
  1010. return u
  1011. }
  1012. // SetProviderInputRef sets the "provider_input_ref" field.
  1013. func (u *BatchImageJobUpsert) SetProviderInputRef(v string) *BatchImageJobUpsert {
  1014. u.Set(batchimagejob.FieldProviderInputRef, v)
  1015. return u
  1016. }
  1017. // UpdateProviderInputRef sets the "provider_input_ref" field to the value that was provided on create.
  1018. func (u *BatchImageJobUpsert) UpdateProviderInputRef() *BatchImageJobUpsert {
  1019. u.SetExcluded(batchimagejob.FieldProviderInputRef)
  1020. return u
  1021. }
  1022. // ClearProviderInputRef clears the value of the "provider_input_ref" field.
  1023. func (u *BatchImageJobUpsert) ClearProviderInputRef() *BatchImageJobUpsert {
  1024. u.SetNull(batchimagejob.FieldProviderInputRef)
  1025. return u
  1026. }
  1027. // SetProviderOutputRef sets the "provider_output_ref" field.
  1028. func (u *BatchImageJobUpsert) SetProviderOutputRef(v string) *BatchImageJobUpsert {
  1029. u.Set(batchimagejob.FieldProviderOutputRef, v)
  1030. return u
  1031. }
  1032. // UpdateProviderOutputRef sets the "provider_output_ref" field to the value that was provided on create.
  1033. func (u *BatchImageJobUpsert) UpdateProviderOutputRef() *BatchImageJobUpsert {
  1034. u.SetExcluded(batchimagejob.FieldProviderOutputRef)
  1035. return u
  1036. }
  1037. // ClearProviderOutputRef clears the value of the "provider_output_ref" field.
  1038. func (u *BatchImageJobUpsert) ClearProviderOutputRef() *BatchImageJobUpsert {
  1039. u.SetNull(batchimagejob.FieldProviderOutputRef)
  1040. return u
  1041. }
  1042. // SetGcsInputURI sets the "gcs_input_uri" field.
  1043. func (u *BatchImageJobUpsert) SetGcsInputURI(v string) *BatchImageJobUpsert {
  1044. u.Set(batchimagejob.FieldGcsInputURI, v)
  1045. return u
  1046. }
  1047. // UpdateGcsInputURI sets the "gcs_input_uri" field to the value that was provided on create.
  1048. func (u *BatchImageJobUpsert) UpdateGcsInputURI() *BatchImageJobUpsert {
  1049. u.SetExcluded(batchimagejob.FieldGcsInputURI)
  1050. return u
  1051. }
  1052. // ClearGcsInputURI clears the value of the "gcs_input_uri" field.
  1053. func (u *BatchImageJobUpsert) ClearGcsInputURI() *BatchImageJobUpsert {
  1054. u.SetNull(batchimagejob.FieldGcsInputURI)
  1055. return u
  1056. }
  1057. // SetGcsOutputURI sets the "gcs_output_uri" field.
  1058. func (u *BatchImageJobUpsert) SetGcsOutputURI(v string) *BatchImageJobUpsert {
  1059. u.Set(batchimagejob.FieldGcsOutputURI, v)
  1060. return u
  1061. }
  1062. // UpdateGcsOutputURI sets the "gcs_output_uri" field to the value that was provided on create.
  1063. func (u *BatchImageJobUpsert) UpdateGcsOutputURI() *BatchImageJobUpsert {
  1064. u.SetExcluded(batchimagejob.FieldGcsOutputURI)
  1065. return u
  1066. }
  1067. // ClearGcsOutputURI clears the value of the "gcs_output_uri" field.
  1068. func (u *BatchImageJobUpsert) ClearGcsOutputURI() *BatchImageJobUpsert {
  1069. u.SetNull(batchimagejob.FieldGcsOutputURI)
  1070. return u
  1071. }
  1072. // SetItemCount sets the "item_count" field.
  1073. func (u *BatchImageJobUpsert) SetItemCount(v int) *BatchImageJobUpsert {
  1074. u.Set(batchimagejob.FieldItemCount, v)
  1075. return u
  1076. }
  1077. // UpdateItemCount sets the "item_count" field to the value that was provided on create.
  1078. func (u *BatchImageJobUpsert) UpdateItemCount() *BatchImageJobUpsert {
  1079. u.SetExcluded(batchimagejob.FieldItemCount)
  1080. return u
  1081. }
  1082. // AddItemCount adds v to the "item_count" field.
  1083. func (u *BatchImageJobUpsert) AddItemCount(v int) *BatchImageJobUpsert {
  1084. u.Add(batchimagejob.FieldItemCount, v)
  1085. return u
  1086. }
  1087. // SetSuccessCount sets the "success_count" field.
  1088. func (u *BatchImageJobUpsert) SetSuccessCount(v int) *BatchImageJobUpsert {
  1089. u.Set(batchimagejob.FieldSuccessCount, v)
  1090. return u
  1091. }
  1092. // UpdateSuccessCount sets the "success_count" field to the value that was provided on create.
  1093. func (u *BatchImageJobUpsert) UpdateSuccessCount() *BatchImageJobUpsert {
  1094. u.SetExcluded(batchimagejob.FieldSuccessCount)
  1095. return u
  1096. }
  1097. // AddSuccessCount adds v to the "success_count" field.
  1098. func (u *BatchImageJobUpsert) AddSuccessCount(v int) *BatchImageJobUpsert {
  1099. u.Add(batchimagejob.FieldSuccessCount, v)
  1100. return u
  1101. }
  1102. // SetFailCount sets the "fail_count" field.
  1103. func (u *BatchImageJobUpsert) SetFailCount(v int) *BatchImageJobUpsert {
  1104. u.Set(batchimagejob.FieldFailCount, v)
  1105. return u
  1106. }
  1107. // UpdateFailCount sets the "fail_count" field to the value that was provided on create.
  1108. func (u *BatchImageJobUpsert) UpdateFailCount() *BatchImageJobUpsert {
  1109. u.SetExcluded(batchimagejob.FieldFailCount)
  1110. return u
  1111. }
  1112. // AddFailCount adds v to the "fail_count" field.
  1113. func (u *BatchImageJobUpsert) AddFailCount(v int) *BatchImageJobUpsert {
  1114. u.Add(batchimagejob.FieldFailCount, v)
  1115. return u
  1116. }
  1117. // SetCancelledCount sets the "cancelled_count" field.
  1118. func (u *BatchImageJobUpsert) SetCancelledCount(v int) *BatchImageJobUpsert {
  1119. u.Set(batchimagejob.FieldCancelledCount, v)
  1120. return u
  1121. }
  1122. // UpdateCancelledCount sets the "cancelled_count" field to the value that was provided on create.
  1123. func (u *BatchImageJobUpsert) UpdateCancelledCount() *BatchImageJobUpsert {
  1124. u.SetExcluded(batchimagejob.FieldCancelledCount)
  1125. return u
  1126. }
  1127. // AddCancelledCount adds v to the "cancelled_count" field.
  1128. func (u *BatchImageJobUpsert) AddCancelledCount(v int) *BatchImageJobUpsert {
  1129. u.Add(batchimagejob.FieldCancelledCount, v)
  1130. return u
  1131. }
  1132. // SetEstimatedCost sets the "estimated_cost" field.
  1133. func (u *BatchImageJobUpsert) SetEstimatedCost(v float64) *BatchImageJobUpsert {
  1134. u.Set(batchimagejob.FieldEstimatedCost, v)
  1135. return u
  1136. }
  1137. // UpdateEstimatedCost sets the "estimated_cost" field to the value that was provided on create.
  1138. func (u *BatchImageJobUpsert) UpdateEstimatedCost() *BatchImageJobUpsert {
  1139. u.SetExcluded(batchimagejob.FieldEstimatedCost)
  1140. return u
  1141. }
  1142. // AddEstimatedCost adds v to the "estimated_cost" field.
  1143. func (u *BatchImageJobUpsert) AddEstimatedCost(v float64) *BatchImageJobUpsert {
  1144. u.Add(batchimagejob.FieldEstimatedCost, v)
  1145. return u
  1146. }
  1147. // SetHoldAmount sets the "hold_amount" field.
  1148. func (u *BatchImageJobUpsert) SetHoldAmount(v float64) *BatchImageJobUpsert {
  1149. u.Set(batchimagejob.FieldHoldAmount, v)
  1150. return u
  1151. }
  1152. // UpdateHoldAmount sets the "hold_amount" field to the value that was provided on create.
  1153. func (u *BatchImageJobUpsert) UpdateHoldAmount() *BatchImageJobUpsert {
  1154. u.SetExcluded(batchimagejob.FieldHoldAmount)
  1155. return u
  1156. }
  1157. // AddHoldAmount adds v to the "hold_amount" field.
  1158. func (u *BatchImageJobUpsert) AddHoldAmount(v float64) *BatchImageJobUpsert {
  1159. u.Add(batchimagejob.FieldHoldAmount, v)
  1160. return u
  1161. }
  1162. // ClearHoldAmount clears the value of the "hold_amount" field.
  1163. func (u *BatchImageJobUpsert) ClearHoldAmount() *BatchImageJobUpsert {
  1164. u.SetNull(batchimagejob.FieldHoldAmount)
  1165. return u
  1166. }
  1167. // SetActualCost sets the "actual_cost" field.
  1168. func (u *BatchImageJobUpsert) SetActualCost(v float64) *BatchImageJobUpsert {
  1169. u.Set(batchimagejob.FieldActualCost, v)
  1170. return u
  1171. }
  1172. // UpdateActualCost sets the "actual_cost" field to the value that was provided on create.
  1173. func (u *BatchImageJobUpsert) UpdateActualCost() *BatchImageJobUpsert {
  1174. u.SetExcluded(batchimagejob.FieldActualCost)
  1175. return u
  1176. }
  1177. // AddActualCost adds v to the "actual_cost" field.
  1178. func (u *BatchImageJobUpsert) AddActualCost(v float64) *BatchImageJobUpsert {
  1179. u.Add(batchimagejob.FieldActualCost, v)
  1180. return u
  1181. }
  1182. // ClearActualCost clears the value of the "actual_cost" field.
  1183. func (u *BatchImageJobUpsert) ClearActualCost() *BatchImageJobUpsert {
  1184. u.SetNull(batchimagejob.FieldActualCost)
  1185. return u
  1186. }
  1187. // SetCurrency sets the "currency" field.
  1188. func (u *BatchImageJobUpsert) SetCurrency(v string) *BatchImageJobUpsert {
  1189. u.Set(batchimagejob.FieldCurrency, v)
  1190. return u
  1191. }
  1192. // UpdateCurrency sets the "currency" field to the value that was provided on create.
  1193. func (u *BatchImageJobUpsert) UpdateCurrency() *BatchImageJobUpsert {
  1194. u.SetExcluded(batchimagejob.FieldCurrency)
  1195. return u
  1196. }
  1197. // SetHoldID sets the "hold_id" field.
  1198. func (u *BatchImageJobUpsert) SetHoldID(v string) *BatchImageJobUpsert {
  1199. u.Set(batchimagejob.FieldHoldID, v)
  1200. return u
  1201. }
  1202. // UpdateHoldID sets the "hold_id" field to the value that was provided on create.
  1203. func (u *BatchImageJobUpsert) UpdateHoldID() *BatchImageJobUpsert {
  1204. u.SetExcluded(batchimagejob.FieldHoldID)
  1205. return u
  1206. }
  1207. // ClearHoldID clears the value of the "hold_id" field.
  1208. func (u *BatchImageJobUpsert) ClearHoldID() *BatchImageJobUpsert {
  1209. u.SetNull(batchimagejob.FieldHoldID)
  1210. return u
  1211. }
  1212. // SetIdempotencyKey sets the "idempotency_key" field.
  1213. func (u *BatchImageJobUpsert) SetIdempotencyKey(v string) *BatchImageJobUpsert {
  1214. u.Set(batchimagejob.FieldIdempotencyKey, v)
  1215. return u
  1216. }
  1217. // UpdateIdempotencyKey sets the "idempotency_key" field to the value that was provided on create.
  1218. func (u *BatchImageJobUpsert) UpdateIdempotencyKey() *BatchImageJobUpsert {
  1219. u.SetExcluded(batchimagejob.FieldIdempotencyKey)
  1220. return u
  1221. }
  1222. // ClearIdempotencyKey clears the value of the "idempotency_key" field.
  1223. func (u *BatchImageJobUpsert) ClearIdempotencyKey() *BatchImageJobUpsert {
  1224. u.SetNull(batchimagejob.FieldIdempotencyKey)
  1225. return u
  1226. }
  1227. // SetRequestHash sets the "request_hash" field.
  1228. func (u *BatchImageJobUpsert) SetRequestHash(v string) *BatchImageJobUpsert {
  1229. u.Set(batchimagejob.FieldRequestHash, v)
  1230. return u
  1231. }
  1232. // UpdateRequestHash sets the "request_hash" field to the value that was provided on create.
  1233. func (u *BatchImageJobUpsert) UpdateRequestHash() *BatchImageJobUpsert {
  1234. u.SetExcluded(batchimagejob.FieldRequestHash)
  1235. return u
  1236. }
  1237. // ClearRequestHash clears the value of the "request_hash" field.
  1238. func (u *BatchImageJobUpsert) ClearRequestHash() *BatchImageJobUpsert {
  1239. u.SetNull(batchimagejob.FieldRequestHash)
  1240. return u
  1241. }
  1242. // SetManifestHash sets the "manifest_hash" field.
  1243. func (u *BatchImageJobUpsert) SetManifestHash(v string) *BatchImageJobUpsert {
  1244. u.Set(batchimagejob.FieldManifestHash, v)
  1245. return u
  1246. }
  1247. // UpdateManifestHash sets the "manifest_hash" field to the value that was provided on create.
  1248. func (u *BatchImageJobUpsert) UpdateManifestHash() *BatchImageJobUpsert {
  1249. u.SetExcluded(batchimagejob.FieldManifestHash)
  1250. return u
  1251. }
  1252. // ClearManifestHash clears the value of the "manifest_hash" field.
  1253. func (u *BatchImageJobUpsert) ClearManifestHash() *BatchImageJobUpsert {
  1254. u.SetNull(batchimagejob.FieldManifestHash)
  1255. return u
  1256. }
  1257. // SetRetryCount sets the "retry_count" field.
  1258. func (u *BatchImageJobUpsert) SetRetryCount(v int) *BatchImageJobUpsert {
  1259. u.Set(batchimagejob.FieldRetryCount, v)
  1260. return u
  1261. }
  1262. // UpdateRetryCount sets the "retry_count" field to the value that was provided on create.
  1263. func (u *BatchImageJobUpsert) UpdateRetryCount() *BatchImageJobUpsert {
  1264. u.SetExcluded(batchimagejob.FieldRetryCount)
  1265. return u
  1266. }
  1267. // AddRetryCount adds v to the "retry_count" field.
  1268. func (u *BatchImageJobUpsert) AddRetryCount(v int) *BatchImageJobUpsert {
  1269. u.Add(batchimagejob.FieldRetryCount, v)
  1270. return u
  1271. }
  1272. // SetVersion sets the "version" field.
  1273. func (u *BatchImageJobUpsert) SetVersion(v int) *BatchImageJobUpsert {
  1274. u.Set(batchimagejob.FieldVersion, v)
  1275. return u
  1276. }
  1277. // UpdateVersion sets the "version" field to the value that was provided on create.
  1278. func (u *BatchImageJobUpsert) UpdateVersion() *BatchImageJobUpsert {
  1279. u.SetExcluded(batchimagejob.FieldVersion)
  1280. return u
  1281. }
  1282. // AddVersion adds v to the "version" field.
  1283. func (u *BatchImageJobUpsert) AddVersion(v int) *BatchImageJobUpsert {
  1284. u.Add(batchimagejob.FieldVersion, v)
  1285. return u
  1286. }
  1287. // SetOutputExpiresAt sets the "output_expires_at" field.
  1288. func (u *BatchImageJobUpsert) SetOutputExpiresAt(v time.Time) *BatchImageJobUpsert {
  1289. u.Set(batchimagejob.FieldOutputExpiresAt, v)
  1290. return u
  1291. }
  1292. // UpdateOutputExpiresAt sets the "output_expires_at" field to the value that was provided on create.
  1293. func (u *BatchImageJobUpsert) UpdateOutputExpiresAt() *BatchImageJobUpsert {
  1294. u.SetExcluded(batchimagejob.FieldOutputExpiresAt)
  1295. return u
  1296. }
  1297. // ClearOutputExpiresAt clears the value of the "output_expires_at" field.
  1298. func (u *BatchImageJobUpsert) ClearOutputExpiresAt() *BatchImageJobUpsert {
  1299. u.SetNull(batchimagejob.FieldOutputExpiresAt)
  1300. return u
  1301. }
  1302. // SetInputDeletedAt sets the "input_deleted_at" field.
  1303. func (u *BatchImageJobUpsert) SetInputDeletedAt(v time.Time) *BatchImageJobUpsert {
  1304. u.Set(batchimagejob.FieldInputDeletedAt, v)
  1305. return u
  1306. }
  1307. // UpdateInputDeletedAt sets the "input_deleted_at" field to the value that was provided on create.
  1308. func (u *BatchImageJobUpsert) UpdateInputDeletedAt() *BatchImageJobUpsert {
  1309. u.SetExcluded(batchimagejob.FieldInputDeletedAt)
  1310. return u
  1311. }
  1312. // ClearInputDeletedAt clears the value of the "input_deleted_at" field.
  1313. func (u *BatchImageJobUpsert) ClearInputDeletedAt() *BatchImageJobUpsert {
  1314. u.SetNull(batchimagejob.FieldInputDeletedAt)
  1315. return u
  1316. }
  1317. // SetOutputDeletedAt sets the "output_deleted_at" field.
  1318. func (u *BatchImageJobUpsert) SetOutputDeletedAt(v time.Time) *BatchImageJobUpsert {
  1319. u.Set(batchimagejob.FieldOutputDeletedAt, v)
  1320. return u
  1321. }
  1322. // UpdateOutputDeletedAt sets the "output_deleted_at" field to the value that was provided on create.
  1323. func (u *BatchImageJobUpsert) UpdateOutputDeletedAt() *BatchImageJobUpsert {
  1324. u.SetExcluded(batchimagejob.FieldOutputDeletedAt)
  1325. return u
  1326. }
  1327. // ClearOutputDeletedAt clears the value of the "output_deleted_at" field.
  1328. func (u *BatchImageJobUpsert) ClearOutputDeletedAt() *BatchImageJobUpsert {
  1329. u.SetNull(batchimagejob.FieldOutputDeletedAt)
  1330. return u
  1331. }
  1332. // SetDownloadedAt sets the "downloaded_at" field.
  1333. func (u *BatchImageJobUpsert) SetDownloadedAt(v time.Time) *BatchImageJobUpsert {
  1334. u.Set(batchimagejob.FieldDownloadedAt, v)
  1335. return u
  1336. }
  1337. // UpdateDownloadedAt sets the "downloaded_at" field to the value that was provided on create.
  1338. func (u *BatchImageJobUpsert) UpdateDownloadedAt() *BatchImageJobUpsert {
  1339. u.SetExcluded(batchimagejob.FieldDownloadedAt)
  1340. return u
  1341. }
  1342. // ClearDownloadedAt clears the value of the "downloaded_at" field.
  1343. func (u *BatchImageJobUpsert) ClearDownloadedAt() *BatchImageJobUpsert {
  1344. u.SetNull(batchimagejob.FieldDownloadedAt)
  1345. return u
  1346. }
  1347. // SetUserDeletedAt sets the "user_deleted_at" field.
  1348. func (u *BatchImageJobUpsert) SetUserDeletedAt(v time.Time) *BatchImageJobUpsert {
  1349. u.Set(batchimagejob.FieldUserDeletedAt, v)
  1350. return u
  1351. }
  1352. // UpdateUserDeletedAt sets the "user_deleted_at" field to the value that was provided on create.
  1353. func (u *BatchImageJobUpsert) UpdateUserDeletedAt() *BatchImageJobUpsert {
  1354. u.SetExcluded(batchimagejob.FieldUserDeletedAt)
  1355. return u
  1356. }
  1357. // ClearUserDeletedAt clears the value of the "user_deleted_at" field.
  1358. func (u *BatchImageJobUpsert) ClearUserDeletedAt() *BatchImageJobUpsert {
  1359. u.SetNull(batchimagejob.FieldUserDeletedAt)
  1360. return u
  1361. }
  1362. // SetLastErrorCode sets the "last_error_code" field.
  1363. func (u *BatchImageJobUpsert) SetLastErrorCode(v string) *BatchImageJobUpsert {
  1364. u.Set(batchimagejob.FieldLastErrorCode, v)
  1365. return u
  1366. }
  1367. // UpdateLastErrorCode sets the "last_error_code" field to the value that was provided on create.
  1368. func (u *BatchImageJobUpsert) UpdateLastErrorCode() *BatchImageJobUpsert {
  1369. u.SetExcluded(batchimagejob.FieldLastErrorCode)
  1370. return u
  1371. }
  1372. // ClearLastErrorCode clears the value of the "last_error_code" field.
  1373. func (u *BatchImageJobUpsert) ClearLastErrorCode() *BatchImageJobUpsert {
  1374. u.SetNull(batchimagejob.FieldLastErrorCode)
  1375. return u
  1376. }
  1377. // SetLastErrorMessage sets the "last_error_message" field.
  1378. func (u *BatchImageJobUpsert) SetLastErrorMessage(v string) *BatchImageJobUpsert {
  1379. u.Set(batchimagejob.FieldLastErrorMessage, v)
  1380. return u
  1381. }
  1382. // UpdateLastErrorMessage sets the "last_error_message" field to the value that was provided on create.
  1383. func (u *BatchImageJobUpsert) UpdateLastErrorMessage() *BatchImageJobUpsert {
  1384. u.SetExcluded(batchimagejob.FieldLastErrorMessage)
  1385. return u
  1386. }
  1387. // ClearLastErrorMessage clears the value of the "last_error_message" field.
  1388. func (u *BatchImageJobUpsert) ClearLastErrorMessage() *BatchImageJobUpsert {
  1389. u.SetNull(batchimagejob.FieldLastErrorMessage)
  1390. return u
  1391. }
  1392. // SetUpdatedAt sets the "updated_at" field.
  1393. func (u *BatchImageJobUpsert) SetUpdatedAt(v time.Time) *BatchImageJobUpsert {
  1394. u.Set(batchimagejob.FieldUpdatedAt, v)
  1395. return u
  1396. }
  1397. // UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
  1398. func (u *BatchImageJobUpsert) UpdateUpdatedAt() *BatchImageJobUpsert {
  1399. u.SetExcluded(batchimagejob.FieldUpdatedAt)
  1400. return u
  1401. }
  1402. // SetSubmittedAt sets the "submitted_at" field.
  1403. func (u *BatchImageJobUpsert) SetSubmittedAt(v time.Time) *BatchImageJobUpsert {
  1404. u.Set(batchimagejob.FieldSubmittedAt, v)
  1405. return u
  1406. }
  1407. // UpdateSubmittedAt sets the "submitted_at" field to the value that was provided on create.
  1408. func (u *BatchImageJobUpsert) UpdateSubmittedAt() *BatchImageJobUpsert {
  1409. u.SetExcluded(batchimagejob.FieldSubmittedAt)
  1410. return u
  1411. }
  1412. // ClearSubmittedAt clears the value of the "submitted_at" field.
  1413. func (u *BatchImageJobUpsert) ClearSubmittedAt() *BatchImageJobUpsert {
  1414. u.SetNull(batchimagejob.FieldSubmittedAt)
  1415. return u
  1416. }
  1417. // SetStartedAt sets the "started_at" field.
  1418. func (u *BatchImageJobUpsert) SetStartedAt(v time.Time) *BatchImageJobUpsert {
  1419. u.Set(batchimagejob.FieldStartedAt, v)
  1420. return u
  1421. }
  1422. // UpdateStartedAt sets the "started_at" field to the value that was provided on create.
  1423. func (u *BatchImageJobUpsert) UpdateStartedAt() *BatchImageJobUpsert {
  1424. u.SetExcluded(batchimagejob.FieldStartedAt)
  1425. return u
  1426. }
  1427. // ClearStartedAt clears the value of the "started_at" field.
  1428. func (u *BatchImageJobUpsert) ClearStartedAt() *BatchImageJobUpsert {
  1429. u.SetNull(batchimagejob.FieldStartedAt)
  1430. return u
  1431. }
  1432. // SetFinishedAt sets the "finished_at" field.
  1433. func (u *BatchImageJobUpsert) SetFinishedAt(v time.Time) *BatchImageJobUpsert {
  1434. u.Set(batchimagejob.FieldFinishedAt, v)
  1435. return u
  1436. }
  1437. // UpdateFinishedAt sets the "finished_at" field to the value that was provided on create.
  1438. func (u *BatchImageJobUpsert) UpdateFinishedAt() *BatchImageJobUpsert {
  1439. u.SetExcluded(batchimagejob.FieldFinishedAt)
  1440. return u
  1441. }
  1442. // ClearFinishedAt clears the value of the "finished_at" field.
  1443. func (u *BatchImageJobUpsert) ClearFinishedAt() *BatchImageJobUpsert {
  1444. u.SetNull(batchimagejob.FieldFinishedAt)
  1445. return u
  1446. }
  1447. // SetSettledAt sets the "settled_at" field.
  1448. func (u *BatchImageJobUpsert) SetSettledAt(v time.Time) *BatchImageJobUpsert {
  1449. u.Set(batchimagejob.FieldSettledAt, v)
  1450. return u
  1451. }
  1452. // UpdateSettledAt sets the "settled_at" field to the value that was provided on create.
  1453. func (u *BatchImageJobUpsert) UpdateSettledAt() *BatchImageJobUpsert {
  1454. u.SetExcluded(batchimagejob.FieldSettledAt)
  1455. return u
  1456. }
  1457. // ClearSettledAt clears the value of the "settled_at" field.
  1458. func (u *BatchImageJobUpsert) ClearSettledAt() *BatchImageJobUpsert {
  1459. u.SetNull(batchimagejob.FieldSettledAt)
  1460. return u
  1461. }
  1462. // UpdateNewValues updates the mutable fields using the new values that were set on create.
  1463. // Using this option is equivalent to using:
  1464. //
  1465. // client.BatchImageJob.Create().
  1466. // OnConflict(
  1467. // sql.ResolveWithNewValues(),
  1468. // ).
  1469. // Exec(ctx)
  1470. func (u *BatchImageJobUpsertOne) UpdateNewValues() *BatchImageJobUpsertOne {
  1471. u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues())
  1472. u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) {
  1473. if _, exists := u.create.mutation.BatchID(); exists {
  1474. s.SetIgnore(batchimagejob.FieldBatchID)
  1475. }
  1476. if _, exists := u.create.mutation.CreatedAt(); exists {
  1477. s.SetIgnore(batchimagejob.FieldCreatedAt)
  1478. }
  1479. }))
  1480. return u
  1481. }
  1482. // Ignore sets each column to itself in case of conflict.
  1483. // Using this option is equivalent to using:
  1484. //
  1485. // client.BatchImageJob.Create().
  1486. // OnConflict(sql.ResolveWithIgnore()).
  1487. // Exec(ctx)
  1488. func (u *BatchImageJobUpsertOne) Ignore() *BatchImageJobUpsertOne {
  1489. u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore())
  1490. return u
  1491. }
  1492. // DoNothing configures the conflict_action to `DO NOTHING`.
  1493. // Supported only by SQLite and PostgreSQL.
  1494. func (u *BatchImageJobUpsertOne) DoNothing() *BatchImageJobUpsertOne {
  1495. u.create.conflict = append(u.create.conflict, sql.DoNothing())
  1496. return u
  1497. }
  1498. // Update allows overriding fields `UPDATE` values. See the BatchImageJobCreate.OnConflict
  1499. // documentation for more info.
  1500. func (u *BatchImageJobUpsertOne) Update(set func(*BatchImageJobUpsert)) *BatchImageJobUpsertOne {
  1501. u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
  1502. set(&BatchImageJobUpsert{UpdateSet: update})
  1503. }))
  1504. return u
  1505. }
  1506. // SetUserID sets the "user_id" field.
  1507. func (u *BatchImageJobUpsertOne) SetUserID(v int64) *BatchImageJobUpsertOne {
  1508. return u.Update(func(s *BatchImageJobUpsert) {
  1509. s.SetUserID(v)
  1510. })
  1511. }
  1512. // AddUserID adds v to the "user_id" field.
  1513. func (u *BatchImageJobUpsertOne) AddUserID(v int64) *BatchImageJobUpsertOne {
  1514. return u.Update(func(s *BatchImageJobUpsert) {
  1515. s.AddUserID(v)
  1516. })
  1517. }
  1518. // UpdateUserID sets the "user_id" field to the value that was provided on create.
  1519. func (u *BatchImageJobUpsertOne) UpdateUserID() *BatchImageJobUpsertOne {
  1520. return u.Update(func(s *BatchImageJobUpsert) {
  1521. s.UpdateUserID()
  1522. })
  1523. }
  1524. // SetAPIKeyID sets the "api_key_id" field.
  1525. func (u *BatchImageJobUpsertOne) SetAPIKeyID(v int64) *BatchImageJobUpsertOne {
  1526. return u.Update(func(s *BatchImageJobUpsert) {
  1527. s.SetAPIKeyID(v)
  1528. })
  1529. }
  1530. // AddAPIKeyID adds v to the "api_key_id" field.
  1531. func (u *BatchImageJobUpsertOne) AddAPIKeyID(v int64) *BatchImageJobUpsertOne {
  1532. return u.Update(func(s *BatchImageJobUpsert) {
  1533. s.AddAPIKeyID(v)
  1534. })
  1535. }
  1536. // UpdateAPIKeyID sets the "api_key_id" field to the value that was provided on create.
  1537. func (u *BatchImageJobUpsertOne) UpdateAPIKeyID() *BatchImageJobUpsertOne {
  1538. return u.Update(func(s *BatchImageJobUpsert) {
  1539. s.UpdateAPIKeyID()
  1540. })
  1541. }
  1542. // ClearAPIKeyID clears the value of the "api_key_id" field.
  1543. func (u *BatchImageJobUpsertOne) ClearAPIKeyID() *BatchImageJobUpsertOne {
  1544. return u.Update(func(s *BatchImageJobUpsert) {
  1545. s.ClearAPIKeyID()
  1546. })
  1547. }
  1548. // SetAccountID sets the "account_id" field.
  1549. func (u *BatchImageJobUpsertOne) SetAccountID(v int64) *BatchImageJobUpsertOne {
  1550. return u.Update(func(s *BatchImageJobUpsert) {
  1551. s.SetAccountID(v)
  1552. })
  1553. }
  1554. // AddAccountID adds v to the "account_id" field.
  1555. func (u *BatchImageJobUpsertOne) AddAccountID(v int64) *BatchImageJobUpsertOne {
  1556. return u.Update(func(s *BatchImageJobUpsert) {
  1557. s.AddAccountID(v)
  1558. })
  1559. }
  1560. // UpdateAccountID sets the "account_id" field to the value that was provided on create.
  1561. func (u *BatchImageJobUpsertOne) UpdateAccountID() *BatchImageJobUpsertOne {
  1562. return u.Update(func(s *BatchImageJobUpsert) {
  1563. s.UpdateAccountID()
  1564. })
  1565. }
  1566. // ClearAccountID clears the value of the "account_id" field.
  1567. func (u *BatchImageJobUpsertOne) ClearAccountID() *BatchImageJobUpsertOne {
  1568. return u.Update(func(s *BatchImageJobUpsert) {
  1569. s.ClearAccountID()
  1570. })
  1571. }
  1572. // SetProvider sets the "provider" field.
  1573. func (u *BatchImageJobUpsertOne) SetProvider(v string) *BatchImageJobUpsertOne {
  1574. return u.Update(func(s *BatchImageJobUpsert) {
  1575. s.SetProvider(v)
  1576. })
  1577. }
  1578. // UpdateProvider sets the "provider" field to the value that was provided on create.
  1579. func (u *BatchImageJobUpsertOne) UpdateProvider() *BatchImageJobUpsertOne {
  1580. return u.Update(func(s *BatchImageJobUpsert) {
  1581. s.UpdateProvider()
  1582. })
  1583. }
  1584. // SetModel sets the "model" field.
  1585. func (u *BatchImageJobUpsertOne) SetModel(v string) *BatchImageJobUpsertOne {
  1586. return u.Update(func(s *BatchImageJobUpsert) {
  1587. s.SetModel(v)
  1588. })
  1589. }
  1590. // UpdateModel sets the "model" field to the value that was provided on create.
  1591. func (u *BatchImageJobUpsertOne) UpdateModel() *BatchImageJobUpsertOne {
  1592. return u.Update(func(s *BatchImageJobUpsert) {
  1593. s.UpdateModel()
  1594. })
  1595. }
  1596. // SetTaskName sets the "task_name" field.
  1597. func (u *BatchImageJobUpsertOne) SetTaskName(v string) *BatchImageJobUpsertOne {
  1598. return u.Update(func(s *BatchImageJobUpsert) {
  1599. s.SetTaskName(v)
  1600. })
  1601. }
  1602. // UpdateTaskName sets the "task_name" field to the value that was provided on create.
  1603. func (u *BatchImageJobUpsertOne) UpdateTaskName() *BatchImageJobUpsertOne {
  1604. return u.Update(func(s *BatchImageJobUpsert) {
  1605. s.UpdateTaskName()
  1606. })
  1607. }
  1608. // SetStatus sets the "status" field.
  1609. func (u *BatchImageJobUpsertOne) SetStatus(v string) *BatchImageJobUpsertOne {
  1610. return u.Update(func(s *BatchImageJobUpsert) {
  1611. s.SetStatus(v)
  1612. })
  1613. }
  1614. // UpdateStatus sets the "status" field to the value that was provided on create.
  1615. func (u *BatchImageJobUpsertOne) UpdateStatus() *BatchImageJobUpsertOne {
  1616. return u.Update(func(s *BatchImageJobUpsert) {
  1617. s.UpdateStatus()
  1618. })
  1619. }
  1620. // SetProviderJobName sets the "provider_job_name" field.
  1621. func (u *BatchImageJobUpsertOne) SetProviderJobName(v string) *BatchImageJobUpsertOne {
  1622. return u.Update(func(s *BatchImageJobUpsert) {
  1623. s.SetProviderJobName(v)
  1624. })
  1625. }
  1626. // UpdateProviderJobName sets the "provider_job_name" field to the value that was provided on create.
  1627. func (u *BatchImageJobUpsertOne) UpdateProviderJobName() *BatchImageJobUpsertOne {
  1628. return u.Update(func(s *BatchImageJobUpsert) {
  1629. s.UpdateProviderJobName()
  1630. })
  1631. }
  1632. // ClearProviderJobName clears the value of the "provider_job_name" field.
  1633. func (u *BatchImageJobUpsertOne) ClearProviderJobName() *BatchImageJobUpsertOne {
  1634. return u.Update(func(s *BatchImageJobUpsert) {
  1635. s.ClearProviderJobName()
  1636. })
  1637. }
  1638. // SetProviderInputRef sets the "provider_input_ref" field.
  1639. func (u *BatchImageJobUpsertOne) SetProviderInputRef(v string) *BatchImageJobUpsertOne {
  1640. return u.Update(func(s *BatchImageJobUpsert) {
  1641. s.SetProviderInputRef(v)
  1642. })
  1643. }
  1644. // UpdateProviderInputRef sets the "provider_input_ref" field to the value that was provided on create.
  1645. func (u *BatchImageJobUpsertOne) UpdateProviderInputRef() *BatchImageJobUpsertOne {
  1646. return u.Update(func(s *BatchImageJobUpsert) {
  1647. s.UpdateProviderInputRef()
  1648. })
  1649. }
  1650. // ClearProviderInputRef clears the value of the "provider_input_ref" field.
  1651. func (u *BatchImageJobUpsertOne) ClearProviderInputRef() *BatchImageJobUpsertOne {
  1652. return u.Update(func(s *BatchImageJobUpsert) {
  1653. s.ClearProviderInputRef()
  1654. })
  1655. }
  1656. // SetProviderOutputRef sets the "provider_output_ref" field.
  1657. func (u *BatchImageJobUpsertOne) SetProviderOutputRef(v string) *BatchImageJobUpsertOne {
  1658. return u.Update(func(s *BatchImageJobUpsert) {
  1659. s.SetProviderOutputRef(v)
  1660. })
  1661. }
  1662. // UpdateProviderOutputRef sets the "provider_output_ref" field to the value that was provided on create.
  1663. func (u *BatchImageJobUpsertOne) UpdateProviderOutputRef() *BatchImageJobUpsertOne {
  1664. return u.Update(func(s *BatchImageJobUpsert) {
  1665. s.UpdateProviderOutputRef()
  1666. })
  1667. }
  1668. // ClearProviderOutputRef clears the value of the "provider_output_ref" field.
  1669. func (u *BatchImageJobUpsertOne) ClearProviderOutputRef() *BatchImageJobUpsertOne {
  1670. return u.Update(func(s *BatchImageJobUpsert) {
  1671. s.ClearProviderOutputRef()
  1672. })
  1673. }
  1674. // SetGcsInputURI sets the "gcs_input_uri" field.
  1675. func (u *BatchImageJobUpsertOne) SetGcsInputURI(v string) *BatchImageJobUpsertOne {
  1676. return u.Update(func(s *BatchImageJobUpsert) {
  1677. s.SetGcsInputURI(v)
  1678. })
  1679. }
  1680. // UpdateGcsInputURI sets the "gcs_input_uri" field to the value that was provided on create.
  1681. func (u *BatchImageJobUpsertOne) UpdateGcsInputURI() *BatchImageJobUpsertOne {
  1682. return u.Update(func(s *BatchImageJobUpsert) {
  1683. s.UpdateGcsInputURI()
  1684. })
  1685. }
  1686. // ClearGcsInputURI clears the value of the "gcs_input_uri" field.
  1687. func (u *BatchImageJobUpsertOne) ClearGcsInputURI() *BatchImageJobUpsertOne {
  1688. return u.Update(func(s *BatchImageJobUpsert) {
  1689. s.ClearGcsInputURI()
  1690. })
  1691. }
  1692. // SetGcsOutputURI sets the "gcs_output_uri" field.
  1693. func (u *BatchImageJobUpsertOne) SetGcsOutputURI(v string) *BatchImageJobUpsertOne {
  1694. return u.Update(func(s *BatchImageJobUpsert) {
  1695. s.SetGcsOutputURI(v)
  1696. })
  1697. }
  1698. // UpdateGcsOutputURI sets the "gcs_output_uri" field to the value that was provided on create.
  1699. func (u *BatchImageJobUpsertOne) UpdateGcsOutputURI() *BatchImageJobUpsertOne {
  1700. return u.Update(func(s *BatchImageJobUpsert) {
  1701. s.UpdateGcsOutputURI()
  1702. })
  1703. }
  1704. // ClearGcsOutputURI clears the value of the "gcs_output_uri" field.
  1705. func (u *BatchImageJobUpsertOne) ClearGcsOutputURI() *BatchImageJobUpsertOne {
  1706. return u.Update(func(s *BatchImageJobUpsert) {
  1707. s.ClearGcsOutputURI()
  1708. })
  1709. }
  1710. // SetItemCount sets the "item_count" field.
  1711. func (u *BatchImageJobUpsertOne) SetItemCount(v int) *BatchImageJobUpsertOne {
  1712. return u.Update(func(s *BatchImageJobUpsert) {
  1713. s.SetItemCount(v)
  1714. })
  1715. }
  1716. // AddItemCount adds v to the "item_count" field.
  1717. func (u *BatchImageJobUpsertOne) AddItemCount(v int) *BatchImageJobUpsertOne {
  1718. return u.Update(func(s *BatchImageJobUpsert) {
  1719. s.AddItemCount(v)
  1720. })
  1721. }
  1722. // UpdateItemCount sets the "item_count" field to the value that was provided on create.
  1723. func (u *BatchImageJobUpsertOne) UpdateItemCount() *BatchImageJobUpsertOne {
  1724. return u.Update(func(s *BatchImageJobUpsert) {
  1725. s.UpdateItemCount()
  1726. })
  1727. }
  1728. // SetSuccessCount sets the "success_count" field.
  1729. func (u *BatchImageJobUpsertOne) SetSuccessCount(v int) *BatchImageJobUpsertOne {
  1730. return u.Update(func(s *BatchImageJobUpsert) {
  1731. s.SetSuccessCount(v)
  1732. })
  1733. }
  1734. // AddSuccessCount adds v to the "success_count" field.
  1735. func (u *BatchImageJobUpsertOne) AddSuccessCount(v int) *BatchImageJobUpsertOne {
  1736. return u.Update(func(s *BatchImageJobUpsert) {
  1737. s.AddSuccessCount(v)
  1738. })
  1739. }
  1740. // UpdateSuccessCount sets the "success_count" field to the value that was provided on create.
  1741. func (u *BatchImageJobUpsertOne) UpdateSuccessCount() *BatchImageJobUpsertOne {
  1742. return u.Update(func(s *BatchImageJobUpsert) {
  1743. s.UpdateSuccessCount()
  1744. })
  1745. }
  1746. // SetFailCount sets the "fail_count" field.
  1747. func (u *BatchImageJobUpsertOne) SetFailCount(v int) *BatchImageJobUpsertOne {
  1748. return u.Update(func(s *BatchImageJobUpsert) {
  1749. s.SetFailCount(v)
  1750. })
  1751. }
  1752. // AddFailCount adds v to the "fail_count" field.
  1753. func (u *BatchImageJobUpsertOne) AddFailCount(v int) *BatchImageJobUpsertOne {
  1754. return u.Update(func(s *BatchImageJobUpsert) {
  1755. s.AddFailCount(v)
  1756. })
  1757. }
  1758. // UpdateFailCount sets the "fail_count" field to the value that was provided on create.
  1759. func (u *BatchImageJobUpsertOne) UpdateFailCount() *BatchImageJobUpsertOne {
  1760. return u.Update(func(s *BatchImageJobUpsert) {
  1761. s.UpdateFailCount()
  1762. })
  1763. }
  1764. // SetCancelledCount sets the "cancelled_count" field.
  1765. func (u *BatchImageJobUpsertOne) SetCancelledCount(v int) *BatchImageJobUpsertOne {
  1766. return u.Update(func(s *BatchImageJobUpsert) {
  1767. s.SetCancelledCount(v)
  1768. })
  1769. }
  1770. // AddCancelledCount adds v to the "cancelled_count" field.
  1771. func (u *BatchImageJobUpsertOne) AddCancelledCount(v int) *BatchImageJobUpsertOne {
  1772. return u.Update(func(s *BatchImageJobUpsert) {
  1773. s.AddCancelledCount(v)
  1774. })
  1775. }
  1776. // UpdateCancelledCount sets the "cancelled_count" field to the value that was provided on create.
  1777. func (u *BatchImageJobUpsertOne) UpdateCancelledCount() *BatchImageJobUpsertOne {
  1778. return u.Update(func(s *BatchImageJobUpsert) {
  1779. s.UpdateCancelledCount()
  1780. })
  1781. }
  1782. // SetEstimatedCost sets the "estimated_cost" field.
  1783. func (u *BatchImageJobUpsertOne) SetEstimatedCost(v float64) *BatchImageJobUpsertOne {
  1784. return u.Update(func(s *BatchImageJobUpsert) {
  1785. s.SetEstimatedCost(v)
  1786. })
  1787. }
  1788. // AddEstimatedCost adds v to the "estimated_cost" field.
  1789. func (u *BatchImageJobUpsertOne) AddEstimatedCost(v float64) *BatchImageJobUpsertOne {
  1790. return u.Update(func(s *BatchImageJobUpsert) {
  1791. s.AddEstimatedCost(v)
  1792. })
  1793. }
  1794. // UpdateEstimatedCost sets the "estimated_cost" field to the value that was provided on create.
  1795. func (u *BatchImageJobUpsertOne) UpdateEstimatedCost() *BatchImageJobUpsertOne {
  1796. return u.Update(func(s *BatchImageJobUpsert) {
  1797. s.UpdateEstimatedCost()
  1798. })
  1799. }
  1800. // SetHoldAmount sets the "hold_amount" field.
  1801. func (u *BatchImageJobUpsertOne) SetHoldAmount(v float64) *BatchImageJobUpsertOne {
  1802. return u.Update(func(s *BatchImageJobUpsert) {
  1803. s.SetHoldAmount(v)
  1804. })
  1805. }
  1806. // AddHoldAmount adds v to the "hold_amount" field.
  1807. func (u *BatchImageJobUpsertOne) AddHoldAmount(v float64) *BatchImageJobUpsertOne {
  1808. return u.Update(func(s *BatchImageJobUpsert) {
  1809. s.AddHoldAmount(v)
  1810. })
  1811. }
  1812. // UpdateHoldAmount sets the "hold_amount" field to the value that was provided on create.
  1813. func (u *BatchImageJobUpsertOne) UpdateHoldAmount() *BatchImageJobUpsertOne {
  1814. return u.Update(func(s *BatchImageJobUpsert) {
  1815. s.UpdateHoldAmount()
  1816. })
  1817. }
  1818. // ClearHoldAmount clears the value of the "hold_amount" field.
  1819. func (u *BatchImageJobUpsertOne) ClearHoldAmount() *BatchImageJobUpsertOne {
  1820. return u.Update(func(s *BatchImageJobUpsert) {
  1821. s.ClearHoldAmount()
  1822. })
  1823. }
  1824. // SetActualCost sets the "actual_cost" field.
  1825. func (u *BatchImageJobUpsertOne) SetActualCost(v float64) *BatchImageJobUpsertOne {
  1826. return u.Update(func(s *BatchImageJobUpsert) {
  1827. s.SetActualCost(v)
  1828. })
  1829. }
  1830. // AddActualCost adds v to the "actual_cost" field.
  1831. func (u *BatchImageJobUpsertOne) AddActualCost(v float64) *BatchImageJobUpsertOne {
  1832. return u.Update(func(s *BatchImageJobUpsert) {
  1833. s.AddActualCost(v)
  1834. })
  1835. }
  1836. // UpdateActualCost sets the "actual_cost" field to the value that was provided on create.
  1837. func (u *BatchImageJobUpsertOne) UpdateActualCost() *BatchImageJobUpsertOne {
  1838. return u.Update(func(s *BatchImageJobUpsert) {
  1839. s.UpdateActualCost()
  1840. })
  1841. }
  1842. // ClearActualCost clears the value of the "actual_cost" field.
  1843. func (u *BatchImageJobUpsertOne) ClearActualCost() *BatchImageJobUpsertOne {
  1844. return u.Update(func(s *BatchImageJobUpsert) {
  1845. s.ClearActualCost()
  1846. })
  1847. }
  1848. // SetCurrency sets the "currency" field.
  1849. func (u *BatchImageJobUpsertOne) SetCurrency(v string) *BatchImageJobUpsertOne {
  1850. return u.Update(func(s *BatchImageJobUpsert) {
  1851. s.SetCurrency(v)
  1852. })
  1853. }
  1854. // UpdateCurrency sets the "currency" field to the value that was provided on create.
  1855. func (u *BatchImageJobUpsertOne) UpdateCurrency() *BatchImageJobUpsertOne {
  1856. return u.Update(func(s *BatchImageJobUpsert) {
  1857. s.UpdateCurrency()
  1858. })
  1859. }
  1860. // SetHoldID sets the "hold_id" field.
  1861. func (u *BatchImageJobUpsertOne) SetHoldID(v string) *BatchImageJobUpsertOne {
  1862. return u.Update(func(s *BatchImageJobUpsert) {
  1863. s.SetHoldID(v)
  1864. })
  1865. }
  1866. // UpdateHoldID sets the "hold_id" field to the value that was provided on create.
  1867. func (u *BatchImageJobUpsertOne) UpdateHoldID() *BatchImageJobUpsertOne {
  1868. return u.Update(func(s *BatchImageJobUpsert) {
  1869. s.UpdateHoldID()
  1870. })
  1871. }
  1872. // ClearHoldID clears the value of the "hold_id" field.
  1873. func (u *BatchImageJobUpsertOne) ClearHoldID() *BatchImageJobUpsertOne {
  1874. return u.Update(func(s *BatchImageJobUpsert) {
  1875. s.ClearHoldID()
  1876. })
  1877. }
  1878. // SetIdempotencyKey sets the "idempotency_key" field.
  1879. func (u *BatchImageJobUpsertOne) SetIdempotencyKey(v string) *BatchImageJobUpsertOne {
  1880. return u.Update(func(s *BatchImageJobUpsert) {
  1881. s.SetIdempotencyKey(v)
  1882. })
  1883. }
  1884. // UpdateIdempotencyKey sets the "idempotency_key" field to the value that was provided on create.
  1885. func (u *BatchImageJobUpsertOne) UpdateIdempotencyKey() *BatchImageJobUpsertOne {
  1886. return u.Update(func(s *BatchImageJobUpsert) {
  1887. s.UpdateIdempotencyKey()
  1888. })
  1889. }
  1890. // ClearIdempotencyKey clears the value of the "idempotency_key" field.
  1891. func (u *BatchImageJobUpsertOne) ClearIdempotencyKey() *BatchImageJobUpsertOne {
  1892. return u.Update(func(s *BatchImageJobUpsert) {
  1893. s.ClearIdempotencyKey()
  1894. })
  1895. }
  1896. // SetRequestHash sets the "request_hash" field.
  1897. func (u *BatchImageJobUpsertOne) SetRequestHash(v string) *BatchImageJobUpsertOne {
  1898. return u.Update(func(s *BatchImageJobUpsert) {
  1899. s.SetRequestHash(v)
  1900. })
  1901. }
  1902. // UpdateRequestHash sets the "request_hash" field to the value that was provided on create.
  1903. func (u *BatchImageJobUpsertOne) UpdateRequestHash() *BatchImageJobUpsertOne {
  1904. return u.Update(func(s *BatchImageJobUpsert) {
  1905. s.UpdateRequestHash()
  1906. })
  1907. }
  1908. // ClearRequestHash clears the value of the "request_hash" field.
  1909. func (u *BatchImageJobUpsertOne) ClearRequestHash() *BatchImageJobUpsertOne {
  1910. return u.Update(func(s *BatchImageJobUpsert) {
  1911. s.ClearRequestHash()
  1912. })
  1913. }
  1914. // SetManifestHash sets the "manifest_hash" field.
  1915. func (u *BatchImageJobUpsertOne) SetManifestHash(v string) *BatchImageJobUpsertOne {
  1916. return u.Update(func(s *BatchImageJobUpsert) {
  1917. s.SetManifestHash(v)
  1918. })
  1919. }
  1920. // UpdateManifestHash sets the "manifest_hash" field to the value that was provided on create.
  1921. func (u *BatchImageJobUpsertOne) UpdateManifestHash() *BatchImageJobUpsertOne {
  1922. return u.Update(func(s *BatchImageJobUpsert) {
  1923. s.UpdateManifestHash()
  1924. })
  1925. }
  1926. // ClearManifestHash clears the value of the "manifest_hash" field.
  1927. func (u *BatchImageJobUpsertOne) ClearManifestHash() *BatchImageJobUpsertOne {
  1928. return u.Update(func(s *BatchImageJobUpsert) {
  1929. s.ClearManifestHash()
  1930. })
  1931. }
  1932. // SetRetryCount sets the "retry_count" field.
  1933. func (u *BatchImageJobUpsertOne) SetRetryCount(v int) *BatchImageJobUpsertOne {
  1934. return u.Update(func(s *BatchImageJobUpsert) {
  1935. s.SetRetryCount(v)
  1936. })
  1937. }
  1938. // AddRetryCount adds v to the "retry_count" field.
  1939. func (u *BatchImageJobUpsertOne) AddRetryCount(v int) *BatchImageJobUpsertOne {
  1940. return u.Update(func(s *BatchImageJobUpsert) {
  1941. s.AddRetryCount(v)
  1942. })
  1943. }
  1944. // UpdateRetryCount sets the "retry_count" field to the value that was provided on create.
  1945. func (u *BatchImageJobUpsertOne) UpdateRetryCount() *BatchImageJobUpsertOne {
  1946. return u.Update(func(s *BatchImageJobUpsert) {
  1947. s.UpdateRetryCount()
  1948. })
  1949. }
  1950. // SetVersion sets the "version" field.
  1951. func (u *BatchImageJobUpsertOne) SetVersion(v int) *BatchImageJobUpsertOne {
  1952. return u.Update(func(s *BatchImageJobUpsert) {
  1953. s.SetVersion(v)
  1954. })
  1955. }
  1956. // AddVersion adds v to the "version" field.
  1957. func (u *BatchImageJobUpsertOne) AddVersion(v int) *BatchImageJobUpsertOne {
  1958. return u.Update(func(s *BatchImageJobUpsert) {
  1959. s.AddVersion(v)
  1960. })
  1961. }
  1962. // UpdateVersion sets the "version" field to the value that was provided on create.
  1963. func (u *BatchImageJobUpsertOne) UpdateVersion() *BatchImageJobUpsertOne {
  1964. return u.Update(func(s *BatchImageJobUpsert) {
  1965. s.UpdateVersion()
  1966. })
  1967. }
  1968. // SetOutputExpiresAt sets the "output_expires_at" field.
  1969. func (u *BatchImageJobUpsertOne) SetOutputExpiresAt(v time.Time) *BatchImageJobUpsertOne {
  1970. return u.Update(func(s *BatchImageJobUpsert) {
  1971. s.SetOutputExpiresAt(v)
  1972. })
  1973. }
  1974. // UpdateOutputExpiresAt sets the "output_expires_at" field to the value that was provided on create.
  1975. func (u *BatchImageJobUpsertOne) UpdateOutputExpiresAt() *BatchImageJobUpsertOne {
  1976. return u.Update(func(s *BatchImageJobUpsert) {
  1977. s.UpdateOutputExpiresAt()
  1978. })
  1979. }
  1980. // ClearOutputExpiresAt clears the value of the "output_expires_at" field.
  1981. func (u *BatchImageJobUpsertOne) ClearOutputExpiresAt() *BatchImageJobUpsertOne {
  1982. return u.Update(func(s *BatchImageJobUpsert) {
  1983. s.ClearOutputExpiresAt()
  1984. })
  1985. }
  1986. // SetInputDeletedAt sets the "input_deleted_at" field.
  1987. func (u *BatchImageJobUpsertOne) SetInputDeletedAt(v time.Time) *BatchImageJobUpsertOne {
  1988. return u.Update(func(s *BatchImageJobUpsert) {
  1989. s.SetInputDeletedAt(v)
  1990. })
  1991. }
  1992. // UpdateInputDeletedAt sets the "input_deleted_at" field to the value that was provided on create.
  1993. func (u *BatchImageJobUpsertOne) UpdateInputDeletedAt() *BatchImageJobUpsertOne {
  1994. return u.Update(func(s *BatchImageJobUpsert) {
  1995. s.UpdateInputDeletedAt()
  1996. })
  1997. }
  1998. // ClearInputDeletedAt clears the value of the "input_deleted_at" field.
  1999. func (u *BatchImageJobUpsertOne) ClearInputDeletedAt() *BatchImageJobUpsertOne {
  2000. return u.Update(func(s *BatchImageJobUpsert) {
  2001. s.ClearInputDeletedAt()
  2002. })
  2003. }
  2004. // SetOutputDeletedAt sets the "output_deleted_at" field.
  2005. func (u *BatchImageJobUpsertOne) SetOutputDeletedAt(v time.Time) *BatchImageJobUpsertOne {
  2006. return u.Update(func(s *BatchImageJobUpsert) {
  2007. s.SetOutputDeletedAt(v)
  2008. })
  2009. }
  2010. // UpdateOutputDeletedAt sets the "output_deleted_at" field to the value that was provided on create.
  2011. func (u *BatchImageJobUpsertOne) UpdateOutputDeletedAt() *BatchImageJobUpsertOne {
  2012. return u.Update(func(s *BatchImageJobUpsert) {
  2013. s.UpdateOutputDeletedAt()
  2014. })
  2015. }
  2016. // ClearOutputDeletedAt clears the value of the "output_deleted_at" field.
  2017. func (u *BatchImageJobUpsertOne) ClearOutputDeletedAt() *BatchImageJobUpsertOne {
  2018. return u.Update(func(s *BatchImageJobUpsert) {
  2019. s.ClearOutputDeletedAt()
  2020. })
  2021. }
  2022. // SetDownloadedAt sets the "downloaded_at" field.
  2023. func (u *BatchImageJobUpsertOne) SetDownloadedAt(v time.Time) *BatchImageJobUpsertOne {
  2024. return u.Update(func(s *BatchImageJobUpsert) {
  2025. s.SetDownloadedAt(v)
  2026. })
  2027. }
  2028. // UpdateDownloadedAt sets the "downloaded_at" field to the value that was provided on create.
  2029. func (u *BatchImageJobUpsertOne) UpdateDownloadedAt() *BatchImageJobUpsertOne {
  2030. return u.Update(func(s *BatchImageJobUpsert) {
  2031. s.UpdateDownloadedAt()
  2032. })
  2033. }
  2034. // ClearDownloadedAt clears the value of the "downloaded_at" field.
  2035. func (u *BatchImageJobUpsertOne) ClearDownloadedAt() *BatchImageJobUpsertOne {
  2036. return u.Update(func(s *BatchImageJobUpsert) {
  2037. s.ClearDownloadedAt()
  2038. })
  2039. }
  2040. // SetUserDeletedAt sets the "user_deleted_at" field.
  2041. func (u *BatchImageJobUpsertOne) SetUserDeletedAt(v time.Time) *BatchImageJobUpsertOne {
  2042. return u.Update(func(s *BatchImageJobUpsert) {
  2043. s.SetUserDeletedAt(v)
  2044. })
  2045. }
  2046. // UpdateUserDeletedAt sets the "user_deleted_at" field to the value that was provided on create.
  2047. func (u *BatchImageJobUpsertOne) UpdateUserDeletedAt() *BatchImageJobUpsertOne {
  2048. return u.Update(func(s *BatchImageJobUpsert) {
  2049. s.UpdateUserDeletedAt()
  2050. })
  2051. }
  2052. // ClearUserDeletedAt clears the value of the "user_deleted_at" field.
  2053. func (u *BatchImageJobUpsertOne) ClearUserDeletedAt() *BatchImageJobUpsertOne {
  2054. return u.Update(func(s *BatchImageJobUpsert) {
  2055. s.ClearUserDeletedAt()
  2056. })
  2057. }
  2058. // SetLastErrorCode sets the "last_error_code" field.
  2059. func (u *BatchImageJobUpsertOne) SetLastErrorCode(v string) *BatchImageJobUpsertOne {
  2060. return u.Update(func(s *BatchImageJobUpsert) {
  2061. s.SetLastErrorCode(v)
  2062. })
  2063. }
  2064. // UpdateLastErrorCode sets the "last_error_code" field to the value that was provided on create.
  2065. func (u *BatchImageJobUpsertOne) UpdateLastErrorCode() *BatchImageJobUpsertOne {
  2066. return u.Update(func(s *BatchImageJobUpsert) {
  2067. s.UpdateLastErrorCode()
  2068. })
  2069. }
  2070. // ClearLastErrorCode clears the value of the "last_error_code" field.
  2071. func (u *BatchImageJobUpsertOne) ClearLastErrorCode() *BatchImageJobUpsertOne {
  2072. return u.Update(func(s *BatchImageJobUpsert) {
  2073. s.ClearLastErrorCode()
  2074. })
  2075. }
  2076. // SetLastErrorMessage sets the "last_error_message" field.
  2077. func (u *BatchImageJobUpsertOne) SetLastErrorMessage(v string) *BatchImageJobUpsertOne {
  2078. return u.Update(func(s *BatchImageJobUpsert) {
  2079. s.SetLastErrorMessage(v)
  2080. })
  2081. }
  2082. // UpdateLastErrorMessage sets the "last_error_message" field to the value that was provided on create.
  2083. func (u *BatchImageJobUpsertOne) UpdateLastErrorMessage() *BatchImageJobUpsertOne {
  2084. return u.Update(func(s *BatchImageJobUpsert) {
  2085. s.UpdateLastErrorMessage()
  2086. })
  2087. }
  2088. // ClearLastErrorMessage clears the value of the "last_error_message" field.
  2089. func (u *BatchImageJobUpsertOne) ClearLastErrorMessage() *BatchImageJobUpsertOne {
  2090. return u.Update(func(s *BatchImageJobUpsert) {
  2091. s.ClearLastErrorMessage()
  2092. })
  2093. }
  2094. // SetUpdatedAt sets the "updated_at" field.
  2095. func (u *BatchImageJobUpsertOne) SetUpdatedAt(v time.Time) *BatchImageJobUpsertOne {
  2096. return u.Update(func(s *BatchImageJobUpsert) {
  2097. s.SetUpdatedAt(v)
  2098. })
  2099. }
  2100. // UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
  2101. func (u *BatchImageJobUpsertOne) UpdateUpdatedAt() *BatchImageJobUpsertOne {
  2102. return u.Update(func(s *BatchImageJobUpsert) {
  2103. s.UpdateUpdatedAt()
  2104. })
  2105. }
  2106. // SetSubmittedAt sets the "submitted_at" field.
  2107. func (u *BatchImageJobUpsertOne) SetSubmittedAt(v time.Time) *BatchImageJobUpsertOne {
  2108. return u.Update(func(s *BatchImageJobUpsert) {
  2109. s.SetSubmittedAt(v)
  2110. })
  2111. }
  2112. // UpdateSubmittedAt sets the "submitted_at" field to the value that was provided on create.
  2113. func (u *BatchImageJobUpsertOne) UpdateSubmittedAt() *BatchImageJobUpsertOne {
  2114. return u.Update(func(s *BatchImageJobUpsert) {
  2115. s.UpdateSubmittedAt()
  2116. })
  2117. }
  2118. // ClearSubmittedAt clears the value of the "submitted_at" field.
  2119. func (u *BatchImageJobUpsertOne) ClearSubmittedAt() *BatchImageJobUpsertOne {
  2120. return u.Update(func(s *BatchImageJobUpsert) {
  2121. s.ClearSubmittedAt()
  2122. })
  2123. }
  2124. // SetStartedAt sets the "started_at" field.
  2125. func (u *BatchImageJobUpsertOne) SetStartedAt(v time.Time) *BatchImageJobUpsertOne {
  2126. return u.Update(func(s *BatchImageJobUpsert) {
  2127. s.SetStartedAt(v)
  2128. })
  2129. }
  2130. // UpdateStartedAt sets the "started_at" field to the value that was provided on create.
  2131. func (u *BatchImageJobUpsertOne) UpdateStartedAt() *BatchImageJobUpsertOne {
  2132. return u.Update(func(s *BatchImageJobUpsert) {
  2133. s.UpdateStartedAt()
  2134. })
  2135. }
  2136. // ClearStartedAt clears the value of the "started_at" field.
  2137. func (u *BatchImageJobUpsertOne) ClearStartedAt() *BatchImageJobUpsertOne {
  2138. return u.Update(func(s *BatchImageJobUpsert) {
  2139. s.ClearStartedAt()
  2140. })
  2141. }
  2142. // SetFinishedAt sets the "finished_at" field.
  2143. func (u *BatchImageJobUpsertOne) SetFinishedAt(v time.Time) *BatchImageJobUpsertOne {
  2144. return u.Update(func(s *BatchImageJobUpsert) {
  2145. s.SetFinishedAt(v)
  2146. })
  2147. }
  2148. // UpdateFinishedAt sets the "finished_at" field to the value that was provided on create.
  2149. func (u *BatchImageJobUpsertOne) UpdateFinishedAt() *BatchImageJobUpsertOne {
  2150. return u.Update(func(s *BatchImageJobUpsert) {
  2151. s.UpdateFinishedAt()
  2152. })
  2153. }
  2154. // ClearFinishedAt clears the value of the "finished_at" field.
  2155. func (u *BatchImageJobUpsertOne) ClearFinishedAt() *BatchImageJobUpsertOne {
  2156. return u.Update(func(s *BatchImageJobUpsert) {
  2157. s.ClearFinishedAt()
  2158. })
  2159. }
  2160. // SetSettledAt sets the "settled_at" field.
  2161. func (u *BatchImageJobUpsertOne) SetSettledAt(v time.Time) *BatchImageJobUpsertOne {
  2162. return u.Update(func(s *BatchImageJobUpsert) {
  2163. s.SetSettledAt(v)
  2164. })
  2165. }
  2166. // UpdateSettledAt sets the "settled_at" field to the value that was provided on create.
  2167. func (u *BatchImageJobUpsertOne) UpdateSettledAt() *BatchImageJobUpsertOne {
  2168. return u.Update(func(s *BatchImageJobUpsert) {
  2169. s.UpdateSettledAt()
  2170. })
  2171. }
  2172. // ClearSettledAt clears the value of the "settled_at" field.
  2173. func (u *BatchImageJobUpsertOne) ClearSettledAt() *BatchImageJobUpsertOne {
  2174. return u.Update(func(s *BatchImageJobUpsert) {
  2175. s.ClearSettledAt()
  2176. })
  2177. }
  2178. // Exec executes the query.
  2179. func (u *BatchImageJobUpsertOne) Exec(ctx context.Context) error {
  2180. if len(u.create.conflict) == 0 {
  2181. return errors.New("ent: missing options for BatchImageJobCreate.OnConflict")
  2182. }
  2183. return u.create.Exec(ctx)
  2184. }
  2185. // ExecX is like Exec, but panics if an error occurs.
  2186. func (u *BatchImageJobUpsertOne) ExecX(ctx context.Context) {
  2187. if err := u.create.Exec(ctx); err != nil {
  2188. panic(err)
  2189. }
  2190. }
  2191. // Exec executes the UPSERT query and returns the inserted/updated ID.
  2192. func (u *BatchImageJobUpsertOne) ID(ctx context.Context) (id int64, err error) {
  2193. node, err := u.create.Save(ctx)
  2194. if err != nil {
  2195. return id, err
  2196. }
  2197. return node.ID, nil
  2198. }
  2199. // IDX is like ID, but panics if an error occurs.
  2200. func (u *BatchImageJobUpsertOne) IDX(ctx context.Context) int64 {
  2201. id, err := u.ID(ctx)
  2202. if err != nil {
  2203. panic(err)
  2204. }
  2205. return id
  2206. }
  2207. // BatchImageJobCreateBulk is the builder for creating many BatchImageJob entities in bulk.
  2208. type BatchImageJobCreateBulk struct {
  2209. config
  2210. err error
  2211. builders []*BatchImageJobCreate
  2212. conflict []sql.ConflictOption
  2213. }
  2214. // Save creates the BatchImageJob entities in the database.
  2215. func (_c *BatchImageJobCreateBulk) Save(ctx context.Context) ([]*BatchImageJob, error) {
  2216. if _c.err != nil {
  2217. return nil, _c.err
  2218. }
  2219. specs := make([]*sqlgraph.CreateSpec, len(_c.builders))
  2220. nodes := make([]*BatchImageJob, len(_c.builders))
  2221. mutators := make([]Mutator, len(_c.builders))
  2222. for i := range _c.builders {
  2223. func(i int, root context.Context) {
  2224. builder := _c.builders[i]
  2225. builder.defaults()
  2226. var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
  2227. mutation, ok := m.(*BatchImageJobMutation)
  2228. if !ok {
  2229. return nil, fmt.Errorf("unexpected mutation type %T", m)
  2230. }
  2231. if err := builder.check(); err != nil {
  2232. return nil, err
  2233. }
  2234. builder.mutation = mutation
  2235. var err error
  2236. nodes[i], specs[i] = builder.createSpec()
  2237. if i < len(mutators)-1 {
  2238. _, err = mutators[i+1].Mutate(root, _c.builders[i+1].mutation)
  2239. } else {
  2240. spec := &sqlgraph.BatchCreateSpec{Nodes: specs}
  2241. spec.OnConflict = _c.conflict
  2242. // Invoke the actual operation on the latest mutation in the chain.
  2243. if err = sqlgraph.BatchCreate(ctx, _c.driver, spec); err != nil {
  2244. if sqlgraph.IsConstraintError(err) {
  2245. err = &ConstraintError{msg: err.Error(), wrap: err}
  2246. }
  2247. }
  2248. }
  2249. if err != nil {
  2250. return nil, err
  2251. }
  2252. mutation.id = &nodes[i].ID
  2253. if specs[i].ID.Value != nil {
  2254. id := specs[i].ID.Value.(int64)
  2255. nodes[i].ID = int64(id)
  2256. }
  2257. mutation.done = true
  2258. return nodes[i], nil
  2259. })
  2260. for i := len(builder.hooks) - 1; i >= 0; i-- {
  2261. mut = builder.hooks[i](mut)
  2262. }
  2263. mutators[i] = mut
  2264. }(i, ctx)
  2265. }
  2266. if len(mutators) > 0 {
  2267. if _, err := mutators[0].Mutate(ctx, _c.builders[0].mutation); err != nil {
  2268. return nil, err
  2269. }
  2270. }
  2271. return nodes, nil
  2272. }
  2273. // SaveX is like Save, but panics if an error occurs.
  2274. func (_c *BatchImageJobCreateBulk) SaveX(ctx context.Context) []*BatchImageJob {
  2275. v, err := _c.Save(ctx)
  2276. if err != nil {
  2277. panic(err)
  2278. }
  2279. return v
  2280. }
  2281. // Exec executes the query.
  2282. func (_c *BatchImageJobCreateBulk) Exec(ctx context.Context) error {
  2283. _, err := _c.Save(ctx)
  2284. return err
  2285. }
  2286. // ExecX is like Exec, but panics if an error occurs.
  2287. func (_c *BatchImageJobCreateBulk) ExecX(ctx context.Context) {
  2288. if err := _c.Exec(ctx); err != nil {
  2289. panic(err)
  2290. }
  2291. }
  2292. // OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
  2293. // of the `INSERT` statement. For example:
  2294. //
  2295. // client.BatchImageJob.CreateBulk(builders...).
  2296. // OnConflict(
  2297. // // Update the row with the new values
  2298. // // the was proposed for insertion.
  2299. // sql.ResolveWithNewValues(),
  2300. // ).
  2301. // // Override some of the fields with custom
  2302. // // update values.
  2303. // Update(func(u *ent.BatchImageJobUpsert) {
  2304. // SetBatchID(v+v).
  2305. // }).
  2306. // Exec(ctx)
  2307. func (_c *BatchImageJobCreateBulk) OnConflict(opts ...sql.ConflictOption) *BatchImageJobUpsertBulk {
  2308. _c.conflict = opts
  2309. return &BatchImageJobUpsertBulk{
  2310. create: _c,
  2311. }
  2312. }
  2313. // OnConflictColumns calls `OnConflict` and configures the columns
  2314. // as conflict target. Using this option is equivalent to using:
  2315. //
  2316. // client.BatchImageJob.Create().
  2317. // OnConflict(sql.ConflictColumns(columns...)).
  2318. // Exec(ctx)
  2319. func (_c *BatchImageJobCreateBulk) OnConflictColumns(columns ...string) *BatchImageJobUpsertBulk {
  2320. _c.conflict = append(_c.conflict, sql.ConflictColumns(columns...))
  2321. return &BatchImageJobUpsertBulk{
  2322. create: _c,
  2323. }
  2324. }
  2325. // BatchImageJobUpsertBulk is the builder for "upsert"-ing
  2326. // a bulk of BatchImageJob nodes.
  2327. type BatchImageJobUpsertBulk struct {
  2328. create *BatchImageJobCreateBulk
  2329. }
  2330. // UpdateNewValues updates the mutable fields using the new values that
  2331. // were set on create. Using this option is equivalent to using:
  2332. //
  2333. // client.BatchImageJob.Create().
  2334. // OnConflict(
  2335. // sql.ResolveWithNewValues(),
  2336. // ).
  2337. // Exec(ctx)
  2338. func (u *BatchImageJobUpsertBulk) UpdateNewValues() *BatchImageJobUpsertBulk {
  2339. u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues())
  2340. u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) {
  2341. for _, b := range u.create.builders {
  2342. if _, exists := b.mutation.BatchID(); exists {
  2343. s.SetIgnore(batchimagejob.FieldBatchID)
  2344. }
  2345. if _, exists := b.mutation.CreatedAt(); exists {
  2346. s.SetIgnore(batchimagejob.FieldCreatedAt)
  2347. }
  2348. }
  2349. }))
  2350. return u
  2351. }
  2352. // Ignore sets each column to itself in case of conflict.
  2353. // Using this option is equivalent to using:
  2354. //
  2355. // client.BatchImageJob.Create().
  2356. // OnConflict(sql.ResolveWithIgnore()).
  2357. // Exec(ctx)
  2358. func (u *BatchImageJobUpsertBulk) Ignore() *BatchImageJobUpsertBulk {
  2359. u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore())
  2360. return u
  2361. }
  2362. // DoNothing configures the conflict_action to `DO NOTHING`.
  2363. // Supported only by SQLite and PostgreSQL.
  2364. func (u *BatchImageJobUpsertBulk) DoNothing() *BatchImageJobUpsertBulk {
  2365. u.create.conflict = append(u.create.conflict, sql.DoNothing())
  2366. return u
  2367. }
  2368. // Update allows overriding fields `UPDATE` values. See the BatchImageJobCreateBulk.OnConflict
  2369. // documentation for more info.
  2370. func (u *BatchImageJobUpsertBulk) Update(set func(*BatchImageJobUpsert)) *BatchImageJobUpsertBulk {
  2371. u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
  2372. set(&BatchImageJobUpsert{UpdateSet: update})
  2373. }))
  2374. return u
  2375. }
  2376. // SetUserID sets the "user_id" field.
  2377. func (u *BatchImageJobUpsertBulk) SetUserID(v int64) *BatchImageJobUpsertBulk {
  2378. return u.Update(func(s *BatchImageJobUpsert) {
  2379. s.SetUserID(v)
  2380. })
  2381. }
  2382. // AddUserID adds v to the "user_id" field.
  2383. func (u *BatchImageJobUpsertBulk) AddUserID(v int64) *BatchImageJobUpsertBulk {
  2384. return u.Update(func(s *BatchImageJobUpsert) {
  2385. s.AddUserID(v)
  2386. })
  2387. }
  2388. // UpdateUserID sets the "user_id" field to the value that was provided on create.
  2389. func (u *BatchImageJobUpsertBulk) UpdateUserID() *BatchImageJobUpsertBulk {
  2390. return u.Update(func(s *BatchImageJobUpsert) {
  2391. s.UpdateUserID()
  2392. })
  2393. }
  2394. // SetAPIKeyID sets the "api_key_id" field.
  2395. func (u *BatchImageJobUpsertBulk) SetAPIKeyID(v int64) *BatchImageJobUpsertBulk {
  2396. return u.Update(func(s *BatchImageJobUpsert) {
  2397. s.SetAPIKeyID(v)
  2398. })
  2399. }
  2400. // AddAPIKeyID adds v to the "api_key_id" field.
  2401. func (u *BatchImageJobUpsertBulk) AddAPIKeyID(v int64) *BatchImageJobUpsertBulk {
  2402. return u.Update(func(s *BatchImageJobUpsert) {
  2403. s.AddAPIKeyID(v)
  2404. })
  2405. }
  2406. // UpdateAPIKeyID sets the "api_key_id" field to the value that was provided on create.
  2407. func (u *BatchImageJobUpsertBulk) UpdateAPIKeyID() *BatchImageJobUpsertBulk {
  2408. return u.Update(func(s *BatchImageJobUpsert) {
  2409. s.UpdateAPIKeyID()
  2410. })
  2411. }
  2412. // ClearAPIKeyID clears the value of the "api_key_id" field.
  2413. func (u *BatchImageJobUpsertBulk) ClearAPIKeyID() *BatchImageJobUpsertBulk {
  2414. return u.Update(func(s *BatchImageJobUpsert) {
  2415. s.ClearAPIKeyID()
  2416. })
  2417. }
  2418. // SetAccountID sets the "account_id" field.
  2419. func (u *BatchImageJobUpsertBulk) SetAccountID(v int64) *BatchImageJobUpsertBulk {
  2420. return u.Update(func(s *BatchImageJobUpsert) {
  2421. s.SetAccountID(v)
  2422. })
  2423. }
  2424. // AddAccountID adds v to the "account_id" field.
  2425. func (u *BatchImageJobUpsertBulk) AddAccountID(v int64) *BatchImageJobUpsertBulk {
  2426. return u.Update(func(s *BatchImageJobUpsert) {
  2427. s.AddAccountID(v)
  2428. })
  2429. }
  2430. // UpdateAccountID sets the "account_id" field to the value that was provided on create.
  2431. func (u *BatchImageJobUpsertBulk) UpdateAccountID() *BatchImageJobUpsertBulk {
  2432. return u.Update(func(s *BatchImageJobUpsert) {
  2433. s.UpdateAccountID()
  2434. })
  2435. }
  2436. // ClearAccountID clears the value of the "account_id" field.
  2437. func (u *BatchImageJobUpsertBulk) ClearAccountID() *BatchImageJobUpsertBulk {
  2438. return u.Update(func(s *BatchImageJobUpsert) {
  2439. s.ClearAccountID()
  2440. })
  2441. }
  2442. // SetProvider sets the "provider" field.
  2443. func (u *BatchImageJobUpsertBulk) SetProvider(v string) *BatchImageJobUpsertBulk {
  2444. return u.Update(func(s *BatchImageJobUpsert) {
  2445. s.SetProvider(v)
  2446. })
  2447. }
  2448. // UpdateProvider sets the "provider" field to the value that was provided on create.
  2449. func (u *BatchImageJobUpsertBulk) UpdateProvider() *BatchImageJobUpsertBulk {
  2450. return u.Update(func(s *BatchImageJobUpsert) {
  2451. s.UpdateProvider()
  2452. })
  2453. }
  2454. // SetModel sets the "model" field.
  2455. func (u *BatchImageJobUpsertBulk) SetModel(v string) *BatchImageJobUpsertBulk {
  2456. return u.Update(func(s *BatchImageJobUpsert) {
  2457. s.SetModel(v)
  2458. })
  2459. }
  2460. // UpdateModel sets the "model" field to the value that was provided on create.
  2461. func (u *BatchImageJobUpsertBulk) UpdateModel() *BatchImageJobUpsertBulk {
  2462. return u.Update(func(s *BatchImageJobUpsert) {
  2463. s.UpdateModel()
  2464. })
  2465. }
  2466. // SetTaskName sets the "task_name" field.
  2467. func (u *BatchImageJobUpsertBulk) SetTaskName(v string) *BatchImageJobUpsertBulk {
  2468. return u.Update(func(s *BatchImageJobUpsert) {
  2469. s.SetTaskName(v)
  2470. })
  2471. }
  2472. // UpdateTaskName sets the "task_name" field to the value that was provided on create.
  2473. func (u *BatchImageJobUpsertBulk) UpdateTaskName() *BatchImageJobUpsertBulk {
  2474. return u.Update(func(s *BatchImageJobUpsert) {
  2475. s.UpdateTaskName()
  2476. })
  2477. }
  2478. // SetStatus sets the "status" field.
  2479. func (u *BatchImageJobUpsertBulk) SetStatus(v string) *BatchImageJobUpsertBulk {
  2480. return u.Update(func(s *BatchImageJobUpsert) {
  2481. s.SetStatus(v)
  2482. })
  2483. }
  2484. // UpdateStatus sets the "status" field to the value that was provided on create.
  2485. func (u *BatchImageJobUpsertBulk) UpdateStatus() *BatchImageJobUpsertBulk {
  2486. return u.Update(func(s *BatchImageJobUpsert) {
  2487. s.UpdateStatus()
  2488. })
  2489. }
  2490. // SetProviderJobName sets the "provider_job_name" field.
  2491. func (u *BatchImageJobUpsertBulk) SetProviderJobName(v string) *BatchImageJobUpsertBulk {
  2492. return u.Update(func(s *BatchImageJobUpsert) {
  2493. s.SetProviderJobName(v)
  2494. })
  2495. }
  2496. // UpdateProviderJobName sets the "provider_job_name" field to the value that was provided on create.
  2497. func (u *BatchImageJobUpsertBulk) UpdateProviderJobName() *BatchImageJobUpsertBulk {
  2498. return u.Update(func(s *BatchImageJobUpsert) {
  2499. s.UpdateProviderJobName()
  2500. })
  2501. }
  2502. // ClearProviderJobName clears the value of the "provider_job_name" field.
  2503. func (u *BatchImageJobUpsertBulk) ClearProviderJobName() *BatchImageJobUpsertBulk {
  2504. return u.Update(func(s *BatchImageJobUpsert) {
  2505. s.ClearProviderJobName()
  2506. })
  2507. }
  2508. // SetProviderInputRef sets the "provider_input_ref" field.
  2509. func (u *BatchImageJobUpsertBulk) SetProviderInputRef(v string) *BatchImageJobUpsertBulk {
  2510. return u.Update(func(s *BatchImageJobUpsert) {
  2511. s.SetProviderInputRef(v)
  2512. })
  2513. }
  2514. // UpdateProviderInputRef sets the "provider_input_ref" field to the value that was provided on create.
  2515. func (u *BatchImageJobUpsertBulk) UpdateProviderInputRef() *BatchImageJobUpsertBulk {
  2516. return u.Update(func(s *BatchImageJobUpsert) {
  2517. s.UpdateProviderInputRef()
  2518. })
  2519. }
  2520. // ClearProviderInputRef clears the value of the "provider_input_ref" field.
  2521. func (u *BatchImageJobUpsertBulk) ClearProviderInputRef() *BatchImageJobUpsertBulk {
  2522. return u.Update(func(s *BatchImageJobUpsert) {
  2523. s.ClearProviderInputRef()
  2524. })
  2525. }
  2526. // SetProviderOutputRef sets the "provider_output_ref" field.
  2527. func (u *BatchImageJobUpsertBulk) SetProviderOutputRef(v string) *BatchImageJobUpsertBulk {
  2528. return u.Update(func(s *BatchImageJobUpsert) {
  2529. s.SetProviderOutputRef(v)
  2530. })
  2531. }
  2532. // UpdateProviderOutputRef sets the "provider_output_ref" field to the value that was provided on create.
  2533. func (u *BatchImageJobUpsertBulk) UpdateProviderOutputRef() *BatchImageJobUpsertBulk {
  2534. return u.Update(func(s *BatchImageJobUpsert) {
  2535. s.UpdateProviderOutputRef()
  2536. })
  2537. }
  2538. // ClearProviderOutputRef clears the value of the "provider_output_ref" field.
  2539. func (u *BatchImageJobUpsertBulk) ClearProviderOutputRef() *BatchImageJobUpsertBulk {
  2540. return u.Update(func(s *BatchImageJobUpsert) {
  2541. s.ClearProviderOutputRef()
  2542. })
  2543. }
  2544. // SetGcsInputURI sets the "gcs_input_uri" field.
  2545. func (u *BatchImageJobUpsertBulk) SetGcsInputURI(v string) *BatchImageJobUpsertBulk {
  2546. return u.Update(func(s *BatchImageJobUpsert) {
  2547. s.SetGcsInputURI(v)
  2548. })
  2549. }
  2550. // UpdateGcsInputURI sets the "gcs_input_uri" field to the value that was provided on create.
  2551. func (u *BatchImageJobUpsertBulk) UpdateGcsInputURI() *BatchImageJobUpsertBulk {
  2552. return u.Update(func(s *BatchImageJobUpsert) {
  2553. s.UpdateGcsInputURI()
  2554. })
  2555. }
  2556. // ClearGcsInputURI clears the value of the "gcs_input_uri" field.
  2557. func (u *BatchImageJobUpsertBulk) ClearGcsInputURI() *BatchImageJobUpsertBulk {
  2558. return u.Update(func(s *BatchImageJobUpsert) {
  2559. s.ClearGcsInputURI()
  2560. })
  2561. }
  2562. // SetGcsOutputURI sets the "gcs_output_uri" field.
  2563. func (u *BatchImageJobUpsertBulk) SetGcsOutputURI(v string) *BatchImageJobUpsertBulk {
  2564. return u.Update(func(s *BatchImageJobUpsert) {
  2565. s.SetGcsOutputURI(v)
  2566. })
  2567. }
  2568. // UpdateGcsOutputURI sets the "gcs_output_uri" field to the value that was provided on create.
  2569. func (u *BatchImageJobUpsertBulk) UpdateGcsOutputURI() *BatchImageJobUpsertBulk {
  2570. return u.Update(func(s *BatchImageJobUpsert) {
  2571. s.UpdateGcsOutputURI()
  2572. })
  2573. }
  2574. // ClearGcsOutputURI clears the value of the "gcs_output_uri" field.
  2575. func (u *BatchImageJobUpsertBulk) ClearGcsOutputURI() *BatchImageJobUpsertBulk {
  2576. return u.Update(func(s *BatchImageJobUpsert) {
  2577. s.ClearGcsOutputURI()
  2578. })
  2579. }
  2580. // SetItemCount sets the "item_count" field.
  2581. func (u *BatchImageJobUpsertBulk) SetItemCount(v int) *BatchImageJobUpsertBulk {
  2582. return u.Update(func(s *BatchImageJobUpsert) {
  2583. s.SetItemCount(v)
  2584. })
  2585. }
  2586. // AddItemCount adds v to the "item_count" field.
  2587. func (u *BatchImageJobUpsertBulk) AddItemCount(v int) *BatchImageJobUpsertBulk {
  2588. return u.Update(func(s *BatchImageJobUpsert) {
  2589. s.AddItemCount(v)
  2590. })
  2591. }
  2592. // UpdateItemCount sets the "item_count" field to the value that was provided on create.
  2593. func (u *BatchImageJobUpsertBulk) UpdateItemCount() *BatchImageJobUpsertBulk {
  2594. return u.Update(func(s *BatchImageJobUpsert) {
  2595. s.UpdateItemCount()
  2596. })
  2597. }
  2598. // SetSuccessCount sets the "success_count" field.
  2599. func (u *BatchImageJobUpsertBulk) SetSuccessCount(v int) *BatchImageJobUpsertBulk {
  2600. return u.Update(func(s *BatchImageJobUpsert) {
  2601. s.SetSuccessCount(v)
  2602. })
  2603. }
  2604. // AddSuccessCount adds v to the "success_count" field.
  2605. func (u *BatchImageJobUpsertBulk) AddSuccessCount(v int) *BatchImageJobUpsertBulk {
  2606. return u.Update(func(s *BatchImageJobUpsert) {
  2607. s.AddSuccessCount(v)
  2608. })
  2609. }
  2610. // UpdateSuccessCount sets the "success_count" field to the value that was provided on create.
  2611. func (u *BatchImageJobUpsertBulk) UpdateSuccessCount() *BatchImageJobUpsertBulk {
  2612. return u.Update(func(s *BatchImageJobUpsert) {
  2613. s.UpdateSuccessCount()
  2614. })
  2615. }
  2616. // SetFailCount sets the "fail_count" field.
  2617. func (u *BatchImageJobUpsertBulk) SetFailCount(v int) *BatchImageJobUpsertBulk {
  2618. return u.Update(func(s *BatchImageJobUpsert) {
  2619. s.SetFailCount(v)
  2620. })
  2621. }
  2622. // AddFailCount adds v to the "fail_count" field.
  2623. func (u *BatchImageJobUpsertBulk) AddFailCount(v int) *BatchImageJobUpsertBulk {
  2624. return u.Update(func(s *BatchImageJobUpsert) {
  2625. s.AddFailCount(v)
  2626. })
  2627. }
  2628. // UpdateFailCount sets the "fail_count" field to the value that was provided on create.
  2629. func (u *BatchImageJobUpsertBulk) UpdateFailCount() *BatchImageJobUpsertBulk {
  2630. return u.Update(func(s *BatchImageJobUpsert) {
  2631. s.UpdateFailCount()
  2632. })
  2633. }
  2634. // SetCancelledCount sets the "cancelled_count" field.
  2635. func (u *BatchImageJobUpsertBulk) SetCancelledCount(v int) *BatchImageJobUpsertBulk {
  2636. return u.Update(func(s *BatchImageJobUpsert) {
  2637. s.SetCancelledCount(v)
  2638. })
  2639. }
  2640. // AddCancelledCount adds v to the "cancelled_count" field.
  2641. func (u *BatchImageJobUpsertBulk) AddCancelledCount(v int) *BatchImageJobUpsertBulk {
  2642. return u.Update(func(s *BatchImageJobUpsert) {
  2643. s.AddCancelledCount(v)
  2644. })
  2645. }
  2646. // UpdateCancelledCount sets the "cancelled_count" field to the value that was provided on create.
  2647. func (u *BatchImageJobUpsertBulk) UpdateCancelledCount() *BatchImageJobUpsertBulk {
  2648. return u.Update(func(s *BatchImageJobUpsert) {
  2649. s.UpdateCancelledCount()
  2650. })
  2651. }
  2652. // SetEstimatedCost sets the "estimated_cost" field.
  2653. func (u *BatchImageJobUpsertBulk) SetEstimatedCost(v float64) *BatchImageJobUpsertBulk {
  2654. return u.Update(func(s *BatchImageJobUpsert) {
  2655. s.SetEstimatedCost(v)
  2656. })
  2657. }
  2658. // AddEstimatedCost adds v to the "estimated_cost" field.
  2659. func (u *BatchImageJobUpsertBulk) AddEstimatedCost(v float64) *BatchImageJobUpsertBulk {
  2660. return u.Update(func(s *BatchImageJobUpsert) {
  2661. s.AddEstimatedCost(v)
  2662. })
  2663. }
  2664. // UpdateEstimatedCost sets the "estimated_cost" field to the value that was provided on create.
  2665. func (u *BatchImageJobUpsertBulk) UpdateEstimatedCost() *BatchImageJobUpsertBulk {
  2666. return u.Update(func(s *BatchImageJobUpsert) {
  2667. s.UpdateEstimatedCost()
  2668. })
  2669. }
  2670. // SetHoldAmount sets the "hold_amount" field.
  2671. func (u *BatchImageJobUpsertBulk) SetHoldAmount(v float64) *BatchImageJobUpsertBulk {
  2672. return u.Update(func(s *BatchImageJobUpsert) {
  2673. s.SetHoldAmount(v)
  2674. })
  2675. }
  2676. // AddHoldAmount adds v to the "hold_amount" field.
  2677. func (u *BatchImageJobUpsertBulk) AddHoldAmount(v float64) *BatchImageJobUpsertBulk {
  2678. return u.Update(func(s *BatchImageJobUpsert) {
  2679. s.AddHoldAmount(v)
  2680. })
  2681. }
  2682. // UpdateHoldAmount sets the "hold_amount" field to the value that was provided on create.
  2683. func (u *BatchImageJobUpsertBulk) UpdateHoldAmount() *BatchImageJobUpsertBulk {
  2684. return u.Update(func(s *BatchImageJobUpsert) {
  2685. s.UpdateHoldAmount()
  2686. })
  2687. }
  2688. // ClearHoldAmount clears the value of the "hold_amount" field.
  2689. func (u *BatchImageJobUpsertBulk) ClearHoldAmount() *BatchImageJobUpsertBulk {
  2690. return u.Update(func(s *BatchImageJobUpsert) {
  2691. s.ClearHoldAmount()
  2692. })
  2693. }
  2694. // SetActualCost sets the "actual_cost" field.
  2695. func (u *BatchImageJobUpsertBulk) SetActualCost(v float64) *BatchImageJobUpsertBulk {
  2696. return u.Update(func(s *BatchImageJobUpsert) {
  2697. s.SetActualCost(v)
  2698. })
  2699. }
  2700. // AddActualCost adds v to the "actual_cost" field.
  2701. func (u *BatchImageJobUpsertBulk) AddActualCost(v float64) *BatchImageJobUpsertBulk {
  2702. return u.Update(func(s *BatchImageJobUpsert) {
  2703. s.AddActualCost(v)
  2704. })
  2705. }
  2706. // UpdateActualCost sets the "actual_cost" field to the value that was provided on create.
  2707. func (u *BatchImageJobUpsertBulk) UpdateActualCost() *BatchImageJobUpsertBulk {
  2708. return u.Update(func(s *BatchImageJobUpsert) {
  2709. s.UpdateActualCost()
  2710. })
  2711. }
  2712. // ClearActualCost clears the value of the "actual_cost" field.
  2713. func (u *BatchImageJobUpsertBulk) ClearActualCost() *BatchImageJobUpsertBulk {
  2714. return u.Update(func(s *BatchImageJobUpsert) {
  2715. s.ClearActualCost()
  2716. })
  2717. }
  2718. // SetCurrency sets the "currency" field.
  2719. func (u *BatchImageJobUpsertBulk) SetCurrency(v string) *BatchImageJobUpsertBulk {
  2720. return u.Update(func(s *BatchImageJobUpsert) {
  2721. s.SetCurrency(v)
  2722. })
  2723. }
  2724. // UpdateCurrency sets the "currency" field to the value that was provided on create.
  2725. func (u *BatchImageJobUpsertBulk) UpdateCurrency() *BatchImageJobUpsertBulk {
  2726. return u.Update(func(s *BatchImageJobUpsert) {
  2727. s.UpdateCurrency()
  2728. })
  2729. }
  2730. // SetHoldID sets the "hold_id" field.
  2731. func (u *BatchImageJobUpsertBulk) SetHoldID(v string) *BatchImageJobUpsertBulk {
  2732. return u.Update(func(s *BatchImageJobUpsert) {
  2733. s.SetHoldID(v)
  2734. })
  2735. }
  2736. // UpdateHoldID sets the "hold_id" field to the value that was provided on create.
  2737. func (u *BatchImageJobUpsertBulk) UpdateHoldID() *BatchImageJobUpsertBulk {
  2738. return u.Update(func(s *BatchImageJobUpsert) {
  2739. s.UpdateHoldID()
  2740. })
  2741. }
  2742. // ClearHoldID clears the value of the "hold_id" field.
  2743. func (u *BatchImageJobUpsertBulk) ClearHoldID() *BatchImageJobUpsertBulk {
  2744. return u.Update(func(s *BatchImageJobUpsert) {
  2745. s.ClearHoldID()
  2746. })
  2747. }
  2748. // SetIdempotencyKey sets the "idempotency_key" field.
  2749. func (u *BatchImageJobUpsertBulk) SetIdempotencyKey(v string) *BatchImageJobUpsertBulk {
  2750. return u.Update(func(s *BatchImageJobUpsert) {
  2751. s.SetIdempotencyKey(v)
  2752. })
  2753. }
  2754. // UpdateIdempotencyKey sets the "idempotency_key" field to the value that was provided on create.
  2755. func (u *BatchImageJobUpsertBulk) UpdateIdempotencyKey() *BatchImageJobUpsertBulk {
  2756. return u.Update(func(s *BatchImageJobUpsert) {
  2757. s.UpdateIdempotencyKey()
  2758. })
  2759. }
  2760. // ClearIdempotencyKey clears the value of the "idempotency_key" field.
  2761. func (u *BatchImageJobUpsertBulk) ClearIdempotencyKey() *BatchImageJobUpsertBulk {
  2762. return u.Update(func(s *BatchImageJobUpsert) {
  2763. s.ClearIdempotencyKey()
  2764. })
  2765. }
  2766. // SetRequestHash sets the "request_hash" field.
  2767. func (u *BatchImageJobUpsertBulk) SetRequestHash(v string) *BatchImageJobUpsertBulk {
  2768. return u.Update(func(s *BatchImageJobUpsert) {
  2769. s.SetRequestHash(v)
  2770. })
  2771. }
  2772. // UpdateRequestHash sets the "request_hash" field to the value that was provided on create.
  2773. func (u *BatchImageJobUpsertBulk) UpdateRequestHash() *BatchImageJobUpsertBulk {
  2774. return u.Update(func(s *BatchImageJobUpsert) {
  2775. s.UpdateRequestHash()
  2776. })
  2777. }
  2778. // ClearRequestHash clears the value of the "request_hash" field.
  2779. func (u *BatchImageJobUpsertBulk) ClearRequestHash() *BatchImageJobUpsertBulk {
  2780. return u.Update(func(s *BatchImageJobUpsert) {
  2781. s.ClearRequestHash()
  2782. })
  2783. }
  2784. // SetManifestHash sets the "manifest_hash" field.
  2785. func (u *BatchImageJobUpsertBulk) SetManifestHash(v string) *BatchImageJobUpsertBulk {
  2786. return u.Update(func(s *BatchImageJobUpsert) {
  2787. s.SetManifestHash(v)
  2788. })
  2789. }
  2790. // UpdateManifestHash sets the "manifest_hash" field to the value that was provided on create.
  2791. func (u *BatchImageJobUpsertBulk) UpdateManifestHash() *BatchImageJobUpsertBulk {
  2792. return u.Update(func(s *BatchImageJobUpsert) {
  2793. s.UpdateManifestHash()
  2794. })
  2795. }
  2796. // ClearManifestHash clears the value of the "manifest_hash" field.
  2797. func (u *BatchImageJobUpsertBulk) ClearManifestHash() *BatchImageJobUpsertBulk {
  2798. return u.Update(func(s *BatchImageJobUpsert) {
  2799. s.ClearManifestHash()
  2800. })
  2801. }
  2802. // SetRetryCount sets the "retry_count" field.
  2803. func (u *BatchImageJobUpsertBulk) SetRetryCount(v int) *BatchImageJobUpsertBulk {
  2804. return u.Update(func(s *BatchImageJobUpsert) {
  2805. s.SetRetryCount(v)
  2806. })
  2807. }
  2808. // AddRetryCount adds v to the "retry_count" field.
  2809. func (u *BatchImageJobUpsertBulk) AddRetryCount(v int) *BatchImageJobUpsertBulk {
  2810. return u.Update(func(s *BatchImageJobUpsert) {
  2811. s.AddRetryCount(v)
  2812. })
  2813. }
  2814. // UpdateRetryCount sets the "retry_count" field to the value that was provided on create.
  2815. func (u *BatchImageJobUpsertBulk) UpdateRetryCount() *BatchImageJobUpsertBulk {
  2816. return u.Update(func(s *BatchImageJobUpsert) {
  2817. s.UpdateRetryCount()
  2818. })
  2819. }
  2820. // SetVersion sets the "version" field.
  2821. func (u *BatchImageJobUpsertBulk) SetVersion(v int) *BatchImageJobUpsertBulk {
  2822. return u.Update(func(s *BatchImageJobUpsert) {
  2823. s.SetVersion(v)
  2824. })
  2825. }
  2826. // AddVersion adds v to the "version" field.
  2827. func (u *BatchImageJobUpsertBulk) AddVersion(v int) *BatchImageJobUpsertBulk {
  2828. return u.Update(func(s *BatchImageJobUpsert) {
  2829. s.AddVersion(v)
  2830. })
  2831. }
  2832. // UpdateVersion sets the "version" field to the value that was provided on create.
  2833. func (u *BatchImageJobUpsertBulk) UpdateVersion() *BatchImageJobUpsertBulk {
  2834. return u.Update(func(s *BatchImageJobUpsert) {
  2835. s.UpdateVersion()
  2836. })
  2837. }
  2838. // SetOutputExpiresAt sets the "output_expires_at" field.
  2839. func (u *BatchImageJobUpsertBulk) SetOutputExpiresAt(v time.Time) *BatchImageJobUpsertBulk {
  2840. return u.Update(func(s *BatchImageJobUpsert) {
  2841. s.SetOutputExpiresAt(v)
  2842. })
  2843. }
  2844. // UpdateOutputExpiresAt sets the "output_expires_at" field to the value that was provided on create.
  2845. func (u *BatchImageJobUpsertBulk) UpdateOutputExpiresAt() *BatchImageJobUpsertBulk {
  2846. return u.Update(func(s *BatchImageJobUpsert) {
  2847. s.UpdateOutputExpiresAt()
  2848. })
  2849. }
  2850. // ClearOutputExpiresAt clears the value of the "output_expires_at" field.
  2851. func (u *BatchImageJobUpsertBulk) ClearOutputExpiresAt() *BatchImageJobUpsertBulk {
  2852. return u.Update(func(s *BatchImageJobUpsert) {
  2853. s.ClearOutputExpiresAt()
  2854. })
  2855. }
  2856. // SetInputDeletedAt sets the "input_deleted_at" field.
  2857. func (u *BatchImageJobUpsertBulk) SetInputDeletedAt(v time.Time) *BatchImageJobUpsertBulk {
  2858. return u.Update(func(s *BatchImageJobUpsert) {
  2859. s.SetInputDeletedAt(v)
  2860. })
  2861. }
  2862. // UpdateInputDeletedAt sets the "input_deleted_at" field to the value that was provided on create.
  2863. func (u *BatchImageJobUpsertBulk) UpdateInputDeletedAt() *BatchImageJobUpsertBulk {
  2864. return u.Update(func(s *BatchImageJobUpsert) {
  2865. s.UpdateInputDeletedAt()
  2866. })
  2867. }
  2868. // ClearInputDeletedAt clears the value of the "input_deleted_at" field.
  2869. func (u *BatchImageJobUpsertBulk) ClearInputDeletedAt() *BatchImageJobUpsertBulk {
  2870. return u.Update(func(s *BatchImageJobUpsert) {
  2871. s.ClearInputDeletedAt()
  2872. })
  2873. }
  2874. // SetOutputDeletedAt sets the "output_deleted_at" field.
  2875. func (u *BatchImageJobUpsertBulk) SetOutputDeletedAt(v time.Time) *BatchImageJobUpsertBulk {
  2876. return u.Update(func(s *BatchImageJobUpsert) {
  2877. s.SetOutputDeletedAt(v)
  2878. })
  2879. }
  2880. // UpdateOutputDeletedAt sets the "output_deleted_at" field to the value that was provided on create.
  2881. func (u *BatchImageJobUpsertBulk) UpdateOutputDeletedAt() *BatchImageJobUpsertBulk {
  2882. return u.Update(func(s *BatchImageJobUpsert) {
  2883. s.UpdateOutputDeletedAt()
  2884. })
  2885. }
  2886. // ClearOutputDeletedAt clears the value of the "output_deleted_at" field.
  2887. func (u *BatchImageJobUpsertBulk) ClearOutputDeletedAt() *BatchImageJobUpsertBulk {
  2888. return u.Update(func(s *BatchImageJobUpsert) {
  2889. s.ClearOutputDeletedAt()
  2890. })
  2891. }
  2892. // SetDownloadedAt sets the "downloaded_at" field.
  2893. func (u *BatchImageJobUpsertBulk) SetDownloadedAt(v time.Time) *BatchImageJobUpsertBulk {
  2894. return u.Update(func(s *BatchImageJobUpsert) {
  2895. s.SetDownloadedAt(v)
  2896. })
  2897. }
  2898. // UpdateDownloadedAt sets the "downloaded_at" field to the value that was provided on create.
  2899. func (u *BatchImageJobUpsertBulk) UpdateDownloadedAt() *BatchImageJobUpsertBulk {
  2900. return u.Update(func(s *BatchImageJobUpsert) {
  2901. s.UpdateDownloadedAt()
  2902. })
  2903. }
  2904. // ClearDownloadedAt clears the value of the "downloaded_at" field.
  2905. func (u *BatchImageJobUpsertBulk) ClearDownloadedAt() *BatchImageJobUpsertBulk {
  2906. return u.Update(func(s *BatchImageJobUpsert) {
  2907. s.ClearDownloadedAt()
  2908. })
  2909. }
  2910. // SetUserDeletedAt sets the "user_deleted_at" field.
  2911. func (u *BatchImageJobUpsertBulk) SetUserDeletedAt(v time.Time) *BatchImageJobUpsertBulk {
  2912. return u.Update(func(s *BatchImageJobUpsert) {
  2913. s.SetUserDeletedAt(v)
  2914. })
  2915. }
  2916. // UpdateUserDeletedAt sets the "user_deleted_at" field to the value that was provided on create.
  2917. func (u *BatchImageJobUpsertBulk) UpdateUserDeletedAt() *BatchImageJobUpsertBulk {
  2918. return u.Update(func(s *BatchImageJobUpsert) {
  2919. s.UpdateUserDeletedAt()
  2920. })
  2921. }
  2922. // ClearUserDeletedAt clears the value of the "user_deleted_at" field.
  2923. func (u *BatchImageJobUpsertBulk) ClearUserDeletedAt() *BatchImageJobUpsertBulk {
  2924. return u.Update(func(s *BatchImageJobUpsert) {
  2925. s.ClearUserDeletedAt()
  2926. })
  2927. }
  2928. // SetLastErrorCode sets the "last_error_code" field.
  2929. func (u *BatchImageJobUpsertBulk) SetLastErrorCode(v string) *BatchImageJobUpsertBulk {
  2930. return u.Update(func(s *BatchImageJobUpsert) {
  2931. s.SetLastErrorCode(v)
  2932. })
  2933. }
  2934. // UpdateLastErrorCode sets the "last_error_code" field to the value that was provided on create.
  2935. func (u *BatchImageJobUpsertBulk) UpdateLastErrorCode() *BatchImageJobUpsertBulk {
  2936. return u.Update(func(s *BatchImageJobUpsert) {
  2937. s.UpdateLastErrorCode()
  2938. })
  2939. }
  2940. // ClearLastErrorCode clears the value of the "last_error_code" field.
  2941. func (u *BatchImageJobUpsertBulk) ClearLastErrorCode() *BatchImageJobUpsertBulk {
  2942. return u.Update(func(s *BatchImageJobUpsert) {
  2943. s.ClearLastErrorCode()
  2944. })
  2945. }
  2946. // SetLastErrorMessage sets the "last_error_message" field.
  2947. func (u *BatchImageJobUpsertBulk) SetLastErrorMessage(v string) *BatchImageJobUpsertBulk {
  2948. return u.Update(func(s *BatchImageJobUpsert) {
  2949. s.SetLastErrorMessage(v)
  2950. })
  2951. }
  2952. // UpdateLastErrorMessage sets the "last_error_message" field to the value that was provided on create.
  2953. func (u *BatchImageJobUpsertBulk) UpdateLastErrorMessage() *BatchImageJobUpsertBulk {
  2954. return u.Update(func(s *BatchImageJobUpsert) {
  2955. s.UpdateLastErrorMessage()
  2956. })
  2957. }
  2958. // ClearLastErrorMessage clears the value of the "last_error_message" field.
  2959. func (u *BatchImageJobUpsertBulk) ClearLastErrorMessage() *BatchImageJobUpsertBulk {
  2960. return u.Update(func(s *BatchImageJobUpsert) {
  2961. s.ClearLastErrorMessage()
  2962. })
  2963. }
  2964. // SetUpdatedAt sets the "updated_at" field.
  2965. func (u *BatchImageJobUpsertBulk) SetUpdatedAt(v time.Time) *BatchImageJobUpsertBulk {
  2966. return u.Update(func(s *BatchImageJobUpsert) {
  2967. s.SetUpdatedAt(v)
  2968. })
  2969. }
  2970. // UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
  2971. func (u *BatchImageJobUpsertBulk) UpdateUpdatedAt() *BatchImageJobUpsertBulk {
  2972. return u.Update(func(s *BatchImageJobUpsert) {
  2973. s.UpdateUpdatedAt()
  2974. })
  2975. }
  2976. // SetSubmittedAt sets the "submitted_at" field.
  2977. func (u *BatchImageJobUpsertBulk) SetSubmittedAt(v time.Time) *BatchImageJobUpsertBulk {
  2978. return u.Update(func(s *BatchImageJobUpsert) {
  2979. s.SetSubmittedAt(v)
  2980. })
  2981. }
  2982. // UpdateSubmittedAt sets the "submitted_at" field to the value that was provided on create.
  2983. func (u *BatchImageJobUpsertBulk) UpdateSubmittedAt() *BatchImageJobUpsertBulk {
  2984. return u.Update(func(s *BatchImageJobUpsert) {
  2985. s.UpdateSubmittedAt()
  2986. })
  2987. }
  2988. // ClearSubmittedAt clears the value of the "submitted_at" field.
  2989. func (u *BatchImageJobUpsertBulk) ClearSubmittedAt() *BatchImageJobUpsertBulk {
  2990. return u.Update(func(s *BatchImageJobUpsert) {
  2991. s.ClearSubmittedAt()
  2992. })
  2993. }
  2994. // SetStartedAt sets the "started_at" field.
  2995. func (u *BatchImageJobUpsertBulk) SetStartedAt(v time.Time) *BatchImageJobUpsertBulk {
  2996. return u.Update(func(s *BatchImageJobUpsert) {
  2997. s.SetStartedAt(v)
  2998. })
  2999. }
  3000. // UpdateStartedAt sets the "started_at" field to the value that was provided on create.
  3001. func (u *BatchImageJobUpsertBulk) UpdateStartedAt() *BatchImageJobUpsertBulk {
  3002. return u.Update(func(s *BatchImageJobUpsert) {
  3003. s.UpdateStartedAt()
  3004. })
  3005. }
  3006. // ClearStartedAt clears the value of the "started_at" field.
  3007. func (u *BatchImageJobUpsertBulk) ClearStartedAt() *BatchImageJobUpsertBulk {
  3008. return u.Update(func(s *BatchImageJobUpsert) {
  3009. s.ClearStartedAt()
  3010. })
  3011. }
  3012. // SetFinishedAt sets the "finished_at" field.
  3013. func (u *BatchImageJobUpsertBulk) SetFinishedAt(v time.Time) *BatchImageJobUpsertBulk {
  3014. return u.Update(func(s *BatchImageJobUpsert) {
  3015. s.SetFinishedAt(v)
  3016. })
  3017. }
  3018. // UpdateFinishedAt sets the "finished_at" field to the value that was provided on create.
  3019. func (u *BatchImageJobUpsertBulk) UpdateFinishedAt() *BatchImageJobUpsertBulk {
  3020. return u.Update(func(s *BatchImageJobUpsert) {
  3021. s.UpdateFinishedAt()
  3022. })
  3023. }
  3024. // ClearFinishedAt clears the value of the "finished_at" field.
  3025. func (u *BatchImageJobUpsertBulk) ClearFinishedAt() *BatchImageJobUpsertBulk {
  3026. return u.Update(func(s *BatchImageJobUpsert) {
  3027. s.ClearFinishedAt()
  3028. })
  3029. }
  3030. // SetSettledAt sets the "settled_at" field.
  3031. func (u *BatchImageJobUpsertBulk) SetSettledAt(v time.Time) *BatchImageJobUpsertBulk {
  3032. return u.Update(func(s *BatchImageJobUpsert) {
  3033. s.SetSettledAt(v)
  3034. })
  3035. }
  3036. // UpdateSettledAt sets the "settled_at" field to the value that was provided on create.
  3037. func (u *BatchImageJobUpsertBulk) UpdateSettledAt() *BatchImageJobUpsertBulk {
  3038. return u.Update(func(s *BatchImageJobUpsert) {
  3039. s.UpdateSettledAt()
  3040. })
  3041. }
  3042. // ClearSettledAt clears the value of the "settled_at" field.
  3043. func (u *BatchImageJobUpsertBulk) ClearSettledAt() *BatchImageJobUpsertBulk {
  3044. return u.Update(func(s *BatchImageJobUpsert) {
  3045. s.ClearSettledAt()
  3046. })
  3047. }
  3048. // Exec executes the query.
  3049. func (u *BatchImageJobUpsertBulk) Exec(ctx context.Context) error {
  3050. if u.create.err != nil {
  3051. return u.create.err
  3052. }
  3053. for i, b := range u.create.builders {
  3054. if len(b.conflict) != 0 {
  3055. return fmt.Errorf("ent: OnConflict was set for builder %d. Set it on the BatchImageJobCreateBulk instead", i)
  3056. }
  3057. }
  3058. if len(u.create.conflict) == 0 {
  3059. return errors.New("ent: missing options for BatchImageJobCreateBulk.OnConflict")
  3060. }
  3061. return u.create.Exec(ctx)
  3062. }
  3063. // ExecX is like Exec, but panics if an error occurs.
  3064. func (u *BatchImageJobUpsertBulk) ExecX(ctx context.Context) {
  3065. if err := u.create.Exec(ctx); err != nil {
  3066. panic(err)
  3067. }
  3068. }