<?php
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/ads/googleads/v24/resources/shared_criterion.proto

namespace Google\Ads\GoogleAds\V24\Resources;

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

/**
 * A criterion belonging to a shared set.
 *
 * Generated from protobuf message <code>google.ads.googleads.v24.resources.SharedCriterion</code>
 */
class SharedCriterion extends \Google\Protobuf\Internal\Message
{
    /**
     * Immutable. The resource name of the shared criterion.
     * Shared set resource names have the form:
     * `customers/{customer_id}/sharedCriteria/{shared_set_id}~{criterion_id}`
     *
     * Generated from protobuf field <code>string resource_name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = {</code>
     */
    protected $resource_name = '';
    /**
     * Immutable. The shared set to which the shared criterion belongs.
     *
     * Generated from protobuf field <code>optional string shared_set = 10 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = {</code>
     */
    protected $shared_set = null;
    /**
     * Output only. The ID of the criterion.
     * This field is ignored for mutates.
     *
     * Generated from protobuf field <code>optional int64 criterion_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $criterion_id = null;
    /**
     * Output only. The type of the criterion.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.enums.CriterionTypeEnum.CriterionType type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $type = 0;
    /**
     * Immutable. If true, the criterion is excluded. If false, the criterion is
     * targeted.
     *
     * Generated from protobuf field <code>optional bool negative = 15 [(.google.api.field_behavior) = IMMUTABLE];</code>
     */
    protected $negative = null;
    protected $criterion;

    /**
     * Constructor.
     *
     * @param array $data {
     *                    Optional. Data for populating the Message object.
     *
     * @type string $resource_name
     *           Immutable. The resource name of the shared criterion.
     *           Shared set resource names have the form:
     *           `customers/{customer_id}/sharedCriteria/{shared_set_id}~{criterion_id}`
     * @type string $shared_set
     *           Immutable. The shared set to which the shared criterion belongs.
     * @type int|string $criterion_id
     *           Output only. The ID of the criterion.
     *           This field is ignored for mutates.
     * @type int $type
     *           Output only. The type of the criterion.
     * @type bool $negative
     *           Immutable. If true, the criterion is excluded. If false, the criterion is
     *           targeted.
     * @type \Google\Ads\GoogleAds\V24\Common\KeywordInfo $keyword
     *           Immutable. Keyword.
     * @type \Google\Ads\GoogleAds\V24\Common\YouTubeVideoInfo $youtube_video
     *           Immutable. YouTube Video.
     * @type \Google\Ads\GoogleAds\V24\Common\YouTubeChannelInfo $youtube_channel
     *           Immutable. YouTube Channel.
     * @type \Google\Ads\GoogleAds\V24\Common\PlacementInfo $placement
     *           Immutable. Placement.
     * @type \Google\Ads\GoogleAds\V24\Common\MobileAppCategoryInfo $mobile_app_category
     *           Immutable. Mobile App Category.
     * @type \Google\Ads\GoogleAds\V24\Common\MobileApplicationInfo $mobile_application
     *           Immutable. Mobile application.
     * @type \Google\Ads\GoogleAds\V24\Common\BrandInfo $brand
     *           Immutable. Brand.
     * @type \Google\Ads\GoogleAds\V24\Common\WebpageInfo $webpage
     *           Immutable. Webpage.
     * @type \Google\Ads\GoogleAds\V24\Common\VerticalAdsItemGroupRuleInfo $vertical_ads_item_group_rule
     *           Immutable. Vertical ads item group rule.
     * @type \Google\Ads\GoogleAds\V24\Common\RetailFilter $retail_filter
     *           Immutable. Retail Filter.
     * }
     */
    public function __construct($data = null)
    {
        \GPBMetadata\Google\Ads\GoogleAds\V24\Resources\SharedCriterion::initOnce();
        parent::__construct($data);
    }

    /**
     * Immutable. The resource name of the shared criterion.
     * Shared set resource names have the form:
     * `customers/{customer_id}/sharedCriteria/{shared_set_id}~{criterion_id}`
     *
     * Generated from protobuf field <code>string resource_name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = {</code>
     *
     * @return string
     */
    public function getResourceName()
    {
        return $this->resource_name;
    }

    /**
     * Immutable. The resource name of the shared criterion.
     * Shared set resource names have the form:
     * `customers/{customer_id}/sharedCriteria/{shared_set_id}~{criterion_id}`
     *
     * Generated from protobuf field <code>string resource_name = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = {</code>
     *
     * @param  string $var
     * @return $this
     */
    public function setResourceName($var)
    {
        GPBUtil::checkString($var, true);
        $this->resource_name = $var;

        return $this;
    }

    /**
     * Immutable. The shared set to which the shared criterion belongs.
     *
     * Generated from protobuf field <code>optional string shared_set = 10 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = {</code>
     *
     * @return string
     */
    public function getSharedSet()
    {
        return isset($this->shared_set) ? $this->shared_set : '';
    }

