//
// 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 OAuthToken = newOAuthTokenTable("arcgis", "oauth_token", "")

type oAuthTokenTable struct {
	postgres.Table

	// Columns
	AccessToken         postgres.ColumnString
	AccessTokenExpires  postgres.ColumnTimestamp
	ArcgisAccountID     postgres.ColumnString
	ArcgisID            postgres.ColumnString
	ArcgisLicenseTypeID postgres.ColumnString
	Created             postgres.ColumnTimestamp
	ID                  postgres.ColumnInteger
	InvalidatedAt       postgres.ColumnTimestamp
	RefreshToken        postgres.ColumnString
	RefreshTokenExpires postgres.ColumnTimestamp
	UserID              postgres.ColumnInteger
	Username            postgres.ColumnString

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

type OAuthTokenTable struct {
	oAuthTokenTable

	EXCLUDED oAuthTokenTable
}

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

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

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

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

func newOAuthTokenTable(schemaName, tableName, alias string) *OAuthTokenTable {
	return &OAuthTokenTable{
		oAuthTokenTable: newOAuthTokenTableImpl(schemaName, tableName, alias),
		EXCLUDED:        newOAuthTokenTableImpl("", "excluded", ""),
	}
}

func newOAuthTokenTableImpl(schemaName, tableName, alias string) oAuthTokenTable {
	var (
		AccessTokenColumn         = postgres.StringColumn("access_token")
		AccessTokenExpiresColumn  = postgres.TimestampColumn("access_token_expires")
		ArcgisAccountIDColumn     = postgres.StringColumn("arcgis_account_id")
		ArcgisIDColumn            = postgres.StringColumn("arcgis_id")
		ArcgisLicenseTypeIDColumn = postgres.StringColumn("arcgis_license_type_id")
		CreatedColumn             = postgres.TimestampColumn("created")
		IDColumn                  = postgres.IntegerColumn("id")
		InvalidatedAtColumn       = postgres.TimestampColumn("invalidated_at")
		RefreshTokenColumn        = postgres.StringColumn("refresh_token")
		RefreshTokenExpiresColumn = postgres.TimestampColumn("refresh_token_expires")
		UserIDColumn              = postgres.IntegerColumn("user_id")
		UsernameColumn            = postgres.StringColumn("username")
		allColumns                = postgres.ColumnList{AccessTokenColumn, AccessTokenExpiresColumn, ArcgisAccountIDColumn, ArcgisIDColumn, ArcgisLicenseTypeIDColumn, CreatedColumn, IDColumn, InvalidatedAtColumn, RefreshTokenColumn, RefreshTokenExpiresColumn, UserIDColumn, UsernameColumn}
		mutableColumns            = postgres.ColumnList{AccessTokenColumn, AccessTokenExpiresColumn, ArcgisAccountIDColumn, ArcgisIDColumn, ArcgisLicenseTypeIDColumn, CreatedColumn, InvalidatedAtColumn, RefreshTokenColumn, RefreshTokenExpiresColumn, UserIDColumn, UsernameColumn}
		defaultColumns            = postgres.ColumnList{IDColumn}
	)

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

		//Columns
		AccessToken:         AccessTokenColumn,
		AccessTokenExpires:  AccessTokenExpiresColumn,
		ArcgisAccountID:     ArcgisAccountIDColumn,
		ArcgisID:            ArcgisIDColumn,
		ArcgisLicenseTypeID: ArcgisLicenseTypeIDColumn,
		Created:             CreatedColumn,
		ID:                  IDColumn,
		InvalidatedAt:       InvalidatedAtColumn,
		RefreshToken:        RefreshTokenColumn,
		RefreshTokenExpires: RefreshTokenExpiresColumn,
		UserID:              UserIDColumn,
		Username:            UsernameColumn,

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