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

namespace Google\Cloud\Sql\V1beta4;

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

/**
 * Read-only password status.
 *
 * Generated from protobuf message <code>google.cloud.sql.v1beta4.PasswordStatus</code>
 */
class PasswordStatus extends \Google\Protobuf\Internal\Message
{
    /**
     * If true, user does not have login privileges.
     *
     * Generated from protobuf field <code>bool locked = 1;</code>
     */
    private $locked = false;
    /**
     * The expiration time of the current password.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp password_expiration_time = 2;</code>
     */
    private $password_expiration_time = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type bool $locked
     *           If true, user does not have login privileges.
     *     @type \Google\Protobuf\Timestamp $password_expiration_time
     *           The expiration time of the current password.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Sql\V1Beta4\CloudSqlUsers::initOnce();
        parent::__construct($data);
    }

    /**
     * If true, user does not have login privileges.
     *
     * Generated from protobuf field <code>bool locked = 1;</code>
     * @return bool
     */
    public function getLocked()
    {
        return $this->locked;
    }

    /**
     * If true, user does not have login privileges.
     *
     * Generated from protobuf field <code>bool locked = 1;</code>
     * @param bool $var
     * @return $this
     */
    public function setLocked($var)
    {
        GPBUtil::checkBool($var);
        $this->locked = $var;

        return $this;
    }

    /**
     * The expiration time of the current password.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp password_expiration_time = 2;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getPasswordExpirationTime()
    {
        return $this->password_expiration_time;
    }

    public function hasPasswordExpirationTime()
    {
        return isset($this->password_expiration_time);
    }

    public function clearPasswordExpirationTime()
    {
        unset($this->password_expiration_time);
    }

    /**
     * The expiration time of the current password.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp password_expiration_time = 2;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setPasswordExpirationTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->password_expiration_time = $var;

        return $this;
    }

}