    public function hasSharedSet()
    {
        return isset($this->shared_set);
    }

    public function clearSharedSet()
    {
        unset($this->shared_set);
    }

    /**
     * Immutable. The shared set to which the shared criterion belongs.
     *
     * Generated from protobuf field <code>optional string shared_set = 10 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = {</code>
     *
     * @param  string $var
     * @return $this
     */
    public function setSharedSet($var)
    {
        GPBUtil::checkString($var, true);
        $this->shared_set = $var;

        return $this;
    }

    /**
     * Output only. The ID of the criterion.
     * This field is ignored for mutates.
     *
     * Generated from protobuf field <code>optional int64 criterion_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return int|string
     */
    public function getCriterionId()
    {
        return isset($this->criterion_id) ? $this->criterion_id : 0;
    }

    public function hasCriterionId()
    {
        return isset($this->criterion_id);
    }

    public function clearCriterionId()
    {
        unset($this->criterion_id);
    }

    /**
     * Output only. The ID of the criterion.
     * This field is ignored for mutates.
     *
     * Generated from protobuf field <code>optional int64 criterion_id = 11 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param  int|string $var
     * @return $this
     */
    public function setCriterionId($var)
    {
        GPBUtil::checkInt64($var);
        $this->criterion_id = $var;

        return $this;
    }

    /**
     * Output only. The type of the criterion.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.enums.CriterionTypeEnum.CriterionType type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Output only. The type of the criterion.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.enums.CriterionTypeEnum.CriterionType type = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param  int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Google\Ads\GoogleAds\V24\Enums\CriterionTypeEnum\CriterionType::class);
        $this->type = $var;

        return $this;
    }

    /**
     * Immutable. If true, the criterion is excluded. If false, the criterion is
     * targeted.
     *
     * Generated from protobuf field <code>optional bool negative = 15 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @return bool
     */
    public function getNegative()
    {
        return isset($this->negative) ? $this->negative : false;
    }

    public function hasNegative()
    {
        return isset($this->negative);
    }

    public function clearNegative()
    {
        unset($this->negative);
    }

    /**
     * Immutable. If true, the criterion is excluded. If false, the criterion is
     * targeted.
     *
     * Generated from protobuf field <code>optional bool negative = 15 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @param  bool $var
     * @return $this
     */
    public function setNegative($var)
    {
        GPBUtil::checkBool($var);
        $this->negative = $var;

        return $this;
    }

    /**
     * Immutable. Keyword.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.common.KeywordInfo keyword = 3 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @return \Google\Ads\GoogleAds\V24\Common\KeywordInfo|null
     */
    public function getKeyword()
    {
        return $this->readOneof(3);
    }

    public function hasKeyword()
    {
        return $this->hasOneof(3);
    }

    /**
     * Immutable. Keyword.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.common.KeywordInfo keyword = 3 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @param  \Google\Ads\GoogleAds\V24\Common\KeywordInfo $var
     * @return $this
     */
    public function setKeyword($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V24\Common\KeywordInfo::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Immutable. YouTube Video.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.common.YouTubeVideoInfo youtube_video = 5 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @return \Google\Ads\GoogleAds\V24\Common\YouTubeVideoInfo|null
     */
    public function getYoutubeVideo()
    {
        return $this->readOneof(5);
    }

    public function hasYoutubeVideo()
    {
        return $this->hasOneof(5);
    }

    /**
     * Immutable. YouTube Video.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.common.YouTubeVideoInfo youtube_video = 5 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @param  \Google\Ads\GoogleAds\V24\Common\YouTubeVideoInfo $var
     * @return $this
     */
    public function setYoutubeVideo($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V24\Common\YouTubeVideoInfo::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * Immutable. YouTube Channel.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.common.YouTubeChannelInfo youtube_channel = 6 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @return \Google\Ads\GoogleAds\V24\Common\YouTubeChannelInfo|null
     */
    public function getYoutubeChannel()
    {
        return $this->readOneof(6);
    }

    public function hasYoutubeChannel()
    {
        return $this->hasOneof(6);
    }

    /**
     * Immutable. YouTube Channel.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.common.YouTubeChannelInfo youtube_channel = 6 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @param  \Google\Ads\GoogleAds\V24\Common\YouTubeChannelInfo $var
     * @return $this
     */
    public function setYoutubeChannel($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V24\Common\YouTubeChannelInfo::class);
        $this->writeOneof(6, $var);

        return $this;
    }

    /**
     * Immutable. Placement.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.common.PlacementInfo placement = 7 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @return \Google\Ads\GoogleAds\V24\Common\PlacementInfo|null
     */
    public function getPlacement()
    {
        return $this->readOneof(7);
    }

    public function hasPlacement()
    {
        return $this->hasOneof(7);
    }

    /**
     * Immutable. Placement.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.common.PlacementInfo placement = 7 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @param  \Google\Ads\GoogleAds\V24\Common\PlacementInfo $var
     * @return $this
     */
    public function setPlacement($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V24\Common\PlacementInfo::class);
        $this->writeOneof(7, $var);

        return $this;
    }

