// Code generated by BobGen psql v0.42.5. DO NOT EDIT.
// This file is meant to be re-generated in place and/or deleted at any time.

package factory

import (
	"context"
	"testing"
	"time"

	"github.com/Gleipnir-Technology/bob"
	"github.com/Gleipnir-Technology/bob/types/pgtypes"
	enums "github.com/Gleipnir-Technology/nidus-sync/db/enums"
	models "github.com/Gleipnir-Technology/nidus-sync/db/models"
	"github.com/aarondl/opt/null"
	"github.com/aarondl/opt/omit"
	"github.com/aarondl/opt/omitnull"
	"github.com/jaswdr/faker/v2"
)

type FileuploadPoolMod interface {
	Apply(context.Context, *FileuploadPoolTemplate)
}

type FileuploadPoolModFunc func(context.Context, *FileuploadPoolTemplate)

func (f FileuploadPoolModFunc) Apply(ctx context.Context, n *FileuploadPoolTemplate) {
	f(ctx, n)
}

type FileuploadPoolModSlice []FileuploadPoolMod

func (mods FileuploadPoolModSlice) Apply(ctx context.Context, n *FileuploadPoolTemplate) {
	for _, f := range mods {
		f.Apply(ctx, n)
	}
}

// FileuploadPoolTemplate is an object representing the database table.
// all columns are optional and should be set by mods
type FileuploadPoolTemplate struct {
	AddressCity            func() string
	AddressPostalCode      func() string
	AddressStreet          func() string
	Committed              func() bool
	Condition              func() enums.FileuploadPoolconditiontype
	Created                func() time.Time
	CreatorID              func() int32
	CSVFile                func() int32
	Deleted                func() null.Val[time.Time]
	Geom                   func() null.Val[string]
	H3cell                 func() null.Val[string]
	ID                     func() int32
	IsInDistrict           func() bool
	IsNew                  func() bool
	Notes                  func() string
	OrganizationID         func() int32
	PropertyOwnerName      func() string
	PropertyOwnerPhoneE164 func() null.Val[string]
	ResidentOwned          func() null.Val[bool]
	ResidentPhoneE164      func() null.Val[string]
	LineNumber             func() int32
	Tags                   func() pgtypes.HStore

	r fileuploadPoolR
	f *Factory

	alreadyPersisted bool
}

type fileuploadPoolR struct {
	CreatorUser                 *fileuploadPoolRCreatorUserR
	CSVFileCSV                  *fileuploadPoolRCSVFileCSVR
	Organization                *fileuploadPoolROrganizationR
	PropertyOwnerPhoneE164Phone *fileuploadPoolRPropertyOwnerPhoneE164PhoneR
	ResidentPhoneE164Phone      *fileuploadPoolRResidentPhoneE164PhoneR
}

type fileuploadPoolRCreatorUserR struct {
	o *UserTemplate
}
type fileuploadPoolRCSVFileCSVR struct {
	o *FileuploadCSVTemplate
}
type fileuploadPoolROrganizationR struct {
	o *OrganizationTemplate
}
type fileuploadPoolRPropertyOwnerPhoneE164PhoneR struct {
	o *CommsPhoneTemplate
}
type fileuploadPoolRResidentPhoneE164PhoneR struct {
	o *CommsPhoneTemplate
}

// Apply mods to the FileuploadPoolTemplate
func (o *FileuploadPoolTemplate) Apply(ctx context.Context, mods ...FileuploadPoolMod) {
	for _, mod := range mods {
		mod.Apply(ctx, o)
	}
}

// setModelRels creates and sets the relationships on *models.FileuploadPool
// according to the relationships in the template. Nothing is inserted into the db
func (t FileuploadPoolTemplate) setModelRels(o *models.FileuploadPool) {
	if t.r.CreatorUser != nil {
		rel := t.r.CreatorUser.o.Build()
		rel.R.FileuploadPool = append(rel.R.FileuploadPool, o)
		o.CreatorID = rel.ID // h2
		o.R.CreatorUser = rel
	}

	if t.r.CSVFileCSV != nil {
		rel := t.r.CSVFileCSV.o.Build()
		rel.R.CSVFilePools = append(rel.R.CSVFilePools, o)
		o.CSVFile = rel.FileID // h2
		o.R.CSVFileCSV = rel
	}

	if t.r.Organization != nil {
		rel := t.r.Organization.o.Build()
		rel.R.Pools = append(rel.R.Pools, o)
		o.OrganizationID = rel.ID // h2
		o.R.Organization = rel
	}

	if t.r.PropertyOwnerPhoneE164Phone != nil {
		rel := t.r.PropertyOwnerPhoneE164Phone.o.Build()
		rel.R.PropertyOwnerPhoneE164Pools = append(rel.R.PropertyOwnerPhoneE164Pools, o)
		o.PropertyOwnerPhoneE164 = null.From(rel.E164) // h2
		o.R.PropertyOwnerPhoneE164Phone = rel
	}

	if t.r.ResidentPhoneE164Phone != nil {
		rel := t.r.ResidentPhoneE164Phone.o.Build()
		rel.R.ResidentPhoneE164Pools = append(rel.R.ResidentPhoneE164Pools, o)
		o.ResidentPhoneE164 = null.From(rel.E164) // h2
		o.R.ResidentPhoneE164Phone = rel
	}
}

