<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/domains/v1/domains.proto

namespace Google\Cloud\Domains\V1;

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

/**
 * Request for the `SearchDomains` method.
 *
 * Generated from protobuf message <code>google.cloud.domains.v1.SearchDomainsRequest</code>
 */
class SearchDomainsRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. String used to search for available domain names.
     *
     * Generated from protobuf field <code>string query = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $query = '';
    /**
     * Required. The location. Must be in the format `projects/&#42;&#47;locations/&#42;`.
     *
     * Generated from protobuf field <code>string location = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $location = '';

    /**
     * @param string $location Required. The location. Must be in the format `projects/&#42;/locations/*`. Please see
     *                         {@see DomainsClient::locationName()} for help formatting this field.
     * @param string $query    Required. String used to search for available domain names.
     *
     * @return \Google\Cloud\Domains\V1\SearchDomainsRequest
     *
     * @experimental
     */
    public static function build(string $location, string $query): self
    {
        return (new self())
            ->setLocation($location)
            ->setQuery($query);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $query
     *           Required. String used to search for available domain names.
     *     @type string $location
     *           Required. The location. Must be in the format `projects/&#42;&#47;locations/&#42;`.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Domains\V1\Domains::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. String used to search for available domain names.
     *
     * Generated from protobuf field <code>string query = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getQuery()
    {
        return $this->query;
    }

    /**
     * Required. String used to search for available domain names.
     *
     * Generated from protobuf field <code>string query = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setQuery($var)
    {
        GPBUtil::checkString($var, True);
        $this->query = $var;

        return $this;
    }

    /**
     * Required. The location. Must be in the format `projects/&#42;&#47;locations/&#42;`.
     *
     * Generated from protobuf field <code>string location = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getLocation()
    {
        return $this->location;
    }

    /**
     * Required. The location. Must be in the format `projects/&#42;&#47;locations/&#42;`.
     *
     * Generated from protobuf field <code>string location = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setLocation($var)
    {
        GPBUtil::checkString($var, True);
        $this->location = $var;

        return $this;
    }

}

