|
@@ -97,12 +97,28 @@ func (ac *AgentCreate) SetBackground(s string) *AgentCreate {
|
|
|
return ac
|
|
|
}
|
|
|
|
|
|
+// SetNillableBackground sets the "background" field if the given value is not nil.
|
|
|
+func (ac *AgentCreate) SetNillableBackground(s *string) *AgentCreate {
|
|
|
+ if s != nil {
|
|
|
+ ac.SetBackground(*s)
|
|
|
+ }
|
|
|
+ return ac
|
|
|
+}
|
|
|
+
|
|
|
// SetExamples sets the "examples" field.
|
|
|
func (ac *AgentCreate) SetExamples(s string) *AgentCreate {
|
|
|
ac.mutation.SetExamples(s)
|
|
|
return ac
|
|
|
}
|
|
|
|
|
|
+// SetNillableExamples sets the "examples" field if the given value is not nil.
|
|
|
+func (ac *AgentCreate) SetNillableExamples(s *string) *AgentCreate {
|
|
|
+ if s != nil {
|
|
|
+ ac.SetExamples(*s)
|
|
|
+ }
|
|
|
+ return ac
|
|
|
+}
|
|
|
+
|
|
|
// SetOrganizationID sets the "organization_id" field.
|
|
|
func (ac *AgentCreate) SetOrganizationID(u uint64) *AgentCreate {
|
|
|
ac.mutation.SetOrganizationID(u)
|
|
@@ -217,17 +233,11 @@ func (ac *AgentCreate) check() error {
|
|
|
return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "Agent.status": %w`, err)}
|
|
|
}
|
|
|
}
|
|
|
- if _, ok := ac.mutation.Background(); !ok {
|
|
|
- return &ValidationError{Name: "background", err: errors.New(`ent: missing required field "Agent.background"`)}
|
|
|
- }
|
|
|
if v, ok := ac.mutation.Background(); ok {
|
|
|
if err := agent.BackgroundValidator(v); err != nil {
|
|
|
return &ValidationError{Name: "background", err: fmt.Errorf(`ent: validator failed for field "Agent.background": %w`, err)}
|
|
|
}
|
|
|
}
|
|
|
- if _, ok := ac.mutation.Examples(); !ok {
|
|
|
- return &ValidationError{Name: "examples", err: errors.New(`ent: missing required field "Agent.examples"`)}
|
|
|
- }
|
|
|
if v, ok := ac.mutation.Examples(); ok {
|
|
|
if err := agent.ExamplesValidator(v); err != nil {
|
|
|
return &ValidationError{Name: "examples", err: fmt.Errorf(`ent: validator failed for field "Agent.examples": %w`, err)}
|
|
@@ -468,6 +478,12 @@ func (u *AgentUpsert) UpdateBackground() *AgentUpsert {
|
|
|
return u
|
|
|
}
|
|
|
|
|
|
+// ClearBackground clears the value of the "background" field.
|
|
|
+func (u *AgentUpsert) ClearBackground() *AgentUpsert {
|
|
|
+ u.SetNull(agent.FieldBackground)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
// SetExamples sets the "examples" field.
|
|
|
func (u *AgentUpsert) SetExamples(v string) *AgentUpsert {
|
|
|
u.Set(agent.FieldExamples, v)
|
|
@@ -480,6 +496,12 @@ func (u *AgentUpsert) UpdateExamples() *AgentUpsert {
|
|
|
return u
|
|
|
}
|
|
|
|
|
|
+// ClearExamples clears the value of the "examples" field.
|
|
|
+func (u *AgentUpsert) ClearExamples() *AgentUpsert {
|
|
|
+ u.SetNull(agent.FieldExamples)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
// SetOrganizationID sets the "organization_id" field.
|
|
|
func (u *AgentUpsert) SetOrganizationID(v uint64) *AgentUpsert {
|
|
|
u.Set(agent.FieldOrganizationID, v)
|
|
@@ -654,6 +676,13 @@ func (u *AgentUpsertOne) UpdateBackground() *AgentUpsertOne {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+// ClearBackground clears the value of the "background" field.
|
|
|
+func (u *AgentUpsertOne) ClearBackground() *AgentUpsertOne {
|
|
|
+ return u.Update(func(s *AgentUpsert) {
|
|
|
+ s.ClearBackground()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
// SetExamples sets the "examples" field.
|
|
|
func (u *AgentUpsertOne) SetExamples(v string) *AgentUpsertOne {
|
|
|
return u.Update(func(s *AgentUpsert) {
|
|
@@ -668,6 +697,13 @@ func (u *AgentUpsertOne) UpdateExamples() *AgentUpsertOne {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+// ClearExamples clears the value of the "examples" field.
|
|
|
+func (u *AgentUpsertOne) ClearExamples() *AgentUpsertOne {
|
|
|
+ return u.Update(func(s *AgentUpsert) {
|
|
|
+ s.ClearExamples()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
// SetOrganizationID sets the "organization_id" field.
|
|
|
func (u *AgentUpsertOne) SetOrganizationID(v uint64) *AgentUpsertOne {
|
|
|
return u.Update(func(s *AgentUpsert) {
|
|
@@ -1011,6 +1047,13 @@ func (u *AgentUpsertBulk) UpdateBackground() *AgentUpsertBulk {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+// ClearBackground clears the value of the "background" field.
|
|
|
+func (u *AgentUpsertBulk) ClearBackground() *AgentUpsertBulk {
|
|
|
+ return u.Update(func(s *AgentUpsert) {
|
|
|
+ s.ClearBackground()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
// SetExamples sets the "examples" field.
|
|
|
func (u *AgentUpsertBulk) SetExamples(v string) *AgentUpsertBulk {
|
|
|
return u.Update(func(s *AgentUpsert) {
|
|
@@ -1025,6 +1068,13 @@ func (u *AgentUpsertBulk) UpdateExamples() *AgentUpsertBulk {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+// ClearExamples clears the value of the "examples" field.
|
|
|
+func (u *AgentUpsertBulk) ClearExamples() *AgentUpsertBulk {
|
|
|
+ return u.Update(func(s *AgentUpsert) {
|
|
|
+ s.ClearExamples()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
// SetOrganizationID sets the "organization_id" field.
|
|
|
func (u *AgentUpsertBulk) SetOrganizationID(v uint64) *AgentUpsertBulk {
|
|
|
return u.Update(func(s *AgentUpsert) {
|