<?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 FirewallPolicy represents a single matching pattern and resulting actions
 * to take.
 *
 * Generated from protobuf message <code>google.cloud.recaptchaenterprise.v1.FirewallPolicy</code>
 */
class FirewallPolicy extends \Google\Protobuf\Internal\Message
{
    /**
     * Identifier. The resource name for the FirewallPolicy in the format
     * `projects/{project}/firewallpolicies/{firewallpolicy}`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     */
    private $name = '';
    /**
     * Optional. A description of what this policy aims to achieve, for
     * convenience purposes. The description can at most include 256 UTF-8
     * characters.
     *
     * Generated from protobuf field <code>string description = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $description = '';
    /**
     * Optional. The path for which this policy applies, specified as a glob
     * pattern. For more information on glob, see the [manual
     * page](https://man7.org/linux/man-pages/man7/glob.7.html).
     * A path has a max length of 200 characters.
     *
     * Generated from protobuf field <code>string path = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $path = '';
    /**
     * Optional. A CEL (Common Expression Language) conditional expression that
     * specifies if this policy applies to an incoming user request. If this
     * condition evaluates to true and the requested path matched the path
     * pattern, the associated actions should be executed by the caller. The
     * condition string is checked for CEL syntax correctness on creation. For
     * more information, see the [CEL spec](https://github.com/google/cel-spec)
     * and its [language
     * definition](https://github.com/google/cel-spec/blob/master/doc/langdef.md).
     * A condition has a max length of 500 characters.
     *
     * Generated from protobuf field <code>string condition = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $condition = '';
    /**
     * Optional. The actions that the caller should take regarding user access.
     * There should be at most one terminal action. A terminal action is any
     * action that forces a response, such as `AllowAction`,
     * `BlockAction` or `SubstituteAction`.
     * Zero or more non-terminal actions such as `SetHeader` might be
     * specified. A single policy can contain up to 16 actions.
     *
     * Generated from protobuf field <code>repeated .google.cloud.recaptchaenterprise.v1.FirewallAction actions = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $actions;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Identifier. The resource name for the FirewallPolicy in the format
     *           `projects/{project}/firewallpolicies/{firewallpolicy}`.
     *     @type string $description
     *           Optional. A description of what this policy aims to achieve, for
     *           convenience purposes. The description can at most include 256 UTF-8
     *           characters.
     *     @type string $path
     *           Optional. The path for which this policy applies, specified as a glob
     *           pattern. For more information on glob, see the [manual
     *           page](https://man7.org/linux/man-pages/man7/glob.7.html).
     *           A path has a max length of 200 characters.
     *     @type string $condition
     *           Optional. A CEL (Common Expression Language) conditional expression that
     *           specifies if this policy applies to an incoming user request. If this
     *           condition evaluates to true and the requested path matched the path
     *           pattern, the associated actions should be executed by the caller. The
     *           condition string is checked for CEL syntax correctness on creation. For
     *           more information, see the [CEL spec](https://github.com/google/cel-spec)
     *           and its [language
     *           definition](https://github.com/google/cel-spec/blob/master/doc/langdef.md).
     *           A condition has a max length of 500 characters.
     *     @type array<\Google\Cloud\RecaptchaEnterprise\V1\FirewallAction>|\Google\Protobuf\Internal\RepeatedField $actions
     *           Optional. The actions that the caller should take regarding user access.
     *           There should be at most one terminal action. A terminal action is any
     *           action that forces a response, such as `AllowAction`,
     *           `BlockAction` or `SubstituteAction`.
     *           Zero or more non-terminal actions such as `SetHeader` might be
     *           specified. A single policy can contain up to 16 actions.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce();
        parent::__construct($data);
    }

    /**
     * Identifier. The resource name for the FirewallPolicy in the format
     * `projects/{project}/firewallpolicies/{firewallpolicy}`.
     *
     * 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 FirewallPolicy in the format
     * `projects/{project}/firewallpolicies/{firewallpolicy}`.
     *
     * 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;
    }

    /**
     * Optional. A description of what this policy aims to achieve, for
     * convenience purposes. The description can at most include 256 UTF-8
     * characters.
     *
     * Generated from protobuf field <code>string description = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Optional. A description of what this policy aims to achieve, for
     * convenience purposes. The description can at most include 256 UTF-8
     * characters.
     *
     * Generated from protobuf field <code>string description = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

    /**
     * Optional. The path for which this policy applies, specified as a glob
     * pattern. For more information on glob, see the [manual
     * page](https://man7.org/linux/man-pages/man7/glob.7.html).
     * A path has a max length of 200 characters.
     *
     * Generated from protobuf field <code>string path = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getPath()
    {
        return $this->path;
    }

    /**
     * Optional. The path for which this policy applies, specified as a glob
     * pattern. For more information on glob, see the [manual
     * page](https://man7.org/linux/man-pages/man7/glob.7.html).
     * A path has a max length of 200 characters.
     *
     * Generated from protobuf field <code>string path = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setPath($var)
    {
        GPBUtil::checkString($var, True);
        $this->path = $var;

        return $this;
    }

    /**
     * Optional. A CEL (Common Expression Language) conditional expression that
     * specifies if this policy applies to an incoming user request. If this
     * condition evaluates to true and the requested path matched the path
     * pattern, the associated actions should be executed by the caller. The
     * condition string is checked for CEL syntax correctness on creation. For
     * more information, see the [CEL spec](https://github.com/google/cel-spec)
     * and its [language
     * definition](https://github.com/google/cel-spec/blob/master/doc/langdef.md).
     * A condition has a max length of 500 characters.
     *
     * Generated from protobuf field <code>string condition = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getCondition()
    {
        return $this->condition;
    }

    /**
     * Optional. A CEL (Common Expression Language) conditional expression that
     * specifies if this policy applies to an incoming user request. If this
     * condition evaluates to true and the requested path matched the path
     * pattern, the associated actions should be executed by the caller. The
     * condition string is checked for CEL syntax correctness on creation. For
     * more information, see the [CEL spec](https://github.com/google/cel-spec)
     * and its [language
     * definition](https://github.com/google/cel-spec/blob/master/doc/langdef.md).
     * A condition has a max length of 500 characters.
     *
     * Generated from protobuf field <code>string condition = 5 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setCondition($var)
    {
        GPBUtil::checkString($var, True);
        $this->condition = $var;

        return $this;
    }

    /**
     * Optional. The actions that the caller should take regarding user access.
     * There should be at most one terminal action. A terminal action is any
     * action that forces a response, such as `AllowAction`,
     * `BlockAction` or `SubstituteAction`.
     * Zero or more non-terminal actions such as `SetHeader` might be
     * specified. A single policy can contain up to 16 actions.
     *
     * Generated from protobuf field <code>repeated .google.cloud.recaptchaenterprise.v1.FirewallAction actions = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getActions()
    {
        return $this->actions;
    }

    /**
     * Optional. The actions that the caller should take regarding user access.
     * There should be at most one terminal action. A terminal action is any
     * action that forces a response, such as `AllowAction`,
     * `BlockAction` or `SubstituteAction`.
     * Zero or more non-terminal actions such as `SetHeader` might be
     * specified. A single policy can contain up to 16 actions.
     *
     * Generated from protobuf field <code>repeated .google.cloud.recaptchaenterprise.v1.FirewallAction actions = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array<\Google\Cloud\RecaptchaEnterprise\V1\FirewallAction>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setActions($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\RecaptchaEnterprise\V1\FirewallAction::class);
        $this->actions = $arr;

        return $this;
    }

}

