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

namespace Google\Ads\GoogleAds\V21\Resources\AdGroup\DemandGenAdGroupSettings;

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

/**
 * Channel controls for Demand Gen ad groups.
 *
 * Generated from protobuf message <code>google.ads.googleads.v21.resources.AdGroup.DemandGenAdGroupSettings.DemandGenChannelControls</code>
 */
class DemandGenChannelControls extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. Channel configuration reflecting which field in the oneof
     * is populated.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v21.enums.DemandGenChannelConfigEnum.DemandGenChannelConfig channel_config = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $channel_config = 0;
    protected $channel_configuration;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $channel_config
     *           Output only. Channel configuration reflecting which field in the oneof
     *           is populated.
     *     @type int $channel_strategy
     *           High level channel strategy.
     *     @type \Google\Ads\GoogleAds\V21\Resources\AdGroup\DemandGenAdGroupSettings\DemandGenChannelControls\DemandGenSelectedChannels $selected_channels
     *           Explicitly selected channels. This field should be set with at
     *           least one true value when present.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V21\Resources\AdGroup::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. Channel configuration reflecting which field in the oneof
     * is populated.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v21.enums.DemandGenChannelConfigEnum.DemandGenChannelConfig channel_config = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getChannelConfig()
    {
        return $this->channel_config;
    }

    /**
     * Output only. Channel configuration reflecting which field in the oneof
     * is populated.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v21.enums.DemandGenChannelConfigEnum.DemandGenChannelConfig channel_config = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setChannelConfig($var)
    {
        GPBUtil::checkEnum($var, \Google\Ads\GoogleAds\V21\Enums\DemandGenChannelConfigEnum\DemandGenChannelConfig::class);
        $this->channel_config = $var;

        return $this;
    }

    /**
     * High level channel strategy.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v21.enums.DemandGenChannelStrategyEnum.DemandGenChannelStrategy channel_strategy = 2;</code>
     * @return int
     */
    public function getChannelStrategy()
    {
        return $this->readOneof(2);
    }

    public function hasChannelStrategy()
    {
        return $this->hasOneof(2);
    }

    /**
     * High level channel strategy.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v21.enums.DemandGenChannelStrategyEnum.DemandGenChannelStrategy channel_strategy = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setChannelStrategy($var)
    {
        GPBUtil::checkEnum($var, \Google\Ads\GoogleAds\V21\Enums\DemandGenChannelStrategyEnum\DemandGenChannelStrategy::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Explicitly selected channels. This field should be set with at
     * least one true value when present.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v21.resources.AdGroup.DemandGenAdGroupSettings.DemandGenChannelControls.DemandGenSelectedChannels selected_channels = 3;</code>
     * @return \Google\Ads\GoogleAds\V21\Resources\AdGroup\DemandGenAdGroupSettings\DemandGenChannelControls\DemandGenSelectedChannels|null
     */
    public function getSelectedChannels()
    {
        return $this->readOneof(3);
    }

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

    /**
     * Explicitly selected channels. This field should be set with at
     * least one true value when present.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v21.resources.AdGroup.DemandGenAdGroupSettings.DemandGenChannelControls.DemandGenSelectedChannels selected_channels = 3;</code>
     * @param \Google\Ads\GoogleAds\V21\Resources\AdGroup\DemandGenAdGroupSettings\DemandGenChannelControls\DemandGenSelectedChannels $var
     * @return $this
     */
    public function setSelectedChannels($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V21\Resources\AdGroup\DemandGenAdGroupSettings\DemandGenChannelControls\DemandGenSelectedChannels::class);
        $this->writeOneof(3, $var);

        return $this;
    }

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

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(DemandGenChannelControls::class, \Google\Ads\GoogleAds\V21\Resources\AdGroup_DemandGenAdGroupSettings_DemandGenChannelControls::class);

