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

package com.azure.resourcemanager.securityinsights.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Resource provider permissions required for the connector. */
@Fluent
public class ResourceProvider {
    /*
     * Provider name
     */
    @JsonProperty(value = "provider")
    private ProviderName provider;

    /*
     * Permission description text
     */
    @JsonProperty(value = "permissionsDisplayText")
    private String permissionsDisplayText;

    /*
     * Permission provider display name
     */
    @JsonProperty(value = "providerDisplayName")
    private String providerDisplayName;

    /*
     * Permission provider scope
     */
    @JsonProperty(value = "scope")
    private PermissionProviderScope scope;

    /*
     * Required permissions for the connector
     */
    @JsonProperty(value = "requiredPermissions")
    private RequiredPermissions requiredPermissions;

    /**
     * Get the provider property: Provider name.
     *
     * @return the provider value.
     */
    public ProviderName provider() {
        return this.provider;
    }

    /**
     * Set the provider property: Provider name.
     *
     * @param provider the provider value to set.
     * @return the ResourceProvider object itself.
     */
    public ResourceProvider withProvider(ProviderName provider) {
        this.provider = provider;
        return this;
    }

    /**
     * Get the permissionsDisplayText property: Permission description text.
     *
     * @return the permissionsDisplayText value.
     */
    public String permissionsDisplayText() {
        return this.permissionsDisplayText;
    }

    /**
     * Set the permissionsDisplayText property: Permission description text.
     *
     * @param permissionsDisplayText the permissionsDisplayText value to set.
     * @return the ResourceProvider object itself.
     */
    public ResourceProvider withPermissionsDisplayText(String permissionsDisplayText) {
        this.permissionsDisplayText = permissionsDisplayText;
        return this;
    }

    /**
     * Get the providerDisplayName property: Permission provider display name.
     *
     * @return the providerDisplayName value.
     */
    public String providerDisplayName() {
        return this.providerDisplayName;
    }

    /**
     * Set the providerDisplayName property: Permission provider display name.
     *
     * @param providerDisplayName the providerDisplayName value to set.
     * @return the ResourceProvider object itself.
     */
    public ResourceProvider withProviderDisplayName(String providerDisplayName) {
        this.providerDisplayName = providerDisplayName;
        return this;
    }

    /**
     * Get the scope property: Permission provider scope.
     *
     * @return the scope value.
     */
    public PermissionProviderScope scope() {
        return this.scope;
    }

    /**
     * Set the scope property: Permission provider scope.
     *
     * @param scope the scope value to set.
     * @return the ResourceProvider object itself.
     */
    public ResourceProvider withScope(PermissionProviderScope scope) {
        this.scope = scope;
        return this;
    }

    /**
     * Get the requiredPermissions property: Required permissions for the connector.
     *
     * @return the requiredPermissions value.
     */
    public RequiredPermissions requiredPermissions() {
        return this.requiredPermissions;
    }

    /**
     * Set the requiredPermissions property: Required permissions for the connector.
     *
     * @param requiredPermissions the requiredPermissions value to set.
     * @return the ResourceProvider object itself.
     */
    public ResourceProvider withRequiredPermissions(RequiredPermissions requiredPermissions) {
        this.requiredPermissions = requiredPermissions;
        return this;
    }

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