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

namespace Google\Ads\GoogleAds\V23\Common;

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

/**
 * A Promotion asset.
 *
 * Generated from protobuf message <code>google.ads.googleads.v23.common.PromotionAsset</code>
 */
class PromotionAsset extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. A freeform description of what the promotion is targeting.
     *
     * Generated from protobuf field <code>string promotion_target = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $promotion_target = '';
    /**
     * A modifier for qualification of the discount.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.enums.PromotionExtensionDiscountModifierEnum.PromotionExtensionDiscountModifier discount_modifier = 2;</code>
     */
    protected $discount_modifier = 0;
    /**
     * Start date of when the promotion is eligible to be redeemed, in yyyy-MM-dd
     * format.
     *
     * Generated from protobuf field <code>string redemption_start_date = 7;</code>
     */
    protected $redemption_start_date = '';
    /**
     * Last date of when the promotion is eligible to be redeemed, in yyyy-MM-dd
     * format.
     *
     * Generated from protobuf field <code>string redemption_end_date = 8;</code>
     */
    protected $redemption_end_date = '';
    /**
     * The occasion the promotion was intended for.
     * If an occasion is set, the redemption window will need to fall within the
     * date range associated with the occasion.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.enums.PromotionExtensionOccasionEnum.PromotionExtensionOccasion occasion = 9;</code>
     */
    protected $occasion = 0;
    /**
     * The language of the promotion.
     * Represented as BCP 47 language tag.
     *
     * Generated from protobuf field <code>string language_code = 10;</code>
     */
    protected $language_code = '';
    /**
     * Start date of when this asset is effective and can begin serving, in
     * yyyy-MM-dd format.
     *
     * Generated from protobuf field <code>string start_date = 11;</code>
     */
    protected $start_date = '';
    /**
     * Last date of when this asset is effective and still serving, in yyyy-MM-dd
     * format.
     *
     * Generated from protobuf field <code>string end_date = 12;</code>
     */
    protected $end_date = '';
    /**
     * List of non-overlapping schedules specifying all time intervals for which
     * the asset may serve. There can be a maximum of 6 schedules per day, 42 in
     * total.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v23.common.AdScheduleInfo ad_schedule_targets = 13;</code>
     */
    private $ad_schedule_targets;
    /**
     * Terms and conditions of the promotion.
     *
     * Generated from protobuf field <code>string terms_and_conditions_text = 14;</code>
     */
    protected $terms_and_conditions_text = '';
    /**
     * URI to the terms and conditions of the promotion.
     *
     * Generated from protobuf field <code>string terms_and_conditions_uri = 15;</code>
     */
    protected $terms_and_conditions_uri = '';
    protected $discount_type;
    protected $promotion_trigger;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $promotion_target
     *           Required. A freeform description of what the promotion is targeting.
     *     @type int $discount_modifier
     *           A modifier for qualification of the discount.
     *     @type string $redemption_start_date
     *           Start date of when the promotion is eligible to be redeemed, in yyyy-MM-dd
     *           format.
     *     @type string $redemption_end_date
     *           Last date of when the promotion is eligible to be redeemed, in yyyy-MM-dd
     *           format.
     *     @type int $occasion
     *           The occasion the promotion was intended for.
     *           If an occasion is set, the redemption window will need to fall within the
     *           date range associated with the occasion.
     *     @type string $language_code
     *           The language of the promotion.
     *           Represented as BCP 47 language tag.
     *     @type string $start_date
     *           Start date of when this asset is effective and can begin serving, in
     *           yyyy-MM-dd format.
     *     @type string $end_date
     *           Last date of when this asset is effective and still serving, in yyyy-MM-dd
     *           format.
     *     @type array<\Google\Ads\GoogleAds\V23\Common\AdScheduleInfo>|\Google\Protobuf\Internal\RepeatedField $ad_schedule_targets
     *           List of non-overlapping schedules specifying all time intervals for which
     *           the asset may serve. There can be a maximum of 6 schedules per day, 42 in
     *           total.
     *     @type string $terms_and_conditions_text
     *           Terms and conditions of the promotion.
     *     @type string $terms_and_conditions_uri
     *           URI to the terms and conditions of the promotion.
     *     @type int|string $percent_off
     *           Percentage off discount in the promotion. 1,000,000 = 100%.
     *           Either this or money_amount_off is required.
     *     @type \Google\Ads\GoogleAds\V23\Common\Money $money_amount_off
     *           Money amount off for discount in the promotion.
     *           Either this or percent_off is required.
     *     @type string $promotion_code
     *           A code the user should use in order to be eligible for the promotion.
     *     @type \Google\Ads\GoogleAds\V23\Common\Money $orders_over_amount
     *           The amount the total order needs to be for the user to be eligible for
     *           the promotion.
     *     @type \Google\Ads\GoogleAds\V23\Common\PromotionBarcodeInfo $promotion_barcode_info
     *           Barcode info used to generate promotion barcode for user to be eligible
     *           for the promotion.
     *     @type \Google\Ads\GoogleAds\V23\Common\PromotionQrCodeInfo $promotion_qr_code_info
     *           QR code info used to generate promotion QR code for user to be eligible
     *           for the promotion.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V23\Common\AssetTypes::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. A freeform description of what the promotion is targeting.
     *
     * Generated from protobuf field <code>string promotion_target = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getPromotionTarget()
    {
        return $this->promotion_target;
    }

    /**
     * Required. A freeform description of what the promotion is targeting.
     *
     * Generated from protobuf field <code>string promotion_target = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setPromotionTarget($var)
    {
        GPBUtil::checkString($var, True);
        $this->promotion_target = $var;

        return $this;
    }

    /**
     * A modifier for qualification of the discount.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.enums.PromotionExtensionDiscountModifierEnum.PromotionExtensionDiscountModifier discount_modifier = 2;</code>
     * @return int
     */
    public function getDiscountModifier()
    {
        return $this->discount_modifier;
    }

    /**
     * A modifier for qualification of the discount.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.enums.PromotionExtensionDiscountModifierEnum.PromotionExtensionDiscountModifier discount_modifier = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setDiscountModifier($var)
    {
        GPBUtil::checkEnum($var, \Google\Ads\GoogleAds\V23\Enums\PromotionExtensionDiscountModifierEnum\PromotionExtensionDiscountModifier::class);
        $this->discount_modifier = $var;

        return $this;
    }

    /**
     * Start date of when the promotion is eligible to be redeemed, in yyyy-MM-dd
     * format.
     *
     * Generated from protobuf field <code>string redemption_start_date = 7;</code>
     * @return string
     */
    public function getRedemptionStartDate()
    {
        return $this->redemption_start_date;
    }

    /**
     * Start date of when the promotion is eligible to be redeemed, in yyyy-MM-dd
     * format.
     *
     * Generated from protobuf field <code>string redemption_start_date = 7;</code>
     * @param string $var
     * @return $this
     */
    public function setRedemptionStartDate($var)
    {
        GPBUtil::checkString($var, True);
        $this->redemption_start_date = $var;

        return $this;
    }

    /**
     * Last date of when the promotion is eligible to be redeemed, in yyyy-MM-dd
     * format.
     *
     * Generated from protobuf field <code>string redemption_end_date = 8;</code>
     * @return string
     */
    public function getRedemptionEndDate()
    {
        return $this->redemption_end_date;
    }

    /**
     * Last date of when the promotion is eligible to be redeemed, in yyyy-MM-dd
     * format.
     *
     * Generated from protobuf field <code>string redemption_end_date = 8;</code>
     * @param string $var
     * @return $this
     */
    public function setRedemptionEndDate($var)
    {
        GPBUtil::checkString($var, True);
        $this->redemption_end_date = $var;

        return $this;
    }

    /**
     * The occasion the promotion was intended for.
     * If an occasion is set, the redemption window will need to fall within the
     * date range associated with the occasion.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.enums.PromotionExtensionOccasionEnum.PromotionExtensionOccasion occasion = 9;</code>
     * @return int
     */
    public function getOccasion()
    {
        return $this->occasion;
    }

    /**
     * The occasion the promotion was intended for.
     * If an occasion is set, the redemption window will need to fall within the
     * date range associated with the occasion.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.enums.PromotionExtensionOccasionEnum.PromotionExtensionOccasion occasion = 9;</code>
     * @param int $var
     * @return $this
     */
    public function setOccasion($var)
    {
        GPBUtil::checkEnum($var, \Google\Ads\GoogleAds\V23\Enums\PromotionExtensionOccasionEnum\PromotionExtensionOccasion::class);
        $this->occasion = $var;

        return $this;
    }

    /**
     * The language of the promotion.
     * Represented as BCP 47 language tag.
     *
     * Generated from protobuf field <code>string language_code = 10;</code>
     * @return string
     */
    public function getLanguageCode()
    {
        return $this->language_code;
    }

    /**
     * The language of the promotion.
     * Represented as BCP 47 language tag.
     *
     * Generated from protobuf field <code>string language_code = 10;</code>
     * @param string $var
     * @return $this
     */
    public function setLanguageCode($var)
    {
        GPBUtil::checkString($var, True);
        $this->language_code = $var;

        return $this;
    }

    /**
     * Start date of when this asset is effective and can begin serving, in
     * yyyy-MM-dd format.
     *
     * Generated from protobuf field <code>string start_date = 11;</code>
     * @return string
     */
    public function getStartDate()
    {
        return $this->start_date;
    }

    /**
     * Start date of when this asset is effective and can begin serving, in
     * yyyy-MM-dd format.
     *
     * Generated from protobuf field <code>string start_date = 11;</code>
     * @param string $var
     * @return $this
     */
    public function setStartDate($var)
    {
        GPBUtil::checkString($var, True);
        $this->start_date = $var;

        return $this;
    }

    /**
     * Last date of when this asset is effective and still serving, in yyyy-MM-dd
     * format.
     *
     * Generated from protobuf field <code>string end_date = 12;</code>
     * @return string
     */
    public function getEndDate()
    {
        return $this->end_date;
    }

    /**
     * Last date of when this asset is effective and still serving, in yyyy-MM-dd
     * format.
     *
     * Generated from protobuf field <code>string end_date = 12;</code>
     * @param string $var
     * @return $this
     */
    public function setEndDate($var)
    {
        GPBUtil::checkString($var, True);
        $this->end_date = $var;

        return $this;
    }

    /**
     * List of non-overlapping schedules specifying all time intervals for which
     * the asset may serve. There can be a maximum of 6 schedules per day, 42 in
     * total.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v23.common.AdScheduleInfo ad_schedule_targets = 13;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getAdScheduleTargets()
    {
        return $this->ad_schedule_targets;
    }

    /**
     * List of non-overlapping schedules specifying all time intervals for which
     * the asset may serve. There can be a maximum of 6 schedules per day, 42 in
     * total.
     *
     * Generated from protobuf field <code>repeated .google.ads.googleads.v23.common.AdScheduleInfo ad_schedule_targets = 13;</code>
     * @param array<\Google\Ads\GoogleAds\V23\Common\AdScheduleInfo>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setAdScheduleTargets($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Ads\GoogleAds\V23\Common\AdScheduleInfo::class);
        $this->ad_schedule_targets = $arr;

        return $this;
    }

    /**
     * Terms and conditions of the promotion.
     *
     * Generated from protobuf field <code>string terms_and_conditions_text = 14;</code>
     * @return string
     */
    public function getTermsAndConditionsText()
    {
        return $this->terms_and_conditions_text;
    }

    /**
     * Terms and conditions of the promotion.
     *
     * Generated from protobuf field <code>string terms_and_conditions_text = 14;</code>
     * @param string $var
     * @return $this
     */
    public function setTermsAndConditionsText($var)
    {
        GPBUtil::checkString($var, True);
        $this->terms_and_conditions_text = $var;

        return $this;
    }

    /**
     * URI to the terms and conditions of the promotion.
     *
     * Generated from protobuf field <code>string terms_and_conditions_uri = 15;</code>
     * @return string
     */
    public function getTermsAndConditionsUri()
    {
        return $this->terms_and_conditions_uri;
    }

    /**
     * URI to the terms and conditions of the promotion.
     *
     * Generated from protobuf field <code>string terms_and_conditions_uri = 15;</code>
     * @param string $var
     * @return $this
     */
    public function setTermsAndConditionsUri($var)
    {
        GPBUtil::checkString($var, True);
        $this->terms_and_conditions_uri = $var;

        return $this;
    }

    /**
     * Percentage off discount in the promotion. 1,000,000 = 100%.
     * Either this or money_amount_off is required.
     *
     * Generated from protobuf field <code>int64 percent_off = 3;</code>
     * @return int|string
     */
    public function getPercentOff()
    {
        return $this->readOneof(3);
    }

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

    /**
     * Percentage off discount in the promotion. 1,000,000 = 100%.
     * Either this or money_amount_off is required.
     *
     * Generated from protobuf field <code>int64 percent_off = 3;</code>
     * @param int|string $var
     * @return $this
     */
    public function setPercentOff($var)
    {
        GPBUtil::checkInt64($var);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Money amount off for discount in the promotion.
     * Either this or percent_off is required.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.common.Money money_amount_off = 4;</code>
     * @return \Google\Ads\GoogleAds\V23\Common\Money|null
     */
    public function getMoneyAmountOff()
    {
        return $this->readOneof(4);
    }

    public function hasMoneyAmountOff()
    {
        return $this->hasOneof(4);
    }

    /**
     * Money amount off for discount in the promotion.
     * Either this or percent_off is required.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.common.Money money_amount_off = 4;</code>
     * @param \Google\Ads\GoogleAds\V23\Common\Money $var
     * @return $this
     */
    public function setMoneyAmountOff($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V23\Common\Money::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * A code the user should use in order to be eligible for the promotion.
     *
     * Generated from protobuf field <code>string promotion_code = 5;</code>
     * @return string
     */
    public function getPromotionCode()
    {
        return $this->readOneof(5);
    }

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

    /**
     * A code the user should use in order to be eligible for the promotion.
     *
     * Generated from protobuf field <code>string promotion_code = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setPromotionCode($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * The amount the total order needs to be for the user to be eligible for
     * the promotion.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.common.Money orders_over_amount = 6;</code>
     * @return \Google\Ads\GoogleAds\V23\Common\Money|null
     */
    public function getOrdersOverAmount()
    {
        return $this->readOneof(6);
    }

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

    /**
     * The amount the total order needs to be for the user to be eligible for
     * the promotion.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.common.Money orders_over_amount = 6;</code>
     * @param \Google\Ads\GoogleAds\V23\Common\Money $var
     * @return $this
     */
    public function setOrdersOverAmount($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V23\Common\Money::class);
        $this->writeOneof(6, $var);

        return $this;
    }

    /**
     * Barcode info used to generate promotion barcode for user to be eligible
     * for the promotion.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.common.PromotionBarcodeInfo promotion_barcode_info = 16;</code>
     * @return \Google\Ads\GoogleAds\V23\Common\PromotionBarcodeInfo|null
     */
    public function getPromotionBarcodeInfo()
    {
        return $this->readOneof(16);
    }

    public function hasPromotionBarcodeInfo()
    {
        return $this->hasOneof(16);
    }

    /**
     * Barcode info used to generate promotion barcode for user to be eligible
     * for the promotion.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.common.PromotionBarcodeInfo promotion_barcode_info = 16;</code>
     * @param \Google\Ads\GoogleAds\V23\Common\PromotionBarcodeInfo $var
     * @return $this
     */
    public function setPromotionBarcodeInfo($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V23\Common\PromotionBarcodeInfo::class);
        $this->writeOneof(16, $var);

        return $this;
    }

    /**
     * QR code info used to generate promotion QR code for user to be eligible
     * for the promotion.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.common.PromotionQrCodeInfo promotion_qr_code_info = 17;</code>
     * @return \Google\Ads\GoogleAds\V23\Common\PromotionQrCodeInfo|null
     */
    public function getPromotionQrCodeInfo()
    {
        return $this->readOneof(17);
    }

    public function hasPromotionQrCodeInfo()
    {
        return $this->hasOneof(17);
    }

    /**
     * QR code info used to generate promotion QR code for user to be eligible
     * for the promotion.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v23.common.PromotionQrCodeInfo promotion_qr_code_info = 17;</code>
     * @param \Google\Ads\GoogleAds\V23\Common\PromotionQrCodeInfo $var
     * @return $this
     */
    public function setPromotionQrCodeInfo($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V23\Common\PromotionQrCodeInfo::class);
        $this->writeOneof(17, $var);

        return $this;
    }

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

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

}

