<?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\GPBUtil;
use Google\Protobuf\RepeatedField;

/**
 * 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;
    protected $token_type_options;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\ConfidentialComputing\V1\AwsPrincipalTagsOptions $aws_principal_tags_options
     *           Optional. Options for AWS token type.
     *     @type string $audience
     *           Optional. Optional string to issue the token with a custom audience claim.
     *           Required if one or more nonces are specified.
     *     @type string[] $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. Options for AWS token type.
     *
     * Generated from protobuf field <code>.google.cloud.confidentialcomputing.v1.AwsPrincipalTagsOptions aws_principal_tags_options = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\ConfidentialComputing\V1\AwsPrincipalTagsOptions|null
     */
    public function getAwsPrincipalTagsOptions()
    {
        return $this->readOneof(4);
    }

    public function hasAwsPrincipalTagsOptions()
    {
        return $this->hasOneof(4);
    }

    /**
     * Optional. Options for AWS token type.
     *
     * Generated from protobuf field <code>.google.cloud.confidentialcomputing.v1.AwsPrincipalTagsOptions aws_principal_tags_options = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\ConfidentialComputing\V1\AwsPrincipalTagsOptions $var
     * @return $this
     */
    public function setAwsPrincipalTagsOptions($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\ConfidentialComputing\V1\AwsPrincipalTagsOptions::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * 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 RepeatedField<string>
     */
    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 string[] $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;
    }

    /**
     * @return string
     */
    public function getTokenTypeOptions()
    {
        return $this->whichOneof("token_type_options");
    }

}

