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

package tsptest.armresourceprovider.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;
import tsptest.armresourceprovider.models.ProvisioningState;

/**
 * Top Level Arm Resource Properties.
 */
@Fluent
public final class TopLevelArmResourceProperties {
    /*
     * Configuration Endpoints.
     */
    @JsonProperty(value = "configurationEndpoints", access = JsonProperty.Access.WRITE_ONLY)
    private List<String> configurationEndpoints;

    /*
     * The userName property.
     */
    @JsonProperty(value = "userName", required = true)
    private String userName;

    /*
     * The userNames property.
     */
    @JsonProperty(value = "userNames", required = true)
    private String userNames;

    /*
     * The accuserName property.
     */
    @JsonProperty(value = "accuserName", required = true)
    private String accuserName;

    /*
     * The startTimeStamp property.
     */
    @JsonProperty(value = "startTimeStamp", required = true)
    private OffsetDateTime startTimeStamp;

    /*
     * The status of the last operation.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private ProvisioningState provisioningState;

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

    /**
     * Get the configurationEndpoints property: Configuration Endpoints.
     * 
     * @return the configurationEndpoints value.
     */
    public List<String> configurationEndpoints() {
        return this.configurationEndpoints;
    }

    /**
     * Get the userName property: The userName property.
     * 
     * @return the userName value.
     */
    public String userName() {
        return this.userName;
    }

    /**
     * Set the userName property: The userName property.
     * 
     * @param userName the userName value to set.
     * @return the TopLevelArmResourceProperties object itself.
     */
    public TopLevelArmResourceProperties withUserName(String userName) {
        this.userName = userName;
        return this;
    }

    /**
     * Get the userNames property: The userNames property.
     * 
     * @return the userNames value.
     */
    public String userNames() {
        return this.userNames;
    }

    /**
     * Set the userNames property: The userNames property.
     * 
     * @param userNames the userNames value to set.
     * @return the TopLevelArmResourceProperties object itself.
     */
    public TopLevelArmResourceProperties withUserNames(String userNames) {
        this.userNames = userNames;
        return this;
    }

    /**
     * Get the accuserName property: The accuserName property.
     * 
     * @return the accuserName value.
     */
    public String accuserName() {
        return this.accuserName;
    }

    /**
     * Set the accuserName property: The accuserName property.
     * 
     * @param accuserName the accuserName value to set.
     * @return the TopLevelArmResourceProperties object itself.
     */
    public TopLevelArmResourceProperties withAccuserName(String accuserName) {
        this.accuserName = accuserName;
        return this;
    }

    /**
     * Get the startTimeStamp property: The startTimeStamp property.
     * 
     * @return the startTimeStamp value.
     */
    public OffsetDateTime startTimeStamp() {
        return this.startTimeStamp;
    }

    /**
     * Set the startTimeStamp property: The startTimeStamp property.
     * 
     * @param startTimeStamp the startTimeStamp value to set.
     * @return the TopLevelArmResourceProperties object itself.
     */
    public TopLevelArmResourceProperties withStartTimeStamp(OffsetDateTime startTimeStamp) {
        this.startTimeStamp = startTimeStamp;
        return this;
    }

    /**
     * Get the provisioningState property: The status of the last operation.
     * 
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (userName() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property userName in model TopLevelArmResourceProperties"));
        }
        if (userNames() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property userNames in model TopLevelArmResourceProperties"));
        }
        if (accuserName() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property accuserName in model TopLevelArmResourceProperties"));
        }
        if (startTimeStamp() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property startTimeStamp in model TopLevelArmResourceProperties"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(TopLevelArmResourceProperties.class);
}
