// 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.LocalDate;

/** Authorized groundstation. */
@Fluent
public final class AuthorizedGroundstation {
    /*
     * Groundstation name.
     */
    @JsonProperty(value = "groundStation", required = true)
    private String groundStation;

    /*
     * Date of authorization expiration.
     */
    @JsonProperty(value = "expirationDate", required = true)
    private LocalDate expirationDate;

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

    /**
     * Get the groundStation property: Groundstation name.
     *
     * @return the groundStation value.
     */
    public String groundStation() {
        return this.groundStation;
    }

    /**
     * Set the groundStation property: Groundstation name.
     *
     * @param groundStation the groundStation value to set.
     * @return the AuthorizedGroundstation object itself.
     */
    public AuthorizedGroundstation withGroundStation(String groundStation) {
        this.groundStation = groundStation;
        return this;
    }

    /**
     * Get the expirationDate property: Date of authorization expiration.
     *
     * @return the expirationDate value.
     */
    public LocalDate expirationDate() {
        return this.expirationDate;
    }

    /**
     * Set the expirationDate property: Date of authorization expiration.
     *
     * @param expirationDate the expirationDate value to set.
     * @return the AuthorizedGroundstation object itself.
     */
    public AuthorizedGroundstation withExpirationDate(LocalDate expirationDate) {
        this.expirationDate = expirationDate;
        return this;
    }

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

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