// BuildSetter returns an *models.FileuploadPoolSetter
// this does nothing with the relationship templates
func (o FileuploadPoolTemplate) BuildSetter() *models.FileuploadPoolSetter {
	m := &models.FileuploadPoolSetter{}

	if o.AddressCity != nil {
		val := o.AddressCity()
		m.AddressCity = omit.From(val)
	}
	if o.AddressPostalCode != nil {
		val := o.AddressPostalCode()
		m.AddressPostalCode = omit.From(val)
	}
	if o.AddressStreet != nil {
		val := o.AddressStreet()
		m.AddressStreet = omit.From(val)
	}
	if o.Committed != nil {
		val := o.Committed()
		m.Committed = omit.From(val)
	}
	if o.Condition != nil {
		val := o.Condition()
		m.Condition = omit.From(val)
	}
	if o.Created != nil {
		val := o.Created()
		m.Created = omit.From(val)
	}
	if o.CreatorID != nil {
		val := o.CreatorID()
		m.CreatorID = omit.From(val)
	}
	if o.CSVFile != nil {
		val := o.CSVFile()
		m.CSVFile = omit.From(val)
	}
	if o.Deleted != nil {
		val := o.Deleted()
		m.Deleted = omitnull.FromNull(val)
	}
	if o.Geom != nil {
		val := o.Geom()
		m.Geom = omitnull.FromNull(val)
	}
	if o.H3cell != nil {
		val := o.H3cell()
		m.H3cell = omitnull.FromNull(val)
	}
	if o.ID != nil {
		val := o.ID()
		m.ID = omit.From(val)
	}
	if o.IsInDistrict != nil {
		val := o.IsInDistrict()
		m.IsInDistrict = omit.From(val)
	}
	if o.IsNew != nil {
		val := o.IsNew()
		m.IsNew = omit.From(val)
	}
	if o.Notes != nil {
		val := o.Notes()
		m.Notes = omit.From(val)
	}
	if o.OrganizationID != nil {
		val := o.OrganizationID()
		m.OrganizationID = omit.From(val)
	}
	if o.PropertyOwnerName != nil {
		val := o.PropertyOwnerName()
		m.PropertyOwnerName = omit.From(val)
	}
	if o.PropertyOwnerPhoneE164 != nil {
		val := o.PropertyOwnerPhoneE164()
		m.PropertyOwnerPhoneE164 = omitnull.FromNull(val)
	}
	if o.ResidentOwned != nil {
		val := o.ResidentOwned()
		m.ResidentOwned = omitnull.FromNull(val)
	}
	if o.ResidentPhoneE164 != nil {
		val := o.ResidentPhoneE164()
		m.ResidentPhoneE164 = omitnull.FromNull(val)
	}
	if o.LineNumber != nil {
		val := o.LineNumber()
		m.LineNumber = omit.From(val)
	}
	if o.Tags != nil {
		val := o.Tags()
		m.Tags = omit.From(val)
	}

	return m
}

// BuildManySetter returns an []*models.FileuploadPoolSetter
// this does nothing with the relationship templates
func (o FileuploadPoolTemplate) BuildManySetter(number int) []*models.FileuploadPoolSetter {
	m := make([]*models.FileuploadPoolSetter, number)

	for i := range m {
		m[i] = o.BuildSetter()
	}

	return m
}

// Build returns an *models.FileuploadPool
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use FileuploadPoolTemplate.Create
func (o FileuploadPoolTemplate) Build() *models.FileuploadPool {
	m := &models.FileuploadPool{}

	if o.AddressCity != nil {
		m.AddressCity = o.AddressCity()
	}
	if o.AddressPostalCode != nil {
		m.AddressPostalCode = o.AddressPostalCode()
	}
	if o.AddressStreet != nil {
		m.AddressStreet = o.AddressStreet()
	}
	if o.Committed != nil {
		m.Committed = o.Committed()
	}
	if o.Condition != nil {
		m.Condition = o.Condition()
	}
	if o.Created != nil {
		m.Created = o.Created()
	}
	if o.CreatorID != nil {
		m.CreatorID = o.CreatorID()
	}
	if o.CSVFile != nil {
		m.CSVFile = o.CSVFile()
	}
	if o.Deleted != nil {
		m.Deleted = o.Deleted()
	}
	if o.Geom != nil {
		m.Geom = o.Geom()
	}
	if o.H3cell != nil {
		m.H3cell = o.H3cell()
	}
	if o.ID != nil {
		m.ID = o.ID()
	}
	if o.IsInDistrict != nil {
		m.IsInDistrict = o.IsInDistrict()
	}
	if o.IsNew != nil {
		m.IsNew = o.IsNew()
	}
	if o.Notes != nil {
		m.Notes = o.Notes()
	}
	if o.OrganizationID != nil {
		m.OrganizationID = o.OrganizationID()
	}
	if o.PropertyOwnerName != nil {
		m.PropertyOwnerName = o.PropertyOwnerName()
	}
	if o.PropertyOwnerPhoneE164 != nil {
		m.PropertyOwnerPhoneE164 = o.PropertyOwnerPhoneE164()
	}
	if o.ResidentOwned != nil {
		m.ResidentOwned = o.ResidentOwned()
	}
	if o.ResidentPhoneE164 != nil {
		m.ResidentPhoneE164 = o.ResidentPhoneE164()
	}
	if o.LineNumber != nil {
		m.LineNumber = o.LineNumber()
	}
	if o.Tags != nil {
		m.Tags = o.Tags()
	}

	o.setModelRels(m)

	return m
}

