//
// 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("arcgis", "user_", "")

type userTable struct {
	postgres.Table

	// Columns
	Access            postgres.ColumnString
	Created           postgres.ColumnTimestamp
	Email             postgres.ColumnString
	FullName          postgres.ColumnString
	ID                postgres.ColumnString
	Level             postgres.ColumnString
	OrgID             postgres.ColumnString
	PublicUserID      postgres.ColumnInteger
	Region            postgres.ColumnString
	Role              postgres.ColumnString
	RoleID            postgres.ColumnString
	Username          postgres.ColumnString
	UserLicenseTypeID postgres.ColumnString
	UserType          postgres.ColumnString

	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 (
		AccessColumn            = postgres.StringColumn("access")
		CreatedColumn           = postgres.TimestampColumn("created")
		EmailColumn             = postgres.StringColumn("email")
		FullNameColumn          = postgres.StringColumn("full_name")
		IDColumn                = postgres.StringColumn("id")
		LevelColumn             = postgres.StringColumn("level")
		OrgIDColumn             = postgres.StringColumn("org_id")
		PublicUserIDColumn      = postgres.IntegerColumn("public_user_id")
		RegionColumn            = postgres.StringColumn("region")
		RoleColumn              = postgres.StringColumn("role")
		RoleIDColumn            = postgres.StringColumn("role_id")
		UsernameColumn          = postgres.StringColumn("username")
		UserLicenseTypeIDColumn = postgres.StringColumn("user_license_type_id")
		UserTypeColumn          = postgres.StringColumn("user_type")
		allColumns              = postgres.ColumnList{AccessColumn, CreatedColumn, EmailColumn, FullNameColumn, IDColumn, LevelColumn, OrgIDColumn, PublicUserIDColumn, RegionColumn, RoleColumn, RoleIDColumn, UsernameColumn, UserLicenseTypeIDColumn, UserTypeColumn}
		mutableColumns          = postgres.ColumnList{AccessColumn, CreatedColumn, EmailColumn, FullNameColumn, LevelColumn, OrgIDColumn, PublicUserIDColumn, RegionColumn, RoleColumn, RoleIDColumn, UsernameColumn, UserLicenseTypeIDColumn, UserTypeColumn}
		defaultColumns          = postgres.ColumnList{}
	)

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

		//Columns
		Access:            AccessColumn,
		Created:           CreatedColumn,
		Email:             EmailColumn,
		FullName:          FullNameColumn,
		ID:                IDColumn,
		Level:             LevelColumn,
		OrgID:             OrgIDColumn,
		PublicUserID:      PublicUserIDColumn,
		Region:            RegionColumn,
		Role:              RoleColumn,
		RoleID:            RoleIDColumn,
		Username:          UsernameColumn,
		UserLicenseTypeID: UserLicenseTypeIDColumn,
		UserType:          UserTypeColumn,

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