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

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.orbital.models.ContactsPropertiesAntennaConfiguration;
import com.azure.resourcemanager.orbital.models.ContactsPropertiesContactProfile;
import com.azure.resourcemanager.orbital.models.ContactsPropertiesProvisioningState;
import com.azure.resourcemanager.orbital.models.ContactsStatus;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

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

    /*
     * Status of a contact.
     */
    @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY)
    private ContactsStatus status;

    /*
     * Reservation start time of a contact (ISO 8601 UTC standard).
     */
    @JsonProperty(value = "reservationStartTime", required = true)
    private OffsetDateTime reservationStartTime;

    /*
     * Reservation end time of a contact (ISO 8601 UTC standard).
     */
    @JsonProperty(value = "reservationEndTime", required = true)
    private OffsetDateTime reservationEndTime;

    /*
     * Receive start time of a contact (ISO 8601 UTC standard).
     */
    @JsonProperty(value = "rxStartTime", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime rxStartTime;

    /*
     * Receive end time of a contact (ISO 8601 UTC standard).
     */
    @JsonProperty(value = "rxEndTime", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime rxEndTime;

    /*
     * Transmit start time of a contact (ISO 8601 UTC standard).
     */
    @JsonProperty(value = "txStartTime", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime txStartTime;

    /*
     * Transmit end time of a contact (ISO 8601 UTC standard).
     */
    @JsonProperty(value = "txEndTime", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime txEndTime;

    /*
     * Any error message while scheduling a contact.
     */
    @JsonProperty(value = "errorMessage", access = JsonProperty.Access.WRITE_ONLY)
    private String errorMessage;

    /*
     * Maximum elevation of the antenna during the contact in decimal degrees.
     */
    @JsonProperty(value = "maximumElevationDegrees", access = JsonProperty.Access.WRITE_ONLY)
    private Float maximumElevationDegrees;

    /*
     * Azimuth of the antenna at the start of the contact in decimal degrees.
     */
    @JsonProperty(value = "startAzimuthDegrees", access = JsonProperty.Access.WRITE_ONLY)
    private Float startAzimuthDegrees;

    /*
     * Azimuth of the antenna at the end of the contact in decimal degrees.
     */
    @JsonProperty(value = "endAzimuthDegrees", access = JsonProperty.Access.WRITE_ONLY)
    private Float endAzimuthDegrees;

    /*
     * Azure Ground Station name.
     */
    @JsonProperty(value = "groundStationName", required = true)
    private String groundStationName;

    /*
     * Spacecraft elevation above the horizon at contact start.
     */
    @JsonProperty(value = "startElevationDegrees", access = JsonProperty.Access.WRITE_ONLY)
    private Float startElevationDegrees;

    /*
     * Spacecraft elevation above the horizon at contact end.
     */
    @JsonProperty(value = "endElevationDegrees", access = JsonProperty.Access.WRITE_ONLY)
    private Float endElevationDegrees;

    /*
     * The configuration associated with the allocated antenna.
     */
    @JsonProperty(value = "antennaConfiguration", access = JsonProperty.Access.WRITE_ONLY)
    private ContactsPropertiesAntennaConfiguration antennaConfiguration;

    /*
     * The reference to the contact profile resource.
     */
    @JsonProperty(value = "contactProfile", required = true)
    private ContactsPropertiesContactProfile contactProfile;

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

    /**
     * Get the provisioningState property: The current state of the resource's creation, deletion, or modification.
     *
     * @return the provisioningState value.
     */
    public ContactsPropertiesProvisioningState 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 ContactsProperties object itself.
     */
    public ContactsProperties withProvisioningState(ContactsPropertiesProvisioningState provisioningState) {
        this.provisioningState = provisioningState;
        return this;
    }

    /**
     * Get the status property: Status of a contact.
     *
     * @return the status value.
     */
    public ContactsStatus status() {
        return this.status;
    }

    /**
     * Get the reservationStartTime property: Reservation start time of a contact (ISO 8601 UTC standard).
     *
     * @return the reservationStartTime value.
     */
    public OffsetDateTime reservationStartTime() {
        return this.reservationStartTime;
    }

    /**
     * Set the reservationStartTime property: Reservation start time of a contact (ISO 8601 UTC standard).
     *
     * @param reservationStartTime the reservationStartTime value to set.
     * @return the ContactsProperties object itself.
     */
    public ContactsProperties withReservationStartTime(OffsetDateTime reservationStartTime) {
        this.reservationStartTime = reservationStartTime;
        return this;
    }

    /**
     * Get the reservationEndTime property: Reservation end time of a contact (ISO 8601 UTC standard).
     *
     * @return the reservationEndTime value.
     */
    public OffsetDateTime reservationEndTime() {
        return this.reservationEndTime;
    }

    /**
     * Set the reservationEndTime property: Reservation end time of a contact (ISO 8601 UTC standard).
     *
     * @param reservationEndTime the reservationEndTime value to set.
     * @return the ContactsProperties object itself.
     */
    public ContactsProperties withReservationEndTime(OffsetDateTime reservationEndTime) {
        this.reservationEndTime = reservationEndTime;
        return this;
    }

    /**
     * Get the rxStartTime property: Receive start time of a contact (ISO 8601 UTC standard).
     *
     * @return the rxStartTime value.
     */
    public OffsetDateTime rxStartTime() {
        return this.rxStartTime;
    }

    /**
     * Get the rxEndTime property: Receive end time of a contact (ISO 8601 UTC standard).
     *
     * @return the rxEndTime value.
     */
    public OffsetDateTime rxEndTime() {
        return this.rxEndTime;
    }

    /**
     * Get the txStartTime property: Transmit start time of a contact (ISO 8601 UTC standard).
     *
     * @return the txStartTime value.
     */
    public OffsetDateTime txStartTime() {
        return this.txStartTime;
    }

    /**
     * Get the txEndTime property: Transmit end time of a contact (ISO 8601 UTC standard).
     *
     * @return the txEndTime value.
     */
    public OffsetDateTime txEndTime() {
        return this.txEndTime;
    }

    /**
     * Get the errorMessage property: Any error message while scheduling a contact.
     *
     * @return the errorMessage value.
     */
    public String errorMessage() {
        return this.errorMessage;
    }

    /**
     * Get the maximumElevationDegrees property: Maximum elevation of the antenna during the contact in decimal degrees.
     *
     * @return the maximumElevationDegrees value.
     */
    public Float maximumElevationDegrees() {
        return this.maximumElevationDegrees;
    }

    /**
     * Get the startAzimuthDegrees property: Azimuth of the antenna at the start of the contact in decimal degrees.
     *
     * @return the startAzimuthDegrees value.
     */
    public Float startAzimuthDegrees() {
        return this.startAzimuthDegrees;
    }

    /**
     * Get the endAzimuthDegrees property: Azimuth of the antenna at the end of the contact in decimal degrees.
     *
     * @return the endAzimuthDegrees value.
     */
    public Float endAzimuthDegrees() {
        return this.endAzimuthDegrees;
    }

    /**
     * Get the groundStationName property: Azure Ground Station name.
     *
     * @return the groundStationName value.
     */
    public String groundStationName() {
        return this.groundStationName;
    }

    /**
     * Set the groundStationName property: Azure Ground Station name.
     *
     * @param groundStationName the groundStationName value to set.
     * @return the ContactsProperties object itself.
     */
    public ContactsProperties withGroundStationName(String groundStationName) {
        this.groundStationName = groundStationName;
        return this;
    }

    /**
     * Get the startElevationDegrees property: Spacecraft elevation above the horizon at contact start.
     *
     * @return the startElevationDegrees value.
     */
    public Float startElevationDegrees() {
        return this.startElevationDegrees;
    }

    /**
     * Get the endElevationDegrees property: Spacecraft elevation above the horizon at contact end.
     *
     * @return the endElevationDegrees value.
     */
    public Float endElevationDegrees() {
        return this.endElevationDegrees;
    }

    /**
     * Get the antennaConfiguration property: The configuration associated with the allocated antenna.
     *
     * @return the antennaConfiguration value.
     */
    public ContactsPropertiesAntennaConfiguration antennaConfiguration() {
        return this.antennaConfiguration;
    }

    /**
     * Get the contactProfile property: The reference to the contact profile resource.
     *
     * @return the contactProfile value.
     */
    public ContactsPropertiesContactProfile contactProfile() {
        return this.contactProfile;
    }

    /**
     * Set the contactProfile property: The reference to the contact profile resource.
     *
     * @param contactProfile the contactProfile value to set.
     * @return the ContactsProperties object itself.
     */
    public ContactsProperties withContactProfile(ContactsPropertiesContactProfile contactProfile) {
        this.contactProfile = contactProfile;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (reservationStartTime() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property reservationStartTime in model ContactsProperties"));
        }
        if (reservationEndTime() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property reservationEndTime in model ContactsProperties"));
        }
        if (groundStationName() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property groundStationName in model ContactsProperties"));
        }
        if (antennaConfiguration() != null) {
            antennaConfiguration().validate();
        }
        if (contactProfile() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property contactProfile in model ContactsProperties"));
        } else {
            contactProfile().validate();
        }
    }

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