// BuildMany returns an models.FileuploadPoolSlice
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use FileuploadPoolTemplate.CreateMany
func (o FileuploadPoolTemplate) BuildMany(number int) models.FileuploadPoolSlice {
	m := make(models.FileuploadPoolSlice, number)

	for i := range m {
		m[i] = o.Build()
	}

	return m
}

func ensureCreatableFileuploadPool(m *models.FileuploadPoolSetter) {
	if !(m.AddressCity.IsValue()) {
		val := random_string(nil)
		m.AddressCity = omit.From(val)
	}
	if !(m.AddressPostalCode.IsValue()) {
		val := random_string(nil)
		m.AddressPostalCode = omit.From(val)
	}
	if !(m.AddressStreet.IsValue()) {
		val := random_string(nil)
		m.AddressStreet = omit.From(val)
	}
	if !(m.Committed.IsValue()) {
		val := random_bool(nil)
		m.Committed = omit.From(val)
	}
	if !(m.Condition.IsValue()) {
		val := random_enums_FileuploadPoolconditiontype(nil)
		m.Condition = omit.From(val)
	}
	if !(m.Created.IsValue()) {
		val := random_time_Time(nil)
		m.Created = omit.From(val)
	}
	if !(m.CreatorID.IsValue()) {
		val := random_int32(nil)
		m.CreatorID = omit.From(val)
	}
	if !(m.CSVFile.IsValue()) {
		val := random_int32(nil)
		m.CSVFile = omit.From(val)
	}
	if !(m.IsInDistrict.IsValue()) {
		val := random_bool(nil)
		m.IsInDistrict = omit.From(val)
	}
	if !(m.IsNew.IsValue()) {
		val := random_bool(nil)
		m.IsNew = omit.From(val)
	}
	if !(m.Notes.IsValue()) {
		val := random_string(nil)
		m.Notes = omit.From(val)
	}
	if !(m.OrganizationID.IsValue()) {
		val := random_int32(nil)
		m.OrganizationID = omit.From(val)
	}
	if !(m.PropertyOwnerName.IsValue()) {
		val := random_string(nil)
		m.PropertyOwnerName = omit.From(val)
	}
	if !(m.LineNumber.IsValue()) {
		val := random_int32(nil)
		m.LineNumber = omit.From(val)
	}
	if !(m.Tags.IsValue()) {
		val := random_pgtypes_HStore(nil)
		m.Tags = omit.From(val)
	}
}

// insertOptRels creates and inserts any optional the relationships on *models.FileuploadPool
// according to the relationships in the template.
// any required relationship should have already exist on the model
func (o *FileuploadPoolTemplate) insertOptRels(ctx context.Context, exec bob.Executor, m *models.FileuploadPool) error {
	var err error

	isPropertyOwnerPhoneE164PhoneDone, _ := fileuploadPoolRelPropertyOwnerPhoneE164PhoneCtx.Value(ctx)
	if !isPropertyOwnerPhoneE164PhoneDone && o.r.PropertyOwnerPhoneE164Phone != nil {
		ctx = fileuploadPoolRelPropertyOwnerPhoneE164PhoneCtx.WithValue(ctx, true)
		if o.r.PropertyOwnerPhoneE164Phone.o.alreadyPersisted {
			m.R.PropertyOwnerPhoneE164Phone = o.r.PropertyOwnerPhoneE164Phone.o.Build()
		} else {
			var rel3 *models.CommsPhone
			rel3, err = o.r.PropertyOwnerPhoneE164Phone.o.Create(ctx, exec)
			if err != nil {
				return err
			}
			err = m.AttachPropertyOwnerPhoneE164Phone(ctx, exec, rel3)
			if err != nil {
				return err
			}
		}

	}

	isResidentPhoneE164PhoneDone, _ := fileuploadPoolRelResidentPhoneE164PhoneCtx.Value(ctx)
	if !isResidentPhoneE164PhoneDone && o.r.ResidentPhoneE164Phone != nil {
		ctx = fileuploadPoolRelResidentPhoneE164PhoneCtx.WithValue(ctx, true)
		if o.r.ResidentPhoneE164Phone.o.alreadyPersisted {
			m.R.ResidentPhoneE164Phone = o.r.ResidentPhoneE164Phone.o.Build()
		} else {
			var rel4 *models.CommsPhone
			rel4, err = o.r.ResidentPhoneE164Phone.o.Create(ctx, exec)
			if err != nil {
				return err
			}
			err = m.AttachResidentPhoneE164Phone(ctx, exec, rel4)
			if err != nil {
				return err
			}
		}

	}

	return err
}

// Create builds a fileuploadPool and inserts it into the database
// Relations objects are also inserted and placed in the .R field
func (o *FileuploadPoolTemplate) Create(ctx context.Context, exec bob.Executor) (*models.FileuploadPool, error) {
	var err error
	opt := o.BuildSetter()
	ensureCreatableFileuploadPool(opt)

	if o.r.CreatorUser == nil {
		FileuploadPoolMods.WithNewCreatorUser().Apply(ctx, o)
	}

	var rel0 *models.User

	if o.r.CreatorUser.o.alreadyPersisted {
		rel0 = o.r.CreatorUser.o.Build()
	} else {
		rel0, err = o.r.CreatorUser.o.Create(ctx, exec)
		if err != nil {
			return nil, err
		}
	}

	opt.CreatorID = omit.From(rel0.ID)

	if o.r.CSVFileCSV == nil {
		FileuploadPoolMods.WithNewCSVFileCSV().Apply(ctx, o)
	}

	var rel1 *models.FileuploadCSV

	if o.r.CSVFileCSV.o.alreadyPersisted {
		rel1 = o.r.CSVFileCSV.o.Build()
	} else {
		rel1, err = o.r.CSVFileCSV.o.Create(ctx, exec)
		if err != nil {
			return nil, err
		}
	}

	opt.CSVFile = omit.From(rel1.FileID)

	if o.r.Organization == nil {
		FileuploadPoolMods.WithNewOrganization().Apply(ctx, o)
	}

	var rel2 *models.Organization

	if o.r.Organization.o.alreadyPersisted {
		rel2 = o.r.Organization.o.Build()
	} else {
		rel2, err = o.r.Organization.o.Create(ctx, exec)
		if err != nil {
			return nil, err
		}
	}

	opt.OrganizationID = omit.From(rel2.ID)

	m, err := models.FileuploadPools.Insert(opt).One(ctx, exec)
	if err != nil {
		return nil, err
	}

	m.R.CreatorUser = rel0
	m.R.CSVFileCSV = rel1
	m.R.Organization = rel2

	if err := o.insertOptRels(ctx, exec, m); err != nil {
		return nil, err
	}
	return m, err
}

