//
// 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/Gleipnir-Technology/jet/postgres"
)

var User = newUserTable("public", "user_", "")

type userTable struct {
	postgres.Table

	// Columns
	ID                        postgres.ColumnInteger
	ArcgisAccessToken         postgres.ColumnString
	ArcgisLicense             postgres.ColumnString
	ArcgisRefreshToken        postgres.ColumnString
	ArcgisRefreshTokenExpires postgres.ColumnTimestamp
	ArcgisRole                postgres.ColumnString
	DisplayName               postgres.ColumnString
	Email                     postgres.ColumnString
	OrganizationID            postgres.ColumnInteger
	Username                  postgres.ColumnString
	PasswordHashType          postgres.ColumnString
	PasswordHash              postgres.ColumnString
	Role                      postgres.ColumnString
	Avatar                    postgres.ColumnString
	IsActive                  postgres.ColumnBool
	IsDronePilot              postgres.ColumnBool
	IsWarrant                 postgres.ColumnBool

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

type UserTable struct {
	userTable

	EXCLUDED userTable
}

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

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

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

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

func newUserTable(schemaName, tableName, alias string) *UserTable {
	return &UserTable{
		userTable: newUserTableImpl(schemaName, tableName, alias),
		EXCLUDED:  newUserTableImpl("", "excluded", ""),
	}
}

func newUserTableImpl(schemaName, tableName, alias string) userTable {
	var (
		IDColumn                        = postgres.IntegerColumn("id")
		ArcgisAccessTokenColumn         = postgres.StringColumn("arcgis_access_token")
		ArcgisLicenseColumn             = postgres.StringColumn("arcgis_license")
		ArcgisRefreshTokenColumn        = postgres.StringColumn("arcgis_refresh_token")
		ArcgisRefreshTokenExpiresColumn = postgres.TimestampColumn("arcgis_refresh_token_expires")
		ArcgisRoleColumn                = postgres.StringColumn("arcgis_role")
		DisplayNameColumn               = postgres.StringColumn("display_name")
		EmailColumn                     = postgres.StringColumn("email")
		OrganizationIDColumn            = postgres.IntegerColumn("organization_id")
		UsernameColumn                  = postgres.StringColumn("username")
		PasswordHashTypeColumn          = postgres.StringColumn("password_hash_type")
		PasswordHashColumn              = postgres.StringColumn("password_hash")
		RoleColumn                      = postgres.StringColumn("role")
		AvatarColumn                    = postgres.StringColumn("avatar")
		IsActiveColumn                  = postgres.BoolColumn("is_active")
		IsDronePilotColumn              = postgres.BoolColumn("is_drone_pilot")
		IsWarrantColumn                 = postgres.BoolColumn("is_warrant")
		allColumns                      = postgres.ColumnList{IDColumn, ArcgisAccessTokenColumn, ArcgisLicenseColumn, ArcgisRefreshTokenColumn, ArcgisRefreshTokenExpiresColumn, ArcgisRoleColumn, DisplayNameColumn, EmailColumn, OrganizationIDColumn, UsernameColumn, PasswordHashTypeColumn, PasswordHashColumn, RoleColumn, AvatarColumn, IsActiveColumn, IsDronePilotColumn, IsWarrantColumn}
		mutableColumns                  = postgres.ColumnList{ArcgisAccessTokenColumn, ArcgisLicenseColumn, ArcgisRefreshTokenColumn, ArcgisRefreshTokenExpiresColumn, ArcgisRoleColumn, DisplayNameColumn, EmailColumn, OrganizationIDColumn, UsernameColumn, PasswordHashTypeColumn, PasswordHashColumn, RoleColumn, AvatarColumn, IsActiveColumn, IsDronePilotColumn, IsWarrantColumn}
		defaultColumns                  = postgres.ColumnList{IDColumn}
	)

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

		//Columns
		ID:                        IDColumn,
		ArcgisAccessToken:         ArcgisAccessTokenColumn,
		ArcgisLicense:             ArcgisLicenseColumn,
		ArcgisRefreshToken:        ArcgisRefreshTokenColumn,
		ArcgisRefreshTokenExpires: ArcgisRefreshTokenExpiresColumn,
		ArcgisRole:                ArcgisRoleColumn,
		DisplayName:               DisplayNameColumn,
		Email:                     EmailColumn,
		OrganizationID:            OrganizationIDColumn,
		Username:                  UsernameColumn,
		PasswordHashType:          PasswordHashTypeColumn,
		PasswordHash:              PasswordHashColumn,
		Role:                      RoleColumn,
		Avatar:                    AvatarColumn,
		IsActive:                  IsActiveColumn,
		IsDronePilot:              IsDronePilotColumn,
		IsWarrant:                 IsWarrantColumn,

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