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

namespace Google\Cloud\NetworkServices\V1;

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

/**
 * `LbEdgeExtension` is a resource that lets the extension service influence
 * the selection of backend services and Cloud CDN cache keys by modifying
 * request headers.
 *
 * Generated from protobuf message <code>google.cloud.networkservices.v1.LbEdgeExtension</code>
 */
class LbEdgeExtension extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Identifier. Name of the `LbEdgeExtension` resource in the
     * following format:
     * `projects/{project}/locations/{location}/lbEdgeExtensions/{lb_edge_extension}`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IDENTIFIER];</code>
     */
    protected $name = '';
    /**
     * Output only. The timestamp when the resource was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $create_time = null;
    /**
     * Output only. The timestamp when the resource was updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $update_time = null;
    /**
     * Optional. A human-readable description of the resource.
     *
     * Generated from protobuf field <code>string description = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $description = '';
    /**
     * Optional. Set of labels associated with the `LbEdgeExtension` resource.
     * The format must comply with [the requirements for
     * labels](https://cloud.google.com/compute/docs/labeling-resources#requirements)
     * for Google Cloud resources.
     *
     * Generated from protobuf field <code>map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $labels;
    /**
     * Required. A list of references to the forwarding rules to which this
     * service extension is attached. At least one forwarding rule is required.
     * Only one `LbEdgeExtension` resource can be associated with a forwarding
     * rule.
     *
     * Generated from protobuf field <code>repeated string forwarding_rules = 5 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $forwarding_rules;
    /**
     * Required. A set of ordered extension chains that contain the match
     * conditions and extensions to execute. Match conditions for each extension
     * chain are evaluated in sequence for a given request. The first extension
     * chain that has a condition that matches the request is executed.
     * Any subsequent extension chains do not execute.
     * Limited to 5 extension chains per resource.
     *
     * Generated from protobuf field <code>repeated .google.cloud.networkservices.v1.ExtensionChain extension_chains = 6 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $extension_chains;
    /**
     * Required. All forwarding rules referenced by this extension must
     * share the same load balancing scheme.
     * Supported values: `EXTERNAL_MANAGED`.
     *
     * Generated from protobuf field <code>.google.cloud.networkservices.v1.LoadBalancingScheme load_balancing_scheme = 7 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $load_balancing_scheme = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Required. Identifier. Name of the `LbEdgeExtension` resource in the
     *           following format:
     *           `projects/{project}/locations/{location}/lbEdgeExtensions/{lb_edge_extension}`.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. The timestamp when the resource was created.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           Output only. The timestamp when the resource was updated.
     *     @type string $description
     *           Optional. A human-readable description of the resource.
     *     @type array|\Google\Protobuf\Internal\MapField $labels
     *           Optional. Set of labels associated with the `LbEdgeExtension` resource.
     *           The format must comply with [the requirements for
     *           labels](https://cloud.google.com/compute/docs/labeling-resources#requirements)
     *           for Google Cloud resources.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $forwarding_rules
     *           Required. A list of references to the forwarding rules to which this
     *           service extension is attached. At least one forwarding rule is required.
     *           Only one `LbEdgeExtension` resource can be associated with a forwarding
     *           rule.
     *     @type array<\Google\Cloud\NetworkServices\V1\ExtensionChain>|\Google\Protobuf\Internal\RepeatedField $extension_chains
     *           Required. A set of ordered extension chains that contain the match
     *           conditions and extensions to execute. Match conditions for each extension
     *           chain are evaluated in sequence for a given request. The first extension
     *           chain that has a condition that matches the request is executed.
     *           Any subsequent extension chains do not execute.
     *           Limited to 5 extension chains per resource.
     *     @type int $load_balancing_scheme
     *           Required. All forwarding rules referenced by this extension must
     *           share the same load balancing scheme.
     *           Supported values: `EXTERNAL_MANAGED`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Networkservices\V1\Dep::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Identifier. Name of the `LbEdgeExtension` resource in the
     * following format:
     * `projects/{project}/locations/{location}/lbEdgeExtensions/{lb_edge_extension}`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IDENTIFIER];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Required. Identifier. Name of the `LbEdgeExtension` resource in the
     * following format:
     * `projects/{project}/locations/{location}/lbEdgeExtensions/{lb_edge_extension}`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IDENTIFIER];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Output only. The timestamp when the resource was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 2 [(.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 when the resource was created.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 2 [(.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;
    }

    /**
     * Output only. The timestamp when the resource was updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getUpdateTime()
    {
        return $this->update_time;
    }

    public function hasUpdateTime()
    {
        return isset($this->update_time);
    }

    public function clearUpdateTime()
    {
        unset($this->update_time);
    }

    /**
     * Output only. The timestamp when the resource was updated.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setUpdateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->update_time = $var;

        return $this;
    }

    /**
     * Optional. A human-readable description of the resource.
     *
     * Generated from protobuf field <code>string description = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Optional. A human-readable description of the resource.
     *
     * Generated from protobuf field <code>string description = 9 [(.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. Set of labels associated with the `LbEdgeExtension` resource.
     * The format must comply with [the requirements for
     * labels](https://cloud.google.com/compute/docs/labeling-resources#requirements)
     * for Google Cloud resources.
     *
     * Generated from protobuf field <code>map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getLabels()
    {
        return $this->labels;
    }

    /**
     * Optional. Set of labels associated with the `LbEdgeExtension` resource.
     * The format must comply with [the requirements for
     * labels](https://cloud.google.com/compute/docs/labeling-resources#requirements)
     * for Google Cloud resources.
     *
     * Generated from protobuf field <code>map<string, string> labels = 4 [(.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;
    }

    /**
     * Required. A list of references to the forwarding rules to which this
     * service extension is attached. At least one forwarding rule is required.
     * Only one `LbEdgeExtension` resource can be associated with a forwarding
     * rule.
     *
     * Generated from protobuf field <code>repeated string forwarding_rules = 5 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getForwardingRules()
    {
        return $this->forwarding_rules;
    }

    /**
     * Required. A list of references to the forwarding rules to which this
     * service extension is attached. At least one forwarding rule is required.
     * Only one `LbEdgeExtension` resource can be associated with a forwarding
     * rule.
     *
     * Generated from protobuf field <code>repeated string forwarding_rules = 5 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setForwardingRules($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->forwarding_rules = $arr;

        return $this;
    }

    /**
     * Required. A set of ordered extension chains that contain the match
     * conditions and extensions to execute. Match conditions for each extension
     * chain are evaluated in sequence for a given request. The first extension
     * chain that has a condition that matches the request is executed.
     * Any subsequent extension chains do not execute.
     * Limited to 5 extension chains per resource.
     *
     * Generated from protobuf field <code>repeated .google.cloud.networkservices.v1.ExtensionChain extension_chains = 6 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getExtensionChains()
    {
        return $this->extension_chains;
    }

    /**
     * Required. A set of ordered extension chains that contain the match
     * conditions and extensions to execute. Match conditions for each extension
     * chain are evaluated in sequence for a given request. The first extension
     * chain that has a condition that matches the request is executed.
     * Any subsequent extension chains do not execute.
     * Limited to 5 extension chains per resource.
     *
     * Generated from protobuf field <code>repeated .google.cloud.networkservices.v1.ExtensionChain extension_chains = 6 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param array<\Google\Cloud\NetworkServices\V1\ExtensionChain>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setExtensionChains($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\NetworkServices\V1\ExtensionChain::class);
        $this->extension_chains = $arr;

        return $this;
    }

    /**
     * Required. All forwarding rules referenced by this extension must
     * share the same load balancing scheme.
     * Supported values: `EXTERNAL_MANAGED`.
     *
     * Generated from protobuf field <code>.google.cloud.networkservices.v1.LoadBalancingScheme load_balancing_scheme = 7 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getLoadBalancingScheme()
    {
        return $this->load_balancing_scheme;
    }

    /**
     * Required. All forwarding rules referenced by this extension must
     * share the same load balancing scheme.
     * Supported values: `EXTERNAL_MANAGED`.
     *
     * Generated from protobuf field <code>.google.cloud.networkservices.v1.LoadBalancingScheme load_balancing_scheme = 7 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setLoadBalancingScheme($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\NetworkServices\V1\LoadBalancingScheme::class);
        $this->load_balancing_scheme = $var;

        return $this;
    }

}