// MustCreate builds a fileuploadPool and inserts it into the database
// Relations objects are also inserted and placed in the .R field
// panics if an error occurs
func (o *FileuploadPoolTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.FileuploadPool {
	m, err := o.Create(ctx, exec)
	if err != nil {
		panic(err)
	}
	return m
}

// CreateOrFail builds a fileuploadPool and inserts it into the database
// Relations objects are also inserted and placed in the .R field
// It calls `tb.Fatal(err)` on the test/benchmark if an error occurs
func (o *FileuploadPoolTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.FileuploadPool {
	tb.Helper()
	m, err := o.Create(ctx, exec)
	if err != nil {
		tb.Fatal(err)
		return nil
	}
	return m
}

// CreateMany builds multiple fileuploadPools and inserts them into the database
// Relations objects are also inserted and placed in the .R field
func (o FileuploadPoolTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.FileuploadPoolSlice, error) {
	var err error
	m := make(models.FileuploadPoolSlice, number)

	for i := range m {
		m[i], err = o.Create(ctx, exec)
		if err != nil {
			return nil, err
		}
	}

	return m, nil
}

// MustCreateMany builds multiple fileuploadPools and inserts them into the database
// Relations objects are also inserted and placed in the .R field
// panics if an error occurs
func (o FileuploadPoolTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.FileuploadPoolSlice {
	m, err := o.CreateMany(ctx, exec, number)
	if err != nil {
		panic(err)
	}
	return m
}

// CreateManyOrFail builds multiple fileuploadPools and inserts them into the database
// Relations objects are also inserted and placed in the .R field
// It calls `tb.Fatal(err)` on the test/benchmark if an error occurs
func (o FileuploadPoolTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.FileuploadPoolSlice {
	tb.Helper()
	m, err := o.CreateMany(ctx, exec, number)
	if err != nil {
		tb.Fatal(err)
		return nil
	}
	return m
}

// FileuploadPool has methods that act as mods for the FileuploadPoolTemplate
var FileuploadPoolMods fileuploadPoolMods

type fileuploadPoolMods struct{}

func (m fileuploadPoolMods) RandomizeAllColumns(f *faker.Faker) FileuploadPoolMod {
	return FileuploadPoolModSlice{
		FileuploadPoolMods.RandomAddressCity(f),
		FileuploadPoolMods.RandomAddressPostalCode(f),
		FileuploadPoolMods.RandomAddressStreet(f),
		FileuploadPoolMods.RandomCommitted(f),
		FileuploadPoolMods.RandomCondition(f),
		FileuploadPoolMods.RandomCreated(f),
		FileuploadPoolMods.RandomCreatorID(f),
		FileuploadPoolMods.RandomCSVFile(f),
		FileuploadPoolMods.RandomDeleted(f),
		FileuploadPoolMods.RandomGeom(f),
		FileuploadPoolMods.RandomH3cell(f),
		FileuploadPoolMods.RandomID(f),
		FileuploadPoolMods.RandomIsInDistrict(f),
		FileuploadPoolMods.RandomIsNew(f),
		FileuploadPoolMods.RandomNotes(f),
		FileuploadPoolMods.RandomOrganizationID(f),
		FileuploadPoolMods.RandomPropertyOwnerName(f),
		FileuploadPoolMods.RandomPropertyOwnerPhoneE164(f),
		FileuploadPoolMods.RandomResidentOwned(f),
		FileuploadPoolMods.RandomResidentPhoneE164(f),
		FileuploadPoolMods.RandomLineNumber(f),
		FileuploadPoolMods.RandomTags(f),
	}
}

// Set the model columns to this value
func (m fileuploadPoolMods) AddressCity(val string) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.AddressCity = func() string { return val }
	})
}

// Set the Column from the function
func (m fileuploadPoolMods) AddressCityFunc(f func() string) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.AddressCity = f
	})
}

// Clear any values for the column
func (m fileuploadPoolMods) UnsetAddressCity() FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.AddressCity = nil
	})
}

// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m fileuploadPoolMods) RandomAddressCity(f *faker.Faker) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.AddressCity = func() string {
			return random_string(f)
		}
	})
}

// Set the model columns to this value
func (m fileuploadPoolMods) AddressPostalCode(val string) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.AddressPostalCode = func() string { return val }
	})
}

// Set the Column from the function
func (m fileuploadPoolMods) AddressPostalCodeFunc(f func() string) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.AddressPostalCode = f
	})
}

