<?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;

/**
 * Options to modify claims in the token to generate custom-purpose tokens.
 *
 * Generated from protobuf message <code>google.cloud.confidentialcomputing.v1.TokenOptions</code>
 */
class TokenOptions extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. Optional string to issue the token with a custom audience claim.
     * Required if one or more nonces are specified.
     *
     * Generated from protobuf field <code>string audience = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $audience = '';
    /**
     * Optional. Optional parameter to place one or more nonces in the eat_nonce
     * claim in the output token. The minimum size for JSON-encoded EATs is 10
     * bytes and the maximum size is 74 bytes.
     *
     * Generated from protobuf field <code>repeated string nonce = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $nonce;
    /**
     * Optional. Optional token type to select what type of token to return.
     *
     * Generated from protobuf field <code>.google.cloud.confidentialcomputing.v1.TokenType token_type = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $token_type = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $audience
     *           Optional. Optional string to issue the token with a custom audience claim.
     *           Required if one or more nonces are specified.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $nonce
     *           Optional. Optional parameter to place one or more nonces in the eat_nonce
     *           claim in the output token. The minimum size for JSON-encoded EATs is 10
     *           bytes and the maximum size is 74 bytes.
     *     @type int $token_type
     *           Optional. Optional token type to select what type of token to return.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Confidentialcomputing\V1\Service::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. Optional string to issue the token with a custom audience claim.
     * Required if one or more nonces are specified.
     *
     * Generated from protobuf field <code>string audience = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getAudience()
    {
        return $this->audience;
    }

    /**
     * Optional. Optional string to issue the token with a custom audience claim.
     * Required if one or more nonces are specified.
     *
     * Generated from protobuf field <code>string audience = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setAudience($var)
    {
        GPBUtil::checkString($var, True);
        $this->audience = $var;

        return $this;
    }

    /**
     * Optional. Optional parameter to place one or more nonces in the eat_nonce
     * claim in the output token. The minimum size for JSON-encoded EATs is 10
     * bytes and the maximum size is 74 bytes.
     *
     * Generated from protobuf field <code>repeated string nonce = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getNonce()
    {
        return $this->nonce;
    }

    /**
     * Optional. Optional parameter to place one or more nonces in the eat_nonce
     * claim in the output token. The minimum size for JSON-encoded EATs is 10
     * bytes and the maximum size is 74 bytes.
     *
     * Generated from protobuf field <code>repeated string nonce = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setNonce($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->nonce = $arr;

        return $this;
    }

    /**
     * Optional. Optional token type to select what type of token to return.
     *
     * Generated from protobuf field <code>.google.cloud.confidentialcomputing.v1.TokenType token_type = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return int
     */
    public function getTokenType()
    {
        return $this->token_type;
    }

    /**
     * Optional. Optional token type to select what type of token to return.
     *
     * Generated from protobuf field <code>.google.cloud.confidentialcomputing.v1.TokenType token_type = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param int $var
     * @return $this
     */
    public function setTokenType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\ConfidentialComputing\V1\TokenType::class);
        $this->token_type = $var;

        return $this;
    }

}

