import re  # noqa: E501
from datetime import date, datetime  # noqa: F401
from typing import List, Dict  # noqa: F401

from capif_security import util
from capif_security.models.base_model import Model


class ResOwnerId(Model):
    """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

    Do not edit the class manually.
    """

    def __init__(self, gpsi=None):  # noqa: E501
        """ResOwnerId - a model defined in OpenAPI

        :param gpsi: The gpsi of this ResOwnerId.  # noqa: E501
        :type gpsi: str
        """
        self.openapi_types = {
            'gpsi': str
        }

        self.attribute_map = {
            'gpsi': 'gpsi'
        }

        self._gpsi = gpsi

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

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

    @property
    def gpsi(self) -> str:
        """Gets the gpsi of this ResOwnerId.

        String identifying a Gpsi shall contain either an External Id or an MSISDN.  It shall be formatted as follows -External Identifier= \"extid-'extid', where 'extid'  shall be formatted according to clause 19.7.2 of 3GPP TS 23.003 that describes an  External Identifier.    # noqa: E501

        :return: The gpsi of this ResOwnerId.
        :rtype: str
        """
        return self._gpsi

    @gpsi.setter
    def gpsi(self, gpsi: str):
        """Sets the gpsi of this ResOwnerId.

        String identifying a Gpsi shall contain either an External Id or an MSISDN.  It shall be formatted as follows -External Identifier= \"extid-'extid', where 'extid'  shall be formatted according to clause 19.7.2 of 3GPP TS 23.003 that describes an  External Identifier.    # noqa: E501

        :param gpsi: The gpsi of this ResOwnerId.
        :type gpsi: str
        """
        if gpsi is not None and not re.search(r'^(msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|.+)$', gpsi):  # noqa: E501
            raise ValueError("Invalid value for `gpsi`, must be a follow pattern or equal to `/^(msisdn-[0-9]{5,15}|extid-[^@]+@[^@]+|.+)$/`")  # noqa: E501

        self._gpsi = gpsi
