// 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.management.ProxyResource;
import com.azure.core.management.SystemData;
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;

/** Customer creates a contact resource for a spacecraft resource. */
@Fluent
public final class ContactInner extends ProxyResource {
    /*
     * Properties of the Contact Resource.
     */
    @JsonProperty(value = "properties", required = true)
    private ContactsProperties innerProperties = new ContactsProperties();

    /*
     * Azure Resource Manager metadata containing createdBy and modifiedBy information.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

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

    /**
     * Get the innerProperties property: Properties of the Contact Resource.
     *
     * @return the innerProperties value.
     */
    private ContactsProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

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

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

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

    /**
     * Set the reservationStartTime property: Reservation start time of a contact (ISO 8601 UTC standard).
     *
     * @param reservationStartTime the reservationStartTime value to set.
     * @return the ContactInner object itself.
     */
    public ContactInner withReservationStartTime(OffsetDateTime reservationStartTime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ContactsProperties();
        }
        this.innerProperties().withReservationStartTime(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.innerProperties() == null ? null : this.innerProperties().reservationEndTime();
    }

    /**
     * Set the reservationEndTime property: Reservation end time of a contact (ISO 8601 UTC standard).
     *
     * @param reservationEndTime the reservationEndTime value to set.
     * @return the ContactInner object itself.
     */
    public ContactInner withReservationEndTime(OffsetDateTime reservationEndTime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ContactsProperties();
        }
        this.innerProperties().withReservationEndTime(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.innerProperties() == null ? null : this.innerProperties().rxStartTime();
    }

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

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

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

    /**
     * Get the errorMessage property: Any error message while scheduling a contact.
     *
     * @return the errorMessage value.
     */
    public String errorMessage() {
        return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().endAzimuthDegrees();
    }

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

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

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

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

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

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

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

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

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