| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279 |
- // Code generated by ent, DO NOT EDIT.
- package pendingauthsession
- import (
- "time"
- "entgo.io/ent/dialect/sql"
- "entgo.io/ent/dialect/sql/sqlgraph"
- )
- const (
- // Label holds the string label denoting the pendingauthsession type in the database.
- Label = "pending_auth_session"
- // FieldID holds the string denoting the id field in the database.
- FieldID = "id"
- // FieldCreatedAt holds the string denoting the created_at field in the database.
- FieldCreatedAt = "created_at"
- // FieldUpdatedAt holds the string denoting the updated_at field in the database.
- FieldUpdatedAt = "updated_at"
- // FieldSessionToken holds the string denoting the session_token field in the database.
- FieldSessionToken = "session_token"
- // FieldIntent holds the string denoting the intent field in the database.
- FieldIntent = "intent"
- // FieldProviderType holds the string denoting the provider_type field in the database.
- FieldProviderType = "provider_type"
- // FieldProviderKey holds the string denoting the provider_key field in the database.
- FieldProviderKey = "provider_key"
- // FieldProviderSubject holds the string denoting the provider_subject field in the database.
- FieldProviderSubject = "provider_subject"
- // FieldTargetUserID holds the string denoting the target_user_id field in the database.
- FieldTargetUserID = "target_user_id"
- // FieldRedirectTo holds the string denoting the redirect_to field in the database.
- FieldRedirectTo = "redirect_to"
- // FieldResolvedEmail holds the string denoting the resolved_email field in the database.
- FieldResolvedEmail = "resolved_email"
- // FieldRegistrationPasswordHash holds the string denoting the registration_password_hash field in the database.
- FieldRegistrationPasswordHash = "registration_password_hash"
- // FieldUpstreamIdentityClaims holds the string denoting the upstream_identity_claims field in the database.
- FieldUpstreamIdentityClaims = "upstream_identity_claims"
- // FieldLocalFlowState holds the string denoting the local_flow_state field in the database.
- FieldLocalFlowState = "local_flow_state"
- // FieldBrowserSessionKey holds the string denoting the browser_session_key field in the database.
- FieldBrowserSessionKey = "browser_session_key"
- // FieldCompletionCodeHash holds the string denoting the completion_code_hash field in the database.
- FieldCompletionCodeHash = "completion_code_hash"
- // FieldCompletionCodeExpiresAt holds the string denoting the completion_code_expires_at field in the database.
- FieldCompletionCodeExpiresAt = "completion_code_expires_at"
- // FieldEmailVerifiedAt holds the string denoting the email_verified_at field in the database.
- FieldEmailVerifiedAt = "email_verified_at"
- // FieldPasswordVerifiedAt holds the string denoting the password_verified_at field in the database.
- FieldPasswordVerifiedAt = "password_verified_at"
- // FieldTotpVerifiedAt holds the string denoting the totp_verified_at field in the database.
- FieldTotpVerifiedAt = "totp_verified_at"
- // FieldExpiresAt holds the string denoting the expires_at field in the database.
- FieldExpiresAt = "expires_at"
- // FieldConsumedAt holds the string denoting the consumed_at field in the database.
- FieldConsumedAt = "consumed_at"
- // EdgeTargetUser holds the string denoting the target_user edge name in mutations.
- EdgeTargetUser = "target_user"
- // EdgeAdoptionDecision holds the string denoting the adoption_decision edge name in mutations.
- EdgeAdoptionDecision = "adoption_decision"
- // Table holds the table name of the pendingauthsession in the database.
- Table = "pending_auth_sessions"
- // TargetUserTable is the table that holds the target_user relation/edge.
- TargetUserTable = "pending_auth_sessions"
- // TargetUserInverseTable is the table name for the User entity.
- // It exists in this package in order to avoid circular dependency with the "user" package.
- TargetUserInverseTable = "users"
- // TargetUserColumn is the table column denoting the target_user relation/edge.
- TargetUserColumn = "target_user_id"
- // AdoptionDecisionTable is the table that holds the adoption_decision relation/edge.
- AdoptionDecisionTable = "identity_adoption_decisions"
- // AdoptionDecisionInverseTable is the table name for the IdentityAdoptionDecision entity.
- // It exists in this package in order to avoid circular dependency with the "identityadoptiondecision" package.
- AdoptionDecisionInverseTable = "identity_adoption_decisions"
- // AdoptionDecisionColumn is the table column denoting the adoption_decision relation/edge.
- AdoptionDecisionColumn = "pending_auth_session_id"
- )
- // Columns holds all SQL columns for pendingauthsession fields.
- var Columns = []string{
- FieldID,
- FieldCreatedAt,
- FieldUpdatedAt,
- FieldSessionToken,
- FieldIntent,
- FieldProviderType,
- FieldProviderKey,
- FieldProviderSubject,
- FieldTargetUserID,
- FieldRedirectTo,
- FieldResolvedEmail,
- FieldRegistrationPasswordHash,
- FieldUpstreamIdentityClaims,
- FieldLocalFlowState,
- FieldBrowserSessionKey,
- FieldCompletionCodeHash,
- FieldCompletionCodeExpiresAt,
- FieldEmailVerifiedAt,
- FieldPasswordVerifiedAt,
- FieldTotpVerifiedAt,
- FieldExpiresAt,
- FieldConsumedAt,
- }
- // ValidColumn reports if the column name is valid (part of the table columns).
- func ValidColumn(column string) bool {
- for i := range Columns {
- if column == Columns[i] {
- return true
- }
- }
- return false
- }
- var (
- // DefaultCreatedAt holds the default value on creation for the "created_at" field.
- DefaultCreatedAt func() time.Time
- // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
- DefaultUpdatedAt func() time.Time
- // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
- UpdateDefaultUpdatedAt func() time.Time
- // SessionTokenValidator is a validator for the "session_token" field. It is called by the builders before save.
- SessionTokenValidator func(string) error
- // IntentValidator is a validator for the "intent" field. It is called by the builders before save.
- IntentValidator func(string) error
- // ProviderTypeValidator is a validator for the "provider_type" field. It is called by the builders before save.
- ProviderTypeValidator func(string) error
- // ProviderKeyValidator is a validator for the "provider_key" field. It is called by the builders before save.
- ProviderKeyValidator func(string) error
- // ProviderSubjectValidator is a validator for the "provider_subject" field. It is called by the builders before save.
- ProviderSubjectValidator func(string) error
- // DefaultRedirectTo holds the default value on creation for the "redirect_to" field.
- DefaultRedirectTo string
- // DefaultResolvedEmail holds the default value on creation for the "resolved_email" field.
- DefaultResolvedEmail string
- // DefaultRegistrationPasswordHash holds the default value on creation for the "registration_password_hash" field.
- DefaultRegistrationPasswordHash string
- // DefaultUpstreamIdentityClaims holds the default value on creation for the "upstream_identity_claims" field.
- DefaultUpstreamIdentityClaims func() map[string]interface{}
- // DefaultLocalFlowState holds the default value on creation for the "local_flow_state" field.
- DefaultLocalFlowState func() map[string]interface{}
- // DefaultBrowserSessionKey holds the default value on creation for the "browser_session_key" field.
- DefaultBrowserSessionKey string
- // DefaultCompletionCodeHash holds the default value on creation for the "completion_code_hash" field.
- DefaultCompletionCodeHash string
- )
- // OrderOption defines the ordering options for the PendingAuthSession queries.
- type OrderOption func(*sql.Selector)
- // ByID orders the results by the id field.
- func ByID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldID, opts...).ToFunc()
- }
- // ByCreatedAt orders the results by the created_at field.
- func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
- }
- // ByUpdatedAt orders the results by the updated_at field.
- func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
- }
- // BySessionToken orders the results by the session_token field.
- func BySessionToken(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldSessionToken, opts...).ToFunc()
- }
- // ByIntent orders the results by the intent field.
- func ByIntent(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldIntent, opts...).ToFunc()
- }
- // ByProviderType orders the results by the provider_type field.
- func ByProviderType(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldProviderType, opts...).ToFunc()
- }
- // ByProviderKey orders the results by the provider_key field.
- func ByProviderKey(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldProviderKey, opts...).ToFunc()
- }
- // ByProviderSubject orders the results by the provider_subject field.
- func ByProviderSubject(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldProviderSubject, opts...).ToFunc()
- }
- // ByTargetUserID orders the results by the target_user_id field.
- func ByTargetUserID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldTargetUserID, opts...).ToFunc()
- }
- // ByRedirectTo orders the results by the redirect_to field.
- func ByRedirectTo(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldRedirectTo, opts...).ToFunc()
- }
- // ByResolvedEmail orders the results by the resolved_email field.
- func ByResolvedEmail(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldResolvedEmail, opts...).ToFunc()
- }
- // ByRegistrationPasswordHash orders the results by the registration_password_hash field.
- func ByRegistrationPasswordHash(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldRegistrationPasswordHash, opts...).ToFunc()
- }
- // ByBrowserSessionKey orders the results by the browser_session_key field.
- func ByBrowserSessionKey(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldBrowserSessionKey, opts...).ToFunc()
- }
- // ByCompletionCodeHash orders the results by the completion_code_hash field.
- func ByCompletionCodeHash(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCompletionCodeHash, opts...).ToFunc()
- }
- // ByCompletionCodeExpiresAt orders the results by the completion_code_expires_at field.
- func ByCompletionCodeExpiresAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCompletionCodeExpiresAt, opts...).ToFunc()
- }
- // ByEmailVerifiedAt orders the results by the email_verified_at field.
- func ByEmailVerifiedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldEmailVerifiedAt, opts...).ToFunc()
- }
- // ByPasswordVerifiedAt orders the results by the password_verified_at field.
- func ByPasswordVerifiedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldPasswordVerifiedAt, opts...).ToFunc()
- }
- // ByTotpVerifiedAt orders the results by the totp_verified_at field.
- func ByTotpVerifiedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldTotpVerifiedAt, opts...).ToFunc()
- }
- // ByExpiresAt orders the results by the expires_at field.
- func ByExpiresAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldExpiresAt, opts...).ToFunc()
- }
- // ByConsumedAt orders the results by the consumed_at field.
- func ByConsumedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldConsumedAt, opts...).ToFunc()
- }
- // ByTargetUserField orders the results by target_user field.
- func ByTargetUserField(field string, opts ...sql.OrderTermOption) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborTerms(s, newTargetUserStep(), sql.OrderByField(field, opts...))
- }
- }
- // ByAdoptionDecisionField orders the results by adoption_decision field.
- func ByAdoptionDecisionField(field string, opts ...sql.OrderTermOption) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborTerms(s, newAdoptionDecisionStep(), sql.OrderByField(field, opts...))
- }
- }
- func newTargetUserStep() *sqlgraph.Step {
- return sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(TargetUserInverseTable, FieldID),
- sqlgraph.Edge(sqlgraph.M2O, true, TargetUserTable, TargetUserColumn),
- )
- }
- func newAdoptionDecisionStep() *sqlgraph.Step {
- return sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(AdoptionDecisionInverseTable, FieldID),
- sqlgraph.Edge(sqlgraph.O2O, false, AdoptionDecisionTable, AdoptionDecisionColumn),
- )
- }
|