# coding: utf-8
from __future__ import absolute_import

from typing import List

from pds_doi_service.api import util
from pds_doi_service.api.models import Model
from pds_doi_service.api.models.label_payload import LabelPayload  # noqa: F401,E501


class LabelsPayload(Model):
    """
    NOTE: This class was auto generated by the swagger code generator program.
    """

    def __init__(self, labels=None):  # noqa: E501
        """LabelsPayload - a model defined in Swagger

        :param labels: The labels of this LabelsPayload.  # noqa: E501
        :type labels: List[LabelPayload]
        """
        self.swagger_types = {"labels": List[LabelPayload]}

        self.attribute_map = {"labels": "labels"}
        self._labels = labels

    @classmethod
    def from_dict(cls, dikt) -> "LabelsPayload":
        """Returns the dict as a model

        :param dikt: A dict.
        :type: dict
        :return: The labels_payload of this LabelsPayload.  # noqa: E501
        :rtype: LabelsPayload
        """
        return util.deserialize_model(dikt, cls)

    @property
    def labels(self) -> List[LabelPayload]:
        """Gets the labels of this LabelsPayload.


        :return: The labels of this LabelsPayload.
        :rtype: List[LabelPayload]
        """
        return self._labels

    @labels.setter
    def labels(self, labels: List[LabelPayload]):
        """Sets the labels of this LabelsPayload.


        :param labels: The labels of this LabelsPayload.
        :type labels: List[LabelPayload]
        """

        self._labels = labels

    def __iter__(self):
        """Short circuit to iterator over list of labels."""
        return iter(self._labels)