// Clear any values for the column
func (m fileuploadPoolMods) UnsetAddressPostalCode() FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.AddressPostalCode = nil
	})
}

// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m fileuploadPoolMods) RandomAddressPostalCode(f *faker.Faker) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.AddressPostalCode = func() string {
			return random_string(f)
		}
	})
}

// Set the model columns to this value
func (m fileuploadPoolMods) AddressStreet(val string) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.AddressStreet = func() string { return val }
	})
}

// Set the Column from the function
func (m fileuploadPoolMods) AddressStreetFunc(f func() string) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.AddressStreet = f
	})
}

// Clear any values for the column
func (m fileuploadPoolMods) UnsetAddressStreet() FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.AddressStreet = nil
	})
}

// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m fileuploadPoolMods) RandomAddressStreet(f *faker.Faker) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.AddressStreet = func() string {
			return random_string(f)
		}
	})
}

// Set the model columns to this value
func (m fileuploadPoolMods) Committed(val bool) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Committed = func() bool { return val }
	})
}

// Set the Column from the function
func (m fileuploadPoolMods) CommittedFunc(f func() bool) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Committed = f
	})
}

// Clear any values for the column
func (m fileuploadPoolMods) UnsetCommitted() FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Committed = nil
	})
}

// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m fileuploadPoolMods) RandomCommitted(f *faker.Faker) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Committed = func() bool {
			return random_bool(f)
		}
	})
}

// Set the model columns to this value
func (m fileuploadPoolMods) Condition(val enums.FileuploadPoolconditiontype) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Condition = func() enums.FileuploadPoolconditiontype { return val }
	})
}

// Set the Column from the function
func (m fileuploadPoolMods) ConditionFunc(f func() enums.FileuploadPoolconditiontype) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Condition = f
	})
}

// Clear any values for the column
func (m fileuploadPoolMods) UnsetCondition() FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Condition = nil
	})
}

// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m fileuploadPoolMods) RandomCondition(f *faker.Faker) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Condition = func() enums.FileuploadPoolconditiontype {
			return random_enums_FileuploadPoolconditiontype(f)
		}
	})
}

// Set the model columns to this value
func (m fileuploadPoolMods) Created(val time.Time) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Created = func() time.Time { return val }
	})
}

// Set the Column from the function
func (m fileuploadPoolMods) CreatedFunc(f func() time.Time) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Created = f
	})
}

// Clear any values for the column
func (m fileuploadPoolMods) UnsetCreated() FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Created = nil
	})
}

// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m fileuploadPoolMods) RandomCreated(f *faker.Faker) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Created = func() time.Time {
			return random_time_Time(f)
		}
	})
}

// Set the model columns to this value
func (m fileuploadPoolMods) CreatorID(val int32) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.CreatorID = func() int32 { return val }
	})
}

// Set the Column from the function
func (m fileuploadPoolMods) CreatorIDFunc(f func() int32) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.CreatorID = f
	})
}

// Clear any values for the column
func (m fileuploadPoolMods) UnsetCreatorID() FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.CreatorID = nil
	})
}

// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m fileuploadPoolMods) RandomCreatorID(f *faker.Faker) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.CreatorID = func() int32 {
			return random_int32(f)
		}
	})
}

// Set the model columns to this value
func (m fileuploadPoolMods) CSVFile(val int32) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.CSVFile = func() int32 { return val }
	})
}

// Set the Column from the function
func (m fileuploadPoolMods) CSVFileFunc(f func() int32) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.CSVFile = f
	})
}

// Clear any values for the column
func (m fileuploadPoolMods) UnsetCSVFile() FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.CSVFile = nil
	})
}

// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m fileuploadPoolMods) RandomCSVFile(f *faker.Faker) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.CSVFile = func() int32 {
			return random_int32(f)
		}
	})
}

// Set the model columns to this value
func (m fileuploadPoolMods) Deleted(val null.Val[time.Time]) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Deleted = func() null.Val[time.Time] { return val }
	})
}

// Set the Column from the function
func (m fileuploadPoolMods) DeletedFunc(f func() null.Val[time.Time]) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Deleted = f
	})
}

// Clear any values for the column
func (m fileuploadPoolMods) UnsetDeleted() FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Deleted = nil
	})
}

// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m fileuploadPoolMods) RandomDeleted(f *faker.Faker) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Deleted = func() null.Val[time.Time] {
			if f == nil {
				f = &defaultFaker
			}

			val := random_time_Time(f)
			return null.From(val)
		}
	})
}

// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m fileuploadPoolMods) RandomDeletedNotNull(f *faker.Faker) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Deleted = func() null.Val[time.Time] {
			if f == nil {
				f = &defaultFaker
			}

			val := random_time_Time(f)
			return null.From(val)
		}
	})
}

// Set the model columns to this value
func (m fileuploadPoolMods) Geom(val null.Val[string]) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Geom = func() null.Val[string] { return val }
	})
}

// Set the Column from the function
func (m fileuploadPoolMods) GeomFunc(f func() null.Val[string]) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Geom = f
	})
}

// Clear any values for the column
func (m fileuploadPoolMods) UnsetGeom() FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Geom = nil
	})
}

// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m fileuploadPoolMods) RandomGeom(f *faker.Faker) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Geom = func() null.Val[string] {
			if f == nil {
				f = &defaultFaker
			}

			val := random_string(f)
			return null.From(val)
		}
	})
}

// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m fileuploadPoolMods) RandomGeomNotNull(f *faker.Faker) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Geom = func() null.Val[string] {
			if f == nil {
				f = &defaultFaker
			}

			val := random_string(f)
			return null.From(val)
		}
	})
}

