//
// 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 NotificationDeadLetters = newNotificationDeadLettersTable("backend", "notification_dead_letters", "")

type notificationDeadLettersTable struct {
	postgres.Table

	// Columns
	DeadLetterID   postgres.ColumnString
	NotificationID postgres.ColumnString
	RouteID        postgres.ColumnString
	ArchivedAt     postgres.ColumnTimestampz
	Reason         postgres.ColumnString

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

type NotificationDeadLettersTable struct {
	notificationDeadLettersTable

	EXCLUDED notificationDeadLettersTable
}

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

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

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

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

func newNotificationDeadLettersTable(schemaName, tableName, alias string) *NotificationDeadLettersTable {
	return &NotificationDeadLettersTable{
		notificationDeadLettersTable: newNotificationDeadLettersTableImpl(schemaName, tableName, alias),
		EXCLUDED:                     newNotificationDeadLettersTableImpl("", "excluded", ""),
	}
}

func newNotificationDeadLettersTableImpl(schemaName, tableName, alias string) notificationDeadLettersTable {
	var (
		DeadLetterIDColumn   = postgres.StringColumn("dead_letter_id")
		NotificationIDColumn = postgres.StringColumn("notification_id")
		RouteIDColumn        = postgres.StringColumn("route_id")
		ArchivedAtColumn     = postgres.TimestampzColumn("archived_at")
		ReasonColumn         = postgres.StringColumn("reason")
		allColumns           = postgres.ColumnList{DeadLetterIDColumn, NotificationIDColumn, RouteIDColumn, ArchivedAtColumn, ReasonColumn}
		mutableColumns       = postgres.ColumnList{NotificationIDColumn, RouteIDColumn, ArchivedAtColumn, ReasonColumn}
		defaultColumns       = postgres.ColumnList{ArchivedAtColumn}
	)

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

		//Columns
		DeadLetterID:   DeadLetterIDColumn,
		NotificationID: NotificationIDColumn,
		RouteID:        RouteIDColumn,
		ArchivedAt:     ArchivedAtColumn,
		Reason:         ReasonColumn,

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