# coding: utf-8

"""
    Cythereal MAGIC API

    The API for accessing Cythereal MAGIC products and services.  # API Conventions  Properties MUST be named using `snake_case`.  This API is inspired by the [google json style guide](https://google.github.io/styleguide/jsoncstyleguide.xml). Any questions about conventions not documented here should be addressed by this style guide.  **All responses** MUST be of type `APIResponse` and contain the following fields:  * `api_version` |  The current api version * `success` | Boolean value indicating if the operation succeeded. * `code` | Status code. Typically corresponds to the HTTP status code.  * `message` | A human readable message providing more details about the operation. Can be null or empty.  **Successful operations** MUST return a `SuccessResponse`, which extends `APIResponse` by adding:  * `data` | Properties containing the response object. * `success` | MUST equal True  When returning objects from a successful response, the `data` object SHOULD contain a property named after the requested object type. For example, the `/matches` endpoint should return a response object with `data.matches`. This property SHOULD  contain a list of the returned objects. For the `/matches` endpoint, the `data.matches` property contains a list of MagicMatch objects. See the `/matches` endpoint documentation for an example.  **Failed Operations** MUST return an `ErrorResponse`, which extends `APIResponse` by adding:  * `errors` | Array of error objects. An error object contains the following properties:     * `ErrorObject.reason` | Unique identifier for this error. Example: \"FileNotFoundError\".     * `ErrorObject.message`| Human readable error message. * `success` | MUST equal False.   # Example Inputs  Here are some example inputs that can be used for testing the service:  * Binary SHA1: `ff9790d7902fea4c910b182f6e0b00221a40d616`   * Can be used for `file_hash` parameters. * Procedure RVA: `0x1000`   * Use with the above SHA1 for `proc_rva` parameters.   # noqa: E501

    OpenAPI spec version: 1
    Contact: support@cythereal.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re  # noqa: F401

import six

from cythereal_magic.models.address import Address  # noqa: F401,E501
from cythereal_magic.models.procedure_similarity_procedures import ProcedureSimilarityProcedures  # noqa: F401,E501
from cythereal_magic.models.sha1 import SHA1  # noqa: F401,E501


class ProcedureSimilarity(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 = {
        'sha1': 'SHA1',
        'rva': 'Address',
        'similarity_method': 'str',
        'procedures': 'list[ProcedureSimilarityProcedures]'
    }

    attribute_map = {
        'sha1': 'sha1',
        'rva': 'rva',
        'similarity_method': 'similarity_method',
        'procedures': 'procedures'
    }

    def __init__(self, sha1=None, rva=None, similarity_method=None, procedures=None):  # noqa: E501
        """ProcedureSimilarity - a model defined in Swagger"""  # noqa: E501

        self._sha1 = None
        self._rva = None
        self._similarity_method = None
        self._procedures = None
        self.discriminator = None

        if sha1 is not None:
            self.sha1 = sha1
        if rva is not None:
            self.rva = rva
        if similarity_method is not None:
            self.similarity_method = similarity_method
        if procedures is not None:
            self.procedures = procedures

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


        :return: The sha1 of this ProcedureSimilarity.  # noqa: E501
        :rtype: SHA1
        """
        return self._sha1

    @sha1.setter
    def sha1(self, sha1):
        """Sets the sha1 of this ProcedureSimilarity.


        :param sha1: The sha1 of this ProcedureSimilarity.  # noqa: E501
        :type: SHA1
        """

        self._sha1 = sha1

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


        :return: The rva of this ProcedureSimilarity.  # noqa: E501
        :rtype: Address
        """
        return self._rva

    @rva.setter
    def rva(self, rva):
        """Sets the rva of this ProcedureSimilarity.


        :param rva: The rva of this ProcedureSimilarity.  # noqa: E501
        :type: Address
        """

        self._rva = rva

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

        Method used to determine this procedure was similar with the query procedure.  Possible values are  - `semantic_hash` Hashes based on the semantics of the procedures matches.   # noqa: E501

        :return: The similarity_method of this ProcedureSimilarity.  # noqa: E501
        :rtype: str
        """
        return self._similarity_method

    @similarity_method.setter
    def similarity_method(self, similarity_method):
        """Sets the similarity_method of this ProcedureSimilarity.

        Method used to determine this procedure was similar with the query procedure.  Possible values are  - `semantic_hash` Hashes based on the semantics of the procedures matches.   # noqa: E501

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

        self._similarity_method = similarity_method

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

        List of procedures found to be similar with the query procedure.  # noqa: E501

        :return: The procedures of this ProcedureSimilarity.  # noqa: E501
        :rtype: list[ProcedureSimilarityProcedures]
        """
        return self._procedures

    @procedures.setter
    def procedures(self, procedures):
        """Sets the procedures of this ProcedureSimilarity.

        List of procedures found to be similar with the query procedure.  # noqa: E501

        :param procedures: The procedures of this ProcedureSimilarity.  # noqa: E501
        :type: list[ProcedureSimilarityProcedures]
        """

        self._procedures = procedures

    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

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

        return self.__dict__ == other.__dict__

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