    /**
     * Immutable. Mobile App Category.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.common.MobileAppCategoryInfo mobile_app_category = 8 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @return \Google\Ads\GoogleAds\V24\Common\MobileAppCategoryInfo|null
     */
    public function getMobileAppCategory()
    {
        return $this->readOneof(8);
    }

    public function hasMobileAppCategory()
    {
        return $this->hasOneof(8);
    }

    /**
     * Immutable. Mobile App Category.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.common.MobileAppCategoryInfo mobile_app_category = 8 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @param  \Google\Ads\GoogleAds\V24\Common\MobileAppCategoryInfo $var
     * @return $this
     */
    public function setMobileAppCategory($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V24\Common\MobileAppCategoryInfo::class);
        $this->writeOneof(8, $var);

        return $this;
    }

    /**
     * Immutable. Mobile application.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.common.MobileApplicationInfo mobile_application = 9 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @return \Google\Ads\GoogleAds\V24\Common\MobileApplicationInfo|null
     */
    public function getMobileApplication()
    {
        return $this->readOneof(9);
    }

    public function hasMobileApplication()
    {
        return $this->hasOneof(9);
    }

    /**
     * Immutable. Mobile application.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.common.MobileApplicationInfo mobile_application = 9 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @param  \Google\Ads\GoogleAds\V24\Common\MobileApplicationInfo $var
     * @return $this
     */
    public function setMobileApplication($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V24\Common\MobileApplicationInfo::class);
        $this->writeOneof(9, $var);

        return $this;
    }

    /**
     * Immutable. Brand.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.common.BrandInfo brand = 12 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @return \Google\Ads\GoogleAds\V24\Common\BrandInfo|null
     */
    public function getBrand()
    {
        return $this->readOneof(12);
    }

    public function hasBrand()
    {
        return $this->hasOneof(12);
    }

    /**
     * Immutable. Brand.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.common.BrandInfo brand = 12 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @param  \Google\Ads\GoogleAds\V24\Common\BrandInfo $var
     * @return $this
     */
    public function setBrand($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V24\Common\BrandInfo::class);
        $this->writeOneof(12, $var);

        return $this;
    }

    /**
     * Immutable. Webpage.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.common.WebpageInfo webpage = 13 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @return \Google\Ads\GoogleAds\V24\Common\WebpageInfo|null
     */
    public function getWebpage()
    {
        return $this->readOneof(13);
    }

    public function hasWebpage()
    {
        return $this->hasOneof(13);
    }

    /**
     * Immutable. Webpage.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.common.WebpageInfo webpage = 13 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @param  \Google\Ads\GoogleAds\V24\Common\WebpageInfo $var
     * @return $this
     */
    public function setWebpage($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V24\Common\WebpageInfo::class);
        $this->writeOneof(13, $var);

        return $this;
    }

    /**
     * Immutable. Vertical ads item group rule.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.common.VerticalAdsItemGroupRuleInfo vertical_ads_item_group_rule = 14 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @return \Google\Ads\GoogleAds\V24\Common\VerticalAdsItemGroupRuleInfo|null
     */
    public function getVerticalAdsItemGroupRule()
    {
        return $this->readOneof(14);
    }

    public function hasVerticalAdsItemGroupRule()
    {
        return $this->hasOneof(14);
    }

    /**
     * Immutable. Vertical ads item group rule.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.common.VerticalAdsItemGroupRuleInfo vertical_ads_item_group_rule = 14 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @param  \Google\Ads\GoogleAds\V24\Common\VerticalAdsItemGroupRuleInfo $var
     * @return $this
     */
    public function setVerticalAdsItemGroupRule($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V24\Common\VerticalAdsItemGroupRuleInfo::class);
        $this->writeOneof(14, $var);

        return $this;
    }

    /**
     * Immutable. Retail Filter.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.common.RetailFilter retail_filter = 181 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @return \Google\Ads\GoogleAds\V24\Common\RetailFilter|null
     */
    public function getRetailFilter()
    {
        return $this->readOneof(181);
    }

    public function hasRetailFilter()
    {
        return $this->hasOneof(181);
    }

    /**
     * Immutable. Retail Filter.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v24.common.RetailFilter retail_filter = 181 [(.google.api.field_behavior) = IMMUTABLE];</code>
     *
     * @param  \Google\Ads\GoogleAds\V24\Common\RetailFilter $var
     * @return $this
     */
    public function setRetailFilter($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V24\Common\RetailFilter::class);
        $this->writeOneof(181, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getCriterion()
    {
        return $this->whichOneof("criterion");
    }

}

