# coding: utf-8

"""
    Onshape REST API

    The Onshape REST API consumed by all clients.  # noqa: E501

    OpenAPI spec version: 1.96
    Contact: api-support@onshape.zendesk.com
    Generated by: https://openapi-generator.tech
"""


import pprint
import re  # noqa: F401

import six


class Encoding(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 = {
        'content_type': 'str',
        'headers': 'dict(str, Header)',
        'style': 'str',
        'explode': 'bool',
        'allow_reserved': 'bool',
        'extensions': 'dict(str, object)'
    }

    attribute_map = {
        'content_type': 'contentType',
        'headers': 'headers',
        'style': 'style',
        'explode': 'explode',
        'allow_reserved': 'allowReserved',
        'extensions': 'extensions'
    }

    def __init__(self, content_type=None, headers=None, style=None, explode=None, allow_reserved=None, extensions=None):  # noqa: E501
        """Encoding - a model defined in OpenAPI"""  # noqa: E501

        self._content_type = None
        self._headers = None
        self._style = None
        self._explode = None
        self._allow_reserved = None
        self._extensions = None
        self.discriminator = None

        if content_type is not None:
            self.content_type = content_type
        if headers is not None:
            self.headers = headers
        if style is not None:
            self.style = style
        if explode is not None:
            self.explode = explode
        if allow_reserved is not None:
            self.allow_reserved = allow_reserved
        if extensions is not None:
            self.extensions = extensions

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


        :return: The content_type of this Encoding.  # noqa: E501
        :rtype: str
        """
        return self._content_type

    @content_type.setter
    def content_type(self, content_type):
        """Sets the content_type of this Encoding.


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

        self._content_type = content_type

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


        :return: The headers of this Encoding.  # noqa: E501
        :rtype: dict(str, Header)
        """
        return self._headers

    @headers.setter
    def headers(self, headers):
        """Sets the headers of this Encoding.


        :param headers: The headers of this Encoding.  # noqa: E501
        :type: dict(str, Header)
        """

        self._headers = headers

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


        :return: The style of this Encoding.  # noqa: E501
        :rtype: str
        """
        return self._style

    @style.setter
    def style(self, style):
        """Sets the style of this Encoding.


        :param style: The style of this Encoding.  # noqa: E501
        :type: str
        """
        allowed_values = ["form", "spaceDelimited", "pipeDelimited", "deepObject"]  # noqa: E501
        if style not in allowed_values:
            raise ValueError(
                "Invalid value for `style` ({0}), must be one of {1}"  # noqa: E501
                .format(style, allowed_values)
            )

        self._style = style

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


        :return: The explode of this Encoding.  # noqa: E501
        :rtype: bool
        """
        return self._explode

    @explode.setter
    def explode(self, explode):
        """Sets the explode of this Encoding.


        :param explode: The explode of this Encoding.  # noqa: E501
        :type: bool
        """

        self._explode = explode

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


        :return: The allow_reserved of this Encoding.  # noqa: E501
        :rtype: bool
        """
        return self._allow_reserved

    @allow_reserved.setter
    def allow_reserved(self, allow_reserved):
        """Sets the allow_reserved of this Encoding.


        :param allow_reserved: The allow_reserved of this Encoding.  # noqa: E501
        :type: bool
        """

        self._allow_reserved = allow_reserved

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


        :return: The extensions of this Encoding.  # noqa: E501
        :rtype: dict(str, object)
        """
        return self._extensions

    @extensions.setter
    def extensions(self, extensions):
        """Sets the extensions of this Encoding.


        :param extensions: The extensions of this Encoding.  # noqa: E501
        :type: dict(str, object)
        """

        self._extensions = extensions

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

        return self.__dict__ == other.__dict__

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