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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
import com.azure.resourcemanager.appcontainers.models.AuthPlatform;
import com.azure.resourcemanager.appcontainers.models.GlobalValidation;
import com.azure.resourcemanager.appcontainers.models.HttpSettings;
import com.azure.resourcemanager.appcontainers.models.IdentityProviders;
import com.azure.resourcemanager.appcontainers.models.Login;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Configuration settings for the Azure ContainerApp Service Authentication / Authorization feature. */
@Fluent
public final class AuthConfigInner extends ProxyResource {
    /*
     * AuthConfig resource specific properties
     */
    @JsonProperty(value = "properties")
    private AuthConfigProperties innerProperties;

    /*
     * Azure Resource Manager metadata containing createdBy and modifiedBy information.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

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

    /**
     * Get the innerProperties property: AuthConfig resource specific properties.
     *
     * @return the innerProperties value.
     */
    private AuthConfigProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /**
     * Get the platform property: The configuration settings of the platform of ContainerApp Service
     * Authentication/Authorization.
     *
     * @return the platform value.
     */
    public AuthPlatform platform() {
        return this.innerProperties() == null ? null : this.innerProperties().platform();
    }

    /**
     * Set the platform property: The configuration settings of the platform of ContainerApp Service
     * Authentication/Authorization.
     *
     * @param platform the platform value to set.
     * @return the AuthConfigInner object itself.
     */
    public AuthConfigInner withPlatform(AuthPlatform platform) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AuthConfigProperties();
        }
        this.innerProperties().withPlatform(platform);
        return this;
    }

    /**
     * Get the globalValidation property: The configuration settings that determines the validation flow of users using
     * Service Authentication/Authorization.
     *
     * @return the globalValidation value.
     */
    public GlobalValidation globalValidation() {
        return this.innerProperties() == null ? null : this.innerProperties().globalValidation();
    }

    /**
     * Set the globalValidation property: The configuration settings that determines the validation flow of users using
     * Service Authentication/Authorization.
     *
     * @param globalValidation the globalValidation value to set.
     * @return the AuthConfigInner object itself.
     */
    public AuthConfigInner withGlobalValidation(GlobalValidation globalValidation) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AuthConfigProperties();
        }
        this.innerProperties().withGlobalValidation(globalValidation);
        return this;
    }

    /**
     * Get the identityProviders property: The configuration settings of each of the identity providers used to
     * configure ContainerApp Service Authentication/Authorization.
     *
     * @return the identityProviders value.
     */
    public IdentityProviders identityProviders() {
        return this.innerProperties() == null ? null : this.innerProperties().identityProviders();
    }

    /**
     * Set the identityProviders property: The configuration settings of each of the identity providers used to
     * configure ContainerApp Service Authentication/Authorization.
     *
     * @param identityProviders the identityProviders value to set.
     * @return the AuthConfigInner object itself.
     */
    public AuthConfigInner withIdentityProviders(IdentityProviders identityProviders) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AuthConfigProperties();
        }
        this.innerProperties().withIdentityProviders(identityProviders);
        return this;
    }

    /**
     * Get the login property: The configuration settings of the login flow of users using ContainerApp Service
     * Authentication/Authorization.
     *
     * @return the login value.
     */
    public Login login() {
        return this.innerProperties() == null ? null : this.innerProperties().login();
    }

    /**
     * Set the login property: The configuration settings of the login flow of users using ContainerApp Service
     * Authentication/Authorization.
     *
     * @param login the login value to set.
     * @return the AuthConfigInner object itself.
     */
    public AuthConfigInner withLogin(Login login) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AuthConfigProperties();
        }
        this.innerProperties().withLogin(login);
        return this;
    }

    /**
     * Get the httpSettings property: The configuration settings of the HTTP requests for authentication and
     * authorization requests made against ContainerApp Service Authentication/Authorization.
     *
     * @return the httpSettings value.
     */
    public HttpSettings httpSettings() {
        return this.innerProperties() == null ? null : this.innerProperties().httpSettings();
    }

    /**
     * Set the httpSettings property: The configuration settings of the HTTP requests for authentication and
     * authorization requests made against ContainerApp Service Authentication/Authorization.
     *
     * @param httpSettings the httpSettings value to set.
     * @return the AuthConfigInner object itself.
     */
    public AuthConfigInner withHttpSettings(HttpSettings httpSettings) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AuthConfigProperties();
        }
        this.innerProperties().withHttpSettings(httpSettings);
        return this;
    }

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