Extra field helpers#
Helpers for managing pydantic extra fields.
- grab_extra_fields(attachment, extra_fields)[source]#
Convenience method for passing attachment extras as named arguments to API functions. This might be useful for making sure no typos appear in code. Accepts a list of extra names and makes a dictionary of extras mathing these names.
- Parameters:
attachment (
BaseModel
) – attachment whose extras will be used.extra_fields (
List
[str
]) – list of extras that will be used.