// 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.fluent.models;

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

/** Amazon Web Services S3 data connector properties. */
@Fluent
public final class AwsS3DataConnectorProperties {
    /*
     * The logs destination table name in LogAnalytics.
     */
    @JsonProperty(value = "destinationTable", required = true)
    private String destinationTable;

    /*
     * The AWS sqs urls for the connector.
     */
    @JsonProperty(value = "sqsUrls", required = true)
    private List<String> sqsUrls;

    /*
     * The Aws Role Arn that is used to access the Aws account.
     */
    @JsonProperty(value = "roleArn", required = true)
    private String roleArn;

    /*
     * The available data types for the connector.
     */
    @JsonProperty(value = "dataTypes", required = true)
    private AwsS3DataConnectorDataTypes dataTypes;

    /**
     * Get the destinationTable property: The logs destination table name in LogAnalytics.
     *
     * @return the destinationTable value.
     */
    public String destinationTable() {
        return this.destinationTable;
    }

    /**
     * Set the destinationTable property: The logs destination table name in LogAnalytics.
     *
     * @param destinationTable the destinationTable value to set.
     * @return the AwsS3DataConnectorProperties object itself.
     */
    public AwsS3DataConnectorProperties withDestinationTable(String destinationTable) {
        this.destinationTable = destinationTable;
        return this;
    }

    /**
     * Get the sqsUrls property: The AWS sqs urls for the connector.
     *
     * @return the sqsUrls value.
     */
    public List<String> sqsUrls() {
        return this.sqsUrls;
    }

    /**
     * Set the sqsUrls property: The AWS sqs urls for the connector.
     *
     * @param sqsUrls the sqsUrls value to set.
     * @return the AwsS3DataConnectorProperties object itself.
     */
    public AwsS3DataConnectorProperties withSqsUrls(List<String> sqsUrls) {
        this.sqsUrls = sqsUrls;
        return this;
    }

    /**
     * Get the roleArn property: The Aws Role Arn that is used to access the Aws account.
     *
     * @return the roleArn value.
     */
    public String roleArn() {
        return this.roleArn;
    }

    /**
     * Set the roleArn property: The Aws Role Arn that is used to access the Aws account.
     *
     * @param roleArn the roleArn value to set.
     * @return the AwsS3DataConnectorProperties object itself.
     */
    public AwsS3DataConnectorProperties withRoleArn(String roleArn) {
        this.roleArn = roleArn;
        return this;
    }

    /**
     * Get the dataTypes property: The available data types for the connector.
     *
     * @return the dataTypes value.
     */
    public AwsS3DataConnectorDataTypes dataTypes() {
        return this.dataTypes;
    }

    /**
     * Set the dataTypes property: The available data types for the connector.
     *
     * @param dataTypes the dataTypes value to set.
     * @return the AwsS3DataConnectorProperties object itself.
     */
    public AwsS3DataConnectorProperties withDataTypes(AwsS3DataConnectorDataTypes dataTypes) {
        this.dataTypes = dataTypes;
        return this;
    }

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

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