//
// 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 RetainedIdentities = newRetainedIdentitiesTable("backend", "retained_identities", "")

type retainedIdentitiesTable struct {
	postgres.Table

	// Columns
	RetainedID postgres.ColumnString
	AccountID  postgres.ColumnString
	Kind       postgres.ColumnString
	ExternalID postgres.ColumnString
	Confirmed  postgres.ColumnBool
	LinkedAt   postgres.ColumnTimestampz
	DetachedAt postgres.ColumnTimestampz
	Reason     postgres.ColumnString

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

type RetainedIdentitiesTable struct {
	retainedIdentitiesTable

	EXCLUDED retainedIdentitiesTable
}

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

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

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

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

func newRetainedIdentitiesTable(schemaName, tableName, alias string) *RetainedIdentitiesTable {
	return &RetainedIdentitiesTable{
		retainedIdentitiesTable: newRetainedIdentitiesTableImpl(schemaName, tableName, alias),
		EXCLUDED:                newRetainedIdentitiesTableImpl("", "excluded", ""),
	}
}

func newRetainedIdentitiesTableImpl(schemaName, tableName, alias string) retainedIdentitiesTable {
	var (
		RetainedIDColumn = postgres.StringColumn("retained_id")
		AccountIDColumn  = postgres.StringColumn("account_id")
		KindColumn       = postgres.StringColumn("kind")
		ExternalIDColumn = postgres.StringColumn("external_id")
		ConfirmedColumn  = postgres.BoolColumn("confirmed")
		LinkedAtColumn   = postgres.TimestampzColumn("linked_at")
		DetachedAtColumn = postgres.TimestampzColumn("detached_at")
		ReasonColumn     = postgres.StringColumn("reason")
		allColumns       = postgres.ColumnList{RetainedIDColumn, AccountIDColumn, KindColumn, ExternalIDColumn, ConfirmedColumn, LinkedAtColumn, DetachedAtColumn, ReasonColumn}
		mutableColumns   = postgres.ColumnList{AccountIDColumn, KindColumn, ExternalIDColumn, ConfirmedColumn, LinkedAtColumn, DetachedAtColumn, ReasonColumn}
		defaultColumns   = postgres.ColumnList{ConfirmedColumn, DetachedAtColumn}
	)

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

		//Columns
		RetainedID: RetainedIDColumn,
		AccountID:  AccountIDColumn,
		Kind:       KindColumn,
		ExternalID: ExternalIDColumn,
		Confirmed:  ConfirmedColumn,
		LinkedAt:   LinkedAtColumn,
		DetachedAt: DetachedAtColumn,
		Reason:     ReasonColumn,

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