// Code generated by ent, DO NOT EDIT.

package ent

import (
	"time"

	"github.com/AvengeMedia/dankcalendar/core/ent/account"
	"github.com/AvengeMedia/dankcalendar/core/ent/calendar"
	"github.com/AvengeMedia/dankcalendar/core/ent/event"
	"github.com/AvengeMedia/dankcalendar/core/ent/invitationstate"
	"github.com/AvengeMedia/dankcalendar/core/ent/reminderstate"
	"github.com/AvengeMedia/dankcalendar/core/ent/schema"
	"github.com/AvengeMedia/dankcalendar/core/ent/secret"
	"github.com/AvengeMedia/dankcalendar/core/ent/task"
)

// 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() {
	accountFields := schema.Account{}.Fields()
	_ = accountFields
	// accountDescDisplayName is the schema descriptor for display_name field.
	accountDescDisplayName := accountFields[2].Descriptor()
	// account.DisplayNameValidator is a validator for the "display_name" field. It is called by the builders before save.
	account.DisplayNameValidator = accountDescDisplayName.Validators[0].(func(string) error)
	// accountDescNeedsReauth is the schema descriptor for needs_reauth field.
	accountDescNeedsReauth := accountFields[4].Descriptor()
	// account.DefaultNeedsReauth holds the default value on creation for the needs_reauth field.
	account.DefaultNeedsReauth = accountDescNeedsReauth.Default.(bool)
	// accountDescCreatedAt is the schema descriptor for created_at field.
	accountDescCreatedAt := accountFields[7].Descriptor()
	// account.DefaultCreatedAt holds the default value on creation for the created_at field.
	account.DefaultCreatedAt = accountDescCreatedAt.Default.(func() time.Time)
	// accountDescUpdatedAt is the schema descriptor for updated_at field.
	accountDescUpdatedAt := accountFields[8].Descriptor()
	// account.DefaultUpdatedAt holds the default value on creation for the updated_at field.
	account.DefaultUpdatedAt = accountDescUpdatedAt.Default.(func() time.Time)
	// account.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
	account.UpdateDefaultUpdatedAt = accountDescUpdatedAt.UpdateDefault.(func() time.Time)
	// accountDescID is the schema descriptor for id field.
	accountDescID := accountFields[0].Descriptor()
	// account.IDValidator is a validator for the "id" field. It is called by the builders before save.
	account.IDValidator = func() func(string) error {
		validators := accountDescID.Validators
		fns := [...]func(string) error{
			validators[0].(func(string) error),
			validators[1].(func(string) error),
		}
		return func(id string) error {
			for _, fn := range fns {
				if err := fn(id); err != nil {
					return err
				}
			}
			return nil
		}
	}()
	calendarFields := schema.Calendar{}.Fields()
	_ = calendarFields
	// calendarDescRemoteID is the schema descriptor for remote_id field.
	calendarDescRemoteID := calendarFields[1].Descriptor()
	// calendar.RemoteIDValidator is a validator for the "remote_id" field. It is called by the builders before save.
	calendar.RemoteIDValidator = calendarDescRemoteID.Validators[0].(func(string) error)
	// calendarDescName is the schema descriptor for name field.
	calendarDescName := calendarFields[2].Descriptor()
	// calendar.NameValidator is a validator for the "name" field. It is called by the builders before save.
	calendar.NameValidator = calendarDescName.Validators[0].(func(string) error)
	// calendarDescReadOnly is the schema descriptor for read_only field.
	calendarDescReadOnly := calendarFields[7].Descriptor()
	// calendar.DefaultReadOnly holds the default value on creation for the read_only field.
	calendar.DefaultReadOnly = calendarDescReadOnly.Default.(bool)
	// calendarDescHidden is the schema descriptor for hidden field.
	calendarDescHidden := calendarFields[8].Descriptor()
	// calendar.DefaultHidden holds the default value on creation for the hidden field.
	calendar.DefaultHidden = calendarDescHidden.Default.(bool)
	// calendarDescSyncDisabled is the schema descriptor for sync_disabled field.
	calendarDescSyncDisabled := calendarFields[9].Descriptor()
	// calendar.DefaultSyncDisabled holds the default value on creation for the sync_disabled field.
	calendar.DefaultSyncDisabled = calendarDescSyncDisabled.Default.(bool)
	// calendarDescCreatedAt is the schema descriptor for created_at field.
	calendarDescCreatedAt := calendarFields[13].Descriptor()
	// calendar.DefaultCreatedAt holds the default value on creation for the created_at field.
	calendar.DefaultCreatedAt = calendarDescCreatedAt.Default.(func() time.Time)
	// calendarDescUpdatedAt is the schema descriptor for updated_at field.
	calendarDescUpdatedAt := calendarFields[14].Descriptor()
	// calendar.DefaultUpdatedAt holds the default value on creation for the updated_at field.
	calendar.DefaultUpdatedAt = calendarDescUpdatedAt.Default.(func() time.Time)
	// calendar.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
	calendar.UpdateDefaultUpdatedAt = calendarDescUpdatedAt.UpdateDefault.(func() time.Time)
	// calendarDescID is the schema descriptor for id field.
	calendarDescID := calendarFields[0].Descriptor()
	// calendar.IDValidator is a validator for the "id" field. It is called by the builders before save.
	calendar.IDValidator = func() func(string) error {
		validators := calendarDescID.Validators
		fns := [...]func(string) error{
			validators[0].(func(string) error),
			validators[1].(func(string) error),
		}
		return func(id string) error {
			for _, fn := range fns {
				if err := fn(id); err != nil {
					return err
				}
			}
			return nil
		}
	}()
	eventFields := schema.Event{}.Fields()
	_ = eventFields
	// eventDescUID is the schema descriptor for uid field.
	eventDescUID := eventFields[1].Descriptor()
	// event.UIDValidator is a validator for the "uid" field. It is called by the builders before save.
	event.UIDValidator = eventDescUID.Validators[0].(func(string) error)
	// eventDescAllDay is the schema descriptor for all_day field.
	eventDescAllDay := eventFields[12].Descriptor()
	// event.DefaultAllDay holds the default value on creation for the all_day field.
	event.DefaultAllDay = eventDescAllDay.Default.(bool)
	// eventDescCreated is the schema descriptor for created field.
	eventDescCreated := eventFields[25].Descriptor()
	// event.DefaultCreated holds the default value on creation for the created field.
	event.DefaultCreated = eventDescCreated.Default.(func() time.Time)
	// eventDescUpdated is the schema descriptor for updated field.
	eventDescUpdated := eventFields[26].Descriptor()
	// event.DefaultUpdated holds the default value on creation for the updated field.
	event.DefaultUpdated = eventDescUpdated.Default.(func() time.Time)
	// event.UpdateDefaultUpdated holds the default value on update for the updated field.
	event.UpdateDefaultUpdated = eventDescUpdated.UpdateDefault.(func() time.Time)
	// eventDescID is the schema descriptor for id field.
	eventDescID := eventFields[0].Descriptor()
	// event.IDValidator is a validator for the "id" field. It is called by the builders before save.
	event.IDValidator = func() func(string) error {
		validators := eventDescID.Validators
		fns := [...]func(string) error{
			validators[0].(func(string) error),
			validators[1].(func(string) error),
		}
		return func(id string) error {
			for _, fn := range fns {
				if err := fn(id); err != nil {
					return err
				}
			}
			return nil
		}
	}()
	invitationstateFields := schema.InvitationState{}.Fields()
	_ = invitationstateFields
	// invitationstateDescCalendarID is the schema descriptor for calendar_id field.
	invitationstateDescCalendarID := invitationstateFields[0].Descriptor()
	// invitationstate.CalendarIDValidator is a validator for the "calendar_id" field. It is called by the builders before save.
	invitationstate.CalendarIDValidator = invitationstateDescCalendarID.Validators[0].(func(string) error)
	// invitationstateDescUID is the schema descriptor for uid field.
	invitationstateDescUID := invitationstateFields[1].Descriptor()
	// invitationstate.UIDValidator is a validator for the "uid" field. It is called by the builders before save.
	invitationstate.UIDValidator = invitationstateDescUID.Validators[0].(func(string) error)
	// invitationstateDescNotifiedAt is the schema descriptor for notified_at field.
	invitationstateDescNotifiedAt := invitationstateFields[3].Descriptor()
	// invitationstate.DefaultNotifiedAt holds the default value on creation for the notified_at field.
	invitationstate.DefaultNotifiedAt = invitationstateDescNotifiedAt.Default.(func() time.Time)
	reminderstateFields := schema.ReminderState{}.Fields()
	_ = reminderstateFields
	// reminderstateDescCalendarID is the schema descriptor for calendar_id field.
	reminderstateDescCalendarID := reminderstateFields[0].Descriptor()
	// reminderstate.CalendarIDValidator is a validator for the "calendar_id" field. It is called by the builders before save.
	reminderstate.CalendarIDValidator = reminderstateDescCalendarID.Validators[0].(func(string) error)
	// reminderstateDescUID is the schema descriptor for uid field.
	reminderstateDescUID := reminderstateFields[1].Descriptor()
	// reminderstate.UIDValidator is a validator for the "uid" field. It is called by the builders before save.
	reminderstate.UIDValidator = reminderstateDescUID.Validators[0].(func(string) error)
	// reminderstateDescFiredAt is the schema descriptor for fired_at field.
	reminderstateDescFiredAt := reminderstateFields[4].Descriptor()
	// reminderstate.DefaultFiredAt holds the default value on creation for the fired_at field.
	reminderstate.DefaultFiredAt = reminderstateDescFiredAt.Default.(func() time.Time)
	secretFields := schema.Secret{}.Fields()
	_ = secretFields
	// secretDescKey is the schema descriptor for key field.
	secretDescKey := secretFields[1].Descriptor()
	// secret.KeyValidator is a validator for the "key" field. It is called by the builders before save.
	secret.KeyValidator = secretDescKey.Validators[0].(func(string) error)
	// secretDescCreatedAt is the schema descriptor for created_at field.
	secretDescCreatedAt := secretFields[3].Descriptor()
	// secret.DefaultCreatedAt holds the default value on creation for the created_at field.
	secret.DefaultCreatedAt = secretDescCreatedAt.Default.(func() time.Time)
	// secretDescUpdatedAt is the schema descriptor for updated_at field.
	secretDescUpdatedAt := secretFields[4].Descriptor()
	// secret.DefaultUpdatedAt holds the default value on creation for the updated_at field.
	secret.DefaultUpdatedAt = secretDescUpdatedAt.Default.(func() time.Time)
	// secret.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
	secret.UpdateDefaultUpdatedAt = secretDescUpdatedAt.UpdateDefault.(func() time.Time)
	// secretDescID is the schema descriptor for id field.
	secretDescID := secretFields[0].Descriptor()
	// secret.IDValidator is a validator for the "id" field. It is called by the builders before save.
	secret.IDValidator = func() func(string) error {
		validators := secretDescID.Validators
		fns := [...]func(string) error{
			validators[0].(func(string) error),
			validators[1].(func(string) error),
		}
		return func(id string) error {
			for _, fn := range fns {
				if err := fn(id); err != nil {
					return err
				}
			}
			return nil
		}
	}()
	taskFields := schema.Task{}.Fields()
	_ = taskFields
	// taskDescUID is the schema descriptor for uid field.
	taskDescUID := taskFields[1].Descriptor()
	// task.UIDValidator is a validator for the "uid" field. It is called by the builders before save.
	task.UIDValidator = taskDescUID.Validators[0].(func(string) error)
	// taskDescPriority is the schema descriptor for priority field.
	taskDescPriority := taskFields[8].Descriptor()
	// task.DefaultPriority holds the default value on creation for the priority field.
	task.DefaultPriority = taskDescPriority.Default.(int)
	// taskDescPercentComplete is the schema descriptor for percent_complete field.
	taskDescPercentComplete := taskFields[9].Descriptor()
	// task.DefaultPercentComplete holds the default value on creation for the percent_complete field.
	task.DefaultPercentComplete = taskDescPercentComplete.Default.(int)
	// taskDescAllDay is the schema descriptor for all_day field.
	taskDescAllDay := taskFields[13].Descriptor()
	// task.DefaultAllDay holds the default value on creation for the all_day field.
	task.DefaultAllDay = taskDescAllDay.Default.(bool)
	// taskDescCreated is the schema descriptor for created field.
	taskDescCreated := taskFields[21].Descriptor()
	// task.DefaultCreated holds the default value on creation for the created field.
	task.DefaultCreated = taskDescCreated.Default.(func() time.Time)
	// taskDescUpdated is the schema descriptor for updated field.
	taskDescUpdated := taskFields[22].Descriptor()
	// task.DefaultUpdated holds the default value on creation for the updated field.
	task.DefaultUpdated = taskDescUpdated.Default.(func() time.Time)
	// task.UpdateDefaultUpdated holds the default value on update for the updated field.
	task.UpdateDefaultUpdated = taskDescUpdated.UpdateDefault.(func() time.Time)
	// taskDescID is the schema descriptor for id field.
	taskDescID := taskFields[0].Descriptor()
	// task.IDValidator is a validator for the "id" field. It is called by the builders before save.
	task.IDValidator = func() func(string) error {
		validators := taskDescID.Validators
		fns := [...]func(string) error{
			validators[0].(func(string) error),
			validators[1].(func(string) error),
		}
		return func(id string) error {
			for _, fn := range fns {
				if err := fn(id); err != nil {
					return err
				}
			}
			return nil
		}
	}()
}
