def _marshall_object(self, values, field, entity, skip_none: bool, use_foreign_key: bool):
    if isinstance(field, mapping.Field):
        self._marshall_field(values, field, entity, skip_none)
    elif (isinstance(field, mapping.Reference) and use_foreign_key):
        values[field.foreign_key] = getattr_(entity, field.foreign_key, None)
    elif isinstance(field, mapping.Definition):
        self._marshall_definition(values, field, entity, skip_none, use_foreign_key)
    elif isinstance(field, mapping.List):
        self._marshall_list(values, field, entity, skip_none, use_foreign_key)
def _marshall_object(self, values, field, entity, skip_none: bool, use_foreign_key: bool):
    if isinstance(field, mapping.Field):
        self._marshall_field(values, field, entity, skip_none)
    elif (isinstance(field, mapping.Reference) and use_foreign_key):
        values[field.foreign_key] = getattr_(entity, field.foreign_key, None)
    elif isinstance(field, mapping.Definition):
        self._marshall_definition(values, field, entity, skip_none, use_foreign_key)
    elif isinstance(field, mapping.List):
        self._marshall_list(values, field, entity, skip_none, use_foreign_key)