<?php
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/ads/googleads/v23/services/experiment_service.proto

namespace Google\Ads\GoogleAds\V23\Services;

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

/**
 * Request message for
 * [ExperimentService.GraduateExperiment][google.ads.googleads.v23.services.ExperimentService.GraduateExperiment].
 *
 * Generated from protobuf message <code>google.ads.googleads.v23.services.GraduateExperimentRequest</code>
 */
class GraduateExperimentRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The experiment to be graduated.
     *
     * Generated from protobuf field <code>string experiment = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $experiment = '';
    /**
     * Required. List of campaign budget mappings for graduation. Each campaign
     * that appears here will graduate, and will be assigned a new budget that is
     * paired with it in the mapping. The maximum size is one.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v23.services.CampaignBudgetMapping campaign_budget_mappings = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $campaign_budget_mappings;
    /**
     * If true, the request is validated but not executed. Only errors are
     * returned, not results.
     *
     * Generated from protobuf field <code>bool validate_only = 3;</code>
     */
    protected $validate_only = false;

    /**
     * @param string                                                     $experiment             Required. The experiment to be graduated.
     * @param \Google\Ads\GoogleAds\V23\Services\CampaignBudgetMapping[] $campaignBudgetMappings Required. List of campaign budget mappings for graduation. Each campaign
     *                                                                                           that appears here will graduate, and will be assigned a new budget that is
     *                                                                                           paired with it in the mapping. The maximum size is one.
     *
     * @return \Google\Ads\GoogleAds\V23\Services\GraduateExperimentRequest
     *
     * @experimental
     */
    public static function build(string $experiment, array $campaignBudgetMappings): self
    {
        return (new self())
            ->setExperiment($experiment)
            ->setCampaignBudgetMappings($campaignBudgetMappings);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *                    Optional. Data for populating the Message object.
     *
     * @type string $experiment
     *           Required. The experiment to be graduated.
     * @type \Google\Ads\GoogleAds\V23\Services\CampaignBudgetMapping[] $campaign_budget_mappings
     *           Required. List of campaign budget mappings for graduation. Each campaign
     *           that appears here will graduate, and will be assigned a new budget that is
     *           paired with it in the mapping. The maximum size is one.
     * @type bool $validate_only
     *           If true, the request is validated but not executed. Only errors are
     *           returned, not results.
     * }
     */
    public function __construct($data = null)
    {
        \GPBMetadata\Google\Ads\GoogleAds\V23\Services\ExperimentService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The experiment to be graduated.
     *
     * Generated from protobuf field <code>string experiment = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     *
     * @return string
     */
    public function getExperiment()
    {
        return $this->experiment;
    }

    /**
     * Required. The experiment to be graduated.
     *
     * Generated from protobuf field <code>string experiment = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     *
     * @param  string $var
     * @return $this
     */
    public function setExperiment($var)
    {
        GPBUtil::checkString($var, true);
        $this->experiment = $var;

        return $this;
    }

    /**
     * Required. List of campaign budget mappings for graduation. Each campaign
     * that appears here will graduate, and will be assigned a new budget that is
     * paired with it in the mapping. The maximum size is one.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v23.services.CampaignBudgetMapping campaign_budget_mappings = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @return RepeatedField<\Google\Ads\GoogleAds\V23\Services\CampaignBudgetMapping>
     */
    public function getCampaignBudgetMappings()
    {
        return $this->campaign_budget_mappings;
    }

    /**
     * Required. List of campaign budget mappings for graduation. Each campaign
     * that appears here will graduate, and will be assigned a new budget that is
     * paired with it in the mapping. The maximum size is one.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v23.services.CampaignBudgetMapping campaign_budget_mappings = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param  \Google\Ads\GoogleAds\V23\Services\CampaignBudgetMapping[] $var
     * @return $this
     */
    public function setCampaignBudgetMappings($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\GoogleAds\V23\Services\CampaignBudgetMapping::class);
        $this->campaign_budget_mappings = $arr;

        return $this;
    }

    /**
     * If true, the request is validated but not executed. Only errors are
     * returned, not results.
     *
     * Generated from protobuf field <code>bool validate_only = 3;</code>
     *
     * @return bool
     */
    public function getValidateOnly()
    {
        return $this->validate_only;
    }

    /**
     * If true, the request is validated but not executed. Only errors are
     * returned, not results.
     *
     * Generated from protobuf field <code>bool validate_only = 3;</code>
     *
     * @param  bool $var
     * @return $this
     */
    public function setValidateOnly($var)
    {
        GPBUtil::checkBool($var);
        $this->validate_only = $var;

        return $this;
    }

}

