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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.dynatrace.models.ProvisioningState;
import com.azure.resourcemanager.dynatrace.models.SingleSignOnStates;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Single sign-on configurations for a given monitor resource. */
@Fluent
public final class DynatraceSingleSignOnResourceInner extends ProxyResource {
    /*
     * The resource-specific properties for this resource.
     */
    @JsonProperty(value = "properties", required = true)
    private DynatraceSingleSignOnProperties innerProperties = new DynatraceSingleSignOnProperties();

    /*
     * System metadata for this resource.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

    /**
     * Get the innerProperties property: The resource-specific properties for this resource.
     *
     * @return the innerProperties value.
     */
    private DynatraceSingleSignOnProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the systemData property: System metadata for this resource.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /**
     * Get the singleSignOnState property: State of Single Sign On.
     *
     * @return the singleSignOnState value.
     */
    public SingleSignOnStates singleSignOnState() {
        return this.innerProperties() == null ? null : this.innerProperties().singleSignOnState();
    }

    /**
     * Set the singleSignOnState property: State of Single Sign On.
     *
     * @param singleSignOnState the singleSignOnState value to set.
     * @return the DynatraceSingleSignOnResourceInner object itself.
     */
    public DynatraceSingleSignOnResourceInner withSingleSignOnState(SingleSignOnStates singleSignOnState) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DynatraceSingleSignOnProperties();
        }
        this.innerProperties().withSingleSignOnState(singleSignOnState);
        return this;
    }

    /**
     * Get the enterpriseAppId property: Version of the Dynatrace agent installed on the VM.
     *
     * @return the enterpriseAppId value.
     */
    public String enterpriseAppId() {
        return this.innerProperties() == null ? null : this.innerProperties().enterpriseAppId();
    }

    /**
     * Set the enterpriseAppId property: Version of the Dynatrace agent installed on the VM.
     *
     * @param enterpriseAppId the enterpriseAppId value to set.
     * @return the DynatraceSingleSignOnResourceInner object itself.
     */
    public DynatraceSingleSignOnResourceInner withEnterpriseAppId(String enterpriseAppId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DynatraceSingleSignOnProperties();
        }
        this.innerProperties().withEnterpriseAppId(enterpriseAppId);
        return this;
    }

    /**
     * Get the singleSignOnUrl property: The login URL specific to this Dynatrace Environment.
     *
     * @return the singleSignOnUrl value.
     */
    public String singleSignOnUrl() {
        return this.innerProperties() == null ? null : this.innerProperties().singleSignOnUrl();
    }

    /**
     * Set the singleSignOnUrl property: The login URL specific to this Dynatrace Environment.
     *
     * @param singleSignOnUrl the singleSignOnUrl value to set.
     * @return the DynatraceSingleSignOnResourceInner object itself.
     */
    public DynatraceSingleSignOnResourceInner withSingleSignOnUrl(String singleSignOnUrl) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DynatraceSingleSignOnProperties();
        }
        this.innerProperties().withSingleSignOnUrl(singleSignOnUrl);
        return this;
    }

    /**
     * Get the aadDomains property: array of Aad(azure active directory) domains.
     *
     * @return the aadDomains value.
     */
    public List<String> aadDomains() {
        return this.innerProperties() == null ? null : this.innerProperties().aadDomains();
    }

    /**
     * Set the aadDomains property: array of Aad(azure active directory) domains.
     *
     * @param aadDomains the aadDomains value to set.
     * @return the DynatraceSingleSignOnResourceInner object itself.
     */
    public DynatraceSingleSignOnResourceInner withAadDomains(List<String> aadDomains) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DynatraceSingleSignOnProperties();
        }
        this.innerProperties().withAadDomains(aadDomains);
        return this;
    }

    /**
     * Get the provisioningState property: Provisioning state of the resource.
     *
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (innerProperties() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property innerProperties in model DynatraceSingleSignOnResourceInner"));
        } else {
            innerProperties().validate();
        }
    }

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