# coding: utf-8

"""
    Vidispine API

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)  # noqa: E501

    The version of the OpenAPI document: 5.x
    Contact: info@vidispine.com
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six
from . import *

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

    Do not edit the class manually.
    """

    """
    Attributes:
      openapi_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.
    """
    openapi_types = {
        'loc': 'str',
        'read': 'bool',
        'last_success': 'datetime',
        'uri': 'str',
        'last_failure': 'datetime',
        'write': 'bool',
        'browse': 'bool',
        'bandwidth': 'int',
        'failure_message': 'str',
        'type': 'str',
        'id': 'str',
        'metadata': 'SimpleMetadataType'
    }

    attribute_map = {
        'loc': 'loc',
        'read': 'read',
        'last_success': 'lastSuccess',
        'uri': 'uri',
        'last_failure': 'lastFailure',
        'write': 'write',
        'browse': 'browse',
        'bandwidth': 'bandwidth',
        'failure_message': 'failureMessage',
        'type': 'type',
        'id': 'id',
        'metadata': 'metadata'
    }

    def __init__(self, loc=None, read=None, last_success=None, uri=None, last_failure=None, write=None, browse=None, bandwidth=None, failure_message=None, type=None, id=None, metadata=None):  # noqa: E501
        """StorageMethodType - a model defined in OpenAPI"""  # noqa: E501

        self._loc = None
        self._read = None
        self._last_success = None
        self._uri = None
        self._last_failure = None
        self._write = None
        self._browse = None
        self._bandwidth = None
        self._failure_message = None
        self._type = None
        self._id = None
        self._metadata = None
        self.discriminator = None

        if loc is not None:
            self.loc = loc
        self.read = read
        if last_success is not None:
            self.last_success = last_success
        self.uri = uri
        if last_failure is not None:
            self.last_failure = last_failure
        self.write = write
        self.browse = browse
        if bandwidth is not None:
            self.bandwidth = bandwidth
        if failure_message is not None:
            self.failure_message = failure_message
        if type is not None:
            self.type = type
        if id is not None:
            self.id = id
        if metadata is not None:
            self.metadata = metadata

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


        :return: The loc of this StorageMethodType.  # noqa: E501
        :rtype: str
        """
        return self._loc

    @loc.setter
    def loc(self, loc):
        """Sets the loc of this StorageMethodType.


        :param loc: The loc of this StorageMethodType.  # noqa: E501
        :type: str
        """

        self._loc = loc

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


        :return: The read of this StorageMethodType.  # noqa: E501
        :rtype: bool
        """
        return self._read

    @read.setter
    def read(self, read):
        """Sets the read of this StorageMethodType.


        :param read: The read of this StorageMethodType.  # noqa: E501
        :type: bool
        """
        if read is None:
            raise ValueError("Invalid value for `read`, must not be `None`")  # noqa: E501

        self._read = read

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


        :return: The last_success of this StorageMethodType.  # noqa: E501
        :rtype: datetime
        """
        return self._last_success

    @last_success.setter
    def last_success(self, last_success):
        """Sets the last_success of this StorageMethodType.


        :param last_success: The last_success of this StorageMethodType.  # noqa: E501
        :type: datetime
        """

        self._last_success = last_success

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


        :return: The uri of this StorageMethodType.  # noqa: E501
        :rtype: str
        """
        return self._uri

    @uri.setter
    def uri(self, uri):
        """Sets the uri of this StorageMethodType.


        :param uri: The uri of this StorageMethodType.  # noqa: E501
        :type: str
        """
        if uri is None:
            raise ValueError("Invalid value for `uri`, must not be `None`")  # noqa: E501

        self._uri = uri

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


        :return: The last_failure of this StorageMethodType.  # noqa: E501
        :rtype: datetime
        """
        return self._last_failure

    @last_failure.setter
    def last_failure(self, last_failure):
        """Sets the last_failure of this StorageMethodType.


        :param last_failure: The last_failure of this StorageMethodType.  # noqa: E501
        :type: datetime
        """

        self._last_failure = last_failure

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


        :return: The write of this StorageMethodType.  # noqa: E501
        :rtype: bool
        """
        return self._write

    @write.setter
    def write(self, write):
        """Sets the write of this StorageMethodType.


        :param write: The write of this StorageMethodType.  # noqa: E501
        :type: bool
        """
        if write is None:
            raise ValueError("Invalid value for `write`, must not be `None`")  # noqa: E501

        self._write = write

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


        :return: The browse of this StorageMethodType.  # noqa: E501
        :rtype: bool
        """
        return self._browse

    @browse.setter
    def browse(self, browse):
        """Sets the browse of this StorageMethodType.


        :param browse: The browse of this StorageMethodType.  # noqa: E501
        :type: bool
        """
        if browse is None:
            raise ValueError("Invalid value for `browse`, must not be `None`")  # noqa: E501

        self._browse = browse

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


        :return: The bandwidth of this StorageMethodType.  # noqa: E501
        :rtype: int
        """
        return self._bandwidth

    @bandwidth.setter
    def bandwidth(self, bandwidth):
        """Sets the bandwidth of this StorageMethodType.


        :param bandwidth: The bandwidth of this StorageMethodType.  # noqa: E501
        :type: int
        """

        self._bandwidth = bandwidth

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


        :return: The failure_message of this StorageMethodType.  # noqa: E501
        :rtype: str
        """
        return self._failure_message

    @failure_message.setter
    def failure_message(self, failure_message):
        """Sets the failure_message of this StorageMethodType.


        :param failure_message: The failure_message of this StorageMethodType.  # noqa: E501
        :type: str
        """

        self._failure_message = failure_message

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


        :return: The type of this StorageMethodType.  # noqa: E501
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type):
        """Sets the type of this StorageMethodType.


        :param type: The type of this StorageMethodType.  # noqa: E501
        :type: str
        """

        self._type = type

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


        :return: The id of this StorageMethodType.  # noqa: E501
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this StorageMethodType.


        :param id: The id of this StorageMethodType.  # noqa: E501
        :type: str
        """
        if id is not None and not re.search(r'([_A-Za-z]+-)?([A-Za-z_][A-Za-z0-9_]*-|(([A-Za-z_][A-Za-z0-9_]*)?\*))([0-9]{1}[0-9]{0,31})', id):  # noqa: E501
            raise ValueError(r"Invalid value for `id`, must be a follow pattern or equal to `/([_A-Za-z]+-)?([A-Za-z_][A-Za-z0-9_]*-|(([A-Za-z_][A-Za-z0-9_]*)?\*))([0-9]{1}[0-9]{0,31})/`")  # noqa: E501

        self._id = id

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


        :return: The metadata of this StorageMethodType.  # noqa: E501
        :rtype: SimpleMetadataType
        """
        return self._metadata

    @metadata.setter
    def metadata(self, metadata):
        """Sets the metadata of this StorageMethodType.


        :param metadata: The metadata of this StorageMethodType.  # noqa: E501
        :type: SimpleMetadataType
        """

        self._metadata = metadata

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

        for attr, _ in six.iteritems(self.openapi_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

        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, StorageMethodType):
            return False

        return self.__dict__ == other.__dict__

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