// Set the model columns to this value
func (m fileuploadPoolMods) H3cell(val null.Val[string]) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.H3cell = func() null.Val[string] { return val }
	})
}

// Set the Column from the function
func (m fileuploadPoolMods) H3cellFunc(f func() null.Val[string]) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.H3cell = f
	})
}

// Clear any values for the column
func (m fileuploadPoolMods) UnsetH3cell() FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.H3cell = nil
	})
}

// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m fileuploadPoolMods) RandomH3cell(f *faker.Faker) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.H3cell = func() null.Val[string] {
			if f == nil {
				f = &defaultFaker
			}

			val := random_string(f)
			return null.From(val)
		}
	})
}

// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m fileuploadPoolMods) RandomH3cellNotNull(f *faker.Faker) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.H3cell = func() null.Val[string] {
			if f == nil {
				f = &defaultFaker
			}

			val := random_string(f)
			return null.From(val)
		}
	})
}

// Set the model columns to this value
func (m fileuploadPoolMods) ID(val int32) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.ID = func() int32 { return val }
	})
}

// Set the Column from the function
func (m fileuploadPoolMods) IDFunc(f func() int32) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.ID = f
	})
}

// Clear any values for the column
func (m fileuploadPoolMods) UnsetID() FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.ID = nil
	})
}

// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m fileuploadPoolMods) RandomID(f *faker.Faker) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.ID = func() int32 {
			return random_int32(f)
		}
	})
}

// Set the model columns to this value
func (m fileuploadPoolMods) IsInDistrict(val bool) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.IsInDistrict = func() bool { return val }
	})
}

// Set the Column from the function
func (m fileuploadPoolMods) IsInDistrictFunc(f func() bool) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.IsInDistrict = f
	})
}

// Clear any values for the column
func (m fileuploadPoolMods) UnsetIsInDistrict() FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.IsInDistrict = nil
	})
}

// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m fileuploadPoolMods) RandomIsInDistrict(f *faker.Faker) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.IsInDistrict = func() bool {
			return random_bool(f)
		}
	})
}

// Set the model columns to this value
func (m fileuploadPoolMods) IsNew(val bool) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.IsNew = func() bool { return val }
	})
}

// Set the Column from the function
func (m fileuploadPoolMods) IsNewFunc(f func() bool) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.IsNew = f
	})
}

// Clear any values for the column
func (m fileuploadPoolMods) UnsetIsNew() FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.IsNew = nil
	})
}

// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m fileuploadPoolMods) RandomIsNew(f *faker.Faker) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.IsNew = func() bool {
			return random_bool(f)
		}
	})
}

// Set the model columns to this value
func (m fileuploadPoolMods) Notes(val string) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Notes = func() string { return val }
	})
}

// Set the Column from the function
func (m fileuploadPoolMods) NotesFunc(f func() string) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Notes = f
	})
}

// Clear any values for the column
func (m fileuploadPoolMods) UnsetNotes() FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Notes = nil
	})
}

// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m fileuploadPoolMods) RandomNotes(f *faker.Faker) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Notes = func() string {
			return random_string(f)
		}
	})
}

// Set the model columns to this value
func (m fileuploadPoolMods) OrganizationID(val int32) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.OrganizationID = func() int32 { return val }
	})
}

// Set the Column from the function
func (m fileuploadPoolMods) OrganizationIDFunc(f func() int32) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.OrganizationID = f
	})
}

// Clear any values for the column
func (m fileuploadPoolMods) UnsetOrganizationID() FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.OrganizationID = nil
	})
}

// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m fileuploadPoolMods) RandomOrganizationID(f *faker.Faker) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.OrganizationID = func() int32 {
			return random_int32(f)
		}
	})
}

// Set the model columns to this value
func (m fileuploadPoolMods) PropertyOwnerName(val string) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.PropertyOwnerName = func() string { return val }
	})
}

// Set the Column from the function
func (m fileuploadPoolMods) PropertyOwnerNameFunc(f func() string) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.PropertyOwnerName = f
	})
}

// Clear any values for the column
func (m fileuploadPoolMods) UnsetPropertyOwnerName() FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.PropertyOwnerName = nil
	})
}

// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m fileuploadPoolMods) RandomPropertyOwnerName(f *faker.Faker) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.PropertyOwnerName = func() string {
			return random_string(f)
		}
	})
}

// Set the model columns to this value
func (m fileuploadPoolMods) PropertyOwnerPhoneE164(val null.Val[string]) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.PropertyOwnerPhoneE164 = func() null.Val[string] { return val }
	})
}

// Set the Column from the function
func (m fileuploadPoolMods) PropertyOwnerPhoneE164Func(f func() null.Val[string]) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.PropertyOwnerPhoneE164 = f
	})
}

// Clear any values for the column
func (m fileuploadPoolMods) UnsetPropertyOwnerPhoneE164() FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.PropertyOwnerPhoneE164 = nil
	})
}

// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m fileuploadPoolMods) RandomPropertyOwnerPhoneE164(f *faker.Faker) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.PropertyOwnerPhoneE164 = func() null.Val[string] {
			if f == nil {
				f = &defaultFaker
			}

			val := random_string(f)
			return null.From(val)
		}
	})
}

// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m fileuploadPoolMods) RandomPropertyOwnerPhoneE164NotNull(f *faker.Faker) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.PropertyOwnerPhoneE164 = func() null.Val[string] {
			if f == nil {
				f = &defaultFaker
			}

			val := random_string(f)
			return null.From(val)
		}
	})
}

