/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace LocationService { namespace Model { /** *

Contains the calculated route's details for each path between a pair of * positions. The number of legs returned corresponds to one fewer than the total * number of positions in the request.

For example, a route with a * departure position and destination position returns one leg with the positions * snapped * to a nearby road:

  • The StartPosition is the * departure position.

  • The EndPosition is the * destination position.

A route with a waypoint between the * departure and destination position returns two legs with the positions snapped * to a nearby road:

  • Leg 1: The StartPosition is the * departure position . The EndPosition is the waypoint positon.

    *
  • Leg 2: The StartPosition is the waypoint position. * The EndPosition is the destination position.

  • *

See Also:

AWS API * Reference

*/ class Leg { public: AWS_LOCATIONSERVICE_API Leg(); AWS_LOCATIONSERVICE_API Leg(Aws::Utils::Json::JsonView jsonValue); AWS_LOCATIONSERVICE_API Leg& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_LOCATIONSERVICE_API Aws::Utils::Json::JsonValue Jsonize() const; /** *

The distance between the leg's StartPosition and * EndPosition along a calculated route.

  • The default * measurement is Kilometers unless the request specifies a * DistanceUnit of Miles.

*/ inline double GetDistance() const{ return m_distance; } /** *

The distance between the leg's StartPosition and * EndPosition along a calculated route.

  • The default * measurement is Kilometers unless the request specifies a * DistanceUnit of Miles.

*/ inline bool DistanceHasBeenSet() const { return m_distanceHasBeenSet; } /** *

The distance between the leg's StartPosition and * EndPosition along a calculated route.

  • The default * measurement is Kilometers unless the request specifies a * DistanceUnit of Miles.

*/ inline void SetDistance(double value) { m_distanceHasBeenSet = true; m_distance = value; } /** *

The distance between the leg's StartPosition and * EndPosition along a calculated route.

  • The default * measurement is Kilometers unless the request specifies a * DistanceUnit of Miles.

*/ inline Leg& WithDistance(double value) { SetDistance(value); return *this;} /** *

The estimated travel time between the leg's StartPosition and * EndPosition. The travel mode and departure time that you specify in * the request determines the calculated time.

*/ inline double GetDurationSeconds() const{ return m_durationSeconds; } /** *

The estimated travel time between the leg's StartPosition and * EndPosition. The travel mode and departure time that you specify in * the request determines the calculated time.

*/ inline bool DurationSecondsHasBeenSet() const { return m_durationSecondsHasBeenSet; } /** *

The estimated travel time between the leg's StartPosition and * EndPosition. The travel mode and departure time that you specify in * the request determines the calculated time.

*/ inline void SetDurationSeconds(double value) { m_durationSecondsHasBeenSet = true; m_durationSeconds = value; } /** *

The estimated travel time between the leg's StartPosition and * EndPosition. The travel mode and departure time that you specify in * the request determines the calculated time.

*/ inline Leg& WithDurationSeconds(double value) { SetDurationSeconds(value); return *this;} /** *

The terminating position of the leg. Follows the format * [longitude,latitude].

If the EndPosition * isn't located on a road, it's snapped * to a nearby road.

*/ inline const Aws::Vector& GetEndPosition() const{ return m_endPosition; } /** *

The terminating position of the leg. Follows the format * [longitude,latitude].

If the EndPosition * isn't located on a road, it's snapped * to a nearby road.

*/ inline bool EndPositionHasBeenSet() const { return m_endPositionHasBeenSet; } /** *

The terminating position of the leg. Follows the format * [longitude,latitude].

If the EndPosition * isn't located on a road, it's snapped * to a nearby road.

*/ inline void SetEndPosition(const Aws::Vector& value) { m_endPositionHasBeenSet = true; m_endPosition = value; } /** *

The terminating position of the leg. Follows the format * [longitude,latitude].

If the EndPosition * isn't located on a road, it's snapped * to a nearby road.

*/ inline void SetEndPosition(Aws::Vector&& value) { m_endPositionHasBeenSet = true; m_endPosition = std::move(value); } /** *

The terminating position of the leg. Follows the format * [longitude,latitude].

If the EndPosition * isn't located on a road, it's snapped * to a nearby road.

*/ inline Leg& WithEndPosition(const Aws::Vector& value) { SetEndPosition(value); return *this;} /** *

The terminating position of the leg. Follows the format * [longitude,latitude].

If the EndPosition * isn't located on a road, it's snapped * to a nearby road.

*/ inline Leg& WithEndPosition(Aws::Vector&& value) { SetEndPosition(std::move(value)); return *this;} /** *

The terminating position of the leg. Follows the format * [longitude,latitude].

If the EndPosition * isn't located on a road, it's snapped * to a nearby road.

*/ inline Leg& AddEndPosition(double value) { m_endPositionHasBeenSet = true; m_endPosition.push_back(value); return *this; } /** *

Contains the calculated route's path as a linestring geometry.

*/ inline const LegGeometry& GetGeometry() const{ return m_geometry; } /** *

Contains the calculated route's path as a linestring geometry.

*/ inline bool GeometryHasBeenSet() const { return m_geometryHasBeenSet; } /** *

Contains the calculated route's path as a linestring geometry.

*/ inline void SetGeometry(const LegGeometry& value) { m_geometryHasBeenSet = true; m_geometry = value; } /** *

Contains the calculated route's path as a linestring geometry.

*/ inline void SetGeometry(LegGeometry&& value) { m_geometryHasBeenSet = true; m_geometry = std::move(value); } /** *

Contains the calculated route's path as a linestring geometry.

*/ inline Leg& WithGeometry(const LegGeometry& value) { SetGeometry(value); return *this;} /** *

Contains the calculated route's path as a linestring geometry.

*/ inline Leg& WithGeometry(LegGeometry&& value) { SetGeometry(std::move(value)); return *this;} /** *

The starting position of the leg. Follows the format * [longitude,latitude].

If the * StartPosition isn't located on a road, it's snapped * to a nearby road.

*/ inline const Aws::Vector& GetStartPosition() const{ return m_startPosition; } /** *

The starting position of the leg. Follows the format * [longitude,latitude].

If the * StartPosition isn't located on a road, it's snapped * to a nearby road.

*/ inline bool StartPositionHasBeenSet() const { return m_startPositionHasBeenSet; } /** *

The starting position of the leg. Follows the format * [longitude,latitude].

If the * StartPosition isn't located on a road, it's snapped * to a nearby road.

*/ inline void SetStartPosition(const Aws::Vector& value) { m_startPositionHasBeenSet = true; m_startPosition = value; } /** *

The starting position of the leg. Follows the format * [longitude,latitude].

If the * StartPosition isn't located on a road, it's snapped * to a nearby road.

*/ inline void SetStartPosition(Aws::Vector&& value) { m_startPositionHasBeenSet = true; m_startPosition = std::move(value); } /** *

The starting position of the leg. Follows the format * [longitude,latitude].

If the * StartPosition isn't located on a road, it's snapped * to a nearby road.

*/ inline Leg& WithStartPosition(const Aws::Vector& value) { SetStartPosition(value); return *this;} /** *

The starting position of the leg. Follows the format * [longitude,latitude].

If the * StartPosition isn't located on a road, it's snapped * to a nearby road.

*/ inline Leg& WithStartPosition(Aws::Vector&& value) { SetStartPosition(std::move(value)); return *this;} /** *

The starting position of the leg. Follows the format * [longitude,latitude].

If the * StartPosition isn't located on a road, it's snapped * to a nearby road.

*/ inline Leg& AddStartPosition(double value) { m_startPositionHasBeenSet = true; m_startPosition.push_back(value); return *this; } /** *

Contains a list of steps, which represent subsections of a leg. Each step * provides instructions for how to move to the next step in the leg such as the * step's start position, end position, travel distance, travel duration, and * geometry offset.

*/ inline const Aws::Vector& GetSteps() const{ return m_steps; } /** *

Contains a list of steps, which represent subsections of a leg. Each step * provides instructions for how to move to the next step in the leg such as the * step's start position, end position, travel distance, travel duration, and * geometry offset.

*/ inline bool StepsHasBeenSet() const { return m_stepsHasBeenSet; } /** *

Contains a list of steps, which represent subsections of a leg. Each step * provides instructions for how to move to the next step in the leg such as the * step's start position, end position, travel distance, travel duration, and * geometry offset.

*/ inline void SetSteps(const Aws::Vector& value) { m_stepsHasBeenSet = true; m_steps = value; } /** *

Contains a list of steps, which represent subsections of a leg. Each step * provides instructions for how to move to the next step in the leg such as the * step's start position, end position, travel distance, travel duration, and * geometry offset.

*/ inline void SetSteps(Aws::Vector&& value) { m_stepsHasBeenSet = true; m_steps = std::move(value); } /** *

Contains a list of steps, which represent subsections of a leg. Each step * provides instructions for how to move to the next step in the leg such as the * step's start position, end position, travel distance, travel duration, and * geometry offset.

*/ inline Leg& WithSteps(const Aws::Vector& value) { SetSteps(value); return *this;} /** *

Contains a list of steps, which represent subsections of a leg. Each step * provides instructions for how to move to the next step in the leg such as the * step's start position, end position, travel distance, travel duration, and * geometry offset.

*/ inline Leg& WithSteps(Aws::Vector&& value) { SetSteps(std::move(value)); return *this;} /** *

Contains a list of steps, which represent subsections of a leg. Each step * provides instructions for how to move to the next step in the leg such as the * step's start position, end position, travel distance, travel duration, and * geometry offset.

*/ inline Leg& AddSteps(const Step& value) { m_stepsHasBeenSet = true; m_steps.push_back(value); return *this; } /** *

Contains a list of steps, which represent subsections of a leg. Each step * provides instructions for how to move to the next step in the leg such as the * step's start position, end position, travel distance, travel duration, and * geometry offset.

*/ inline Leg& AddSteps(Step&& value) { m_stepsHasBeenSet = true; m_steps.push_back(std::move(value)); return *this; } private: double m_distance; bool m_distanceHasBeenSet = false; double m_durationSeconds; bool m_durationSecondsHasBeenSet = false; Aws::Vector m_endPosition; bool m_endPositionHasBeenSet = false; LegGeometry m_geometry; bool m_geometryHasBeenSet = false; Aws::Vector m_startPosition; bool m_startPositionHasBeenSet = false; Aws::Vector m_steps; bool m_stepsHasBeenSet = false; }; } // namespace Model } // namespace LocationService } // namespace Aws