//
// Code generated by go-jet DO NOT EDIT.
//
// WARNING: Changes to this file may cause incorrect behavior
// and will be lost if the code is regenerated
//

package table

import (
	"github.com/go-jet/jet/v2/postgres"
)

var SessionRevocations = newSessionRevocationsTable("backend", "session_revocations", "")

type sessionRevocationsTable struct {
	postgres.Table

	// Columns
	RevocationID    postgres.ColumnString
	DeviceSessionID postgres.ColumnString
	UserID          postgres.ColumnString
	ActorKind       postgres.ColumnString
	ActorUserID     postgres.ColumnString
	ActorUsername   postgres.ColumnString
	Reason          postgres.ColumnString
	RevokedAt       postgres.ColumnTimestampz

	AllColumns     postgres.ColumnList
	MutableColumns postgres.ColumnList
	DefaultColumns postgres.ColumnList
}

type SessionRevocationsTable struct {
	sessionRevocationsTable

	EXCLUDED sessionRevocationsTable
}

// AS creates new SessionRevocationsTable with assigned alias
func (a SessionRevocationsTable) AS(alias string) *SessionRevocationsTable {
	return newSessionRevocationsTable(a.SchemaName(), a.TableName(), alias)
}

// Schema creates new SessionRevocationsTable with assigned schema name
func (a SessionRevocationsTable) FromSchema(schemaName string) *SessionRevocationsTable {
	return newSessionRevocationsTable(schemaName, a.TableName(), a.Alias())
}

// WithPrefix creates new SessionRevocationsTable with assigned table prefix
func (a SessionRevocationsTable) WithPrefix(prefix string) *SessionRevocationsTable {
	return newSessionRevocationsTable(a.SchemaName(), prefix+a.TableName(), a.TableName())
}

// WithSuffix creates new SessionRevocationsTable with assigned table suffix
func (a SessionRevocationsTable) WithSuffix(suffix string) *SessionRevocationsTable {
	return newSessionRevocationsTable(a.SchemaName(), a.TableName()+suffix, a.TableName())
}

func newSessionRevocationsTable(schemaName, tableName, alias string) *SessionRevocationsTable {
	return &SessionRevocationsTable{
		sessionRevocationsTable: newSessionRevocationsTableImpl(schemaName, tableName, alias),
		EXCLUDED:                newSessionRevocationsTableImpl("", "excluded", ""),
	}
}

func newSessionRevocationsTableImpl(schemaName, tableName, alias string) sessionRevocationsTable {
	var (
		RevocationIDColumn    = postgres.StringColumn("revocation_id")
		DeviceSessionIDColumn = postgres.StringColumn("device_session_id")
		UserIDColumn          = postgres.StringColumn("user_id")
		ActorKindColumn       = postgres.StringColumn("actor_kind")
		ActorUserIDColumn     = postgres.StringColumn("actor_user_id")
		ActorUsernameColumn   = postgres.StringColumn("actor_username")
		ReasonColumn          = postgres.StringColumn("reason")
		RevokedAtColumn       = postgres.TimestampzColumn("revoked_at")
		allColumns            = postgres.ColumnList{RevocationIDColumn, DeviceSessionIDColumn, UserIDColumn, ActorKindColumn, ActorUserIDColumn, ActorUsernameColumn, ReasonColumn, RevokedAtColumn}
		mutableColumns        = postgres.ColumnList{DeviceSessionIDColumn, UserIDColumn, ActorKindColumn, ActorUserIDColumn, ActorUsernameColumn, ReasonColumn, RevokedAtColumn}
		defaultColumns        = postgres.ColumnList{ReasonColumn, RevokedAtColumn}
	)

	return sessionRevocationsTable{
		Table: postgres.NewTable(schemaName, tableName, alias, allColumns...),

		//Columns
		RevocationID:    RevocationIDColumn,
		DeviceSessionID: DeviceSessionIDColumn,
		UserID:          UserIDColumn,
		ActorKind:       ActorKindColumn,
		ActorUserID:     ActorUserIDColumn,
		ActorUsername:   ActorUsernameColumn,
		Reason:          ReasonColumn,
		RevokedAt:       RevokedAtColumn,

		AllColumns:     allColumns,
		MutableColumns: mutableColumns,
		DefaultColumns: defaultColumns,
	}
}
