Builders
Builders overview
Fluent builders for request models used in the EFL Leasing SDK.
Namespace and purpose
The Imoli\EflLeasingSdk\Builder namespace contains fluent builders for the main request models used when calling the EFL Leasing Online API.
They provide a more readable and less error‑prone way of constructing complex payloads than assembling nested arrays by hand.
Builders are most often used together with EflClient methods from the clients section and the corresponding models from the models section.
Groups of builders
- Calculation – basket and offer‑related payloads:
AssetToCalculationBuilder– buildsAssetToCalculation(basket for basic offer calculation),OfferItemBuilder– buildsOfferItementries for the basket,ItemDetailBuilder– buildsItemDetailmetadata items for offer items.
- Customer – company and customer‑related payloads:
CustomerDataBuilder– buildsCustomerDatafor/Customer/PostCustomerDataForLon,CompanyBuilder– buildsCompanywith contact details, addresses and statements,PersonBuilder– buildsPersonlinked to the company,AddressBuilder– buildsAddressentries,EmailAddressBuilder– buildsEmailAddressentries,PhoneBuilder– buildsPhoneentries,CustomerDataStatementBuilder– buildsCustomerDataStatemententries,IdentityDocumentBuilder– buildsIdentityDocumententries.
- Lead – contact / lead‑related payloads:
ContactDataBuilder– buildsContactDatafor/Lead/SendContactForm,ProspectBuilder– buildsProspectdata,StatementLeadBuilder– buildsStatementLeadconsent entries.
- Verification – identity verification payloads:
When to use builders
Use builders when:
- you want a fluent API instead of constructing nested arrays or calling large model constructors directly,
- you need to enforce required fields – most builders validate required data in
build()and throw a\LogicExceptionif it is missing, - you want a single place where default values and composition rules are encoded.
You can always construct models directly (see the models section), but builders are recommended for application‑level code that prepares payloads for EflClient.