DefinitionsBuilder
No overview available.
Attributes
| Attribute | Type | Description |
|---|---|---|
| definitions | Definitions< T > | A collection of type definitions used to store and manage the schema components being built. |
| use_prebuilt | bool | A flag indicating whether the builder should utilize existing prebuilt definitions instead of generating new ones. |
Constructor
Signature
def DefinitionsBuilder(
definitions: Definitions< T >,
use_prebuilt: bool
) - > [DefinitionsBuilder](definitionsbuilder.md?sid=definitions_definitionsbuilder)
Parameters
| Name | Type | Description |
|---|---|---|
| definitions | Definitions< T > | A collection of definitions to be used by the builder. |
| use_prebuilt | bool | A boolean flag indicating if prebuilt definitions should be utilized. |
Signature
@classmethod
def new() - > DefinitionsBuilder< T >
Methods
with_prebuilt()
def with_prebuilt(
use_prebuilt: bool
) - > DefinitionsBuilder< T >
Configures whether the builder should utilize prebuilt definitions during the construction process.
Parameters
| Name | Type | Description |
|---|---|---|
| use_prebuilt | bool | A flag indicating if pre-existing definitions should be incorporated. |
Returns
| Type | Description |
|---|---|
DefinitionsBuilder< T > | The builder instance with the updated prebuilt configuration. |
add_definition()
def add_definition(
definition: T
) - > DefinitionsBuilder< T >
Registers a new definition entry into the builder's internal collection.
Parameters
| Name | Type | Description |
|---|---|---|
| definition | T | The definition object or value to be stored in the collection. |
Returns
| Type | Description |
|---|---|
DefinitionsBuilder< T > | The builder instance containing the newly added definition. |
build()
def build() - > Definitions< T >
Consumes the builder and returns the finalized Definitions object.
Returns
| Type | Description |
|---|---|
Definitions< T > | The completed definitions collection ready for use. |