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

package com.azure.resourcemanager.orbital.models;

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

/** List of Contact Profile Resource Properties. */
@Fluent
public class ContactProfilesProperties {
    /*
     * The current state of the resource's creation, deletion, or modification.
     */
    @JsonProperty(value = "provisioningState")
    private ContactProfilesPropertiesProvisioningState provisioningState;

    /*
     * Minimum viable contact duration in ISO 8601 format. Used for listing the available contacts with a spacecraft at
     * a given ground station.
     */
    @JsonProperty(value = "minimumViableContactDuration")
    private String minimumViableContactDuration;

    /*
     * Minimum viable elevation for the contact in decimal degrees. Used for listing the available contacts with a
     * spacecraft at a given ground station.
     */
    @JsonProperty(value = "minimumElevationDegrees")
    private Float minimumElevationDegrees;

    /*
     * Auto-tracking configuration.
     */
    @JsonProperty(value = "autoTrackingConfiguration")
    private AutoTrackingConfiguration autoTrackingConfiguration;

    /*
     * ARM resource identifier of the Event Hub used for telemetry. Requires granting Orbital Resource Provider the
     * rights to send telemetry into the hub.
     */
    @JsonProperty(value = "eventHubUri")
    private String eventHubUri;

    /*
     * Network configuration of customer virtual network.
     */
    @JsonProperty(value = "networkConfiguration", required = true)
    private ContactProfilesPropertiesNetworkConfiguration networkConfiguration;

    /*
     * Third-party mission configuration of the Contact Profile. Describes RF links, modem processing, and IP
     * endpoints.
     */
    @JsonProperty(value = "thirdPartyConfigurations")
    private List<ContactProfileThirdPartyConfiguration> thirdPartyConfigurations;

    /*
     * Links of the Contact Profile. Describes RF links, modem processing, and IP endpoints.
     */
    @JsonProperty(value = "links", required = true)
    private List<ContactProfileLink> links;

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

    /**
     * Get the provisioningState property: The current state of the resource's creation, deletion, or modification.
     *
     * @return the provisioningState value.
     */
    public ContactProfilesPropertiesProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Set the provisioningState property: The current state of the resource's creation, deletion, or modification.
     *
     * @param provisioningState the provisioningState value to set.
     * @return the ContactProfilesProperties object itself.
     */
    public ContactProfilesProperties withProvisioningState(
        ContactProfilesPropertiesProvisioningState provisioningState) {
        this.provisioningState = provisioningState;
        return this;
    }

    /**
     * Get the minimumViableContactDuration property: Minimum viable contact duration in ISO 8601 format. Used for
     * listing the available contacts with a spacecraft at a given ground station.
     *
     * @return the minimumViableContactDuration value.
     */
    public String minimumViableContactDuration() {
        return this.minimumViableContactDuration;
    }

    /**
     * Set the minimumViableContactDuration property: Minimum viable contact duration in ISO 8601 format. Used for
     * listing the available contacts with a spacecraft at a given ground station.
     *
     * @param minimumViableContactDuration the minimumViableContactDuration value to set.
     * @return the ContactProfilesProperties object itself.
     */
    public ContactProfilesProperties withMinimumViableContactDuration(String minimumViableContactDuration) {
        this.minimumViableContactDuration = minimumViableContactDuration;
        return this;
    }

    /**
     * Get the minimumElevationDegrees property: Minimum viable elevation for the contact in decimal degrees. Used for
     * listing the available contacts with a spacecraft at a given ground station.
     *
     * @return the minimumElevationDegrees value.
     */
    public Float minimumElevationDegrees() {
        return this.minimumElevationDegrees;
    }

    /**
     * Set the minimumElevationDegrees property: Minimum viable elevation for the contact in decimal degrees. Used for
     * listing the available contacts with a spacecraft at a given ground station.
     *
     * @param minimumElevationDegrees the minimumElevationDegrees value to set.
     * @return the ContactProfilesProperties object itself.
     */
    public ContactProfilesProperties withMinimumElevationDegrees(Float minimumElevationDegrees) {
        this.minimumElevationDegrees = minimumElevationDegrees;
        return this;
    }

