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

namespace Google\Cloud\OsLogin\V1;

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

/**
 * The user profile information used for logging in to a virtual machine on
 * Google Compute Engine.
 *
 * Generated from protobuf message <code>google.cloud.oslogin.v1.LoginProfile</code>
 */
class LoginProfile extends \Google\Protobuf\Internal\Message
{
    /**
     * The primary email address that uniquely identifies the user.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    private $name = '';
    /**
     * The list of POSIX accounts associated with the user.
     *
     * Generated from protobuf field <code>repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2;</code>
     */
    private $posix_accounts;
    /**
     * A map from SSH public key fingerprint to the associated key object.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.oslogin.common.SshPublicKey> ssh_public_keys = 3;</code>
     */
    private $ssh_public_keys;
    /**
     * Indicates if the user is suspended. A suspended user cannot log in but
     * their profile information is retained.
     *
     * Generated from protobuf field <code>bool suspended = 4;</code>
     */
    private $suspended = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           The primary email address that uniquely identifies the user.
     *     @type \Google\Cloud\OsLogin\Common\PosixAccount[]|\Google\Protobuf\Internal\RepeatedField $posix_accounts
     *           The list of POSIX accounts associated with the user.
     *     @type array|\Google\Protobuf\Internal\MapField $ssh_public_keys
     *           A map from SSH public key fingerprint to the associated key object.
     *     @type bool $suspended
     *           Indicates if the user is suspended. A suspended user cannot log in but
     *           their profile information is retained.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Oslogin\V1\Oslogin::initOnce();
        parent::__construct($data);
    }

    /**
     * The primary email address that uniquely identifies the user.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * The primary email address that uniquely identifies the user.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * The list of POSIX accounts associated with the user.
     *
     * Generated from protobuf field <code>repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getPosixAccounts()
    {
        return $this->posix_accounts;
    }

    /**
     * The list of POSIX accounts associated with the user.
     *
     * Generated from protobuf field <code>repeated .google.cloud.oslogin.common.PosixAccount posix_accounts = 2;</code>
     * @param \Google\Cloud\OsLogin\Common\PosixAccount[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setPosixAccounts($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\OsLogin\Common\PosixAccount::class);
        $this->posix_accounts = $arr;

        return $this;
    }

    /**
     * A map from SSH public key fingerprint to the associated key object.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.oslogin.common.SshPublicKey> ssh_public_keys = 3;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getSshPublicKeys()
    {
        return $this->ssh_public_keys;
    }

    /**
     * A map from SSH public key fingerprint to the associated key object.
     *
     * Generated from protobuf field <code>map<string, .google.cloud.oslogin.common.SshPublicKey> ssh_public_keys = 3;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setSshPublicKeys($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\OsLogin\Common\SshPublicKey::class);
        $this->ssh_public_keys = $arr;

        return $this;
    }

    /**
     * Indicates if the user is suspended. A suspended user cannot log in but
     * their profile information is retained.
     *
     * Generated from protobuf field <code>bool suspended = 4;</code>
     * @return bool
     */
    public function getSuspended()
    {
        return $this->suspended;
    }

    /**
     * Indicates if the user is suspended. A suspended user cannot log in but
     * their profile information is retained.
     *
     * Generated from protobuf field <code>bool suspended = 4;</code>
     * @param bool $var
     * @return $this
     */
    public function setSuspended($var)
    {
        GPBUtil::checkBool($var);
        $this->suspended = $var;

        return $this;
    }

}

