# coding: utf-8

"""
    ChannelEngine Channel API

    ChannelEngine API for channels  # noqa: E501

    The version of the OpenAPI document: 2.9.10
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six

from channelengine_channel_api_client.configuration import Configuration


class ChannelCancellationResponse(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 = {
        'channel_order_no': 'str',
        'lines': 'list[ChannelCancellationLineResponse]',
        'created_at': 'datetime',
        'updated_at': 'datetime',
        'reason': 'str',
        'reason_code': 'MancoReason'
    }

    attribute_map = {
        'channel_order_no': 'ChannelOrderNo',
        'lines': 'Lines',
        'created_at': 'CreatedAt',
        'updated_at': 'UpdatedAt',
        'reason': 'Reason',
        'reason_code': 'ReasonCode'
    }

    def __init__(self, channel_order_no=None, lines=None, created_at=None, updated_at=None, reason=None, reason_code=None, local_vars_configuration=None):  # noqa: E501
        """ChannelCancellationResponse - a model defined in OpenAPI"""  # noqa: E501
        if local_vars_configuration is None:
            local_vars_configuration = Configuration()
        self.local_vars_configuration = local_vars_configuration

        self._channel_order_no = None
        self._lines = None
        self._created_at = None
        self._updated_at = None
        self._reason = None
        self._reason_code = None
        self.discriminator = None

        self.channel_order_no = channel_order_no
        self.lines = lines
        if created_at is not None:
            self.created_at = created_at
        if updated_at is not None:
            self.updated_at = updated_at
        self.reason = reason
        self.reason_code = reason_code

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

        The unique order reference used by the Channel.  # noqa: E501

        :return: The channel_order_no of this ChannelCancellationResponse.  # noqa: E501
        :rtype: str
        """
        return self._channel_order_no

    @channel_order_no.setter
    def channel_order_no(self, channel_order_no):
        """Sets the channel_order_no of this ChannelCancellationResponse.

        The unique order reference used by the Channel.  # noqa: E501

        :param channel_order_no: The channel_order_no of this ChannelCancellationResponse.  # noqa: E501
        :type channel_order_no: str
        """
        if self.local_vars_configuration.client_side_validation and channel_order_no is None:  # noqa: E501
            raise ValueError("Invalid value for `channel_order_no`, must not be `None`")  # noqa: E501

        self._channel_order_no = channel_order_no

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


        :return: The lines of this ChannelCancellationResponse.  # noqa: E501
        :rtype: list[ChannelCancellationLineResponse]
        """
        return self._lines

    @lines.setter
    def lines(self, lines):
        """Sets the lines of this ChannelCancellationResponse.


        :param lines: The lines of this ChannelCancellationResponse.  # noqa: E501
        :type lines: list[ChannelCancellationLineResponse]
        """
        if self.local_vars_configuration.client_side_validation and lines is None:  # noqa: E501
            raise ValueError("Invalid value for `lines`, must not be `None`")  # noqa: E501

        self._lines = lines

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

        The date at which the cancellation was created in ChannelEngine.  # noqa: E501

        :return: The created_at of this ChannelCancellationResponse.  # noqa: E501
        :rtype: datetime
        """
        return self._created_at

    @created_at.setter
    def created_at(self, created_at):
        """Sets the created_at of this ChannelCancellationResponse.

        The date at which the cancellation was created in ChannelEngine.  # noqa: E501

        :param created_at: The created_at of this ChannelCancellationResponse.  # noqa: E501
        :type created_at: datetime
        """

        self._created_at = created_at

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

        The date at which the cancellation was last modified in ChannelEngine.  # noqa: E501

        :return: The updated_at of this ChannelCancellationResponse.  # noqa: E501
        :rtype: datetime
        """
        return self._updated_at

    @updated_at.setter
    def updated_at(self, updated_at):
        """Sets the updated_at of this ChannelCancellationResponse.

        The date at which the cancellation was last modified in ChannelEngine.  # noqa: E501

        :param updated_at: The updated_at of this ChannelCancellationResponse.  # noqa: E501
        :type updated_at: datetime
        """

        self._updated_at = updated_at

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

        Reason for cancellation (text).  # noqa: E501

        :return: The reason of this ChannelCancellationResponse.  # noqa: E501
        :rtype: str
        """
        return self._reason

    @reason.setter
    def reason(self, reason):
        """Sets the reason of this ChannelCancellationResponse.

        Reason for cancellation (text).  # noqa: E501

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

        self._reason = reason

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

        Reason code for cancellation.  # noqa: E501

        :return: The reason_code of this ChannelCancellationResponse.  # noqa: E501
        :rtype: MancoReason
        """
        return self._reason_code

    @reason_code.setter
    def reason_code(self, reason_code):
        """Sets the reason_code of this ChannelCancellationResponse.

        Reason code for cancellation.  # noqa: E501

        :param reason_code: The reason_code of this ChannelCancellationResponse.  # noqa: E501
        :type reason_code: MancoReason
        """

        self._reason_code = reason_code

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

        return self.to_dict() == other.to_dict()

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

        return self.to_dict() != other.to_dict()
