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

namespace Google\Ads\GoogleAds\V21\Services;

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

/**
 * Request message for
 * [GoogleAdsService.Search][google.ads.googleads.v21.services.GoogleAdsService.Search].
 *
 * Generated from protobuf message <code>google.ads.googleads.v21.services.SearchGoogleAdsRequest</code>
 */
class SearchGoogleAdsRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The ID of the customer being queried.
     *
     * Generated from protobuf field <code>string customer_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $customer_id = '';
    /**
     * Required. The query string.
     *
     * Generated from protobuf field <code>string query = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $query = '';
    /**
     * Token of the page to retrieve. If not specified, the first
     * page of results will be returned. Use the value obtained from
     * `next_page_token` in the previous response in order to request
     * the next page of results.
     *
     * Generated from protobuf field <code>string page_token = 3;</code>
     */
    protected $page_token = '';
    /**
     * This field is deprecated and will be removed in
     * a future version of the API. As of v17, Google Ads API will return a
     * `PAGE_SIZE_NOT_SUPPORTED` error if this field is set in the request body.
     * See
     * https://ads-developers.googleblog.com/2024/07/upcoming-changes-to-page-size-in-google.html
     * to learn more details.
     *
     * Generated from protobuf field <code>int32 page_size = 4;</code>
     */
    protected $page_size = 0;
    /**
     * If true, the request is validated but not executed.
     *
     * Generated from protobuf field <code>bool validate_only = 5;</code>
     */
    protected $validate_only = false;
    /**
     * Settings that allow users to specify request count, summary row, and
     * results behavior.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v21.services.SearchSettings search_settings = 10;</code>
     */
    protected $search_settings = null;

    /**
     * @param string $customerId Required. The ID of the customer being queried.
     * @param string $query      Required. The query string.
     *
     * @return \Google\Ads\GoogleAds\V21\Services\SearchGoogleAdsRequest
     *
     * @experimental
     */
    public static function build(string $customerId, string $query): self
    {
        return (new self())
            ->setCustomerId($customerId)
            ->setQuery($query);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $customer_id
     *           Required. The ID of the customer being queried.
     *     @type string $query
     *           Required. The query string.
     *     @type string $page_token
     *           Token of the page to retrieve. If not specified, the first
     *           page of results will be returned. Use the value obtained from
     *           `next_page_token` in the previous response in order to request
     *           the next page of results.
     *     @type int $page_size
     *           This field is deprecated and will be removed in
     *           a future version of the API. As of v17, Google Ads API will return a
     *           `PAGE_SIZE_NOT_SUPPORTED` error if this field is set in the request body.
     *           See
     *           https://ads-developers.googleblog.com/2024/07/upcoming-changes-to-page-size-in-google.html
     *           to learn more details.
     *     @type bool $validate_only
     *           If true, the request is validated but not executed.
     *     @type \Google\Ads\GoogleAds\V21\Services\SearchSettings $search_settings
     *           Settings that allow users to specify request count, summary row, and
     *           results behavior.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Ads\GoogleAds\V21\Services\GoogleAdsService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The ID of the customer being queried.
     *
     * Generated from protobuf field <code>string customer_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getCustomerId()
    {
        return $this->customer_id;
    }

    /**
     * Required. The ID of the customer being queried.
     *
     * Generated from protobuf field <code>string customer_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setCustomerId($var)
    {
        GPBUtil::checkString($var, True);
        $this->customer_id = $var;

        return $this;
    }

    /**
     * Required. The query string.
     *
     * Generated from protobuf field <code>string query = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getQuery()
    {
        return $this->query;
    }

    /**
     * Required. The query string.
     *
     * Generated from protobuf field <code>string query = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setQuery($var)
    {
        GPBUtil::checkString($var, True);
        $this->query = $var;

        return $this;
    }

    /**
     * Token of the page to retrieve. If not specified, the first
     * page of results will be returned. Use the value obtained from
     * `next_page_token` in the previous response in order to request
     * the next page of results.
     *
     * Generated from protobuf field <code>string page_token = 3;</code>
     * @return string
     */
    public function getPageToken()
    {
        return $this->page_token;
    }

    /**
     * Token of the page to retrieve. If not specified, the first
     * page of results will be returned. Use the value obtained from
     * `next_page_token` in the previous response in order to request
     * the next page of results.
     *
     * Generated from protobuf field <code>string page_token = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setPageToken($var)
    {
        GPBUtil::checkString($var, True);
        $this->page_token = $var;

        return $this;
    }

    /**
     * This field is deprecated and will be removed in
     * a future version of the API. As of v17, Google Ads API will return a
     * `PAGE_SIZE_NOT_SUPPORTED` error if this field is set in the request body.
     * See
     * https://ads-developers.googleblog.com/2024/07/upcoming-changes-to-page-size-in-google.html
     * to learn more details.
     *
     * Generated from protobuf field <code>int32 page_size = 4;</code>
     * @return int
     */
    public function getPageSize()
    {
        return $this->page_size;
    }

    /**
     * This field is deprecated and will be removed in
     * a future version of the API. As of v17, Google Ads API will return a
     * `PAGE_SIZE_NOT_SUPPORTED` error if this field is set in the request body.
     * See
     * https://ads-developers.googleblog.com/2024/07/upcoming-changes-to-page-size-in-google.html
     * to learn more details.
     *
     * Generated from protobuf field <code>int32 page_size = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setPageSize($var)
    {
        GPBUtil::checkInt32($var);
        $this->page_size = $var;

        return $this;
    }

    /**
     * If true, the request is validated but not executed.
     *
     * Generated from protobuf field <code>bool validate_only = 5;</code>
     * @return bool
     */
    public function getValidateOnly()
    {
        return $this->validate_only;
    }

    /**
     * If true, the request is validated but not executed.
     *
     * Generated from protobuf field <code>bool validate_only = 5;</code>
     * @param bool $var
     * @return $this
     */
    public function setValidateOnly($var)
    {
        GPBUtil::checkBool($var);
        $this->validate_only = $var;

        return $this;
    }

    /**
     * Settings that allow users to specify request count, summary row, and
     * results behavior.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v21.services.SearchSettings search_settings = 10;</code>
     * @return \Google\Ads\GoogleAds\V21\Services\SearchSettings|null
     */
    public function getSearchSettings()
    {
        return $this->search_settings;
    }

    public function hasSearchSettings()
    {
        return isset($this->search_settings);
    }

    public function clearSearchSettings()
    {
        unset($this->search_settings);
    }

    /**
     * Settings that allow users to specify request count, summary row, and
     * results behavior.
     *
     * Generated from protobuf field <code>.google.ads.googleads.v21.services.SearchSettings search_settings = 10;</code>
     * @param \Google\Ads\GoogleAds\V21\Services\SearchSettings $var
     * @return $this
     */
    public function setSearchSettings($var)
    {
        GPBUtil::checkMessage($var, \Google\Ads\GoogleAds\V21\Services\SearchSettings::class);
        $this->search_settings = $var;

        return $this;
    }

}

