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

package com.azure.resourcemanager.providerhub.models;

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

/** The ResourceProviderAuthentication model. */
@Fluent
public class ResourceProviderAuthentication {
    /*
     * The allowedAudiences property.
     */
    @JsonProperty(value = "allowedAudiences", required = true)
    private List<String> allowedAudiences;

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

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

    /**
     * Set the allowedAudiences property: The allowedAudiences property.
     *
     * @param allowedAudiences the allowedAudiences value to set.
     * @return the ResourceProviderAuthentication object itself.
     */
    public ResourceProviderAuthentication withAllowedAudiences(List<String> allowedAudiences) {
        this.allowedAudiences = allowedAudiences;
        return this;
    }

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

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