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

/**
 * A key used to identify and configure applications (web and/or mobile) that
 * use reCAPTCHA Enterprise.
 *
 * Generated from protobuf message <code>google.cloud.recaptchaenterprise.v1.Key</code>
 */
class Key extends \Google\Protobuf\Internal\Message
{
    /**
     * Identifier. The resource name for the Key in the format
     * `projects/{project}/keys/{key}`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     */
    private $name = '';
    /**
     * Required. Human-readable display name of this key. Modifiable by user.
     *
     * Generated from protobuf field <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $display_name = '';
    /**
     * Optional. See [Creating and managing labels]
     * (https://cloud.google.com/recaptcha/docs/labels).
     *
     * Generated from protobuf field <code>map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $labels;
    /**
     * Output only. The timestamp corresponding to the creation of this key.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $create_time = null;
    /**
     * Optional. Options for user acceptance testing.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.TestingOptions testing_options = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $testing_options = null;
    /**
     * Optional. Settings for WAF
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.WafSettings waf_settings = 10 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $waf_settings = null;
    protected $platform_settings;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Identifier. The resource name for the Key in the format
     *           `projects/{project}/keys/{key}`.
     *     @type string $display_name
     *           Required. Human-readable display name of this key. Modifiable by user.
     *     @type \Google\Cloud\RecaptchaEnterprise\V1\WebKeySettings $web_settings
     *           Settings for keys that can be used by websites.
     *     @type \Google\Cloud\RecaptchaEnterprise\V1\AndroidKeySettings $android_settings
     *           Settings for keys that can be used by Android apps.
     *     @type \Google\Cloud\RecaptchaEnterprise\V1\IOSKeySettings $ios_settings
     *           Settings for keys that can be used by iOS apps.
     *     @type \Google\Cloud\RecaptchaEnterprise\V1\ExpressKeySettings $express_settings
     *           Settings for keys that can be used by reCAPTCHA Express.
     *     @type array|\Google\Protobuf\Internal\MapField $labels
     *           Optional. See [Creating and managing labels]
     *           (https://cloud.google.com/recaptcha/docs/labels).
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. The timestamp corresponding to the creation of this key.
     *     @type \Google\Cloud\RecaptchaEnterprise\V1\TestingOptions $testing_options
     *           Optional. Options for user acceptance testing.
     *     @type \Google\Cloud\RecaptchaEnterprise\V1\WafSettings $waf_settings
     *           Optional. Settings for WAF
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce();
        parent::__construct($data);
    }

    /**
     * Identifier. The resource name for the Key in the format
     * `projects/{project}/keys/{key}`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Identifier. The resource name for the Key in the format
     * `projects/{project}/keys/{key}`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Required. Human-readable display name of this key. Modifiable by user.
     *
     * Generated from protobuf field <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getDisplayName()
    {
        return $this->display_name;
    }

    /**
     * Required. Human-readable display name of this key. Modifiable by user.
     *
     * Generated from protobuf field <code>string display_name = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setDisplayName($var)
    {
        GPBUtil::checkString($var, True);
        $this->display_name = $var;

        return $this;
    }

    /**
     * Settings for keys that can be used by websites.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.WebKeySettings web_settings = 3;</code>
     * @return \Google\Cloud\RecaptchaEnterprise\V1\WebKeySettings|null
     */
    public function getWebSettings()
    {
        return $this->readOneof(3);
    }

    public function hasWebSettings()
    {
        return $this->hasOneof(3);
    }

