2025-11-07 16:15:16 +01:00
|
|
|
package lens
|
|
|
|
|
|
|
|
|
|
// Code generated by go generate; DO NOT EDIT.
|
|
|
|
|
// This file was generated by robots at
|
2025-11-13 09:05:57 +01:00
|
|
|
// 2025-11-13 09:05:02.7405925 +0100 CET m=+0.003158301
|
2025-11-07 16:15:16 +01:00
|
|
|
|
|
|
|
|
import (
|
2025-11-13 09:05:57 +01:00
|
|
|
IO "github.com/IBM/fp-go/v2/optics/iso/option"
|
2025-11-07 16:15:16 +01:00
|
|
|
L "github.com/IBM/fp-go/v2/optics/lens"
|
|
|
|
|
LO "github.com/IBM/fp-go/v2/optics/lens/option"
|
|
|
|
|
option "github.com/IBM/fp-go/v2/optics/lens/option"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// PersonLenses provides lenses for accessing fields of Person
|
|
|
|
|
type PersonLenses struct {
|
2025-11-13 09:05:57 +01:00
|
|
|
// mandatory fields
|
|
|
|
|
Name L.Lens[Person, string]
|
|
|
|
|
Age L.Lens[Person, int]
|
2025-11-07 16:15:16 +01:00
|
|
|
Email L.Lens[Person, string]
|
2025-11-13 09:05:57 +01:00
|
|
|
Phone L.Lens[Person, *string]
|
|
|
|
|
// optional fields
|
|
|
|
|
NameO LO.LensO[Person, string]
|
|
|
|
|
AgeO LO.LensO[Person, int]
|
|
|
|
|
EmailO LO.LensO[Person, string]
|
|
|
|
|
PhoneO LO.LensO[Person, *string]
|
2025-11-07 16:15:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PersonRefLenses provides lenses for accessing fields of Person via a reference to Person
|
|
|
|
|
type PersonRefLenses struct {
|
2025-11-13 09:05:57 +01:00
|
|
|
// mandatory fields
|
|
|
|
|
Name L.Lens[*Person, string]
|
|
|
|
|
Age L.Lens[*Person, int]
|
2025-11-07 16:15:16 +01:00
|
|
|
Email L.Lens[*Person, string]
|
2025-11-13 09:05:57 +01:00
|
|
|
Phone L.Lens[*Person, *string]
|
|
|
|
|
// optional fields
|
|
|
|
|
NameO LO.LensO[*Person, string]
|
|
|
|
|
AgeO LO.LensO[*Person, int]
|
|
|
|
|
EmailO LO.LensO[*Person, string]
|
|
|
|
|
PhoneO LO.LensO[*Person, *string]
|
2025-11-07 16:15:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// MakePersonLenses creates a new PersonLenses with lenses for all fields
|
|
|
|
|
func MakePersonLenses() PersonLenses {
|
2025-11-13 09:05:57 +01:00
|
|
|
// mandatory lenses
|
|
|
|
|
lensName := L.MakeLens(
|
|
|
|
|
func(s Person) string { return s.Name },
|
|
|
|
|
func(s Person, v string) Person { s.Name = v; return s },
|
|
|
|
|
)
|
|
|
|
|
lensAge := L.MakeLens(
|
|
|
|
|
func(s Person) int { return s.Age },
|
|
|
|
|
func(s Person, v int) Person { s.Age = v; return s },
|
|
|
|
|
)
|
|
|
|
|
lensEmail := L.MakeLens(
|
|
|
|
|
func(s Person) string { return s.Email },
|
|
|
|
|
func(s Person, v string) Person { s.Email = v; return s },
|
|
|
|
|
)
|
|
|
|
|
lensPhone := L.MakeLens(
|
|
|
|
|
func(s Person) *string { return s.Phone },
|
|
|
|
|
func(s Person, v *string) Person { s.Phone = v; return s },
|
|
|
|
|
)
|
|
|
|
|
// optional lenses
|
|
|
|
|
lensNameO := LO.FromIso[Person](IO.FromZero[string]())(lensName)
|
|
|
|
|
lensAgeO := LO.FromIso[Person](IO.FromZero[int]())(lensAge)
|
|
|
|
|
lensEmailO := LO.FromIso[Person](IO.FromZero[string]())(lensEmail)
|
|
|
|
|
lensPhoneO := LO.FromIso[Person](IO.FromZero[*string]())(lensPhone)
|
2025-11-07 16:15:16 +01:00
|
|
|
return PersonLenses{
|
2025-11-13 09:05:57 +01:00
|
|
|
// mandatory lenses
|
|
|
|
|
Name: lensName,
|
|
|
|
|
Age: lensAge,
|
|
|
|
|
Email: lensEmail,
|
|
|
|
|
Phone: lensPhone,
|
|
|
|
|
// optional lenses
|
|
|
|
|
NameO: lensNameO,
|
|
|
|
|
AgeO: lensAgeO,
|
|
|
|
|
EmailO: lensEmailO,
|
|
|
|
|
PhoneO: lensPhoneO,
|
2025-11-07 16:15:16 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// MakePersonRefLenses creates a new PersonRefLenses with lenses for all fields
|
|
|
|
|
func MakePersonRefLenses() PersonRefLenses {
|
2025-11-13 09:05:57 +01:00
|
|
|
// mandatory lenses
|
|
|
|
|
lensName := L.MakeLensStrict(
|
|
|
|
|
func(s *Person) string { return s.Name },
|
|
|
|
|
func(s *Person, v string) *Person { s.Name = v; return s },
|
|
|
|
|
)
|
|
|
|
|
lensAge := L.MakeLensStrict(
|
|
|
|
|
func(s *Person) int { return s.Age },
|
|
|
|
|
func(s *Person, v int) *Person { s.Age = v; return s },
|
|
|
|
|
)
|
|
|
|
|
lensEmail := L.MakeLensStrict(
|
|
|
|
|
func(s *Person) string { return s.Email },
|
|
|
|
|
func(s *Person, v string) *Person { s.Email = v; return s },
|
|
|
|
|
)
|
|
|
|
|
lensPhone := L.MakeLensStrict(
|
|
|
|
|
func(s *Person) *string { return s.Phone },
|
|
|
|
|
func(s *Person, v *string) *Person { s.Phone = v; return s },
|
|
|
|
|
)
|
|
|
|
|
// optional lenses
|
|
|
|
|
lensNameO := LO.FromIso[*Person](IO.FromZero[string]())(lensName)
|
|
|
|
|
lensAgeO := LO.FromIso[*Person](IO.FromZero[int]())(lensAge)
|
|
|
|
|
lensEmailO := LO.FromIso[*Person](IO.FromZero[string]())(lensEmail)
|
|
|
|
|
lensPhoneO := LO.FromIso[*Person](IO.FromZero[*string]())(lensPhone)
|
2025-11-07 16:15:16 +01:00
|
|
|
return PersonRefLenses{
|
2025-11-13 09:05:57 +01:00
|
|
|
// mandatory lenses
|
|
|
|
|
Name: lensName,
|
|
|
|
|
Age: lensAge,
|
|
|
|
|
Email: lensEmail,
|
|
|
|
|
Phone: lensPhone,
|
|
|
|
|
// optional lenses
|
|
|
|
|
NameO: lensNameO,
|
|
|
|
|
AgeO: lensAgeO,
|
|
|
|
|
EmailO: lensEmailO,
|
|
|
|
|
PhoneO: lensPhoneO,
|
2025-11-07 16:15:16 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// AddressLenses provides lenses for accessing fields of Address
|
|
|
|
|
type AddressLenses struct {
|
2025-11-13 09:05:57 +01:00
|
|
|
// mandatory fields
|
|
|
|
|
Street L.Lens[Address, string]
|
|
|
|
|
City L.Lens[Address, string]
|
2025-11-07 16:15:16 +01:00
|
|
|
ZipCode L.Lens[Address, string]
|
|
|
|
|
Country L.Lens[Address, string]
|
2025-11-13 09:05:57 +01:00
|
|
|
State L.Lens[Address, *string]
|
|
|
|
|
// optional fields
|
|
|
|
|
StreetO LO.LensO[Address, string]
|
|
|
|
|
CityO LO.LensO[Address, string]
|
|
|
|
|
ZipCodeO LO.LensO[Address, string]
|
|
|
|
|
CountryO LO.LensO[Address, string]
|
|
|
|
|
StateO LO.LensO[Address, *string]
|
2025-11-07 16:15:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// AddressRefLenses provides lenses for accessing fields of Address via a reference to Address
|
|
|
|
|
type AddressRefLenses struct {
|
2025-11-13 09:05:57 +01:00
|
|
|
// mandatory fields
|
|
|
|
|
Street L.Lens[*Address, string]
|
|
|
|
|
City L.Lens[*Address, string]
|
2025-11-07 16:15:16 +01:00
|
|
|
ZipCode L.Lens[*Address, string]
|
|
|
|
|
Country L.Lens[*Address, string]
|
2025-11-13 09:05:57 +01:00
|
|
|
State L.Lens[*Address, *string]
|
|
|
|
|
// optional fields
|
|
|
|
|
StreetO LO.LensO[*Address, string]
|
|
|
|
|
CityO LO.LensO[*Address, string]
|
|
|
|
|
ZipCodeO LO.LensO[*Address, string]
|
|
|
|
|
CountryO LO.LensO[*Address, string]
|
|
|
|
|
StateO LO.LensO[*Address, *string]
|
2025-11-07 16:15:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// MakeAddressLenses creates a new AddressLenses with lenses for all fields
|
|
|
|
|
func MakeAddressLenses() AddressLenses {
|
2025-11-13 09:05:57 +01:00
|
|
|
// mandatory lenses
|
|
|
|
|
lensStreet := L.MakeLens(
|
|
|
|
|
func(s Address) string { return s.Street },
|
|
|
|
|
func(s Address, v string) Address { s.Street = v; return s },
|
|
|
|
|
)
|
|
|
|
|
lensCity := L.MakeLens(
|
|
|
|
|
func(s Address) string { return s.City },
|
|
|
|
|
func(s Address, v string) Address { s.City = v; return s },
|
|
|
|
|
)
|
|
|
|
|
lensZipCode := L.MakeLens(
|
|
|
|
|
func(s Address) string { return s.ZipCode },
|
|
|
|
|
func(s Address, v string) Address { s.ZipCode = v; return s },
|
|
|
|
|
)
|
|
|
|
|
lensCountry := L.MakeLens(
|
|
|
|
|
func(s Address) string { return s.Country },
|
|
|
|
|
func(s Address, v string) Address { s.Country = v; return s },
|
|
|
|
|
)
|
|
|
|
|
lensState := L.MakeLens(
|
|
|
|
|
func(s Address) *string { return s.State },
|
|
|
|
|
func(s Address, v *string) Address { s.State = v; return s },
|
|
|
|
|
)
|
|
|
|
|
// optional lenses
|
|
|
|
|
lensStreetO := LO.FromIso[Address](IO.FromZero[string]())(lensStreet)
|
|
|
|
|
lensCityO := LO.FromIso[Address](IO.FromZero[string]())(lensCity)
|
|
|
|
|
lensZipCodeO := LO.FromIso[Address](IO.FromZero[string]())(lensZipCode)
|
|
|
|
|
lensCountryO := LO.FromIso[Address](IO.FromZero[string]())(lensCountry)
|
|
|
|
|
lensStateO := LO.FromIso[Address](IO.FromZero[*string]())(lensState)
|
2025-11-07 16:15:16 +01:00
|
|
|
return AddressLenses{
|
2025-11-13 09:05:57 +01:00
|
|
|
// mandatory lenses
|
|
|
|
|
Street: lensStreet,
|
|
|
|
|
City: lensCity,
|
|
|
|
|
ZipCode: lensZipCode,
|
|
|
|
|
Country: lensCountry,
|
|
|
|
|
State: lensState,
|
|
|
|
|
// optional lenses
|
|
|
|
|
StreetO: lensStreetO,
|
|
|
|
|
CityO: lensCityO,
|
|
|
|
|
ZipCodeO: lensZipCodeO,
|
|
|
|
|
CountryO: lensCountryO,
|
|
|
|
|
StateO: lensStateO,
|
2025-11-07 16:15:16 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// MakeAddressRefLenses creates a new AddressRefLenses with lenses for all fields
|
|
|
|
|
func MakeAddressRefLenses() AddressRefLenses {
|
2025-11-13 09:05:57 +01:00
|
|
|
// mandatory lenses
|
|
|
|
|
lensStreet := L.MakeLensStrict(
|
|
|
|
|
func(s *Address) string { return s.Street },
|
|
|
|
|
func(s *Address, v string) *Address { s.Street = v; return s },
|
|
|
|
|
)
|
|
|
|
|
lensCity := L.MakeLensStrict(
|
|
|
|
|
func(s *Address) string { return s.City },
|
|
|
|
|
func(s *Address, v string) *Address { s.City = v; return s },
|
|
|
|
|
)
|
|
|
|
|
lensZipCode := L.MakeLensStrict(
|
|
|
|
|
func(s *Address) string { return s.ZipCode },
|
|
|
|
|
func(s *Address, v string) *Address { s.ZipCode = v; return s },
|
|
|
|
|
)
|
|
|
|
|
lensCountry := L.MakeLensStrict(
|
|
|
|
|
func(s *Address) string { return s.Country },
|
|
|
|
|
func(s *Address, v string) *Address { s.Country = v; return s },
|
|
|
|
|
)
|
|
|
|
|
lensState := L.MakeLensStrict(
|
|
|
|
|
func(s *Address) *string { return s.State },
|
|
|
|
|
func(s *Address, v *string) *Address { s.State = v; return s },
|
|
|
|
|
)
|
|
|
|
|
// optional lenses
|
|
|
|
|
lensStreetO := LO.FromIso[*Address](IO.FromZero[string]())(lensStreet)
|
|
|
|
|
lensCityO := LO.FromIso[*Address](IO.FromZero[string]())(lensCity)
|
|
|
|
|
lensZipCodeO := LO.FromIso[*Address](IO.FromZero[string]())(lensZipCode)
|
|
|
|
|
lensCountryO := LO.FromIso[*Address](IO.FromZero[string]())(lensCountry)
|
|
|
|
|
lensStateO := LO.FromIso[*Address](IO.FromZero[*string]())(lensState)
|
2025-11-07 16:15:16 +01:00
|
|
|
return AddressRefLenses{
|
2025-11-13 09:05:57 +01:00
|
|
|
// mandatory lenses
|
|
|
|
|
Street: lensStreet,
|
|
|
|
|
City: lensCity,
|
|
|
|
|
ZipCode: lensZipCode,
|
|
|
|
|
Country: lensCountry,
|
|
|
|
|
State: lensState,
|
|
|
|
|
// optional lenses
|
|
|
|
|
StreetO: lensStreetO,
|
|
|
|
|
CityO: lensCityO,
|
|
|
|
|
ZipCodeO: lensZipCodeO,
|
|
|
|
|
CountryO: lensCountryO,
|
|
|
|
|
StateO: lensStateO,
|
2025-11-07 16:15:16 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// CompanyLenses provides lenses for accessing fields of Company
|
|
|
|
|
type CompanyLenses struct {
|
2025-11-13 09:05:57 +01:00
|
|
|
// mandatory fields
|
|
|
|
|
Name L.Lens[Company, string]
|
2025-11-07 16:15:16 +01:00
|
|
|
Address L.Lens[Company, Address]
|
2025-11-13 09:05:57 +01:00
|
|
|
CEO L.Lens[Company, Person]
|
|
|
|
|
Website L.Lens[Company, *string]
|
|
|
|
|
// optional fields
|
|
|
|
|
NameO LO.LensO[Company, string]
|
|
|
|
|
AddressO LO.LensO[Company, Address]
|
|
|
|
|
CEOO LO.LensO[Company, Person]
|
|
|
|
|
WebsiteO LO.LensO[Company, *string]
|
2025-11-07 16:15:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// CompanyRefLenses provides lenses for accessing fields of Company via a reference to Company
|
|
|
|
|
type CompanyRefLenses struct {
|
2025-11-13 09:05:57 +01:00
|
|
|
// mandatory fields
|
|
|
|
|
Name L.Lens[*Company, string]
|
2025-11-07 16:15:16 +01:00
|
|
|
Address L.Lens[*Company, Address]
|
2025-11-13 09:05:57 +01:00
|
|
|
CEO L.Lens[*Company, Person]
|
|
|
|
|
Website L.Lens[*Company, *string]
|
|
|
|
|
// optional fields
|
|
|
|
|
NameO LO.LensO[*Company, string]
|
|
|
|
|
AddressO LO.LensO[*Company, Address]
|
|
|
|
|
CEOO LO.LensO[*Company, Person]
|
|
|
|
|
WebsiteO LO.LensO[*Company, *string]
|
2025-11-07 16:15:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// MakeCompanyLenses creates a new CompanyLenses with lenses for all fields
|
|
|
|
|
func MakeCompanyLenses() CompanyLenses {
|
2025-11-13 09:05:57 +01:00
|
|
|
// mandatory lenses
|
|
|
|
|
lensName := L.MakeLens(
|
|
|
|
|
func(s Company) string { return s.Name },
|
|
|
|
|
func(s Company, v string) Company { s.Name = v; return s },
|
|
|
|
|
)
|
|
|
|
|
lensAddress := L.MakeLens(
|
|
|
|
|
func(s Company) Address { return s.Address },
|
|
|
|
|
func(s Company, v Address) Company { s.Address = v; return s },
|
|
|
|
|
)
|
|
|
|
|
lensCEO := L.MakeLens(
|
|
|
|
|
func(s Company) Person { return s.CEO },
|
|
|
|
|
func(s Company, v Person) Company { s.CEO = v; return s },
|
|
|
|
|
)
|
|
|
|
|
lensWebsite := L.MakeLens(
|
|
|
|
|
func(s Company) *string { return s.Website },
|
|
|
|
|
func(s Company, v *string) Company { s.Website = v; return s },
|
|
|
|
|
)
|
|
|
|
|
// optional lenses
|
|
|
|
|
lensNameO := LO.FromIso[Company](IO.FromZero[string]())(lensName)
|
|
|
|
|
lensAddressO := LO.FromIso[Company](IO.FromZero[Address]())(lensAddress)
|
|
|
|
|
lensCEOO := LO.FromIso[Company](IO.FromZero[Person]())(lensCEO)
|
|
|
|
|
lensWebsiteO := LO.FromIso[Company](IO.FromZero[*string]())(lensWebsite)
|
2025-11-07 16:15:16 +01:00
|
|
|
return CompanyLenses{
|
2025-11-13 09:05:57 +01:00
|
|
|
// mandatory lenses
|
|
|
|
|
Name: lensName,
|
|
|
|
|
Address: lensAddress,
|
|
|
|
|
CEO: lensCEO,
|
|
|
|
|
Website: lensWebsite,
|
|
|
|
|
// optional lenses
|
|
|
|
|
NameO: lensNameO,
|
|
|
|
|
AddressO: lensAddressO,
|
|
|
|
|
CEOO: lensCEOO,
|
|
|
|
|
WebsiteO: lensWebsiteO,
|
2025-11-07 16:15:16 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// MakeCompanyRefLenses creates a new CompanyRefLenses with lenses for all fields
|
|
|
|
|
func MakeCompanyRefLenses() CompanyRefLenses {
|
2025-11-13 09:05:57 +01:00
|
|
|
// mandatory lenses
|
|
|
|
|
lensName := L.MakeLensStrict(
|
|
|
|
|
func(s *Company) string { return s.Name },
|
|
|
|
|
func(s *Company, v string) *Company { s.Name = v; return s },
|
|
|
|
|
)
|
|
|
|
|
lensAddress := L.MakeLensStrict(
|
|
|
|
|
func(s *Company) Address { return s.Address },
|
|
|
|
|
func(s *Company, v Address) *Company { s.Address = v; return s },
|
|
|
|
|
)
|
|
|
|
|
lensCEO := L.MakeLensStrict(
|
|
|
|
|
func(s *Company) Person { return s.CEO },
|
|
|
|
|
func(s *Company, v Person) *Company { s.CEO = v; return s },
|
|
|
|
|
)
|
|
|
|
|
lensWebsite := L.MakeLensStrict(
|
|
|
|
|
func(s *Company) *string { return s.Website },
|
|
|
|
|
func(s *Company, v *string) *Company { s.Website = v; return s },
|
|
|
|
|
)
|
|
|
|
|
// optional lenses
|
|
|
|
|
lensNameO := LO.FromIso[*Company](IO.FromZero[string]())(lensName)
|
|
|
|
|
lensAddressO := LO.FromIso[*Company](IO.FromZero[Address]())(lensAddress)
|
|
|
|
|
lensCEOO := LO.FromIso[*Company](IO.FromZero[Person]())(lensCEO)
|
|
|
|
|
lensWebsiteO := LO.FromIso[*Company](IO.FromZero[*string]())(lensWebsite)
|
2025-11-07 16:15:16 +01:00
|
|
|
return CompanyRefLenses{
|
2025-11-13 09:05:57 +01:00
|
|
|
// mandatory lenses
|
|
|
|
|
Name: lensName,
|
|
|
|
|
Address: lensAddress,
|
|
|
|
|
CEO: lensCEO,
|
|
|
|
|
Website: lensWebsite,
|
|
|
|
|
// optional lenses
|
|
|
|
|
NameO: lensNameO,
|
|
|
|
|
AddressO: lensAddressO,
|
|
|
|
|
CEOO: lensCEOO,
|
|
|
|
|
WebsiteO: lensWebsiteO,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// CompanyExtendedLenses provides lenses for accessing fields of CompanyExtended
|
|
|
|
|
type CompanyExtendedLenses struct {
|
|
|
|
|
// mandatory fields
|
|
|
|
|
Extended L.Lens[CompanyExtended, string]
|
|
|
|
|
// optional fields
|
|
|
|
|
ExtendedO LO.LensO[CompanyExtended, string]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// CompanyExtendedRefLenses provides lenses for accessing fields of CompanyExtended via a reference to CompanyExtended
|
|
|
|
|
type CompanyExtendedRefLenses struct {
|
|
|
|
|
// mandatory fields
|
|
|
|
|
Extended L.Lens[*CompanyExtended, string]
|
|
|
|
|
// optional fields
|
|
|
|
|
ExtendedO LO.LensO[*CompanyExtended, string]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// MakeCompanyExtendedLenses creates a new CompanyExtendedLenses with lenses for all fields
|
|
|
|
|
func MakeCompanyExtendedLenses() CompanyExtendedLenses {
|
|
|
|
|
// mandatory lenses
|
|
|
|
|
lensExtended := L.MakeLens(
|
|
|
|
|
func(s CompanyExtended) string { return s.Extended },
|
|
|
|
|
func(s CompanyExtended, v string) CompanyExtended { s.Extended = v; return s },
|
|
|
|
|
)
|
|
|
|
|
// optional lenses
|
|
|
|
|
lensExtendedO := LO.FromIso[CompanyExtended](IO.FromZero[string]())(lensExtended)
|
|
|
|
|
return CompanyExtendedLenses{
|
|
|
|
|
// mandatory lenses
|
|
|
|
|
Extended: lensExtended,
|
|
|
|
|
// optional lenses
|
|
|
|
|
ExtendedO: lensExtendedO,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// MakeCompanyExtendedRefLenses creates a new CompanyExtendedRefLenses with lenses for all fields
|
|
|
|
|
func MakeCompanyExtendedRefLenses() CompanyExtendedRefLenses {
|
|
|
|
|
// mandatory lenses
|
|
|
|
|
lensExtended := L.MakeLensStrict(
|
|
|
|
|
func(s *CompanyExtended) string { return s.Extended },
|
|
|
|
|
func(s *CompanyExtended, v string) *CompanyExtended { s.Extended = v; return s },
|
|
|
|
|
)
|
|
|
|
|
// optional lenses
|
|
|
|
|
lensExtendedO := LO.FromIso[*CompanyExtended](IO.FromZero[string]())(lensExtended)
|
|
|
|
|
return CompanyExtendedRefLenses{
|
|
|
|
|
// mandatory lenses
|
|
|
|
|
Extended: lensExtended,
|
|
|
|
|
// optional lenses
|
|
|
|
|
ExtendedO: lensExtendedO,
|
2025-11-07 16:15:16 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// CheckOptionLenses provides lenses for accessing fields of CheckOption
|
|
|
|
|
type CheckOptionLenses struct {
|
2025-11-13 09:05:57 +01:00
|
|
|
// mandatory fields
|
|
|
|
|
Name L.Lens[CheckOption, option.Option[string]]
|
|
|
|
|
Value L.Lens[CheckOption, string]
|
|
|
|
|
// optional fields
|
|
|
|
|
NameO LO.LensO[CheckOption, option.Option[string]]
|
|
|
|
|
ValueO LO.LensO[CheckOption, string]
|
2025-11-07 16:15:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// CheckOptionRefLenses provides lenses for accessing fields of CheckOption via a reference to CheckOption
|
|
|
|
|
type CheckOptionRefLenses struct {
|
2025-11-13 09:05:57 +01:00
|
|
|
// mandatory fields
|
|
|
|
|
Name L.Lens[*CheckOption, option.Option[string]]
|
|
|
|
|
Value L.Lens[*CheckOption, string]
|
|
|
|
|
// optional fields
|
|
|
|
|
NameO LO.LensO[*CheckOption, option.Option[string]]
|
|
|
|
|
ValueO LO.LensO[*CheckOption, string]
|
2025-11-07 16:15:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// MakeCheckOptionLenses creates a new CheckOptionLenses with lenses for all fields
|
|
|
|
|
func MakeCheckOptionLenses() CheckOptionLenses {
|
2025-11-13 09:05:57 +01:00
|
|
|
// mandatory lenses
|
|
|
|
|
lensName := L.MakeLens(
|
|
|
|
|
func(s CheckOption) option.Option[string] { return s.Name },
|
|
|
|
|
func(s CheckOption, v option.Option[string]) CheckOption { s.Name = v; return s },
|
|
|
|
|
)
|
|
|
|
|
lensValue := L.MakeLens(
|
|
|
|
|
func(s CheckOption) string { return s.Value },
|
|
|
|
|
func(s CheckOption, v string) CheckOption { s.Value = v; return s },
|
|
|
|
|
)
|
|
|
|
|
// optional lenses
|
|
|
|
|
lensNameO := LO.FromIso[CheckOption](IO.FromZero[option.Option[string]]())(lensName)
|
|
|
|
|
lensValueO := LO.FromIso[CheckOption](IO.FromZero[string]())(lensValue)
|
2025-11-07 16:15:16 +01:00
|
|
|
return CheckOptionLenses{
|
2025-11-13 09:05:57 +01:00
|
|
|
// mandatory lenses
|
|
|
|
|
Name: lensName,
|
|
|
|
|
Value: lensValue,
|
|
|
|
|
// optional lenses
|
|
|
|
|
NameO: lensNameO,
|
|
|
|
|
ValueO: lensValueO,
|
2025-11-07 16:15:16 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// MakeCheckOptionRefLenses creates a new CheckOptionRefLenses with lenses for all fields
|
|
|
|
|
func MakeCheckOptionRefLenses() CheckOptionRefLenses {
|
2025-11-13 09:05:57 +01:00
|
|
|
// mandatory lenses
|
|
|
|
|
lensName := L.MakeLensRef(
|
|
|
|
|
func(s *CheckOption) option.Option[string] { return s.Name },
|
|
|
|
|
func(s *CheckOption, v option.Option[string]) *CheckOption { s.Name = v; return s },
|
|
|
|
|
)
|
|
|
|
|
lensValue := L.MakeLensStrict(
|
|
|
|
|
func(s *CheckOption) string { return s.Value },
|
|
|
|
|
func(s *CheckOption, v string) *CheckOption { s.Value = v; return s },
|
|
|
|
|
)
|
|
|
|
|
// optional lenses
|
|
|
|
|
lensNameO := LO.FromIso[*CheckOption](IO.FromZero[option.Option[string]]())(lensName)
|
|
|
|
|
lensValueO := LO.FromIso[*CheckOption](IO.FromZero[string]())(lensValue)
|
2025-11-07 16:15:16 +01:00
|
|
|
return CheckOptionRefLenses{
|
2025-11-13 09:05:57 +01:00
|
|
|
// mandatory lenses
|
|
|
|
|
Name: lensName,
|
|
|
|
|
Value: lensValue,
|
|
|
|
|
// optional lenses
|
|
|
|
|
NameO: lensNameO,
|
|
|
|
|
ValueO: lensValueO,
|
2025-11-07 16:15:16 +01:00
|
|
|
}
|
|
|
|
|
}
|