// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.devtestlabs.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.resourcemanager.devtestlabs.models.UserIdentity;
import com.azure.resourcemanager.devtestlabs.models.UserSecretStore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.Map;

/** Profile of a lab user. */
@Fluent
public final class UserInner extends Resource {
    /*
     * The properties of the resource.
     */
    @JsonProperty(value = "properties")
    private UserProperties innerProperties;

    /** Creates an instance of UserInner class. */
    public UserInner() {
    }

    /**
     * Get the innerProperties property: The properties of the resource.
     *
     * @return the innerProperties value.
     */
    private UserProperties innerProperties() {
        return this.innerProperties;
    }

    /** {@inheritDoc} */
    @Override
    public UserInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public UserInner withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

    /**
     * Get the identity property: The identity of the user.
     *
     * @return the identity value.
     */
    public UserIdentity identity() {
        return this.innerProperties() == null ? null : this.innerProperties().identity();
    }

    /**
     * Set the identity property: The identity of the user.
     *
     * @param identity the identity value to set.
     * @return the UserInner object itself.
     */
    public UserInner withIdentity(UserIdentity identity) {
        if (this.innerProperties() == null) {
            this.innerProperties = new UserProperties();
        }
        this.innerProperties().withIdentity(identity);
        return this;
    }

    /**
     * Get the secretStore property: The secret store of the user.
     *
     * @return the secretStore value.
     */
    public UserSecretStore secretStore() {
        return this.innerProperties() == null ? null : this.innerProperties().secretStore();
    }

    /**
     * Set the secretStore property: The secret store of the user.
     *
     * @param secretStore the secretStore value to set.
     * @return the UserInner object itself.
     */
    public UserInner withSecretStore(UserSecretStore secretStore) {
        if (this.innerProperties() == null) {
            this.innerProperties = new UserProperties();
        }
        this.innerProperties().withSecretStore(secretStore);
        return this;
    }

    /**
     * Get the createdDate property: The creation date of the user profile.
     *
     * @return the createdDate value.
     */
    public OffsetDateTime createdDate() {
        return this.innerProperties() == null ? null : this.innerProperties().createdDate();
    }

    /**
     * Get the provisioningState property: The provisioning status of the resource.
     *
     * @return the provisioningState value.
     */
    public String provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid).
     *
     * @return the uniqueIdentifier value.
     */
    public String uniqueIdentifier() {
        return this.innerProperties() == null ? null : this.innerProperties().uniqueIdentifier();
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (innerProperties() != null) {
            innerProperties().validate();
        }
    }
}
