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

namespace Google\Apps\Chat\V1;

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

/**
 * A request to get direct message space based on the user resource.
 *
 * Generated from protobuf message <code>google.chat.v1.FindDirectMessageRequest</code>
 */
class FindDirectMessageRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Resource name of the user to find direct message with.
     * Format: `users/{user}`, where `{user}` is either the `id` for the
     * [person](https://developers.google.com/people/api/rest/v1/people) from the
     * People API, or the `id` for the
     * [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users)
     * in the Directory API. For example, if the People API profile ID is
     * `123456789`, you can find a direct message with that person by using
     * `users/123456789` as the `name`. When [authenticated as a
     * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user),
     * you can use the email as an alias for `{user}`. For example,
     * `users/example\@gmail.com` where `example\@gmail.com` is the email of the
     * Google Chat user.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $name = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Required. Resource name of the user to find direct message with.
     *           Format: `users/{user}`, where `{user}` is either the `id` for the
     *           [person](https://developers.google.com/people/api/rest/v1/people) from the
     *           People API, or the `id` for the
     *           [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users)
     *           in the Directory API. For example, if the People API profile ID is
     *           `123456789`, you can find a direct message with that person by using
     *           `users/123456789` as the `name`. When [authenticated as a
     *           user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user),
     *           you can use the email as an alias for `{user}`. For example,
     *           `users/example\@gmail.com` where `example\@gmail.com` is the email of the
     *           Google Chat user.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Chat\V1\Space::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Resource name of the user to find direct message with.
     * Format: `users/{user}`, where `{user}` is either the `id` for the
     * [person](https://developers.google.com/people/api/rest/v1/people) from the
     * People API, or the `id` for the
     * [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users)
     * in the Directory API. For example, if the People API profile ID is
     * `123456789`, you can find a direct message with that person by using
     * `users/123456789` as the `name`. When [authenticated as a
     * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user),
     * you can use the email as an alias for `{user}`. For example,
     * `users/example\@gmail.com` where `example\@gmail.com` is the email of the
     * Google Chat user.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Required. Resource name of the user to find direct message with.
     * Format: `users/{user}`, where `{user}` is either the `id` for the
     * [person](https://developers.google.com/people/api/rest/v1/people) from the
     * People API, or the `id` for the
     * [user](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users)
     * in the Directory API. For example, if the People API profile ID is
     * `123456789`, you can find a direct message with that person by using
     * `users/123456789` as the `name`. When [authenticated as a
     * user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user),
     * you can use the email as an alias for `{user}`. For example,
     * `users/example\@gmail.com` where `example\@gmail.com` is the email of the
     * Google Chat user.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

}

