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

package com.azure.maps.traffic.implementation.models;

import com.azure.core.annotation.Fluent;
import com.azure.maps.traffic.models.TrafficFlowSegmentDataPropertiesCoordinates;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Flow Segment Data property. */
@Fluent
public final class TrafficFlowSegmentDataFlowSegmentData {
    /*
     * Functional Road Class. This indicates the road type:
     * 0: Motorway, freeway or other major road.
     * 1: Major road, less important than a motorway.
     * 2: Other major road.
     * 3: Secondary road.
     * 4: Local connecting road.
     * 5: Local road of high importance.
     * 6: Local road.
     */
    @JsonProperty(value = "frc", access = JsonProperty.Access.WRITE_ONLY)
    private String functionalRoadClass;

    /*
     * The current average speed at the selected point, in the units requested.
     * This is calculated from the currentTravelTime and the length of the
     * selected segment.
     */
    @JsonProperty(value = "currentSpeed", access = JsonProperty.Access.WRITE_ONLY)
    private Integer currentSpeed;

    /*
     * The free flow speed expected under ideal conditions, expressed in the
     * units requested. This is related to the freeFlowTravelTime.
     */
    @JsonProperty(value = "freeFlowSpeed", access = JsonProperty.Access.WRITE_ONLY)
    private Integer freeFlowSpeed;

    /*
     * Current travel time in seconds, across this traffic segment, based on
     * fused real-time measurements between the defined locations in the
     * specified direction.
     */
    @JsonProperty(value = "currentTravelTime", access = JsonProperty.Access.WRITE_ONLY)
    private Integer currentTravelTime;

    /*
     * The travel time in seconds, across this traffic segment, which would be
     * expected under ideal free flow conditions.
     */
    @JsonProperty(value = "freeFlowTravelTime", access = JsonProperty.Access.WRITE_ONLY)
    private Integer freeFlowTravelTime;

    /*
     * The confidence is a measure of the quality of the provided travel time
     * and speed. A value of 1 means full confidence, that the response
     * contains the highest quality data.  Lower values indicate the degree
     * that the response may vary from the actual conditions on the road. Any
     * value greater than 0.6 means the information was based on real-time
     * probe input. A value of 0.5 means the reported speed is based on
     * historical info.   A value between 0.5 and 0.6 has a calculated weighted
     * average between historical and live speeds.
     */
    @JsonProperty(value = "confidence", access = JsonProperty.Access.WRITE_ONLY)
    private Float confidence;

    /*
     * Includes the coordinates describing the shape of the segment.
     * Coordinates are shifted from the road depending on the zoom level to
     * support high quality visualization in every scale.
     */
    @JsonProperty(value = "coordinates")
    private TrafficFlowSegmentDataPropertiesCoordinates coordinates;

    /*
     * This indicates the software version that generated the response.
     */
    @JsonProperty(value = "@version", access = JsonProperty.Access.WRITE_ONLY)
    private String version;

    /*
     * OpenLR code for segment. See
     * [OpenLR](https://en.wikipedia.org/wiki/OpenLR) for more information on
     * the use of Open LR codes.
     */
    @JsonProperty(value = "openlr", access = JsonProperty.Access.WRITE_ONLY)
    private String openLrCode;

    /**
     * Get the functionalRoadClass property: Functional Road Class. This indicates the road type: 0: Motorway, freeway
     * or other major road. 1: Major road, less important than a motorway. 2: Other major road. 3: Secondary road. 4:
     * Local connecting road. 5: Local road of high importance. 6: Local road.
     *
     * @return the functionalRoadClass value.
     */
    public String getFunctionalRoadClass() {
        return this.functionalRoadClass;
    }

    /**
     * Get the currentSpeed property: The current average speed at the selected point, in the units requested. This is
     * calculated from the currentTravelTime and the length of the selected segment.
     *
     * @return the currentSpeed value.
     */
    public Integer getCurrentSpeed() {
        return this.currentSpeed;
    }

    /**
     * Get the freeFlowSpeed property: The free flow speed expected under ideal conditions, expressed in the units
     * requested. This is related to the freeFlowTravelTime.
     *
     * @return the freeFlowSpeed value.
     */
    public Integer getFreeFlowSpeed() {
        return this.freeFlowSpeed;
    }

    /**
     * Get the currentTravelTime property: Current travel time in seconds, across this traffic segment, based on fused
     * real-time measurements between the defined locations in the specified direction.
     *
     * @return the currentTravelTime value.
     */
    public Integer getCurrentTravelTime() {
        return this.currentTravelTime;
    }

    /**
     * Get the freeFlowTravelTime property: The travel time in seconds, across this traffic segment, which would be
     * expected under ideal free flow conditions.
     *
     * @return the freeFlowTravelTime value.
     */
    public Integer getFreeFlowTravelTime() {
        return this.freeFlowTravelTime;
    }

    /**
     * Get the confidence property: The confidence is a measure of the quality of the provided travel time and speed. A
     * value of 1 means full confidence, that the response contains the highest quality data. Lower values indicate the
     * degree that the response may vary from the actual conditions on the road. Any value greater than 0.6 means the
     * information was based on real-time probe input. A value of 0.5 means the reported speed is based on historical
     * info. A value between 0.5 and 0.6 has a calculated weighted average between historical and live speeds.
     *
     * @return the confidence value.
     */
    public Float getConfidence() {
        return this.confidence;
    }

    /**
     * Get the coordinates property: Includes the coordinates describing the shape of the segment. Coordinates are
     * shifted from the road depending on the zoom level to support high quality visualization in every scale.
     *
     * @return the coordinates value.
     */
    public TrafficFlowSegmentDataPropertiesCoordinates getCoordinates() {
        return this.coordinates;
    }

    /**
     * Set the coordinates property: Includes the coordinates describing the shape of the segment. Coordinates are
     * shifted from the road depending on the zoom level to support high quality visualization in every scale.
     *
     * @param coordinates the coordinates value to set.
     * @return the TrafficFlowSegmentDataFlowSegmentData object itself.
     */
    public TrafficFlowSegmentDataFlowSegmentData setCoordinates(
            TrafficFlowSegmentDataPropertiesCoordinates coordinates) {
        this.coordinates = coordinates;
        return this;
    }

    /**
     * Get the version property: This indicates the software version that generated the response.
     *
     * @return the version value.
     */
    public String getVersion() {
        return this.version;
    }

    /**
     * Get the openLrCode property: OpenLR code for segment. See [OpenLR](https://en.wikipedia.org/wiki/OpenLR) for more
     * information on the use of Open LR codes.
     *
     * @return the openLrCode value.
     */
    public String getOpenLrCode() {
        return this.openLrCode;
    }
}
