Schema.Union(
Schema.declare((input: unknown): input is Location => input instanceof Location && input.$isPersisted, {
identifier: 'Location',
description: 'Location model instance',
}),
Schema.Struct({
city: Schema.optionalWith(Schema.NullOr(Schema.String), { default: () => null }),
region: Schema.optionalWith(Schema.NullOr(Schema.String), { default: () => null }),
country: Schema.optionalWith(Schema.NullOr(Schema.String), { default: () => null }),
})
)
Schema.Union(
Schema.declare((input: unknown): input is Location => input instanceof Location && input.$isPersisted, {
identifier: 'Location',
description: 'Location model instance',
}),
Schema.Struct({
city: Schema.optionalWith(Schema.NullOr(Schema.String), { default: () => null }),
region: Schema.optionalWith(Schema.NullOr(Schema.String), { default: () => null }),
country: Schema.optionalWith(Schema.NullOr(Schema.String), { default: () => null }),
})
)