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

package com.azure.maps.weather.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.models.GeoPolygon;
import com.azure.core.models.GeoPosition;
import com.azure.maps.weather.implementation.helpers.Utility;
import com.azure.maps.weather.implementation.models.GeoJsonGeometry;
import com.azure.maps.weather.implementation.models.LatLongPair;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/** Forecast window for the storm. */
@Fluent
public final class WeatherWindow {
    /*
     * Location of the point on the left side of the window at the time of the timeframe.
     */
    @JsonProperty(value = "left")
    private LatLongPair topLeft;

    /*
     * Location of the point on the right side of the window at the end of the timeframe.
     */
    @JsonProperty(value = "right")
    private LatLongPair bottomRight;

    /*
     * DateTime of the beginning of the window of movement, displayed in ISO8601 format.
     */
    @JsonProperty(value = "beginDateTime")
    private OffsetDateTime beginTimestamp;

    /*
     * DateTime of the end of the window of movement, displayed in ISO8601 format.
     */
    @JsonProperty(value = "endDateTime")
    private OffsetDateTime endTimestamp;

    /*
     * Storm status at the beginning of the window.
     */
    @JsonProperty(value = "beginStatus")
    private String beginStatus;

    /*
     * Storm status at the end of the window.
     */
    @JsonProperty(value = "endStatus")
    private String endStatus;

    /*
     * Displayed when windowGeometry=true in request. GeoJSON object containing coordinates describing the window of
     * movement during the specified timeframe.
     */
    @JsonProperty(value = "geometry")
    private GeoJsonGeometry geometry;

    /** Set default WeatherWindow constructor to private */
    private WeatherWindow() {}

    /**
     * Get the topLeft property: Location of the point on the left side of the window at the time of the timeframe.
     *
     * @return the topLeft value.
     */
    public GeoPosition getTopLeft() {
        LatLongPair returnValue = this.topLeft;
        return new GeoPosition(returnValue.getLongitude(), returnValue.getLatitude());
    }

    /**
     * Get the bottomRight property: Location of the point on the right side of the window at the end of the timeframe.
     *
     * @return the bottomRight value.
     */
    public GeoPosition getBottomRight() {
        LatLongPair returnValue = this.bottomRight;
        return new GeoPosition(returnValue.getLongitude(), returnValue.getLatitude());
    }

    /**
     * Get the beginTimestamp property: DateTime of the beginning of the window of movement, displayed in ISO8601
     * format.
     *
     * @return the beginTimestamp value.
     */
    public OffsetDateTime getBeginTimestamp() {
        return this.beginTimestamp;
    }

    /**
     * Get the endTimestamp property: DateTime of the end of the window of movement, displayed in ISO8601 format.
     *
     * @return the endTimestamp value.
     */
    public OffsetDateTime getEndTimestamp() {
        return this.endTimestamp;
    }

    /**
     * Get the beginStatus property: Storm status at the beginning of the window.
     *
     * @return the beginStatus value.
     */
    public String getBeginStatus() {
        return this.beginStatus;
    }

    /**
     * Get the endStatus property: Storm status at the end of the window.
     *
     * @return the endStatus value.
     */
    public String getEndStatus() {
        return this.endStatus;
    }

    /**
     * Return GeoPolygon
     *
     * @return Returns a {@link GeoPolygon} for this weather window
     */
    public GeoPolygon getPolygon() {
        return Utility.toGeoPolygon(this.geometry);
    }
}
