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

namespace Google\Ads\GoogleAds\V25\Services;

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

/**
 * An acquisition incentive offer for a user. An offer means how the user is
 * treated. An offer can have no incentive or multiple incentives.
 *
 * Generated from protobuf message <code>google.ads.googleads.v25.services.IncentiveOffer</code>
 */
class IncentiveOffer extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. The URL of the terms and conditions for the incentive offer.
     *
     * Generated from protobuf field <code>optional string consolidated_terms_and_conditions_url = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $consolidated_terms_and_conditions_url = null;
    /**
     * Required. The type of this acquisition incentive offer.
     *
     * Generated from protobuf field <code>optional .google.ads.googleads.v25.enums.IncentiveOfferTypeEnum.OfferType offer_type = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $offer_type = null;
    protected $incentive_details;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $consolidated_terms_and_conditions_url
     *           Optional. The URL of the terms and conditions for the incentive offer.
     *     @type int $offer_type
     *           Required. The type of this acquisition incentive offer.
     *     @type \Google\Ads\GoogleAds\V25\Services\CyoIncentives $cyo_incentives
     *           CYO incentives. Set when type is CYO_INCENTIVE.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V25\Services\IncentiveService::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. The URL of the terms and conditions for the incentive offer.
     *
     * Generated from protobuf field <code>optional string consolidated_terms_and_conditions_url = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getConsolidatedTermsAndConditionsUrl()
    {
        return isset($this->consolidated_terms_and_conditions_url) ? $this->consolidated_terms_and_conditions_url : '';
    }

    public function hasConsolidatedTermsAndConditionsUrl()
    {
        return isset($this->consolidated_terms_and_conditions_url);
    }

    public function clearConsolidatedTermsAndConditionsUrl()
    {
        unset($this->consolidated_terms_and_conditions_url);
    }

    /**
     * Optional. The URL of the terms and conditions for the incentive offer.
     *
     * Generated from protobuf field <code>optional string consolidated_terms_and_conditions_url = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setConsolidatedTermsAndConditionsUrl($var)
    {
        GPBUtil::checkString($var, True);
        $this->consolidated_terms_and_conditions_url = $var;

        return $this;
    }

    /**
     * Required. The type of this acquisition incentive offer.
     *
     * Generated from protobuf field <code>optional .google.ads.googleads.v25.enums.IncentiveOfferTypeEnum.OfferType offer_type = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getOfferType()
    {
        return isset($this->offer_type) ? $this->offer_type : 0;
    }

    public function hasOfferType()
    {
        return isset($this->offer_type);
    }

    public function clearOfferType()
    {
        unset($this->offer_type);
    }

    /**
     * Required. The type of this acquisition incentive offer.
     *
     * Generated from protobuf field <code>optional .google.ads.googleads.v25.enums.IncentiveOfferTypeEnum.OfferType offer_type = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setOfferType($var)
    {
        GPBUtil::checkEnum($var, \Google\Ads\GoogleAds\V25\Enums\IncentiveOfferTypeEnum\OfferType::class);
        $this->offer_type = $var;

        return $this;
    }

    /**
     * CYO incentives. Set when type is CYO_INCENTIVE.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v25.services.CyoIncentives cyo_incentives = 3;</code>
     * @return \Google\Ads\GoogleAds\V25\Services\CyoIncentives|null
     */
    public function getCyoIncentives()
    {
        return $this->readOneof(3);
    }

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

    /**
     * CYO incentives. Set when type is CYO_INCENTIVE.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v25.services.CyoIncentives cyo_incentives = 3;</code>
     * @param \Google\Ads\GoogleAds\V25\Services\CyoIncentives $var
     * @return $this
     */
    public function setCyoIncentives($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V25\Services\CyoIncentives::class);
        $this->writeOneof(3, $var);

        return $this;
    }

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

}