    /**
     * Get the autoTrackingConfiguration property: Auto-tracking configuration.
     *
     * @return the autoTrackingConfiguration value.
     */
    public AutoTrackingConfiguration autoTrackingConfiguration() {
        return this.autoTrackingConfiguration;
    }

    /**
     * Set the autoTrackingConfiguration property: Auto-tracking configuration.
     *
     * @param autoTrackingConfiguration the autoTrackingConfiguration value to set.
     * @return the ContactProfilesProperties object itself.
     */
    public ContactProfilesProperties withAutoTrackingConfiguration(
        AutoTrackingConfiguration autoTrackingConfiguration) {
        this.autoTrackingConfiguration = autoTrackingConfiguration;
        return this;
    }

    /**
     * Get the eventHubUri property: ARM resource identifier of the Event Hub used for telemetry. Requires granting
     * Orbital Resource Provider the rights to send telemetry into the hub.
     *
     * @return the eventHubUri value.
     */
    public String eventHubUri() {
        return this.eventHubUri;
    }

    /**
     * Set the eventHubUri property: ARM resource identifier of the Event Hub used for telemetry. Requires granting
     * Orbital Resource Provider the rights to send telemetry into the hub.
     *
     * @param eventHubUri the eventHubUri value to set.
     * @return the ContactProfilesProperties object itself.
     */
    public ContactProfilesProperties withEventHubUri(String eventHubUri) {
        this.eventHubUri = eventHubUri;
        return this;
    }

    /**
     * Get the networkConfiguration property: Network configuration of customer virtual network.
     *
     * @return the networkConfiguration value.
     */
    public ContactProfilesPropertiesNetworkConfiguration networkConfiguration() {
        return this.networkConfiguration;
    }

    /**
     * Set the networkConfiguration property: Network configuration of customer virtual network.
     *
     * @param networkConfiguration the networkConfiguration value to set.
     * @return the ContactProfilesProperties object itself.
     */
    public ContactProfilesProperties withNetworkConfiguration(
        ContactProfilesPropertiesNetworkConfiguration networkConfiguration) {
        this.networkConfiguration = networkConfiguration;
        return this;
    }

    /**
     * Get the thirdPartyConfigurations property: Third-party mission configuration of the Contact Profile. Describes RF
     * links, modem processing, and IP endpoints.
     *
     * @return the thirdPartyConfigurations value.
     */
    public List<ContactProfileThirdPartyConfiguration> thirdPartyConfigurations() {
        return this.thirdPartyConfigurations;
    }

    /**
     * Set the thirdPartyConfigurations property: Third-party mission configuration of the Contact Profile. Describes RF
     * links, modem processing, and IP endpoints.
     *
     * @param thirdPartyConfigurations the thirdPartyConfigurations value to set.
     * @return the ContactProfilesProperties object itself.
     */
    public ContactProfilesProperties withThirdPartyConfigurations(
        List<ContactProfileThirdPartyConfiguration> thirdPartyConfigurations) {
        this.thirdPartyConfigurations = thirdPartyConfigurations;
        return this;
    }

    /**
     * Get the links property: Links of the Contact Profile. Describes RF links, modem processing, and IP endpoints.
     *
     * @return the links value.
     */
    public List<ContactProfileLink> links() {
        return this.links;
    }

    /**
     * Set the links property: Links of the Contact Profile. Describes RF links, modem processing, and IP endpoints.
     *
     * @param links the links value to set.
     * @return the ContactProfilesProperties object itself.
     */
    public ContactProfilesProperties withLinks(List<ContactProfileLink> links) {
        this.links = links;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (networkConfiguration() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property networkConfiguration in model ContactProfilesProperties"));
        } else {
            networkConfiguration().validate();
        }
        if (thirdPartyConfigurations() != null) {
            thirdPartyConfigurations().forEach(e -> e.validate());
        }
        if (links() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property links in model ContactProfilesProperties"));
        } else {
            links().forEach(e -> e.validate());
        }
    }

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