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

namespace Google\Ads\GoogleAds\V24\Resources;

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

/**
 * This report provides granular performance data, including cost metrics, for
 * each individual search term that triggered your ads. If keyword-related
 * segments are used, Performance Max data will be excluded from the results.
 *
 * Generated from protobuf message <code>google.ads.googleads.v24.resources.CampaignSearchTermView</code>
 */
class CampaignSearchTermView extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The resource name of the campaign search term view.
     * Campaign search term view resource names have the form:
     * `customers/{customer_id}/campaignSearchTermViews/{campaign_id}~{URL-base64_search_term}`
     *
     * Generated from protobuf field <code>string resource_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {</code>
     */
    protected $resource_name = '';
    /**
     * Output only. The search term.
     *
     * Generated from protobuf field <code>optional string search_term = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $search_term = null;
    /**
     * Output only. The campaign the search term served in.
     *
     * Generated from protobuf field <code>optional string campaign = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {</code>
     */
    protected $campaign = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *                    Optional. Data for populating the Message object.
     *
     * @type string $resource_name
     *           Output only. The resource name of the campaign search term view.
     *           Campaign search term view resource names have the form:
     *           `customers/{customer_id}/campaignSearchTermViews/{campaign_id}~{URL-base64_search_term}`
     * @type string $search_term
     *           Output only. The search term.
     * @type string $campaign
     *           Output only. The campaign the search term served in.
     * }
     */
    public function __construct($data = null)
    {
        \GPBMetadata\Google\Ads\GoogleAds\V24\Resources\CampaignSearchTermView::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. The resource name of the campaign search term view.
     * Campaign search term view resource names have the form:
     * `customers/{customer_id}/campaignSearchTermViews/{campaign_id}~{URL-base64_search_term}`
     *
     * Generated from protobuf field <code>string resource_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {</code>
     *
     * @return string
     */
    public function getResourceName()
    {
        return $this->resource_name;
    }

    /**
     * Output only. The resource name of the campaign search term view.
     * Campaign search term view resource names have the form:
     * `customers/{customer_id}/campaignSearchTermViews/{campaign_id}~{URL-base64_search_term}`
     *
     * Generated from protobuf field <code>string resource_name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {</code>
     *
     * @param  string $var
     * @return $this
     */
    public function setResourceName($var)
    {
        GPBUtil::checkString($var, true);
        $this->resource_name = $var;

        return $this;
    }

    /**
     * Output only. The search term.
     *
     * Generated from protobuf field <code>optional string search_term = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @return string
     */
    public function getSearchTerm()
    {
        return isset($this->search_term) ? $this->search_term : '';
    }

    public function hasSearchTerm()
    {
        return isset($this->search_term);
    }

    public function clearSearchTerm()
    {
        unset($this->search_term);
    }

    /**
     * Output only. The search term.
     *
     * Generated from protobuf field <code>optional string search_term = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     *
     * @param  string $var
     * @return $this
     */
    public function setSearchTerm($var)
    {
        GPBUtil::checkString($var, true);
        $this->search_term = $var;

        return $this;
    }

    /**
     * Output only. The campaign the search term served in.
     *
     * Generated from protobuf field <code>optional string campaign = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {</code>
     *
     * @return string
     */
    public function getCampaign()
    {
        return isset($this->campaign) ? $this->campaign : '';
    }

    public function hasCampaign()
    {
        return isset($this->campaign);
    }

    public function clearCampaign()
    {
        unset($this->campaign);
    }

    /**
     * Output only. The campaign the search term served in.
     *
     * Generated from protobuf field <code>optional string campaign = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = {</code>
     *
     * @param  string $var
     * @return $this
     */
    public function setCampaign($var)
    {
        GPBUtil::checkString($var, true);
        $this->campaign = $var;

        return $this;
    }

}

