// 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.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Config to describe the instructions blade. */
@Fluent
public final class CodelessUiConnectorConfigProperties {
    /*
     * Connector blade title
     */
    @JsonProperty(value = "title", required = true)
    private String title;

    /*
     * Connector publisher name
     */
    @JsonProperty(value = "publisher", required = true)
    private String publisher;

    /*
     * Connector description
     */
    @JsonProperty(value = "descriptionMarkdown", required = true)
    private String descriptionMarkdown;

    /*
     * An optional custom image to be used when displaying the connector within Azure Sentinel's connector's gallery
     */
    @JsonProperty(value = "customImage")
    private String customImage;

    /*
     * Name of the table the connector will insert the data to
     */
    @JsonProperty(value = "graphQueriesTableName", required = true)
    private String graphQueriesTableName;

    /*
     * The graph query to show the current data status
     */
    @JsonProperty(value = "graphQueries", required = true)
    private List<CodelessUiConnectorConfigPropertiesGraphQueriesItem> graphQueries;

    /*
     * The sample queries for the connector
     */
    @JsonProperty(value = "sampleQueries", required = true)
    private List<CodelessUiConnectorConfigPropertiesSampleQueriesItem> sampleQueries;

    /*
     * Data types to check for last data received
     */
    @JsonProperty(value = "dataTypes", required = true)
    private List<CodelessUiConnectorConfigPropertiesDataTypesItem> dataTypes;

    /*
     * Define the way the connector check connectivity
     */
    @JsonProperty(value = "connectivityCriteria", required = true)
    private List<CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem> connectivityCriteria;

    /*
     * Connector Availability Status
     */
    @JsonProperty(value = "availability", required = true)
    private Availability availability;

    /*
     * Permissions required for the connector
     */
    @JsonProperty(value = "permissions", required = true)
    private Permissions permissions;

    /*
     * Instruction steps to enable the connector
     */
    @JsonProperty(value = "instructionSteps", required = true)
    private List<CodelessUiConnectorConfigPropertiesInstructionStepsItem> instructionSteps;

    /**
     * Get the title property: Connector blade title.
     *
     * @return the title value.
     */
    public String title() {
        return this.title;
    }

    /**
     * Set the title property: Connector blade title.
     *
     * @param title the title value to set.
     * @return the CodelessUiConnectorConfigProperties object itself.
     */
    public CodelessUiConnectorConfigProperties withTitle(String title) {
        this.title = title;
        return this;
    }

    /**
     * Get the publisher property: Connector publisher name.
     *
     * @return the publisher value.
     */
    public String publisher() {
        return this.publisher;
    }

    /**
     * Set the publisher property: Connector publisher name.
     *
     * @param publisher the publisher value to set.
     * @return the CodelessUiConnectorConfigProperties object itself.
     */
    public CodelessUiConnectorConfigProperties withPublisher(String publisher) {
        this.publisher = publisher;
        return this;
    }

    /**
     * Get the descriptionMarkdown property: Connector description.
     *
     * @return the descriptionMarkdown value.
     */
    public String descriptionMarkdown() {
        return this.descriptionMarkdown;
    }

    /**
     * Set the descriptionMarkdown property: Connector description.
     *
     * @param descriptionMarkdown the descriptionMarkdown value to set.
     * @return the CodelessUiConnectorConfigProperties object itself.
     */
    public CodelessUiConnectorConfigProperties withDescriptionMarkdown(String descriptionMarkdown) {
        this.descriptionMarkdown = descriptionMarkdown;
        return this;
    }

    /**
     * Get the customImage property: An optional custom image to be used when displaying the connector within Azure
     * Sentinel's connector's gallery.
     *
     * @return the customImage value.
     */
    public String customImage() {
        return this.customImage;
    }

    /**
     * Set the customImage property: An optional custom image to be used when displaying the connector within Azure
     * Sentinel's connector's gallery.
     *
     * @param customImage the customImage value to set.
     * @return the CodelessUiConnectorConfigProperties object itself.
     */
    public CodelessUiConnectorConfigProperties withCustomImage(String customImage) {
        this.customImage = customImage;
        return this;
    }

    /**
     * Get the graphQueriesTableName property: Name of the table the connector will insert the data to.
     *
     * @return the graphQueriesTableName value.
     */
    public String graphQueriesTableName() {
        return this.graphQueriesTableName;
    }

    /**
     * Set the graphQueriesTableName property: Name of the table the connector will insert the data to.
     *
     * @param graphQueriesTableName the graphQueriesTableName value to set.
     * @return the CodelessUiConnectorConfigProperties object itself.
     */
    public CodelessUiConnectorConfigProperties withGraphQueriesTableName(String graphQueriesTableName) {
        this.graphQueriesTableName = graphQueriesTableName;
        return this;
    }

    /**
     * Get the graphQueries property: The graph query to show the current data status.
     *
     * @return the graphQueries value.
     */
    public List<CodelessUiConnectorConfigPropertiesGraphQueriesItem> graphQueries() {
        return this.graphQueries;
    }

    /**
     * Set the graphQueries property: The graph query to show the current data status.
     *
     * @param graphQueries the graphQueries value to set.
     * @return the CodelessUiConnectorConfigProperties object itself.
     */
    public CodelessUiConnectorConfigProperties withGraphQueries(
        List<CodelessUiConnectorConfigPropertiesGraphQueriesItem> graphQueries) {
        this.graphQueries = graphQueries;
        return this;
    }

