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

namespace Google\Cloud\RecaptchaEnterprise\V1;

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

/**
 * The retrieve legacy secret key request message.
 *
 * Generated from protobuf message <code>google.cloud.recaptchaenterprise.v1.RetrieveLegacySecretKeyRequest</code>
 */
class RetrieveLegacySecretKeyRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The public key name linked to the requested secret key in the
     * format `projects/{project}/keys/{key}`.
     *
     * Generated from protobuf field <code>string key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $key = '';

    /**
     * @param string $key Required. The public key name linked to the requested secret key in the
     *                    format `projects/{project}/keys/{key}`. Please see
     *                    {@see RecaptchaEnterpriseServiceClient::keyName()} for help formatting this field.
     *
     * @return \Google\Cloud\RecaptchaEnterprise\V1\RetrieveLegacySecretKeyRequest
     *
     * @experimental
     */
    public static function build(string $key): self
    {
        return (new self())
            ->setKey($key);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $key
     *           Required. The public key name linked to the requested secret key in the
     *           format `projects/{project}/keys/{key}`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The public key name linked to the requested secret key in the
     * format `projects/{project}/keys/{key}`.
     *
     * Generated from protobuf field <code>string key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getKey()
    {
        return $this->key;
    }

    /**
     * Required. The public key name linked to the requested secret key in the
     * format `projects/{project}/keys/{key}`.
     *
     * Generated from protobuf field <code>string key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setKey($var)
    {
        GPBUtil::checkString($var, True);
        $this->key = $var;

        return $this;
    }

}

© 2026 Bruce Wells
Search Namespaces \ Classes
Configuration