|
@@ -19224,6 +19224,8 @@ type WxMutation struct {
|
|
|
head_big *string
|
|
|
organization_id *uint64
|
|
|
addorganization_id *int64
|
|
|
+ api_base *string
|
|
|
+ api_key *string
|
|
|
clearedFields map[string]struct{}
|
|
|
server *uint64
|
|
|
clearedserver bool
|
|
@@ -19972,6 +19974,104 @@ func (m *WxMutation) ResetAgentID() {
|
|
|
m.agent = nil
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+func (m *WxMutation) SetAPIBase(s string) {
|
|
|
+ m.api_base = &s
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+func (m *WxMutation) APIBase() (r string, exists bool) {
|
|
|
+ v := m.api_base
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+func (m *WxMutation) 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
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+func (m *WxMutation) ClearAPIBase() {
|
|
|
+ m.api_base = nil
|
|
|
+ m.clearedFields[wx.FieldAPIBase] = struct{}{}
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+func (m *WxMutation) APIBaseCleared() bool {
|
|
|
+ _, ok := m.clearedFields[wx.FieldAPIBase]
|
|
|
+ return ok
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+func (m *WxMutation) ResetAPIBase() {
|
|
|
+ m.api_base = nil
|
|
|
+ delete(m.clearedFields, wx.FieldAPIBase)
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+func (m *WxMutation) SetAPIKey(s string) {
|
|
|
+ m.api_key = &s
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+func (m *WxMutation) APIKey() (r string, exists bool) {
|
|
|
+ v := m.api_key
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+func (m *WxMutation) 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
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+func (m *WxMutation) ClearAPIKey() {
|
|
|
+ m.api_key = nil
|
|
|
+ m.clearedFields[wx.FieldAPIKey] = struct{}{}
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+func (m *WxMutation) APIKeyCleared() bool {
|
|
|
+ _, ok := m.clearedFields[wx.FieldAPIKey]
|
|
|
+ return ok
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+func (m *WxMutation) ResetAPIKey() {
|
|
|
+ m.api_key = nil
|
|
|
+ delete(m.clearedFields, wx.FieldAPIKey)
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
func (m *WxMutation) ClearServer() {
|
|
|
m.clearedserver = true
|
|
@@ -20060,7 +20160,7 @@ func (m *WxMutation) Type() string {
|
|
|
|
|
|
|
|
|
func (m *WxMutation) Fields() []string {
|
|
|
- fields := make([]string, 0, 15)
|
|
|
+ fields := make([]string, 0, 17)
|
|
|
if m.created_at != nil {
|
|
|
fields = append(fields, wx.FieldCreatedAt)
|
|
|
}
|
|
@@ -20106,6 +20206,12 @@ func (m *WxMutation) Fields() []string {
|
|
|
if m.agent != nil {
|
|
|
fields = append(fields, wx.FieldAgentID)
|
|
|
}
|
|
|
+ if m.api_base != nil {
|
|
|
+ fields = append(fields, wx.FieldAPIBase)
|
|
|
+ }
|
|
|
+ if m.api_key != nil {
|
|
|
+ fields = append(fields, wx.FieldAPIKey)
|
|
|
+ }
|
|
|
return fields
|
|
|
}
|
|
|
|
|
@@ -20144,6 +20250,10 @@ func (m *WxMutation) Field(name string) (ent.Value, bool) {
|
|
|
return m.OrganizationID()
|
|
|
case wx.FieldAgentID:
|
|
|
return m.AgentID()
|
|
|
+ case wx.FieldAPIBase:
|
|
|
+ return m.APIBase()
|
|
|
+ case wx.FieldAPIKey:
|
|
|
+ return m.APIKey()
|
|
|
}
|
|
|
return nil, false
|
|
|
}
|
|
@@ -20183,6 +20293,10 @@ func (m *WxMutation) OldField(ctx context.Context, name string) (ent.Value, erro
|
|
|
return m.OldOrganizationID(ctx)
|
|
|
case wx.FieldAgentID:
|
|
|
return m.OldAgentID(ctx)
|
|
|
+ case wx.FieldAPIBase:
|
|
|
+ return m.OldAPIBase(ctx)
|
|
|
+ case wx.FieldAPIKey:
|
|
|
+ return m.OldAPIKey(ctx)
|
|
|
}
|
|
|
return nil, fmt.Errorf("unknown Wx field %s", name)
|
|
|
}
|
|
@@ -20297,6 +20411,20 @@ func (m *WxMutation) SetField(name string, value ent.Value) error {
|
|
|
}
|
|
|
m.SetAgentID(v)
|
|
|
return nil
|
|
|
+ case wx.FieldAPIBase:
|
|
|
+ v, ok := value.(string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetAPIBase(v)
|
|
|
+ return nil
|
|
|
+ case wx.FieldAPIKey:
|
|
|
+ v, ok := value.(string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetAPIKey(v)
|
|
|
+ return nil
|
|
|
}
|
|
|
return fmt.Errorf("unknown Wx field %s", name)
|
|
|
}
|
|
@@ -20366,6 +20494,12 @@ func (m *WxMutation) ClearedFields() []string {
|
|
|
if m.FieldCleared(wx.FieldOrganizationID) {
|
|
|
fields = append(fields, wx.FieldOrganizationID)
|
|
|
}
|
|
|
+ if m.FieldCleared(wx.FieldAPIBase) {
|
|
|
+ fields = append(fields, wx.FieldAPIBase)
|
|
|
+ }
|
|
|
+ if m.FieldCleared(wx.FieldAPIKey) {
|
|
|
+ fields = append(fields, wx.FieldAPIKey)
|
|
|
+ }
|
|
|
return fields
|
|
|
}
|
|
|
|
|
@@ -20392,6 +20526,12 @@ func (m *WxMutation) ClearField(name string) error {
|
|
|
case wx.FieldOrganizationID:
|
|
|
m.ClearOrganizationID()
|
|
|
return nil
|
|
|
+ case wx.FieldAPIBase:
|
|
|
+ m.ClearAPIBase()
|
|
|
+ return nil
|
|
|
+ case wx.FieldAPIKey:
|
|
|
+ m.ClearAPIKey()
|
|
|
+ return nil
|
|
|
}
|
|
|
return fmt.Errorf("unknown Wx nullable field %s", name)
|
|
|
}
|
|
@@ -20445,6 +20585,12 @@ func (m *WxMutation) ResetField(name string) error {
|
|
|
case wx.FieldAgentID:
|
|
|
m.ResetAgentID()
|
|
|
return nil
|
|
|
+ case wx.FieldAPIBase:
|
|
|
+ m.ResetAPIBase()
|
|
|
+ return nil
|
|
|
+ case wx.FieldAPIKey:
|
|
|
+ m.ResetAPIKey()
|
|
|
+ return nil
|
|
|
}
|
|
|
return fmt.Errorf("unknown Wx field %s", name)
|
|
|
}
|