    /**
     * Get the sampleQueries property: The sample queries for the connector.
     *
     * @return the sampleQueries value.
     */
    public List<CodelessUiConnectorConfigPropertiesSampleQueriesItem> sampleQueries() {
        return this.sampleQueries;
    }

    /**
     * Set the sampleQueries property: The sample queries for the connector.
     *
     * @param sampleQueries the sampleQueries value to set.
     * @return the CodelessUiConnectorConfigProperties object itself.
     */
    public CodelessUiConnectorConfigProperties withSampleQueries(
        List<CodelessUiConnectorConfigPropertiesSampleQueriesItem> sampleQueries) {
        this.sampleQueries = sampleQueries;
        return this;
    }

    /**
     * Get the dataTypes property: Data types to check for last data received.
     *
     * @return the dataTypes value.
     */
    public List<CodelessUiConnectorConfigPropertiesDataTypesItem> dataTypes() {
        return this.dataTypes;
    }

    /**
     * Set the dataTypes property: Data types to check for last data received.
     *
     * @param dataTypes the dataTypes value to set.
     * @return the CodelessUiConnectorConfigProperties object itself.
     */
    public CodelessUiConnectorConfigProperties withDataTypes(
        List<CodelessUiConnectorConfigPropertiesDataTypesItem> dataTypes) {
        this.dataTypes = dataTypes;
        return this;
    }

    /**
     * Get the connectivityCriteria property: Define the way the connector check connectivity.
     *
     * @return the connectivityCriteria value.
     */
    public List<CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem> connectivityCriteria() {
        return this.connectivityCriteria;
    }

    /**
     * Set the connectivityCriteria property: Define the way the connector check connectivity.
     *
     * @param connectivityCriteria the connectivityCriteria value to set.
     * @return the CodelessUiConnectorConfigProperties object itself.
     */
    public CodelessUiConnectorConfigProperties withConnectivityCriteria(
        List<CodelessUiConnectorConfigPropertiesConnectivityCriteriaItem> connectivityCriteria) {
        this.connectivityCriteria = connectivityCriteria;
        return this;
    }

    /**
     * Get the availability property: Connector Availability Status.
     *
     * @return the availability value.
     */
    public Availability availability() {
        return this.availability;
    }

    /**
     * Set the availability property: Connector Availability Status.
     *
     * @param availability the availability value to set.
     * @return the CodelessUiConnectorConfigProperties object itself.
     */
    public CodelessUiConnectorConfigProperties withAvailability(Availability availability) {
        this.availability = availability;
        return this;
    }

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

    /**
     * Set the permissions property: Permissions required for the connector.
     *
     * @param permissions the permissions value to set.
     * @return the CodelessUiConnectorConfigProperties object itself.
     */
    public CodelessUiConnectorConfigProperties withPermissions(Permissions permissions) {
        this.permissions = permissions;
        return this;
    }

    /**
     * Get the instructionSteps property: Instruction steps to enable the connector.
     *
     * @return the instructionSteps value.
     */
    public List<CodelessUiConnectorConfigPropertiesInstructionStepsItem> instructionSteps() {
        return this.instructionSteps;
    }

    /**
     * Set the instructionSteps property: Instruction steps to enable the connector.
     *
     * @param instructionSteps the instructionSteps value to set.
     * @return the CodelessUiConnectorConfigProperties object itself.
     */
    public CodelessUiConnectorConfigProperties withInstructionSteps(
        List<CodelessUiConnectorConfigPropertiesInstructionStepsItem> instructionSteps) {
        this.instructionSteps = instructionSteps;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (title() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property title in model CodelessUiConnectorConfigProperties"));
        }
        if (publisher() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property publisher in model CodelessUiConnectorConfigProperties"));
        }
        if (descriptionMarkdown() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property descriptionMarkdown in model CodelessUiConnectorConfigProperties"));
        }
        if (graphQueriesTableName() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property graphQueriesTableName in model"
                            + " CodelessUiConnectorConfigProperties"));
        }
        if (graphQueries() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property graphQueries in model CodelessUiConnectorConfigProperties"));
        } else {
            graphQueries().forEach(e -> e.validate());
        }
        if (sampleQueries() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property sampleQueries in model CodelessUiConnectorConfigProperties"));
        } else {
            sampleQueries().forEach(e -> e.validate());
        }
        if (dataTypes() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property dataTypes in model CodelessUiConnectorConfigProperties"));
        } else {
            dataTypes().forEach(e -> e.validate());
        }
        if (connectivityCriteria() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property connectivityCriteria in model CodelessUiConnectorConfigProperties"));
        } else {
            connectivityCriteria().forEach(e -> e.validate());
        }
        if (availability() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property availability in model CodelessUiConnectorConfigProperties"));
        } else {
            availability().validate();
        }
        if (permissions() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property permissions in model CodelessUiConnectorConfigProperties"));
        } else {
            permissions().validate();
        }
        if (instructionSteps() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property instructionSteps in model CodelessUiConnectorConfigProperties"));
        } else {
            instructionSteps().forEach(e -> e.validate());
        }
    }

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