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

namespace Google\Ads\GoogleAds\V20\Services;

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

/**
 * Request message for
 * [GeoTargetConstantService.SuggestGeoTargetConstants][google.ads.googleads.v20.services.GeoTargetConstantService.SuggestGeoTargetConstants].
 *
 * Generated from protobuf message <code>google.ads.googleads.v20.services.SuggestGeoTargetConstantsRequest</code>
 */
class SuggestGeoTargetConstantsRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * If possible, returned geo targets are translated using this locale. If not,
     * en is used by default. This is also used as a hint for returned geo
     * targets.
     *
     * Generated from protobuf field <code>optional string locale = 6;</code>
     */
    protected $locale = null;
    /**
     * Returned geo targets are restricted to this country code.
     *
     * Generated from protobuf field <code>optional string country_code = 7;</code>
     */
    protected $country_code = null;
    protected $query;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $locale
     *           If possible, returned geo targets are translated using this locale. If not,
     *           en is used by default. This is also used as a hint for returned geo
     *           targets.
     *     @type string $country_code
     *           Returned geo targets are restricted to this country code.
     *     @type \Google\Ads\GoogleAds\V20\Services\SuggestGeoTargetConstantsRequest\LocationNames $location_names
     *           The location names to search by. At most 25 names can be set.
     *     @type \Google\Ads\GoogleAds\V20\Services\SuggestGeoTargetConstantsRequest\GeoTargets $geo_targets
     *           The geo target constant resource names to filter by.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V20\Services\GeoTargetConstantService::initOnce();
        parent::__construct($data);
    }

    /**
     * If possible, returned geo targets are translated using this locale. If not,
     * en is used by default. This is also used as a hint for returned geo
     * targets.
     *
     * Generated from protobuf field <code>optional string locale = 6;</code>
     * @return string
     */
    public function getLocale()
    {
        return isset($this->locale) ? $this->locale : '';
    }

    public function hasLocale()
    {
        return isset($this->locale);
    }

    public function clearLocale()
    {
        unset($this->locale);
    }

    /**
     * If possible, returned geo targets are translated using this locale. If not,
     * en is used by default. This is also used as a hint for returned geo
     * targets.
     *
     * Generated from protobuf field <code>optional string locale = 6;</code>
     * @param string $var
     * @return $this
     */
    public function setLocale($var)
    {
        GPBUtil::checkString($var, True);
        $this->locale = $var;

        return $this;
    }

    /**
     * Returned geo targets are restricted to this country code.
     *
     * Generated from protobuf field <code>optional string country_code = 7;</code>
     * @return string
     */
    public function getCountryCode()
    {
        return isset($this->country_code) ? $this->country_code : '';
    }

    public function hasCountryCode()
    {
        return isset($this->country_code);
    }

    public function clearCountryCode()
    {
        unset($this->country_code);
    }

    /**
     * Returned geo targets are restricted to this country code.
     *
     * Generated from protobuf field <code>optional string country_code = 7;</code>
     * @param string $var
     * @return $this
     */
    public function setCountryCode($var)
    {
        GPBUtil::checkString($var, True);
        $this->country_code = $var;

        return $this;
    }

    /**
     * The location names to search by. At most 25 names can be set.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v20.services.SuggestGeoTargetConstantsRequest.LocationNames location_names = 1;</code>
     * @return \Google\Ads\GoogleAds\V20\Services\SuggestGeoTargetConstantsRequest\LocationNames|null
     */
    public function getLocationNames()
    {
        return $this->readOneof(1);
    }

    public function hasLocationNames()
    {
        return $this->hasOneof(1);
    }

    /**
     * The location names to search by. At most 25 names can be set.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v20.services.SuggestGeoTargetConstantsRequest.LocationNames location_names = 1;</code>
     * @param \Google\Ads\GoogleAds\V20\Services\SuggestGeoTargetConstantsRequest\LocationNames $var
     * @return $this
     */
    public function setLocationNames($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V20\Services\SuggestGeoTargetConstantsRequest\LocationNames::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * The geo target constant resource names to filter by.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v20.services.SuggestGeoTargetConstantsRequest.GeoTargets geo_targets = 2;</code>
     * @return \Google\Ads\GoogleAds\V20\Services\SuggestGeoTargetConstantsRequest\GeoTargets|null
     */
    public function getGeoTargets()
    {
        return $this->readOneof(2);
    }

    public function hasGeoTargets()
    {
        return $this->hasOneof(2);
    }

    /**
     * The geo target constant resource names to filter by.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v20.services.SuggestGeoTargetConstantsRequest.GeoTargets geo_targets = 2;</code>
     * @param \Google\Ads\GoogleAds\V20\Services\SuggestGeoTargetConstantsRequest\GeoTargets $var
     * @return $this
     */
    public function setGeoTargets($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V20\Services\SuggestGeoTargetConstantsRequest\GeoTargets::class);
        $this->writeOneof(2, $var);

        return $this;
    }

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

}

