# coding: utf-8

"""
ChannelPort.py

 The Clear BSD License

 Copyright (c) – 2016, NetApp, Inc. All rights reserved.

 Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met:

 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

 * Neither the name of NetApp, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

 NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""

from pprint import pformat
from six import iteritems


class ChannelPort(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self):
        """
        ChannelPort - a model defined in Swagger

        :param dict swaggerTypes: The key is attribute name
                                  and the value is attribute type.
        :param dict attributeMap: The key is attribute name
                                  and the value is json key in definition.
        """
        self.swagger_types = {
            'port_ref': 'str',  # (required parameter)
            'port_parent': 'ChannelPortParent',  # (required parameter)
            'port_number': 'int',  # (required parameter)
            'channel': 'int',  # (required parameter)
            'channel_type': 'str',  # (required parameter)
            'physical_location': 'Location',  # (required parameter)
            'is_trunk_active': 'bool',  # (required parameter)
            'id': 'str'
        }

        self.attribute_map = {
            'port_ref': 'portRef',  # (required parameter)
            'port_parent': 'portParent',  # (required parameter)
            'port_number': 'portNumber',  # (required parameter)
            'channel': 'channel',  # (required parameter)
            'channel_type': 'channelType',  # (required parameter)
            'physical_location': 'physicalLocation',  # (required parameter)
            'is_trunk_active': 'isTrunkActive',  # (required parameter)
            'id': 'id'
        }

        self._port_ref = None
        self._port_parent = None
        self._port_number = None
        self._channel = None
        self._channel_type = None
        self._physical_location = None
        self._is_trunk_active = None
        self._id = None

    @property
    def port_ref(self):
        """
        Gets the port_ref of this ChannelPort.
        A reference to this channel port.

        :return: The port_ref of this ChannelPort.
        :rtype: str
        :required/optional: required
        """
        return self._port_ref

    @port_ref.setter
    def port_ref(self, port_ref):
        """
        Sets the port_ref of this ChannelPort.
        A reference to this channel port.

        :param port_ref: The port_ref of this ChannelPort.
        :type: str
        """
        self._port_ref = port_ref

    @property
    def port_parent(self):
        """
        Gets the port_parent of this ChannelPort.
        The parent of the channel port object (minihub, controller, or ESM).

        :return: The port_parent of this ChannelPort.
        :rtype: ChannelPortParent
        :required/optional: required
        """
        return self._port_parent

    @port_parent.setter
    def port_parent(self, port_parent):
        """
        Sets the port_parent of this ChannelPort.
        The parent of the channel port object (minihub, controller, or ESM).

        :param port_parent: The port_parent of this ChannelPort.
        :type: ChannelPortParent
        """
        self._port_parent = port_parent

    @property
    def port_number(self):
        """
        Gets the port_number of this ChannelPort.
        The identifying number assigned to this channel port. The range for port numbers is 1..n. If the port number cannot be determined, this field is set to zero.

        :return: The port_number of this ChannelPort.
        :rtype: int
        :required/optional: required
        """
        return self._port_number

    @port_number.setter
    def port_number(self, port_number):
        """
        Sets the port_number of this ChannelPort.
        The identifying number assigned to this channel port. The range for port numbers is 1..n. If the port number cannot be determined, this field is set to zero.

        :param port_number: The port_number of this ChannelPort.
        :type: int
        """
        self._port_number = port_number

    @property
    def channel(self):
        """
        Gets the channel of this ChannelPort.
        The number of the associated channel.

        :return: The channel of this ChannelPort.
        :rtype: int
        :required/optional: required
        """
        return self._channel

    @channel.setter
    def channel(self, channel):
        """
        Sets the channel of this ChannelPort.
        The number of the associated channel.

        :param channel: The channel of this ChannelPort.
        :type: int
        """
        self._channel = channel

    @property
    def channel_type(self):
        """
        Gets the channel_type of this ChannelPort.
        The type of the associated channel - either host-side or drive-side.

        :return: The channel_type of this ChannelPort.
        :rtype: str
        :required/optional: required
        """
        return self._channel_type

    @channel_type.setter
    def channel_type(self, channel_type):
        """
        Sets the channel_type of this ChannelPort.
        The type of the associated channel - either host-side or drive-side.

        :param channel_type: The channel_type of this ChannelPort.
        :type: str
        """
        allowed_values = ["hostside", "driveside", "management", "__UNDEFINED"]
        if channel_type not in allowed_values:
            raise ValueError(
                "Invalid value for `channel_type`, must be one of {0}"
                .format(allowed_values)
            )
        self._channel_type = channel_type

    @property
    def physical_location(self):
        """
        Gets the physical_location of this ChannelPort.
        The physical location of the channel port. The parent reference in Location identifies the physical CRU where the port is located, and the position field is the parent-relative/like-port relative number of the port, starting at 1.

        :return: The physical_location of this ChannelPort.
        :rtype: Location
        :required/optional: required
        """
        return self._physical_location

    @physical_location.setter
    def physical_location(self, physical_location):
        """
        Sets the physical_location of this ChannelPort.
        The physical location of the channel port. The parent reference in Location identifies the physical CRU where the port is located, and the position field is the parent-relative/like-port relative number of the port, starting at 1.

        :param physical_location: The physical_location of this ChannelPort.
        :type: Location
        """
        self._physical_location = physical_location

    @property
    def is_trunk_active(self):
        """
        Gets the is_trunk_active of this ChannelPort.
        This field is true if a trunk connection has been established and is being maintained on this controller or ESM channel port. This field is always false if the channel port is on a controller or ESM that does not have a Fibre Channel I/O interface type, or if the channel port is associated with a host-side channel.

        :return: The is_trunk_active of this ChannelPort.
        :rtype: bool
        :required/optional: required
        """
        return self._is_trunk_active

    @is_trunk_active.setter
    def is_trunk_active(self, is_trunk_active):
        """
        Sets the is_trunk_active of this ChannelPort.
        This field is true if a trunk connection has been established and is being maintained on this controller or ESM channel port. This field is always false if the channel port is on a controller or ESM that does not have a Fibre Channel I/O interface type, or if the channel port is associated with a host-side channel.

        :param is_trunk_active: The is_trunk_active of this ChannelPort.
        :type: bool
        """
        self._is_trunk_active = is_trunk_active

    @property
    def id(self):
        """
        Gets the id of this ChannelPort.


        :return: The id of this ChannelPort.
        :rtype: str
        :required/optional: optional
        """
        return self._id

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


        :param id: The id of this ChannelPort.
        :type: str
        """
        self._id = id

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

        for attr, _ in 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

        return result

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

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

    def __eq__(self, other):
        """
        Returns true if both objects are equal
        """
        if self is None or other is None:
            return None
        return self.__dict__ == other.__dict__

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

