MethodConfig#
- pydantic model fitrequest.method_config.MethodConfig[source]#
Bases:
BaseModelDescribes the configuration of ONE method. No the other method is declared: Explicit is better than implicit.
- field async_method: bool = False#
Boolean indicating whether the generated method is asynchronous.
- field base_url: Annotated[FitVar | dict | str | None, FieldInfo(annotation=NoneType, required=True, validate_default=True), BeforeValidator(func=validate_init_value, json_schema_input_type=PydanticUndefined)] = None#
Base URL for the generated method (overrides default).
- field decorators: list[~types.Annotated[~collections.abc.Callable | str, ~pydantic.functional_validators.BeforeValidator(func=~fitrequest.method_decorator.validate_init_value, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~fitrequest.method_decorator.<lambda>, return_type=str, when_used=always)]] [Optional]#
Decorators applied to the generated method.
- field docstring: str = ''#
Jinja template for the generated method (overrides default). The default variable declaration
{{my_var}}is replaced by{my_var}. See: https://jinja.palletsprojects.com/en/stable/
- field docstring_vars: dict[Any, Any] [Optional]#
Values of the docstring variables.
- field endpoint: str [Required]#
Endpoint of the request.
- field json_path: str | None = None#
JSON path string used to extract data from the received JSON response. See: https://pypi.org/project/jsonpath-ng/
- field name: str [Required]#
Name of the method that will be created.
- field params_model: <lambda>, return_type=str, when_used=always)] = None#
Use a Pydantic model or list of fields to define allowed parameters for the request URL. If a Pydantic model is used, parameters will be type-checked and validated. The URL’s parameters appear as arguments in the generated method. Note that custom params can still be provided, but those passed directly to the method have higher priority.
- field raise_for_status: bool = True#
Whether to raise an exception for response status codes between 400 and 599.
- field request_verb: RequestVerb = RequestVerb.get#
HTTP verb for the request, defined in the RequestVerb enumeration.
- field response_model: <lambda>, return_type=str, when_used=always)] = None#
Pydantic model used to format the request’s response.
- field save_method: bool = False#
Boolean indicating if the method includes an extra argument
filepathto write the response to a file.
- property docstring_template: Template#
- property docstring_varnames: set[str]#
- property endpoint_varnames: set[str]#
- property params_signature: FlattenedModelSignature | None#
- property signature: str#
- property url_template: Template#