|
@@ -84,24 +84,56 @@ func (xc *XunjiCreate) SetAppKey(s string) *XunjiCreate {
|
|
|
return xc
|
|
|
}
|
|
|
|
|
|
+// SetNillableAppKey sets the "app_key" field if the given value is not nil.
|
|
|
+func (xc *XunjiCreate) SetNillableAppKey(s *string) *XunjiCreate {
|
|
|
+ if s != nil {
|
|
|
+ xc.SetAppKey(*s)
|
|
|
+ }
|
|
|
+ return xc
|
|
|
+}
|
|
|
+
|
|
|
// SetAppSecret sets the "app_secret" field.
|
|
|
func (xc *XunjiCreate) SetAppSecret(s string) *XunjiCreate {
|
|
|
xc.mutation.SetAppSecret(s)
|
|
|
return xc
|
|
|
}
|
|
|
|
|
|
+// SetNillableAppSecret sets the "app_secret" field if the given value is not nil.
|
|
|
+func (xc *XunjiCreate) SetNillableAppSecret(s *string) *XunjiCreate {
|
|
|
+ if s != nil {
|
|
|
+ xc.SetAppSecret(*s)
|
|
|
+ }
|
|
|
+ return xc
|
|
|
+}
|
|
|
+
|
|
|
// SetToken sets the "token" field.
|
|
|
func (xc *XunjiCreate) SetToken(s string) *XunjiCreate {
|
|
|
xc.mutation.SetToken(s)
|
|
|
return xc
|
|
|
}
|
|
|
|
|
|
+// SetNillableToken sets the "token" field if the given value is not nil.
|
|
|
+func (xc *XunjiCreate) SetNillableToken(s *string) *XunjiCreate {
|
|
|
+ if s != nil {
|
|
|
+ xc.SetToken(*s)
|
|
|
+ }
|
|
|
+ return xc
|
|
|
+}
|
|
|
+
|
|
|
// SetEncodingKey sets the "encoding_key" field.
|
|
|
func (xc *XunjiCreate) SetEncodingKey(s string) *XunjiCreate {
|
|
|
xc.mutation.SetEncodingKey(s)
|
|
|
return xc
|
|
|
}
|
|
|
|
|
|
+// SetNillableEncodingKey sets the "encoding_key" field if the given value is not nil.
|
|
|
+func (xc *XunjiCreate) SetNillableEncodingKey(s *string) *XunjiCreate {
|
|
|
+ if s != nil {
|
|
|
+ xc.SetEncodingKey(*s)
|
|
|
+ }
|
|
|
+ return xc
|
|
|
+}
|
|
|
+
|
|
|
// SetOrganizationID sets the "organization_id" field.
|
|
|
func (xc *XunjiCreate) SetOrganizationID(u uint64) *XunjiCreate {
|
|
|
xc.mutation.SetOrganizationID(u)
|
|
@@ -180,18 +212,6 @@ func (xc *XunjiCreate) check() error {
|
|
|
if _, ok := xc.mutation.UpdatedAt(); !ok {
|
|
|
return &ValidationError{Name: "updated_at", err: errors.New(`ent: missing required field "Xunji.updated_at"`)}
|
|
|
}
|
|
|
- if _, ok := xc.mutation.AppKey(); !ok {
|
|
|
- return &ValidationError{Name: "app_key", err: errors.New(`ent: missing required field "Xunji.app_key"`)}
|
|
|
- }
|
|
|
- if _, ok := xc.mutation.AppSecret(); !ok {
|
|
|
- return &ValidationError{Name: "app_secret", err: errors.New(`ent: missing required field "Xunji.app_secret"`)}
|
|
|
- }
|
|
|
- if _, ok := xc.mutation.Token(); !ok {
|
|
|
- return &ValidationError{Name: "token", err: errors.New(`ent: missing required field "Xunji.token"`)}
|
|
|
- }
|
|
|
- if _, ok := xc.mutation.EncodingKey(); !ok {
|
|
|
- return &ValidationError{Name: "encoding_key", err: errors.New(`ent: missing required field "Xunji.encoding_key"`)}
|
|
|
- }
|
|
|
if _, ok := xc.mutation.OrganizationID(); !ok {
|
|
|
return &ValidationError{Name: "organization_id", err: errors.New(`ent: missing required field "Xunji.organization_id"`)}
|
|
|
}
|
|
@@ -387,6 +407,12 @@ func (u *XunjiUpsert) UpdateAppKey() *XunjiUpsert {
|
|
|
return u
|
|
|
}
|
|
|
|
|
|
+// ClearAppKey clears the value of the "app_key" field.
|
|
|
+func (u *XunjiUpsert) ClearAppKey() *XunjiUpsert {
|
|
|
+ u.SetNull(xunji.FieldAppKey)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
// SetAppSecret sets the "app_secret" field.
|
|
|
func (u *XunjiUpsert) SetAppSecret(v string) *XunjiUpsert {
|
|
|
u.Set(xunji.FieldAppSecret, v)
|
|
@@ -399,6 +425,12 @@ func (u *XunjiUpsert) UpdateAppSecret() *XunjiUpsert {
|
|
|
return u
|
|
|
}
|
|
|
|
|
|
+// ClearAppSecret clears the value of the "app_secret" field.
|
|
|
+func (u *XunjiUpsert) ClearAppSecret() *XunjiUpsert {
|
|
|
+ u.SetNull(xunji.FieldAppSecret)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
// SetToken sets the "token" field.
|
|
|
func (u *XunjiUpsert) SetToken(v string) *XunjiUpsert {
|
|
|
u.Set(xunji.FieldToken, v)
|
|
@@ -411,6 +443,12 @@ func (u *XunjiUpsert) UpdateToken() *XunjiUpsert {
|
|
|
return u
|
|
|
}
|
|
|
|
|
|
+// ClearToken clears the value of the "token" field.
|
|
|
+func (u *XunjiUpsert) ClearToken() *XunjiUpsert {
|
|
|
+ u.SetNull(xunji.FieldToken)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
// SetEncodingKey sets the "encoding_key" field.
|
|
|
func (u *XunjiUpsert) SetEncodingKey(v string) *XunjiUpsert {
|
|
|
u.Set(xunji.FieldEncodingKey, v)
|
|
@@ -423,6 +461,12 @@ func (u *XunjiUpsert) UpdateEncodingKey() *XunjiUpsert {
|
|
|
return u
|
|
|
}
|
|
|
|
|
|
+// ClearEncodingKey clears the value of the "encoding_key" field.
|
|
|
+func (u *XunjiUpsert) ClearEncodingKey() *XunjiUpsert {
|
|
|
+ u.SetNull(xunji.FieldEncodingKey)
|
|
|
+ return u
|
|
|
+}
|
|
|
+
|
|
|
// SetOrganizationID sets the "organization_id" field.
|
|
|
func (u *XunjiUpsert) SetOrganizationID(v uint64) *XunjiUpsert {
|
|
|
u.Set(xunji.FieldOrganizationID, v)
|
|
@@ -569,6 +613,13 @@ func (u *XunjiUpsertOne) UpdateAppKey() *XunjiUpsertOne {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+// ClearAppKey clears the value of the "app_key" field.
|
|
|
+func (u *XunjiUpsertOne) ClearAppKey() *XunjiUpsertOne {
|
|
|
+ return u.Update(func(s *XunjiUpsert) {
|
|
|
+ s.ClearAppKey()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
// SetAppSecret sets the "app_secret" field.
|
|
|
func (u *XunjiUpsertOne) SetAppSecret(v string) *XunjiUpsertOne {
|
|
|
return u.Update(func(s *XunjiUpsert) {
|
|
@@ -583,6 +634,13 @@ func (u *XunjiUpsertOne) UpdateAppSecret() *XunjiUpsertOne {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+// ClearAppSecret clears the value of the "app_secret" field.
|
|
|
+func (u *XunjiUpsertOne) ClearAppSecret() *XunjiUpsertOne {
|
|
|
+ return u.Update(func(s *XunjiUpsert) {
|
|
|
+ s.ClearAppSecret()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
// SetToken sets the "token" field.
|
|
|
func (u *XunjiUpsertOne) SetToken(v string) *XunjiUpsertOne {
|
|
|
return u.Update(func(s *XunjiUpsert) {
|
|
@@ -597,6 +655,13 @@ func (u *XunjiUpsertOne) UpdateToken() *XunjiUpsertOne {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+// ClearToken clears the value of the "token" field.
|
|
|
+func (u *XunjiUpsertOne) ClearToken() *XunjiUpsertOne {
|
|
|
+ return u.Update(func(s *XunjiUpsert) {
|
|
|
+ s.ClearToken()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
// SetEncodingKey sets the "encoding_key" field.
|
|
|
func (u *XunjiUpsertOne) SetEncodingKey(v string) *XunjiUpsertOne {
|
|
|
return u.Update(func(s *XunjiUpsert) {
|
|
@@ -611,6 +676,13 @@ func (u *XunjiUpsertOne) UpdateEncodingKey() *XunjiUpsertOne {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+// ClearEncodingKey clears the value of the "encoding_key" field.
|
|
|
+func (u *XunjiUpsertOne) ClearEncodingKey() *XunjiUpsertOne {
|
|
|
+ return u.Update(func(s *XunjiUpsert) {
|
|
|
+ s.ClearEncodingKey()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
// SetOrganizationID sets the "organization_id" field.
|
|
|
func (u *XunjiUpsertOne) SetOrganizationID(v uint64) *XunjiUpsertOne {
|
|
|
return u.Update(func(s *XunjiUpsert) {
|
|
@@ -926,6 +998,13 @@ func (u *XunjiUpsertBulk) UpdateAppKey() *XunjiUpsertBulk {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+// ClearAppKey clears the value of the "app_key" field.
|
|
|
+func (u *XunjiUpsertBulk) ClearAppKey() *XunjiUpsertBulk {
|
|
|
+ return u.Update(func(s *XunjiUpsert) {
|
|
|
+ s.ClearAppKey()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
// SetAppSecret sets the "app_secret" field.
|
|
|
func (u *XunjiUpsertBulk) SetAppSecret(v string) *XunjiUpsertBulk {
|
|
|
return u.Update(func(s *XunjiUpsert) {
|
|
@@ -940,6 +1019,13 @@ func (u *XunjiUpsertBulk) UpdateAppSecret() *XunjiUpsertBulk {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+// ClearAppSecret clears the value of the "app_secret" field.
|
|
|
+func (u *XunjiUpsertBulk) ClearAppSecret() *XunjiUpsertBulk {
|
|
|
+ return u.Update(func(s *XunjiUpsert) {
|
|
|
+ s.ClearAppSecret()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
// SetToken sets the "token" field.
|
|
|
func (u *XunjiUpsertBulk) SetToken(v string) *XunjiUpsertBulk {
|
|
|
return u.Update(func(s *XunjiUpsert) {
|
|
@@ -954,6 +1040,13 @@ func (u *XunjiUpsertBulk) UpdateToken() *XunjiUpsertBulk {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+// ClearToken clears the value of the "token" field.
|
|
|
+func (u *XunjiUpsertBulk) ClearToken() *XunjiUpsertBulk {
|
|
|
+ return u.Update(func(s *XunjiUpsert) {
|
|
|
+ s.ClearToken()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
// SetEncodingKey sets the "encoding_key" field.
|
|
|
func (u *XunjiUpsertBulk) SetEncodingKey(v string) *XunjiUpsertBulk {
|
|
|
return u.Update(func(s *XunjiUpsert) {
|
|
@@ -968,6 +1061,13 @@ func (u *XunjiUpsertBulk) UpdateEncodingKey() *XunjiUpsertBulk {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+// ClearEncodingKey clears the value of the "encoding_key" field.
|
|
|
+func (u *XunjiUpsertBulk) ClearEncodingKey() *XunjiUpsertBulk {
|
|
|
+ return u.Update(func(s *XunjiUpsert) {
|
|
|
+ s.ClearEncodingKey()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
// SetOrganizationID sets the "organization_id" field.
|
|
|
func (u *XunjiUpsertBulk) SetOrganizationID(v uint64) *XunjiUpsertBulk {
|
|
|
return u.Update(func(s *XunjiUpsert) {
|