    /**
     * Settings for keys that can be used by websites.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.WebKeySettings web_settings = 3;</code>
     * @param \Google\Cloud\RecaptchaEnterprise\V1\WebKeySettings $var
     * @return $this
     */
    public function setWebSettings($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\WebKeySettings::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Settings for keys that can be used by Android apps.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.AndroidKeySettings android_settings = 4;</code>
     * @return \Google\Cloud\RecaptchaEnterprise\V1\AndroidKeySettings|null
     */
    public function getAndroidSettings()
    {
        return $this->readOneof(4);
    }

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

    /**
     * Settings for keys that can be used by Android apps.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.AndroidKeySettings android_settings = 4;</code>
     * @param \Google\Cloud\RecaptchaEnterprise\V1\AndroidKeySettings $var
     * @return $this
     */
    public function setAndroidSettings($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\AndroidKeySettings::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * Settings for keys that can be used by iOS apps.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.IOSKeySettings ios_settings = 5;</code>
     * @return \Google\Cloud\RecaptchaEnterprise\V1\IOSKeySettings|null
     */
    public function getIosSettings()
    {
        return $this->readOneof(5);
    }

    public function hasIosSettings()
    {
        return $this->hasOneof(5);
    }

    /**
     * Settings for keys that can be used by iOS apps.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.IOSKeySettings ios_settings = 5;</code>
     * @param \Google\Cloud\RecaptchaEnterprise\V1\IOSKeySettings $var
     * @return $this
     */
    public function setIosSettings($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\IOSKeySettings::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * Settings for keys that can be used by reCAPTCHA Express.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.ExpressKeySettings express_settings = 11;</code>
     * @return \Google\Cloud\RecaptchaEnterprise\V1\ExpressKeySettings|null
     */
    public function getExpressSettings()
    {
        return $this->readOneof(11);
    }

    public function hasExpressSettings()
    {
        return $this->hasOneof(11);
    }

    /**
     * Settings for keys that can be used by reCAPTCHA Express.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.ExpressKeySettings express_settings = 11;</code>
     * @param \Google\Cloud\RecaptchaEnterprise\V1\ExpressKeySettings $var
     * @return $this
     */
    public function setExpressSettings($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\ExpressKeySettings::class);
        $this->writeOneof(11, $var);

        return $this;
    }

    /**
     * Optional. See [Creating and managing labels]
     * (https://cloud.google.com/recaptcha/docs/labels).
     *
     * Generated from protobuf field <code>map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getLabels()
    {
        return $this->labels;
    }

    /**
     * Optional. See [Creating and managing labels]
     * (https://cloud.google.com/recaptcha/docs/labels).
     *
     * Generated from protobuf field <code>map<string, string> labels = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setLabels($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->labels = $arr;

        return $this;
    }

    /**
     * Output only. The timestamp corresponding to the creation of this key.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 7 [(.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 timestamp corresponding to the creation of this key.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 7 [(.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;
    }

    /**
     * Optional. Options for user acceptance testing.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.TestingOptions testing_options = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\RecaptchaEnterprise\V1\TestingOptions|null
     */
    public function getTestingOptions()
    {
        return $this->testing_options;
    }

    public function hasTestingOptions()
    {
        return isset($this->testing_options);
    }

    public function clearTestingOptions()
    {
        unset($this->testing_options);
    }

    /**
     * Optional. Options for user acceptance testing.
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.TestingOptions testing_options = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\RecaptchaEnterprise\V1\TestingOptions $var
     * @return $this
     */
    public function setTestingOptions($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\TestingOptions::class);
        $this->testing_options = $var;

        return $this;
    }

    /**
     * Optional. Settings for WAF
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.WafSettings waf_settings = 10 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\RecaptchaEnterprise\V1\WafSettings|null
     */
    public function getWafSettings()
    {
        return $this->waf_settings;
    }

    public function hasWafSettings()
    {
        return isset($this->waf_settings);
    }

    public function clearWafSettings()
    {
        unset($this->waf_settings);
    }

    /**
     * Optional. Settings for WAF
     *
     * Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.WafSettings waf_settings = 10 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\RecaptchaEnterprise\V1\WafSettings $var
     * @return $this
     */
    public function setWafSettings($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\WafSettings::class);
        $this->waf_settings = $var;

        return $this;
    }

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

}

