//
// 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 NotifyEmail = newNotifyEmailTable("publicreport", "notify_email", "")

type notifyEmailTable struct {
	postgres.Table

	// Columns
	Created      postgres.ColumnTimestamp
	Deleted      postgres.ColumnTimestamp
	EmailAddress postgres.ColumnString
	ReportID     postgres.ColumnInteger

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

type NotifyEmailTable struct {
	notifyEmailTable

	EXCLUDED notifyEmailTable
}

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

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

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

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

func newNotifyEmailTable(schemaName, tableName, alias string) *NotifyEmailTable {
	return &NotifyEmailTable{
		notifyEmailTable: newNotifyEmailTableImpl(schemaName, tableName, alias),
		EXCLUDED:         newNotifyEmailTableImpl("", "excluded", ""),
	}
}

func newNotifyEmailTableImpl(schemaName, tableName, alias string) notifyEmailTable {
	var (
		CreatedColumn      = postgres.TimestampColumn("created")
		DeletedColumn      = postgres.TimestampColumn("deleted")
		EmailAddressColumn = postgres.StringColumn("email_address")
		ReportIDColumn     = postgres.IntegerColumn("report_id")
		allColumns         = postgres.ColumnList{CreatedColumn, DeletedColumn, EmailAddressColumn, ReportIDColumn}
		mutableColumns     = postgres.ColumnList{CreatedColumn, DeletedColumn}
		defaultColumns     = postgres.ColumnList{}
	)

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

		//Columns
		Created:      CreatedColumn,
		Deleted:      DeletedColumn,
		EmailAddress: EmailAddressColumn,
		ReportID:     ReportIDColumn,

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