check runs all checks and user-defined validators on the builder.
()
| 503 | |
| 504 | // check runs all checks and user-defined validators on the builder. |
| 505 | func (_c *AlertCreate) check() error { |
| 506 | if _, ok := _c.mutation.CreatedAt(); !ok { |
| 507 | return &ValidationError{Name: "created_at", err: errors.New(`ent: missing required field "Alert.created_at"`)} |
| 508 | } |
| 509 | if _, ok := _c.mutation.UpdatedAt(); !ok { |
| 510 | return &ValidationError{Name: "updated_at", err: errors.New(`ent: missing required field "Alert.updated_at"`)} |
| 511 | } |
| 512 | if _, ok := _c.mutation.Scenario(); !ok { |
| 513 | return &ValidationError{Name: "scenario", err: errors.New(`ent: missing required field "Alert.scenario"`)} |
| 514 | } |
| 515 | if _, ok := _c.mutation.Simulated(); !ok { |
| 516 | return &ValidationError{Name: "simulated", err: errors.New(`ent: missing required field "Alert.simulated"`)} |
| 517 | } |
| 518 | return nil |
| 519 | } |
| 520 | |
| 521 | func (_c *AlertCreate) sqlSave(ctx context.Context) (*Alert, error) { |
| 522 | if err := _c.check(); err != nil { |