# coding: utf-8

"""
    Grafeas API

    An API to insert and retrieve annotations on cloud artifacts.

    OpenAPI spec version: 0.1
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
"""

from pprint import pformat
from six import iteritems
import re


class PgpSignedAttestation(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """
    def __init__(self, signature=None, content_type=None, pgp_key_id=None):
        """
        PgpSignedAttestation - 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 = {
            'signature': 'str',
            'content_type': 'str',
            'pgp_key_id': 'str'
        }

        self.attribute_map = {
            'signature': 'signature',
            'content_type': 'contentType',
            'pgp_key_id': 'pgpKeyId'
        }

        self._signature = signature
        self._content_type = content_type
        self._pgp_key_id = pgp_key_id

    @property
    def signature(self):
        """
        Gets the signature of this PgpSignedAttestation.
        The raw content of the signature, as output by gpg or equivalent.  Since this message only supports attached signatures, the payload that was signed must be attached. While the signature format supported is dependent on the verification implementation, currently only ASCII-armored (`--armor` to gpg), non-clearsigned (`--sign` rather than `--clearsign` to gpg) are supported. Concretely, `gpg --sign --armor --output=signature.gpg payload.json` will create the signature content expected in this field in `signature.gpg` for the `payload.json` attestation payload.

        :return: The signature of this PgpSignedAttestation.
        :rtype: str
        """
        return self._signature

    @signature.setter
    def signature(self, signature):
        """
        Sets the signature of this PgpSignedAttestation.
        The raw content of the signature, as output by gpg or equivalent.  Since this message only supports attached signatures, the payload that was signed must be attached. While the signature format supported is dependent on the verification implementation, currently only ASCII-armored (`--armor` to gpg), non-clearsigned (`--sign` rather than `--clearsign` to gpg) are supported. Concretely, `gpg --sign --armor --output=signature.gpg payload.json` will create the signature content expected in this field in `signature.gpg` for the `payload.json` attestation payload.

        :param signature: The signature of this PgpSignedAttestation.
        :type: str
        """

        self._signature = signature

    @property
    def content_type(self):
        """
        Gets the content_type of this PgpSignedAttestation.
        Type (e.g. schema) of the attestation payload that was signed. The verifier must ensure that the provided type is one that the verifier supports, and that the attestation payload is a valid instantiation of that type (e.g. by validating a JSON schema).

        :return: The content_type of this PgpSignedAttestation.
        :rtype: str
        """
        return self._content_type

    @content_type.setter
    def content_type(self, content_type):
        """
        Sets the content_type of this PgpSignedAttestation.
        Type (e.g. schema) of the attestation payload that was signed. The verifier must ensure that the provided type is one that the verifier supports, and that the attestation payload is a valid instantiation of that type (e.g. by validating a JSON schema).

        :param content_type: The content_type of this PgpSignedAttestation.
        :type: str
        """
        allowed_values = ["UNSET", "SIMPLE_SIGNING_JSON"]
        if content_type not in allowed_values:
            raise ValueError(
                "Invalid value for `content_type` ({0}), must be one of {1}"
                .format(content_type, allowed_values)
            )

        self._content_type = content_type

    @property
    def pgp_key_id(self):
        """
        Gets the pgp_key_id of this PgpSignedAttestation.
        The ID of the key, as output by `gpg --list-keys`.  This should be 8 hexidecimal digits, capitalized.  e.g. $ gpg --list-keys pub 2048R/A663AEEA 2017-08-01 ui Fake Name <example-attesting-user@google.com> In the above example, the `key_id` is \"A663AEEA\". Note that in practice this ID is the last 64 bits of the key fingerprint.

        :return: The pgp_key_id of this PgpSignedAttestation.
        :rtype: str
        """
        return self._pgp_key_id

    @pgp_key_id.setter
    def pgp_key_id(self, pgp_key_id):
        """
        Sets the pgp_key_id of this PgpSignedAttestation.
        The ID of the key, as output by `gpg --list-keys`.  This should be 8 hexidecimal digits, capitalized.  e.g. $ gpg --list-keys pub 2048R/A663AEEA 2017-08-01 ui Fake Name <example-attesting-user@google.com> In the above example, the `key_id` is \"A663AEEA\". Note that in practice this ID is the last 64 bits of the key fingerprint.

        :param pgp_key_id: The pgp_key_id of this PgpSignedAttestation.
        :type: str
        """

        self._pgp_key_id = pgp_key_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`
        """
        return self.to_str()

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

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