# coding: utf-8

"""
    Paragon Insights APIs

    API interface for PI application  # noqa: E501

    OpenAPI spec version: 4.0.0
    Contact: healthbot-feedback@juniper.net
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six


class TopicSchemaLocateresource(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    """

    """
    Attributes:
      swagger_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    """
    swagger_types = {
        'label_as': 'str',
        'resource': 'str',
        'where': 'TopicSchemaWhere',
        'with_capture_group': 'list[TopicSchemaWithcapturegroup]'
    }

    attribute_map = {
        'label_as': 'label-as',
        'resource': 'resource',
        'where': 'where',
        'with_capture_group': 'with-capture-group'
    }

    def __init__(self, label_as=None, resource=None, where=None, with_capture_group=None):  # noqa: E501
        """TopicSchemaLocateresource - a model defined in Swagger"""  # noqa: E501

        self._label_as = None
        self._resource = None
        self._where = None
        self._with_capture_group = None
        self.discriminator = None

        self.label_as = label_as
        self.resource = resource
        if where is not None:
            self.where = where
        if with_capture_group is not None:
            self.with_capture_group = with_capture_group

    @property
    def label_as(self):
        """Gets the label_as of this TopicSchemaLocateresource.  # noqa: E501


        :return: The label_as of this TopicSchemaLocateresource.  # noqa: E501
        :rtype: str
        """
        return self._label_as

    @label_as.setter
    def label_as(self, label_as):
        """Sets the label_as of this TopicSchemaLocateresource.


        :param label_as: The label_as of this TopicSchemaLocateresource.  # noqa: E501
        :type: str
        """
        if label_as is None:
            raise ValueError("Invalid value for `label_as`, must not be `None`")  # noqa: E501
        if label_as is not None and len(label_as) > 64:
            raise ValueError("Invalid value for `label_as`, length must be less than or equal to `64`")  # noqa: E501
        if label_as is not None and len(label_as) < 1:
            raise ValueError("Invalid value for `label_as`, length must be greater than or equal to `1`")  # noqa: E501
        if label_as is not None and not re.search(r'^[a-zA-Z][a-zA-Z0-9-]*$', label_as):  # noqa: E501
            raise ValueError(r"Invalid value for `label_as`, must be a follow pattern or equal to `/^[a-zA-Z][a-zA-Z0-9-]*$/`")  # noqa: E501

        self._label_as = label_as

    @property
    def resource(self):
        """Gets the resource of this TopicSchemaLocateresource.  # noqa: E501

        Name of the resource which needs to looped over. Format: <optional-idetifier followed by :><topic-name/rule-name>. Should be of pattern ([a-zA-Z][a-zA-Z0-9-]*:)?[a-z][a-z-]*(\\.{1}[a-z0-9-]+)*/[a-z][a-z0-9-]*.  # noqa: E501

        :return: The resource of this TopicSchemaLocateresource.  # noqa: E501
        :rtype: str
        """
        return self._resource

    @resource.setter
    def resource(self, resource):
        """Sets the resource of this TopicSchemaLocateresource.

        Name of the resource which needs to looped over. Format: <optional-idetifier followed by :><topic-name/rule-name>. Should be of pattern ([a-zA-Z][a-zA-Z0-9-]*:)?[a-z][a-z-]*(\\.{1}[a-z0-9-]+)*/[a-z][a-z0-9-]*.  # noqa: E501

        :param resource: The resource of this TopicSchemaLocateresource.  # noqa: E501
        :type: str
        """
        if resource is None:
            raise ValueError("Invalid value for `resource`, must not be `None`")  # noqa: E501
        if resource is not None and not re.search(r'^([a-zA-Z][a-zA-Z0-9-]*:)?[a-z][a-z-]*(\\.{1}[a-z0-9-]+)*\/[a-z][a-z0-9-]*$', resource):  # noqa: E501
            raise ValueError(r"Invalid value for `resource`, must be a follow pattern or equal to `/^([a-zA-Z][a-zA-Z0-9-]*:)?[a-z][a-z-]*(\\.{1}[a-z0-9-]+)*\/[a-z][a-z0-9-]*$/`")  # noqa: E501

        self._resource = resource

    @property
    def where(self):
        """Gets the where of this TopicSchemaLocateresource.  # noqa: E501


        :return: The where of this TopicSchemaLocateresource.  # noqa: E501
        :rtype: TopicSchemaWhere
        """
        return self._where

    @where.setter
    def where(self, where):
        """Sets the where of this TopicSchemaLocateresource.


        :param where: The where of this TopicSchemaLocateresource.  # noqa: E501
        :type: TopicSchemaWhere
        """

        self._where = where

    @property
    def with_capture_group(self):
        """Gets the with_capture_group of this TopicSchemaLocateresource.  # noqa: E501


        :return: The with_capture_group of this TopicSchemaLocateresource.  # noqa: E501
        :rtype: list[TopicSchemaWithcapturegroup]
        """
        return self._with_capture_group

    @with_capture_group.setter
    def with_capture_group(self, with_capture_group):
        """Sets the with_capture_group of this TopicSchemaLocateresource.


        :param with_capture_group: The with_capture_group of this TopicSchemaLocateresource.  # noqa: E501
        :type: list[TopicSchemaWithcapturegroup]
        """

        self._with_capture_group = with_capture_group

    def to_dict(self):
        """Returns the model properties as a dict"""
        result = {}

        for attr, _ in six.iteritems(self.swagger_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
                    value
                ))
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1].to_dict())
                    if hasattr(item[1], "to_dict") else item,
                    value.items()
                ))
            else:
                result[attr] = value
        if issubclass(TopicSchemaLocateresource, dict):
            for key, value in self.items():
                result[key] = value

        return result

    def to_str(self):
        """Returns the string representation of the model"""
        return pprint.pformat(self.to_dict())

    def __repr__(self):
        """For `print` and `pprint`"""
        return self.to_str()

    def __eq__(self, other):
        """Returns true if both objects are equal"""
        if not isinstance(other, TopicSchemaLocateresource):
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """Returns true if both objects are not equal"""
        return not self == other
