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

namespace Google\Cloud\ConfidentialComputing\V1;

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

/**
 * A Challenge from the server used to guarantee freshness of attestations
 *
 * Generated from protobuf message <code>google.cloud.confidentialcomputing.v1.Challenge</code>
 */
class Challenge extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The resource name for this Challenge in the format
     * `projects/&#42;&#47;locations/&#42;&#47;challenges/&#42;`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $name = '';
    /**
     * Output only. The time at which this Challenge was created
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $create_time = null;
    /**
     * Output only. The time at which this Challenge will no longer be usable. It
     * is also the expiration time for any tokens generated from this Challenge.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp expire_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $expire_time = null;
    /**
     * Output only. Indicates if this challenge has been used to generate a token.
     *
     * Generated from protobuf field <code>bool used = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $used = false;
    /**
     * Output only. Identical to nonce, but as a string.
     *
     * Generated from protobuf field <code>string tpm_nonce = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $tpm_nonce = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Output only. The resource name for this Challenge in the format
     *           `projects/&#42;&#47;locations/&#42;&#47;challenges/&#42;`
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. The time at which this Challenge was created
     *     @type \Google\Protobuf\Timestamp $expire_time
     *           Output only. The time at which this Challenge will no longer be usable. It
     *           is also the expiration time for any tokens generated from this Challenge.
     *     @type bool $used
     *           Output only. Indicates if this challenge has been used to generate a token.
     *     @type string $tpm_nonce
     *           Output only. Identical to nonce, but as a string.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Confidentialcomputing\V1\Service::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. The resource name for this Challenge in the format
     * `projects/&#42;&#47;locations/&#42;&#47;challenges/&#42;`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Output only. The resource name for this Challenge in the format
     * `projects/&#42;&#47;locations/&#42;&#47;challenges/&#42;`
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Output only. The time at which this Challenge was created
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    public function hasCreateTime()
    {
        return isset($this->create_time);
    }

    public function clearCreateTime()
    {
        unset($this->create_time);
    }

    /**
     * Output only. The time at which this Challenge was created
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->create_time = $var;

        return $this;
    }

    /**
     * Output only. The time at which this Challenge will no longer be usable. It
     * is also the expiration time for any tokens generated from this Challenge.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp expire_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getExpireTime()
    {
        return $this->expire_time;
    }

    public function hasExpireTime()
    {
        return isset($this->expire_time);
    }

    public function clearExpireTime()
    {
        unset($this->expire_time);
    }

    /**
     * Output only. The time at which this Challenge will no longer be usable. It
     * is also the expiration time for any tokens generated from this Challenge.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp expire_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setExpireTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->expire_time = $var;

        return $this;
    }

    /**
     * Output only. Indicates if this challenge has been used to generate a token.
     *
     * Generated from protobuf field <code>bool used = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return bool
     */
    public function getUsed()
    {
        return $this->used;
    }

    /**
     * Output only. Indicates if this challenge has been used to generate a token.
     *
     * Generated from protobuf field <code>bool used = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param bool $var
     * @return $this
     */
    public function setUsed($var)
    {
        GPBUtil::checkBool($var);
        $this->used = $var;

        return $this;
    }

    /**
     * Output only. Identical to nonce, but as a string.
     *
     * Generated from protobuf field <code>string tpm_nonce = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getTpmNonce()
    {
        return $this->tpm_nonce;
    }

    /**
     * Output only. Identical to nonce, but as a string.
     *
     * Generated from protobuf field <code>string tpm_nonce = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setTpmNonce($var)
    {
        GPBUtil::checkString($var, True);
        $this->tpm_nonce = $var;

        return $this;
    }

}

