// 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.time.OffsetDateTime;

/** Parameters that define the contact resource. */
@Fluent
public final class ContactParameters {
    /*
     * The reference to the contact profile resource.
     */
    @JsonProperty(value = "contactProfile", required = true)
    private ContactParametersContactProfile contactProfile;

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

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

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

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

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

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

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

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

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

    /**
     * Set the startTime property: Start time of a contact (ISO 8601 UTC standard).
     *
     * @param startTime the startTime value to set.
     * @return the ContactParameters object itself.
     */
    public ContactParameters withStartTime(OffsetDateTime startTime) {
        this.startTime = startTime;
        return this;
    }

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

    /**
     * Set the endTime property: End time of a contact (ISO 8601 UTC standard).
     *
     * @param endTime the endTime value to set.
     * @return the ContactParameters object itself.
     */
    public ContactParameters withEndTime(OffsetDateTime endTime) {
        this.endTime = endTime;
        return this;
    }

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

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