// 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.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The ThirdPartyProviderAuthorization model. */
@Fluent
public class ThirdPartyProviderAuthorization {
    /*
     * The authorizations property.
     */
    @JsonProperty(value = "authorizations")
    private List<LightHouseAuthorization> authorizations;

    /*
     * The managedByTenantId property.
     */
    @JsonProperty(value = "managedByTenantId")
    private String managedByTenantId;

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

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

    /**
     * Set the authorizations property: The authorizations property.
     *
     * @param authorizations the authorizations value to set.
     * @return the ThirdPartyProviderAuthorization object itself.
     */
    public ThirdPartyProviderAuthorization withAuthorizations(List<LightHouseAuthorization> authorizations) {
        this.authorizations = authorizations;
        return this;
    }

    /**
     * Get the managedByTenantId property: The managedByTenantId property.
     *
     * @return the managedByTenantId value.
     */
    public String managedByTenantId() {
        return this.managedByTenantId;
    }

    /**
     * Set the managedByTenantId property: The managedByTenantId property.
     *
     * @param managedByTenantId the managedByTenantId value to set.
     * @return the ThirdPartyProviderAuthorization object itself.
     */
    public ThirdPartyProviderAuthorization withManagedByTenantId(String managedByTenantId) {
        this.managedByTenantId = managedByTenantId;
        return this;
    }

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