//
// 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 ServiceMap = newServiceMapTable("arcgis", "service_map", "")

type serviceMapTable struct {
	postgres.Table

	// Columns
	AccountID postgres.ColumnString
	ArcgisID  postgres.ColumnString
	Name      postgres.ColumnString
	Title     postgres.ColumnString
	URL       postgres.ColumnString

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

type ServiceMapTable struct {
	serviceMapTable

	EXCLUDED serviceMapTable
}

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

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

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

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

func newServiceMapTable(schemaName, tableName, alias string) *ServiceMapTable {
	return &ServiceMapTable{
		serviceMapTable: newServiceMapTableImpl(schemaName, tableName, alias),
		EXCLUDED:        newServiceMapTableImpl("", "excluded", ""),
	}
}

func newServiceMapTableImpl(schemaName, tableName, alias string) serviceMapTable {
	var (
		AccountIDColumn = postgres.StringColumn("account_id")
		ArcgisIDColumn  = postgres.StringColumn("arcgis_id")
		NameColumn      = postgres.StringColumn("name")
		TitleColumn     = postgres.StringColumn("title")
		URLColumn       = postgres.StringColumn("url")
		allColumns      = postgres.ColumnList{AccountIDColumn, ArcgisIDColumn, NameColumn, TitleColumn, URLColumn}
		mutableColumns  = postgres.ColumnList{AccountIDColumn, NameColumn, TitleColumn, URLColumn}
		defaultColumns  = postgres.ColumnList{}
	)

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

		//Columns
		AccountID: AccountIDColumn,
		ArcgisID:  ArcgisIDColumn,
		Name:      NameColumn,
		Title:     TitleColumn,
		URL:       URLColumn,

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