// Set the model columns to this value
func (m fileuploadPoolMods) ResidentOwned(val null.Val[bool]) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.ResidentOwned = func() null.Val[bool] { return val }
	})
}

// Set the Column from the function
func (m fileuploadPoolMods) ResidentOwnedFunc(f func() null.Val[bool]) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.ResidentOwned = f
	})
}

// Clear any values for the column
func (m fileuploadPoolMods) UnsetResidentOwned() FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.ResidentOwned = nil
	})
}

// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m fileuploadPoolMods) RandomResidentOwned(f *faker.Faker) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.ResidentOwned = func() null.Val[bool] {
			if f == nil {
				f = &defaultFaker
			}

			val := random_bool(f)
			return null.From(val)
		}
	})
}

// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m fileuploadPoolMods) RandomResidentOwnedNotNull(f *faker.Faker) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.ResidentOwned = func() null.Val[bool] {
			if f == nil {
				f = &defaultFaker
			}

			val := random_bool(f)
			return null.From(val)
		}
	})
}

// Set the model columns to this value
func (m fileuploadPoolMods) ResidentPhoneE164(val null.Val[string]) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.ResidentPhoneE164 = func() null.Val[string] { return val }
	})
}

// Set the Column from the function
func (m fileuploadPoolMods) ResidentPhoneE164Func(f func() null.Val[string]) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.ResidentPhoneE164 = f
	})
}

// Clear any values for the column
func (m fileuploadPoolMods) UnsetResidentPhoneE164() FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.ResidentPhoneE164 = nil
	})
}

// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is sometimes null
func (m fileuploadPoolMods) RandomResidentPhoneE164(f *faker.Faker) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.ResidentPhoneE164 = func() null.Val[string] {
			if f == nil {
				f = &defaultFaker
			}

			val := random_string(f)
			return null.From(val)
		}
	})
}

// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
// The generated value is never null
func (m fileuploadPoolMods) RandomResidentPhoneE164NotNull(f *faker.Faker) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.ResidentPhoneE164 = func() null.Val[string] {
			if f == nil {
				f = &defaultFaker
			}

			val := random_string(f)
			return null.From(val)
		}
	})
}

// Set the model columns to this value
func (m fileuploadPoolMods) LineNumber(val int32) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.LineNumber = func() int32 { return val }
	})
}

// Set the Column from the function
func (m fileuploadPoolMods) LineNumberFunc(f func() int32) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.LineNumber = f
	})
}

// Clear any values for the column
func (m fileuploadPoolMods) UnsetLineNumber() FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.LineNumber = nil
	})
}

// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m fileuploadPoolMods) RandomLineNumber(f *faker.Faker) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.LineNumber = func() int32 {
			return random_int32(f)
		}
	})
}

// Set the model columns to this value
func (m fileuploadPoolMods) Tags(val pgtypes.HStore) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Tags = func() pgtypes.HStore { return val }
	})
}

// Set the Column from the function
func (m fileuploadPoolMods) TagsFunc(f func() pgtypes.HStore) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Tags = f
	})
}

// Clear any values for the column
func (m fileuploadPoolMods) UnsetTags() FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Tags = nil
	})
}

// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m fileuploadPoolMods) RandomTags(f *faker.Faker) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(_ context.Context, o *FileuploadPoolTemplate) {
		o.Tags = func() pgtypes.HStore {
			return random_pgtypes_HStore(f)
		}
	})
}

func (m fileuploadPoolMods) WithParentsCascading() FileuploadPoolMod {
	return FileuploadPoolModFunc(func(ctx context.Context, o *FileuploadPoolTemplate) {
		if isDone, _ := fileuploadPoolWithParentsCascadingCtx.Value(ctx); isDone {
			return
		}
		ctx = fileuploadPoolWithParentsCascadingCtx.WithValue(ctx, true)
		{

			related := o.f.NewUserWithContext(ctx, UserMods.WithParentsCascading())
			m.WithCreatorUser(related).Apply(ctx, o)
		}
		{

			related := o.f.NewFileuploadCSVWithContext(ctx, FileuploadCSVMods.WithParentsCascading())
			m.WithCSVFileCSV(related).Apply(ctx, o)
		}
		{

			related := o.f.NewOrganizationWithContext(ctx, OrganizationMods.WithParentsCascading())
			m.WithOrganization(related).Apply(ctx, o)
		}
		{

			related := o.f.NewCommsPhoneWithContext(ctx, CommsPhoneMods.WithParentsCascading())
			m.WithPropertyOwnerPhoneE164Phone(related).Apply(ctx, o)
		}
		{

			related := o.f.NewCommsPhoneWithContext(ctx, CommsPhoneMods.WithParentsCascading())
			m.WithResidentPhoneE164Phone(related).Apply(ctx, o)
		}
	})
}

func (m fileuploadPoolMods) WithCreatorUser(rel *UserTemplate) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(ctx context.Context, o *FileuploadPoolTemplate) {
		o.r.CreatorUser = &fileuploadPoolRCreatorUserR{
			o: rel,
		}
	})
}

func (m fileuploadPoolMods) WithNewCreatorUser(mods ...UserMod) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(ctx context.Context, o *FileuploadPoolTemplate) {
		related := o.f.NewUserWithContext(ctx, mods...)

		m.WithCreatorUser(related).Apply(ctx, o)
	})
}

