<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/kms/v1/resources.proto

namespace Google\Cloud\Kms\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Contains an HSM-generated attestation about a key operation. For more
 * information, see [Verifying attestations]
 * (https://cloud.google.com/kms/docs/attest-key).
 *
 * Generated from protobuf message <code>google.cloud.kms.v1.KeyOperationAttestation</code>
 */
class KeyOperationAttestation extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The format of the attestation data.
     *
     * Generated from protobuf field <code>.google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat format = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $format = 0;
    /**
     * Output only. The attestation data provided by the HSM when the key
     * operation was performed.
     *
     * Generated from protobuf field <code>bytes content = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $content = '';
    /**
     * Output only. The certificate chains needed to validate the attestation
     *
     * Generated from protobuf field <code>.google.cloud.kms.v1.KeyOperationAttestation.CertificateChains cert_chains = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $cert_chains = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $format
     *           Output only. The format of the attestation data.
     *     @type string $content
     *           Output only. The attestation data provided by the HSM when the key
     *           operation was performed.
     *     @type \Google\Cloud\Kms\V1\KeyOperationAttestation\CertificateChains $cert_chains
     *           Output only. The certificate chains needed to validate the attestation
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Kms\V1\Resources::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. The format of the attestation data.
     *
     * Generated from protobuf field <code>.google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat format = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getFormat()
    {
        return $this->format;
    }

    /**
     * Output only. The format of the attestation data.
     *
     * Generated from protobuf field <code>.google.cloud.kms.v1.KeyOperationAttestation.AttestationFormat format = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setFormat($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Kms\V1\KeyOperationAttestation\AttestationFormat::class);
        $this->format = $var;

        return $this;
    }

    /**
     * Output only. The attestation data provided by the HSM when the key
     * operation was performed.
     *
     * Generated from protobuf field <code>bytes content = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getContent()
    {
        return $this->content;
    }

    /**
     * Output only. The attestation data provided by the HSM when the key
     * operation was performed.
     *
     * Generated from protobuf field <code>bytes content = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setContent($var)
    {
        GPBUtil::checkString($var, False);
        $this->content = $var;

        return $this;
    }

    /**
     * Output only. The certificate chains needed to validate the attestation
     *
     * Generated from protobuf field <code>.google.cloud.kms.v1.KeyOperationAttestation.CertificateChains cert_chains = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Cloud\Kms\V1\KeyOperationAttestation\CertificateChains|null
     */
    public function getCertChains()
    {
        return $this->cert_chains;
    }

    public function hasCertChains()
    {
        return isset($this->cert_chains);
    }

    public function clearCertChains()
    {
        unset($this->cert_chains);
    }

    /**
     * Output only. The certificate chains needed to validate the attestation
     *
     * Generated from protobuf field <code>.google.cloud.kms.v1.KeyOperationAttestation.CertificateChains cert_chains = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Cloud\Kms\V1\KeyOperationAttestation\CertificateChains $var
     * @return $this
     */
    public function setCertChains($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Kms\V1\KeyOperationAttestation\CertificateChains::class);
        $this->cert_chains = $var;

        return $this;
    }

}

