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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;

/** OpenID Connect Providers Contract. */
@Fluent
public final class OpenidConnectProviderContractProperties {
    /*
     * User-friendly OpenID Connect Provider name.
     */
    @JsonProperty(value = "displayName", required = true)
    private String displayName;

    /*
     * User-friendly description of OpenID Connect Provider.
     */
    @JsonProperty(value = "description")
    private String description;

    /*
     * Metadata endpoint URI.
     */
    @JsonProperty(value = "metadataEndpoint", required = true)
    private String metadataEndpoint;

    /*
     * Client ID of developer console which is the client application.
     */
    @JsonProperty(value = "clientId", required = true)
    private String clientId;

    /*
     * Client Secret of developer console which is the client application.
     */
    @JsonProperty(value = "clientSecret")
    private String clientSecret;

    /**
     * Get the displayName property: User-friendly OpenID Connect Provider name.
     *
     * @return the displayName value.
     */
    public String displayName() {
        return this.displayName;
    }

    /**
     * Set the displayName property: User-friendly OpenID Connect Provider name.
     *
     * @param displayName the displayName value to set.
     * @return the OpenidConnectProviderContractProperties object itself.
     */
    public OpenidConnectProviderContractProperties withDisplayName(String displayName) {
        this.displayName = displayName;
        return this;
    }

    /**
     * Get the description property: User-friendly description of OpenID Connect Provider.
     *
     * @return the description value.
     */
    public String description() {
        return this.description;
    }

    /**
     * Set the description property: User-friendly description of OpenID Connect Provider.
     *
     * @param description the description value to set.
     * @return the OpenidConnectProviderContractProperties object itself.
     */
    public OpenidConnectProviderContractProperties withDescription(String description) {
        this.description = description;
        return this;
    }

    /**
     * Get the metadataEndpoint property: Metadata endpoint URI.
     *
     * @return the metadataEndpoint value.
     */
    public String metadataEndpoint() {
        return this.metadataEndpoint;
    }

    /**
     * Set the metadataEndpoint property: Metadata endpoint URI.
     *
     * @param metadataEndpoint the metadataEndpoint value to set.
     * @return the OpenidConnectProviderContractProperties object itself.
     */
    public OpenidConnectProviderContractProperties withMetadataEndpoint(String metadataEndpoint) {
        this.metadataEndpoint = metadataEndpoint;
        return this;
    }

    /**
     * Get the clientId property: Client ID of developer console which is the client application.
     *
     * @return the clientId value.
     */
    public String clientId() {
        return this.clientId;
    }

    /**
     * Set the clientId property: Client ID of developer console which is the client application.
     *
     * @param clientId the clientId value to set.
     * @return the OpenidConnectProviderContractProperties object itself.
     */
    public OpenidConnectProviderContractProperties withClientId(String clientId) {
        this.clientId = clientId;
        return this;
    }

    /**
     * Get the clientSecret property: Client Secret of developer console which is the client application.
     *
     * @return the clientSecret value.
     */
    public String clientSecret() {
        return this.clientSecret;
    }

    /**
     * Set the clientSecret property: Client Secret of developer console which is the client application.
     *
     * @param clientSecret the clientSecret value to set.
     * @return the OpenidConnectProviderContractProperties object itself.
     */
    public OpenidConnectProviderContractProperties withClientSecret(String clientSecret) {
        this.clientSecret = clientSecret;
        return this;
    }

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

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