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

package com.azure.resourcemanager.datalakestore.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.datalakestore.fluent.models.CreateOrUpdateTrustedIdProviderProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The parameters used to create a new trusted identity provider. */
@Fluent
public final class CreateOrUpdateTrustedIdProviderParameters {
    /*
     * The trusted identity provider properties to use when creating a new trusted identity provider.
     */
    @JsonProperty(value = "properties", required = true)
    private CreateOrUpdateTrustedIdProviderProperties innerProperties = new CreateOrUpdateTrustedIdProviderProperties();

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

    /**
     * Get the innerProperties property: The trusted identity provider properties to use when creating a new trusted
     * identity provider.
     *
     * @return the innerProperties value.
     */
    private CreateOrUpdateTrustedIdProviderProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the idProvider property: The URL of this trusted identity provider.
     *
     * @return the idProvider value.
     */
    public String idProvider() {
        return this.innerProperties() == null ? null : this.innerProperties().idProvider();
    }

    /**
     * Set the idProvider property: The URL of this trusted identity provider.
     *
     * @param idProvider the idProvider value to set.
     * @return the CreateOrUpdateTrustedIdProviderParameters object itself.
     */
    public CreateOrUpdateTrustedIdProviderParameters withIdProvider(String idProvider) {
        if (this.innerProperties() == null) {
            this.innerProperties = new CreateOrUpdateTrustedIdProviderProperties();
        }
        this.innerProperties().withIdProvider(idProvider);
        return this;
    }

    /**
     * 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"
                            + " CreateOrUpdateTrustedIdProviderParameters"));
        } else {
            innerProperties().validate();
        }
    }

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