|
@@ -41,6 +41,7 @@ import (
|
|
|
"wechat-api/ent/usagestatistichour"
|
|
|
"wechat-api/ent/usagestatisticmonth"
|
|
|
"wechat-api/ent/usagetotal"
|
|
|
+ "wechat-api/ent/whatsapp"
|
|
|
"wechat-api/ent/workexperience"
|
|
|
"wechat-api/ent/wpchatroom"
|
|
|
"wechat-api/ent/wpchatroommember"
|
|
@@ -93,6 +94,7 @@ const (
|
|
|
TypeUsageStatisticHour = "UsageStatisticHour"
|
|
|
TypeUsageStatisticMonth = "UsageStatisticMonth"
|
|
|
TypeUsageTotal = "UsageTotal"
|
|
|
+ TypeWhatsapp = "Whatsapp"
|
|
|
TypeWorkExperience = "WorkExperience"
|
|
|
TypeWpChatroom = "WpChatroom"
|
|
|
TypeWpChatroomMember = "WpChatroomMember"
|
|
@@ -36802,6 +36804,1541 @@ func (m *UsageTotalMutation) ResetEdge(name string) error {
|
|
|
return fmt.Errorf("unknown UsageTotal edge %s", name)
|
|
|
}
|
|
|
|
|
|
+// WhatsappMutation represents an operation that mutates the Whatsapp nodes in the graph.
|
|
|
+type WhatsappMutation struct {
|
|
|
+ config
|
|
|
+ op Op
|
|
|
+ typ string
|
|
|
+ id *uint64
|
|
|
+ created_at *time.Time
|
|
|
+ updated_at *time.Time
|
|
|
+ status *uint8
|
|
|
+ addstatus *int8
|
|
|
+ deleted_at *time.Time
|
|
|
+ ak *string
|
|
|
+ sk *string
|
|
|
+ callback *string
|
|
|
+ account *string
|
|
|
+ nickname *string
|
|
|
+ phone *string
|
|
|
+ organization_id *uint64
|
|
|
+ addorganization_id *int64
|
|
|
+ agent_id *uint64
|
|
|
+ addagent_id *int64
|
|
|
+ api_base *string
|
|
|
+ api_key *string
|
|
|
+ allow_list *[]string
|
|
|
+ appendallow_list []string
|
|
|
+ group_allow_list *[]string
|
|
|
+ appendgroup_allow_list []string
|
|
|
+ block_list *[]string
|
|
|
+ appendblock_list []string
|
|
|
+ group_block_list *[]string
|
|
|
+ appendgroup_block_list []string
|
|
|
+ clearedFields map[string]struct{}
|
|
|
+ done bool
|
|
|
+ oldValue func(context.Context) (*Whatsapp, error)
|
|
|
+ predicates []predicate.Whatsapp
|
|
|
+}
|
|
|
+
|
|
|
+var _ ent.Mutation = (*WhatsappMutation)(nil)
|
|
|
+
|
|
|
+// whatsappOption allows management of the mutation configuration using functional options.
|
|
|
+type whatsappOption func(*WhatsappMutation)
|
|
|
+
|
|
|
+// newWhatsappMutation creates new mutation for the Whatsapp entity.
|
|
|
+func newWhatsappMutation(c config, op Op, opts ...whatsappOption) *WhatsappMutation {
|
|
|
+ m := &WhatsappMutation{
|
|
|
+ config: c,
|
|
|
+ op: op,
|
|
|
+ typ: TypeWhatsapp,
|
|
|
+ clearedFields: make(map[string]struct{}),
|
|
|
+ }
|
|
|
+ for _, opt := range opts {
|
|
|
+ opt(m)
|
|
|
+ }
|
|
|
+ return m
|
|
|
+}
|
|
|
+
|
|
|
+// withWhatsappID sets the ID field of the mutation.
|
|
|
+func withWhatsappID(id uint64) whatsappOption {
|
|
|
+ return func(m *WhatsappMutation) {
|
|
|
+ var (
|
|
|
+ err error
|
|
|
+ once sync.Once
|
|
|
+ value *Whatsapp
|
|
|
+ )
|
|
|
+ m.oldValue = func(ctx context.Context) (*Whatsapp, error) {
|
|
|
+ once.Do(func() {
|
|
|
+ if m.done {
|
|
|
+ err = errors.New("querying old values post mutation is not allowed")
|
|
|
+ } else {
|
|
|
+ value, err = m.Client().Whatsapp.Get(ctx, id)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return value, err
|
|
|
+ }
|
|
|
+ m.id = &id
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// withWhatsapp sets the old Whatsapp of the mutation.
|
|
|
+func withWhatsapp(node *Whatsapp) whatsappOption {
|
|
|
+ return func(m *WhatsappMutation) {
|
|
|
+ m.oldValue = func(context.Context) (*Whatsapp, error) {
|
|
|
+ return node, nil
|
|
|
+ }
|
|
|
+ m.id = &node.ID
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// Client returns a new `ent.Client` from the mutation. If the mutation was
|
|
|
+// executed in a transaction (ent.Tx), a transactional client is returned.
|
|
|
+func (m WhatsappMutation) Client() *Client {
|
|
|
+ client := &Client{config: m.config}
|
|
|
+ client.init()
|
|
|
+ return client
|
|
|
+}
|
|
|
+
|
|
|
+// Tx returns an `ent.Tx` for mutations that were executed in transactions;
|
|
|
+// it returns an error otherwise.
|
|
|
+func (m WhatsappMutation) Tx() (*Tx, error) {
|
|
|
+ if _, ok := m.driver.(*txDriver); !ok {
|
|
|
+ return nil, errors.New("ent: mutation is not running in a transaction")
|
|
|
+ }
|
|
|
+ tx := &Tx{config: m.config}
|
|
|
+ tx.init()
|
|
|
+ return tx, nil
|
|
|
+}
|
|
|
+
|
|
|
+// SetID sets the value of the id field. Note that this
|
|
|
+// operation is only accepted on creation of Whatsapp entities.
|
|
|
+func (m *WhatsappMutation) SetID(id uint64) {
|
|
|
+ m.id = &id
|
|
|
+}
|
|
|
+
|
|
|
+// ID returns the ID value in the mutation. Note that the ID is only available
|
|
|
+// if it was provided to the builder or after it was returned from the database.
|
|
|
+func (m *WhatsappMutation) ID() (id uint64, exists bool) {
|
|
|
+ if m.id == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *m.id, true
|
|
|
+}
|
|
|
+
|
|
|
+// IDs queries the database and returns the entity ids that match the mutation's predicate.
|
|
|
+// That means, if the mutation is applied within a transaction with an isolation level such
|
|
|
+// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated
|
|
|
+// or updated by the mutation.
|
|
|
+func (m *WhatsappMutation) IDs(ctx context.Context) ([]uint64, error) {
|
|
|
+ switch {
|
|
|
+ case m.op.Is(OpUpdateOne | OpDeleteOne):
|
|
|
+ id, exists := m.ID()
|
|
|
+ if exists {
|
|
|
+ return []uint64{id}, nil
|
|
|
+ }
|
|
|
+ fallthrough
|
|
|
+ case m.op.Is(OpUpdate | OpDelete):
|
|
|
+ return m.Client().Whatsapp.Query().Where(m.predicates...).IDs(ctx)
|
|
|
+ default:
|
|
|
+ return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// SetCreatedAt sets the "created_at" field.
|
|
|
+func (m *WhatsappMutation) SetCreatedAt(t time.Time) {
|
|
|
+ m.created_at = &t
|
|
|
+}
|
|
|
+
|
|
|
+// CreatedAt returns the value of the "created_at" field in the mutation.
|
|
|
+func (m *WhatsappMutation) CreatedAt() (r time.Time, exists bool) {
|
|
|
+ v := m.created_at
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldCreatedAt returns the old "created_at" field's value of the Whatsapp entity.
|
|
|
+// If the Whatsapp object wasn't provided to the builder, the object is fetched from the database.
|
|
|
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
|
|
+func (m *WhatsappMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldCreatedAt requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.CreatedAt, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ResetCreatedAt resets all changes to the "created_at" field.
|
|
|
+func (m *WhatsappMutation) ResetCreatedAt() {
|
|
|
+ m.created_at = nil
|
|
|
+}
|
|
|
+
|
|
|
+// SetUpdatedAt sets the "updated_at" field.
|
|
|
+func (m *WhatsappMutation) SetUpdatedAt(t time.Time) {
|
|
|
+ m.updated_at = &t
|
|
|
+}
|
|
|
+
|
|
|
+// UpdatedAt returns the value of the "updated_at" field in the mutation.
|
|
|
+func (m *WhatsappMutation) UpdatedAt() (r time.Time, exists bool) {
|
|
|
+ v := m.updated_at
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldUpdatedAt returns the old "updated_at" field's value of the Whatsapp entity.
|
|
|
+// If the Whatsapp object wasn't provided to the builder, the object is fetched from the database.
|
|
|
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
|
|
+func (m *WhatsappMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldUpdatedAt requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.UpdatedAt, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ResetUpdatedAt resets all changes to the "updated_at" field.
|
|
|
+func (m *WhatsappMutation) ResetUpdatedAt() {
|
|
|
+ m.updated_at = nil
|
|
|
+}
|
|
|
+
|
|
|
+// SetStatus sets the "status" field.
|
|
|
+func (m *WhatsappMutation) SetStatus(u uint8) {
|
|
|
+ m.status = &u
|
|
|
+ m.addstatus = nil
|
|
|
+}
|
|
|
+
|
|
|
+// Status returns the value of the "status" field in the mutation.
|
|
|
+func (m *WhatsappMutation) Status() (r uint8, exists bool) {
|
|
|
+ v := m.status
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldStatus returns the old "status" field's value of the Whatsapp entity.
|
|
|
+// If the Whatsapp object wasn't provided to the builder, the object is fetched from the database.
|
|
|
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
|
|
+func (m *WhatsappMutation) OldStatus(ctx context.Context) (v uint8, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldStatus is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldStatus requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldStatus: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.Status, nil
|
|
|
+}
|
|
|
+
|
|
|
+// AddStatus adds u to the "status" field.
|
|
|
+func (m *WhatsappMutation) AddStatus(u int8) {
|
|
|
+ if m.addstatus != nil {
|
|
|
+ *m.addstatus += u
|
|
|
+ } else {
|
|
|
+ m.addstatus = &u
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// AddedStatus returns the value that was added to the "status" field in this mutation.
|
|
|
+func (m *WhatsappMutation) AddedStatus() (r int8, exists bool) {
|
|
|
+ v := m.addstatus
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// ClearStatus clears the value of the "status" field.
|
|
|
+func (m *WhatsappMutation) ClearStatus() {
|
|
|
+ m.status = nil
|
|
|
+ m.addstatus = nil
|
|
|
+ m.clearedFields[whatsapp.FieldStatus] = struct{}{}
|
|
|
+}
|
|
|
+
|
|
|
+// StatusCleared returns if the "status" field was cleared in this mutation.
|
|
|
+func (m *WhatsappMutation) StatusCleared() bool {
|
|
|
+ _, ok := m.clearedFields[whatsapp.FieldStatus]
|
|
|
+ return ok
|
|
|
+}
|
|
|
+
|
|
|
+// ResetStatus resets all changes to the "status" field.
|
|
|
+func (m *WhatsappMutation) ResetStatus() {
|
|
|
+ m.status = nil
|
|
|
+ m.addstatus = nil
|
|
|
+ delete(m.clearedFields, whatsapp.FieldStatus)
|
|
|
+}
|
|
|
+
|
|
|
+// SetDeletedAt sets the "deleted_at" field.
|
|
|
+func (m *WhatsappMutation) SetDeletedAt(t time.Time) {
|
|
|
+ m.deleted_at = &t
|
|
|
+}
|
|
|
+
|
|
|
+// DeletedAt returns the value of the "deleted_at" field in the mutation.
|
|
|
+func (m *WhatsappMutation) DeletedAt() (r time.Time, exists bool) {
|
|
|
+ v := m.deleted_at
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldDeletedAt returns the old "deleted_at" field's value of the Whatsapp entity.
|
|
|
+// If the Whatsapp object wasn't provided to the builder, the object is fetched from the database.
|
|
|
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
|
|
+func (m *WhatsappMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldDeletedAt requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.DeletedAt, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ClearDeletedAt clears the value of the "deleted_at" field.
|
|
|
+func (m *WhatsappMutation) ClearDeletedAt() {
|
|
|
+ m.deleted_at = nil
|
|
|
+ m.clearedFields[whatsapp.FieldDeletedAt] = struct{}{}
|
|
|
+}
|
|
|
+
|
|
|
+// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.
|
|
|
+func (m *WhatsappMutation) DeletedAtCleared() bool {
|
|
|
+ _, ok := m.clearedFields[whatsapp.FieldDeletedAt]
|
|
|
+ return ok
|
|
|
+}
|
|
|
+
|
|
|
+// ResetDeletedAt resets all changes to the "deleted_at" field.
|
|
|
+func (m *WhatsappMutation) ResetDeletedAt() {
|
|
|
+ m.deleted_at = nil
|
|
|
+ delete(m.clearedFields, whatsapp.FieldDeletedAt)
|
|
|
+}
|
|
|
+
|
|
|
+// SetAk sets the "ak" field.
|
|
|
+func (m *WhatsappMutation) SetAk(s string) {
|
|
|
+ m.ak = &s
|
|
|
+}
|
|
|
+
|
|
|
+// Ak returns the value of the "ak" field in the mutation.
|
|
|
+func (m *WhatsappMutation) Ak() (r string, exists bool) {
|
|
|
+ v := m.ak
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldAk returns the old "ak" field's value of the Whatsapp entity.
|
|
|
+// If the Whatsapp object wasn't provided to the builder, the object is fetched from the database.
|
|
|
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
|
|
+func (m *WhatsappMutation) OldAk(ctx context.Context) (v string, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldAk is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldAk requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldAk: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.Ak, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ClearAk clears the value of the "ak" field.
|
|
|
+func (m *WhatsappMutation) ClearAk() {
|
|
|
+ m.ak = nil
|
|
|
+ m.clearedFields[whatsapp.FieldAk] = struct{}{}
|
|
|
+}
|
|
|
+
|
|
|
+// AkCleared returns if the "ak" field was cleared in this mutation.
|
|
|
+func (m *WhatsappMutation) AkCleared() bool {
|
|
|
+ _, ok := m.clearedFields[whatsapp.FieldAk]
|
|
|
+ return ok
|
|
|
+}
|
|
|
+
|
|
|
+// ResetAk resets all changes to the "ak" field.
|
|
|
+func (m *WhatsappMutation) ResetAk() {
|
|
|
+ m.ak = nil
|
|
|
+ delete(m.clearedFields, whatsapp.FieldAk)
|
|
|
+}
|
|
|
+
|
|
|
+// SetSk sets the "sk" field.
|
|
|
+func (m *WhatsappMutation) SetSk(s string) {
|
|
|
+ m.sk = &s
|
|
|
+}
|
|
|
+
|
|
|
+// Sk returns the value of the "sk" field in the mutation.
|
|
|
+func (m *WhatsappMutation) Sk() (r string, exists bool) {
|
|
|
+ v := m.sk
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldSk returns the old "sk" field's value of the Whatsapp entity.
|
|
|
+// If the Whatsapp object wasn't provided to the builder, the object is fetched from the database.
|
|
|
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
|
|
+func (m *WhatsappMutation) OldSk(ctx context.Context) (v string, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldSk is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldSk requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldSk: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.Sk, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ResetSk resets all changes to the "sk" field.
|
|
|
+func (m *WhatsappMutation) ResetSk() {
|
|
|
+ m.sk = nil
|
|
|
+}
|
|
|
+
|
|
|
+// SetCallback sets the "callback" field.
|
|
|
+func (m *WhatsappMutation) SetCallback(s string) {
|
|
|
+ m.callback = &s
|
|
|
+}
|
|
|
+
|
|
|
+// Callback returns the value of the "callback" field in the mutation.
|
|
|
+func (m *WhatsappMutation) Callback() (r string, exists bool) {
|
|
|
+ v := m.callback
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldCallback returns the old "callback" field's value of the Whatsapp entity.
|
|
|
+// If the Whatsapp object wasn't provided to the builder, the object is fetched from the database.
|
|
|
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
|
|
+func (m *WhatsappMutation) OldCallback(ctx context.Context) (v string, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldCallback is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldCallback requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldCallback: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.Callback, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ResetCallback resets all changes to the "callback" field.
|
|
|
+func (m *WhatsappMutation) ResetCallback() {
|
|
|
+ m.callback = nil
|
|
|
+}
|
|
|
+
|
|
|
+// SetAccount sets the "account" field.
|
|
|
+func (m *WhatsappMutation) SetAccount(s string) {
|
|
|
+ m.account = &s
|
|
|
+}
|
|
|
+
|
|
|
+// Account returns the value of the "account" field in the mutation.
|
|
|
+func (m *WhatsappMutation) Account() (r string, exists bool) {
|
|
|
+ v := m.account
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldAccount returns the old "account" field's value of the Whatsapp entity.
|
|
|
+// If the Whatsapp object wasn't provided to the builder, the object is fetched from the database.
|
|
|
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
|
|
+func (m *WhatsappMutation) OldAccount(ctx context.Context) (v string, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldAccount is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldAccount requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldAccount: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.Account, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ResetAccount resets all changes to the "account" field.
|
|
|
+func (m *WhatsappMutation) ResetAccount() {
|
|
|
+ m.account = nil
|
|
|
+}
|
|
|
+
|
|
|
+// SetNickname sets the "nickname" field.
|
|
|
+func (m *WhatsappMutation) SetNickname(s string) {
|
|
|
+ m.nickname = &s
|
|
|
+}
|
|
|
+
|
|
|
+// Nickname returns the value of the "nickname" field in the mutation.
|
|
|
+func (m *WhatsappMutation) Nickname() (r string, exists bool) {
|
|
|
+ v := m.nickname
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldNickname returns the old "nickname" field's value of the Whatsapp entity.
|
|
|
+// If the Whatsapp object wasn't provided to the builder, the object is fetched from the database.
|
|
|
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
|
|
+func (m *WhatsappMutation) OldNickname(ctx context.Context) (v string, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldNickname is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldNickname requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldNickname: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.Nickname, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ResetNickname resets all changes to the "nickname" field.
|
|
|
+func (m *WhatsappMutation) ResetNickname() {
|
|
|
+ m.nickname = nil
|
|
|
+}
|
|
|
+
|
|
|
+// SetPhone sets the "phone" field.
|
|
|
+func (m *WhatsappMutation) SetPhone(s string) {
|
|
|
+ m.phone = &s
|
|
|
+}
|
|
|
+
|
|
|
+// Phone returns the value of the "phone" field in the mutation.
|
|
|
+func (m *WhatsappMutation) Phone() (r string, exists bool) {
|
|
|
+ v := m.phone
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldPhone returns the old "phone" field's value of the Whatsapp entity.
|
|
|
+// If the Whatsapp object wasn't provided to the builder, the object is fetched from the database.
|
|
|
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
|
|
+func (m *WhatsappMutation) OldPhone(ctx context.Context) (v string, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldPhone is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldPhone requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldPhone: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.Phone, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ResetPhone resets all changes to the "phone" field.
|
|
|
+func (m *WhatsappMutation) ResetPhone() {
|
|
|
+ m.phone = nil
|
|
|
+}
|
|
|
+
|
|
|
+// SetOrganizationID sets the "organization_id" field.
|
|
|
+func (m *WhatsappMutation) SetOrganizationID(u uint64) {
|
|
|
+ m.organization_id = &u
|
|
|
+ m.addorganization_id = nil
|
|
|
+}
|
|
|
+
|
|
|
+// OrganizationID returns the value of the "organization_id" field in the mutation.
|
|
|
+func (m *WhatsappMutation) OrganizationID() (r uint64, exists bool) {
|
|
|
+ v := m.organization_id
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldOrganizationID returns the old "organization_id" field's value of the Whatsapp entity.
|
|
|
+// If the Whatsapp object wasn't provided to the builder, the object is fetched from the database.
|
|
|
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
|
|
+func (m *WhatsappMutation) OldOrganizationID(ctx context.Context) (v uint64, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldOrganizationID is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldOrganizationID requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldOrganizationID: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.OrganizationID, nil
|
|
|
+}
|
|
|
+
|
|
|
+// AddOrganizationID adds u to the "organization_id" field.
|
|
|
+func (m *WhatsappMutation) AddOrganizationID(u int64) {
|
|
|
+ if m.addorganization_id != nil {
|
|
|
+ *m.addorganization_id += u
|
|
|
+ } else {
|
|
|
+ m.addorganization_id = &u
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// AddedOrganizationID returns the value that was added to the "organization_id" field in this mutation.
|
|
|
+func (m *WhatsappMutation) AddedOrganizationID() (r int64, exists bool) {
|
|
|
+ v := m.addorganization_id
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// ClearOrganizationID clears the value of the "organization_id" field.
|
|
|
+func (m *WhatsappMutation) ClearOrganizationID() {
|
|
|
+ m.organization_id = nil
|
|
|
+ m.addorganization_id = nil
|
|
|
+ m.clearedFields[whatsapp.FieldOrganizationID] = struct{}{}
|
|
|
+}
|
|
|
+
|
|
|
+// OrganizationIDCleared returns if the "organization_id" field was cleared in this mutation.
|
|
|
+func (m *WhatsappMutation) OrganizationIDCleared() bool {
|
|
|
+ _, ok := m.clearedFields[whatsapp.FieldOrganizationID]
|
|
|
+ return ok
|
|
|
+}
|
|
|
+
|
|
|
+// ResetOrganizationID resets all changes to the "organization_id" field.
|
|
|
+func (m *WhatsappMutation) ResetOrganizationID() {
|
|
|
+ m.organization_id = nil
|
|
|
+ m.addorganization_id = nil
|
|
|
+ delete(m.clearedFields, whatsapp.FieldOrganizationID)
|
|
|
+}
|
|
|
+
|
|
|
+// SetAgentID sets the "agent_id" field.
|
|
|
+func (m *WhatsappMutation) SetAgentID(u uint64) {
|
|
|
+ m.agent_id = &u
|
|
|
+ m.addagent_id = nil
|
|
|
+}
|
|
|
+
|
|
|
+// AgentID returns the value of the "agent_id" field in the mutation.
|
|
|
+func (m *WhatsappMutation) AgentID() (r uint64, exists bool) {
|
|
|
+ v := m.agent_id
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldAgentID returns the old "agent_id" field's value of the Whatsapp entity.
|
|
|
+// If the Whatsapp object wasn't provided to the builder, the object is fetched from the database.
|
|
|
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
|
|
+func (m *WhatsappMutation) OldAgentID(ctx context.Context) (v uint64, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldAgentID is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldAgentID requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldAgentID: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.AgentID, nil
|
|
|
+}
|
|
|
+
|
|
|
+// AddAgentID adds u to the "agent_id" field.
|
|
|
+func (m *WhatsappMutation) AddAgentID(u int64) {
|
|
|
+ if m.addagent_id != nil {
|
|
|
+ *m.addagent_id += u
|
|
|
+ } else {
|
|
|
+ m.addagent_id = &u
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// AddedAgentID returns the value that was added to the "agent_id" field in this mutation.
|
|
|
+func (m *WhatsappMutation) AddedAgentID() (r int64, exists bool) {
|
|
|
+ v := m.addagent_id
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// ResetAgentID resets all changes to the "agent_id" field.
|
|
|
+func (m *WhatsappMutation) ResetAgentID() {
|
|
|
+ m.agent_id = nil
|
|
|
+ m.addagent_id = nil
|
|
|
+}
|
|
|
+
|
|
|
+// SetAPIBase sets the "api_base" field.
|
|
|
+func (m *WhatsappMutation) SetAPIBase(s string) {
|
|
|
+ m.api_base = &s
|
|
|
+}
|
|
|
+
|
|
|
+// APIBase returns the value of the "api_base" field in the mutation.
|
|
|
+func (m *WhatsappMutation) APIBase() (r string, exists bool) {
|
|
|
+ v := m.api_base
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldAPIBase returns the old "api_base" field's value of the Whatsapp entity.
|
|
|
+// If the Whatsapp object wasn't provided to the builder, the object is fetched from the database.
|
|
|
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
|
|
+func (m *WhatsappMutation) OldAPIBase(ctx context.Context) (v string, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldAPIBase is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldAPIBase requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldAPIBase: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.APIBase, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ClearAPIBase clears the value of the "api_base" field.
|
|
|
+func (m *WhatsappMutation) ClearAPIBase() {
|
|
|
+ m.api_base = nil
|
|
|
+ m.clearedFields[whatsapp.FieldAPIBase] = struct{}{}
|
|
|
+}
|
|
|
+
|
|
|
+// APIBaseCleared returns if the "api_base" field was cleared in this mutation.
|
|
|
+func (m *WhatsappMutation) APIBaseCleared() bool {
|
|
|
+ _, ok := m.clearedFields[whatsapp.FieldAPIBase]
|
|
|
+ return ok
|
|
|
+}
|
|
|
+
|
|
|
+// ResetAPIBase resets all changes to the "api_base" field.
|
|
|
+func (m *WhatsappMutation) ResetAPIBase() {
|
|
|
+ m.api_base = nil
|
|
|
+ delete(m.clearedFields, whatsapp.FieldAPIBase)
|
|
|
+}
|
|
|
+
|
|
|
+// SetAPIKey sets the "api_key" field.
|
|
|
+func (m *WhatsappMutation) SetAPIKey(s string) {
|
|
|
+ m.api_key = &s
|
|
|
+}
|
|
|
+
|
|
|
+// APIKey returns the value of the "api_key" field in the mutation.
|
|
|
+func (m *WhatsappMutation) APIKey() (r string, exists bool) {
|
|
|
+ v := m.api_key
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldAPIKey returns the old "api_key" field's value of the Whatsapp entity.
|
|
|
+// If the Whatsapp object wasn't provided to the builder, the object is fetched from the database.
|
|
|
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
|
|
+func (m *WhatsappMutation) OldAPIKey(ctx context.Context) (v string, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldAPIKey is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldAPIKey requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldAPIKey: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.APIKey, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ClearAPIKey clears the value of the "api_key" field.
|
|
|
+func (m *WhatsappMutation) ClearAPIKey() {
|
|
|
+ m.api_key = nil
|
|
|
+ m.clearedFields[whatsapp.FieldAPIKey] = struct{}{}
|
|
|
+}
|
|
|
+
|
|
|
+// APIKeyCleared returns if the "api_key" field was cleared in this mutation.
|
|
|
+func (m *WhatsappMutation) APIKeyCleared() bool {
|
|
|
+ _, ok := m.clearedFields[whatsapp.FieldAPIKey]
|
|
|
+ return ok
|
|
|
+}
|
|
|
+
|
|
|
+// ResetAPIKey resets all changes to the "api_key" field.
|
|
|
+func (m *WhatsappMutation) ResetAPIKey() {
|
|
|
+ m.api_key = nil
|
|
|
+ delete(m.clearedFields, whatsapp.FieldAPIKey)
|
|
|
+}
|
|
|
+
|
|
|
+// SetAllowList sets the "allow_list" field.
|
|
|
+func (m *WhatsappMutation) SetAllowList(s []string) {
|
|
|
+ m.allow_list = &s
|
|
|
+ m.appendallow_list = nil
|
|
|
+}
|
|
|
+
|
|
|
+// AllowList returns the value of the "allow_list" field in the mutation.
|
|
|
+func (m *WhatsappMutation) AllowList() (r []string, exists bool) {
|
|
|
+ v := m.allow_list
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldAllowList returns the old "allow_list" field's value of the Whatsapp entity.
|
|
|
+// If the Whatsapp object wasn't provided to the builder, the object is fetched from the database.
|
|
|
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
|
|
+func (m *WhatsappMutation) OldAllowList(ctx context.Context) (v []string, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldAllowList is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldAllowList requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldAllowList: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.AllowList, nil
|
|
|
+}
|
|
|
+
|
|
|
+// AppendAllowList adds s to the "allow_list" field.
|
|
|
+func (m *WhatsappMutation) AppendAllowList(s []string) {
|
|
|
+ m.appendallow_list = append(m.appendallow_list, s...)
|
|
|
+}
|
|
|
+
|
|
|
+// AppendedAllowList returns the list of values that were appended to the "allow_list" field in this mutation.
|
|
|
+func (m *WhatsappMutation) AppendedAllowList() ([]string, bool) {
|
|
|
+ if len(m.appendallow_list) == 0 {
|
|
|
+ return nil, false
|
|
|
+ }
|
|
|
+ return m.appendallow_list, true
|
|
|
+}
|
|
|
+
|
|
|
+// ResetAllowList resets all changes to the "allow_list" field.
|
|
|
+func (m *WhatsappMutation) ResetAllowList() {
|
|
|
+ m.allow_list = nil
|
|
|
+ m.appendallow_list = nil
|
|
|
+}
|
|
|
+
|
|
|
+// SetGroupAllowList sets the "group_allow_list" field.
|
|
|
+func (m *WhatsappMutation) SetGroupAllowList(s []string) {
|
|
|
+ m.group_allow_list = &s
|
|
|
+ m.appendgroup_allow_list = nil
|
|
|
+}
|
|
|
+
|
|
|
+// GroupAllowList returns the value of the "group_allow_list" field in the mutation.
|
|
|
+func (m *WhatsappMutation) GroupAllowList() (r []string, exists bool) {
|
|
|
+ v := m.group_allow_list
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldGroupAllowList returns the old "group_allow_list" field's value of the Whatsapp entity.
|
|
|
+// If the Whatsapp object wasn't provided to the builder, the object is fetched from the database.
|
|
|
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
|
|
+func (m *WhatsappMutation) OldGroupAllowList(ctx context.Context) (v []string, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldGroupAllowList is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldGroupAllowList requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldGroupAllowList: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.GroupAllowList, nil
|
|
|
+}
|
|
|
+
|
|
|
+// AppendGroupAllowList adds s to the "group_allow_list" field.
|
|
|
+func (m *WhatsappMutation) AppendGroupAllowList(s []string) {
|
|
|
+ m.appendgroup_allow_list = append(m.appendgroup_allow_list, s...)
|
|
|
+}
|
|
|
+
|
|
|
+// AppendedGroupAllowList returns the list of values that were appended to the "group_allow_list" field in this mutation.
|
|
|
+func (m *WhatsappMutation) AppendedGroupAllowList() ([]string, bool) {
|
|
|
+ if len(m.appendgroup_allow_list) == 0 {
|
|
|
+ return nil, false
|
|
|
+ }
|
|
|
+ return m.appendgroup_allow_list, true
|
|
|
+}
|
|
|
+
|
|
|
+// ResetGroupAllowList resets all changes to the "group_allow_list" field.
|
|
|
+func (m *WhatsappMutation) ResetGroupAllowList() {
|
|
|
+ m.group_allow_list = nil
|
|
|
+ m.appendgroup_allow_list = nil
|
|
|
+}
|
|
|
+
|
|
|
+// SetBlockList sets the "block_list" field.
|
|
|
+func (m *WhatsappMutation) SetBlockList(s []string) {
|
|
|
+ m.block_list = &s
|
|
|
+ m.appendblock_list = nil
|
|
|
+}
|
|
|
+
|
|
|
+// BlockList returns the value of the "block_list" field in the mutation.
|
|
|
+func (m *WhatsappMutation) BlockList() (r []string, exists bool) {
|
|
|
+ v := m.block_list
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldBlockList returns the old "block_list" field's value of the Whatsapp entity.
|
|
|
+// If the Whatsapp object wasn't provided to the builder, the object is fetched from the database.
|
|
|
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
|
|
+func (m *WhatsappMutation) OldBlockList(ctx context.Context) (v []string, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldBlockList is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldBlockList requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldBlockList: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.BlockList, nil
|
|
|
+}
|
|
|
+
|
|
|
+// AppendBlockList adds s to the "block_list" field.
|
|
|
+func (m *WhatsappMutation) AppendBlockList(s []string) {
|
|
|
+ m.appendblock_list = append(m.appendblock_list, s...)
|
|
|
+}
|
|
|
+
|
|
|
+// AppendedBlockList returns the list of values that were appended to the "block_list" field in this mutation.
|
|
|
+func (m *WhatsappMutation) AppendedBlockList() ([]string, bool) {
|
|
|
+ if len(m.appendblock_list) == 0 {
|
|
|
+ return nil, false
|
|
|
+ }
|
|
|
+ return m.appendblock_list, true
|
|
|
+}
|
|
|
+
|
|
|
+// ResetBlockList resets all changes to the "block_list" field.
|
|
|
+func (m *WhatsappMutation) ResetBlockList() {
|
|
|
+ m.block_list = nil
|
|
|
+ m.appendblock_list = nil
|
|
|
+}
|
|
|
+
|
|
|
+// SetGroupBlockList sets the "group_block_list" field.
|
|
|
+func (m *WhatsappMutation) SetGroupBlockList(s []string) {
|
|
|
+ m.group_block_list = &s
|
|
|
+ m.appendgroup_block_list = nil
|
|
|
+}
|
|
|
+
|
|
|
+// GroupBlockList returns the value of the "group_block_list" field in the mutation.
|
|
|
+func (m *WhatsappMutation) GroupBlockList() (r []string, exists bool) {
|
|
|
+ v := m.group_block_list
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldGroupBlockList returns the old "group_block_list" field's value of the Whatsapp entity.
|
|
|
+// If the Whatsapp object wasn't provided to the builder, the object is fetched from the database.
|
|
|
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
|
|
+func (m *WhatsappMutation) OldGroupBlockList(ctx context.Context) (v []string, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldGroupBlockList is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldGroupBlockList requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldGroupBlockList: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.GroupBlockList, nil
|
|
|
+}
|
|
|
+
|
|
|
+// AppendGroupBlockList adds s to the "group_block_list" field.
|
|
|
+func (m *WhatsappMutation) AppendGroupBlockList(s []string) {
|
|
|
+ m.appendgroup_block_list = append(m.appendgroup_block_list, s...)
|
|
|
+}
|
|
|
+
|
|
|
+// AppendedGroupBlockList returns the list of values that were appended to the "group_block_list" field in this mutation.
|
|
|
+func (m *WhatsappMutation) AppendedGroupBlockList() ([]string, bool) {
|
|
|
+ if len(m.appendgroup_block_list) == 0 {
|
|
|
+ return nil, false
|
|
|
+ }
|
|
|
+ return m.appendgroup_block_list, true
|
|
|
+}
|
|
|
+
|
|
|
+// ResetGroupBlockList resets all changes to the "group_block_list" field.
|
|
|
+func (m *WhatsappMutation) ResetGroupBlockList() {
|
|
|
+ m.group_block_list = nil
|
|
|
+ m.appendgroup_block_list = nil
|
|
|
+}
|
|
|
+
|
|
|
+// Where appends a list predicates to the WhatsappMutation builder.
|
|
|
+func (m *WhatsappMutation) Where(ps ...predicate.Whatsapp) {
|
|
|
+ m.predicates = append(m.predicates, ps...)
|
|
|
+}
|
|
|
+
|
|
|
+// WhereP appends storage-level predicates to the WhatsappMutation builder. Using this method,
|
|
|
+// users can use type-assertion to append predicates that do not depend on any generated package.
|
|
|
+func (m *WhatsappMutation) WhereP(ps ...func(*sql.Selector)) {
|
|
|
+ p := make([]predicate.Whatsapp, len(ps))
|
|
|
+ for i := range ps {
|
|
|
+ p[i] = ps[i]
|
|
|
+ }
|
|
|
+ m.Where(p...)
|
|
|
+}
|
|
|
+
|
|
|
+// Op returns the operation name.
|
|
|
+func (m *WhatsappMutation) Op() Op {
|
|
|
+ return m.op
|
|
|
+}
|
|
|
+
|
|
|
+// SetOp allows setting the mutation operation.
|
|
|
+func (m *WhatsappMutation) SetOp(op Op) {
|
|
|
+ m.op = op
|
|
|
+}
|
|
|
+
|
|
|
+// Type returns the node type of this mutation (Whatsapp).
|
|
|
+func (m *WhatsappMutation) Type() string {
|
|
|
+ return m.typ
|
|
|
+}
|
|
|
+
|
|
|
+// Fields returns all fields that were changed during this mutation. Note that in
|
|
|
+// order to get all numeric fields that were incremented/decremented, call
|
|
|
+// AddedFields().
|
|
|
+func (m *WhatsappMutation) Fields() []string {
|
|
|
+ fields := make([]string, 0, 18)
|
|
|
+ if m.created_at != nil {
|
|
|
+ fields = append(fields, whatsapp.FieldCreatedAt)
|
|
|
+ }
|
|
|
+ if m.updated_at != nil {
|
|
|
+ fields = append(fields, whatsapp.FieldUpdatedAt)
|
|
|
+ }
|
|
|
+ if m.status != nil {
|
|
|
+ fields = append(fields, whatsapp.FieldStatus)
|
|
|
+ }
|
|
|
+ if m.deleted_at != nil {
|
|
|
+ fields = append(fields, whatsapp.FieldDeletedAt)
|
|
|
+ }
|
|
|
+ if m.ak != nil {
|
|
|
+ fields = append(fields, whatsapp.FieldAk)
|
|
|
+ }
|
|
|
+ if m.sk != nil {
|
|
|
+ fields = append(fields, whatsapp.FieldSk)
|
|
|
+ }
|
|
|
+ if m.callback != nil {
|
|
|
+ fields = append(fields, whatsapp.FieldCallback)
|
|
|
+ }
|
|
|
+ if m.account != nil {
|
|
|
+ fields = append(fields, whatsapp.FieldAccount)
|
|
|
+ }
|
|
|
+ if m.nickname != nil {
|
|
|
+ fields = append(fields, whatsapp.FieldNickname)
|
|
|
+ }
|
|
|
+ if m.phone != nil {
|
|
|
+ fields = append(fields, whatsapp.FieldPhone)
|
|
|
+ }
|
|
|
+ if m.organization_id != nil {
|
|
|
+ fields = append(fields, whatsapp.FieldOrganizationID)
|
|
|
+ }
|
|
|
+ if m.agent_id != nil {
|
|
|
+ fields = append(fields, whatsapp.FieldAgentID)
|
|
|
+ }
|
|
|
+ if m.api_base != nil {
|
|
|
+ fields = append(fields, whatsapp.FieldAPIBase)
|
|
|
+ }
|
|
|
+ if m.api_key != nil {
|
|
|
+ fields = append(fields, whatsapp.FieldAPIKey)
|
|
|
+ }
|
|
|
+ if m.allow_list != nil {
|
|
|
+ fields = append(fields, whatsapp.FieldAllowList)
|
|
|
+ }
|
|
|
+ if m.group_allow_list != nil {
|
|
|
+ fields = append(fields, whatsapp.FieldGroupAllowList)
|
|
|
+ }
|
|
|
+ if m.block_list != nil {
|
|
|
+ fields = append(fields, whatsapp.FieldBlockList)
|
|
|
+ }
|
|
|
+ if m.group_block_list != nil {
|
|
|
+ fields = append(fields, whatsapp.FieldGroupBlockList)
|
|
|
+ }
|
|
|
+ return fields
|
|
|
+}
|
|
|
+
|
|
|
+// Field returns the value of a field with the given name. The second boolean
|
|
|
+// return value indicates that this field was not set, or was not defined in the
|
|
|
+// schema.
|
|
|
+func (m *WhatsappMutation) Field(name string) (ent.Value, bool) {
|
|
|
+ switch name {
|
|
|
+ case whatsapp.FieldCreatedAt:
|
|
|
+ return m.CreatedAt()
|
|
|
+ case whatsapp.FieldUpdatedAt:
|
|
|
+ return m.UpdatedAt()
|
|
|
+ case whatsapp.FieldStatus:
|
|
|
+ return m.Status()
|
|
|
+ case whatsapp.FieldDeletedAt:
|
|
|
+ return m.DeletedAt()
|
|
|
+ case whatsapp.FieldAk:
|
|
|
+ return m.Ak()
|
|
|
+ case whatsapp.FieldSk:
|
|
|
+ return m.Sk()
|
|
|
+ case whatsapp.FieldCallback:
|
|
|
+ return m.Callback()
|
|
|
+ case whatsapp.FieldAccount:
|
|
|
+ return m.Account()
|
|
|
+ case whatsapp.FieldNickname:
|
|
|
+ return m.Nickname()
|
|
|
+ case whatsapp.FieldPhone:
|
|
|
+ return m.Phone()
|
|
|
+ case whatsapp.FieldOrganizationID:
|
|
|
+ return m.OrganizationID()
|
|
|
+ case whatsapp.FieldAgentID:
|
|
|
+ return m.AgentID()
|
|
|
+ case whatsapp.FieldAPIBase:
|
|
|
+ return m.APIBase()
|
|
|
+ case whatsapp.FieldAPIKey:
|
|
|
+ return m.APIKey()
|
|
|
+ case whatsapp.FieldAllowList:
|
|
|
+ return m.AllowList()
|
|
|
+ case whatsapp.FieldGroupAllowList:
|
|
|
+ return m.GroupAllowList()
|
|
|
+ case whatsapp.FieldBlockList:
|
|
|
+ return m.BlockList()
|
|
|
+ case whatsapp.FieldGroupBlockList:
|
|
|
+ return m.GroupBlockList()
|
|
|
+ }
|
|
|
+ return nil, false
|
|
|
+}
|
|
|
+
|
|
|
+// OldField returns the old value of the field from the database. An error is
|
|
|
+// returned if the mutation operation is not UpdateOne, or the query to the
|
|
|
+// database failed.
|
|
|
+func (m *WhatsappMutation) OldField(ctx context.Context, name string) (ent.Value, error) {
|
|
|
+ switch name {
|
|
|
+ case whatsapp.FieldCreatedAt:
|
|
|
+ return m.OldCreatedAt(ctx)
|
|
|
+ case whatsapp.FieldUpdatedAt:
|
|
|
+ return m.OldUpdatedAt(ctx)
|
|
|
+ case whatsapp.FieldStatus:
|
|
|
+ return m.OldStatus(ctx)
|
|
|
+ case whatsapp.FieldDeletedAt:
|
|
|
+ return m.OldDeletedAt(ctx)
|
|
|
+ case whatsapp.FieldAk:
|
|
|
+ return m.OldAk(ctx)
|
|
|
+ case whatsapp.FieldSk:
|
|
|
+ return m.OldSk(ctx)
|
|
|
+ case whatsapp.FieldCallback:
|
|
|
+ return m.OldCallback(ctx)
|
|
|
+ case whatsapp.FieldAccount:
|
|
|
+ return m.OldAccount(ctx)
|
|
|
+ case whatsapp.FieldNickname:
|
|
|
+ return m.OldNickname(ctx)
|
|
|
+ case whatsapp.FieldPhone:
|
|
|
+ return m.OldPhone(ctx)
|
|
|
+ case whatsapp.FieldOrganizationID:
|
|
|
+ return m.OldOrganizationID(ctx)
|
|
|
+ case whatsapp.FieldAgentID:
|
|
|
+ return m.OldAgentID(ctx)
|
|
|
+ case whatsapp.FieldAPIBase:
|
|
|
+ return m.OldAPIBase(ctx)
|
|
|
+ case whatsapp.FieldAPIKey:
|
|
|
+ return m.OldAPIKey(ctx)
|
|
|
+ case whatsapp.FieldAllowList:
|
|
|
+ return m.OldAllowList(ctx)
|
|
|
+ case whatsapp.FieldGroupAllowList:
|
|
|
+ return m.OldGroupAllowList(ctx)
|
|
|
+ case whatsapp.FieldBlockList:
|
|
|
+ return m.OldBlockList(ctx)
|
|
|
+ case whatsapp.FieldGroupBlockList:
|
|
|
+ return m.OldGroupBlockList(ctx)
|
|
|
+ }
|
|
|
+ return nil, fmt.Errorf("unknown Whatsapp field %s", name)
|
|
|
+}
|
|
|
+
|
|
|
+// SetField sets the value of a field with the given name. It returns an error if
|
|
|
+// the field is not defined in the schema, or if the type mismatched the field
|
|
|
+// type.
|
|
|
+func (m *WhatsappMutation) SetField(name string, value ent.Value) error {
|
|
|
+ switch name {
|
|
|
+ case whatsapp.FieldCreatedAt:
|
|
|
+ v, ok := value.(time.Time)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetCreatedAt(v)
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldUpdatedAt:
|
|
|
+ v, ok := value.(time.Time)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetUpdatedAt(v)
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldStatus:
|
|
|
+ v, ok := value.(uint8)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetStatus(v)
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldDeletedAt:
|
|
|
+ v, ok := value.(time.Time)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetDeletedAt(v)
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldAk:
|
|
|
+ v, ok := value.(string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetAk(v)
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldSk:
|
|
|
+ v, ok := value.(string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetSk(v)
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldCallback:
|
|
|
+ v, ok := value.(string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetCallback(v)
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldAccount:
|
|
|
+ v, ok := value.(string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetAccount(v)
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldNickname:
|
|
|
+ v, ok := value.(string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetNickname(v)
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldPhone:
|
|
|
+ v, ok := value.(string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetPhone(v)
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldOrganizationID:
|
|
|
+ v, ok := value.(uint64)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetOrganizationID(v)
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldAgentID:
|
|
|
+ v, ok := value.(uint64)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetAgentID(v)
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldAPIBase:
|
|
|
+ v, ok := value.(string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetAPIBase(v)
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldAPIKey:
|
|
|
+ v, ok := value.(string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetAPIKey(v)
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldAllowList:
|
|
|
+ v, ok := value.([]string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetAllowList(v)
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldGroupAllowList:
|
|
|
+ v, ok := value.([]string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetGroupAllowList(v)
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldBlockList:
|
|
|
+ v, ok := value.([]string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetBlockList(v)
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldGroupBlockList:
|
|
|
+ v, ok := value.([]string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetGroupBlockList(v)
|
|
|
+ return nil
|
|
|
+ }
|
|
|
+ return fmt.Errorf("unknown Whatsapp field %s", name)
|
|
|
+}
|
|
|
+
|
|
|
+// AddedFields returns all numeric fields that were incremented/decremented during
|
|
|
+// this mutation.
|
|
|
+func (m *WhatsappMutation) AddedFields() []string {
|
|
|
+ var fields []string
|
|
|
+ if m.addstatus != nil {
|
|
|
+ fields = append(fields, whatsapp.FieldStatus)
|
|
|
+ }
|
|
|
+ if m.addorganization_id != nil {
|
|
|
+ fields = append(fields, whatsapp.FieldOrganizationID)
|
|
|
+ }
|
|
|
+ if m.addagent_id != nil {
|
|
|
+ fields = append(fields, whatsapp.FieldAgentID)
|
|
|
+ }
|
|
|
+ return fields
|
|
|
+}
|
|
|
+
|
|
|
+// AddedField returns the numeric value that was incremented/decremented on a field
|
|
|
+// with the given name. The second boolean return value indicates that this field
|
|
|
+// was not set, or was not defined in the schema.
|
|
|
+func (m *WhatsappMutation) AddedField(name string) (ent.Value, bool) {
|
|
|
+ switch name {
|
|
|
+ case whatsapp.FieldStatus:
|
|
|
+ return m.AddedStatus()
|
|
|
+ case whatsapp.FieldOrganizationID:
|
|
|
+ return m.AddedOrganizationID()
|
|
|
+ case whatsapp.FieldAgentID:
|
|
|
+ return m.AddedAgentID()
|
|
|
+ }
|
|
|
+ return nil, false
|
|
|
+}
|
|
|
+
|
|
|
+// AddField adds the value to the field with the given name. It returns an error if
|
|
|
+// the field is not defined in the schema, or if the type mismatched the field
|
|
|
+// type.
|
|
|
+func (m *WhatsappMutation) AddField(name string, value ent.Value) error {
|
|
|
+ switch name {
|
|
|
+ case whatsapp.FieldStatus:
|
|
|
+ v, ok := value.(int8)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.AddStatus(v)
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldOrganizationID:
|
|
|
+ v, ok := value.(int64)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.AddOrganizationID(v)
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldAgentID:
|
|
|
+ v, ok := value.(int64)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.AddAgentID(v)
|
|
|
+ return nil
|
|
|
+ }
|
|
|
+ return fmt.Errorf("unknown Whatsapp numeric field %s", name)
|
|
|
+}
|
|
|
+
|
|
|
+// ClearedFields returns all nullable fields that were cleared during this
|
|
|
+// mutation.
|
|
|
+func (m *WhatsappMutation) ClearedFields() []string {
|
|
|
+ var fields []string
|
|
|
+ if m.FieldCleared(whatsapp.FieldStatus) {
|
|
|
+ fields = append(fields, whatsapp.FieldStatus)
|
|
|
+ }
|
|
|
+ if m.FieldCleared(whatsapp.FieldDeletedAt) {
|
|
|
+ fields = append(fields, whatsapp.FieldDeletedAt)
|
|
|
+ }
|
|
|
+ if m.FieldCleared(whatsapp.FieldAk) {
|
|
|
+ fields = append(fields, whatsapp.FieldAk)
|
|
|
+ }
|
|
|
+ if m.FieldCleared(whatsapp.FieldOrganizationID) {
|
|
|
+ fields = append(fields, whatsapp.FieldOrganizationID)
|
|
|
+ }
|
|
|
+ if m.FieldCleared(whatsapp.FieldAPIBase) {
|
|
|
+ fields = append(fields, whatsapp.FieldAPIBase)
|
|
|
+ }
|
|
|
+ if m.FieldCleared(whatsapp.FieldAPIKey) {
|
|
|
+ fields = append(fields, whatsapp.FieldAPIKey)
|
|
|
+ }
|
|
|
+ return fields
|
|
|
+}
|
|
|
+
|
|
|
+// FieldCleared returns a boolean indicating if a field with the given name was
|
|
|
+// cleared in this mutation.
|
|
|
+func (m *WhatsappMutation) FieldCleared(name string) bool {
|
|
|
+ _, ok := m.clearedFields[name]
|
|
|
+ return ok
|
|
|
+}
|
|
|
+
|
|
|
+// ClearField clears the value of the field with the given name. It returns an
|
|
|
+// error if the field is not defined in the schema.
|
|
|
+func (m *WhatsappMutation) ClearField(name string) error {
|
|
|
+ switch name {
|
|
|
+ case whatsapp.FieldStatus:
|
|
|
+ m.ClearStatus()
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldDeletedAt:
|
|
|
+ m.ClearDeletedAt()
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldAk:
|
|
|
+ m.ClearAk()
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldOrganizationID:
|
|
|
+ m.ClearOrganizationID()
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldAPIBase:
|
|
|
+ m.ClearAPIBase()
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldAPIKey:
|
|
|
+ m.ClearAPIKey()
|
|
|
+ return nil
|
|
|
+ }
|
|
|
+ return fmt.Errorf("unknown Whatsapp nullable field %s", name)
|
|
|
+}
|
|
|
+
|
|
|
+// ResetField resets all changes in the mutation for the field with the given name.
|
|
|
+// It returns an error if the field is not defined in the schema.
|
|
|
+func (m *WhatsappMutation) ResetField(name string) error {
|
|
|
+ switch name {
|
|
|
+ case whatsapp.FieldCreatedAt:
|
|
|
+ m.ResetCreatedAt()
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldUpdatedAt:
|
|
|
+ m.ResetUpdatedAt()
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldStatus:
|
|
|
+ m.ResetStatus()
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldDeletedAt:
|
|
|
+ m.ResetDeletedAt()
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldAk:
|
|
|
+ m.ResetAk()
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldSk:
|
|
|
+ m.ResetSk()
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldCallback:
|
|
|
+ m.ResetCallback()
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldAccount:
|
|
|
+ m.ResetAccount()
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldNickname:
|
|
|
+ m.ResetNickname()
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldPhone:
|
|
|
+ m.ResetPhone()
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldOrganizationID:
|
|
|
+ m.ResetOrganizationID()
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldAgentID:
|
|
|
+ m.ResetAgentID()
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldAPIBase:
|
|
|
+ m.ResetAPIBase()
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldAPIKey:
|
|
|
+ m.ResetAPIKey()
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldAllowList:
|
|
|
+ m.ResetAllowList()
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldGroupAllowList:
|
|
|
+ m.ResetGroupAllowList()
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldBlockList:
|
|
|
+ m.ResetBlockList()
|
|
|
+ return nil
|
|
|
+ case whatsapp.FieldGroupBlockList:
|
|
|
+ m.ResetGroupBlockList()
|
|
|
+ return nil
|
|
|
+ }
|
|
|
+ return fmt.Errorf("unknown Whatsapp field %s", name)
|
|
|
+}
|
|
|
+
|
|
|
+// AddedEdges returns all edge names that were set/added in this mutation.
|
|
|
+func (m *WhatsappMutation) AddedEdges() []string {
|
|
|
+ edges := make([]string, 0, 0)
|
|
|
+ return edges
|
|
|
+}
|
|
|
+
|
|
|
+// AddedIDs returns all IDs (to other nodes) that were added for the given edge
|
|
|
+// name in this mutation.
|
|
|
+func (m *WhatsappMutation) AddedIDs(name string) []ent.Value {
|
|
|
+ return nil
|
|
|
+}
|
|
|
+
|
|
|
+// RemovedEdges returns all edge names that were removed in this mutation.
|
|
|
+func (m *WhatsappMutation) RemovedEdges() []string {
|
|
|
+ edges := make([]string, 0, 0)
|
|
|
+ return edges
|
|
|
+}
|
|
|
+
|
|
|
+// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with
|
|
|
+// the given name in this mutation.
|
|
|
+func (m *WhatsappMutation) RemovedIDs(name string) []ent.Value {
|
|
|
+ return nil
|
|
|
+}
|
|
|
+
|
|
|
+// ClearedEdges returns all edge names that were cleared in this mutation.
|
|
|
+func (m *WhatsappMutation) ClearedEdges() []string {
|
|
|
+ edges := make([]string, 0, 0)
|
|
|
+ return edges
|
|
|
+}
|
|
|
+
|
|
|
+// EdgeCleared returns a boolean which indicates if the edge with the given name
|
|
|
+// was cleared in this mutation.
|
|
|
+func (m *WhatsappMutation) EdgeCleared(name string) bool {
|
|
|
+ return false
|
|
|
+}
|
|
|
+
|
|
|
+// ClearEdge clears the value of the edge with the given name. It returns an error
|
|
|
+// if that edge is not defined in the schema.
|
|
|
+func (m *WhatsappMutation) ClearEdge(name string) error {
|
|
|
+ return fmt.Errorf("unknown Whatsapp unique edge %s", name)
|
|
|
+}
|
|
|
+
|
|
|
+// ResetEdge resets all changes to the edge with the given name in this mutation.
|
|
|
+// It returns an error if the edge is not defined in the schema.
|
|
|
+func (m *WhatsappMutation) ResetEdge(name string) error {
|
|
|
+ return fmt.Errorf("unknown Whatsapp edge %s", name)
|
|
|
+}
|
|
|
+
|
|
|
// WorkExperienceMutation represents an operation that mutates the WorkExperience nodes in the graph.
|
|
|
type WorkExperienceMutation struct {
|
|
|
config
|