func (m fileuploadPoolMods) WithExistingCreatorUser(em *models.User) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(ctx context.Context, o *FileuploadPoolTemplate) {
		o.r.CreatorUser = &fileuploadPoolRCreatorUserR{
			o: o.f.FromExistingUser(em),
		}
	})
}

func (m fileuploadPoolMods) WithoutCreatorUser() FileuploadPoolMod {
	return FileuploadPoolModFunc(func(ctx context.Context, o *FileuploadPoolTemplate) {
		o.r.CreatorUser = nil
	})
}

func (m fileuploadPoolMods) WithCSVFileCSV(rel *FileuploadCSVTemplate) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(ctx context.Context, o *FileuploadPoolTemplate) {
		o.r.CSVFileCSV = &fileuploadPoolRCSVFileCSVR{
			o: rel,
		}
	})
}

func (m fileuploadPoolMods) WithNewCSVFileCSV(mods ...FileuploadCSVMod) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(ctx context.Context, o *FileuploadPoolTemplate) {
		related := o.f.NewFileuploadCSVWithContext(ctx, mods...)

		m.WithCSVFileCSV(related).Apply(ctx, o)
	})
}

func (m fileuploadPoolMods) WithExistingCSVFileCSV(em *models.FileuploadCSV) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(ctx context.Context, o *FileuploadPoolTemplate) {
		o.r.CSVFileCSV = &fileuploadPoolRCSVFileCSVR{
			o: o.f.FromExistingFileuploadCSV(em),
		}
	})
}

func (m fileuploadPoolMods) WithoutCSVFileCSV() FileuploadPoolMod {
	return FileuploadPoolModFunc(func(ctx context.Context, o *FileuploadPoolTemplate) {
		o.r.CSVFileCSV = nil
	})
}

func (m fileuploadPoolMods) WithOrganization(rel *OrganizationTemplate) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(ctx context.Context, o *FileuploadPoolTemplate) {
		o.r.Organization = &fileuploadPoolROrganizationR{
			o: rel,
		}
	})
}

func (m fileuploadPoolMods) WithNewOrganization(mods ...OrganizationMod) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(ctx context.Context, o *FileuploadPoolTemplate) {
		related := o.f.NewOrganizationWithContext(ctx, mods...)

		m.WithOrganization(related).Apply(ctx, o)
	})
}

func (m fileuploadPoolMods) WithExistingOrganization(em *models.Organization) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(ctx context.Context, o *FileuploadPoolTemplate) {
		o.r.Organization = &fileuploadPoolROrganizationR{
			o: o.f.FromExistingOrganization(em),
		}
	})
}

func (m fileuploadPoolMods) WithoutOrganization() FileuploadPoolMod {
	return FileuploadPoolModFunc(func(ctx context.Context, o *FileuploadPoolTemplate) {
		o.r.Organization = nil
	})
}

func (m fileuploadPoolMods) WithPropertyOwnerPhoneE164Phone(rel *CommsPhoneTemplate) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(ctx context.Context, o *FileuploadPoolTemplate) {
		o.r.PropertyOwnerPhoneE164Phone = &fileuploadPoolRPropertyOwnerPhoneE164PhoneR{
			o: rel,
		}
	})
}

func (m fileuploadPoolMods) WithNewPropertyOwnerPhoneE164Phone(mods ...CommsPhoneMod) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(ctx context.Context, o *FileuploadPoolTemplate) {
		related := o.f.NewCommsPhoneWithContext(ctx, mods...)

		m.WithPropertyOwnerPhoneE164Phone(related).Apply(ctx, o)
	})
}

func (m fileuploadPoolMods) WithExistingPropertyOwnerPhoneE164Phone(em *models.CommsPhone) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(ctx context.Context, o *FileuploadPoolTemplate) {
		o.r.PropertyOwnerPhoneE164Phone = &fileuploadPoolRPropertyOwnerPhoneE164PhoneR{
			o: o.f.FromExistingCommsPhone(em),
		}
	})
}

func (m fileuploadPoolMods) WithoutPropertyOwnerPhoneE164Phone() FileuploadPoolMod {
	return FileuploadPoolModFunc(func(ctx context.Context, o *FileuploadPoolTemplate) {
		o.r.PropertyOwnerPhoneE164Phone = nil
	})
}

func (m fileuploadPoolMods) WithResidentPhoneE164Phone(rel *CommsPhoneTemplate) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(ctx context.Context, o *FileuploadPoolTemplate) {
		o.r.ResidentPhoneE164Phone = &fileuploadPoolRResidentPhoneE164PhoneR{
			o: rel,
		}
	})
}

func (m fileuploadPoolMods) WithNewResidentPhoneE164Phone(mods ...CommsPhoneMod) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(ctx context.Context, o *FileuploadPoolTemplate) {
		related := o.f.NewCommsPhoneWithContext(ctx, mods...)

		m.WithResidentPhoneE164Phone(related).Apply(ctx, o)
	})
}

func (m fileuploadPoolMods) WithExistingResidentPhoneE164Phone(em *models.CommsPhone) FileuploadPoolMod {
	return FileuploadPoolModFunc(func(ctx context.Context, o *FileuploadPoolTemplate) {
		o.r.ResidentPhoneE164Phone = &fileuploadPoolRResidentPhoneE164PhoneR{
			o: o.f.FromExistingCommsPhone(em),
		}
	})
}

func (m fileuploadPoolMods) WithoutResidentPhoneE164Phone() FileuploadPoolMod {
	return FileuploadPoolModFunc(func(ctx context.Context, o *FileuploadPoolTemplate) {
		o.r.ResidentPhoneE164Phone = nil
	})
}
