agent_update.go 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  1. // Code generated by ent, DO NOT EDIT.
  2. package ent
  3. import (
  4. "context"
  5. "errors"
  6. "fmt"
  7. "time"
  8. "wechat-api/ent/agent"
  9. "wechat-api/ent/predicate"
  10. "entgo.io/ent/dialect/sql"
  11. "entgo.io/ent/dialect/sql/sqlgraph"
  12. "entgo.io/ent/schema/field"
  13. )
  14. // AgentUpdate is the builder for updating Agent entities.
  15. type AgentUpdate struct {
  16. config
  17. hooks []Hook
  18. mutation *AgentMutation
  19. }
  20. // Where appends a list predicates to the AgentUpdate builder.
  21. func (au *AgentUpdate) Where(ps ...predicate.Agent) *AgentUpdate {
  22. au.mutation.Where(ps...)
  23. return au
  24. }
  25. // SetUpdatedAt sets the "updated_at" field.
  26. func (au *AgentUpdate) SetUpdatedAt(t time.Time) *AgentUpdate {
  27. au.mutation.SetUpdatedAt(t)
  28. return au
  29. }
  30. // SetDeletedAt sets the "deleted_at" field.
  31. func (au *AgentUpdate) SetDeletedAt(t time.Time) *AgentUpdate {
  32. au.mutation.SetDeletedAt(t)
  33. return au
  34. }
  35. // SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
  36. func (au *AgentUpdate) SetNillableDeletedAt(t *time.Time) *AgentUpdate {
  37. if t != nil {
  38. au.SetDeletedAt(*t)
  39. }
  40. return au
  41. }
  42. // ClearDeletedAt clears the value of the "deleted_at" field.
  43. func (au *AgentUpdate) ClearDeletedAt() *AgentUpdate {
  44. au.mutation.ClearDeletedAt()
  45. return au
  46. }
  47. // SetName sets the "name" field.
  48. func (au *AgentUpdate) SetName(s string) *AgentUpdate {
  49. au.mutation.SetName(s)
  50. return au
  51. }
  52. // SetNillableName sets the "name" field if the given value is not nil.
  53. func (au *AgentUpdate) SetNillableName(s *string) *AgentUpdate {
  54. if s != nil {
  55. au.SetName(*s)
  56. }
  57. return au
  58. }
  59. // SetRole sets the "role" field.
  60. func (au *AgentUpdate) SetRole(s string) *AgentUpdate {
  61. au.mutation.SetRole(s)
  62. return au
  63. }
  64. // SetNillableRole sets the "role" field if the given value is not nil.
  65. func (au *AgentUpdate) SetNillableRole(s *string) *AgentUpdate {
  66. if s != nil {
  67. au.SetRole(*s)
  68. }
  69. return au
  70. }
  71. // SetStatus sets the "status" field.
  72. func (au *AgentUpdate) SetStatus(i int) *AgentUpdate {
  73. au.mutation.ResetStatus()
  74. au.mutation.SetStatus(i)
  75. return au
  76. }
  77. // SetNillableStatus sets the "status" field if the given value is not nil.
  78. func (au *AgentUpdate) SetNillableStatus(i *int) *AgentUpdate {
  79. if i != nil {
  80. au.SetStatus(*i)
  81. }
  82. return au
  83. }
  84. // AddStatus adds i to the "status" field.
  85. func (au *AgentUpdate) AddStatus(i int) *AgentUpdate {
  86. au.mutation.AddStatus(i)
  87. return au
  88. }
  89. // ClearStatus clears the value of the "status" field.
  90. func (au *AgentUpdate) ClearStatus() *AgentUpdate {
  91. au.mutation.ClearStatus()
  92. return au
  93. }
  94. // SetBackground sets the "background" field.
  95. func (au *AgentUpdate) SetBackground(s string) *AgentUpdate {
  96. au.mutation.SetBackground(s)
  97. return au
  98. }
  99. // SetNillableBackground sets the "background" field if the given value is not nil.
  100. func (au *AgentUpdate) SetNillableBackground(s *string) *AgentUpdate {
  101. if s != nil {
  102. au.SetBackground(*s)
  103. }
  104. return au
  105. }
  106. // SetExamples sets the "examples" field.
  107. func (au *AgentUpdate) SetExamples(s string) *AgentUpdate {
  108. au.mutation.SetExamples(s)
  109. return au
  110. }
  111. // SetNillableExamples sets the "examples" field if the given value is not nil.
  112. func (au *AgentUpdate) SetNillableExamples(s *string) *AgentUpdate {
  113. if s != nil {
  114. au.SetExamples(*s)
  115. }
  116. return au
  117. }
  118. // SetOrganizationID sets the "organization_id" field.
  119. func (au *AgentUpdate) SetOrganizationID(u uint64) *AgentUpdate {
  120. au.mutation.ResetOrganizationID()
  121. au.mutation.SetOrganizationID(u)
  122. return au
  123. }
  124. // SetNillableOrganizationID sets the "organization_id" field if the given value is not nil.
  125. func (au *AgentUpdate) SetNillableOrganizationID(u *uint64) *AgentUpdate {
  126. if u != nil {
  127. au.SetOrganizationID(*u)
  128. }
  129. return au
  130. }
  131. // AddOrganizationID adds u to the "organization_id" field.
  132. func (au *AgentUpdate) AddOrganizationID(u int64) *AgentUpdate {
  133. au.mutation.AddOrganizationID(u)
  134. return au
  135. }
  136. // Mutation returns the AgentMutation object of the builder.
  137. func (au *AgentUpdate) Mutation() *AgentMutation {
  138. return au.mutation
  139. }
  140. // Save executes the query and returns the number of nodes affected by the update operation.
  141. func (au *AgentUpdate) Save(ctx context.Context) (int, error) {
  142. if err := au.defaults(); err != nil {
  143. return 0, err
  144. }
  145. return withHooks(ctx, au.sqlSave, au.mutation, au.hooks)
  146. }
  147. // SaveX is like Save, but panics if an error occurs.
  148. func (au *AgentUpdate) SaveX(ctx context.Context) int {
  149. affected, err := au.Save(ctx)
  150. if err != nil {
  151. panic(err)
  152. }
  153. return affected
  154. }
  155. // Exec executes the query.
  156. func (au *AgentUpdate) Exec(ctx context.Context) error {
  157. _, err := au.Save(ctx)
  158. return err
  159. }
  160. // ExecX is like Exec, but panics if an error occurs.
  161. func (au *AgentUpdate) ExecX(ctx context.Context) {
  162. if err := au.Exec(ctx); err != nil {
  163. panic(err)
  164. }
  165. }
  166. // defaults sets the default values of the builder before save.
  167. func (au *AgentUpdate) defaults() error {
  168. if _, ok := au.mutation.UpdatedAt(); !ok {
  169. if agent.UpdateDefaultUpdatedAt == nil {
  170. return fmt.Errorf("ent: uninitialized agent.UpdateDefaultUpdatedAt (forgotten import ent/runtime?)")
  171. }
  172. v := agent.UpdateDefaultUpdatedAt()
  173. au.mutation.SetUpdatedAt(v)
  174. }
  175. return nil
  176. }
  177. // check runs all checks and user-defined validators on the builder.
  178. func (au *AgentUpdate) check() error {
  179. if v, ok := au.mutation.Name(); ok {
  180. if err := agent.NameValidator(v); err != nil {
  181. return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "Agent.name": %w`, err)}
  182. }
  183. }
  184. if v, ok := au.mutation.Role(); ok {
  185. if err := agent.RoleValidator(v); err != nil {
  186. return &ValidationError{Name: "role", err: fmt.Errorf(`ent: validator failed for field "Agent.role": %w`, err)}
  187. }
  188. }
  189. if v, ok := au.mutation.Background(); ok {
  190. if err := agent.BackgroundValidator(v); err != nil {
  191. return &ValidationError{Name: "background", err: fmt.Errorf(`ent: validator failed for field "Agent.background": %w`, err)}
  192. }
  193. }
  194. if v, ok := au.mutation.Examples(); ok {
  195. if err := agent.ExamplesValidator(v); err != nil {
  196. return &ValidationError{Name: "examples", err: fmt.Errorf(`ent: validator failed for field "Agent.examples": %w`, err)}
  197. }
  198. }
  199. return nil
  200. }
  201. func (au *AgentUpdate) sqlSave(ctx context.Context) (n int, err error) {
  202. if err := au.check(); err != nil {
  203. return n, err
  204. }
  205. _spec := sqlgraph.NewUpdateSpec(agent.Table, agent.Columns, sqlgraph.NewFieldSpec(agent.FieldID, field.TypeUint64))
  206. if ps := au.mutation.predicates; len(ps) > 0 {
  207. _spec.Predicate = func(selector *sql.Selector) {
  208. for i := range ps {
  209. ps[i](selector)
  210. }
  211. }
  212. }
  213. if value, ok := au.mutation.UpdatedAt(); ok {
  214. _spec.SetField(agent.FieldUpdatedAt, field.TypeTime, value)
  215. }
  216. if value, ok := au.mutation.DeletedAt(); ok {
  217. _spec.SetField(agent.FieldDeletedAt, field.TypeTime, value)
  218. }
  219. if au.mutation.DeletedAtCleared() {
  220. _spec.ClearField(agent.FieldDeletedAt, field.TypeTime)
  221. }
  222. if value, ok := au.mutation.Name(); ok {
  223. _spec.SetField(agent.FieldName, field.TypeString, value)
  224. }
  225. if value, ok := au.mutation.Role(); ok {
  226. _spec.SetField(agent.FieldRole, field.TypeString, value)
  227. }
  228. if value, ok := au.mutation.Status(); ok {
  229. _spec.SetField(agent.FieldStatus, field.TypeInt, value)
  230. }
  231. if value, ok := au.mutation.AddedStatus(); ok {
  232. _spec.AddField(agent.FieldStatus, field.TypeInt, value)
  233. }
  234. if au.mutation.StatusCleared() {
  235. _spec.ClearField(agent.FieldStatus, field.TypeInt)
  236. }
  237. if value, ok := au.mutation.Background(); ok {
  238. _spec.SetField(agent.FieldBackground, field.TypeString, value)
  239. }
  240. if value, ok := au.mutation.Examples(); ok {
  241. _spec.SetField(agent.FieldExamples, field.TypeString, value)
  242. }
  243. if value, ok := au.mutation.OrganizationID(); ok {
  244. _spec.SetField(agent.FieldOrganizationID, field.TypeUint64, value)
  245. }
  246. if value, ok := au.mutation.AddedOrganizationID(); ok {
  247. _spec.AddField(agent.FieldOrganizationID, field.TypeUint64, value)
  248. }
  249. if n, err = sqlgraph.UpdateNodes(ctx, au.driver, _spec); err != nil {
  250. if _, ok := err.(*sqlgraph.NotFoundError); ok {
  251. err = &NotFoundError{agent.Label}
  252. } else if sqlgraph.IsConstraintError(err) {
  253. err = &ConstraintError{msg: err.Error(), wrap: err}
  254. }
  255. return 0, err
  256. }
  257. au.mutation.done = true
  258. return n, nil
  259. }
  260. // AgentUpdateOne is the builder for updating a single Agent entity.
  261. type AgentUpdateOne struct {
  262. config
  263. fields []string
  264. hooks []Hook
  265. mutation *AgentMutation
  266. }
  267. // SetUpdatedAt sets the "updated_at" field.
  268. func (auo *AgentUpdateOne) SetUpdatedAt(t time.Time) *AgentUpdateOne {
  269. auo.mutation.SetUpdatedAt(t)
  270. return auo
  271. }
  272. // SetDeletedAt sets the "deleted_at" field.
  273. func (auo *AgentUpdateOne) SetDeletedAt(t time.Time) *AgentUpdateOne {
  274. auo.mutation.SetDeletedAt(t)
  275. return auo
  276. }
  277. // SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
  278. func (auo *AgentUpdateOne) SetNillableDeletedAt(t *time.Time) *AgentUpdateOne {
  279. if t != nil {
  280. auo.SetDeletedAt(*t)
  281. }
  282. return auo
  283. }
  284. // ClearDeletedAt clears the value of the "deleted_at" field.
  285. func (auo *AgentUpdateOne) ClearDeletedAt() *AgentUpdateOne {
  286. auo.mutation.ClearDeletedAt()
  287. return auo
  288. }
  289. // SetName sets the "name" field.
  290. func (auo *AgentUpdateOne) SetName(s string) *AgentUpdateOne {
  291. auo.mutation.SetName(s)
  292. return auo
  293. }
  294. // SetNillableName sets the "name" field if the given value is not nil.
  295. func (auo *AgentUpdateOne) SetNillableName(s *string) *AgentUpdateOne {
  296. if s != nil {
  297. auo.SetName(*s)
  298. }
  299. return auo
  300. }
  301. // SetRole sets the "role" field.
  302. func (auo *AgentUpdateOne) SetRole(s string) *AgentUpdateOne {
  303. auo.mutation.SetRole(s)
  304. return auo
  305. }
  306. // SetNillableRole sets the "role" field if the given value is not nil.
  307. func (auo *AgentUpdateOne) SetNillableRole(s *string) *AgentUpdateOne {
  308. if s != nil {
  309. auo.SetRole(*s)
  310. }
  311. return auo
  312. }
  313. // SetStatus sets the "status" field.
  314. func (auo *AgentUpdateOne) SetStatus(i int) *AgentUpdateOne {
  315. auo.mutation.ResetStatus()
  316. auo.mutation.SetStatus(i)
  317. return auo
  318. }
  319. // SetNillableStatus sets the "status" field if the given value is not nil.
  320. func (auo *AgentUpdateOne) SetNillableStatus(i *int) *AgentUpdateOne {
  321. if i != nil {
  322. auo.SetStatus(*i)
  323. }
  324. return auo
  325. }
  326. // AddStatus adds i to the "status" field.
  327. func (auo *AgentUpdateOne) AddStatus(i int) *AgentUpdateOne {
  328. auo.mutation.AddStatus(i)
  329. return auo
  330. }
  331. // ClearStatus clears the value of the "status" field.
  332. func (auo *AgentUpdateOne) ClearStatus() *AgentUpdateOne {
  333. auo.mutation.ClearStatus()
  334. return auo
  335. }
  336. // SetBackground sets the "background" field.
  337. func (auo *AgentUpdateOne) SetBackground(s string) *AgentUpdateOne {
  338. auo.mutation.SetBackground(s)
  339. return auo
  340. }
  341. // SetNillableBackground sets the "background" field if the given value is not nil.
  342. func (auo *AgentUpdateOne) SetNillableBackground(s *string) *AgentUpdateOne {
  343. if s != nil {
  344. auo.SetBackground(*s)
  345. }
  346. return auo
  347. }
  348. // SetExamples sets the "examples" field.
  349. func (auo *AgentUpdateOne) SetExamples(s string) *AgentUpdateOne {
  350. auo.mutation.SetExamples(s)
  351. return auo
  352. }
  353. // SetNillableExamples sets the "examples" field if the given value is not nil.
  354. func (auo *AgentUpdateOne) SetNillableExamples(s *string) *AgentUpdateOne {
  355. if s != nil {
  356. auo.SetExamples(*s)
  357. }
  358. return auo
  359. }
  360. // SetOrganizationID sets the "organization_id" field.
  361. func (auo *AgentUpdateOne) SetOrganizationID(u uint64) *AgentUpdateOne {
  362. auo.mutation.ResetOrganizationID()
  363. auo.mutation.SetOrganizationID(u)
  364. return auo
  365. }
  366. // SetNillableOrganizationID sets the "organization_id" field if the given value is not nil.
  367. func (auo *AgentUpdateOne) SetNillableOrganizationID(u *uint64) *AgentUpdateOne {
  368. if u != nil {
  369. auo.SetOrganizationID(*u)
  370. }
  371. return auo
  372. }
  373. // AddOrganizationID adds u to the "organization_id" field.
  374. func (auo *AgentUpdateOne) AddOrganizationID(u int64) *AgentUpdateOne {
  375. auo.mutation.AddOrganizationID(u)
  376. return auo
  377. }
  378. // Mutation returns the AgentMutation object of the builder.
  379. func (auo *AgentUpdateOne) Mutation() *AgentMutation {
  380. return auo.mutation
  381. }
  382. // Where appends a list predicates to the AgentUpdate builder.
  383. func (auo *AgentUpdateOne) Where(ps ...predicate.Agent) *AgentUpdateOne {
  384. auo.mutation.Where(ps...)
  385. return auo
  386. }
  387. // Select allows selecting one or more fields (columns) of the returned entity.
  388. // The default is selecting all fields defined in the entity schema.
  389. func (auo *AgentUpdateOne) Select(field string, fields ...string) *AgentUpdateOne {
  390. auo.fields = append([]string{field}, fields...)
  391. return auo
  392. }
  393. // Save executes the query and returns the updated Agent entity.
  394. func (auo *AgentUpdateOne) Save(ctx context.Context) (*Agent, error) {
  395. if err := auo.defaults(); err != nil {
  396. return nil, err
  397. }
  398. return withHooks(ctx, auo.sqlSave, auo.mutation, auo.hooks)
  399. }
  400. // SaveX is like Save, but panics if an error occurs.
  401. func (auo *AgentUpdateOne) SaveX(ctx context.Context) *Agent {
  402. node, err := auo.Save(ctx)
  403. if err != nil {
  404. panic(err)
  405. }
  406. return node
  407. }
  408. // Exec executes the query on the entity.
  409. func (auo *AgentUpdateOne) Exec(ctx context.Context) error {
  410. _, err := auo.Save(ctx)
  411. return err
  412. }
  413. // ExecX is like Exec, but panics if an error occurs.
  414. func (auo *AgentUpdateOne) ExecX(ctx context.Context) {
  415. if err := auo.Exec(ctx); err != nil {
  416. panic(err)
  417. }
  418. }
  419. // defaults sets the default values of the builder before save.
  420. func (auo *AgentUpdateOne) defaults() error {
  421. if _, ok := auo.mutation.UpdatedAt(); !ok {
  422. if agent.UpdateDefaultUpdatedAt == nil {
  423. return fmt.Errorf("ent: uninitialized agent.UpdateDefaultUpdatedAt (forgotten import ent/runtime?)")
  424. }
  425. v := agent.UpdateDefaultUpdatedAt()
  426. auo.mutation.SetUpdatedAt(v)
  427. }
  428. return nil
  429. }
  430. // check runs all checks and user-defined validators on the builder.
  431. func (auo *AgentUpdateOne) check() error {
  432. if v, ok := auo.mutation.Name(); ok {
  433. if err := agent.NameValidator(v); err != nil {
  434. return &ValidationError{Name: "name", err: fmt.Errorf(`ent: validator failed for field "Agent.name": %w`, err)}
  435. }
  436. }
  437. if v, ok := auo.mutation.Role(); ok {
  438. if err := agent.RoleValidator(v); err != nil {
  439. return &ValidationError{Name: "role", err: fmt.Errorf(`ent: validator failed for field "Agent.role": %w`, err)}
  440. }
  441. }
  442. if v, ok := auo.mutation.Background(); ok {
  443. if err := agent.BackgroundValidator(v); err != nil {
  444. return &ValidationError{Name: "background", err: fmt.Errorf(`ent: validator failed for field "Agent.background": %w`, err)}
  445. }
  446. }
  447. if v, ok := auo.mutation.Examples(); ok {
  448. if err := agent.ExamplesValidator(v); err != nil {
  449. return &ValidationError{Name: "examples", err: fmt.Errorf(`ent: validator failed for field "Agent.examples": %w`, err)}
  450. }
  451. }
  452. return nil
  453. }
  454. func (auo *AgentUpdateOne) sqlSave(ctx context.Context) (_node *Agent, err error) {
  455. if err := auo.check(); err != nil {
  456. return _node, err
  457. }
  458. _spec := sqlgraph.NewUpdateSpec(agent.Table, agent.Columns, sqlgraph.NewFieldSpec(agent.FieldID, field.TypeUint64))
  459. id, ok := auo.mutation.ID()
  460. if !ok {
  461. return nil, &ValidationError{Name: "id", err: errors.New(`ent: missing "Agent.id" for update`)}
  462. }
  463. _spec.Node.ID.Value = id
  464. if fields := auo.fields; len(fields) > 0 {
  465. _spec.Node.Columns = make([]string, 0, len(fields))
  466. _spec.Node.Columns = append(_spec.Node.Columns, agent.FieldID)
  467. for _, f := range fields {
  468. if !agent.ValidColumn(f) {
  469. return nil, &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)}
  470. }
  471. if f != agent.FieldID {
  472. _spec.Node.Columns = append(_spec.Node.Columns, f)
  473. }
  474. }
  475. }
  476. if ps := auo.mutation.predicates; len(ps) > 0 {
  477. _spec.Predicate = func(selector *sql.Selector) {
  478. for i := range ps {
  479. ps[i](selector)
  480. }
  481. }
  482. }
  483. if value, ok := auo.mutation.UpdatedAt(); ok {
  484. _spec.SetField(agent.FieldUpdatedAt, field.TypeTime, value)
  485. }
  486. if value, ok := auo.mutation.DeletedAt(); ok {
  487. _spec.SetField(agent.FieldDeletedAt, field.TypeTime, value)
  488. }
  489. if auo.mutation.DeletedAtCleared() {
  490. _spec.ClearField(agent.FieldDeletedAt, field.TypeTime)
  491. }
  492. if value, ok := auo.mutation.Name(); ok {
  493. _spec.SetField(agent.FieldName, field.TypeString, value)
  494. }
  495. if value, ok := auo.mutation.Role(); ok {
  496. _spec.SetField(agent.FieldRole, field.TypeString, value)
  497. }
  498. if value, ok := auo.mutation.Status(); ok {
  499. _spec.SetField(agent.FieldStatus, field.TypeInt, value)
  500. }
  501. if value, ok := auo.mutation.AddedStatus(); ok {
  502. _spec.AddField(agent.FieldStatus, field.TypeInt, value)
  503. }
  504. if auo.mutation.StatusCleared() {
  505. _spec.ClearField(agent.FieldStatus, field.TypeInt)
  506. }
  507. if value, ok := auo.mutation.Background(); ok {
  508. _spec.SetField(agent.FieldBackground, field.TypeString, value)
  509. }
  510. if value, ok := auo.mutation.Examples(); ok {
  511. _spec.SetField(agent.FieldExamples, field.TypeString, value)
  512. }
  513. if value, ok := auo.mutation.OrganizationID(); ok {
  514. _spec.SetField(agent.FieldOrganizationID, field.TypeUint64, value)
  515. }
  516. if value, ok := auo.mutation.AddedOrganizationID(); ok {
  517. _spec.AddField(agent.FieldOrganizationID, field.TypeUint64, value)
  518. }
  519. _node = &Agent{config: auo.config}
  520. _spec.Assign = _node.assignValues
  521. _spec.ScanValues = _node.scanValues
  522. if err = sqlgraph.UpdateNode(ctx, auo.driver, _spec); err != nil {
  523. if _, ok := err.(*sqlgraph.NotFoundError); ok {
  524. err = &NotFoundError{agent.Label}
  525. } else if sqlgraph.IsConstraintError(err) {
  526. err = &ConstraintError{msg: err.Error(), wrap: err}
  527. }
  528. return nil, err
  529. }
  530. auo.mutation.done = true
  531. return _node, nil
  532. }