{%- block array %}
    def set_{{name}}(self, values: list) -> None:

        self.{{name}} = []
        if isinstance(values, list):
            for element in values:
                {#- handle tons of types which sucks... -#}
                {%- if field.array_item_type.fieldtype == 'reference' %}
                self.{{name}}.append({{field.array_item_type.reference_name}}(element))
                {%- elif field.array_item_type.fieldtype == 'primitive'%}
                if isinstance(element, {{primitive_type_map[field.array_item_type.avrotype]}}):
                    self.{{name}}.append(element)
                else:
                    raise TypeError(
                        "Type for '{{name}}' should be '{{primitive_type_map[field.array_item_type.fieldtype]}}'"
                    )
                {%- endif %}
        else:
            raise TypeError("Field '{{name}}' should be type list")

    def get_{{name}}(self) -> list:
        return self.{{name}}
{%- endblock -%}