Generator#

class fitrequest.generator.Generator[source]#

Bases: object

static format_params(method_config: MethodConfig, **kwargs) dict[source]#

Format and check params of generated method, raise on unrecognized arguments.

classmethod generate_method(method_config: MethodConfig) Callable[source]#

Generate method from configuration with correct signature.

static get_url_params(method_config: MethodConfig, **kwargs) dict[source]#

Return the keyword arguments from kwargs that correspond to URL parameters.

This involves merging the parameters found in the params keyword argument with those inferred directly from the method’s signature.

Parameters from the method signature have priority over any parameters specified in the params field of kwargs.

Additionally, replace any arguments with specified aliases using their corresponding replacements.

static unknown_params(method_config: MethodConfig, request_method_base: dict, **kwargs) set[str][source]#

Returns the collection of unexpected parameters found in the method arguments (kwargs). The only expected parameters are those reserved for fit_request, httpx.Request, the keyword self, and URL parameters.