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

namespace Google\Ads\GoogleAds\V23\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.v23.services.IncentiveOffer</code>
 */
class IncentiveOffer extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The type of this acquisition incentive offer.
     *
     * Generated from protobuf field <code>optional .google.ads.googleads.v23.services.IncentiveOffer.OfferType type = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $type = null;
    /**
     * 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;
    protected $incentive_details;

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

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

    public function hasType()
    {
        return isset($this->type);
    }

    public function clearType()
    {
        unset($this->type);
    }

    /**
     * Required. The type of this acquisition incentive offer.
     *
     * Generated from protobuf field <code>optional .google.ads.googleads.v23.services.IncentiveOffer.OfferType type = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     *
     * @param  int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Google\Ads\GoogleAds\V23\Services\IncentiveOffer\OfferType::class);
        $this->type = $var;

        return $this;
    }

    /**
     * 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;
    }

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

        return $this;
    }

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

}

