axonhub / internal /ent /runtime /runtime.go
llzai's picture
Upload 1793 files
9853396 verified
Raw
History Blame Contribute Delete
51.6 kB
// Code generated by ent, DO NOT EDIT.
package runtime
import (
"context"
"time"
"github.com/looplj/axonhub/internal/ent/apikey"
"github.com/looplj/axonhub/internal/ent/channel"
"github.com/looplj/axonhub/internal/ent/channelmodelprice"
"github.com/looplj/axonhub/internal/ent/channelmodelpriceversion"
"github.com/looplj/axonhub/internal/ent/channeloverridetemplate"
"github.com/looplj/axonhub/internal/ent/datastorage"
"github.com/looplj/axonhub/internal/ent/model"
"github.com/looplj/axonhub/internal/ent/project"
"github.com/looplj/axonhub/internal/ent/prompt"
"github.com/looplj/axonhub/internal/ent/providerquotastatus"
"github.com/looplj/axonhub/internal/ent/request"
"github.com/looplj/axonhub/internal/ent/requestexecution"
"github.com/looplj/axonhub/internal/ent/role"
"github.com/looplj/axonhub/internal/ent/schema"
"github.com/looplj/axonhub/internal/ent/system"
"github.com/looplj/axonhub/internal/ent/thread"
"github.com/looplj/axonhub/internal/ent/trace"
"github.com/looplj/axonhub/internal/ent/usagelog"
"github.com/looplj/axonhub/internal/ent/user"
"github.com/looplj/axonhub/internal/ent/userproject"
"github.com/looplj/axonhub/internal/ent/userrole"
"github.com/looplj/axonhub/internal/objects"
"entgo.io/ent"
"entgo.io/ent/privacy"
)
// The init function reads all schema descriptors with runtime code
// (default values, validators, hooks and policies) and stitches it
// to their package variables.
func init() {
apikeyMixin := schema.APIKey{}.Mixin()
apikey.Policy = privacy.NewPolicies(schema.APIKey{})
apikey.Hooks[0] = func(next ent.Mutator) ent.Mutator {
return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if err := apikey.Policy.EvalMutation(ctx, m); err != nil {
return nil, err
}
return next.Mutate(ctx, m)
})
}
apikeyMixinHooks1 := apikeyMixin[1].Hooks()
apikey.Hooks[1] = apikeyMixinHooks1[0]
apikeyMixinInters1 := apikeyMixin[1].Interceptors()
apikey.Interceptors[0] = apikeyMixinInters1[0]
apikeyMixinFields0 := apikeyMixin[0].Fields()
_ = apikeyMixinFields0
apikeyMixinFields1 := apikeyMixin[1].Fields()
_ = apikeyMixinFields1
apikeyFields := schema.APIKey{}.Fields()
_ = apikeyFields
// apikeyDescCreatedAt is the schema descriptor for created_at field.
apikeyDescCreatedAt := apikeyMixinFields0[0].Descriptor()
// apikey.DefaultCreatedAt holds the default value on creation for the created_at field.
apikey.DefaultCreatedAt = apikeyDescCreatedAt.Default.(func() time.Time)
// apikeyDescUpdatedAt is the schema descriptor for updated_at field.
apikeyDescUpdatedAt := apikeyMixinFields0[1].Descriptor()
// apikey.DefaultUpdatedAt holds the default value on creation for the updated_at field.
apikey.DefaultUpdatedAt = apikeyDescUpdatedAt.Default.(func() time.Time)
// apikey.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
apikey.UpdateDefaultUpdatedAt = apikeyDescUpdatedAt.UpdateDefault.(func() time.Time)
// apikeyDescDeletedAt is the schema descriptor for deleted_at field.
apikeyDescDeletedAt := apikeyMixinFields1[0].Descriptor()
// apikey.DefaultDeletedAt holds the default value on creation for the deleted_at field.
apikey.DefaultDeletedAt = apikeyDescDeletedAt.Default.(int)
// apikeyDescProjectID is the schema descriptor for project_id field.
apikeyDescProjectID := apikeyFields[1].Descriptor()
// apikey.DefaultProjectID holds the default value on creation for the project_id field.
apikey.DefaultProjectID = apikeyDescProjectID.Default.(int)
// apikeyDescScopes is the schema descriptor for scopes field.
apikeyDescScopes := apikeyFields[6].Descriptor()
// apikey.DefaultScopes holds the default value on creation for the scopes field.
apikey.DefaultScopes = apikeyDescScopes.Default.([]string)
// apikeyDescProfiles is the schema descriptor for profiles field.
apikeyDescProfiles := apikeyFields[7].Descriptor()
// apikey.DefaultProfiles holds the default value on creation for the profiles field.
apikey.DefaultProfiles = apikeyDescProfiles.Default.(*objects.APIKeyProfiles)
channelMixin := schema.Channel{}.Mixin()
channel.Policy = privacy.NewPolicies(schema.Channel{})
channel.Hooks[0] = func(next ent.Mutator) ent.Mutator {
return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if err := channel.Policy.EvalMutation(ctx, m); err != nil {
return nil, err
}
return next.Mutate(ctx, m)
})
}
channelMixinHooks1 := channelMixin[1].Hooks()
channel.Hooks[1] = channelMixinHooks1[0]
channelMixinInters1 := channelMixin[1].Interceptors()
channel.Interceptors[0] = channelMixinInters1[0]
channelMixinFields0 := channelMixin[0].Fields()
_ = channelMixinFields0
channelMixinFields1 := channelMixin[1].Fields()
_ = channelMixinFields1
channelFields := schema.Channel{}.Fields()
_ = channelFields
// channelDescCreatedAt is the schema descriptor for created_at field.
channelDescCreatedAt := channelMixinFields0[0].Descriptor()
// channel.DefaultCreatedAt holds the default value on creation for the created_at field.
channel.DefaultCreatedAt = channelDescCreatedAt.Default.(func() time.Time)
// channelDescUpdatedAt is the schema descriptor for updated_at field.
channelDescUpdatedAt := channelMixinFields0[1].Descriptor()
// channel.DefaultUpdatedAt holds the default value on creation for the updated_at field.
channel.DefaultUpdatedAt = channelDescUpdatedAt.Default.(func() time.Time)
// channel.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
channel.UpdateDefaultUpdatedAt = channelDescUpdatedAt.UpdateDefault.(func() time.Time)
// channelDescDeletedAt is the schema descriptor for deleted_at field.
channelDescDeletedAt := channelMixinFields1[0].Descriptor()
// channel.DefaultDeletedAt holds the default value on creation for the deleted_at field.
channel.DefaultDeletedAt = channelDescDeletedAt.Default.(int)
// channelDescDisabledAPIKeys is the schema descriptor for disabled_api_keys field.
channelDescDisabledAPIKeys := channelFields[5].Descriptor()
// channel.DefaultDisabledAPIKeys holds the default value on creation for the disabled_api_keys field.
channel.DefaultDisabledAPIKeys = channelDescDisabledAPIKeys.Default.([]objects.DisabledAPIKey)
// channelDescAutoSyncSupportedModels is the schema descriptor for auto_sync_supported_models field.
channelDescAutoSyncSupportedModels := channelFields[7].Descriptor()
// channel.DefaultAutoSyncSupportedModels holds the default value on creation for the auto_sync_supported_models field.
channel.DefaultAutoSyncSupportedModels = channelDescAutoSyncSupportedModels.Default.(bool)
// channelDescTags is the schema descriptor for tags field.
channelDescTags := channelFields[8].Descriptor()
// channel.DefaultTags holds the default value on creation for the tags field.
channel.DefaultTags = channelDescTags.Default.([]string)
// channelDescPolicies is the schema descriptor for policies field.
channelDescPolicies := channelFields[10].Descriptor()
// channel.DefaultPolicies holds the default value on creation for the policies field.
channel.DefaultPolicies = channelDescPolicies.Default.(objects.ChannelPolicies)
// channelDescSettings is the schema descriptor for settings field.
channelDescSettings := channelFields[11].Descriptor()
// channel.DefaultSettings holds the default value on creation for the settings field.
channel.DefaultSettings = channelDescSettings.Default.(*objects.ChannelSettings)
// channelDescOrderingWeight is the schema descriptor for ordering_weight field.
channelDescOrderingWeight := channelFields[12].Descriptor()
// channel.DefaultOrderingWeight holds the default value on creation for the ordering_weight field.
channel.DefaultOrderingWeight = channelDescOrderingWeight.Default.(int)
channelmodelpriceMixin := schema.ChannelModelPrice{}.Mixin()
channelmodelprice.Policy = privacy.NewPolicies(schema.ChannelModelPrice{})
channelmodelprice.Hooks[0] = func(next ent.Mutator) ent.Mutator {
return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if err := channelmodelprice.Policy.EvalMutation(ctx, m); err != nil {
return nil, err
}
return next.Mutate(ctx, m)
})
}
channelmodelpriceMixinHooks1 := channelmodelpriceMixin[1].Hooks()
channelmodelprice.Hooks[1] = channelmodelpriceMixinHooks1[0]
channelmodelpriceMixinInters1 := channelmodelpriceMixin[1].Interceptors()
channelmodelprice.Interceptors[0] = channelmodelpriceMixinInters1[0]
channelmodelpriceMixinFields0 := channelmodelpriceMixin[0].Fields()
_ = channelmodelpriceMixinFields0
channelmodelpriceMixinFields1 := channelmodelpriceMixin[1].Fields()
_ = channelmodelpriceMixinFields1
channelmodelpriceFields := schema.ChannelModelPrice{}.Fields()
_ = channelmodelpriceFields
// channelmodelpriceDescCreatedAt is the schema descriptor for created_at field.
channelmodelpriceDescCreatedAt := channelmodelpriceMixinFields0[0].Descriptor()
// channelmodelprice.DefaultCreatedAt holds the default value on creation for the created_at field.
channelmodelprice.DefaultCreatedAt = channelmodelpriceDescCreatedAt.Default.(func() time.Time)
// channelmodelpriceDescUpdatedAt is the schema descriptor for updated_at field.
channelmodelpriceDescUpdatedAt := channelmodelpriceMixinFields0[1].Descriptor()
// channelmodelprice.DefaultUpdatedAt holds the default value on creation for the updated_at field.
channelmodelprice.DefaultUpdatedAt = channelmodelpriceDescUpdatedAt.Default.(func() time.Time)
// channelmodelprice.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
channelmodelprice.UpdateDefaultUpdatedAt = channelmodelpriceDescUpdatedAt.UpdateDefault.(func() time.Time)
// channelmodelpriceDescDeletedAt is the schema descriptor for deleted_at field.
channelmodelpriceDescDeletedAt := channelmodelpriceMixinFields1[0].Descriptor()
// channelmodelprice.DefaultDeletedAt holds the default value on creation for the deleted_at field.
channelmodelprice.DefaultDeletedAt = channelmodelpriceDescDeletedAt.Default.(int)
channelmodelpriceversionMixin := schema.ChannelModelPriceVersion{}.Mixin()
channelmodelpriceversion.Policy = privacy.NewPolicies(schema.ChannelModelPriceVersion{})
channelmodelpriceversion.Hooks[0] = func(next ent.Mutator) ent.Mutator {
return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if err := channelmodelpriceversion.Policy.EvalMutation(ctx, m); err != nil {
return nil, err
}
return next.Mutate(ctx, m)
})
}
channelmodelpriceversionMixinFields0 := channelmodelpriceversionMixin[0].Fields()
_ = channelmodelpriceversionMixinFields0
channelmodelpriceversionFields := schema.ChannelModelPriceVersion{}.Fields()
_ = channelmodelpriceversionFields
// channelmodelpriceversionDescCreatedAt is the schema descriptor for created_at field.
channelmodelpriceversionDescCreatedAt := channelmodelpriceversionMixinFields0[0].Descriptor()
// channelmodelpriceversion.DefaultCreatedAt holds the default value on creation for the created_at field.
channelmodelpriceversion.DefaultCreatedAt = channelmodelpriceversionDescCreatedAt.Default.(func() time.Time)
// channelmodelpriceversionDescUpdatedAt is the schema descriptor for updated_at field.
channelmodelpriceversionDescUpdatedAt := channelmodelpriceversionMixinFields0[1].Descriptor()
// channelmodelpriceversion.DefaultUpdatedAt holds the default value on creation for the updated_at field.
channelmodelpriceversion.DefaultUpdatedAt = channelmodelpriceversionDescUpdatedAt.Default.(func() time.Time)
// channelmodelpriceversion.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
channelmodelpriceversion.UpdateDefaultUpdatedAt = channelmodelpriceversionDescUpdatedAt.UpdateDefault.(func() time.Time)
channeloverridetemplateMixin := schema.ChannelOverrideTemplate{}.Mixin()
channeloverridetemplate.Policy = privacy.NewPolicies(schema.ChannelOverrideTemplate{})
channeloverridetemplate.Hooks[0] = func(next ent.Mutator) ent.Mutator {
return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if err := channeloverridetemplate.Policy.EvalMutation(ctx, m); err != nil {
return nil, err
}
return next.Mutate(ctx, m)
})
}
channeloverridetemplateMixinHooks1 := channeloverridetemplateMixin[1].Hooks()
channeloverridetemplate.Hooks[1] = channeloverridetemplateMixinHooks1[0]
channeloverridetemplateMixinInters1 := channeloverridetemplateMixin[1].Interceptors()
channeloverridetemplate.Interceptors[0] = channeloverridetemplateMixinInters1[0]
channeloverridetemplateMixinFields0 := channeloverridetemplateMixin[0].Fields()
_ = channeloverridetemplateMixinFields0
channeloverridetemplateMixinFields1 := channeloverridetemplateMixin[1].Fields()
_ = channeloverridetemplateMixinFields1
channeloverridetemplateFields := schema.ChannelOverrideTemplate{}.Fields()
_ = channeloverridetemplateFields
// channeloverridetemplateDescCreatedAt is the schema descriptor for created_at field.
channeloverridetemplateDescCreatedAt := channeloverridetemplateMixinFields0[0].Descriptor()
// channeloverridetemplate.DefaultCreatedAt holds the default value on creation for the created_at field.
channeloverridetemplate.DefaultCreatedAt = channeloverridetemplateDescCreatedAt.Default.(func() time.Time)
// channeloverridetemplateDescUpdatedAt is the schema descriptor for updated_at field.
channeloverridetemplateDescUpdatedAt := channeloverridetemplateMixinFields0[1].Descriptor()
// channeloverridetemplate.DefaultUpdatedAt holds the default value on creation for the updated_at field.
channeloverridetemplate.DefaultUpdatedAt = channeloverridetemplateDescUpdatedAt.Default.(func() time.Time)
// channeloverridetemplate.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
channeloverridetemplate.UpdateDefaultUpdatedAt = channeloverridetemplateDescUpdatedAt.UpdateDefault.(func() time.Time)
// channeloverridetemplateDescDeletedAt is the schema descriptor for deleted_at field.
channeloverridetemplateDescDeletedAt := channeloverridetemplateMixinFields1[0].Descriptor()
// channeloverridetemplate.DefaultDeletedAt holds the default value on creation for the deleted_at field.
channeloverridetemplate.DefaultDeletedAt = channeloverridetemplateDescDeletedAt.Default.(int)
// channeloverridetemplateDescName is the schema descriptor for name field.
channeloverridetemplateDescName := channeloverridetemplateFields[1].Descriptor()
// channeloverridetemplate.NameValidator is a validator for the "name" field. It is called by the builders before save.
channeloverridetemplate.NameValidator = channeloverridetemplateDescName.Validators[0].(func(string) error)
// channeloverridetemplateDescOverrideParameters is the schema descriptor for override_parameters field.
channeloverridetemplateDescOverrideParameters := channeloverridetemplateFields[3].Descriptor()
// channeloverridetemplate.DefaultOverrideParameters holds the default value on creation for the override_parameters field.
channeloverridetemplate.DefaultOverrideParameters = channeloverridetemplateDescOverrideParameters.Default.(string)
// channeloverridetemplateDescOverrideHeaders is the schema descriptor for override_headers field.
channeloverridetemplateDescOverrideHeaders := channeloverridetemplateFields[4].Descriptor()
// channeloverridetemplate.DefaultOverrideHeaders holds the default value on creation for the override_headers field.
channeloverridetemplate.DefaultOverrideHeaders = channeloverridetemplateDescOverrideHeaders.Default.([]objects.HeaderEntry)
// channeloverridetemplateDescHeaderOverrideOperations is the schema descriptor for header_override_operations field.
channeloverridetemplateDescHeaderOverrideOperations := channeloverridetemplateFields[5].Descriptor()
// channeloverridetemplate.DefaultHeaderOverrideOperations holds the default value on creation for the header_override_operations field.
channeloverridetemplate.DefaultHeaderOverrideOperations = channeloverridetemplateDescHeaderOverrideOperations.Default.([]objects.OverrideOperation)
// channeloverridetemplateDescBodyOverrideOperations is the schema descriptor for body_override_operations field.
channeloverridetemplateDescBodyOverrideOperations := channeloverridetemplateFields[6].Descriptor()
// channeloverridetemplate.DefaultBodyOverrideOperations holds the default value on creation for the body_override_operations field.
channeloverridetemplate.DefaultBodyOverrideOperations = channeloverridetemplateDescBodyOverrideOperations.Default.([]objects.OverrideOperation)
datastorageMixin := schema.DataStorage{}.Mixin()
datastorage.Policy = privacy.NewPolicies(schema.DataStorage{})
datastorage.Hooks[0] = func(next ent.Mutator) ent.Mutator {
return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if err := datastorage.Policy.EvalMutation(ctx, m); err != nil {
return nil, err
}
return next.Mutate(ctx, m)
})
}
datastorageMixinHooks1 := datastorageMixin[1].Hooks()
datastorage.Hooks[1] = datastorageMixinHooks1[0]
datastorageMixinInters1 := datastorageMixin[1].Interceptors()
datastorage.Interceptors[0] = datastorageMixinInters1[0]
datastorageMixinFields0 := datastorageMixin[0].Fields()
_ = datastorageMixinFields0
datastorageMixinFields1 := datastorageMixin[1].Fields()
_ = datastorageMixinFields1
datastorageFields := schema.DataStorage{}.Fields()
_ = datastorageFields
// datastorageDescCreatedAt is the schema descriptor for created_at field.
datastorageDescCreatedAt := datastorageMixinFields0[0].Descriptor()
// datastorage.DefaultCreatedAt holds the default value on creation for the created_at field.
datastorage.DefaultCreatedAt = datastorageDescCreatedAt.Default.(func() time.Time)
// datastorageDescUpdatedAt is the schema descriptor for updated_at field.
datastorageDescUpdatedAt := datastorageMixinFields0[1].Descriptor()
// datastorage.DefaultUpdatedAt holds the default value on creation for the updated_at field.
datastorage.DefaultUpdatedAt = datastorageDescUpdatedAt.Default.(func() time.Time)
// datastorage.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
datastorage.UpdateDefaultUpdatedAt = datastorageDescUpdatedAt.UpdateDefault.(func() time.Time)
// datastorageDescDeletedAt is the schema descriptor for deleted_at field.
datastorageDescDeletedAt := datastorageMixinFields1[0].Descriptor()
// datastorage.DefaultDeletedAt holds the default value on creation for the deleted_at field.
datastorage.DefaultDeletedAt = datastorageDescDeletedAt.Default.(int)
// datastorageDescPrimary is the schema descriptor for primary field.
datastorageDescPrimary := datastorageFields[2].Descriptor()
// datastorage.DefaultPrimary holds the default value on creation for the primary field.
datastorage.DefaultPrimary = datastorageDescPrimary.Default.(bool)
modelMixin := schema.Model{}.Mixin()
model.Policy = privacy.NewPolicies(schema.Model{})
model.Hooks[0] = func(next ent.Mutator) ent.Mutator {
return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if err := model.Policy.EvalMutation(ctx, m); err != nil {
return nil, err
}
return next.Mutate(ctx, m)
})
}
modelMixinHooks1 := modelMixin[1].Hooks()
model.Hooks[1] = modelMixinHooks1[0]
modelMixinInters1 := modelMixin[1].Interceptors()
model.Interceptors[0] = modelMixinInters1[0]
modelMixinFields0 := modelMixin[0].Fields()
_ = modelMixinFields0
modelMixinFields1 := modelMixin[1].Fields()
_ = modelMixinFields1
modelFields := schema.Model{}.Fields()
_ = modelFields
// modelDescCreatedAt is the schema descriptor for created_at field.
modelDescCreatedAt := modelMixinFields0[0].Descriptor()
// model.DefaultCreatedAt holds the default value on creation for the created_at field.
model.DefaultCreatedAt = modelDescCreatedAt.Default.(func() time.Time)
// modelDescUpdatedAt is the schema descriptor for updated_at field.
modelDescUpdatedAt := modelMixinFields0[1].Descriptor()
// model.DefaultUpdatedAt holds the default value on creation for the updated_at field.
model.DefaultUpdatedAt = modelDescUpdatedAt.Default.(func() time.Time)
// model.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
model.UpdateDefaultUpdatedAt = modelDescUpdatedAt.UpdateDefault.(func() time.Time)
// modelDescDeletedAt is the schema descriptor for deleted_at field.
modelDescDeletedAt := modelMixinFields1[0].Descriptor()
// model.DefaultDeletedAt holds the default value on creation for the deleted_at field.
model.DefaultDeletedAt = modelDescDeletedAt.Default.(int)
projectMixin := schema.Project{}.Mixin()
project.Policy = privacy.NewPolicies(schema.Project{})
project.Hooks[0] = func(next ent.Mutator) ent.Mutator {
return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if err := project.Policy.EvalMutation(ctx, m); err != nil {
return nil, err
}
return next.Mutate(ctx, m)
})
}
projectMixinHooks1 := projectMixin[1].Hooks()
project.Hooks[1] = projectMixinHooks1[0]
projectMixinInters1 := projectMixin[1].Interceptors()
project.Interceptors[0] = projectMixinInters1[0]
projectMixinFields0 := projectMixin[0].Fields()
_ = projectMixinFields0
projectMixinFields1 := projectMixin[1].Fields()
_ = projectMixinFields1
projectFields := schema.Project{}.Fields()
_ = projectFields
// projectDescCreatedAt is the schema descriptor for created_at field.
projectDescCreatedAt := projectMixinFields0[0].Descriptor()
// project.DefaultCreatedAt holds the default value on creation for the created_at field.
project.DefaultCreatedAt = projectDescCreatedAt.Default.(func() time.Time)
// projectDescUpdatedAt is the schema descriptor for updated_at field.
projectDescUpdatedAt := projectMixinFields0[1].Descriptor()
// project.DefaultUpdatedAt holds the default value on creation for the updated_at field.
project.DefaultUpdatedAt = projectDescUpdatedAt.Default.(func() time.Time)
// project.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
project.UpdateDefaultUpdatedAt = projectDescUpdatedAt.UpdateDefault.(func() time.Time)
// projectDescDeletedAt is the schema descriptor for deleted_at field.
projectDescDeletedAt := projectMixinFields1[0].Descriptor()
// project.DefaultDeletedAt holds the default value on creation for the deleted_at field.
project.DefaultDeletedAt = projectDescDeletedAt.Default.(int)
// projectDescDescription is the schema descriptor for description field.
projectDescDescription := projectFields[1].Descriptor()
// project.DefaultDescription holds the default value on creation for the description field.
project.DefaultDescription = projectDescDescription.Default.(string)
promptMixin := schema.Prompt{}.Mixin()
prompt.Policy = privacy.NewPolicies(schema.Prompt{})
prompt.Hooks[0] = func(next ent.Mutator) ent.Mutator {
return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if err := prompt.Policy.EvalMutation(ctx, m); err != nil {
return nil, err
}
return next.Mutate(ctx, m)
})
}
promptMixinHooks1 := promptMixin[1].Hooks()
prompt.Hooks[1] = promptMixinHooks1[0]
promptMixinInters1 := promptMixin[1].Interceptors()
prompt.Interceptors[0] = promptMixinInters1[0]
promptMixinFields0 := promptMixin[0].Fields()
_ = promptMixinFields0
promptMixinFields1 := promptMixin[1].Fields()
_ = promptMixinFields1
promptFields := schema.Prompt{}.Fields()
_ = promptFields
// promptDescCreatedAt is the schema descriptor for created_at field.
promptDescCreatedAt := promptMixinFields0[0].Descriptor()
// prompt.DefaultCreatedAt holds the default value on creation for the created_at field.
prompt.DefaultCreatedAt = promptDescCreatedAt.Default.(func() time.Time)
// promptDescUpdatedAt is the schema descriptor for updated_at field.
promptDescUpdatedAt := promptMixinFields0[1].Descriptor()
// prompt.DefaultUpdatedAt holds the default value on creation for the updated_at field.
prompt.DefaultUpdatedAt = promptDescUpdatedAt.Default.(func() time.Time)
// prompt.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
prompt.UpdateDefaultUpdatedAt = promptDescUpdatedAt.UpdateDefault.(func() time.Time)
// promptDescDeletedAt is the schema descriptor for deleted_at field.
promptDescDeletedAt := promptMixinFields1[0].Descriptor()
// prompt.DefaultDeletedAt holds the default value on creation for the deleted_at field.
prompt.DefaultDeletedAt = promptDescDeletedAt.Default.(int)
// promptDescDescription is the schema descriptor for description field.
promptDescDescription := promptFields[2].Descriptor()
// prompt.DefaultDescription holds the default value on creation for the description field.
prompt.DefaultDescription = promptDescDescription.Default.(string)
providerquotastatusMixin := schema.ProviderQuotaStatus{}.Mixin()
providerquotastatusMixinHooks1 := providerquotastatusMixin[1].Hooks()
providerquotastatus.Hooks[0] = providerquotastatusMixinHooks1[0]
providerquotastatusMixinInters1 := providerquotastatusMixin[1].Interceptors()
providerquotastatus.Interceptors[0] = providerquotastatusMixinInters1[0]
providerquotastatusMixinFields0 := providerquotastatusMixin[0].Fields()
_ = providerquotastatusMixinFields0
providerquotastatusMixinFields1 := providerquotastatusMixin[1].Fields()
_ = providerquotastatusMixinFields1
providerquotastatusFields := schema.ProviderQuotaStatus{}.Fields()
_ = providerquotastatusFields
// providerquotastatusDescCreatedAt is the schema descriptor for created_at field.
providerquotastatusDescCreatedAt := providerquotastatusMixinFields0[0].Descriptor()
// providerquotastatus.DefaultCreatedAt holds the default value on creation for the created_at field.
providerquotastatus.DefaultCreatedAt = providerquotastatusDescCreatedAt.Default.(func() time.Time)
// providerquotastatusDescUpdatedAt is the schema descriptor for updated_at field.
providerquotastatusDescUpdatedAt := providerquotastatusMixinFields0[1].Descriptor()
// providerquotastatus.DefaultUpdatedAt holds the default value on creation for the updated_at field.
providerquotastatus.DefaultUpdatedAt = providerquotastatusDescUpdatedAt.Default.(func() time.Time)
// providerquotastatus.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
providerquotastatus.UpdateDefaultUpdatedAt = providerquotastatusDescUpdatedAt.UpdateDefault.(func() time.Time)
// providerquotastatusDescDeletedAt is the schema descriptor for deleted_at field.
providerquotastatusDescDeletedAt := providerquotastatusMixinFields1[0].Descriptor()
// providerquotastatus.DefaultDeletedAt holds the default value on creation for the deleted_at field.
providerquotastatus.DefaultDeletedAt = providerquotastatusDescDeletedAt.Default.(int)
// providerquotastatusDescReady is the schema descriptor for ready field.
providerquotastatusDescReady := providerquotastatusFields[5].Descriptor()
// providerquotastatus.DefaultReady holds the default value on creation for the ready field.
providerquotastatus.DefaultReady = providerquotastatusDescReady.Default.(bool)
requestMixin := schema.Request{}.Mixin()
request.Policy = privacy.NewPolicies(schema.Request{})
request.Hooks[0] = func(next ent.Mutator) ent.Mutator {
return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if err := request.Policy.EvalMutation(ctx, m); err != nil {
return nil, err
}
return next.Mutate(ctx, m)
})
}
requestMixinFields0 := requestMixin[0].Fields()
_ = requestMixinFields0
requestFields := schema.Request{}.Fields()
_ = requestFields
// requestDescCreatedAt is the schema descriptor for created_at field.
requestDescCreatedAt := requestMixinFields0[0].Descriptor()
// request.DefaultCreatedAt holds the default value on creation for the created_at field.
request.DefaultCreatedAt = requestDescCreatedAt.Default.(func() time.Time)
// requestDescUpdatedAt is the schema descriptor for updated_at field.
requestDescUpdatedAt := requestMixinFields0[1].Descriptor()
// request.DefaultUpdatedAt holds the default value on creation for the updated_at field.
request.DefaultUpdatedAt = requestDescUpdatedAt.Default.(func() time.Time)
// request.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
request.UpdateDefaultUpdatedAt = requestDescUpdatedAt.UpdateDefault.(func() time.Time)
// requestDescProjectID is the schema descriptor for project_id field.
requestDescProjectID := requestFields[1].Descriptor()
// request.DefaultProjectID holds the default value on creation for the project_id field.
request.DefaultProjectID = requestDescProjectID.Default.(int)
// requestDescFormat is the schema descriptor for format field.
requestDescFormat := requestFields[6].Descriptor()
// request.DefaultFormat holds the default value on creation for the format field.
request.DefaultFormat = requestDescFormat.Default.(string)
// requestDescStream is the schema descriptor for stream field.
requestDescStream := requestFields[14].Descriptor()
// request.DefaultStream holds the default value on creation for the stream field.
request.DefaultStream = requestDescStream.Default.(bool)
// requestDescClientIP is the schema descriptor for client_ip field.
requestDescClientIP := requestFields[15].Descriptor()
// request.DefaultClientIP holds the default value on creation for the client_ip field.
request.DefaultClientIP = requestDescClientIP.Default.(string)
requestexecutionMixin := schema.RequestExecution{}.Mixin()
requestexecutionMixinFields0 := requestexecutionMixin[0].Fields()
_ = requestexecutionMixinFields0
requestexecutionFields := schema.RequestExecution{}.Fields()
_ = requestexecutionFields
// requestexecutionDescCreatedAt is the schema descriptor for created_at field.
requestexecutionDescCreatedAt := requestexecutionMixinFields0[0].Descriptor()
// requestexecution.DefaultCreatedAt holds the default value on creation for the created_at field.
requestexecution.DefaultCreatedAt = requestexecutionDescCreatedAt.Default.(func() time.Time)
// requestexecutionDescUpdatedAt is the schema descriptor for updated_at field.
requestexecutionDescUpdatedAt := requestexecutionMixinFields0[1].Descriptor()
// requestexecution.DefaultUpdatedAt holds the default value on creation for the updated_at field.
requestexecution.DefaultUpdatedAt = requestexecutionDescUpdatedAt.Default.(func() time.Time)
// requestexecution.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
requestexecution.UpdateDefaultUpdatedAt = requestexecutionDescUpdatedAt.UpdateDefault.(func() time.Time)
// requestexecutionDescProjectID is the schema descriptor for project_id field.
requestexecutionDescProjectID := requestexecutionFields[0].Descriptor()
// requestexecution.DefaultProjectID holds the default value on creation for the project_id field.
requestexecution.DefaultProjectID = requestexecutionDescProjectID.Default.(int)
// requestexecutionDescFormat is the schema descriptor for format field.
requestexecutionDescFormat := requestexecutionFields[6].Descriptor()
// requestexecution.DefaultFormat holds the default value on creation for the format field.
requestexecution.DefaultFormat = requestexecutionDescFormat.Default.(string)
// requestexecutionDescStream is the schema descriptor for stream field.
requestexecutionDescStream := requestexecutionFields[12].Descriptor()
// requestexecution.DefaultStream holds the default value on creation for the stream field.
requestexecution.DefaultStream = requestexecutionDescStream.Default.(bool)
roleMixin := schema.Role{}.Mixin()
role.Policy = privacy.NewPolicies(schema.Role{})
role.Hooks[0] = func(next ent.Mutator) ent.Mutator {
return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if err := role.Policy.EvalMutation(ctx, m); err != nil {
return nil, err
}
return next.Mutate(ctx, m)
})
}
roleMixinHooks1 := roleMixin[1].Hooks()
role.Hooks[1] = roleMixinHooks1[0]
roleMixinInters1 := roleMixin[1].Interceptors()
role.Interceptors[0] = roleMixinInters1[0]
roleMixinFields0 := roleMixin[0].Fields()
_ = roleMixinFields0
roleMixinFields1 := roleMixin[1].Fields()
_ = roleMixinFields1
roleFields := schema.Role{}.Fields()
_ = roleFields
// roleDescCreatedAt is the schema descriptor for created_at field.
roleDescCreatedAt := roleMixinFields0[0].Descriptor()
// role.DefaultCreatedAt holds the default value on creation for the created_at field.
role.DefaultCreatedAt = roleDescCreatedAt.Default.(func() time.Time)
// roleDescUpdatedAt is the schema descriptor for updated_at field.
roleDescUpdatedAt := roleMixinFields0[1].Descriptor()
// role.DefaultUpdatedAt holds the default value on creation for the updated_at field.
role.DefaultUpdatedAt = roleDescUpdatedAt.Default.(func() time.Time)
// role.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
role.UpdateDefaultUpdatedAt = roleDescUpdatedAt.UpdateDefault.(func() time.Time)
// roleDescDeletedAt is the schema descriptor for deleted_at field.
roleDescDeletedAt := roleMixinFields1[0].Descriptor()
// role.DefaultDeletedAt holds the default value on creation for the deleted_at field.
role.DefaultDeletedAt = roleDescDeletedAt.Default.(int)
// roleDescScopes is the schema descriptor for scopes field.
roleDescScopes := roleFields[3].Descriptor()
// role.DefaultScopes holds the default value on creation for the scopes field.
role.DefaultScopes = roleDescScopes.Default.([]string)
systemMixin := schema.System{}.Mixin()
system.Policy = privacy.NewPolicies(schema.System{})
system.Hooks[0] = func(next ent.Mutator) ent.Mutator {
return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if err := system.Policy.EvalMutation(ctx, m); err != nil {
return nil, err
}
return next.Mutate(ctx, m)
})
}
systemMixinHooks1 := systemMixin[1].Hooks()
system.Hooks[1] = systemMixinHooks1[0]
systemMixinInters1 := systemMixin[1].Interceptors()
system.Interceptors[0] = systemMixinInters1[0]
systemMixinFields0 := systemMixin[0].Fields()
_ = systemMixinFields0
systemMixinFields1 := systemMixin[1].Fields()
_ = systemMixinFields1
systemFields := schema.System{}.Fields()
_ = systemFields
// systemDescCreatedAt is the schema descriptor for created_at field.
systemDescCreatedAt := systemMixinFields0[0].Descriptor()
// system.DefaultCreatedAt holds the default value on creation for the created_at field.
system.DefaultCreatedAt = systemDescCreatedAt.Default.(func() time.Time)
// systemDescUpdatedAt is the schema descriptor for updated_at field.
systemDescUpdatedAt := systemMixinFields0[1].Descriptor()
// system.DefaultUpdatedAt holds the default value on creation for the updated_at field.
system.DefaultUpdatedAt = systemDescUpdatedAt.Default.(func() time.Time)
// system.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
system.UpdateDefaultUpdatedAt = systemDescUpdatedAt.UpdateDefault.(func() time.Time)
// systemDescDeletedAt is the schema descriptor for deleted_at field.
systemDescDeletedAt := systemMixinFields1[0].Descriptor()
// system.DefaultDeletedAt holds the default value on creation for the deleted_at field.
system.DefaultDeletedAt = systemDescDeletedAt.Default.(int)
threadMixin := schema.Thread{}.Mixin()
thread.Policy = privacy.NewPolicies(schema.Thread{})
thread.Hooks[0] = func(next ent.Mutator) ent.Mutator {
return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if err := thread.Policy.EvalMutation(ctx, m); err != nil {
return nil, err
}
return next.Mutate(ctx, m)
})
}
threadMixinFields0 := threadMixin[0].Fields()
_ = threadMixinFields0
threadFields := schema.Thread{}.Fields()
_ = threadFields
// threadDescCreatedAt is the schema descriptor for created_at field.
threadDescCreatedAt := threadMixinFields0[0].Descriptor()
// thread.DefaultCreatedAt holds the default value on creation for the created_at field.
thread.DefaultCreatedAt = threadDescCreatedAt.Default.(func() time.Time)
// threadDescUpdatedAt is the schema descriptor for updated_at field.
threadDescUpdatedAt := threadMixinFields0[1].Descriptor()
// thread.DefaultUpdatedAt holds the default value on creation for the updated_at field.
thread.DefaultUpdatedAt = threadDescUpdatedAt.Default.(func() time.Time)
// thread.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
thread.UpdateDefaultUpdatedAt = threadDescUpdatedAt.UpdateDefault.(func() time.Time)
traceMixin := schema.Trace{}.Mixin()
trace.Policy = privacy.NewPolicies(schema.Trace{})
trace.Hooks[0] = func(next ent.Mutator) ent.Mutator {
return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if err := trace.Policy.EvalMutation(ctx, m); err != nil {
return nil, err
}
return next.Mutate(ctx, m)
})
}
traceMixinFields0 := traceMixin[0].Fields()
_ = traceMixinFields0
traceFields := schema.Trace{}.Fields()
_ = traceFields
// traceDescCreatedAt is the schema descriptor for created_at field.
traceDescCreatedAt := traceMixinFields0[0].Descriptor()
// trace.DefaultCreatedAt holds the default value on creation for the created_at field.
trace.DefaultCreatedAt = traceDescCreatedAt.Default.(func() time.Time)
// traceDescUpdatedAt is the schema descriptor for updated_at field.
traceDescUpdatedAt := traceMixinFields0[1].Descriptor()
// trace.DefaultUpdatedAt holds the default value on creation for the updated_at field.
trace.DefaultUpdatedAt = traceDescUpdatedAt.Default.(func() time.Time)
// trace.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
trace.UpdateDefaultUpdatedAt = traceDescUpdatedAt.UpdateDefault.(func() time.Time)
usagelogMixin := schema.UsageLog{}.Mixin()
usagelog.Policy = privacy.NewPolicies(schema.UsageLog{})
usagelog.Hooks[0] = func(next ent.Mutator) ent.Mutator {
return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if err := usagelog.Policy.EvalMutation(ctx, m); err != nil {
return nil, err
}
return next.Mutate(ctx, m)
})
}
usagelogMixinFields0 := usagelogMixin[0].Fields()
_ = usagelogMixinFields0
usagelogFields := schema.UsageLog{}.Fields()
_ = usagelogFields
// usagelogDescCreatedAt is the schema descriptor for created_at field.
usagelogDescCreatedAt := usagelogMixinFields0[0].Descriptor()
// usagelog.DefaultCreatedAt holds the default value on creation for the created_at field.
usagelog.DefaultCreatedAt = usagelogDescCreatedAt.Default.(func() time.Time)
// usagelogDescUpdatedAt is the schema descriptor for updated_at field.
usagelogDescUpdatedAt := usagelogMixinFields0[1].Descriptor()
// usagelog.DefaultUpdatedAt holds the default value on creation for the updated_at field.
usagelog.DefaultUpdatedAt = usagelogDescUpdatedAt.Default.(func() time.Time)
// usagelog.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
usagelog.UpdateDefaultUpdatedAt = usagelogDescUpdatedAt.UpdateDefault.(func() time.Time)
// usagelogDescProjectID is the schema descriptor for project_id field.
usagelogDescProjectID := usagelogFields[2].Descriptor()
// usagelog.DefaultProjectID holds the default value on creation for the project_id field.
usagelog.DefaultProjectID = usagelogDescProjectID.Default.(int)
// usagelogDescPromptTokens is the schema descriptor for prompt_tokens field.
usagelogDescPromptTokens := usagelogFields[5].Descriptor()
// usagelog.DefaultPromptTokens holds the default value on creation for the prompt_tokens field.
usagelog.DefaultPromptTokens = usagelogDescPromptTokens.Default.(int64)
// usagelogDescCompletionTokens is the schema descriptor for completion_tokens field.
usagelogDescCompletionTokens := usagelogFields[6].Descriptor()
// usagelog.DefaultCompletionTokens holds the default value on creation for the completion_tokens field.
usagelog.DefaultCompletionTokens = usagelogDescCompletionTokens.Default.(int64)
// usagelogDescTotalTokens is the schema descriptor for total_tokens field.
usagelogDescTotalTokens := usagelogFields[7].Descriptor()
// usagelog.DefaultTotalTokens holds the default value on creation for the total_tokens field.
usagelog.DefaultTotalTokens = usagelogDescTotalTokens.Default.(int64)
// usagelogDescPromptAudioTokens is the schema descriptor for prompt_audio_tokens field.
usagelogDescPromptAudioTokens := usagelogFields[8].Descriptor()
// usagelog.DefaultPromptAudioTokens holds the default value on creation for the prompt_audio_tokens field.
usagelog.DefaultPromptAudioTokens = usagelogDescPromptAudioTokens.Default.(int64)
// usagelogDescPromptCachedTokens is the schema descriptor for prompt_cached_tokens field.
usagelogDescPromptCachedTokens := usagelogFields[9].Descriptor()
// usagelog.DefaultPromptCachedTokens holds the default value on creation for the prompt_cached_tokens field.
usagelog.DefaultPromptCachedTokens = usagelogDescPromptCachedTokens.Default.(int64)
// usagelogDescPromptWriteCachedTokens is the schema descriptor for prompt_write_cached_tokens field.
usagelogDescPromptWriteCachedTokens := usagelogFields[10].Descriptor()
// usagelog.DefaultPromptWriteCachedTokens holds the default value on creation for the prompt_write_cached_tokens field.
usagelog.DefaultPromptWriteCachedTokens = usagelogDescPromptWriteCachedTokens.Default.(int64)
// usagelogDescPromptWriteCachedTokens5m is the schema descriptor for prompt_write_cached_tokens_5m field.
usagelogDescPromptWriteCachedTokens5m := usagelogFields[11].Descriptor()
// usagelog.DefaultPromptWriteCachedTokens5m holds the default value on creation for the prompt_write_cached_tokens_5m field.
usagelog.DefaultPromptWriteCachedTokens5m = usagelogDescPromptWriteCachedTokens5m.Default.(int64)
// usagelogDescPromptWriteCachedTokens1h is the schema descriptor for prompt_write_cached_tokens_1h field.
usagelogDescPromptWriteCachedTokens1h := usagelogFields[12].Descriptor()
// usagelog.DefaultPromptWriteCachedTokens1h holds the default value on creation for the prompt_write_cached_tokens_1h field.
usagelog.DefaultPromptWriteCachedTokens1h = usagelogDescPromptWriteCachedTokens1h.Default.(int64)
// usagelogDescCompletionAudioTokens is the schema descriptor for completion_audio_tokens field.
usagelogDescCompletionAudioTokens := usagelogFields[13].Descriptor()
// usagelog.DefaultCompletionAudioTokens holds the default value on creation for the completion_audio_tokens field.
usagelog.DefaultCompletionAudioTokens = usagelogDescCompletionAudioTokens.Default.(int64)
// usagelogDescCompletionReasoningTokens is the schema descriptor for completion_reasoning_tokens field.
usagelogDescCompletionReasoningTokens := usagelogFields[14].Descriptor()
// usagelog.DefaultCompletionReasoningTokens holds the default value on creation for the completion_reasoning_tokens field.
usagelog.DefaultCompletionReasoningTokens = usagelogDescCompletionReasoningTokens.Default.(int64)
// usagelogDescCompletionAcceptedPredictionTokens is the schema descriptor for completion_accepted_prediction_tokens field.
usagelogDescCompletionAcceptedPredictionTokens := usagelogFields[15].Descriptor()
// usagelog.DefaultCompletionAcceptedPredictionTokens holds the default value on creation for the completion_accepted_prediction_tokens field.
usagelog.DefaultCompletionAcceptedPredictionTokens = usagelogDescCompletionAcceptedPredictionTokens.Default.(int64)
// usagelogDescCompletionRejectedPredictionTokens is the schema descriptor for completion_rejected_prediction_tokens field.
usagelogDescCompletionRejectedPredictionTokens := usagelogFields[16].Descriptor()
// usagelog.DefaultCompletionRejectedPredictionTokens holds the default value on creation for the completion_rejected_prediction_tokens field.
usagelog.DefaultCompletionRejectedPredictionTokens = usagelogDescCompletionRejectedPredictionTokens.Default.(int64)
// usagelogDescFormat is the schema descriptor for format field.
usagelogDescFormat := usagelogFields[18].Descriptor()
// usagelog.DefaultFormat holds the default value on creation for the format field.
usagelog.DefaultFormat = usagelogDescFormat.Default.(string)
// usagelogDescCostItems is the schema descriptor for cost_items field.
usagelogDescCostItems := usagelogFields[20].Descriptor()
// usagelog.DefaultCostItems holds the default value on creation for the cost_items field.
usagelog.DefaultCostItems = usagelogDescCostItems.Default.([]objects.CostItem)
userMixin := schema.User{}.Mixin()
user.Policy = privacy.NewPolicies(schema.User{})
user.Hooks[0] = func(next ent.Mutator) ent.Mutator {
return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if err := user.Policy.EvalMutation(ctx, m); err != nil {
return nil, err
}
return next.Mutate(ctx, m)
})
}
userMixinHooks1 := userMixin[1].Hooks()
user.Hooks[1] = userMixinHooks1[0]
userMixinInters1 := userMixin[1].Interceptors()
user.Interceptors[0] = userMixinInters1[0]
userMixinFields0 := userMixin[0].Fields()
_ = userMixinFields0
userMixinFields1 := userMixin[1].Fields()
_ = userMixinFields1
userFields := schema.User{}.Fields()
_ = userFields
// userDescCreatedAt is the schema descriptor for created_at field.
userDescCreatedAt := userMixinFields0[0].Descriptor()
// user.DefaultCreatedAt holds the default value on creation for the created_at field.
user.DefaultCreatedAt = userDescCreatedAt.Default.(func() time.Time)
// userDescUpdatedAt is the schema descriptor for updated_at field.
userDescUpdatedAt := userMixinFields0[1].Descriptor()
// user.DefaultUpdatedAt holds the default value on creation for the updated_at field.
user.DefaultUpdatedAt = userDescUpdatedAt.Default.(func() time.Time)
// user.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
user.UpdateDefaultUpdatedAt = userDescUpdatedAt.UpdateDefault.(func() time.Time)
// userDescDeletedAt is the schema descriptor for deleted_at field.
userDescDeletedAt := userMixinFields1[0].Descriptor()
// user.DefaultDeletedAt holds the default value on creation for the deleted_at field.
user.DefaultDeletedAt = userDescDeletedAt.Default.(int)
// userDescPreferLanguage is the schema descriptor for prefer_language field.
userDescPreferLanguage := userFields[2].Descriptor()
// user.DefaultPreferLanguage holds the default value on creation for the prefer_language field.
user.DefaultPreferLanguage = userDescPreferLanguage.Default.(string)
// userDescFirstName is the schema descriptor for first_name field.
userDescFirstName := userFields[4].Descriptor()
// user.DefaultFirstName holds the default value on creation for the first_name field.
user.DefaultFirstName = userDescFirstName.Default.(string)
// userDescLastName is the schema descriptor for last_name field.
userDescLastName := userFields[5].Descriptor()
// user.DefaultLastName holds the default value on creation for the last_name field.
user.DefaultLastName = userDescLastName.Default.(string)
// userDescIsOwner is the schema descriptor for is_owner field.
userDescIsOwner := userFields[7].Descriptor()
// user.DefaultIsOwner holds the default value on creation for the is_owner field.
user.DefaultIsOwner = userDescIsOwner.Default.(bool)
// userDescScopes is the schema descriptor for scopes field.
userDescScopes := userFields[8].Descriptor()
// user.DefaultScopes holds the default value on creation for the scopes field.
user.DefaultScopes = userDescScopes.Default.([]string)
userprojectMixin := schema.UserProject{}.Mixin()
userproject.Policy = privacy.NewPolicies(schema.UserProject{})
userproject.Hooks[0] = func(next ent.Mutator) ent.Mutator {
return ent.MutateFunc(func(ctx context.Context, m ent.Mutation) (ent.Value, error) {
if err := userproject.Policy.EvalMutation(ctx, m); err != nil {
return nil, err
}
return next.Mutate(ctx, m)
})
}
userprojectMixinFields0 := userprojectMixin[0].Fields()
_ = userprojectMixinFields0
userprojectFields := schema.UserProject{}.Fields()
_ = userprojectFields
// userprojectDescCreatedAt is the schema descriptor for created_at field.
userprojectDescCreatedAt := userprojectMixinFields0[0].Descriptor()
// userproject.DefaultCreatedAt holds the default value on creation for the created_at field.
userproject.DefaultCreatedAt = userprojectDescCreatedAt.Default.(func() time.Time)
// userprojectDescUpdatedAt is the schema descriptor for updated_at field.
userprojectDescUpdatedAt := userprojectMixinFields0[1].Descriptor()
// userproject.DefaultUpdatedAt holds the default value on creation for the updated_at field.
userproject.DefaultUpdatedAt = userprojectDescUpdatedAt.Default.(func() time.Time)
// userproject.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
userproject.UpdateDefaultUpdatedAt = userprojectDescUpdatedAt.UpdateDefault.(func() time.Time)
// userprojectDescIsOwner is the schema descriptor for is_owner field.
userprojectDescIsOwner := userprojectFields[2].Descriptor()
// userproject.DefaultIsOwner holds the default value on creation for the is_owner field.
userproject.DefaultIsOwner = userprojectDescIsOwner.Default.(bool)
// userprojectDescScopes is the schema descriptor for scopes field.
userprojectDescScopes := userprojectFields[3].Descriptor()
// userproject.DefaultScopes holds the default value on creation for the scopes field.
userproject.DefaultScopes = userprojectDescScopes.Default.([]string)
userroleFields := schema.UserRole{}.Fields()
_ = userroleFields
// userroleDescCreatedAt is the schema descriptor for created_at field.
userroleDescCreatedAt := userroleFields[2].Descriptor()
// userrole.DefaultCreatedAt holds the default value on creation for the created_at field.
userrole.DefaultCreatedAt = userroleDescCreatedAt.Default.(func() time.Time)
// userroleDescUpdatedAt is the schema descriptor for updated_at field.
userroleDescUpdatedAt := userroleFields[3].Descriptor()
// userrole.DefaultUpdatedAt holds the default value on creation for the updated_at field.
userrole.DefaultUpdatedAt = userroleDescUpdatedAt.Default.(func() time.Time)
// userrole.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
userrole.UpdateDefaultUpdatedAt = userroleDescUpdatedAt.UpdateDefault.(func() time.Time)
}
const (
Version = "v0.14.5" // Version of ent codegen.
Sum = "h1:Rj2WOYJtCkWyFo6a+5wB3EfBRP0rnx1fMk6gGA0UUe4=" // Sum of ent codegen.
)