// Code generated by ent, DO NOT EDIT. package ent import ( "context" "errors" "fmt" "time" "entgo.io/ent/dialect/sql" "entgo.io/ent/dialect/sql/sqlgraph" "entgo.io/ent/schema/field" "github.com/Wei-Shaw/sub2api/ent/soraaccount" ) // SoraAccountCreate is the builder for creating a SoraAccount entity. type SoraAccountCreate struct { config mutation *SoraAccountMutation hooks []Hook conflict []sql.ConflictOption } // SetCreatedAt sets the "created_at" field. func (_c *SoraAccountCreate) SetCreatedAt(v time.Time) *SoraAccountCreate { _c.mutation.SetCreatedAt(v) return _c } // SetNillableCreatedAt sets the "created_at" field if the given value is not nil. func (_c *SoraAccountCreate) SetNillableCreatedAt(v *time.Time) *SoraAccountCreate { if v != nil { _c.SetCreatedAt(*v) } return _c } // SetUpdatedAt sets the "updated_at" field. func (_c *SoraAccountCreate) SetUpdatedAt(v time.Time) *SoraAccountCreate { _c.mutation.SetUpdatedAt(v) return _c } // SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil. func (_c *SoraAccountCreate) SetNillableUpdatedAt(v *time.Time) *SoraAccountCreate { if v != nil { _c.SetUpdatedAt(*v) } return _c } // SetAccountID sets the "account_id" field. func (_c *SoraAccountCreate) SetAccountID(v int64) *SoraAccountCreate { _c.mutation.SetAccountID(v) return _c } // SetAccessToken sets the "access_token" field. func (_c *SoraAccountCreate) SetAccessToken(v string) *SoraAccountCreate { _c.mutation.SetAccessToken(v) return _c } // SetNillableAccessToken sets the "access_token" field if the given value is not nil. func (_c *SoraAccountCreate) SetNillableAccessToken(v *string) *SoraAccountCreate { if v != nil { _c.SetAccessToken(*v) } return _c } // SetSessionToken sets the "session_token" field. func (_c *SoraAccountCreate) SetSessionToken(v string) *SoraAccountCreate { _c.mutation.SetSessionToken(v) return _c } // SetNillableSessionToken sets the "session_token" field if the given value is not nil. func (_c *SoraAccountCreate) SetNillableSessionToken(v *string) *SoraAccountCreate { if v != nil { _c.SetSessionToken(*v) } return _c } // SetRefreshToken sets the "refresh_token" field. func (_c *SoraAccountCreate) SetRefreshToken(v string) *SoraAccountCreate { _c.mutation.SetRefreshToken(v) return _c } // SetNillableRefreshToken sets the "refresh_token" field if the given value is not nil. func (_c *SoraAccountCreate) SetNillableRefreshToken(v *string) *SoraAccountCreate { if v != nil { _c.SetRefreshToken(*v) } return _c } // SetClientID sets the "client_id" field. func (_c *SoraAccountCreate) SetClientID(v string) *SoraAccountCreate { _c.mutation.SetClientID(v) return _c } // SetNillableClientID sets the "client_id" field if the given value is not nil. func (_c *SoraAccountCreate) SetNillableClientID(v *string) *SoraAccountCreate { if v != nil { _c.SetClientID(*v) } return _c } // SetEmail sets the "email" field. func (_c *SoraAccountCreate) SetEmail(v string) *SoraAccountCreate { _c.mutation.SetEmail(v) return _c } // SetNillableEmail sets the "email" field if the given value is not nil. func (_c *SoraAccountCreate) SetNillableEmail(v *string) *SoraAccountCreate { if v != nil { _c.SetEmail(*v) } return _c } // SetUsername sets the "username" field. func (_c *SoraAccountCreate) SetUsername(v string) *SoraAccountCreate { _c.mutation.SetUsername(v) return _c } // SetNillableUsername sets the "username" field if the given value is not nil. func (_c *SoraAccountCreate) SetNillableUsername(v *string) *SoraAccountCreate { if v != nil { _c.SetUsername(*v) } return _c } // SetRemark sets the "remark" field. func (_c *SoraAccountCreate) SetRemark(v string) *SoraAccountCreate { _c.mutation.SetRemark(v) return _c } // SetNillableRemark sets the "remark" field if the given value is not nil. func (_c *SoraAccountCreate) SetNillableRemark(v *string) *SoraAccountCreate { if v != nil { _c.SetRemark(*v) } return _c } // SetUseCount sets the "use_count" field. func (_c *SoraAccountCreate) SetUseCount(v int) *SoraAccountCreate { _c.mutation.SetUseCount(v) return _c } // SetNillableUseCount sets the "use_count" field if the given value is not nil. func (_c *SoraAccountCreate) SetNillableUseCount(v *int) *SoraAccountCreate { if v != nil { _c.SetUseCount(*v) } return _c } // SetPlanType sets the "plan_type" field. func (_c *SoraAccountCreate) SetPlanType(v string) *SoraAccountCreate { _c.mutation.SetPlanType(v) return _c } // SetNillablePlanType sets the "plan_type" field if the given value is not nil. func (_c *SoraAccountCreate) SetNillablePlanType(v *string) *SoraAccountCreate { if v != nil { _c.SetPlanType(*v) } return _c } // SetPlanTitle sets the "plan_title" field. func (_c *SoraAccountCreate) SetPlanTitle(v string) *SoraAccountCreate { _c.mutation.SetPlanTitle(v) return _c } // SetNillablePlanTitle sets the "plan_title" field if the given value is not nil. func (_c *SoraAccountCreate) SetNillablePlanTitle(v *string) *SoraAccountCreate { if v != nil { _c.SetPlanTitle(*v) } return _c } // SetSubscriptionEnd sets the "subscription_end" field. func (_c *SoraAccountCreate) SetSubscriptionEnd(v time.Time) *SoraAccountCreate { _c.mutation.SetSubscriptionEnd(v) return _c } // SetNillableSubscriptionEnd sets the "subscription_end" field if the given value is not nil. func (_c *SoraAccountCreate) SetNillableSubscriptionEnd(v *time.Time) *SoraAccountCreate { if v != nil { _c.SetSubscriptionEnd(*v) } return _c } // SetSoraSupported sets the "sora_supported" field. func (_c *SoraAccountCreate) SetSoraSupported(v bool) *SoraAccountCreate { _c.mutation.SetSoraSupported(v) return _c } // SetNillableSoraSupported sets the "sora_supported" field if the given value is not nil. func (_c *SoraAccountCreate) SetNillableSoraSupported(v *bool) *SoraAccountCreate { if v != nil { _c.SetSoraSupported(*v) } return _c } // SetSoraInviteCode sets the "sora_invite_code" field. func (_c *SoraAccountCreate) SetSoraInviteCode(v string) *SoraAccountCreate { _c.mutation.SetSoraInviteCode(v) return _c } // SetNillableSoraInviteCode sets the "sora_invite_code" field if the given value is not nil. func (_c *SoraAccountCreate) SetNillableSoraInviteCode(v *string) *SoraAccountCreate { if v != nil { _c.SetSoraInviteCode(*v) } return _c } // SetSoraRedeemedCount sets the "sora_redeemed_count" field. func (_c *SoraAccountCreate) SetSoraRedeemedCount(v int) *SoraAccountCreate { _c.mutation.SetSoraRedeemedCount(v) return _c } // SetNillableSoraRedeemedCount sets the "sora_redeemed_count" field if the given value is not nil. func (_c *SoraAccountCreate) SetNillableSoraRedeemedCount(v *int) *SoraAccountCreate { if v != nil { _c.SetSoraRedeemedCount(*v) } return _c } // SetSoraRemainingCount sets the "sora_remaining_count" field. func (_c *SoraAccountCreate) SetSoraRemainingCount(v int) *SoraAccountCreate { _c.mutation.SetSoraRemainingCount(v) return _c } // SetNillableSoraRemainingCount sets the "sora_remaining_count" field if the given value is not nil. func (_c *SoraAccountCreate) SetNillableSoraRemainingCount(v *int) *SoraAccountCreate { if v != nil { _c.SetSoraRemainingCount(*v) } return _c } // SetSoraTotalCount sets the "sora_total_count" field. func (_c *SoraAccountCreate) SetSoraTotalCount(v int) *SoraAccountCreate { _c.mutation.SetSoraTotalCount(v) return _c } // SetNillableSoraTotalCount sets the "sora_total_count" field if the given value is not nil. func (_c *SoraAccountCreate) SetNillableSoraTotalCount(v *int) *SoraAccountCreate { if v != nil { _c.SetSoraTotalCount(*v) } return _c } // SetSoraCooldownUntil sets the "sora_cooldown_until" field. func (_c *SoraAccountCreate) SetSoraCooldownUntil(v time.Time) *SoraAccountCreate { _c.mutation.SetSoraCooldownUntil(v) return _c } // SetNillableSoraCooldownUntil sets the "sora_cooldown_until" field if the given value is not nil. func (_c *SoraAccountCreate) SetNillableSoraCooldownUntil(v *time.Time) *SoraAccountCreate { if v != nil { _c.SetSoraCooldownUntil(*v) } return _c } // SetCooledUntil sets the "cooled_until" field. func (_c *SoraAccountCreate) SetCooledUntil(v time.Time) *SoraAccountCreate { _c.mutation.SetCooledUntil(v) return _c } // SetNillableCooledUntil sets the "cooled_until" field if the given value is not nil. func (_c *SoraAccountCreate) SetNillableCooledUntil(v *time.Time) *SoraAccountCreate { if v != nil { _c.SetCooledUntil(*v) } return _c } // SetImageEnabled sets the "image_enabled" field. func (_c *SoraAccountCreate) SetImageEnabled(v bool) *SoraAccountCreate { _c.mutation.SetImageEnabled(v) return _c } // SetNillableImageEnabled sets the "image_enabled" field if the given value is not nil. func (_c *SoraAccountCreate) SetNillableImageEnabled(v *bool) *SoraAccountCreate { if v != nil { _c.SetImageEnabled(*v) } return _c } // SetVideoEnabled sets the "video_enabled" field. func (_c *SoraAccountCreate) SetVideoEnabled(v bool) *SoraAccountCreate { _c.mutation.SetVideoEnabled(v) return _c } // SetNillableVideoEnabled sets the "video_enabled" field if the given value is not nil. func (_c *SoraAccountCreate) SetNillableVideoEnabled(v *bool) *SoraAccountCreate { if v != nil { _c.SetVideoEnabled(*v) } return _c } // SetImageConcurrency sets the "image_concurrency" field. func (_c *SoraAccountCreate) SetImageConcurrency(v int) *SoraAccountCreate { _c.mutation.SetImageConcurrency(v) return _c } // SetNillableImageConcurrency sets the "image_concurrency" field if the given value is not nil. func (_c *SoraAccountCreate) SetNillableImageConcurrency(v *int) *SoraAccountCreate { if v != nil { _c.SetImageConcurrency(*v) } return _c } // SetVideoConcurrency sets the "video_concurrency" field. func (_c *SoraAccountCreate) SetVideoConcurrency(v int) *SoraAccountCreate { _c.mutation.SetVideoConcurrency(v) return _c } // SetNillableVideoConcurrency sets the "video_concurrency" field if the given value is not nil. func (_c *SoraAccountCreate) SetNillableVideoConcurrency(v *int) *SoraAccountCreate { if v != nil { _c.SetVideoConcurrency(*v) } return _c } // SetIsExpired sets the "is_expired" field. func (_c *SoraAccountCreate) SetIsExpired(v bool) *SoraAccountCreate { _c.mutation.SetIsExpired(v) return _c } // SetNillableIsExpired sets the "is_expired" field if the given value is not nil. func (_c *SoraAccountCreate) SetNillableIsExpired(v *bool) *SoraAccountCreate { if v != nil { _c.SetIsExpired(*v) } return _c } // Mutation returns the SoraAccountMutation object of the builder. func (_c *SoraAccountCreate) Mutation() *SoraAccountMutation { return _c.mutation } // Save creates the SoraAccount in the database. func (_c *SoraAccountCreate) Save(ctx context.Context) (*SoraAccount, error) { _c.defaults() return withHooks(ctx, _c.sqlSave, _c.mutation, _c.hooks) } // SaveX calls Save and panics if Save returns an error. func (_c *SoraAccountCreate) SaveX(ctx context.Context) *SoraAccount { v, err := _c.Save(ctx) if err != nil { panic(err) } return v } // Exec executes the query. func (_c *SoraAccountCreate) Exec(ctx context.Context) error { _, err := _c.Save(ctx) return err } // ExecX is like Exec, but panics if an error occurs. func (_c *SoraAccountCreate) ExecX(ctx context.Context) { if err := _c.Exec(ctx); err != nil { panic(err) } } // defaults sets the default values of the builder before save. func (_c *SoraAccountCreate) defaults() { if _, ok := _c.mutation.CreatedAt(); !ok { v := soraaccount.DefaultCreatedAt() _c.mutation.SetCreatedAt(v) } if _, ok := _c.mutation.UpdatedAt(); !ok { v := soraaccount.DefaultUpdatedAt() _c.mutation.SetUpdatedAt(v) } if _, ok := _c.mutation.UseCount(); !ok { v := soraaccount.DefaultUseCount _c.mutation.SetUseCount(v) } if _, ok := _c.mutation.SoraSupported(); !ok { v := soraaccount.DefaultSoraSupported _c.mutation.SetSoraSupported(v) } if _, ok := _c.mutation.SoraRedeemedCount(); !ok { v := soraaccount.DefaultSoraRedeemedCount _c.mutation.SetSoraRedeemedCount(v) } if _, ok := _c.mutation.SoraRemainingCount(); !ok { v := soraaccount.DefaultSoraRemainingCount _c.mutation.SetSoraRemainingCount(v) } if _, ok := _c.mutation.SoraTotalCount(); !ok { v := soraaccount.DefaultSoraTotalCount _c.mutation.SetSoraTotalCount(v) } if _, ok := _c.mutation.ImageEnabled(); !ok { v := soraaccount.DefaultImageEnabled _c.mutation.SetImageEnabled(v) } if _, ok := _c.mutation.VideoEnabled(); !ok { v := soraaccount.DefaultVideoEnabled _c.mutation.SetVideoEnabled(v) } if _, ok := _c.mutation.ImageConcurrency(); !ok { v := soraaccount.DefaultImageConcurrency _c.mutation.SetImageConcurrency(v) } if _, ok := _c.mutation.VideoConcurrency(); !ok { v := soraaccount.DefaultVideoConcurrency _c.mutation.SetVideoConcurrency(v) } if _, ok := _c.mutation.IsExpired(); !ok { v := soraaccount.DefaultIsExpired _c.mutation.SetIsExpired(v) } } // check runs all checks and user-defined validators on the builder. func (_c *SoraAccountCreate) check() error { if _, ok := _c.mutation.CreatedAt(); !ok { return &ValidationError{Name: "created_at", err: errors.New(`ent: missing required field "SoraAccount.created_at"`)} } if _, ok := _c.mutation.UpdatedAt(); !ok { return &ValidationError{Name: "updated_at", err: errors.New(`ent: missing required field "SoraAccount.updated_at"`)} } if _, ok := _c.mutation.AccountID(); !ok { return &ValidationError{Name: "account_id", err: errors.New(`ent: missing required field "SoraAccount.account_id"`)} } if _, ok := _c.mutation.UseCount(); !ok { return &ValidationError{Name: "use_count", err: errors.New(`ent: missing required field "SoraAccount.use_count"`)} } if _, ok := _c.mutation.SoraSupported(); !ok { return &ValidationError{Name: "sora_supported", err: errors.New(`ent: missing required field "SoraAccount.sora_supported"`)} } if _, ok := _c.mutation.SoraRedeemedCount(); !ok { return &ValidationError{Name: "sora_redeemed_count", err: errors.New(`ent: missing required field "SoraAccount.sora_redeemed_count"`)} } if _, ok := _c.mutation.SoraRemainingCount(); !ok { return &ValidationError{Name: "sora_remaining_count", err: errors.New(`ent: missing required field "SoraAccount.sora_remaining_count"`)} } if _, ok := _c.mutation.SoraTotalCount(); !ok { return &ValidationError{Name: "sora_total_count", err: errors.New(`ent: missing required field "SoraAccount.sora_total_count"`)} } if _, ok := _c.mutation.ImageEnabled(); !ok { return &ValidationError{Name: "image_enabled", err: errors.New(`ent: missing required field "SoraAccount.image_enabled"`)} } if _, ok := _c.mutation.VideoEnabled(); !ok { return &ValidationError{Name: "video_enabled", err: errors.New(`ent: missing required field "SoraAccount.video_enabled"`)} } if _, ok := _c.mutation.ImageConcurrency(); !ok { return &ValidationError{Name: "image_concurrency", err: errors.New(`ent: missing required field "SoraAccount.image_concurrency"`)} } if _, ok := _c.mutation.VideoConcurrency(); !ok { return &ValidationError{Name: "video_concurrency", err: errors.New(`ent: missing required field "SoraAccount.video_concurrency"`)} } if _, ok := _c.mutation.IsExpired(); !ok { return &ValidationError{Name: "is_expired", err: errors.New(`ent: missing required field "SoraAccount.is_expired"`)} } return nil } func (_c *SoraAccountCreate) sqlSave(ctx context.Context) (*SoraAccount, error) { if err := _c.check(); err != nil { return nil, err } _node, _spec := _c.createSpec() if err := sqlgraph.CreateNode(ctx, _c.driver, _spec); err != nil { if sqlgraph.IsConstraintError(err) { err = &ConstraintError{msg: err.Error(), wrap: err} } return nil, err } id := _spec.ID.Value.(int64) _node.ID = int64(id) _c.mutation.id = &_node.ID _c.mutation.done = true return _node, nil } func (_c *SoraAccountCreate) createSpec() (*SoraAccount, *sqlgraph.CreateSpec) { var ( _node = &SoraAccount{config: _c.config} _spec = sqlgraph.NewCreateSpec(soraaccount.Table, sqlgraph.NewFieldSpec(soraaccount.FieldID, field.TypeInt64)) ) _spec.OnConflict = _c.conflict if value, ok := _c.mutation.CreatedAt(); ok { _spec.SetField(soraaccount.FieldCreatedAt, field.TypeTime, value) _node.CreatedAt = value } if value, ok := _c.mutation.UpdatedAt(); ok { _spec.SetField(soraaccount.FieldUpdatedAt, field.TypeTime, value) _node.UpdatedAt = value } if value, ok := _c.mutation.AccountID(); ok { _spec.SetField(soraaccount.FieldAccountID, field.TypeInt64, value) _node.AccountID = value } if value, ok := _c.mutation.AccessToken(); ok { _spec.SetField(soraaccount.FieldAccessToken, field.TypeString, value) _node.AccessToken = &value } if value, ok := _c.mutation.SessionToken(); ok { _spec.SetField(soraaccount.FieldSessionToken, field.TypeString, value) _node.SessionToken = &value } if value, ok := _c.mutation.RefreshToken(); ok { _spec.SetField(soraaccount.FieldRefreshToken, field.TypeString, value) _node.RefreshToken = &value } if value, ok := _c.mutation.ClientID(); ok { _spec.SetField(soraaccount.FieldClientID, field.TypeString, value) _node.ClientID = &value } if value, ok := _c.mutation.Email(); ok { _spec.SetField(soraaccount.FieldEmail, field.TypeString, value) _node.Email = &value } if value, ok := _c.mutation.Username(); ok { _spec.SetField(soraaccount.FieldUsername, field.TypeString, value) _node.Username = &value } if value, ok := _c.mutation.Remark(); ok { _spec.SetField(soraaccount.FieldRemark, field.TypeString, value) _node.Remark = &value } if value, ok := _c.mutation.UseCount(); ok { _spec.SetField(soraaccount.FieldUseCount, field.TypeInt, value) _node.UseCount = value } if value, ok := _c.mutation.PlanType(); ok { _spec.SetField(soraaccount.FieldPlanType, field.TypeString, value) _node.PlanType = &value } if value, ok := _c.mutation.PlanTitle(); ok { _spec.SetField(soraaccount.FieldPlanTitle, field.TypeString, value) _node.PlanTitle = &value } if value, ok := _c.mutation.SubscriptionEnd(); ok { _spec.SetField(soraaccount.FieldSubscriptionEnd, field.TypeTime, value) _node.SubscriptionEnd = &value } if value, ok := _c.mutation.SoraSupported(); ok { _spec.SetField(soraaccount.FieldSoraSupported, field.TypeBool, value) _node.SoraSupported = value } if value, ok := _c.mutation.SoraInviteCode(); ok { _spec.SetField(soraaccount.FieldSoraInviteCode, field.TypeString, value) _node.SoraInviteCode = &value } if value, ok := _c.mutation.SoraRedeemedCount(); ok { _spec.SetField(soraaccount.FieldSoraRedeemedCount, field.TypeInt, value) _node.SoraRedeemedCount = value } if value, ok := _c.mutation.SoraRemainingCount(); ok { _spec.SetField(soraaccount.FieldSoraRemainingCount, field.TypeInt, value) _node.SoraRemainingCount = value } if value, ok := _c.mutation.SoraTotalCount(); ok { _spec.SetField(soraaccount.FieldSoraTotalCount, field.TypeInt, value) _node.SoraTotalCount = value } if value, ok := _c.mutation.SoraCooldownUntil(); ok { _spec.SetField(soraaccount.FieldSoraCooldownUntil, field.TypeTime, value) _node.SoraCooldownUntil = &value } if value, ok := _c.mutation.CooledUntil(); ok { _spec.SetField(soraaccount.FieldCooledUntil, field.TypeTime, value) _node.CooledUntil = &value } if value, ok := _c.mutation.ImageEnabled(); ok { _spec.SetField(soraaccount.FieldImageEnabled, field.TypeBool, value) _node.ImageEnabled = value } if value, ok := _c.mutation.VideoEnabled(); ok { _spec.SetField(soraaccount.FieldVideoEnabled, field.TypeBool, value) _node.VideoEnabled = value } if value, ok := _c.mutation.ImageConcurrency(); ok { _spec.SetField(soraaccount.FieldImageConcurrency, field.TypeInt, value) _node.ImageConcurrency = value } if value, ok := _c.mutation.VideoConcurrency(); ok { _spec.SetField(soraaccount.FieldVideoConcurrency, field.TypeInt, value) _node.VideoConcurrency = value } if value, ok := _c.mutation.IsExpired(); ok { _spec.SetField(soraaccount.FieldIsExpired, field.TypeBool, value) _node.IsExpired = value } return _node, _spec } // OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause // of the `INSERT` statement. For example: // // client.SoraAccount.Create(). // SetCreatedAt(v). // OnConflict( // // Update the row with the new values // // the was proposed for insertion. // sql.ResolveWithNewValues(), // ). // // Override some of the fields with custom // // update values. // Update(func(u *ent.SoraAccountUpsert) { // SetCreatedAt(v+v). // }). // Exec(ctx) func (_c *SoraAccountCreate) OnConflict(opts ...sql.ConflictOption) *SoraAccountUpsertOne { _c.conflict = opts return &SoraAccountUpsertOne{ create: _c, } } // OnConflictColumns calls `OnConflict` and configures the columns // as conflict target. Using this option is equivalent to using: // // client.SoraAccount.Create(). // OnConflict(sql.ConflictColumns(columns...)). // Exec(ctx) func (_c *SoraAccountCreate) OnConflictColumns(columns ...string) *SoraAccountUpsertOne { _c.conflict = append(_c.conflict, sql.ConflictColumns(columns...)) return &SoraAccountUpsertOne{ create: _c, } } type ( // SoraAccountUpsertOne is the builder for "upsert"-ing // one SoraAccount node. SoraAccountUpsertOne struct { create *SoraAccountCreate } // SoraAccountUpsert is the "OnConflict" setter. SoraAccountUpsert struct { *sql.UpdateSet } ) // SetUpdatedAt sets the "updated_at" field. func (u *SoraAccountUpsert) SetUpdatedAt(v time.Time) *SoraAccountUpsert { u.Set(soraaccount.FieldUpdatedAt, v) return u } // UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create. func (u *SoraAccountUpsert) UpdateUpdatedAt() *SoraAccountUpsert { u.SetExcluded(soraaccount.FieldUpdatedAt) return u } // SetAccountID sets the "account_id" field. func (u *SoraAccountUpsert) SetAccountID(v int64) *SoraAccountUpsert { u.Set(soraaccount.FieldAccountID, v) return u } // UpdateAccountID sets the "account_id" field to the value that was provided on create. func (u *SoraAccountUpsert) UpdateAccountID() *SoraAccountUpsert { u.SetExcluded(soraaccount.FieldAccountID) return u } // AddAccountID adds v to the "account_id" field. func (u *SoraAccountUpsert) AddAccountID(v int64) *SoraAccountUpsert { u.Add(soraaccount.FieldAccountID, v) return u } // SetAccessToken sets the "access_token" field. func (u *SoraAccountUpsert) SetAccessToken(v string) *SoraAccountUpsert { u.Set(soraaccount.FieldAccessToken, v) return u } // UpdateAccessToken sets the "access_token" field to the value that was provided on create. func (u *SoraAccountUpsert) UpdateAccessToken() *SoraAccountUpsert { u.SetExcluded(soraaccount.FieldAccessToken) return u } // ClearAccessToken clears the value of the "access_token" field. func (u *SoraAccountUpsert) ClearAccessToken() *SoraAccountUpsert { u.SetNull(soraaccount.FieldAccessToken) return u } // SetSessionToken sets the "session_token" field. func (u *SoraAccountUpsert) SetSessionToken(v string) *SoraAccountUpsert { u.Set(soraaccount.FieldSessionToken, v) return u } // UpdateSessionToken sets the "session_token" field to the value that was provided on create. func (u *SoraAccountUpsert) UpdateSessionToken() *SoraAccountUpsert { u.SetExcluded(soraaccount.FieldSessionToken) return u } // ClearSessionToken clears the value of the "session_token" field. func (u *SoraAccountUpsert) ClearSessionToken() *SoraAccountUpsert { u.SetNull(soraaccount.FieldSessionToken) return u } // SetRefreshToken sets the "refresh_token" field. func (u *SoraAccountUpsert) SetRefreshToken(v string) *SoraAccountUpsert { u.Set(soraaccount.FieldRefreshToken, v) return u } // UpdateRefreshToken sets the "refresh_token" field to the value that was provided on create. func (u *SoraAccountUpsert) UpdateRefreshToken() *SoraAccountUpsert { u.SetExcluded(soraaccount.FieldRefreshToken) return u } // ClearRefreshToken clears the value of the "refresh_token" field. func (u *SoraAccountUpsert) ClearRefreshToken() *SoraAccountUpsert { u.SetNull(soraaccount.FieldRefreshToken) return u } // SetClientID sets the "client_id" field. func (u *SoraAccountUpsert) SetClientID(v string) *SoraAccountUpsert { u.Set(soraaccount.FieldClientID, v) return u } // UpdateClientID sets the "client_id" field to the value that was provided on create. func (u *SoraAccountUpsert) UpdateClientID() *SoraAccountUpsert { u.SetExcluded(soraaccount.FieldClientID) return u } // ClearClientID clears the value of the "client_id" field. func (u *SoraAccountUpsert) ClearClientID() *SoraAccountUpsert { u.SetNull(soraaccount.FieldClientID) return u } // SetEmail sets the "email" field. func (u *SoraAccountUpsert) SetEmail(v string) *SoraAccountUpsert { u.Set(soraaccount.FieldEmail, v) return u } // UpdateEmail sets the "email" field to the value that was provided on create. func (u *SoraAccountUpsert) UpdateEmail() *SoraAccountUpsert { u.SetExcluded(soraaccount.FieldEmail) return u } // ClearEmail clears the value of the "email" field. func (u *SoraAccountUpsert) ClearEmail() *SoraAccountUpsert { u.SetNull(soraaccount.FieldEmail) return u } // SetUsername sets the "username" field. func (u *SoraAccountUpsert) SetUsername(v string) *SoraAccountUpsert { u.Set(soraaccount.FieldUsername, v) return u } // UpdateUsername sets the "username" field to the value that was provided on create. func (u *SoraAccountUpsert) UpdateUsername() *SoraAccountUpsert { u.SetExcluded(soraaccount.FieldUsername) return u } // ClearUsername clears the value of the "username" field. func (u *SoraAccountUpsert) ClearUsername() *SoraAccountUpsert { u.SetNull(soraaccount.FieldUsername) return u } // SetRemark sets the "remark" field. func (u *SoraAccountUpsert) SetRemark(v string) *SoraAccountUpsert { u.Set(soraaccount.FieldRemark, v) return u } // UpdateRemark sets the "remark" field to the value that was provided on create. func (u *SoraAccountUpsert) UpdateRemark() *SoraAccountUpsert { u.SetExcluded(soraaccount.FieldRemark) return u } // ClearRemark clears the value of the "remark" field. func (u *SoraAccountUpsert) ClearRemark() *SoraAccountUpsert { u.SetNull(soraaccount.FieldRemark) return u } // SetUseCount sets the "use_count" field. func (u *SoraAccountUpsert) SetUseCount(v int) *SoraAccountUpsert { u.Set(soraaccount.FieldUseCount, v) return u } // UpdateUseCount sets the "use_count" field to the value that was provided on create. func (u *SoraAccountUpsert) UpdateUseCount() *SoraAccountUpsert { u.SetExcluded(soraaccount.FieldUseCount) return u } // AddUseCount adds v to the "use_count" field. func (u *SoraAccountUpsert) AddUseCount(v int) *SoraAccountUpsert { u.Add(soraaccount.FieldUseCount, v) return u } // SetPlanType sets the "plan_type" field. func (u *SoraAccountUpsert) SetPlanType(v string) *SoraAccountUpsert { u.Set(soraaccount.FieldPlanType, v) return u } // UpdatePlanType sets the "plan_type" field to the value that was provided on create. func (u *SoraAccountUpsert) UpdatePlanType() *SoraAccountUpsert { u.SetExcluded(soraaccount.FieldPlanType) return u } // ClearPlanType clears the value of the "plan_type" field. func (u *SoraAccountUpsert) ClearPlanType() *SoraAccountUpsert { u.SetNull(soraaccount.FieldPlanType) return u } // SetPlanTitle sets the "plan_title" field. func (u *SoraAccountUpsert) SetPlanTitle(v string) *SoraAccountUpsert { u.Set(soraaccount.FieldPlanTitle, v) return u } // UpdatePlanTitle sets the "plan_title" field to the value that was provided on create. func (u *SoraAccountUpsert) UpdatePlanTitle() *SoraAccountUpsert { u.SetExcluded(soraaccount.FieldPlanTitle) return u } // ClearPlanTitle clears the value of the "plan_title" field. func (u *SoraAccountUpsert) ClearPlanTitle() *SoraAccountUpsert { u.SetNull(soraaccount.FieldPlanTitle) return u } // SetSubscriptionEnd sets the "subscription_end" field. func (u *SoraAccountUpsert) SetSubscriptionEnd(v time.Time) *SoraAccountUpsert { u.Set(soraaccount.FieldSubscriptionEnd, v) return u } // UpdateSubscriptionEnd sets the "subscription_end" field to the value that was provided on create. func (u *SoraAccountUpsert) UpdateSubscriptionEnd() *SoraAccountUpsert { u.SetExcluded(soraaccount.FieldSubscriptionEnd) return u } // ClearSubscriptionEnd clears the value of the "subscription_end" field. func (u *SoraAccountUpsert) ClearSubscriptionEnd() *SoraAccountUpsert { u.SetNull(soraaccount.FieldSubscriptionEnd) return u } // SetSoraSupported sets the "sora_supported" field. func (u *SoraAccountUpsert) SetSoraSupported(v bool) *SoraAccountUpsert { u.Set(soraaccount.FieldSoraSupported, v) return u } // UpdateSoraSupported sets the "sora_supported" field to the value that was provided on create. func (u *SoraAccountUpsert) UpdateSoraSupported() *SoraAccountUpsert { u.SetExcluded(soraaccount.FieldSoraSupported) return u } // SetSoraInviteCode sets the "sora_invite_code" field. func (u *SoraAccountUpsert) SetSoraInviteCode(v string) *SoraAccountUpsert { u.Set(soraaccount.FieldSoraInviteCode, v) return u } // UpdateSoraInviteCode sets the "sora_invite_code" field to the value that was provided on create. func (u *SoraAccountUpsert) UpdateSoraInviteCode() *SoraAccountUpsert { u.SetExcluded(soraaccount.FieldSoraInviteCode) return u } // ClearSoraInviteCode clears the value of the "sora_invite_code" field. func (u *SoraAccountUpsert) ClearSoraInviteCode() *SoraAccountUpsert { u.SetNull(soraaccount.FieldSoraInviteCode) return u } // SetSoraRedeemedCount sets the "sora_redeemed_count" field. func (u *SoraAccountUpsert) SetSoraRedeemedCount(v int) *SoraAccountUpsert { u.Set(soraaccount.FieldSoraRedeemedCount, v) return u } // UpdateSoraRedeemedCount sets the "sora_redeemed_count" field to the value that was provided on create. func (u *SoraAccountUpsert) UpdateSoraRedeemedCount() *SoraAccountUpsert { u.SetExcluded(soraaccount.FieldSoraRedeemedCount) return u } // AddSoraRedeemedCount adds v to the "sora_redeemed_count" field. func (u *SoraAccountUpsert) AddSoraRedeemedCount(v int) *SoraAccountUpsert { u.Add(soraaccount.FieldSoraRedeemedCount, v) return u } // SetSoraRemainingCount sets the "sora_remaining_count" field. func (u *SoraAccountUpsert) SetSoraRemainingCount(v int) *SoraAccountUpsert { u.Set(soraaccount.FieldSoraRemainingCount, v) return u } // UpdateSoraRemainingCount sets the "sora_remaining_count" field to the value that was provided on create. func (u *SoraAccountUpsert) UpdateSoraRemainingCount() *SoraAccountUpsert { u.SetExcluded(soraaccount.FieldSoraRemainingCount) return u } // AddSoraRemainingCount adds v to the "sora_remaining_count" field. func (u *SoraAccountUpsert) AddSoraRemainingCount(v int) *SoraAccountUpsert { u.Add(soraaccount.FieldSoraRemainingCount, v) return u } // SetSoraTotalCount sets the "sora_total_count" field. func (u *SoraAccountUpsert) SetSoraTotalCount(v int) *SoraAccountUpsert { u.Set(soraaccount.FieldSoraTotalCount, v) return u } // UpdateSoraTotalCount sets the "sora_total_count" field to the value that was provided on create. func (u *SoraAccountUpsert) UpdateSoraTotalCount() *SoraAccountUpsert { u.SetExcluded(soraaccount.FieldSoraTotalCount) return u } // AddSoraTotalCount adds v to the "sora_total_count" field. func (u *SoraAccountUpsert) AddSoraTotalCount(v int) *SoraAccountUpsert { u.Add(soraaccount.FieldSoraTotalCount, v) return u } // SetSoraCooldownUntil sets the "sora_cooldown_until" field. func (u *SoraAccountUpsert) SetSoraCooldownUntil(v time.Time) *SoraAccountUpsert { u.Set(soraaccount.FieldSoraCooldownUntil, v) return u } // UpdateSoraCooldownUntil sets the "sora_cooldown_until" field to the value that was provided on create. func (u *SoraAccountUpsert) UpdateSoraCooldownUntil() *SoraAccountUpsert { u.SetExcluded(soraaccount.FieldSoraCooldownUntil) return u } // ClearSoraCooldownUntil clears the value of the "sora_cooldown_until" field. func (u *SoraAccountUpsert) ClearSoraCooldownUntil() *SoraAccountUpsert { u.SetNull(soraaccount.FieldSoraCooldownUntil) return u } // SetCooledUntil sets the "cooled_until" field. func (u *SoraAccountUpsert) SetCooledUntil(v time.Time) *SoraAccountUpsert { u.Set(soraaccount.FieldCooledUntil, v) return u } // UpdateCooledUntil sets the "cooled_until" field to the value that was provided on create. func (u *SoraAccountUpsert) UpdateCooledUntil() *SoraAccountUpsert { u.SetExcluded(soraaccount.FieldCooledUntil) return u } // ClearCooledUntil clears the value of the "cooled_until" field. func (u *SoraAccountUpsert) ClearCooledUntil() *SoraAccountUpsert { u.SetNull(soraaccount.FieldCooledUntil) return u } // SetImageEnabled sets the "image_enabled" field. func (u *SoraAccountUpsert) SetImageEnabled(v bool) *SoraAccountUpsert { u.Set(soraaccount.FieldImageEnabled, v) return u } // UpdateImageEnabled sets the "image_enabled" field to the value that was provided on create. func (u *SoraAccountUpsert) UpdateImageEnabled() *SoraAccountUpsert { u.SetExcluded(soraaccount.FieldImageEnabled) return u } // SetVideoEnabled sets the "video_enabled" field. func (u *SoraAccountUpsert) SetVideoEnabled(v bool) *SoraAccountUpsert { u.Set(soraaccount.FieldVideoEnabled, v) return u } // UpdateVideoEnabled sets the "video_enabled" field to the value that was provided on create. func (u *SoraAccountUpsert) UpdateVideoEnabled() *SoraAccountUpsert { u.SetExcluded(soraaccount.FieldVideoEnabled) return u } // SetImageConcurrency sets the "image_concurrency" field. func (u *SoraAccountUpsert) SetImageConcurrency(v int) *SoraAccountUpsert { u.Set(soraaccount.FieldImageConcurrency, v) return u } // UpdateImageConcurrency sets the "image_concurrency" field to the value that was provided on create. func (u *SoraAccountUpsert) UpdateImageConcurrency() *SoraAccountUpsert { u.SetExcluded(soraaccount.FieldImageConcurrency) return u } // AddImageConcurrency adds v to the "image_concurrency" field. func (u *SoraAccountUpsert) AddImageConcurrency(v int) *SoraAccountUpsert { u.Add(soraaccount.FieldImageConcurrency, v) return u } // SetVideoConcurrency sets the "video_concurrency" field. func (u *SoraAccountUpsert) SetVideoConcurrency(v int) *SoraAccountUpsert { u.Set(soraaccount.FieldVideoConcurrency, v) return u } // UpdateVideoConcurrency sets the "video_concurrency" field to the value that was provided on create. func (u *SoraAccountUpsert) UpdateVideoConcurrency() *SoraAccountUpsert { u.SetExcluded(soraaccount.FieldVideoConcurrency) return u } // AddVideoConcurrency adds v to the "video_concurrency" field. func (u *SoraAccountUpsert) AddVideoConcurrency(v int) *SoraAccountUpsert { u.Add(soraaccount.FieldVideoConcurrency, v) return u } // SetIsExpired sets the "is_expired" field. func (u *SoraAccountUpsert) SetIsExpired(v bool) *SoraAccountUpsert { u.Set(soraaccount.FieldIsExpired, v) return u } // UpdateIsExpired sets the "is_expired" field to the value that was provided on create. func (u *SoraAccountUpsert) UpdateIsExpired() *SoraAccountUpsert { u.SetExcluded(soraaccount.FieldIsExpired) return u } // UpdateNewValues updates the mutable fields using the new values that were set on create. // Using this option is equivalent to using: // // client.SoraAccount.Create(). // OnConflict( // sql.ResolveWithNewValues(), // ). // Exec(ctx) func (u *SoraAccountUpsertOne) UpdateNewValues() *SoraAccountUpsertOne { u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues()) u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) { if _, exists := u.create.mutation.CreatedAt(); exists { s.SetIgnore(soraaccount.FieldCreatedAt) } })) return u } // Ignore sets each column to itself in case of conflict. // Using this option is equivalent to using: // // client.SoraAccount.Create(). // OnConflict(sql.ResolveWithIgnore()). // Exec(ctx) func (u *SoraAccountUpsertOne) Ignore() *SoraAccountUpsertOne { u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore()) return u } // DoNothing configures the conflict_action to `DO NOTHING`. // Supported only by SQLite and PostgreSQL. func (u *SoraAccountUpsertOne) DoNothing() *SoraAccountUpsertOne { u.create.conflict = append(u.create.conflict, sql.DoNothing()) return u } // Update allows overriding fields `UPDATE` values. See the SoraAccountCreate.OnConflict // documentation for more info. func (u *SoraAccountUpsertOne) Update(set func(*SoraAccountUpsert)) *SoraAccountUpsertOne { u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) { set(&SoraAccountUpsert{UpdateSet: update}) })) return u } // SetUpdatedAt sets the "updated_at" field. func (u *SoraAccountUpsertOne) SetUpdatedAt(v time.Time) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.SetUpdatedAt(v) }) } // UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create. func (u *SoraAccountUpsertOne) UpdateUpdatedAt() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.UpdateUpdatedAt() }) } // SetAccountID sets the "account_id" field. func (u *SoraAccountUpsertOne) SetAccountID(v int64) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.SetAccountID(v) }) } // AddAccountID adds v to the "account_id" field. func (u *SoraAccountUpsertOne) AddAccountID(v int64) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.AddAccountID(v) }) } // UpdateAccountID sets the "account_id" field to the value that was provided on create. func (u *SoraAccountUpsertOne) UpdateAccountID() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.UpdateAccountID() }) } // SetAccessToken sets the "access_token" field. func (u *SoraAccountUpsertOne) SetAccessToken(v string) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.SetAccessToken(v) }) } // UpdateAccessToken sets the "access_token" field to the value that was provided on create. func (u *SoraAccountUpsertOne) UpdateAccessToken() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.UpdateAccessToken() }) } // ClearAccessToken clears the value of the "access_token" field. func (u *SoraAccountUpsertOne) ClearAccessToken() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.ClearAccessToken() }) } // SetSessionToken sets the "session_token" field. func (u *SoraAccountUpsertOne) SetSessionToken(v string) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.SetSessionToken(v) }) } // UpdateSessionToken sets the "session_token" field to the value that was provided on create. func (u *SoraAccountUpsertOne) UpdateSessionToken() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.UpdateSessionToken() }) } // ClearSessionToken clears the value of the "session_token" field. func (u *SoraAccountUpsertOne) ClearSessionToken() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.ClearSessionToken() }) } // SetRefreshToken sets the "refresh_token" field. func (u *SoraAccountUpsertOne) SetRefreshToken(v string) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.SetRefreshToken(v) }) } // UpdateRefreshToken sets the "refresh_token" field to the value that was provided on create. func (u *SoraAccountUpsertOne) UpdateRefreshToken() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.UpdateRefreshToken() }) } // ClearRefreshToken clears the value of the "refresh_token" field. func (u *SoraAccountUpsertOne) ClearRefreshToken() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.ClearRefreshToken() }) } // SetClientID sets the "client_id" field. func (u *SoraAccountUpsertOne) SetClientID(v string) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.SetClientID(v) }) } // UpdateClientID sets the "client_id" field to the value that was provided on create. func (u *SoraAccountUpsertOne) UpdateClientID() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.UpdateClientID() }) } // ClearClientID clears the value of the "client_id" field. func (u *SoraAccountUpsertOne) ClearClientID() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.ClearClientID() }) } // SetEmail sets the "email" field. func (u *SoraAccountUpsertOne) SetEmail(v string) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.SetEmail(v) }) } // UpdateEmail sets the "email" field to the value that was provided on create. func (u *SoraAccountUpsertOne) UpdateEmail() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.UpdateEmail() }) } // ClearEmail clears the value of the "email" field. func (u *SoraAccountUpsertOne) ClearEmail() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.ClearEmail() }) } // SetUsername sets the "username" field. func (u *SoraAccountUpsertOne) SetUsername(v string) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.SetUsername(v) }) } // UpdateUsername sets the "username" field to the value that was provided on create. func (u *SoraAccountUpsertOne) UpdateUsername() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.UpdateUsername() }) } // ClearUsername clears the value of the "username" field. func (u *SoraAccountUpsertOne) ClearUsername() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.ClearUsername() }) } // SetRemark sets the "remark" field. func (u *SoraAccountUpsertOne) SetRemark(v string) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.SetRemark(v) }) } // UpdateRemark sets the "remark" field to the value that was provided on create. func (u *SoraAccountUpsertOne) UpdateRemark() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.UpdateRemark() }) } // ClearRemark clears the value of the "remark" field. func (u *SoraAccountUpsertOne) ClearRemark() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.ClearRemark() }) } // SetUseCount sets the "use_count" field. func (u *SoraAccountUpsertOne) SetUseCount(v int) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.SetUseCount(v) }) } // AddUseCount adds v to the "use_count" field. func (u *SoraAccountUpsertOne) AddUseCount(v int) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.AddUseCount(v) }) } // UpdateUseCount sets the "use_count" field to the value that was provided on create. func (u *SoraAccountUpsertOne) UpdateUseCount() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.UpdateUseCount() }) } // SetPlanType sets the "plan_type" field. func (u *SoraAccountUpsertOne) SetPlanType(v string) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.SetPlanType(v) }) } // UpdatePlanType sets the "plan_type" field to the value that was provided on create. func (u *SoraAccountUpsertOne) UpdatePlanType() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.UpdatePlanType() }) } // ClearPlanType clears the value of the "plan_type" field. func (u *SoraAccountUpsertOne) ClearPlanType() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.ClearPlanType() }) } // SetPlanTitle sets the "plan_title" field. func (u *SoraAccountUpsertOne) SetPlanTitle(v string) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.SetPlanTitle(v) }) } // UpdatePlanTitle sets the "plan_title" field to the value that was provided on create. func (u *SoraAccountUpsertOne) UpdatePlanTitle() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.UpdatePlanTitle() }) } // ClearPlanTitle clears the value of the "plan_title" field. func (u *SoraAccountUpsertOne) ClearPlanTitle() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.ClearPlanTitle() }) } // SetSubscriptionEnd sets the "subscription_end" field. func (u *SoraAccountUpsertOne) SetSubscriptionEnd(v time.Time) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.SetSubscriptionEnd(v) }) } // UpdateSubscriptionEnd sets the "subscription_end" field to the value that was provided on create. func (u *SoraAccountUpsertOne) UpdateSubscriptionEnd() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.UpdateSubscriptionEnd() }) } // ClearSubscriptionEnd clears the value of the "subscription_end" field. func (u *SoraAccountUpsertOne) ClearSubscriptionEnd() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.ClearSubscriptionEnd() }) } // SetSoraSupported sets the "sora_supported" field. func (u *SoraAccountUpsertOne) SetSoraSupported(v bool) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.SetSoraSupported(v) }) } // UpdateSoraSupported sets the "sora_supported" field to the value that was provided on create. func (u *SoraAccountUpsertOne) UpdateSoraSupported() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.UpdateSoraSupported() }) } // SetSoraInviteCode sets the "sora_invite_code" field. func (u *SoraAccountUpsertOne) SetSoraInviteCode(v string) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.SetSoraInviteCode(v) }) } // UpdateSoraInviteCode sets the "sora_invite_code" field to the value that was provided on create. func (u *SoraAccountUpsertOne) UpdateSoraInviteCode() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.UpdateSoraInviteCode() }) } // ClearSoraInviteCode clears the value of the "sora_invite_code" field. func (u *SoraAccountUpsertOne) ClearSoraInviteCode() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.ClearSoraInviteCode() }) } // SetSoraRedeemedCount sets the "sora_redeemed_count" field. func (u *SoraAccountUpsertOne) SetSoraRedeemedCount(v int) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.SetSoraRedeemedCount(v) }) } // AddSoraRedeemedCount adds v to the "sora_redeemed_count" field. func (u *SoraAccountUpsertOne) AddSoraRedeemedCount(v int) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.AddSoraRedeemedCount(v) }) } // UpdateSoraRedeemedCount sets the "sora_redeemed_count" field to the value that was provided on create. func (u *SoraAccountUpsertOne) UpdateSoraRedeemedCount() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.UpdateSoraRedeemedCount() }) } // SetSoraRemainingCount sets the "sora_remaining_count" field. func (u *SoraAccountUpsertOne) SetSoraRemainingCount(v int) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.SetSoraRemainingCount(v) }) } // AddSoraRemainingCount adds v to the "sora_remaining_count" field. func (u *SoraAccountUpsertOne) AddSoraRemainingCount(v int) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.AddSoraRemainingCount(v) }) } // UpdateSoraRemainingCount sets the "sora_remaining_count" field to the value that was provided on create. func (u *SoraAccountUpsertOne) UpdateSoraRemainingCount() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.UpdateSoraRemainingCount() }) } // SetSoraTotalCount sets the "sora_total_count" field. func (u *SoraAccountUpsertOne) SetSoraTotalCount(v int) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.SetSoraTotalCount(v) }) } // AddSoraTotalCount adds v to the "sora_total_count" field. func (u *SoraAccountUpsertOne) AddSoraTotalCount(v int) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.AddSoraTotalCount(v) }) } // UpdateSoraTotalCount sets the "sora_total_count" field to the value that was provided on create. func (u *SoraAccountUpsertOne) UpdateSoraTotalCount() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.UpdateSoraTotalCount() }) } // SetSoraCooldownUntil sets the "sora_cooldown_until" field. func (u *SoraAccountUpsertOne) SetSoraCooldownUntil(v time.Time) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.SetSoraCooldownUntil(v) }) } // UpdateSoraCooldownUntil sets the "sora_cooldown_until" field to the value that was provided on create. func (u *SoraAccountUpsertOne) UpdateSoraCooldownUntil() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.UpdateSoraCooldownUntil() }) } // ClearSoraCooldownUntil clears the value of the "sora_cooldown_until" field. func (u *SoraAccountUpsertOne) ClearSoraCooldownUntil() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.ClearSoraCooldownUntil() }) } // SetCooledUntil sets the "cooled_until" field. func (u *SoraAccountUpsertOne) SetCooledUntil(v time.Time) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.SetCooledUntil(v) }) } // UpdateCooledUntil sets the "cooled_until" field to the value that was provided on create. func (u *SoraAccountUpsertOne) UpdateCooledUntil() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.UpdateCooledUntil() }) } // ClearCooledUntil clears the value of the "cooled_until" field. func (u *SoraAccountUpsertOne) ClearCooledUntil() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.ClearCooledUntil() }) } // SetImageEnabled sets the "image_enabled" field. func (u *SoraAccountUpsertOne) SetImageEnabled(v bool) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.SetImageEnabled(v) }) } // UpdateImageEnabled sets the "image_enabled" field to the value that was provided on create. func (u *SoraAccountUpsertOne) UpdateImageEnabled() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.UpdateImageEnabled() }) } // SetVideoEnabled sets the "video_enabled" field. func (u *SoraAccountUpsertOne) SetVideoEnabled(v bool) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.SetVideoEnabled(v) }) } // UpdateVideoEnabled sets the "video_enabled" field to the value that was provided on create. func (u *SoraAccountUpsertOne) UpdateVideoEnabled() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.UpdateVideoEnabled() }) } // SetImageConcurrency sets the "image_concurrency" field. func (u *SoraAccountUpsertOne) SetImageConcurrency(v int) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.SetImageConcurrency(v) }) } // AddImageConcurrency adds v to the "image_concurrency" field. func (u *SoraAccountUpsertOne) AddImageConcurrency(v int) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.AddImageConcurrency(v) }) } // UpdateImageConcurrency sets the "image_concurrency" field to the value that was provided on create. func (u *SoraAccountUpsertOne) UpdateImageConcurrency() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.UpdateImageConcurrency() }) } // SetVideoConcurrency sets the "video_concurrency" field. func (u *SoraAccountUpsertOne) SetVideoConcurrency(v int) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.SetVideoConcurrency(v) }) } // AddVideoConcurrency adds v to the "video_concurrency" field. func (u *SoraAccountUpsertOne) AddVideoConcurrency(v int) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.AddVideoConcurrency(v) }) } // UpdateVideoConcurrency sets the "video_concurrency" field to the value that was provided on create. func (u *SoraAccountUpsertOne) UpdateVideoConcurrency() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.UpdateVideoConcurrency() }) } // SetIsExpired sets the "is_expired" field. func (u *SoraAccountUpsertOne) SetIsExpired(v bool) *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.SetIsExpired(v) }) } // UpdateIsExpired sets the "is_expired" field to the value that was provided on create. func (u *SoraAccountUpsertOne) UpdateIsExpired() *SoraAccountUpsertOne { return u.Update(func(s *SoraAccountUpsert) { s.UpdateIsExpired() }) } // Exec executes the query. func (u *SoraAccountUpsertOne) Exec(ctx context.Context) error { if len(u.create.conflict) == 0 { return errors.New("ent: missing options for SoraAccountCreate.OnConflict") } return u.create.Exec(ctx) } // ExecX is like Exec, but panics if an error occurs. func (u *SoraAccountUpsertOne) ExecX(ctx context.Context) { if err := u.create.Exec(ctx); err != nil { panic(err) } } // Exec executes the UPSERT query and returns the inserted/updated ID. func (u *SoraAccountUpsertOne) ID(ctx context.Context) (id int64, err error) { node, err := u.create.Save(ctx) if err != nil { return id, err } return node.ID, nil } // IDX is like ID, but panics if an error occurs. func (u *SoraAccountUpsertOne) IDX(ctx context.Context) int64 { id, err := u.ID(ctx) if err != nil { panic(err) } return id } // SoraAccountCreateBulk is the builder for creating many SoraAccount entities in bulk. type SoraAccountCreateBulk struct { config err error builders []*SoraAccountCreate conflict []sql.ConflictOption } // Save creates the SoraAccount entities in the database. func (_c *SoraAccountCreateBulk) Save(ctx context.Context) ([]*SoraAccount, error) { if _c.err != nil { return nil, _c.err } specs := make([]*sqlgraph.CreateSpec, len(_c.builders)) nodes := make([]*SoraAccount, len(_c.builders)) mutators := make([]Mutator, len(_c.builders)) for i := range _c.builders { func(i int, root context.Context) { builder := _c.builders[i] builder.defaults() var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) { mutation, ok := m.(*SoraAccountMutation) if !ok { return nil, fmt.Errorf("unexpected mutation type %T", m) } if err := builder.check(); err != nil { return nil, err } builder.mutation = mutation var err error nodes[i], specs[i] = builder.createSpec() if i < len(mutators)-1 { _, err = mutators[i+1].Mutate(root, _c.builders[i+1].mutation) } else { spec := &sqlgraph.BatchCreateSpec{Nodes: specs} spec.OnConflict = _c.conflict // Invoke the actual operation on the latest mutation in the chain. if err = sqlgraph.BatchCreate(ctx, _c.driver, spec); err != nil { if sqlgraph.IsConstraintError(err) { err = &ConstraintError{msg: err.Error(), wrap: err} } } } if err != nil { return nil, err } mutation.id = &nodes[i].ID if specs[i].ID.Value != nil { id := specs[i].ID.Value.(int64) nodes[i].ID = int64(id) } mutation.done = true return nodes[i], nil }) for i := len(builder.hooks) - 1; i >= 0; i-- { mut = builder.hooks[i](mut) } mutators[i] = mut }(i, ctx) } if len(mutators) > 0 { if _, err := mutators[0].Mutate(ctx, _c.builders[0].mutation); err != nil { return nil, err } } return nodes, nil } // SaveX is like Save, but panics if an error occurs. func (_c *SoraAccountCreateBulk) SaveX(ctx context.Context) []*SoraAccount { v, err := _c.Save(ctx) if err != nil { panic(err) } return v } // Exec executes the query. func (_c *SoraAccountCreateBulk) Exec(ctx context.Context) error { _, err := _c.Save(ctx) return err } // ExecX is like Exec, but panics if an error occurs. func (_c *SoraAccountCreateBulk) ExecX(ctx context.Context) { if err := _c.Exec(ctx); err != nil { panic(err) } } // OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause // of the `INSERT` statement. For example: // // client.SoraAccount.CreateBulk(builders...). // OnConflict( // // Update the row with the new values // // the was proposed for insertion. // sql.ResolveWithNewValues(), // ). // // Override some of the fields with custom // // update values. // Update(func(u *ent.SoraAccountUpsert) { // SetCreatedAt(v+v). // }). // Exec(ctx) func (_c *SoraAccountCreateBulk) OnConflict(opts ...sql.ConflictOption) *SoraAccountUpsertBulk { _c.conflict = opts return &SoraAccountUpsertBulk{ create: _c, } } // OnConflictColumns calls `OnConflict` and configures the columns // as conflict target. Using this option is equivalent to using: // // client.SoraAccount.Create(). // OnConflict(sql.ConflictColumns(columns...)). // Exec(ctx) func (_c *SoraAccountCreateBulk) OnConflictColumns(columns ...string) *SoraAccountUpsertBulk { _c.conflict = append(_c.conflict, sql.ConflictColumns(columns...)) return &SoraAccountUpsertBulk{ create: _c, } } // SoraAccountUpsertBulk is the builder for "upsert"-ing // a bulk of SoraAccount nodes. type SoraAccountUpsertBulk struct { create *SoraAccountCreateBulk } // UpdateNewValues updates the mutable fields using the new values that // were set on create. Using this option is equivalent to using: // // client.SoraAccount.Create(). // OnConflict( // sql.ResolveWithNewValues(), // ). // Exec(ctx) func (u *SoraAccountUpsertBulk) UpdateNewValues() *SoraAccountUpsertBulk { u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues()) u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) { for _, b := range u.create.builders { if _, exists := b.mutation.CreatedAt(); exists { s.SetIgnore(soraaccount.FieldCreatedAt) } } })) return u } // Ignore sets each column to itself in case of conflict. // Using this option is equivalent to using: // // client.SoraAccount.Create(). // OnConflict(sql.ResolveWithIgnore()). // Exec(ctx) func (u *SoraAccountUpsertBulk) Ignore() *SoraAccountUpsertBulk { u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore()) return u } // DoNothing configures the conflict_action to `DO NOTHING`. // Supported only by SQLite and PostgreSQL. func (u *SoraAccountUpsertBulk) DoNothing() *SoraAccountUpsertBulk { u.create.conflict = append(u.create.conflict, sql.DoNothing()) return u } // Update allows overriding fields `UPDATE` values. See the SoraAccountCreateBulk.OnConflict // documentation for more info. func (u *SoraAccountUpsertBulk) Update(set func(*SoraAccountUpsert)) *SoraAccountUpsertBulk { u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) { set(&SoraAccountUpsert{UpdateSet: update}) })) return u } // SetUpdatedAt sets the "updated_at" field. func (u *SoraAccountUpsertBulk) SetUpdatedAt(v time.Time) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.SetUpdatedAt(v) }) } // UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create. func (u *SoraAccountUpsertBulk) UpdateUpdatedAt() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.UpdateUpdatedAt() }) } // SetAccountID sets the "account_id" field. func (u *SoraAccountUpsertBulk) SetAccountID(v int64) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.SetAccountID(v) }) } // AddAccountID adds v to the "account_id" field. func (u *SoraAccountUpsertBulk) AddAccountID(v int64) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.AddAccountID(v) }) } // UpdateAccountID sets the "account_id" field to the value that was provided on create. func (u *SoraAccountUpsertBulk) UpdateAccountID() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.UpdateAccountID() }) } // SetAccessToken sets the "access_token" field. func (u *SoraAccountUpsertBulk) SetAccessToken(v string) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.SetAccessToken(v) }) } // UpdateAccessToken sets the "access_token" field to the value that was provided on create. func (u *SoraAccountUpsertBulk) UpdateAccessToken() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.UpdateAccessToken() }) } // ClearAccessToken clears the value of the "access_token" field. func (u *SoraAccountUpsertBulk) ClearAccessToken() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.ClearAccessToken() }) } // SetSessionToken sets the "session_token" field. func (u *SoraAccountUpsertBulk) SetSessionToken(v string) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.SetSessionToken(v) }) } // UpdateSessionToken sets the "session_token" field to the value that was provided on create. func (u *SoraAccountUpsertBulk) UpdateSessionToken() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.UpdateSessionToken() }) } // ClearSessionToken clears the value of the "session_token" field. func (u *SoraAccountUpsertBulk) ClearSessionToken() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.ClearSessionToken() }) } // SetRefreshToken sets the "refresh_token" field. func (u *SoraAccountUpsertBulk) SetRefreshToken(v string) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.SetRefreshToken(v) }) } // UpdateRefreshToken sets the "refresh_token" field to the value that was provided on create. func (u *SoraAccountUpsertBulk) UpdateRefreshToken() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.UpdateRefreshToken() }) } // ClearRefreshToken clears the value of the "refresh_token" field. func (u *SoraAccountUpsertBulk) ClearRefreshToken() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.ClearRefreshToken() }) } // SetClientID sets the "client_id" field. func (u *SoraAccountUpsertBulk) SetClientID(v string) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.SetClientID(v) }) } // UpdateClientID sets the "client_id" field to the value that was provided on create. func (u *SoraAccountUpsertBulk) UpdateClientID() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.UpdateClientID() }) } // ClearClientID clears the value of the "client_id" field. func (u *SoraAccountUpsertBulk) ClearClientID() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.ClearClientID() }) } // SetEmail sets the "email" field. func (u *SoraAccountUpsertBulk) SetEmail(v string) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.SetEmail(v) }) } // UpdateEmail sets the "email" field to the value that was provided on create. func (u *SoraAccountUpsertBulk) UpdateEmail() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.UpdateEmail() }) } // ClearEmail clears the value of the "email" field. func (u *SoraAccountUpsertBulk) ClearEmail() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.ClearEmail() }) } // SetUsername sets the "username" field. func (u *SoraAccountUpsertBulk) SetUsername(v string) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.SetUsername(v) }) } // UpdateUsername sets the "username" field to the value that was provided on create. func (u *SoraAccountUpsertBulk) UpdateUsername() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.UpdateUsername() }) } // ClearUsername clears the value of the "username" field. func (u *SoraAccountUpsertBulk) ClearUsername() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.ClearUsername() }) } // SetRemark sets the "remark" field. func (u *SoraAccountUpsertBulk) SetRemark(v string) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.SetRemark(v) }) } // UpdateRemark sets the "remark" field to the value that was provided on create. func (u *SoraAccountUpsertBulk) UpdateRemark() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.UpdateRemark() }) } // ClearRemark clears the value of the "remark" field. func (u *SoraAccountUpsertBulk) ClearRemark() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.ClearRemark() }) } // SetUseCount sets the "use_count" field. func (u *SoraAccountUpsertBulk) SetUseCount(v int) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.SetUseCount(v) }) } // AddUseCount adds v to the "use_count" field. func (u *SoraAccountUpsertBulk) AddUseCount(v int) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.AddUseCount(v) }) } // UpdateUseCount sets the "use_count" field to the value that was provided on create. func (u *SoraAccountUpsertBulk) UpdateUseCount() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.UpdateUseCount() }) } // SetPlanType sets the "plan_type" field. func (u *SoraAccountUpsertBulk) SetPlanType(v string) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.SetPlanType(v) }) } // UpdatePlanType sets the "plan_type" field to the value that was provided on create. func (u *SoraAccountUpsertBulk) UpdatePlanType() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.UpdatePlanType() }) } // ClearPlanType clears the value of the "plan_type" field. func (u *SoraAccountUpsertBulk) ClearPlanType() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.ClearPlanType() }) } // SetPlanTitle sets the "plan_title" field. func (u *SoraAccountUpsertBulk) SetPlanTitle(v string) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.SetPlanTitle(v) }) } // UpdatePlanTitle sets the "plan_title" field to the value that was provided on create. func (u *SoraAccountUpsertBulk) UpdatePlanTitle() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.UpdatePlanTitle() }) } // ClearPlanTitle clears the value of the "plan_title" field. func (u *SoraAccountUpsertBulk) ClearPlanTitle() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.ClearPlanTitle() }) } // SetSubscriptionEnd sets the "subscription_end" field. func (u *SoraAccountUpsertBulk) SetSubscriptionEnd(v time.Time) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.SetSubscriptionEnd(v) }) } // UpdateSubscriptionEnd sets the "subscription_end" field to the value that was provided on create. func (u *SoraAccountUpsertBulk) UpdateSubscriptionEnd() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.UpdateSubscriptionEnd() }) } // ClearSubscriptionEnd clears the value of the "subscription_end" field. func (u *SoraAccountUpsertBulk) ClearSubscriptionEnd() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.ClearSubscriptionEnd() }) } // SetSoraSupported sets the "sora_supported" field. func (u *SoraAccountUpsertBulk) SetSoraSupported(v bool) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.SetSoraSupported(v) }) } // UpdateSoraSupported sets the "sora_supported" field to the value that was provided on create. func (u *SoraAccountUpsertBulk) UpdateSoraSupported() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.UpdateSoraSupported() }) } // SetSoraInviteCode sets the "sora_invite_code" field. func (u *SoraAccountUpsertBulk) SetSoraInviteCode(v string) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.SetSoraInviteCode(v) }) } // UpdateSoraInviteCode sets the "sora_invite_code" field to the value that was provided on create. func (u *SoraAccountUpsertBulk) UpdateSoraInviteCode() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.UpdateSoraInviteCode() }) } // ClearSoraInviteCode clears the value of the "sora_invite_code" field. func (u *SoraAccountUpsertBulk) ClearSoraInviteCode() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.ClearSoraInviteCode() }) } // SetSoraRedeemedCount sets the "sora_redeemed_count" field. func (u *SoraAccountUpsertBulk) SetSoraRedeemedCount(v int) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.SetSoraRedeemedCount(v) }) } // AddSoraRedeemedCount adds v to the "sora_redeemed_count" field. func (u *SoraAccountUpsertBulk) AddSoraRedeemedCount(v int) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.AddSoraRedeemedCount(v) }) } // UpdateSoraRedeemedCount sets the "sora_redeemed_count" field to the value that was provided on create. func (u *SoraAccountUpsertBulk) UpdateSoraRedeemedCount() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.UpdateSoraRedeemedCount() }) } // SetSoraRemainingCount sets the "sora_remaining_count" field. func (u *SoraAccountUpsertBulk) SetSoraRemainingCount(v int) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.SetSoraRemainingCount(v) }) } // AddSoraRemainingCount adds v to the "sora_remaining_count" field. func (u *SoraAccountUpsertBulk) AddSoraRemainingCount(v int) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.AddSoraRemainingCount(v) }) } // UpdateSoraRemainingCount sets the "sora_remaining_count" field to the value that was provided on create. func (u *SoraAccountUpsertBulk) UpdateSoraRemainingCount() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.UpdateSoraRemainingCount() }) } // SetSoraTotalCount sets the "sora_total_count" field. func (u *SoraAccountUpsertBulk) SetSoraTotalCount(v int) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.SetSoraTotalCount(v) }) } // AddSoraTotalCount adds v to the "sora_total_count" field. func (u *SoraAccountUpsertBulk) AddSoraTotalCount(v int) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.AddSoraTotalCount(v) }) } // UpdateSoraTotalCount sets the "sora_total_count" field to the value that was provided on create. func (u *SoraAccountUpsertBulk) UpdateSoraTotalCount() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.UpdateSoraTotalCount() }) } // SetSoraCooldownUntil sets the "sora_cooldown_until" field. func (u *SoraAccountUpsertBulk) SetSoraCooldownUntil(v time.Time) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.SetSoraCooldownUntil(v) }) } // UpdateSoraCooldownUntil sets the "sora_cooldown_until" field to the value that was provided on create. func (u *SoraAccountUpsertBulk) UpdateSoraCooldownUntil() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.UpdateSoraCooldownUntil() }) } // ClearSoraCooldownUntil clears the value of the "sora_cooldown_until" field. func (u *SoraAccountUpsertBulk) ClearSoraCooldownUntil() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.ClearSoraCooldownUntil() }) } // SetCooledUntil sets the "cooled_until" field. func (u *SoraAccountUpsertBulk) SetCooledUntil(v time.Time) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.SetCooledUntil(v) }) } // UpdateCooledUntil sets the "cooled_until" field to the value that was provided on create. func (u *SoraAccountUpsertBulk) UpdateCooledUntil() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.UpdateCooledUntil() }) } // ClearCooledUntil clears the value of the "cooled_until" field. func (u *SoraAccountUpsertBulk) ClearCooledUntil() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.ClearCooledUntil() }) } // SetImageEnabled sets the "image_enabled" field. func (u *SoraAccountUpsertBulk) SetImageEnabled(v bool) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.SetImageEnabled(v) }) } // UpdateImageEnabled sets the "image_enabled" field to the value that was provided on create. func (u *SoraAccountUpsertBulk) UpdateImageEnabled() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.UpdateImageEnabled() }) } // SetVideoEnabled sets the "video_enabled" field. func (u *SoraAccountUpsertBulk) SetVideoEnabled(v bool) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.SetVideoEnabled(v) }) } // UpdateVideoEnabled sets the "video_enabled" field to the value that was provided on create. func (u *SoraAccountUpsertBulk) UpdateVideoEnabled() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.UpdateVideoEnabled() }) } // SetImageConcurrency sets the "image_concurrency" field. func (u *SoraAccountUpsertBulk) SetImageConcurrency(v int) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.SetImageConcurrency(v) }) } // AddImageConcurrency adds v to the "image_concurrency" field. func (u *SoraAccountUpsertBulk) AddImageConcurrency(v int) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.AddImageConcurrency(v) }) } // UpdateImageConcurrency sets the "image_concurrency" field to the value that was provided on create. func (u *SoraAccountUpsertBulk) UpdateImageConcurrency() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.UpdateImageConcurrency() }) } // SetVideoConcurrency sets the "video_concurrency" field. func (u *SoraAccountUpsertBulk) SetVideoConcurrency(v int) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.SetVideoConcurrency(v) }) } // AddVideoConcurrency adds v to the "video_concurrency" field. func (u *SoraAccountUpsertBulk) AddVideoConcurrency(v int) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.AddVideoConcurrency(v) }) } // UpdateVideoConcurrency sets the "video_concurrency" field to the value that was provided on create. func (u *SoraAccountUpsertBulk) UpdateVideoConcurrency() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.UpdateVideoConcurrency() }) } // SetIsExpired sets the "is_expired" field. func (u *SoraAccountUpsertBulk) SetIsExpired(v bool) *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.SetIsExpired(v) }) } // UpdateIsExpired sets the "is_expired" field to the value that was provided on create. func (u *SoraAccountUpsertBulk) UpdateIsExpired() *SoraAccountUpsertBulk { return u.Update(func(s *SoraAccountUpsert) { s.UpdateIsExpired() }) } // Exec executes the query. func (u *SoraAccountUpsertBulk) Exec(ctx context.Context) error { if u.create.err != nil { return u.create.err } for i, b := range u.create.builders { if len(b.conflict) != 0 { return fmt.Errorf("ent: OnConflict was set for builder %d. Set it on the SoraAccountCreateBulk instead", i) } } if len(u.create.conflict) == 0 { return errors.New("ent: missing options for SoraAccountCreateBulk.OnConflict") } return u.create.Exec(ctx) } // ExecX is like Exec, but panics if an error occurs. func (u *SoraAccountUpsertBulk) ExecX(ctx context.Context) { if err := u.create.Exec(ctx); err != nil { panic(err) } }