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

namespace Google\Ads\GoogleAds\V23\Resources\Invoice;

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

/**
 * Represents campaign level billable cost information associated with an
 * account budget.
 *
 * Generated from protobuf message <code>google.ads.googleads.v23.resources.Invoice.CampaignSummary</code>
 */
class CampaignSummary extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The description of the campaign. This is generally the same
     * as the campaign name, but may differ.
     *
     * Generated from protobuf field <code>optional string campaign_description = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $campaign_description = null;
    /**
     * Output only. The quantity served for the given unit of measure.
     *
     * Generated from protobuf field <code>optional int64 quantity = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $quantity = null;
    /**
     * Output only. The unit of measure for the quantity served.
     *
     * Generated from protobuf field <code>optional .google.ads.googleads.v23.enums.UnitOfMeasureEnum.UnitOfMeasure unit_of_measure = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $unit_of_measure = null;
    /**
     * Output only. The amount attributable to this campaign for the given unit
     * of measure during the service period, in micros. The currency code for
     * this amount is the same as the Invoice.currency_code.
     *
     * Generated from protobuf field <code>optional int64 amount_micros = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $amount_micros = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $campaign_description
     *           Output only. The description of the campaign. This is generally the same
     *           as the campaign name, but may differ.
     *     @type int|string $quantity
     *           Output only. The quantity served for the given unit of measure.
     *     @type int $unit_of_measure
     *           Output only. The unit of measure for the quantity served.
     *     @type int|string $amount_micros
     *           Output only. The amount attributable to this campaign for the given unit
     *           of measure during the service period, in micros. The currency code for
     *           this amount is the same as the Invoice.currency_code.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V23\Resources\Invoice::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. The description of the campaign. This is generally the same
     * as the campaign name, but may differ.
     *
     * Generated from protobuf field <code>optional string campaign_description = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getCampaignDescription()
    {
        return isset($this->campaign_description) ? $this->campaign_description : '';
    }

    public function hasCampaignDescription()
    {
        return isset($this->campaign_description);
    }

    public function clearCampaignDescription()
    {
        unset($this->campaign_description);
    }

    /**
     * Output only. The description of the campaign. This is generally the same
     * as the campaign name, but may differ.
     *
     * Generated from protobuf field <code>optional string campaign_description = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setCampaignDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->campaign_description = $var;

        return $this;
    }

    /**
     * Output only. The quantity served for the given unit of measure.
     *
     * Generated from protobuf field <code>optional int64 quantity = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int|string
     */
    public function getQuantity()
    {
        return isset($this->quantity) ? $this->quantity : 0;
    }

    public function hasQuantity()
    {
        return isset($this->quantity);
    }

    public function clearQuantity()
    {
        unset($this->quantity);
    }

    /**
     * Output only. The quantity served for the given unit of measure.
     *
     * Generated from protobuf field <code>optional int64 quantity = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int|string $var
     * @return $this
     */
    public function setQuantity($var)
    {
        GPBUtil::checkInt64($var);
        $this->quantity = $var;

        return $this;
    }

    /**
     * Output only. The unit of measure for the quantity served.
     *
     * Generated from protobuf field <code>optional .google.ads.googleads.v23.enums.UnitOfMeasureEnum.UnitOfMeasure unit_of_measure = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getUnitOfMeasure()
    {
        return isset($this->unit_of_measure) ? $this->unit_of_measure : 0;
    }

    public function hasUnitOfMeasure()
    {
        return isset($this->unit_of_measure);
    }

    public function clearUnitOfMeasure()
    {
        unset($this->unit_of_measure);
    }

    /**
     * Output only. The unit of measure for the quantity served.
     *
     * Generated from protobuf field <code>optional .google.ads.googleads.v23.enums.UnitOfMeasureEnum.UnitOfMeasure unit_of_measure = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setUnitOfMeasure($var)
    {
        GPBUtil::checkEnum($var, \Google\Ads\GoogleAds\V23\Enums\UnitOfMeasureEnum\UnitOfMeasure::class);
        $this->unit_of_measure = $var;

        return $this;
    }

    /**
     * Output only. The amount attributable to this campaign for the given unit
     * of measure during the service period, in micros. The currency code for
     * this amount is the same as the Invoice.currency_code.
     *
     * Generated from protobuf field <code>optional int64 amount_micros = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int|string
     */
    public function getAmountMicros()
    {
        return isset($this->amount_micros) ? $this->amount_micros : 0;
    }

    public function hasAmountMicros()
    {
        return isset($this->amount_micros);
    }

    public function clearAmountMicros()
    {
        unset($this->amount_micros);
    }

    /**
     * Output only. The amount attributable to this campaign for the given unit
     * of measure during the service period, in micros. The currency code for
     * this amount is the same as the Invoice.currency_code.
     *
     * Generated from protobuf field <code>optional int64 amount_micros = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int|string $var
     * @return $this
     */
    public function setAmountMicros($var)
    {
        GPBUtil::checkInt64($var);
        $this->amount_micros = $var;

        return $this;
    }

}

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

