From 3263c71ffb60cfeee0bcf0054138b22f658b99dd Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 10 Nov 2023 07:21:33 -0800 Subject: [PATCH] feat: Add a new field `token_type` to `TokenOptions` message proto (#6783) chore: remove backend configuration from the service config PiperOrigin-RevId: 581042395 Source-Link: https://github.com/googleapis/googleapis/commit/2a4cbb9766ba13cd435d47ac91af4138d4821d22 Source-Link: https://github.com/googleapis/googleapis-gen/commit/a8d92b254cf89d1c310ae58167fdd1fd3d1d4d03 Copy-Tag: eyJwIjoiQ29uZmlkZW50aWFsQ29tcHV0aW5nLy5Pd2xCb3QueWFtbCIsImgiOiJhOGQ5MmIyNTRjZjg5ZDFjMzEwYWU1ODE2N2ZkZDFmZDNkMWQ0ZDAzIn0= --- ConfidentialComputing/metadata/V1/Service.php | Bin 4073 -> 4211 bytes ConfidentialComputing/src/V1/TokenOptions.php | 34 +++++++++++ ConfidentialComputing/src/V1/TokenType.php | 55 ++++++++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 ConfidentialComputing/src/V1/TokenType.php diff --git a/ConfidentialComputing/metadata/V1/Service.php b/ConfidentialComputing/metadata/V1/Service.php index 8e229f79931034e80ef449b9a8c7a93e1210b6c0..d4d7baf396e80ceb417392cb33e5284712092cf4 100644 GIT binary patch delta 135 zcmaDU|5;&!BQwhjNiO4w-o~3Nm|wCmwJ=Uj;;repeated string nonce = 2 [(.google.api.field_behavior) = OPTIONAL]; */ private $nonce; + /** + * Optional. Optional token type to select what type of token to return. + * + * Generated from protobuf field .google.cloud.confidentialcomputing.v1.TokenType token_type = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $token_type = 0; /** * Constructor. @@ -44,6 +50,8 @@ class TokenOptions extends \Google\Protobuf\Internal\Message * 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) { @@ -109,5 +117,31 @@ public function setNonce($var) return $this; } + /** + * Optional. Optional token type to select what type of token to return. + * + * Generated from protobuf field .google.cloud.confidentialcomputing.v1.TokenType token_type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @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 .google.cloud.confidentialcomputing.v1.TokenType token_type = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setTokenType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\ConfidentialComputing\V1\TokenType::class); + $this->token_type = $var; + + return $this; + } + } diff --git a/ConfidentialComputing/src/V1/TokenType.php b/ConfidentialComputing/src/V1/TokenType.php new file mode 100644 index 000000000000..002e1eff8c37 --- /dev/null +++ b/ConfidentialComputing/src/V1/TokenType.php @@ -0,0 +1,55 @@ +google.cloud.confidentialcomputing.v1.TokenType + */ +class TokenType +{ + /** + * Unspecified token type + * + * Generated from protobuf enum TOKEN_TYPE_UNSPECIFIED = 0; + */ + const TOKEN_TYPE_UNSPECIFIED = 0; + /** + * OpenID Connect (OIDC) token type + * + * Generated from protobuf enum TOKEN_TYPE_OIDC = 1; + */ + const TOKEN_TYPE_OIDC = 1; + + private static $valueToName = [ + self::TOKEN_TYPE_UNSPECIFIED => 'TOKEN_TYPE_UNSPECIFIED', + self::TOKEN_TYPE_OIDC => 'TOKEN_TYPE_OIDC', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} +