|
@@ -36960,6 +36960,7 @@ type WhatsappMutation struct {
|
|
|
addstatus *int8
|
|
|
deleted_at *time.Time
|
|
|
wa_id *string
|
|
|
+ wa_name *string
|
|
|
callback *string
|
|
|
account *string
|
|
|
cc *string
|
|
@@ -37331,6 +37332,55 @@ func (m *WhatsappMutation) ResetWaID() {
|
|
|
delete(m.clearedFields, whatsapp.FieldWaID)
|
|
|
}
|
|
|
|
|
|
+// SetWaName sets the "wa_name" field.
|
|
|
+func (m *WhatsappMutation) SetWaName(s string) {
|
|
|
+ m.wa_name = &s
|
|
|
+}
|
|
|
+
|
|
|
+// WaName returns the value of the "wa_name" field in the mutation.
|
|
|
+func (m *WhatsappMutation) WaName() (r string, exists bool) {
|
|
|
+ v := m.wa_name
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldWaName returns the old "wa_name" 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) OldWaName(ctx context.Context) (v string, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldWaName is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldWaName requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldWaName: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.WaName, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ClearWaName clears the value of the "wa_name" field.
|
|
|
+func (m *WhatsappMutation) ClearWaName() {
|
|
|
+ m.wa_name = nil
|
|
|
+ m.clearedFields[whatsapp.FieldWaName] = struct{}{}
|
|
|
+}
|
|
|
+
|
|
|
+// WaNameCleared returns if the "wa_name" field was cleared in this mutation.
|
|
|
+func (m *WhatsappMutation) WaNameCleared() bool {
|
|
|
+ _, ok := m.clearedFields[whatsapp.FieldWaName]
|
|
|
+ return ok
|
|
|
+}
|
|
|
+
|
|
|
+// ResetWaName resets all changes to the "wa_name" field.
|
|
|
+func (m *WhatsappMutation) ResetWaName() {
|
|
|
+ m.wa_name = nil
|
|
|
+ delete(m.clearedFields, whatsapp.FieldWaName)
|
|
|
+}
|
|
|
+
|
|
|
// SetCallback sets the "callback" field.
|
|
|
func (m *WhatsappMutation) SetCallback(s string) {
|
|
|
m.callback = &s
|
|
@@ -38118,7 +38168,7 @@ func (m *WhatsappMutation) Type() string {
|
|
|
// order to get all numeric fields that were incremented/decremented, call
|
|
|
// AddedFields().
|
|
|
func (m *WhatsappMutation) Fields() []string {
|
|
|
- fields := make([]string, 0, 19)
|
|
|
+ fields := make([]string, 0, 20)
|
|
|
if m.created_at != nil {
|
|
|
fields = append(fields, whatsapp.FieldCreatedAt)
|
|
|
}
|
|
@@ -38134,6 +38184,9 @@ func (m *WhatsappMutation) Fields() []string {
|
|
|
if m.wa_id != nil {
|
|
|
fields = append(fields, whatsapp.FieldWaID)
|
|
|
}
|
|
|
+ if m.wa_name != nil {
|
|
|
+ fields = append(fields, whatsapp.FieldWaName)
|
|
|
+ }
|
|
|
if m.callback != nil {
|
|
|
fields = append(fields, whatsapp.FieldCallback)
|
|
|
}
|
|
@@ -38194,6 +38247,8 @@ func (m *WhatsappMutation) Field(name string) (ent.Value, bool) {
|
|
|
return m.DeletedAt()
|
|
|
case whatsapp.FieldWaID:
|
|
|
return m.WaID()
|
|
|
+ case whatsapp.FieldWaName:
|
|
|
+ return m.WaName()
|
|
|
case whatsapp.FieldCallback:
|
|
|
return m.Callback()
|
|
|
case whatsapp.FieldAgentID:
|
|
@@ -38241,6 +38296,8 @@ func (m *WhatsappMutation) OldField(ctx context.Context, name string) (ent.Value
|
|
|
return m.OldDeletedAt(ctx)
|
|
|
case whatsapp.FieldWaID:
|
|
|
return m.OldWaID(ctx)
|
|
|
+ case whatsapp.FieldWaName:
|
|
|
+ return m.OldWaName(ctx)
|
|
|
case whatsapp.FieldCallback:
|
|
|
return m.OldCallback(ctx)
|
|
|
case whatsapp.FieldAgentID:
|
|
@@ -38313,6 +38370,13 @@ func (m *WhatsappMutation) SetField(name string, value ent.Value) error {
|
|
|
}
|
|
|
m.SetWaID(v)
|
|
|
return nil
|
|
|
+ case whatsapp.FieldWaName:
|
|
|
+ v, ok := value.(string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetWaName(v)
|
|
|
+ return nil
|
|
|
case whatsapp.FieldCallback:
|
|
|
v, ok := value.(string)
|
|
|
if !ok {
|
|
@@ -38489,6 +38553,9 @@ func (m *WhatsappMutation) ClearedFields() []string {
|
|
|
if m.FieldCleared(whatsapp.FieldWaID) {
|
|
|
fields = append(fields, whatsapp.FieldWaID)
|
|
|
}
|
|
|
+ if m.FieldCleared(whatsapp.FieldWaName) {
|
|
|
+ fields = append(fields, whatsapp.FieldWaName)
|
|
|
+ }
|
|
|
if m.FieldCleared(whatsapp.FieldCallback) {
|
|
|
fields = append(fields, whatsapp.FieldCallback)
|
|
|
}
|
|
@@ -38539,6 +38606,9 @@ func (m *WhatsappMutation) ClearField(name string) error {
|
|
|
case whatsapp.FieldWaID:
|
|
|
m.ClearWaID()
|
|
|
return nil
|
|
|
+ case whatsapp.FieldWaName:
|
|
|
+ m.ClearWaName()
|
|
|
+ return nil
|
|
|
case whatsapp.FieldCallback:
|
|
|
m.ClearCallback()
|
|
|
return nil
|
|
@@ -38589,6 +38659,9 @@ func (m *WhatsappMutation) ResetField(name string) error {
|
|
|
case whatsapp.FieldWaID:
|
|
|
m.ResetWaID()
|
|
|
return nil
|
|
|
+ case whatsapp.FieldWaName:
|
|
|
+ m.ResetWaName()
|
|
|
+ return nil
|
|
|
case whatsapp.FieldCallback:
|
|
|
m.ResetCallback()
|
|
|
return nil
|