<?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 create firewall policy request message.
*
* Generated from protobuf message <code>google.cloud.recaptchaenterprise.v1.CreateFirewallPolicyRequest</code>
*/
class CreateFirewallPolicyRequest extends \Google\Protobuf\Internal\Message
{
/**
* Required. The name of the project this policy applies to, in the format
* `projects/{project}`.
*
* Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
*/
protected $parent = '';
/**
* Required. Information to create the policy.
*
* Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.FirewallPolicy firewall_policy = 2 [(.google.api.field_behavior) = REQUIRED];</code>
*/
protected $firewall_policy = null;
/**
* @param string $parent Required. The name of the project this policy applies to, in the format
* `projects/{project}`. Please see
* {@see RecaptchaEnterpriseServiceClient::projectName()} for help formatting this field.
* @param \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy $firewallPolicy Required. Information to create the policy.
*
* @return \Google\Cloud\RecaptchaEnterprise\V1\CreateFirewallPolicyRequest
*
* @experimental
*/
public static function build(string $parent, \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy $firewallPolicy): self
{
return (new self())
->setParent($parent)
->setFirewallPolicy($firewallPolicy);
}
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type string $parent
* Required. The name of the project this policy applies to, in the format
* `projects/{project}`.
* @type \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy $firewall_policy
* Required. Information to create the policy.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce();
parent::__construct($data);
}
/**
* Required. The name of the project this policy applies to, in the format
* `projects/{project}`.
*
* Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
* @return string
*/
public function getParent()
{
return $this->parent;
}
/**
* Required. The name of the project this policy applies to, in the format
* `projects/{project}`.
*
* Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
* @param string $var
* @return $this
*/
public function setParent($var)
{
GPBUtil::checkString($var, True);
$this->parent = $var;
return $this;
}
/**
* Required. Information to create the policy.
*
* Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.FirewallPolicy firewall_policy = 2 [(.google.api.field_behavior) = REQUIRED];</code>
* @return \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy|null
*/
public function getFirewallPolicy()
{
return $this->firewall_policy;
}
public function hasFirewallPolicy()
{
return isset($this->firewall_policy);
}
public function clearFirewallPolicy()
{
unset($this->firewall_policy);
}
/**
* Required. Information to create the policy.
*
* Generated from protobuf field <code>.google.cloud.recaptchaenterprise.v1.FirewallPolicy firewall_policy = 2 [(.google.api.field_behavior) = REQUIRED];</code>
* @param \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy $var
* @return $this
*/
public function setFirewallPolicy($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\RecaptchaEnterprise\V1\FirewallPolicy::class);
$this->firewall_policy = $var;
return $this;
}
}