mirror of
https://github.com/chaitin/MonkeyCode.git
synced 2026-11-22 03:18:50 +08:00
- 新增 git_bots, git_bot_users, git_bot_tasks, project_git_bots 表 - 添加 user, host, project 到 gitbot 的关联边 - 使用 soft delete 和 created_at 游标
1535 lines
46 KiB
Go
1535 lines
46 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package db
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"fmt"
|
|
"time"
|
|
|
|
"entgo.io/ent/dialect/sql"
|
|
"entgo.io/ent/dialect/sql/sqlgraph"
|
|
"entgo.io/ent/schema/field"
|
|
"github.com/chaitin/MonkeyCode/backend/consts"
|
|
"github.com/chaitin/MonkeyCode/backend/db/gitbot"
|
|
"github.com/chaitin/MonkeyCode/backend/db/gitbottask"
|
|
"github.com/chaitin/MonkeyCode/backend/db/gitbotuser"
|
|
"github.com/chaitin/MonkeyCode/backend/db/host"
|
|
"github.com/chaitin/MonkeyCode/backend/db/predicate"
|
|
"github.com/chaitin/MonkeyCode/backend/db/project"
|
|
"github.com/chaitin/MonkeyCode/backend/db/projectgitbot"
|
|
"github.com/chaitin/MonkeyCode/backend/db/user"
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
// GitBotUpdate is the builder for updating GitBot entities.
|
|
type GitBotUpdate struct {
|
|
config
|
|
hooks []Hook
|
|
mutation *GitBotMutation
|
|
modifiers []func(*sql.UpdateBuilder)
|
|
}
|
|
|
|
// Where appends a list predicates to the GitBotUpdate builder.
|
|
func (_u *GitBotUpdate) Where(ps ...predicate.GitBot) *GitBotUpdate {
|
|
_u.mutation.Where(ps...)
|
|
return _u
|
|
}
|
|
|
|
// SetDeletedAt sets the "deleted_at" field.
|
|
func (_u *GitBotUpdate) SetDeletedAt(v time.Time) *GitBotUpdate {
|
|
_u.mutation.SetDeletedAt(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
|
|
func (_u *GitBotUpdate) SetNillableDeletedAt(v *time.Time) *GitBotUpdate {
|
|
if v != nil {
|
|
_u.SetDeletedAt(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// ClearDeletedAt clears the value of the "deleted_at" field.
|
|
func (_u *GitBotUpdate) ClearDeletedAt() *GitBotUpdate {
|
|
_u.mutation.ClearDeletedAt()
|
|
return _u
|
|
}
|
|
|
|
// SetUserID sets the "user_id" field.
|
|
func (_u *GitBotUpdate) SetUserID(v uuid.UUID) *GitBotUpdate {
|
|
_u.mutation.SetUserID(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableUserID sets the "user_id" field if the given value is not nil.
|
|
func (_u *GitBotUpdate) SetNillableUserID(v *uuid.UUID) *GitBotUpdate {
|
|
if v != nil {
|
|
_u.SetUserID(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// SetName sets the "name" field.
|
|
func (_u *GitBotUpdate) SetName(v string) *GitBotUpdate {
|
|
_u.mutation.SetName(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableName sets the "name" field if the given value is not nil.
|
|
func (_u *GitBotUpdate) SetNillableName(v *string) *GitBotUpdate {
|
|
if v != nil {
|
|
_u.SetName(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// ClearName clears the value of the "name" field.
|
|
func (_u *GitBotUpdate) ClearName() *GitBotUpdate {
|
|
_u.mutation.ClearName()
|
|
return _u
|
|
}
|
|
|
|
// SetHostID sets the "host_id" field.
|
|
func (_u *GitBotUpdate) SetHostID(v string) *GitBotUpdate {
|
|
_u.mutation.SetHostID(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableHostID sets the "host_id" field if the given value is not nil.
|
|
func (_u *GitBotUpdate) SetNillableHostID(v *string) *GitBotUpdate {
|
|
if v != nil {
|
|
_u.SetHostID(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// SetToken sets the "token" field.
|
|
func (_u *GitBotUpdate) SetToken(v string) *GitBotUpdate {
|
|
_u.mutation.SetToken(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableToken sets the "token" field if the given value is not nil.
|
|
func (_u *GitBotUpdate) SetNillableToken(v *string) *GitBotUpdate {
|
|
if v != nil {
|
|
_u.SetToken(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// ClearToken clears the value of the "token" field.
|
|
func (_u *GitBotUpdate) ClearToken() *GitBotUpdate {
|
|
_u.mutation.ClearToken()
|
|
return _u
|
|
}
|
|
|
|
// SetSecretToken sets the "secret_token" field.
|
|
func (_u *GitBotUpdate) SetSecretToken(v string) *GitBotUpdate {
|
|
_u.mutation.SetSecretToken(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableSecretToken sets the "secret_token" field if the given value is not nil.
|
|
func (_u *GitBotUpdate) SetNillableSecretToken(v *string) *GitBotUpdate {
|
|
if v != nil {
|
|
_u.SetSecretToken(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// ClearSecretToken clears the value of the "secret_token" field.
|
|
func (_u *GitBotUpdate) ClearSecretToken() *GitBotUpdate {
|
|
_u.mutation.ClearSecretToken()
|
|
return _u
|
|
}
|
|
|
|
// SetPlatform sets the "platform" field.
|
|
func (_u *GitBotUpdate) SetPlatform(v consts.GitPlatform) *GitBotUpdate {
|
|
_u.mutation.SetPlatform(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillablePlatform sets the "platform" field if the given value is not nil.
|
|
func (_u *GitBotUpdate) SetNillablePlatform(v *consts.GitPlatform) *GitBotUpdate {
|
|
if v != nil {
|
|
_u.SetPlatform(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// SetCreatedAt sets the "created_at" field.
|
|
func (_u *GitBotUpdate) SetCreatedAt(v time.Time) *GitBotUpdate {
|
|
_u.mutation.SetCreatedAt(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
|
|
func (_u *GitBotUpdate) SetNillableCreatedAt(v *time.Time) *GitBotUpdate {
|
|
if v != nil {
|
|
_u.SetCreatedAt(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// AddGitBotTaskIDs adds the "git_bot_tasks" edge to the GitBotTask entity by IDs.
|
|
func (_u *GitBotUpdate) AddGitBotTaskIDs(ids ...uuid.UUID) *GitBotUpdate {
|
|
_u.mutation.AddGitBotTaskIDs(ids...)
|
|
return _u
|
|
}
|
|
|
|
// AddGitBotTasks adds the "git_bot_tasks" edges to the GitBotTask entity.
|
|
func (_u *GitBotUpdate) AddGitBotTasks(v ...*GitBotTask) *GitBotUpdate {
|
|
ids := make([]uuid.UUID, len(v))
|
|
for i := range v {
|
|
ids[i] = v[i].ID
|
|
}
|
|
return _u.AddGitBotTaskIDs(ids...)
|
|
}
|
|
|
|
// SetHost sets the "host" edge to the Host entity.
|
|
func (_u *GitBotUpdate) SetHost(v *Host) *GitBotUpdate {
|
|
return _u.SetHostID(v.ID)
|
|
}
|
|
|
|
// AddUserIDs adds the "users" edge to the User entity by IDs.
|
|
func (_u *GitBotUpdate) AddUserIDs(ids ...uuid.UUID) *GitBotUpdate {
|
|
_u.mutation.AddUserIDs(ids...)
|
|
return _u
|
|
}
|
|
|
|
// AddUsers adds the "users" edges to the User entity.
|
|
func (_u *GitBotUpdate) AddUsers(v ...*User) *GitBotUpdate {
|
|
ids := make([]uuid.UUID, len(v))
|
|
for i := range v {
|
|
ids[i] = v[i].ID
|
|
}
|
|
return _u.AddUserIDs(ids...)
|
|
}
|
|
|
|
// AddProjectIDs adds the "projects" edge to the Project entity by IDs.
|
|
func (_u *GitBotUpdate) AddProjectIDs(ids ...uuid.UUID) *GitBotUpdate {
|
|
_u.mutation.AddProjectIDs(ids...)
|
|
return _u
|
|
}
|
|
|
|
// AddProjects adds the "projects" edges to the Project entity.
|
|
func (_u *GitBotUpdate) AddProjects(v ...*Project) *GitBotUpdate {
|
|
ids := make([]uuid.UUID, len(v))
|
|
for i := range v {
|
|
ids[i] = v[i].ID
|
|
}
|
|
return _u.AddProjectIDs(ids...)
|
|
}
|
|
|
|
// AddGitBotUserIDs adds the "git_bot_users" edge to the GitBotUser entity by IDs.
|
|
func (_u *GitBotUpdate) AddGitBotUserIDs(ids ...uuid.UUID) *GitBotUpdate {
|
|
_u.mutation.AddGitBotUserIDs(ids...)
|
|
return _u
|
|
}
|
|
|
|
// AddGitBotUsers adds the "git_bot_users" edges to the GitBotUser entity.
|
|
func (_u *GitBotUpdate) AddGitBotUsers(v ...*GitBotUser) *GitBotUpdate {
|
|
ids := make([]uuid.UUID, len(v))
|
|
for i := range v {
|
|
ids[i] = v[i].ID
|
|
}
|
|
return _u.AddGitBotUserIDs(ids...)
|
|
}
|
|
|
|
// AddProjectGitBotIDs adds the "project_git_bots" edge to the ProjectGitBot entity by IDs.
|
|
func (_u *GitBotUpdate) AddProjectGitBotIDs(ids ...uuid.UUID) *GitBotUpdate {
|
|
_u.mutation.AddProjectGitBotIDs(ids...)
|
|
return _u
|
|
}
|
|
|
|
// AddProjectGitBots adds the "project_git_bots" edges to the ProjectGitBot entity.
|
|
func (_u *GitBotUpdate) AddProjectGitBots(v ...*ProjectGitBot) *GitBotUpdate {
|
|
ids := make([]uuid.UUID, len(v))
|
|
for i := range v {
|
|
ids[i] = v[i].ID
|
|
}
|
|
return _u.AddProjectGitBotIDs(ids...)
|
|
}
|
|
|
|
// Mutation returns the GitBotMutation object of the builder.
|
|
func (_u *GitBotUpdate) Mutation() *GitBotMutation {
|
|
return _u.mutation
|
|
}
|
|
|
|
// ClearGitBotTasks clears all "git_bot_tasks" edges to the GitBotTask entity.
|
|
func (_u *GitBotUpdate) ClearGitBotTasks() *GitBotUpdate {
|
|
_u.mutation.ClearGitBotTasks()
|
|
return _u
|
|
}
|
|
|
|
// RemoveGitBotTaskIDs removes the "git_bot_tasks" edge to GitBotTask entities by IDs.
|
|
func (_u *GitBotUpdate) RemoveGitBotTaskIDs(ids ...uuid.UUID) *GitBotUpdate {
|
|
_u.mutation.RemoveGitBotTaskIDs(ids...)
|
|
return _u
|
|
}
|
|
|
|
// RemoveGitBotTasks removes "git_bot_tasks" edges to GitBotTask entities.
|
|
func (_u *GitBotUpdate) RemoveGitBotTasks(v ...*GitBotTask) *GitBotUpdate {
|
|
ids := make([]uuid.UUID, len(v))
|
|
for i := range v {
|
|
ids[i] = v[i].ID
|
|
}
|
|
return _u.RemoveGitBotTaskIDs(ids...)
|
|
}
|
|
|
|
// ClearHost clears the "host" edge to the Host entity.
|
|
func (_u *GitBotUpdate) ClearHost() *GitBotUpdate {
|
|
_u.mutation.ClearHost()
|
|
return _u
|
|
}
|
|
|
|
// ClearUsers clears all "users" edges to the User entity.
|
|
func (_u *GitBotUpdate) ClearUsers() *GitBotUpdate {
|
|
_u.mutation.ClearUsers()
|
|
return _u
|
|
}
|
|
|
|
// RemoveUserIDs removes the "users" edge to User entities by IDs.
|
|
func (_u *GitBotUpdate) RemoveUserIDs(ids ...uuid.UUID) *GitBotUpdate {
|
|
_u.mutation.RemoveUserIDs(ids...)
|
|
return _u
|
|
}
|
|
|
|
// RemoveUsers removes "users" edges to User entities.
|
|
func (_u *GitBotUpdate) RemoveUsers(v ...*User) *GitBotUpdate {
|
|
ids := make([]uuid.UUID, len(v))
|
|
for i := range v {
|
|
ids[i] = v[i].ID
|
|
}
|
|
return _u.RemoveUserIDs(ids...)
|
|
}
|
|
|
|
// ClearProjects clears all "projects" edges to the Project entity.
|
|
func (_u *GitBotUpdate) ClearProjects() *GitBotUpdate {
|
|
_u.mutation.ClearProjects()
|
|
return _u
|
|
}
|
|
|
|
// RemoveProjectIDs removes the "projects" edge to Project entities by IDs.
|
|
func (_u *GitBotUpdate) RemoveProjectIDs(ids ...uuid.UUID) *GitBotUpdate {
|
|
_u.mutation.RemoveProjectIDs(ids...)
|
|
return _u
|
|
}
|
|
|
|
// RemoveProjects removes "projects" edges to Project entities.
|
|
func (_u *GitBotUpdate) RemoveProjects(v ...*Project) *GitBotUpdate {
|
|
ids := make([]uuid.UUID, len(v))
|
|
for i := range v {
|
|
ids[i] = v[i].ID
|
|
}
|
|
return _u.RemoveProjectIDs(ids...)
|
|
}
|
|
|
|
// ClearGitBotUsers clears all "git_bot_users" edges to the GitBotUser entity.
|
|
func (_u *GitBotUpdate) ClearGitBotUsers() *GitBotUpdate {
|
|
_u.mutation.ClearGitBotUsers()
|
|
return _u
|
|
}
|
|
|
|
// RemoveGitBotUserIDs removes the "git_bot_users" edge to GitBotUser entities by IDs.
|
|
func (_u *GitBotUpdate) RemoveGitBotUserIDs(ids ...uuid.UUID) *GitBotUpdate {
|
|
_u.mutation.RemoveGitBotUserIDs(ids...)
|
|
return _u
|
|
}
|
|
|
|
// RemoveGitBotUsers removes "git_bot_users" edges to GitBotUser entities.
|
|
func (_u *GitBotUpdate) RemoveGitBotUsers(v ...*GitBotUser) *GitBotUpdate {
|
|
ids := make([]uuid.UUID, len(v))
|
|
for i := range v {
|
|
ids[i] = v[i].ID
|
|
}
|
|
return _u.RemoveGitBotUserIDs(ids...)
|
|
}
|
|
|
|
// ClearProjectGitBots clears all "project_git_bots" edges to the ProjectGitBot entity.
|
|
func (_u *GitBotUpdate) ClearProjectGitBots() *GitBotUpdate {
|
|
_u.mutation.ClearProjectGitBots()
|
|
return _u
|
|
}
|
|
|
|
// RemoveProjectGitBotIDs removes the "project_git_bots" edge to ProjectGitBot entities by IDs.
|
|
func (_u *GitBotUpdate) RemoveProjectGitBotIDs(ids ...uuid.UUID) *GitBotUpdate {
|
|
_u.mutation.RemoveProjectGitBotIDs(ids...)
|
|
return _u
|
|
}
|
|
|
|
// RemoveProjectGitBots removes "project_git_bots" edges to ProjectGitBot entities.
|
|
func (_u *GitBotUpdate) RemoveProjectGitBots(v ...*ProjectGitBot) *GitBotUpdate {
|
|
ids := make([]uuid.UUID, len(v))
|
|
for i := range v {
|
|
ids[i] = v[i].ID
|
|
}
|
|
return _u.RemoveProjectGitBotIDs(ids...)
|
|
}
|
|
|
|
// Save executes the query and returns the number of nodes affected by the update operation.
|
|
func (_u *GitBotUpdate) Save(ctx context.Context) (int, error) {
|
|
return withHooks(ctx, _u.sqlSave, _u.mutation, _u.hooks)
|
|
}
|
|
|
|
// SaveX is like Save, but panics if an error occurs.
|
|
func (_u *GitBotUpdate) SaveX(ctx context.Context) int {
|
|
affected, err := _u.Save(ctx)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return affected
|
|
}
|
|
|
|
// Exec executes the query.
|
|
func (_u *GitBotUpdate) Exec(ctx context.Context) error {
|
|
_, err := _u.Save(ctx)
|
|
return err
|
|
}
|
|
|
|
// ExecX is like Exec, but panics if an error occurs.
|
|
func (_u *GitBotUpdate) ExecX(ctx context.Context) {
|
|
if err := _u.Exec(ctx); err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
|
|
// check runs all checks and user-defined validators on the builder.
|
|
func (_u *GitBotUpdate) check() error {
|
|
if _u.mutation.HostCleared() && len(_u.mutation.HostIDs()) > 0 {
|
|
return errors.New(`db: clearing a required unique edge "GitBot.host"`)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
|
|
func (_u *GitBotUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *GitBotUpdate {
|
|
_u.modifiers = append(_u.modifiers, modifiers...)
|
|
return _u
|
|
}
|
|
|
|
func (_u *GitBotUpdate) sqlSave(ctx context.Context) (_node int, err error) {
|
|
if err := _u.check(); err != nil {
|
|
return _node, err
|
|
}
|
|
_spec := sqlgraph.NewUpdateSpec(gitbot.Table, gitbot.Columns, sqlgraph.NewFieldSpec(gitbot.FieldID, field.TypeUUID))
|
|
if ps := _u.mutation.predicates; len(ps) > 0 {
|
|
_spec.Predicate = func(selector *sql.Selector) {
|
|
for i := range ps {
|
|
ps[i](selector)
|
|
}
|
|
}
|
|
}
|
|
if value, ok := _u.mutation.DeletedAt(); ok {
|
|
_spec.SetField(gitbot.FieldDeletedAt, field.TypeTime, value)
|
|
}
|
|
if _u.mutation.DeletedAtCleared() {
|
|
_spec.ClearField(gitbot.FieldDeletedAt, field.TypeTime)
|
|
}
|
|
if value, ok := _u.mutation.UserID(); ok {
|
|
_spec.SetField(gitbot.FieldUserID, field.TypeUUID, value)
|
|
}
|
|
if value, ok := _u.mutation.Name(); ok {
|
|
_spec.SetField(gitbot.FieldName, field.TypeString, value)
|
|
}
|
|
if _u.mutation.NameCleared() {
|
|
_spec.ClearField(gitbot.FieldName, field.TypeString)
|
|
}
|
|
if value, ok := _u.mutation.Token(); ok {
|
|
_spec.SetField(gitbot.FieldToken, field.TypeString, value)
|
|
}
|
|
if _u.mutation.TokenCleared() {
|
|
_spec.ClearField(gitbot.FieldToken, field.TypeString)
|
|
}
|
|
if value, ok := _u.mutation.SecretToken(); ok {
|
|
_spec.SetField(gitbot.FieldSecretToken, field.TypeString, value)
|
|
}
|
|
if _u.mutation.SecretTokenCleared() {
|
|
_spec.ClearField(gitbot.FieldSecretToken, field.TypeString)
|
|
}
|
|
if value, ok := _u.mutation.Platform(); ok {
|
|
_spec.SetField(gitbot.FieldPlatform, field.TypeString, value)
|
|
}
|
|
if value, ok := _u.mutation.CreatedAt(); ok {
|
|
_spec.SetField(gitbot.FieldCreatedAt, field.TypeTime, value)
|
|
}
|
|
if _u.mutation.GitBotTasksCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: false,
|
|
Table: gitbot.GitBotTasksTable,
|
|
Columns: []string{gitbot.GitBotTasksColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(gitbottask.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := _u.mutation.RemovedGitBotTasksIDs(); len(nodes) > 0 && !_u.mutation.GitBotTasksCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: false,
|
|
Table: gitbot.GitBotTasksTable,
|
|
Columns: []string{gitbot.GitBotTasksColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(gitbottask.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := _u.mutation.GitBotTasksIDs(); len(nodes) > 0 {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: false,
|
|
Table: gitbot.GitBotTasksTable,
|
|
Columns: []string{gitbot.GitBotTasksColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(gitbottask.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
|
}
|
|
if _u.mutation.HostCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.M2O,
|
|
Inverse: true,
|
|
Table: gitbot.HostTable,
|
|
Columns: []string{gitbot.HostColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(host.FieldID, field.TypeString),
|
|
},
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := _u.mutation.HostIDs(); len(nodes) > 0 {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.M2O,
|
|
Inverse: true,
|
|
Table: gitbot.HostTable,
|
|
Columns: []string{gitbot.HostColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(host.FieldID, field.TypeString),
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
|
}
|
|
if _u.mutation.UsersCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.M2M,
|
|
Inverse: true,
|
|
Table: gitbot.UsersTable,
|
|
Columns: gitbot.UsersPrimaryKey,
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
createE := &GitBotUserCreate{config: _u.config, mutation: newGitBotUserMutation(_u.config, OpCreate)}
|
|
createE.defaults()
|
|
_, specE := createE.createSpec()
|
|
edge.Target.Fields = specE.Fields
|
|
if specE.ID.Value != nil {
|
|
edge.Target.Fields = append(edge.Target.Fields, specE.ID)
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := _u.mutation.RemovedUsersIDs(); len(nodes) > 0 && !_u.mutation.UsersCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.M2M,
|
|
Inverse: true,
|
|
Table: gitbot.UsersTable,
|
|
Columns: gitbot.UsersPrimaryKey,
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
createE := &GitBotUserCreate{config: _u.config, mutation: newGitBotUserMutation(_u.config, OpCreate)}
|
|
createE.defaults()
|
|
_, specE := createE.createSpec()
|
|
edge.Target.Fields = specE.Fields
|
|
if specE.ID.Value != nil {
|
|
edge.Target.Fields = append(edge.Target.Fields, specE.ID)
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := _u.mutation.UsersIDs(); len(nodes) > 0 {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.M2M,
|
|
Inverse: true,
|
|
Table: gitbot.UsersTable,
|
|
Columns: gitbot.UsersPrimaryKey,
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
createE := &GitBotUserCreate{config: _u.config, mutation: newGitBotUserMutation(_u.config, OpCreate)}
|
|
createE.defaults()
|
|
_, specE := createE.createSpec()
|
|
edge.Target.Fields = specE.Fields
|
|
if specE.ID.Value != nil {
|
|
edge.Target.Fields = append(edge.Target.Fields, specE.ID)
|
|
}
|
|
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
|
}
|
|
if _u.mutation.ProjectsCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.M2M,
|
|
Inverse: true,
|
|
Table: gitbot.ProjectsTable,
|
|
Columns: gitbot.ProjectsPrimaryKey,
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(project.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
createE := &ProjectGitBotCreate{config: _u.config, mutation: newProjectGitBotMutation(_u.config, OpCreate)}
|
|
createE.defaults()
|
|
_, specE := createE.createSpec()
|
|
edge.Target.Fields = specE.Fields
|
|
if specE.ID.Value != nil {
|
|
edge.Target.Fields = append(edge.Target.Fields, specE.ID)
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := _u.mutation.RemovedProjectsIDs(); len(nodes) > 0 && !_u.mutation.ProjectsCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.M2M,
|
|
Inverse: true,
|
|
Table: gitbot.ProjectsTable,
|
|
Columns: gitbot.ProjectsPrimaryKey,
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(project.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
createE := &ProjectGitBotCreate{config: _u.config, mutation: newProjectGitBotMutation(_u.config, OpCreate)}
|
|
createE.defaults()
|
|
_, specE := createE.createSpec()
|
|
edge.Target.Fields = specE.Fields
|
|
if specE.ID.Value != nil {
|
|
edge.Target.Fields = append(edge.Target.Fields, specE.ID)
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := _u.mutation.ProjectsIDs(); len(nodes) > 0 {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.M2M,
|
|
Inverse: true,
|
|
Table: gitbot.ProjectsTable,
|
|
Columns: gitbot.ProjectsPrimaryKey,
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(project.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
createE := &ProjectGitBotCreate{config: _u.config, mutation: newProjectGitBotMutation(_u.config, OpCreate)}
|
|
createE.defaults()
|
|
_, specE := createE.createSpec()
|
|
edge.Target.Fields = specE.Fields
|
|
if specE.ID.Value != nil {
|
|
edge.Target.Fields = append(edge.Target.Fields, specE.ID)
|
|
}
|
|
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
|
}
|
|
if _u.mutation.GitBotUsersCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: true,
|
|
Table: gitbot.GitBotUsersTable,
|
|
Columns: []string{gitbot.GitBotUsersColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(gitbotuser.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := _u.mutation.RemovedGitBotUsersIDs(); len(nodes) > 0 && !_u.mutation.GitBotUsersCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: true,
|
|
Table: gitbot.GitBotUsersTable,
|
|
Columns: []string{gitbot.GitBotUsersColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(gitbotuser.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := _u.mutation.GitBotUsersIDs(); len(nodes) > 0 {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: true,
|
|
Table: gitbot.GitBotUsersTable,
|
|
Columns: []string{gitbot.GitBotUsersColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(gitbotuser.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
|
}
|
|
if _u.mutation.ProjectGitBotsCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: true,
|
|
Table: gitbot.ProjectGitBotsTable,
|
|
Columns: []string{gitbot.ProjectGitBotsColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(projectgitbot.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := _u.mutation.RemovedProjectGitBotsIDs(); len(nodes) > 0 && !_u.mutation.ProjectGitBotsCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: true,
|
|
Table: gitbot.ProjectGitBotsTable,
|
|
Columns: []string{gitbot.ProjectGitBotsColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(projectgitbot.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := _u.mutation.ProjectGitBotsIDs(); len(nodes) > 0 {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: true,
|
|
Table: gitbot.ProjectGitBotsTable,
|
|
Columns: []string{gitbot.ProjectGitBotsColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(projectgitbot.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
|
}
|
|
_spec.AddModifiers(_u.modifiers...)
|
|
if _node, err = sqlgraph.UpdateNodes(ctx, _u.driver, _spec); err != nil {
|
|
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
|
err = &NotFoundError{gitbot.Label}
|
|
} else if sqlgraph.IsConstraintError(err) {
|
|
err = &ConstraintError{msg: err.Error(), wrap: err}
|
|
}
|
|
return 0, err
|
|
}
|
|
_u.mutation.done = true
|
|
return _node, nil
|
|
}
|
|
|
|
// GitBotUpdateOne is the builder for updating a single GitBot entity.
|
|
type GitBotUpdateOne struct {
|
|
config
|
|
fields []string
|
|
hooks []Hook
|
|
mutation *GitBotMutation
|
|
modifiers []func(*sql.UpdateBuilder)
|
|
}
|
|
|
|
// SetDeletedAt sets the "deleted_at" field.
|
|
func (_u *GitBotUpdateOne) SetDeletedAt(v time.Time) *GitBotUpdateOne {
|
|
_u.mutation.SetDeletedAt(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
|
|
func (_u *GitBotUpdateOne) SetNillableDeletedAt(v *time.Time) *GitBotUpdateOne {
|
|
if v != nil {
|
|
_u.SetDeletedAt(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// ClearDeletedAt clears the value of the "deleted_at" field.
|
|
func (_u *GitBotUpdateOne) ClearDeletedAt() *GitBotUpdateOne {
|
|
_u.mutation.ClearDeletedAt()
|
|
return _u
|
|
}
|
|
|
|
// SetUserID sets the "user_id" field.
|
|
func (_u *GitBotUpdateOne) SetUserID(v uuid.UUID) *GitBotUpdateOne {
|
|
_u.mutation.SetUserID(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableUserID sets the "user_id" field if the given value is not nil.
|
|
func (_u *GitBotUpdateOne) SetNillableUserID(v *uuid.UUID) *GitBotUpdateOne {
|
|
if v != nil {
|
|
_u.SetUserID(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// SetName sets the "name" field.
|
|
func (_u *GitBotUpdateOne) SetName(v string) *GitBotUpdateOne {
|
|
_u.mutation.SetName(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableName sets the "name" field if the given value is not nil.
|
|
func (_u *GitBotUpdateOne) SetNillableName(v *string) *GitBotUpdateOne {
|
|
if v != nil {
|
|
_u.SetName(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// ClearName clears the value of the "name" field.
|
|
func (_u *GitBotUpdateOne) ClearName() *GitBotUpdateOne {
|
|
_u.mutation.ClearName()
|
|
return _u
|
|
}
|
|
|
|
// SetHostID sets the "host_id" field.
|
|
func (_u *GitBotUpdateOne) SetHostID(v string) *GitBotUpdateOne {
|
|
_u.mutation.SetHostID(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableHostID sets the "host_id" field if the given value is not nil.
|
|
func (_u *GitBotUpdateOne) SetNillableHostID(v *string) *GitBotUpdateOne {
|
|
if v != nil {
|
|
_u.SetHostID(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// SetToken sets the "token" field.
|
|
func (_u *GitBotUpdateOne) SetToken(v string) *GitBotUpdateOne {
|
|
_u.mutation.SetToken(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableToken sets the "token" field if the given value is not nil.
|
|
func (_u *GitBotUpdateOne) SetNillableToken(v *string) *GitBotUpdateOne {
|
|
if v != nil {
|
|
_u.SetToken(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// ClearToken clears the value of the "token" field.
|
|
func (_u *GitBotUpdateOne) ClearToken() *GitBotUpdateOne {
|
|
_u.mutation.ClearToken()
|
|
return _u
|
|
}
|
|
|
|
// SetSecretToken sets the "secret_token" field.
|
|
func (_u *GitBotUpdateOne) SetSecretToken(v string) *GitBotUpdateOne {
|
|
_u.mutation.SetSecretToken(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableSecretToken sets the "secret_token" field if the given value is not nil.
|
|
func (_u *GitBotUpdateOne) SetNillableSecretToken(v *string) *GitBotUpdateOne {
|
|
if v != nil {
|
|
_u.SetSecretToken(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// ClearSecretToken clears the value of the "secret_token" field.
|
|
func (_u *GitBotUpdateOne) ClearSecretToken() *GitBotUpdateOne {
|
|
_u.mutation.ClearSecretToken()
|
|
return _u
|
|
}
|
|
|
|
// SetPlatform sets the "platform" field.
|
|
func (_u *GitBotUpdateOne) SetPlatform(v consts.GitPlatform) *GitBotUpdateOne {
|
|
_u.mutation.SetPlatform(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillablePlatform sets the "platform" field if the given value is not nil.
|
|
func (_u *GitBotUpdateOne) SetNillablePlatform(v *consts.GitPlatform) *GitBotUpdateOne {
|
|
if v != nil {
|
|
_u.SetPlatform(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// SetCreatedAt sets the "created_at" field.
|
|
func (_u *GitBotUpdateOne) SetCreatedAt(v time.Time) *GitBotUpdateOne {
|
|
_u.mutation.SetCreatedAt(v)
|
|
return _u
|
|
}
|
|
|
|
// SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
|
|
func (_u *GitBotUpdateOne) SetNillableCreatedAt(v *time.Time) *GitBotUpdateOne {
|
|
if v != nil {
|
|
_u.SetCreatedAt(*v)
|
|
}
|
|
return _u
|
|
}
|
|
|
|
// AddGitBotTaskIDs adds the "git_bot_tasks" edge to the GitBotTask entity by IDs.
|
|
func (_u *GitBotUpdateOne) AddGitBotTaskIDs(ids ...uuid.UUID) *GitBotUpdateOne {
|
|
_u.mutation.AddGitBotTaskIDs(ids...)
|
|
return _u
|
|
}
|
|
|
|
// AddGitBotTasks adds the "git_bot_tasks" edges to the GitBotTask entity.
|
|
func (_u *GitBotUpdateOne) AddGitBotTasks(v ...*GitBotTask) *GitBotUpdateOne {
|
|
ids := make([]uuid.UUID, len(v))
|
|
for i := range v {
|
|
ids[i] = v[i].ID
|
|
}
|
|
return _u.AddGitBotTaskIDs(ids...)
|
|
}
|
|
|
|
// SetHost sets the "host" edge to the Host entity.
|
|
func (_u *GitBotUpdateOne) SetHost(v *Host) *GitBotUpdateOne {
|
|
return _u.SetHostID(v.ID)
|
|
}
|
|
|
|
// AddUserIDs adds the "users" edge to the User entity by IDs.
|
|
func (_u *GitBotUpdateOne) AddUserIDs(ids ...uuid.UUID) *GitBotUpdateOne {
|
|
_u.mutation.AddUserIDs(ids...)
|
|
return _u
|
|
}
|
|
|
|
// AddUsers adds the "users" edges to the User entity.
|
|
func (_u *GitBotUpdateOne) AddUsers(v ...*User) *GitBotUpdateOne {
|
|
ids := make([]uuid.UUID, len(v))
|
|
for i := range v {
|
|
ids[i] = v[i].ID
|
|
}
|
|
return _u.AddUserIDs(ids...)
|
|
}
|
|
|
|
// AddProjectIDs adds the "projects" edge to the Project entity by IDs.
|
|
func (_u *GitBotUpdateOne) AddProjectIDs(ids ...uuid.UUID) *GitBotUpdateOne {
|
|
_u.mutation.AddProjectIDs(ids...)
|
|
return _u
|
|
}
|
|
|
|
// AddProjects adds the "projects" edges to the Project entity.
|
|
func (_u *GitBotUpdateOne) AddProjects(v ...*Project) *GitBotUpdateOne {
|
|
ids := make([]uuid.UUID, len(v))
|
|
for i := range v {
|
|
ids[i] = v[i].ID
|
|
}
|
|
return _u.AddProjectIDs(ids...)
|
|
}
|
|
|
|
// AddGitBotUserIDs adds the "git_bot_users" edge to the GitBotUser entity by IDs.
|
|
func (_u *GitBotUpdateOne) AddGitBotUserIDs(ids ...uuid.UUID) *GitBotUpdateOne {
|
|
_u.mutation.AddGitBotUserIDs(ids...)
|
|
return _u
|
|
}
|
|
|
|
// AddGitBotUsers adds the "git_bot_users" edges to the GitBotUser entity.
|
|
func (_u *GitBotUpdateOne) AddGitBotUsers(v ...*GitBotUser) *GitBotUpdateOne {
|
|
ids := make([]uuid.UUID, len(v))
|
|
for i := range v {
|
|
ids[i] = v[i].ID
|
|
}
|
|
return _u.AddGitBotUserIDs(ids...)
|
|
}
|
|
|
|
// AddProjectGitBotIDs adds the "project_git_bots" edge to the ProjectGitBot entity by IDs.
|
|
func (_u *GitBotUpdateOne) AddProjectGitBotIDs(ids ...uuid.UUID) *GitBotUpdateOne {
|
|
_u.mutation.AddProjectGitBotIDs(ids...)
|
|
return _u
|
|
}
|
|
|
|
// AddProjectGitBots adds the "project_git_bots" edges to the ProjectGitBot entity.
|
|
func (_u *GitBotUpdateOne) AddProjectGitBots(v ...*ProjectGitBot) *GitBotUpdateOne {
|
|
ids := make([]uuid.UUID, len(v))
|
|
for i := range v {
|
|
ids[i] = v[i].ID
|
|
}
|
|
return _u.AddProjectGitBotIDs(ids...)
|
|
}
|
|
|
|
// Mutation returns the GitBotMutation object of the builder.
|
|
func (_u *GitBotUpdateOne) Mutation() *GitBotMutation {
|
|
return _u.mutation
|
|
}
|
|
|
|
// ClearGitBotTasks clears all "git_bot_tasks" edges to the GitBotTask entity.
|
|
func (_u *GitBotUpdateOne) ClearGitBotTasks() *GitBotUpdateOne {
|
|
_u.mutation.ClearGitBotTasks()
|
|
return _u
|
|
}
|
|
|
|
// RemoveGitBotTaskIDs removes the "git_bot_tasks" edge to GitBotTask entities by IDs.
|
|
func (_u *GitBotUpdateOne) RemoveGitBotTaskIDs(ids ...uuid.UUID) *GitBotUpdateOne {
|
|
_u.mutation.RemoveGitBotTaskIDs(ids...)
|
|
return _u
|
|
}
|
|
|
|
// RemoveGitBotTasks removes "git_bot_tasks" edges to GitBotTask entities.
|
|
func (_u *GitBotUpdateOne) RemoveGitBotTasks(v ...*GitBotTask) *GitBotUpdateOne {
|
|
ids := make([]uuid.UUID, len(v))
|
|
for i := range v {
|
|
ids[i] = v[i].ID
|
|
}
|
|
return _u.RemoveGitBotTaskIDs(ids...)
|
|
}
|
|
|
|
// ClearHost clears the "host" edge to the Host entity.
|
|
func (_u *GitBotUpdateOne) ClearHost() *GitBotUpdateOne {
|
|
_u.mutation.ClearHost()
|
|
return _u
|
|
}
|
|
|
|
// ClearUsers clears all "users" edges to the User entity.
|
|
func (_u *GitBotUpdateOne) ClearUsers() *GitBotUpdateOne {
|
|
_u.mutation.ClearUsers()
|
|
return _u
|
|
}
|
|
|
|
// RemoveUserIDs removes the "users" edge to User entities by IDs.
|
|
func (_u *GitBotUpdateOne) RemoveUserIDs(ids ...uuid.UUID) *GitBotUpdateOne {
|
|
_u.mutation.RemoveUserIDs(ids...)
|
|
return _u
|
|
}
|
|
|
|
// RemoveUsers removes "users" edges to User entities.
|
|
func (_u *GitBotUpdateOne) RemoveUsers(v ...*User) *GitBotUpdateOne {
|
|
ids := make([]uuid.UUID, len(v))
|
|
for i := range v {
|
|
ids[i] = v[i].ID
|
|
}
|
|
return _u.RemoveUserIDs(ids...)
|
|
}
|
|
|
|
// ClearProjects clears all "projects" edges to the Project entity.
|
|
func (_u *GitBotUpdateOne) ClearProjects() *GitBotUpdateOne {
|
|
_u.mutation.ClearProjects()
|
|
return _u
|
|
}
|
|
|
|
// RemoveProjectIDs removes the "projects" edge to Project entities by IDs.
|
|
func (_u *GitBotUpdateOne) RemoveProjectIDs(ids ...uuid.UUID) *GitBotUpdateOne {
|
|
_u.mutation.RemoveProjectIDs(ids...)
|
|
return _u
|
|
}
|
|
|
|
// RemoveProjects removes "projects" edges to Project entities.
|
|
func (_u *GitBotUpdateOne) RemoveProjects(v ...*Project) *GitBotUpdateOne {
|
|
ids := make([]uuid.UUID, len(v))
|
|
for i := range v {
|
|
ids[i] = v[i].ID
|
|
}
|
|
return _u.RemoveProjectIDs(ids...)
|
|
}
|
|
|
|
// ClearGitBotUsers clears all "git_bot_users" edges to the GitBotUser entity.
|
|
func (_u *GitBotUpdateOne) ClearGitBotUsers() *GitBotUpdateOne {
|
|
_u.mutation.ClearGitBotUsers()
|
|
return _u
|
|
}
|
|
|
|
// RemoveGitBotUserIDs removes the "git_bot_users" edge to GitBotUser entities by IDs.
|
|
func (_u *GitBotUpdateOne) RemoveGitBotUserIDs(ids ...uuid.UUID) *GitBotUpdateOne {
|
|
_u.mutation.RemoveGitBotUserIDs(ids...)
|
|
return _u
|
|
}
|
|
|
|
// RemoveGitBotUsers removes "git_bot_users" edges to GitBotUser entities.
|
|
func (_u *GitBotUpdateOne) RemoveGitBotUsers(v ...*GitBotUser) *GitBotUpdateOne {
|
|
ids := make([]uuid.UUID, len(v))
|
|
for i := range v {
|
|
ids[i] = v[i].ID
|
|
}
|
|
return _u.RemoveGitBotUserIDs(ids...)
|
|
}
|
|
|
|
// ClearProjectGitBots clears all "project_git_bots" edges to the ProjectGitBot entity.
|
|
func (_u *GitBotUpdateOne) ClearProjectGitBots() *GitBotUpdateOne {
|
|
_u.mutation.ClearProjectGitBots()
|
|
return _u
|
|
}
|
|
|
|
// RemoveProjectGitBotIDs removes the "project_git_bots" edge to ProjectGitBot entities by IDs.
|
|
func (_u *GitBotUpdateOne) RemoveProjectGitBotIDs(ids ...uuid.UUID) *GitBotUpdateOne {
|
|
_u.mutation.RemoveProjectGitBotIDs(ids...)
|
|
return _u
|
|
}
|
|
|
|
// RemoveProjectGitBots removes "project_git_bots" edges to ProjectGitBot entities.
|
|
func (_u *GitBotUpdateOne) RemoveProjectGitBots(v ...*ProjectGitBot) *GitBotUpdateOne {
|
|
ids := make([]uuid.UUID, len(v))
|
|
for i := range v {
|
|
ids[i] = v[i].ID
|
|
}
|
|
return _u.RemoveProjectGitBotIDs(ids...)
|
|
}
|
|
|
|
// Where appends a list predicates to the GitBotUpdate builder.
|
|
func (_u *GitBotUpdateOne) Where(ps ...predicate.GitBot) *GitBotUpdateOne {
|
|
_u.mutation.Where(ps...)
|
|
return _u
|
|
}
|
|
|
|
// Select allows selecting one or more fields (columns) of the returned entity.
|
|
// The default is selecting all fields defined in the entity schema.
|
|
func (_u *GitBotUpdateOne) Select(field string, fields ...string) *GitBotUpdateOne {
|
|
_u.fields = append([]string{field}, fields...)
|
|
return _u
|
|
}
|
|
|
|
// Save executes the query and returns the updated GitBot entity.
|
|
func (_u *GitBotUpdateOne) Save(ctx context.Context) (*GitBot, error) {
|
|
return withHooks(ctx, _u.sqlSave, _u.mutation, _u.hooks)
|
|
}
|
|
|
|
// SaveX is like Save, but panics if an error occurs.
|
|
func (_u *GitBotUpdateOne) SaveX(ctx context.Context) *GitBot {
|
|
node, err := _u.Save(ctx)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return node
|
|
}
|
|
|
|
// Exec executes the query on the entity.
|
|
func (_u *GitBotUpdateOne) Exec(ctx context.Context) error {
|
|
_, err := _u.Save(ctx)
|
|
return err
|
|
}
|
|
|
|
// ExecX is like Exec, but panics if an error occurs.
|
|
func (_u *GitBotUpdateOne) ExecX(ctx context.Context) {
|
|
if err := _u.Exec(ctx); err != nil {
|
|
panic(err)
|
|
}
|
|
}
|
|
|
|
// check runs all checks and user-defined validators on the builder.
|
|
func (_u *GitBotUpdateOne) check() error {
|
|
if _u.mutation.HostCleared() && len(_u.mutation.HostIDs()) > 0 {
|
|
return errors.New(`db: clearing a required unique edge "GitBot.host"`)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
|
|
func (_u *GitBotUpdateOne) Modify(modifiers ...func(u *sql.UpdateBuilder)) *GitBotUpdateOne {
|
|
_u.modifiers = append(_u.modifiers, modifiers...)
|
|
return _u
|
|
}
|
|
|
|
func (_u *GitBotUpdateOne) sqlSave(ctx context.Context) (_node *GitBot, err error) {
|
|
if err := _u.check(); err != nil {
|
|
return _node, err
|
|
}
|
|
_spec := sqlgraph.NewUpdateSpec(gitbot.Table, gitbot.Columns, sqlgraph.NewFieldSpec(gitbot.FieldID, field.TypeUUID))
|
|
id, ok := _u.mutation.ID()
|
|
if !ok {
|
|
return nil, &ValidationError{Name: "id", err: errors.New(`db: missing "GitBot.id" for update`)}
|
|
}
|
|
_spec.Node.ID.Value = id
|
|
if fields := _u.fields; len(fields) > 0 {
|
|
_spec.Node.Columns = make([]string, 0, len(fields))
|
|
_spec.Node.Columns = append(_spec.Node.Columns, gitbot.FieldID)
|
|
for _, f := range fields {
|
|
if !gitbot.ValidColumn(f) {
|
|
return nil, &ValidationError{Name: f, err: fmt.Errorf("db: invalid field %q for query", f)}
|
|
}
|
|
if f != gitbot.FieldID {
|
|
_spec.Node.Columns = append(_spec.Node.Columns, f)
|
|
}
|
|
}
|
|
}
|
|
if ps := _u.mutation.predicates; len(ps) > 0 {
|
|
_spec.Predicate = func(selector *sql.Selector) {
|
|
for i := range ps {
|
|
ps[i](selector)
|
|
}
|
|
}
|
|
}
|
|
if value, ok := _u.mutation.DeletedAt(); ok {
|
|
_spec.SetField(gitbot.FieldDeletedAt, field.TypeTime, value)
|
|
}
|
|
if _u.mutation.DeletedAtCleared() {
|
|
_spec.ClearField(gitbot.FieldDeletedAt, field.TypeTime)
|
|
}
|
|
if value, ok := _u.mutation.UserID(); ok {
|
|
_spec.SetField(gitbot.FieldUserID, field.TypeUUID, value)
|
|
}
|
|
if value, ok := _u.mutation.Name(); ok {
|
|
_spec.SetField(gitbot.FieldName, field.TypeString, value)
|
|
}
|
|
if _u.mutation.NameCleared() {
|
|
_spec.ClearField(gitbot.FieldName, field.TypeString)
|
|
}
|
|
if value, ok := _u.mutation.Token(); ok {
|
|
_spec.SetField(gitbot.FieldToken, field.TypeString, value)
|
|
}
|
|
if _u.mutation.TokenCleared() {
|
|
_spec.ClearField(gitbot.FieldToken, field.TypeString)
|
|
}
|
|
if value, ok := _u.mutation.SecretToken(); ok {
|
|
_spec.SetField(gitbot.FieldSecretToken, field.TypeString, value)
|
|
}
|
|
if _u.mutation.SecretTokenCleared() {
|
|
_spec.ClearField(gitbot.FieldSecretToken, field.TypeString)
|
|
}
|
|
if value, ok := _u.mutation.Platform(); ok {
|
|
_spec.SetField(gitbot.FieldPlatform, field.TypeString, value)
|
|
}
|
|
if value, ok := _u.mutation.CreatedAt(); ok {
|
|
_spec.SetField(gitbot.FieldCreatedAt, field.TypeTime, value)
|
|
}
|
|
if _u.mutation.GitBotTasksCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: false,
|
|
Table: gitbot.GitBotTasksTable,
|
|
Columns: []string{gitbot.GitBotTasksColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(gitbottask.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := _u.mutation.RemovedGitBotTasksIDs(); len(nodes) > 0 && !_u.mutation.GitBotTasksCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: false,
|
|
Table: gitbot.GitBotTasksTable,
|
|
Columns: []string{gitbot.GitBotTasksColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(gitbottask.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := _u.mutation.GitBotTasksIDs(); len(nodes) > 0 {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: false,
|
|
Table: gitbot.GitBotTasksTable,
|
|
Columns: []string{gitbot.GitBotTasksColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(gitbottask.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
|
}
|
|
if _u.mutation.HostCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.M2O,
|
|
Inverse: true,
|
|
Table: gitbot.HostTable,
|
|
Columns: []string{gitbot.HostColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(host.FieldID, field.TypeString),
|
|
},
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := _u.mutation.HostIDs(); len(nodes) > 0 {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.M2O,
|
|
Inverse: true,
|
|
Table: gitbot.HostTable,
|
|
Columns: []string{gitbot.HostColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(host.FieldID, field.TypeString),
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
|
}
|
|
if _u.mutation.UsersCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.M2M,
|
|
Inverse: true,
|
|
Table: gitbot.UsersTable,
|
|
Columns: gitbot.UsersPrimaryKey,
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
createE := &GitBotUserCreate{config: _u.config, mutation: newGitBotUserMutation(_u.config, OpCreate)}
|
|
createE.defaults()
|
|
_, specE := createE.createSpec()
|
|
edge.Target.Fields = specE.Fields
|
|
if specE.ID.Value != nil {
|
|
edge.Target.Fields = append(edge.Target.Fields, specE.ID)
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := _u.mutation.RemovedUsersIDs(); len(nodes) > 0 && !_u.mutation.UsersCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.M2M,
|
|
Inverse: true,
|
|
Table: gitbot.UsersTable,
|
|
Columns: gitbot.UsersPrimaryKey,
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
createE := &GitBotUserCreate{config: _u.config, mutation: newGitBotUserMutation(_u.config, OpCreate)}
|
|
createE.defaults()
|
|
_, specE := createE.createSpec()
|
|
edge.Target.Fields = specE.Fields
|
|
if specE.ID.Value != nil {
|
|
edge.Target.Fields = append(edge.Target.Fields, specE.ID)
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := _u.mutation.UsersIDs(); len(nodes) > 0 {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.M2M,
|
|
Inverse: true,
|
|
Table: gitbot.UsersTable,
|
|
Columns: gitbot.UsersPrimaryKey,
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(user.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
createE := &GitBotUserCreate{config: _u.config, mutation: newGitBotUserMutation(_u.config, OpCreate)}
|
|
createE.defaults()
|
|
_, specE := createE.createSpec()
|
|
edge.Target.Fields = specE.Fields
|
|
if specE.ID.Value != nil {
|
|
edge.Target.Fields = append(edge.Target.Fields, specE.ID)
|
|
}
|
|
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
|
}
|
|
if _u.mutation.ProjectsCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.M2M,
|
|
Inverse: true,
|
|
Table: gitbot.ProjectsTable,
|
|
Columns: gitbot.ProjectsPrimaryKey,
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(project.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
createE := &ProjectGitBotCreate{config: _u.config, mutation: newProjectGitBotMutation(_u.config, OpCreate)}
|
|
createE.defaults()
|
|
_, specE := createE.createSpec()
|
|
edge.Target.Fields = specE.Fields
|
|
if specE.ID.Value != nil {
|
|
edge.Target.Fields = append(edge.Target.Fields, specE.ID)
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := _u.mutation.RemovedProjectsIDs(); len(nodes) > 0 && !_u.mutation.ProjectsCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.M2M,
|
|
Inverse: true,
|
|
Table: gitbot.ProjectsTable,
|
|
Columns: gitbot.ProjectsPrimaryKey,
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(project.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
createE := &ProjectGitBotCreate{config: _u.config, mutation: newProjectGitBotMutation(_u.config, OpCreate)}
|
|
createE.defaults()
|
|
_, specE := createE.createSpec()
|
|
edge.Target.Fields = specE.Fields
|
|
if specE.ID.Value != nil {
|
|
edge.Target.Fields = append(edge.Target.Fields, specE.ID)
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := _u.mutation.ProjectsIDs(); len(nodes) > 0 {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.M2M,
|
|
Inverse: true,
|
|
Table: gitbot.ProjectsTable,
|
|
Columns: gitbot.ProjectsPrimaryKey,
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(project.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
createE := &ProjectGitBotCreate{config: _u.config, mutation: newProjectGitBotMutation(_u.config, OpCreate)}
|
|
createE.defaults()
|
|
_, specE := createE.createSpec()
|
|
edge.Target.Fields = specE.Fields
|
|
if specE.ID.Value != nil {
|
|
edge.Target.Fields = append(edge.Target.Fields, specE.ID)
|
|
}
|
|
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
|
}
|
|
if _u.mutation.GitBotUsersCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: true,
|
|
Table: gitbot.GitBotUsersTable,
|
|
Columns: []string{gitbot.GitBotUsersColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(gitbotuser.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := _u.mutation.RemovedGitBotUsersIDs(); len(nodes) > 0 && !_u.mutation.GitBotUsersCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: true,
|
|
Table: gitbot.GitBotUsersTable,
|
|
Columns: []string{gitbot.GitBotUsersColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(gitbotuser.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := _u.mutation.GitBotUsersIDs(); len(nodes) > 0 {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: true,
|
|
Table: gitbot.GitBotUsersTable,
|
|
Columns: []string{gitbot.GitBotUsersColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(gitbotuser.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
|
}
|
|
if _u.mutation.ProjectGitBotsCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: true,
|
|
Table: gitbot.ProjectGitBotsTable,
|
|
Columns: []string{gitbot.ProjectGitBotsColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(projectgitbot.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := _u.mutation.RemovedProjectGitBotsIDs(); len(nodes) > 0 && !_u.mutation.ProjectGitBotsCleared() {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: true,
|
|
Table: gitbot.ProjectGitBotsTable,
|
|
Columns: []string{gitbot.ProjectGitBotsColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(projectgitbot.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
|
|
}
|
|
if nodes := _u.mutation.ProjectGitBotsIDs(); len(nodes) > 0 {
|
|
edge := &sqlgraph.EdgeSpec{
|
|
Rel: sqlgraph.O2M,
|
|
Inverse: true,
|
|
Table: gitbot.ProjectGitBotsTable,
|
|
Columns: []string{gitbot.ProjectGitBotsColumn},
|
|
Bidi: false,
|
|
Target: &sqlgraph.EdgeTarget{
|
|
IDSpec: sqlgraph.NewFieldSpec(projectgitbot.FieldID, field.TypeUUID),
|
|
},
|
|
}
|
|
for _, k := range nodes {
|
|
edge.Target.Nodes = append(edge.Target.Nodes, k)
|
|
}
|
|
_spec.Edges.Add = append(_spec.Edges.Add, edge)
|
|
}
|
|
_spec.AddModifiers(_u.modifiers...)
|
|
_node = &GitBot{config: _u.config}
|
|
_spec.Assign = _node.assignValues
|
|
_spec.ScanValues = _node.scanValues
|
|
if err = sqlgraph.UpdateNode(ctx, _u.driver, _spec); err != nil {
|
|
if _, ok := err.(*sqlgraph.NotFoundError); ok {
|
|
err = &NotFoundError{gitbot.Label}
|
|
} else if sqlgraph.IsConstraintError(err) {
|
|
err = &ConstraintError{msg: err.Error(), wrap: err}
|
|
}
|
|
return nil, err
|
|
}
|
|
_u.mutation.done = true
|
|
return _node, nil
|
|
}
|