nidus-sync/db/factory/publicreport.nuisance.bob.go
Eli Ribble 61d8d14fc2
Bunch of work around assigning reports to districts
I added some DB schema to track logos and to relate reports to
organizations. I reworked how GPS data comes from EXIF data on images
because it wasn't working for JPEGs. I might have broken PNGs in the
process. Also made the config options for domain names more
standardized.
2026-01-22 03:27:32 +00:00

1549 lines
52 KiB
Go

// Code generated by BobGen psql v0.42.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"
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"
"github.com/stephenafamo/bob"
)
type PublicreportNuisanceMod interface {
Apply(context.Context, *PublicreportNuisanceTemplate)
}
type PublicreportNuisanceModFunc func(context.Context, *PublicreportNuisanceTemplate)
func (f PublicreportNuisanceModFunc) Apply(ctx context.Context, n *PublicreportNuisanceTemplate) {
f(ctx, n)
}
type PublicreportNuisanceModSlice []PublicreportNuisanceMod
func (mods PublicreportNuisanceModSlice) Apply(ctx context.Context, n *PublicreportNuisanceTemplate) {
for _, f := range mods {
f.Apply(ctx, n)
}
}
// PublicreportNuisanceTemplate is an object representing the database table.
// all columns are optional and should be set by mods
type PublicreportNuisanceTemplate struct {
ID func() int32
AdditionalInfo func() string
Created func() time.Time
Duration func() enums.PublicreportNuisancedurationtype
Email func() string
InspectionType func() enums.PublicreportNuisanceinspectiontype
SourceLocation func() enums.PublicreportNuisancelocationtype
PreferredDateRange func() enums.PublicreportNuisancepreferreddaterangetype
PreferredTime func() enums.PublicreportNuisancepreferredtimetype
RequestCall func() bool
Severity func() int16
SourceContainer func() bool
SourceDescription func() string
SourceRoof func() bool
SourceStagnant func() bool
TimeOfDayDay func() bool
TimeOfDayEarly func() bool
TimeOfDayEvening func() bool
TimeOfDayNight func() bool
PublicID func() string
ReporterAddress func() string
ReporterEmail func() string
ReporterName func() string
ReporterPhone func() string
Address func() string
Location func() null.Val[string]
Status func() enums.PublicreportReportstatustype
OrganizationID func() null.Val[int32]
r publicreportNuisanceR
f *Factory
alreadyPersisted bool
}
type publicreportNuisanceR struct {
Organization *publicreportNuisanceROrganizationR
}
type publicreportNuisanceROrganizationR struct {
o *OrganizationTemplate
}
// Apply mods to the PublicreportNuisanceTemplate
func (o *PublicreportNuisanceTemplate) Apply(ctx context.Context, mods ...PublicreportNuisanceMod) {
for _, mod := range mods {
mod.Apply(ctx, o)
}
}
// setModelRels creates and sets the relationships on *models.PublicreportNuisance
// according to the relationships in the template. Nothing is inserted into the db
func (t PublicreportNuisanceTemplate) setModelRels(o *models.PublicreportNuisance) {
if t.r.Organization != nil {
rel := t.r.Organization.o.Build()
rel.R.Nuisances = append(rel.R.Nuisances, o)
o.OrganizationID = null.From(rel.ID) // h2
o.R.Organization = rel
}
}
// BuildSetter returns an *models.PublicreportNuisanceSetter
// this does nothing with the relationship templates
func (o PublicreportNuisanceTemplate) BuildSetter() *models.PublicreportNuisanceSetter {
m := &models.PublicreportNuisanceSetter{}
if o.ID != nil {
val := o.ID()
m.ID = omit.From(val)
}
if o.AdditionalInfo != nil {
val := o.AdditionalInfo()
m.AdditionalInfo = omit.From(val)
}
if o.Created != nil {
val := o.Created()
m.Created = omit.From(val)
}
if o.Duration != nil {
val := o.Duration()
m.Duration = omit.From(val)
}
if o.Email != nil {
val := o.Email()
m.Email = omit.From(val)
}
if o.InspectionType != nil {
val := o.InspectionType()
m.InspectionType = omit.From(val)
}
if o.SourceLocation != nil {
val := o.SourceLocation()
m.SourceLocation = omit.From(val)
}
if o.PreferredDateRange != nil {
val := o.PreferredDateRange()
m.PreferredDateRange = omit.From(val)
}
if o.PreferredTime != nil {
val := o.PreferredTime()
m.PreferredTime = omit.From(val)
}
if o.RequestCall != nil {
val := o.RequestCall()
m.RequestCall = omit.From(val)
}
if o.Severity != nil {
val := o.Severity()
m.Severity = omit.From(val)
}
if o.SourceContainer != nil {
val := o.SourceContainer()
m.SourceContainer = omit.From(val)
}
if o.SourceDescription != nil {
val := o.SourceDescription()
m.SourceDescription = omit.From(val)
}
if o.SourceRoof != nil {
val := o.SourceRoof()
m.SourceRoof = omit.From(val)
}
if o.SourceStagnant != nil {
val := o.SourceStagnant()
m.SourceStagnant = omit.From(val)
}
if o.TimeOfDayDay != nil {
val := o.TimeOfDayDay()
m.TimeOfDayDay = omit.From(val)
}
if o.TimeOfDayEarly != nil {
val := o.TimeOfDayEarly()
m.TimeOfDayEarly = omit.From(val)
}
if o.TimeOfDayEvening != nil {
val := o.TimeOfDayEvening()
m.TimeOfDayEvening = omit.From(val)
}
if o.TimeOfDayNight != nil {
val := o.TimeOfDayNight()
m.TimeOfDayNight = omit.From(val)
}
if o.PublicID != nil {
val := o.PublicID()
m.PublicID = omit.From(val)
}
if o.ReporterAddress != nil {
val := o.ReporterAddress()
m.ReporterAddress = omit.From(val)
}
if o.ReporterEmail != nil {
val := o.ReporterEmail()
m.ReporterEmail = omit.From(val)
}
if o.ReporterName != nil {
val := o.ReporterName()
m.ReporterName = omit.From(val)
}
if o.ReporterPhone != nil {
val := o.ReporterPhone()
m.ReporterPhone = omit.From(val)
}
if o.Address != nil {
val := o.Address()
m.Address = omit.From(val)
}
if o.Location != nil {
val := o.Location()
m.Location = omitnull.FromNull(val)
}
if o.Status != nil {
val := o.Status()
m.Status = omit.From(val)
}
if o.OrganizationID != nil {
val := o.OrganizationID()
m.OrganizationID = omitnull.FromNull(val)
}
return m
}
// BuildManySetter returns an []*models.PublicreportNuisanceSetter
// this does nothing with the relationship templates
func (o PublicreportNuisanceTemplate) BuildManySetter(number int) []*models.PublicreportNuisanceSetter {
m := make([]*models.PublicreportNuisanceSetter, number)
for i := range m {
m[i] = o.BuildSetter()
}
return m
}
// Build returns an *models.PublicreportNuisance
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use PublicreportNuisanceTemplate.Create
func (o PublicreportNuisanceTemplate) Build() *models.PublicreportNuisance {
m := &models.PublicreportNuisance{}
if o.ID != nil {
m.ID = o.ID()
}
if o.AdditionalInfo != nil {
m.AdditionalInfo = o.AdditionalInfo()
}
if o.Created != nil {
m.Created = o.Created()
}
if o.Duration != nil {
m.Duration = o.Duration()
}
if o.Email != nil {
m.Email = o.Email()
}
if o.InspectionType != nil {
m.InspectionType = o.InspectionType()
}
if o.SourceLocation != nil {
m.SourceLocation = o.SourceLocation()
}
if o.PreferredDateRange != nil {
m.PreferredDateRange = o.PreferredDateRange()
}
if o.PreferredTime != nil {
m.PreferredTime = o.PreferredTime()
}
if o.RequestCall != nil {
m.RequestCall = o.RequestCall()
}
if o.Severity != nil {
m.Severity = o.Severity()
}
if o.SourceContainer != nil {
m.SourceContainer = o.SourceContainer()
}
if o.SourceDescription != nil {
m.SourceDescription = o.SourceDescription()
}
if o.SourceRoof != nil {
m.SourceRoof = o.SourceRoof()
}
if o.SourceStagnant != nil {
m.SourceStagnant = o.SourceStagnant()
}
if o.TimeOfDayDay != nil {
m.TimeOfDayDay = o.TimeOfDayDay()
}
if o.TimeOfDayEarly != nil {
m.TimeOfDayEarly = o.TimeOfDayEarly()
}
if o.TimeOfDayEvening != nil {
m.TimeOfDayEvening = o.TimeOfDayEvening()
}
if o.TimeOfDayNight != nil {
m.TimeOfDayNight = o.TimeOfDayNight()
}
if o.PublicID != nil {
m.PublicID = o.PublicID()
}
if o.ReporterAddress != nil {
m.ReporterAddress = o.ReporterAddress()
}
if o.ReporterEmail != nil {
m.ReporterEmail = o.ReporterEmail()
}
if o.ReporterName != nil {
m.ReporterName = o.ReporterName()
}
if o.ReporterPhone != nil {
m.ReporterPhone = o.ReporterPhone()
}
if o.Address != nil {
m.Address = o.Address()
}
if o.Location != nil {
m.Location = o.Location()
}
if o.Status != nil {
m.Status = o.Status()
}
if o.OrganizationID != nil {
m.OrganizationID = o.OrganizationID()
}
o.setModelRels(m)
return m
}
// BuildMany returns an models.PublicreportNuisanceSlice
// Related objects are also created and placed in the .R field
// NOTE: Objects are not inserted into the database. Use PublicreportNuisanceTemplate.CreateMany
func (o PublicreportNuisanceTemplate) BuildMany(number int) models.PublicreportNuisanceSlice {
m := make(models.PublicreportNuisanceSlice, number)
for i := range m {
m[i] = o.Build()
}
return m
}
func ensureCreatablePublicreportNuisance(m *models.PublicreportNuisanceSetter) {
if !(m.AdditionalInfo.IsValue()) {
val := random_string(nil)
m.AdditionalInfo = omit.From(val)
}
if !(m.Created.IsValue()) {
val := random_time_Time(nil)
m.Created = omit.From(val)
}
if !(m.Duration.IsValue()) {
val := random_enums_PublicreportNuisancedurationtype(nil)
m.Duration = omit.From(val)
}
if !(m.Email.IsValue()) {
val := random_string(nil)
m.Email = omit.From(val)
}
if !(m.InspectionType.IsValue()) {
val := random_enums_PublicreportNuisanceinspectiontype(nil)
m.InspectionType = omit.From(val)
}
if !(m.SourceLocation.IsValue()) {
val := random_enums_PublicreportNuisancelocationtype(nil)
m.SourceLocation = omit.From(val)
}
if !(m.PreferredDateRange.IsValue()) {
val := random_enums_PublicreportNuisancepreferreddaterangetype(nil)
m.PreferredDateRange = omit.From(val)
}
if !(m.PreferredTime.IsValue()) {
val := random_enums_PublicreportNuisancepreferredtimetype(nil)
m.PreferredTime = omit.From(val)
}
if !(m.RequestCall.IsValue()) {
val := random_bool(nil)
m.RequestCall = omit.From(val)
}
if !(m.Severity.IsValue()) {
val := random_int16(nil)
m.Severity = omit.From(val)
}
if !(m.SourceContainer.IsValue()) {
val := random_bool(nil)
m.SourceContainer = omit.From(val)
}
if !(m.SourceDescription.IsValue()) {
val := random_string(nil)
m.SourceDescription = omit.From(val)
}
if !(m.SourceRoof.IsValue()) {
val := random_bool(nil)
m.SourceRoof = omit.From(val)
}
if !(m.SourceStagnant.IsValue()) {
val := random_bool(nil)
m.SourceStagnant = omit.From(val)
}
if !(m.TimeOfDayDay.IsValue()) {
val := random_bool(nil)
m.TimeOfDayDay = omit.From(val)
}
if !(m.TimeOfDayEarly.IsValue()) {
val := random_bool(nil)
m.TimeOfDayEarly = omit.From(val)
}
if !(m.TimeOfDayEvening.IsValue()) {
val := random_bool(nil)
m.TimeOfDayEvening = omit.From(val)
}
if !(m.TimeOfDayNight.IsValue()) {
val := random_bool(nil)
m.TimeOfDayNight = omit.From(val)
}
if !(m.PublicID.IsValue()) {
val := random_string(nil)
m.PublicID = omit.From(val)
}
if !(m.ReporterAddress.IsValue()) {
val := random_string(nil)
m.ReporterAddress = omit.From(val)
}
if !(m.ReporterEmail.IsValue()) {
val := random_string(nil)
m.ReporterEmail = omit.From(val)
}
if !(m.ReporterName.IsValue()) {
val := random_string(nil)
m.ReporterName = omit.From(val)
}
if !(m.ReporterPhone.IsValue()) {
val := random_string(nil)
m.ReporterPhone = omit.From(val)
}
if !(m.Address.IsValue()) {
val := random_string(nil)
m.Address = omit.From(val)
}
if !(m.Status.IsValue()) {
val := random_enums_PublicreportReportstatustype(nil)
m.Status = omit.From(val)
}
}
// insertOptRels creates and inserts any optional the relationships on *models.PublicreportNuisance
// according to the relationships in the template.
// any required relationship should have already exist on the model
func (o *PublicreportNuisanceTemplate) insertOptRels(ctx context.Context, exec bob.Executor, m *models.PublicreportNuisance) error {
var err error
isOrganizationDone, _ := publicreportNuisanceRelOrganizationCtx.Value(ctx)
if !isOrganizationDone && o.r.Organization != nil {
ctx = publicreportNuisanceRelOrganizationCtx.WithValue(ctx, true)
if o.r.Organization.o.alreadyPersisted {
m.R.Organization = o.r.Organization.o.Build()
} else {
var rel0 *models.Organization
rel0, err = o.r.Organization.o.Create(ctx, exec)
if err != nil {
return err
}
err = m.AttachOrganization(ctx, exec, rel0)
if err != nil {
return err
}
}
}
return err
}
// Create builds a publicreportNuisance and inserts it into the database
// Relations objects are also inserted and placed in the .R field
func (o *PublicreportNuisanceTemplate) Create(ctx context.Context, exec bob.Executor) (*models.PublicreportNuisance, error) {
var err error
opt := o.BuildSetter()
ensureCreatablePublicreportNuisance(opt)
m, err := models.PublicreportNuisances.Insert(opt).One(ctx, exec)
if err != nil {
return nil, err
}
if err := o.insertOptRels(ctx, exec, m); err != nil {
return nil, err
}
return m, err
}
// MustCreate builds a publicreportNuisance and inserts it into the database
// Relations objects are also inserted and placed in the .R field
// panics if an error occurs
func (o *PublicreportNuisanceTemplate) MustCreate(ctx context.Context, exec bob.Executor) *models.PublicreportNuisance {
m, err := o.Create(ctx, exec)
if err != nil {
panic(err)
}
return m
}
// CreateOrFail builds a publicreportNuisance 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 *PublicreportNuisanceTemplate) CreateOrFail(ctx context.Context, tb testing.TB, exec bob.Executor) *models.PublicreportNuisance {
tb.Helper()
m, err := o.Create(ctx, exec)
if err != nil {
tb.Fatal(err)
return nil
}
return m
}
// CreateMany builds multiple publicreportNuisances and inserts them into the database
// Relations objects are also inserted and placed in the .R field
func (o PublicreportNuisanceTemplate) CreateMany(ctx context.Context, exec bob.Executor, number int) (models.PublicreportNuisanceSlice, error) {
var err error
m := make(models.PublicreportNuisanceSlice, number)
for i := range m {
m[i], err = o.Create(ctx, exec)
if err != nil {
return nil, err
}
}
return m, nil
}
// MustCreateMany builds multiple publicreportNuisances and inserts them into the database
// Relations objects are also inserted and placed in the .R field
// panics if an error occurs
func (o PublicreportNuisanceTemplate) MustCreateMany(ctx context.Context, exec bob.Executor, number int) models.PublicreportNuisanceSlice {
m, err := o.CreateMany(ctx, exec, number)
if err != nil {
panic(err)
}
return m
}
// CreateManyOrFail builds multiple publicreportNuisances 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 PublicreportNuisanceTemplate) CreateManyOrFail(ctx context.Context, tb testing.TB, exec bob.Executor, number int) models.PublicreportNuisanceSlice {
tb.Helper()
m, err := o.CreateMany(ctx, exec, number)
if err != nil {
tb.Fatal(err)
return nil
}
return m
}
// PublicreportNuisance has methods that act as mods for the PublicreportNuisanceTemplate
var PublicreportNuisanceMods publicreportNuisanceMods
type publicreportNuisanceMods struct{}
func (m publicreportNuisanceMods) RandomizeAllColumns(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModSlice{
PublicreportNuisanceMods.RandomID(f),
PublicreportNuisanceMods.RandomAdditionalInfo(f),
PublicreportNuisanceMods.RandomCreated(f),
PublicreportNuisanceMods.RandomDuration(f),
PublicreportNuisanceMods.RandomEmail(f),
PublicreportNuisanceMods.RandomInspectionType(f),
PublicreportNuisanceMods.RandomSourceLocation(f),
PublicreportNuisanceMods.RandomPreferredDateRange(f),
PublicreportNuisanceMods.RandomPreferredTime(f),
PublicreportNuisanceMods.RandomRequestCall(f),
PublicreportNuisanceMods.RandomSeverity(f),
PublicreportNuisanceMods.RandomSourceContainer(f),
PublicreportNuisanceMods.RandomSourceDescription(f),
PublicreportNuisanceMods.RandomSourceRoof(f),
PublicreportNuisanceMods.RandomSourceStagnant(f),
PublicreportNuisanceMods.RandomTimeOfDayDay(f),
PublicreportNuisanceMods.RandomTimeOfDayEarly(f),
PublicreportNuisanceMods.RandomTimeOfDayEvening(f),
PublicreportNuisanceMods.RandomTimeOfDayNight(f),
PublicreportNuisanceMods.RandomPublicID(f),
PublicreportNuisanceMods.RandomReporterAddress(f),
PublicreportNuisanceMods.RandomReporterEmail(f),
PublicreportNuisanceMods.RandomReporterName(f),
PublicreportNuisanceMods.RandomReporterPhone(f),
PublicreportNuisanceMods.RandomAddress(f),
PublicreportNuisanceMods.RandomLocation(f),
PublicreportNuisanceMods.RandomStatus(f),
PublicreportNuisanceMods.RandomOrganizationID(f),
}
}
// Set the model columns to this value
func (m publicreportNuisanceMods) ID(val int32) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.ID = func() int32 { return val }
})
}
// Set the Column from the function
func (m publicreportNuisanceMods) IDFunc(f func() int32) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.ID = f
})
}
// Clear any values for the column
func (m publicreportNuisanceMods) UnsetID() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
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 publicreportNuisanceMods) RandomID(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.ID = func() int32 {
return random_int32(f)
}
})
}
// Set the model columns to this value
func (m publicreportNuisanceMods) AdditionalInfo(val string) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.AdditionalInfo = func() string { return val }
})
}
// Set the Column from the function
func (m publicreportNuisanceMods) AdditionalInfoFunc(f func() string) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.AdditionalInfo = f
})
}
// Clear any values for the column
func (m publicreportNuisanceMods) UnsetAdditionalInfo() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.AdditionalInfo = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m publicreportNuisanceMods) RandomAdditionalInfo(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.AdditionalInfo = func() string {
return random_string(f)
}
})
}
// Set the model columns to this value
func (m publicreportNuisanceMods) Created(val time.Time) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.Created = func() time.Time { return val }
})
}
// Set the Column from the function
func (m publicreportNuisanceMods) CreatedFunc(f func() time.Time) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.Created = f
})
}
// Clear any values for the column
func (m publicreportNuisanceMods) UnsetCreated() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
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 publicreportNuisanceMods) RandomCreated(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.Created = func() time.Time {
return random_time_Time(f)
}
})
}
// Set the model columns to this value
func (m publicreportNuisanceMods) Duration(val enums.PublicreportNuisancedurationtype) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.Duration = func() enums.PublicreportNuisancedurationtype { return val }
})
}
// Set the Column from the function
func (m publicreportNuisanceMods) DurationFunc(f func() enums.PublicreportNuisancedurationtype) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.Duration = f
})
}
// Clear any values for the column
func (m publicreportNuisanceMods) UnsetDuration() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.Duration = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m publicreportNuisanceMods) RandomDuration(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.Duration = func() enums.PublicreportNuisancedurationtype {
return random_enums_PublicreportNuisancedurationtype(f)
}
})
}
// Set the model columns to this value
func (m publicreportNuisanceMods) Email(val string) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.Email = func() string { return val }
})
}
// Set the Column from the function
func (m publicreportNuisanceMods) EmailFunc(f func() string) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.Email = f
})
}
// Clear any values for the column
func (m publicreportNuisanceMods) UnsetEmail() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.Email = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m publicreportNuisanceMods) RandomEmail(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.Email = func() string {
return random_string(f)
}
})
}
// Set the model columns to this value
func (m publicreportNuisanceMods) InspectionType(val enums.PublicreportNuisanceinspectiontype) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.InspectionType = func() enums.PublicreportNuisanceinspectiontype { return val }
})
}
// Set the Column from the function
func (m publicreportNuisanceMods) InspectionTypeFunc(f func() enums.PublicreportNuisanceinspectiontype) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.InspectionType = f
})
}
// Clear any values for the column
func (m publicreportNuisanceMods) UnsetInspectionType() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.InspectionType = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m publicreportNuisanceMods) RandomInspectionType(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.InspectionType = func() enums.PublicreportNuisanceinspectiontype {
return random_enums_PublicreportNuisanceinspectiontype(f)
}
})
}
// Set the model columns to this value
func (m publicreportNuisanceMods) SourceLocation(val enums.PublicreportNuisancelocationtype) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.SourceLocation = func() enums.PublicreportNuisancelocationtype { return val }
})
}
// Set the Column from the function
func (m publicreportNuisanceMods) SourceLocationFunc(f func() enums.PublicreportNuisancelocationtype) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.SourceLocation = f
})
}
// Clear any values for the column
func (m publicreportNuisanceMods) UnsetSourceLocation() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.SourceLocation = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m publicreportNuisanceMods) RandomSourceLocation(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.SourceLocation = func() enums.PublicreportNuisancelocationtype {
return random_enums_PublicreportNuisancelocationtype(f)
}
})
}
// Set the model columns to this value
func (m publicreportNuisanceMods) PreferredDateRange(val enums.PublicreportNuisancepreferreddaterangetype) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.PreferredDateRange = func() enums.PublicreportNuisancepreferreddaterangetype { return val }
})
}
// Set the Column from the function
func (m publicreportNuisanceMods) PreferredDateRangeFunc(f func() enums.PublicreportNuisancepreferreddaterangetype) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.PreferredDateRange = f
})
}
// Clear any values for the column
func (m publicreportNuisanceMods) UnsetPreferredDateRange() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.PreferredDateRange = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m publicreportNuisanceMods) RandomPreferredDateRange(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.PreferredDateRange = func() enums.PublicreportNuisancepreferreddaterangetype {
return random_enums_PublicreportNuisancepreferreddaterangetype(f)
}
})
}
// Set the model columns to this value
func (m publicreportNuisanceMods) PreferredTime(val enums.PublicreportNuisancepreferredtimetype) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.PreferredTime = func() enums.PublicreportNuisancepreferredtimetype { return val }
})
}
// Set the Column from the function
func (m publicreportNuisanceMods) PreferredTimeFunc(f func() enums.PublicreportNuisancepreferredtimetype) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.PreferredTime = f
})
}
// Clear any values for the column
func (m publicreportNuisanceMods) UnsetPreferredTime() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.PreferredTime = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m publicreportNuisanceMods) RandomPreferredTime(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.PreferredTime = func() enums.PublicreportNuisancepreferredtimetype {
return random_enums_PublicreportNuisancepreferredtimetype(f)
}
})
}
// Set the model columns to this value
func (m publicreportNuisanceMods) RequestCall(val bool) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.RequestCall = func() bool { return val }
})
}
// Set the Column from the function
func (m publicreportNuisanceMods) RequestCallFunc(f func() bool) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.RequestCall = f
})
}
// Clear any values for the column
func (m publicreportNuisanceMods) UnsetRequestCall() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.RequestCall = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m publicreportNuisanceMods) RandomRequestCall(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.RequestCall = func() bool {
return random_bool(f)
}
})
}
// Set the model columns to this value
func (m publicreportNuisanceMods) Severity(val int16) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.Severity = func() int16 { return val }
})
}
// Set the Column from the function
func (m publicreportNuisanceMods) SeverityFunc(f func() int16) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.Severity = f
})
}
// Clear any values for the column
func (m publicreportNuisanceMods) UnsetSeverity() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.Severity = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m publicreportNuisanceMods) RandomSeverity(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.Severity = func() int16 {
return random_int16(f)
}
})
}
// Set the model columns to this value
func (m publicreportNuisanceMods) SourceContainer(val bool) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.SourceContainer = func() bool { return val }
})
}
// Set the Column from the function
func (m publicreportNuisanceMods) SourceContainerFunc(f func() bool) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.SourceContainer = f
})
}
// Clear any values for the column
func (m publicreportNuisanceMods) UnsetSourceContainer() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.SourceContainer = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m publicreportNuisanceMods) RandomSourceContainer(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.SourceContainer = func() bool {
return random_bool(f)
}
})
}
// Set the model columns to this value
func (m publicreportNuisanceMods) SourceDescription(val string) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.SourceDescription = func() string { return val }
})
}
// Set the Column from the function
func (m publicreportNuisanceMods) SourceDescriptionFunc(f func() string) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.SourceDescription = f
})
}
// Clear any values for the column
func (m publicreportNuisanceMods) UnsetSourceDescription() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.SourceDescription = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m publicreportNuisanceMods) RandomSourceDescription(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.SourceDescription = func() string {
return random_string(f)
}
})
}
// Set the model columns to this value
func (m publicreportNuisanceMods) SourceRoof(val bool) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.SourceRoof = func() bool { return val }
})
}
// Set the Column from the function
func (m publicreportNuisanceMods) SourceRoofFunc(f func() bool) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.SourceRoof = f
})
}
// Clear any values for the column
func (m publicreportNuisanceMods) UnsetSourceRoof() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.SourceRoof = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m publicreportNuisanceMods) RandomSourceRoof(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.SourceRoof = func() bool {
return random_bool(f)
}
})
}
// Set the model columns to this value
func (m publicreportNuisanceMods) SourceStagnant(val bool) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.SourceStagnant = func() bool { return val }
})
}
// Set the Column from the function
func (m publicreportNuisanceMods) SourceStagnantFunc(f func() bool) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.SourceStagnant = f
})
}
// Clear any values for the column
func (m publicreportNuisanceMods) UnsetSourceStagnant() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.SourceStagnant = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m publicreportNuisanceMods) RandomSourceStagnant(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.SourceStagnant = func() bool {
return random_bool(f)
}
})
}
// Set the model columns to this value
func (m publicreportNuisanceMods) TimeOfDayDay(val bool) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.TimeOfDayDay = func() bool { return val }
})
}
// Set the Column from the function
func (m publicreportNuisanceMods) TimeOfDayDayFunc(f func() bool) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.TimeOfDayDay = f
})
}
// Clear any values for the column
func (m publicreportNuisanceMods) UnsetTimeOfDayDay() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.TimeOfDayDay = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m publicreportNuisanceMods) RandomTimeOfDayDay(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.TimeOfDayDay = func() bool {
return random_bool(f)
}
})
}
// Set the model columns to this value
func (m publicreportNuisanceMods) TimeOfDayEarly(val bool) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.TimeOfDayEarly = func() bool { return val }
})
}
// Set the Column from the function
func (m publicreportNuisanceMods) TimeOfDayEarlyFunc(f func() bool) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.TimeOfDayEarly = f
})
}
// Clear any values for the column
func (m publicreportNuisanceMods) UnsetTimeOfDayEarly() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.TimeOfDayEarly = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m publicreportNuisanceMods) RandomTimeOfDayEarly(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.TimeOfDayEarly = func() bool {
return random_bool(f)
}
})
}
// Set the model columns to this value
func (m publicreportNuisanceMods) TimeOfDayEvening(val bool) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.TimeOfDayEvening = func() bool { return val }
})
}
// Set the Column from the function
func (m publicreportNuisanceMods) TimeOfDayEveningFunc(f func() bool) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.TimeOfDayEvening = f
})
}
// Clear any values for the column
func (m publicreportNuisanceMods) UnsetTimeOfDayEvening() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.TimeOfDayEvening = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m publicreportNuisanceMods) RandomTimeOfDayEvening(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.TimeOfDayEvening = func() bool {
return random_bool(f)
}
})
}
// Set the model columns to this value
func (m publicreportNuisanceMods) TimeOfDayNight(val bool) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.TimeOfDayNight = func() bool { return val }
})
}
// Set the Column from the function
func (m publicreportNuisanceMods) TimeOfDayNightFunc(f func() bool) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.TimeOfDayNight = f
})
}
// Clear any values for the column
func (m publicreportNuisanceMods) UnsetTimeOfDayNight() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.TimeOfDayNight = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m publicreportNuisanceMods) RandomTimeOfDayNight(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.TimeOfDayNight = func() bool {
return random_bool(f)
}
})
}
// Set the model columns to this value
func (m publicreportNuisanceMods) PublicID(val string) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.PublicID = func() string { return val }
})
}
// Set the Column from the function
func (m publicreportNuisanceMods) PublicIDFunc(f func() string) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.PublicID = f
})
}
// Clear any values for the column
func (m publicreportNuisanceMods) UnsetPublicID() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.PublicID = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m publicreportNuisanceMods) RandomPublicID(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.PublicID = func() string {
return random_string(f)
}
})
}
// Set the model columns to this value
func (m publicreportNuisanceMods) ReporterAddress(val string) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.ReporterAddress = func() string { return val }
})
}
// Set the Column from the function
func (m publicreportNuisanceMods) ReporterAddressFunc(f func() string) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.ReporterAddress = f
})
}
// Clear any values for the column
func (m publicreportNuisanceMods) UnsetReporterAddress() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.ReporterAddress = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m publicreportNuisanceMods) RandomReporterAddress(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.ReporterAddress = func() string {
return random_string(f)
}
})
}
// Set the model columns to this value
func (m publicreportNuisanceMods) ReporterEmail(val string) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.ReporterEmail = func() string { return val }
})
}
// Set the Column from the function
func (m publicreportNuisanceMods) ReporterEmailFunc(f func() string) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.ReporterEmail = f
})
}
// Clear any values for the column
func (m publicreportNuisanceMods) UnsetReporterEmail() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.ReporterEmail = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m publicreportNuisanceMods) RandomReporterEmail(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.ReporterEmail = func() string {
return random_string(f)
}
})
}
// Set the model columns to this value
func (m publicreportNuisanceMods) ReporterName(val string) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.ReporterName = func() string { return val }
})
}
// Set the Column from the function
func (m publicreportNuisanceMods) ReporterNameFunc(f func() string) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.ReporterName = f
})
}
// Clear any values for the column
func (m publicreportNuisanceMods) UnsetReporterName() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.ReporterName = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m publicreportNuisanceMods) RandomReporterName(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.ReporterName = func() string {
return random_string(f)
}
})
}
// Set the model columns to this value
func (m publicreportNuisanceMods) ReporterPhone(val string) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.ReporterPhone = func() string { return val }
})
}
// Set the Column from the function
func (m publicreportNuisanceMods) ReporterPhoneFunc(f func() string) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.ReporterPhone = f
})
}
// Clear any values for the column
func (m publicreportNuisanceMods) UnsetReporterPhone() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.ReporterPhone = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m publicreportNuisanceMods) RandomReporterPhone(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.ReporterPhone = func() string {
return random_string(f)
}
})
}
// Set the model columns to this value
func (m publicreportNuisanceMods) Address(val string) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.Address = func() string { return val }
})
}
// Set the Column from the function
func (m publicreportNuisanceMods) AddressFunc(f func() string) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.Address = f
})
}
// Clear any values for the column
func (m publicreportNuisanceMods) UnsetAddress() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.Address = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m publicreportNuisanceMods) RandomAddress(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.Address = func() string {
return random_string(f)
}
})
}
// Set the model columns to this value
func (m publicreportNuisanceMods) Location(val null.Val[string]) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.Location = func() null.Val[string] { return val }
})
}
// Set the Column from the function
func (m publicreportNuisanceMods) LocationFunc(f func() null.Val[string]) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.Location = f
})
}
// Clear any values for the column
func (m publicreportNuisanceMods) UnsetLocation() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.Location = 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 publicreportNuisanceMods) RandomLocation(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.Location = 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 publicreportNuisanceMods) RandomLocationNotNull(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.Location = 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 publicreportNuisanceMods) Status(val enums.PublicreportReportstatustype) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.Status = func() enums.PublicreportReportstatustype { return val }
})
}
// Set the Column from the function
func (m publicreportNuisanceMods) StatusFunc(f func() enums.PublicreportReportstatustype) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.Status = f
})
}
// Clear any values for the column
func (m publicreportNuisanceMods) UnsetStatus() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.Status = nil
})
}
// Generates a random value for the column using the given faker
// if faker is nil, a default faker is used
func (m publicreportNuisanceMods) RandomStatus(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.Status = func() enums.PublicreportReportstatustype {
return random_enums_PublicreportReportstatustype(f)
}
})
}
// Set the model columns to this value
func (m publicreportNuisanceMods) OrganizationID(val null.Val[int32]) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.OrganizationID = func() null.Val[int32] { return val }
})
}
// Set the Column from the function
func (m publicreportNuisanceMods) OrganizationIDFunc(f func() null.Val[int32]) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.OrganizationID = f
})
}
// Clear any values for the column
func (m publicreportNuisanceMods) UnsetOrganizationID() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.OrganizationID = 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 publicreportNuisanceMods) RandomOrganizationID(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.OrganizationID = func() null.Val[int32] {
if f == nil {
f = &defaultFaker
}
val := random_int32(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 publicreportNuisanceMods) RandomOrganizationIDNotNull(f *faker.Faker) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(_ context.Context, o *PublicreportNuisanceTemplate) {
o.OrganizationID = func() null.Val[int32] {
if f == nil {
f = &defaultFaker
}
val := random_int32(f)
return null.From(val)
}
})
}
func (m publicreportNuisanceMods) WithParentsCascading() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(ctx context.Context, o *PublicreportNuisanceTemplate) {
if isDone, _ := publicreportNuisanceWithParentsCascadingCtx.Value(ctx); isDone {
return
}
ctx = publicreportNuisanceWithParentsCascadingCtx.WithValue(ctx, true)
{
related := o.f.NewOrganizationWithContext(ctx, OrganizationMods.WithParentsCascading())
m.WithOrganization(related).Apply(ctx, o)
}
})
}
func (m publicreportNuisanceMods) WithOrganization(rel *OrganizationTemplate) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(ctx context.Context, o *PublicreportNuisanceTemplate) {
o.r.Organization = &publicreportNuisanceROrganizationR{
o: rel,
}
})
}
func (m publicreportNuisanceMods) WithNewOrganization(mods ...OrganizationMod) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(ctx context.Context, o *PublicreportNuisanceTemplate) {
related := o.f.NewOrganizationWithContext(ctx, mods...)
m.WithOrganization(related).Apply(ctx, o)
})
}
func (m publicreportNuisanceMods) WithExistingOrganization(em *models.Organization) PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(ctx context.Context, o *PublicreportNuisanceTemplate) {
o.r.Organization = &publicreportNuisanceROrganizationR{
o: o.f.FromExistingOrganization(em),
}
})
}
func (m publicreportNuisanceMods) WithoutOrganization() PublicreportNuisanceMod {
return PublicreportNuisanceModFunc(func(ctx context.Context, o *PublicreportNuisanceTemplate) {
o.r.Organization = nil
})
}