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

namespace Google\Cloud\DiscoveryEngine\V1;

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

/**
 * User License information assigned by the admin.
 *
 * Generated from protobuf message <code>google.cloud.discoveryengine.v1.UserLicense</code>
 */
class UserLicense extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Immutable. The user principal of the User, could be email address
     * or other prinical identifier. This field is immutable. Admin assign
     * licenses based on the user principal.
     *
     * Generated from protobuf field <code>string user_principal = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $user_principal = '';
    /**
     * Optional. The user profile.
     * We user user full name(First name + Last name) as user profile.
     *
     * Generated from protobuf field <code>string user_profile = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $user_profile = '';
    /**
     * Output only. License assignment state of the user.
     * If the user is assigned with a license config, the user loggin will be
     * assigned with the license;
     * If the user's license assignment state is unassigned or unspecified, no
     * license config will be associated to the user;
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.UserLicense.LicenseAssignmentState license_assignment_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $license_assignment_state = 0;
    /**
     * Optional. The full resource name of the Subscription(LicenseConfig)
     * assigned to the user.
     *
     * Generated from protobuf field <code>string license_config = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     */
    protected $license_config = '';
    /**
     * Output only. User created timestamp.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $create_time = null;
    /**
     * Output only. User update timestamp.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $update_time = null;
    /**
     * Output only. User last logged in time.
     * If the user has not logged in yet, this field will be empty.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_login_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $last_login_time = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $user_principal
     *           Required. Immutable. The user principal of the User, could be email address
     *           or other prinical identifier. This field is immutable. Admin assign
     *           licenses based on the user principal.
     *     @type string $user_profile
     *           Optional. The user profile.
     *           We user user full name(First name + Last name) as user profile.
     *     @type int $license_assignment_state
     *           Output only. License assignment state of the user.
     *           If the user is assigned with a license config, the user loggin will be
     *           assigned with the license;
     *           If the user's license assignment state is unassigned or unspecified, no
     *           license config will be associated to the user;
     *     @type string $license_config
     *           Optional. The full resource name of the Subscription(LicenseConfig)
     *           assigned to the user.
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. User created timestamp.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           Output only. User update timestamp.
     *     @type \Google\Protobuf\Timestamp $last_login_time
     *           Output only. User last logged in time.
     *           If the user has not logged in yet, this field will be empty.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Discoveryengine\V1\UserLicense::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Immutable. The user principal of the User, could be email address
     * or other prinical identifier. This field is immutable. Admin assign
     * licenses based on the user principal.
     *
     * Generated from protobuf field <code>string user_principal = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getUserPrincipal()
    {
        return $this->user_principal;
    }

    /**
     * Required. Immutable. The user principal of the User, could be email address
     * or other prinical identifier. This field is immutable. Admin assign
     * licenses based on the user principal.
     *
     * Generated from protobuf field <code>string user_principal = 1 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setUserPrincipal($var)
    {
        GPBUtil::checkString($var, True);
        $this->user_principal = $var;

        return $this;
    }

    /**
     * Optional. The user profile.
     * We user user full name(First name + Last name) as user profile.
     *
     * Generated from protobuf field <code>string user_profile = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getUserProfile()
    {
        return $this->user_profile;
    }

    /**
     * Optional. The user profile.
     * We user user full name(First name + Last name) as user profile.
     *
     * Generated from protobuf field <code>string user_profile = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setUserProfile($var)
    {
        GPBUtil::checkString($var, True);
        $this->user_profile = $var;

        return $this;
    }

    /**
     * Output only. License assignment state of the user.
     * If the user is assigned with a license config, the user loggin will be
     * assigned with the license;
     * If the user's license assignment state is unassigned or unspecified, no
     * license config will be associated to the user;
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.UserLicense.LicenseAssignmentState license_assignment_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getLicenseAssignmentState()
    {
        return $this->license_assignment_state;
    }

    /**
     * Output only. License assignment state of the user.
     * If the user is assigned with a license config, the user loggin will be
     * assigned with the license;
     * If the user's license assignment state is unassigned or unspecified, no
     * license config will be associated to the user;
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.UserLicense.LicenseAssignmentState license_assignment_state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setLicenseAssignmentState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\DiscoveryEngine\V1\UserLicense\LicenseAssignmentState::class);
        $this->license_assignment_state = $var;

        return $this;
    }

    /**
     * Optional. The full resource name of the Subscription(LicenseConfig)
     * assigned to the user.
     *
     * Generated from protobuf field <code>string license_config = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getLicenseConfig()
    {
        return $this->license_config;
    }

    /**
     * Optional. The full resource name of the Subscription(LicenseConfig)
     * assigned to the user.
     *
     * Generated from protobuf field <code>string license_config = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setLicenseConfig($var)
    {
        GPBUtil::checkString($var, True);
        $this->license_config = $var;

        return $this;
    }

    /**
     * Output only. User created timestamp.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    public function hasCreateTime()
    {
        return isset($this->create_time);
    }

    public function clearCreateTime()
    {
        unset($this->create_time);
    }

    /**
     * Output only. User created timestamp.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->create_time = $var;

        return $this;
    }

    /**
     * Output only. User update timestamp.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getUpdateTime()
    {
        return $this->update_time;
    }

    public function hasUpdateTime()
    {
        return isset($this->update_time);
    }

    public function clearUpdateTime()
    {
        unset($this->update_time);
    }

    /**
     * Output only. User update timestamp.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setUpdateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->update_time = $var;

        return $this;
    }

    /**
     * Output only. User last logged in time.
     * If the user has not logged in yet, this field will be empty.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_login_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getLastLoginTime()
    {
        return $this->last_login_time;
    }

    public function hasLastLoginTime()
    {
        return isset($this->last_login_time);
    }

    public function clearLastLoginTime()
    {
        unset($this->last_login_time);
    }

    /**
     * Output only. User last logged in time.
     * If the user has not logged in yet, this field will be empty.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp last_login_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setLastLoginTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->last_login_time = $var;

        return $this;
    }

}

