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

namespace Google\Cloud\AppEngine\V1;

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

/**
 * Request message for `Firewall.CreateIngressRule`.
 *
 * Generated from protobuf message <code>google.appengine.v1.CreateIngressRuleRequest</code>
 */
class CreateIngressRuleRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Name of the parent Firewall collection in which to create a new rule.
     * Example: `apps/myapp/firewall/ingressRules`.
     *
     * Generated from protobuf field <code>string parent = 1;</code>
     */
    private $parent = '';
    /**
     * A FirewallRule containing the new resource.
     * The user may optionally provide a position at which the new rule will be
     * placed. The positions define a sequential list starting at 1. If a rule
     * already exists at the given position, rules greater than the provided
     * position will be moved forward by one.
     * If no position is provided, the server will place the rule as the second to
     * last rule in the sequence before the required default allow-all or deny-all
     * rule.
     *
     * Generated from protobuf field <code>.google.appengine.v1.FirewallRule rule = 2;</code>
     */
    private $rule = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Name of the parent Firewall collection in which to create a new rule.
     *           Example: `apps/myapp/firewall/ingressRules`.
     *     @type \Google\Cloud\AppEngine\V1\FirewallRule $rule
     *           A FirewallRule containing the new resource.
     *           The user may optionally provide a position at which the new rule will be
     *           placed. The positions define a sequential list starting at 1. If a rule
     *           already exists at the given position, rules greater than the provided
     *           position will be moved forward by one.
     *           If no position is provided, the server will place the rule as the second to
     *           last rule in the sequence before the required default allow-all or deny-all
     *           rule.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Appengine\V1\Appengine::initOnce();
        parent::__construct($data);
    }

    /**
     * Name of the parent Firewall collection in which to create a new rule.
     * Example: `apps/myapp/firewall/ingressRules`.
     *
     * Generated from protobuf field <code>string parent = 1;</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Name of the parent Firewall collection in which to create a new rule.
     * Example: `apps/myapp/firewall/ingressRules`.
     *
     * Generated from protobuf field <code>string parent = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setParent($var)
    {
        GPBUtil::checkString($var, True);
        $this->parent = $var;

        return $this;
    }

    /**
     * A FirewallRule containing the new resource.
     * The user may optionally provide a position at which the new rule will be
     * placed. The positions define a sequential list starting at 1. If a rule
     * already exists at the given position, rules greater than the provided
     * position will be moved forward by one.
     * If no position is provided, the server will place the rule as the second to
     * last rule in the sequence before the required default allow-all or deny-all
     * rule.
     *
     * Generated from protobuf field <code>.google.appengine.v1.FirewallRule rule = 2;</code>
     * @return \Google\Cloud\AppEngine\V1\FirewallRule|null
     */
    public function getRule()
    {
        return $this->rule;
    }

    public function hasRule()
    {
        return isset($this->rule);
    }

    public function clearRule()
    {
        unset($this->rule);
    }

    /**
     * A FirewallRule containing the new resource.
     * The user may optionally provide a position at which the new rule will be
     * placed. The positions define a sequential list starting at 1. If a rule
     * already exists at the given position, rules greater than the provided
     * position will be moved forward by one.
     * If no position is provided, the server will place the rule as the second to
     * last rule in the sequence before the required default allow-all or deny-all
     * rule.
     *
     * Generated from protobuf field <code>.google.appengine.v1.FirewallRule rule = 2;</code>
     * @param \Google\Cloud\AppEngine\V1\FirewallRule $var
     * @return $this
     */
    public function setRule($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AppEngine\V1\FirewallRule::class);
        $this->rule = $var;

        return $this;
    }

}

