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

package com.azure.resourcemanager.security.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.List;

/** The AWS connector environment data. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "environmentType")
@JsonTypeName("AwsAccount")
@Fluent
public final class AwsEnvironmentData extends EnvironmentData {
    /*
     * The AWS account's organizational data
     */
    @JsonProperty(value = "organizationalData")
    private AwsOrganizationalData organizationalData;

    /*
     * list of regions to scan
     */
    @JsonProperty(value = "regions")
    private List<String> regions;

    /*
     * The AWS account name
     */
    @JsonProperty(value = "accountName", access = JsonProperty.Access.WRITE_ONLY)
    private String accountName;

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

    /**
     * Get the organizationalData property: The AWS account's organizational data.
     *
     * @return the organizationalData value.
     */
    public AwsOrganizationalData organizationalData() {
        return this.organizationalData;
    }

    /**
     * Set the organizationalData property: The AWS account's organizational data.
     *
     * @param organizationalData the organizationalData value to set.
     * @return the AwsEnvironmentData object itself.
     */
    public AwsEnvironmentData withOrganizationalData(AwsOrganizationalData organizationalData) {
        this.organizationalData = organizationalData;
        return this;
    }

    /**
     * Get the regions property: list of regions to scan.
     *
     * @return the regions value.
     */
    public List<String> regions() {
        return this.regions;
    }

    /**
     * Set the regions property: list of regions to scan.
     *
     * @param regions the regions value to set.
     * @return the AwsEnvironmentData object itself.
     */
    public AwsEnvironmentData withRegions(List<String> regions) {
        this.regions = regions;
        return this;
    }

    /**
     * Get the accountName property: The AWS account name.
     *
     * @return the accountName value.
     */
    public String accountName() {
        return this.accountName;
    }

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