nidus-sync/factory/fs_stormdrain.bob.go
Eli Ribble e48abb09c0
Go to h3 v4, Add initial h3 aggregation work
This calculates the summary information of data in h3 nodes and puts it
in the database for fast lookup.
2025-11-13 23:49:12 +00:00

1634 lines
47 KiB
Go

// Code generated by BobGen psql v0.41.1. 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"
models "github.com/Gleipnir-Technology/nidus-sync/models"
"github.com/aarondl/opt/null"
"github.com/aarondl/opt/omit"
"github.com/aarondl/opt/omitnull"
"github.com/jaswdr/faker/v2"
"github.com/stephenafamo/bob"
)
type FSStormdrainMod interface {
Apply(context.Context, *FSStormdrainTemplate)
}
type FSStormdrainModFunc func(context.Context, *FSStormdrainTemplate)
func (f FSStormdrainModFunc) Apply(ctx context.Context, n *FSStormdrainTemplate) {
f(ctx, n)
}
type FSStormdrainModSlice []FSStormdrainMod
func (mods FSStormdrainModSlice) Apply(ctx context.Context, n *FSStormdrainTemplate) {
for _, f := range mods {
f.Apply(ctx, n)
}
}
// FSStormdrainTemplate is an object representing the database table.
// all columns are optional and should be set by mods
type FSStormdrainTemplate struct {
OrganizationID func() int32
Creationdate func() null.Val[int64]
Creator func() null.Val[string]
Editdate func() null.Val[int64]
Editor func() null.Val[string]
Globalid func() string
Jurisdiction func() null.Val[string]
Lastaction func() null.Val[string]
Laststatus func() null.Val[string]
Lasttreatdate func() null.Val[int64]
Nexttreatmentdate func() null.Val[int64]
Objectid func() int32
Symbology func() null.Val[string]
Type func() null.Val[string]
Zone func() null.Val[string]
Zone2 func() null.Val[string]
CreatedDate func() null.Val[int64]
CreatedUser func() null.Val[string]
GeometryX func() null.Val[float64]
GeometryY func() null.Val[float64]
LastEditedDate func() null.Val[int64]
LastEditedUser func() null.Val[string]
Updated func() time.Time
r fsStormdrainR
f *Factory
alreadyPersisted bool
}
type fsStormdrainR struct {
Organization *fsStormdrainROrganizationR
}
type fsStormdrainROrganizationR struct {
o *OrganizationTemplate
}
// Apply mods to the FSStormdrainTemplate
func (o *FSStormdrainTemplate) Apply(ctx context.Context, mods ...FSStormdrainMod) {
for _, mod := range mods {
mod.Apply(ctx, o)
}
}
// setModelRels creates and sets the relationships on *models.FSStormdrain
// according to the relationships in the template. Nothing is inserted into the db
func (t FSStormdrainTemplate) setModelRels(o *models.FSStormdrain) {
if t.r.Organization != nil {
rel := t.r.Organization.o.Build()
rel.R.FSStormdrains = append(rel.R.FSStormdrains, o)
o.OrganizationID = rel.ID // h2
o.R.Organization = rel
}
}
// BuildSetter returns an *models.FSStormdrainSetter
// this does nothing with the relationship templates
func (o FSStormdrainTemplate) BuildSetter() *models.FSStormdrainSetter {
m := &models.FSStormdrainSetter{}
if o.OrganizationID != nil {
val := o.OrganizationID()
m.OrganizationID = omit.From(val)
}
if o.Creationdate != nil {
val := o.Creationdate()
m.Creationdate = omitnull.FromNull(val)
}
if o.Creator != nil {
val := o.Creator()
m.Creator = omitnull.FromNull(val)
}
if o.Editdate != nil {
val := o.Editdate()
m.Editdate = omitnull.FromNull(val)
}
if o.Editor != nil {
val := o.Editor()
m.Editor = omitnull.FromNull(val)
}
if o.Globalid != nil {
val := o.Globalid()
m.Globalid = omit.From(val)
}
if o.Jurisdiction != nil {
val := o.Jurisdiction()
m.Jurisdiction = omitnull.FromNull(val)
}
if o.Lastaction != nil {
val := o.Lastaction()
m.Lastaction = omitnull.FromNull(val)
}
if o.Laststatus != nil {
val := o.Laststatus()
m.Laststatus = omitnull.FromNull(val)
}
if o.Lasttreatdate != nil {
val := o.Lasttreatdate()
m.Lasttreatdate = omitnull.FromNull(val)
}
if o.Nexttreatmentdate != nil {
val := o.Nexttreatmentdate()
m.Nexttreatmentdate = omitnull.FromNull(val)
}
if o.Objectid != nil {
val := o.Objectid()
m.Objectid = omit.From(val)
}
if o.Symbology != nil {
val := o.Symbology()
m.Symbology = omitnull.FromNull(val)
}
if o.Type != nil {
val := o.Type()
m.Type = omitnull.FromNull(val)
}
if o.Zone != nil {
val := o.Zone()
m.Zone = omitnull.FromNull(val)
}
if o.Zone2 != nil {
val := o.Zone2()
m.Zone2 = omitnull.FromNull(val)
}
if o.CreatedDate != nil {
val := o.CreatedDate()
m.CreatedDate = omitnull.FromNull(val)
}
if o.CreatedUser != nil {
val := o.CreatedUser()
m.CreatedUser = omitnull.FromNull(val)
}
if o.GeometryX != nil {
val := o.GeometryX()
m.GeometryX = omitnull.FromNull(val)
}
if o.GeometryY != nil {
val := o.GeometryY()
m.GeometryY = omitnull.FromNull(val)
}
if o.LastEditedDate != nil {
val := o.LastEditedDate()
m.LastEditedDate = omitnull.FromNull(val)
}
if o.LastEditedUser != nil {
val := o.LastEditedUser()
m.LastEditedUser = omitnull.FromNull(val)
}
if o.Updated != nil {
val := o.Updated()
m.Updated = omit.From(val)
}
return m
}
// BuildManySetter returns an []*models.FSStormdrainSetter
// this does nothing with the relationship templates
func (o FSStormdrainTemplate) BuildManySetter(number int) []*models.FSStormdrainSetter {
m := make([]*models.FSStormdrainSetter, number)
for i := range m {
m[i] = o.BuildSetter()
}
return m
}
// Build returns an *models.FSStormdrain
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use FSStormdrainTemplate.Create
func (o FSStormdrainTemplate) Build() *models.FSStormdrain {
m := &models.FSStormdrain{}
if o.OrganizationID != nil {
m.OrganizationID = o.OrganizationID()
}
if o.Creationdate != nil {
m.Creationdate = o.Creationdate()
}
if o.Creator != nil {
m.Creator = o.Creator()
}
if o.Editdate != nil {
m.Editdate = o.Editdate()
}
if o.Editor != nil {
m.Editor = o.Editor()
}
if o.Globalid != nil {
m.Globalid = o.Globalid()
}
if o.Jurisdiction != nil {
m.Jurisdiction = o.Jurisdiction()
}
if o.Lastaction != nil {
m.Lastaction = o.Lastaction()
}
if o.Laststatus != nil {
m.Laststatus = o.Laststatus()
}
if o.Lasttreatdate != nil {
m.Lasttreatdate = o.Lasttreatdate()
}
if o.Nexttreatmentdate != nil {
m.Nexttreatmentdate = o.Nexttreatmentdate()
}
if o.Objectid != nil {
m.Objectid = o.Objectid()
}
if o.Symbology != nil {
m.Symbology = o.Symbology()
}
if o.Type != nil {
m.Type = o.Type()
}
if o.Zone != nil {
m.Zone = o.Zone()
}
if o.Zone2 != nil {
m.Zone2 = o.Zone2()
}
if o.CreatedDate != nil {
m.CreatedDate = o.CreatedDate()
}
if o.CreatedUser != nil {
m.CreatedUser = o.CreatedUser()
}
if o.GeometryX != nil {
m.GeometryX = o.GeometryX()
}
if o.GeometryY != nil {
m.GeometryY = o.GeometryY()
}
if o.LastEditedDate != nil {
m.LastEditedDate = o.LastEditedDate()
}
if o.LastEditedUser != nil {
m.LastEditedUser = o.LastEditedUser()
}
if o.Updated != nil {
m.Updated = o.Updated()
}
o.setModelRels(m)
return m
}
// BuildMany returns an models.FSStormdrainSlice
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use FSStormdrainTemplate.CreateMany
func (o FSStormdrainTemplate) BuildMany(number int) models.FSStormdrainSlice {
m := make(models.FSStormdrainSlice, number)
for i := range m {
m[i] = o.Build()
}
return m
}
func ensureCreatableFSStormdrain(m *models.FSStormdrainSetter) {
if !(m.OrganizationID.IsValue()) {
val := random_int32(nil)
m.OrganizationID = omit.From(val)
}
if !(m.Globalid.IsValue()) {
val := random_string(nil)
m.Globalid = omit.From(val)
}
if !(m.Objectid.IsValue()) {
val := random_int32(nil)
m.Objectid = omit.From(val)
}
}
// insertOptRels creates and inserts any optional the relationships on *models.FSStormdrain
// according to the relationships in the template.
// any required relationship should have already exist on the model
func (o *FSStormdrainTemplate) insertOptRels(ctx context.Context, exec bob.Executor, m *models.FSStormdrain) error {
var err error
return err
}
// Create builds a fsStormdrain and inserts it into the database
// Relations objects are also inserted and placed in the .R field
func (o *FSStormdrainTemplate) Create(ctx context.Context, exec bob.Executor) (*models.FSStormdrain, error) {
var err error
opt := o.BuildSetter()
ensureCreatableFSStormdrain(opt)
if o.r.Organization == nil {
FSStormdrainMods.WithNewOrganization().Apply(ctx, o)
}
var rel0 *models.Organization
if o.r.Organization.o.alreadyPersisted {
rel0 = o.r.Organization.o.Build()
} else {
rel0, err = o.r.Organization.o.Create(ctx, exec)
if err != nil {
return nil, err
}
}
opt.OrganizationID = omit.From(rel0.ID)
m, err := models.FSStormdrains.Insert(opt).One(ctx, exec)
if err != nil {
return nil, err
}
m.R.Organization = rel0
if err := o.insertOptRels(ctx, exec, m); err != nil {
return nil, err
}
return m, err
}
// MustCreate builds a fsStormdrain and inserts it into the database
// Relations objects are also inserted and placed in the .R field
// panics if an error occurs
func (o *FSStormdrainTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.FSStormdrain {
m, err := o.Create(ctx, exec)
if err != nil {
panic(err)
}
return m
}
// CreateOrFail builds a fsStormdrain 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 *FSStormdrainTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.FSStormdrain {
tb.Helper()
m, err := o.Create(ctx, exec)
if err != nil {
tb.Fatal(err)
return nil
}
return m
}
// CreateMany builds multiple fsStormdrains and inserts them into the database
// Relations objects are also inserted and placed in the .R field
func (o FSStormdrainTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.FSStormdrainSlice, error) {
var err error
m := make(models.FSStormdrainSlice, number)
for i := range m {
m[i], err = o.Create(ctx, exec)
if err != nil {
return nil, err
}
}
return m, nil
}
// MustCreateMany builds multiple fsStormdrains and inserts them into the database
// Relations objects are also inserted and placed in the .R field
// panics if an error occurs
func (o FSStormdrainTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.FSStormdrainSlice {
m, err := o.CreateMany(ctx, exec, number)
if err != nil {
panic(err)
}
return m
}
// CreateManyOrFail builds multiple fsStormdrains 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 FSStormdrainTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.FSStormdrainSlice {
tb.Helper()
m, err := o.CreateMany(ctx, exec, number)
if err != nil {
tb.Fatal(err)
return nil
}
return m
}
// FSStormdrain has methods that act as mods for the FSStormdrainTemplate
var FSStormdrainMods fsStormdrainMods
type fsStormdrainMods struct{}
func (m fsStormdrainMods) RandomizeAllColumns(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModSlice{
FSStormdrainMods.RandomOrganizationID(f),
FSStormdrainMods.RandomCreationdate(f),
FSStormdrainMods.RandomCreator(f),
FSStormdrainMods.RandomEditdate(f),
FSStormdrainMods.RandomEditor(f),
FSStormdrainMods.RandomGlobalid(f),
FSStormdrainMods.RandomJurisdiction(f),
FSStormdrainMods.RandomLastaction(f),
FSStormdrainMods.RandomLaststatus(f),
FSStormdrainMods.RandomLasttreatdate(f),
FSStormdrainMods.RandomNexttreatmentdate(f),
FSStormdrainMods.RandomObjectid(f),
FSStormdrainMods.RandomSymbology(f),
FSStormdrainMods.RandomType(f),
FSStormdrainMods.RandomZone(f),
FSStormdrainMods.RandomZone2(f),
FSStormdrainMods.RandomCreatedDate(f),
FSStormdrainMods.RandomCreatedUser(f),
FSStormdrainMods.RandomGeometryX(f),
FSStormdrainMods.RandomGeometryY(f),
FSStormdrainMods.RandomLastEditedDate(f),
FSStormdrainMods.RandomLastEditedUser(f),
FSStormdrainMods.RandomUpdated(f),
}
}
// Set the model columns to this value
func (m fsStormdrainMods) OrganizationID(val int32) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.OrganizationID = func() int32 { return val }
})
}
// Set the Column from the function
func (m fsStormdrainMods) OrganizationIDFunc(f func() int32) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.OrganizationID = f
})
}
// Clear any values for the column
func (m fsStormdrainMods) UnsetOrganizationID() FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
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 fsStormdrainMods) RandomOrganizationID(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.OrganizationID = func() int32 {
return random_int32(f)
}
})
}
// Set the model columns to this value
func (m fsStormdrainMods) Creationdate(val null.Val[int64]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Creationdate = func() null.Val[int64] { return val }
})
}
// Set the Column from the function
func (m fsStormdrainMods) CreationdateFunc(f func() null.Val[int64]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Creationdate = f
})
}
// Clear any values for the column
func (m fsStormdrainMods) UnsetCreationdate() FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Creationdate = 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 fsStormdrainMods) RandomCreationdate(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Creationdate = func() null.Val[int64] {
if f == nil {
f = &defaultFaker
}
val := random_int64(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 fsStormdrainMods) RandomCreationdateNotNull(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Creationdate = func() null.Val[int64] {
if f == nil {
f = &defaultFaker
}
val := random_int64(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fsStormdrainMods) Creator(val null.Val[string]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Creator = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fsStormdrainMods) CreatorFunc(f func() null.Val[string]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Creator = f
})
}
// Clear any values for the column
func (m fsStormdrainMods) UnsetCreator() FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Creator = 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 fsStormdrainMods) RandomCreator(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Creator = 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 fsStormdrainMods) RandomCreatorNotNull(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Creator = 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 fsStormdrainMods) Editdate(val null.Val[int64]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Editdate = func() null.Val[int64] { return val }
})
}
// Set the Column from the function
func (m fsStormdrainMods) EditdateFunc(f func() null.Val[int64]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Editdate = f
})
}
// Clear any values for the column
func (m fsStormdrainMods) UnsetEditdate() FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Editdate = 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 fsStormdrainMods) RandomEditdate(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Editdate = func() null.Val[int64] {
if f == nil {
f = &defaultFaker
}
val := random_int64(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 fsStormdrainMods) RandomEditdateNotNull(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Editdate = func() null.Val[int64] {
if f == nil {
f = &defaultFaker
}
val := random_int64(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fsStormdrainMods) Editor(val null.Val[string]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Editor = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fsStormdrainMods) EditorFunc(f func() null.Val[string]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Editor = f
})
}
// Clear any values for the column
func (m fsStormdrainMods) UnsetEditor() FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Editor = 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 fsStormdrainMods) RandomEditor(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Editor = 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 fsStormdrainMods) RandomEditorNotNull(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Editor = 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 fsStormdrainMods) Globalid(val string) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Globalid = func() string { return val }
})
}
// Set the Column from the function
func (m fsStormdrainMods) GlobalidFunc(f func() string) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Globalid = f
})
}
// Clear any values for the column
func (m fsStormdrainMods) UnsetGlobalid() FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Globalid = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m fsStormdrainMods) RandomGlobalid(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Globalid = func() string {
return random_string(f)
}
})
}
// Set the model columns to this value
func (m fsStormdrainMods) Jurisdiction(val null.Val[string]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Jurisdiction = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fsStormdrainMods) JurisdictionFunc(f func() null.Val[string]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Jurisdiction = f
})
}
// Clear any values for the column
func (m fsStormdrainMods) UnsetJurisdiction() FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Jurisdiction = 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 fsStormdrainMods) RandomJurisdiction(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Jurisdiction = 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 fsStormdrainMods) RandomJurisdictionNotNull(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Jurisdiction = 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 fsStormdrainMods) Lastaction(val null.Val[string]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Lastaction = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fsStormdrainMods) LastactionFunc(f func() null.Val[string]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Lastaction = f
})
}
// Clear any values for the column
func (m fsStormdrainMods) UnsetLastaction() FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Lastaction = 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 fsStormdrainMods) RandomLastaction(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Lastaction = 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 fsStormdrainMods) RandomLastactionNotNull(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Lastaction = 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 fsStormdrainMods) Laststatus(val null.Val[string]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Laststatus = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fsStormdrainMods) LaststatusFunc(f func() null.Val[string]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Laststatus = f
})
}
// Clear any values for the column
func (m fsStormdrainMods) UnsetLaststatus() FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Laststatus = 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 fsStormdrainMods) RandomLaststatus(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Laststatus = 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 fsStormdrainMods) RandomLaststatusNotNull(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Laststatus = 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 fsStormdrainMods) Lasttreatdate(val null.Val[int64]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Lasttreatdate = func() null.Val[int64] { return val }
})
}
// Set the Column from the function
func (m fsStormdrainMods) LasttreatdateFunc(f func() null.Val[int64]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Lasttreatdate = f
})
}
// Clear any values for the column
func (m fsStormdrainMods) UnsetLasttreatdate() FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Lasttreatdate = 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 fsStormdrainMods) RandomLasttreatdate(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Lasttreatdate = func() null.Val[int64] {
if f == nil {
f = &defaultFaker
}
val := random_int64(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 fsStormdrainMods) RandomLasttreatdateNotNull(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Lasttreatdate = func() null.Val[int64] {
if f == nil {
f = &defaultFaker
}
val := random_int64(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fsStormdrainMods) Nexttreatmentdate(val null.Val[int64]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Nexttreatmentdate = func() null.Val[int64] { return val }
})
}
// Set the Column from the function
func (m fsStormdrainMods) NexttreatmentdateFunc(f func() null.Val[int64]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Nexttreatmentdate = f
})
}
// Clear any values for the column
func (m fsStormdrainMods) UnsetNexttreatmentdate() FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Nexttreatmentdate = 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 fsStormdrainMods) RandomNexttreatmentdate(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Nexttreatmentdate = func() null.Val[int64] {
if f == nil {
f = &defaultFaker
}
val := random_int64(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 fsStormdrainMods) RandomNexttreatmentdateNotNull(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Nexttreatmentdate = func() null.Val[int64] {
if f == nil {
f = &defaultFaker
}
val := random_int64(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fsStormdrainMods) Objectid(val int32) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Objectid = func() int32 { return val }
})
}
// Set the Column from the function
func (m fsStormdrainMods) ObjectidFunc(f func() int32) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Objectid = f
})
}
// Clear any values for the column
func (m fsStormdrainMods) UnsetObjectid() FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Objectid = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m fsStormdrainMods) RandomObjectid(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Objectid = func() int32 {
return random_int32(f)
}
})
}
// Set the model columns to this value
func (m fsStormdrainMods) Symbology(val null.Val[string]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Symbology = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fsStormdrainMods) SymbologyFunc(f func() null.Val[string]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Symbology = f
})
}
// Clear any values for the column
func (m fsStormdrainMods) UnsetSymbology() FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Symbology = 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 fsStormdrainMods) RandomSymbology(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Symbology = 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 fsStormdrainMods) RandomSymbologyNotNull(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Symbology = 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 fsStormdrainMods) Type(val null.Val[string]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Type = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fsStormdrainMods) TypeFunc(f func() null.Val[string]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Type = f
})
}
// Clear any values for the column
func (m fsStormdrainMods) UnsetType() FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Type = 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 fsStormdrainMods) RandomType(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Type = 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 fsStormdrainMods) RandomTypeNotNull(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Type = 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 fsStormdrainMods) Zone(val null.Val[string]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Zone = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fsStormdrainMods) ZoneFunc(f func() null.Val[string]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Zone = f
})
}
// Clear any values for the column
func (m fsStormdrainMods) UnsetZone() FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Zone = 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 fsStormdrainMods) RandomZone(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Zone = 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 fsStormdrainMods) RandomZoneNotNull(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Zone = 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 fsStormdrainMods) Zone2(val null.Val[string]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Zone2 = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fsStormdrainMods) Zone2Func(f func() null.Val[string]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Zone2 = f
})
}
// Clear any values for the column
func (m fsStormdrainMods) UnsetZone2() FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Zone2 = 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 fsStormdrainMods) RandomZone2(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Zone2 = 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 fsStormdrainMods) RandomZone2NotNull(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Zone2 = 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 fsStormdrainMods) CreatedDate(val null.Val[int64]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.CreatedDate = func() null.Val[int64] { return val }
})
}
// Set the Column from the function
func (m fsStormdrainMods) CreatedDateFunc(f func() null.Val[int64]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.CreatedDate = f
})
}
// Clear any values for the column
func (m fsStormdrainMods) UnsetCreatedDate() FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.CreatedDate = 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 fsStormdrainMods) RandomCreatedDate(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.CreatedDate = func() null.Val[int64] {
if f == nil {
f = &defaultFaker
}
val := random_int64(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 fsStormdrainMods) RandomCreatedDateNotNull(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.CreatedDate = func() null.Val[int64] {
if f == nil {
f = &defaultFaker
}
val := random_int64(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fsStormdrainMods) CreatedUser(val null.Val[string]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.CreatedUser = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fsStormdrainMods) CreatedUserFunc(f func() null.Val[string]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.CreatedUser = f
})
}
// Clear any values for the column
func (m fsStormdrainMods) UnsetCreatedUser() FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.CreatedUser = 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 fsStormdrainMods) RandomCreatedUser(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.CreatedUser = 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 fsStormdrainMods) RandomCreatedUserNotNull(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.CreatedUser = 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 fsStormdrainMods) GeometryX(val null.Val[float64]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.GeometryX = func() null.Val[float64] { return val }
})
}
// Set the Column from the function
func (m fsStormdrainMods) GeometryXFunc(f func() null.Val[float64]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.GeometryX = f
})
}
// Clear any values for the column
func (m fsStormdrainMods) UnsetGeometryX() FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.GeometryX = 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 fsStormdrainMods) RandomGeometryX(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.GeometryX = func() null.Val[float64] {
if f == nil {
f = &defaultFaker
}
val := random_float64(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 fsStormdrainMods) RandomGeometryXNotNull(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.GeometryX = func() null.Val[float64] {
if f == nil {
f = &defaultFaker
}
val := random_float64(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fsStormdrainMods) GeometryY(val null.Val[float64]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.GeometryY = func() null.Val[float64] { return val }
})
}
// Set the Column from the function
func (m fsStormdrainMods) GeometryYFunc(f func() null.Val[float64]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.GeometryY = f
})
}
// Clear any values for the column
func (m fsStormdrainMods) UnsetGeometryY() FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.GeometryY = 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 fsStormdrainMods) RandomGeometryY(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.GeometryY = func() null.Val[float64] {
if f == nil {
f = &defaultFaker
}
val := random_float64(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 fsStormdrainMods) RandomGeometryYNotNull(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.GeometryY = func() null.Val[float64] {
if f == nil {
f = &defaultFaker
}
val := random_float64(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fsStormdrainMods) LastEditedDate(val null.Val[int64]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.LastEditedDate = func() null.Val[int64] { return val }
})
}
// Set the Column from the function
func (m fsStormdrainMods) LastEditedDateFunc(f func() null.Val[int64]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.LastEditedDate = f
})
}
// Clear any values for the column
func (m fsStormdrainMods) UnsetLastEditedDate() FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.LastEditedDate = 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 fsStormdrainMods) RandomLastEditedDate(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.LastEditedDate = func() null.Val[int64] {
if f == nil {
f = &defaultFaker
}
val := random_int64(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 fsStormdrainMods) RandomLastEditedDateNotNull(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.LastEditedDate = func() null.Val[int64] {
if f == nil {
f = &defaultFaker
}
val := random_int64(f)
return null.From(val)
}
})
}
// Set the model columns to this value
func (m fsStormdrainMods) LastEditedUser(val null.Val[string]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.LastEditedUser = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m fsStormdrainMods) LastEditedUserFunc(f func() null.Val[string]) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.LastEditedUser = f
})
}
// Clear any values for the column
func (m fsStormdrainMods) UnsetLastEditedUser() FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.LastEditedUser = 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 fsStormdrainMods) RandomLastEditedUser(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.LastEditedUser = 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 fsStormdrainMods) RandomLastEditedUserNotNull(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.LastEditedUser = 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 fsStormdrainMods) Updated(val time.Time) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Updated = func() time.Time { return val }
})
}
// Set the Column from the function
func (m fsStormdrainMods) UpdatedFunc(f func() time.Time) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Updated = f
})
}
// Clear any values for the column
func (m fsStormdrainMods) UnsetUpdated() FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Updated = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m fsStormdrainMods) RandomUpdated(f *faker.Faker) FSStormdrainMod {
return FSStormdrainModFunc(func(_ context.Context, o *FSStormdrainTemplate) {
o.Updated = func() time.Time {
return random_time_Time(f)
}
})
}
func (m fsStormdrainMods) WithParentsCascading() FSStormdrainMod {
return FSStormdrainModFunc(func(ctx context.Context, o *FSStormdrainTemplate) {
if isDone, _ := fsStormdrainWithParentsCascadingCtx.Value(ctx); isDone {
return
}
ctx = fsStormdrainWithParentsCascadingCtx.WithValue(ctx, true)
{
related := o.f.NewOrganizationWithContext(ctx, OrganizationMods.WithParentsCascading())
m.WithOrganization(related).Apply(ctx, o)
}
})
}
func (m fsStormdrainMods) WithOrganization(rel *OrganizationTemplate) FSStormdrainMod {
return FSStormdrainModFunc(func(ctx context.Context, o *FSStormdrainTemplate) {
o.r.Organization = &fsStormdrainROrganizationR{
o: rel,
}
})
}
func (m fsStormdrainMods) WithNewOrganization(mods ...OrganizationMod) FSStormdrainMod {
return FSStormdrainModFunc(func(ctx context.Context, o *FSStormdrainTemplate) {
related := o.f.NewOrganizationWithContext(ctx, mods...)
m.WithOrganization(related).Apply(ctx, o)
})
}
func (m fsStormdrainMods) WithExistingOrganization(em *models.Organization) FSStormdrainMod {
return FSStormdrainModFunc(func(ctx context.Context, o *FSStormdrainTemplate) {
o.r.Organization = &fsStormdrainROrganizationR{
o: o.f.FromExistingOrganization(em),
}
})
}
func (m fsStormdrainMods) WithoutOrganization() FSStormdrainMod {
return FSStormdrainModFunc(func(ctx context.Context, o *FSStormdrainTemplate) {
o.r.Organization = nil
})
}