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

import com.azure.core.annotation.Immutable;
import com.azure.resourcemanager.security.models.ConnectableResource;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;

/** Describes the allowed traffic between Azure resources. */
@Immutable
public final class AllowedConnectionsResourceProperties {
    /*
     * The UTC time on which the allowed connections resource was calculated
     */
    @JsonProperty(value = "calculatedDateTime", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime calculatedDateTime;

    /*
     * List of connectable resources
     */
    @JsonProperty(value = "connectableResources", access = JsonProperty.Access.WRITE_ONLY)
    private List<ConnectableResource> connectableResources;

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

    /**
     * Get the calculatedDateTime property: The UTC time on which the allowed connections resource was calculated.
     *
     * @return the calculatedDateTime value.
     */
    public OffsetDateTime calculatedDateTime() {
        return this.calculatedDateTime;
    }

    /**
     * Get the connectableResources property: List of connectable resources.
     *
     * @return the connectableResources value.
     */
    public List<ConnectableResource> connectableResources() {
        return this.connectableResources;
    }

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