<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/ads/googleads/v25/common/asset_set_types.proto

namespace Google\Ads\GoogleAds\V25\Common;

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

/**
 * Data used to configure a location set populated with the specified chains.
 *
 * Generated from protobuf message <code>google.ads.googleads.v25.common.ChainSet</code>
 */
class ChainSet extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Immutable. Relationship type the specified chains have with this
     * advertiser.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v25.enums.ChainRelationshipTypeEnum.ChainRelationshipType relationship_type = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];</code>
     */
    protected $relationship_type = 0;
    /**
     * Required. A list of chain level filters, all filters are OR'ed together.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v25.common.ChainFilter chains = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $chains;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $relationship_type
     *           Required. Immutable. Relationship type the specified chains have with this
     *           advertiser.
     *     @type \Google\Ads\GoogleAds\V25\Common\ChainFilter[] $chains
     *           Required. A list of chain level filters, all filters are OR'ed together.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V25\Common\AssetSetTypes::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Immutable. Relationship type the specified chains have with this
     * advertiser.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v25.enums.ChainRelationshipTypeEnum.ChainRelationshipType relationship_type = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @return int
     */
    public function getRelationshipType()
    {
        return $this->relationship_type;
    }

    /**
     * Required. Immutable. Relationship type the specified chains have with this
     * advertiser.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v25.enums.ChainRelationshipTypeEnum.ChainRelationshipType relationship_type = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @param int $var
     * @return $this
     */
    public function setRelationshipType($var)
    {
        GPBUtil::checkEnum($var, \Google\Ads\GoogleAds\V25\Enums\ChainRelationshipTypeEnum\ChainRelationshipType::class);
        $this->relationship_type = $var;

        return $this;
    }

    /**
     * Required. A list of chain level filters, all filters are OR'ed together.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v25.common.ChainFilter chains = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return RepeatedField<\Google\Ads\GoogleAds\V25\Common\ChainFilter>
     */
    public function getChains()
    {
        return $this->chains;
    }

    /**
     * Required. A list of chain level filters, all filters are OR'ed together.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v25.common.ChainFilter chains = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Ads\GoogleAds\V25\Common\ChainFilter[] $var
     * @return $this
     */
    public function setChains($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\GoogleAds\V25\Common\ChainFilter::class);
        $this->chains = $arr;

        return $this;
    }

}

