|
| 1 | +// smithy-typescript generated code |
| 2 | +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; |
| 3 | +import { getSerdePlugin } from "@smithy/middleware-serde"; |
| 4 | +import { Command as $Command } from "@smithy/smithy-client"; |
| 5 | +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; |
| 6 | + |
| 7 | +import { commonParams } from "../endpoint/EndpointParameters"; |
| 8 | +import { LocationClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../LocationClient"; |
| 9 | +import { |
| 10 | + ForecastGeofenceEventsRequest, |
| 11 | + ForecastGeofenceEventsRequestFilterSensitiveLog, |
| 12 | + ForecastGeofenceEventsResponse, |
| 13 | + ForecastGeofenceEventsResponseFilterSensitiveLog, |
| 14 | +} from "../models/models_0"; |
| 15 | +import { de_ForecastGeofenceEventsCommand, se_ForecastGeofenceEventsCommand } from "../protocols/Aws_restJson1"; |
| 16 | + |
| 17 | +/** |
| 18 | + * @public |
| 19 | + */ |
| 20 | +export type { __MetadataBearer }; |
| 21 | +export { $Command }; |
| 22 | +/** |
| 23 | + * @public |
| 24 | + * |
| 25 | + * The input for {@link ForecastGeofenceEventsCommand}. |
| 26 | + */ |
| 27 | +export interface ForecastGeofenceEventsCommandInput extends ForecastGeofenceEventsRequest {} |
| 28 | +/** |
| 29 | + * @public |
| 30 | + * |
| 31 | + * The output of {@link ForecastGeofenceEventsCommand}. |
| 32 | + */ |
| 33 | +export interface ForecastGeofenceEventsCommandOutput extends ForecastGeofenceEventsResponse, __MetadataBearer {} |
| 34 | + |
| 35 | +/** |
| 36 | + * <p>Evaluates device positions against |
| 37 | + * geofence geometries from a given geofence collection. The event forecasts three states for which |
| 38 | + * a device can be in relative to a geofence:</p> |
| 39 | + * <p> |
| 40 | + * <code>ENTER</code>: If a device is outside of a geofence, but would breach the fence if the device is moving at its current speed within time horizon window.</p> |
| 41 | + * <p> |
| 42 | + * <code>EXIT</code>: If a device is inside of a geofence, but would breach the fence if the device is moving at its current speed within time horizon window.</p> |
| 43 | + * <p> |
| 44 | + * <code>IDLE</code>: If a device is inside of a geofence, and the device is not moving.</p> |
| 45 | + * @example |
| 46 | + * Use a bare-bones client and the command you need to make an API call. |
| 47 | + * ```javascript |
| 48 | + * import { LocationClient, ForecastGeofenceEventsCommand } from "@aws-sdk/client-location"; // ES Modules import |
| 49 | + * // const { LocationClient, ForecastGeofenceEventsCommand } = require("@aws-sdk/client-location"); // CommonJS import |
| 50 | + * const client = new LocationClient(config); |
| 51 | + * const input = { // ForecastGeofenceEventsRequest |
| 52 | + * CollectionName: "STRING_VALUE", // required |
| 53 | + * DeviceState: { // ForecastGeofenceEventsDeviceState |
| 54 | + * Position: [ // Position // required |
| 55 | + * Number("double"), |
| 56 | + * ], |
| 57 | + * Speed: Number("double"), |
| 58 | + * }, |
| 59 | + * TimeHorizonMinutes: Number("double"), |
| 60 | + * DistanceUnit: "STRING_VALUE", |
| 61 | + * SpeedUnit: "STRING_VALUE", |
| 62 | + * NextToken: "STRING_VALUE", |
| 63 | + * MaxResults: Number("int"), |
| 64 | + * }; |
| 65 | + * const command = new ForecastGeofenceEventsCommand(input); |
| 66 | + * const response = await client.send(command); |
| 67 | + * // { // ForecastGeofenceEventsResponse |
| 68 | + * // ForecastedEvents: [ // ForecastedEventsList // required |
| 69 | + * // { // ForecastedEvent |
| 70 | + * // EventId: "STRING_VALUE", // required |
| 71 | + * // GeofenceId: "STRING_VALUE", // required |
| 72 | + * // IsDeviceInGeofence: true || false, // required |
| 73 | + * // NearestDistance: Number("double"), // required |
| 74 | + * // EventType: "STRING_VALUE", // required |
| 75 | + * // ForecastedBreachTime: new Date("TIMESTAMP"), |
| 76 | + * // GeofenceProperties: { // PropertyMap |
| 77 | + * // "<keys>": "STRING_VALUE", |
| 78 | + * // }, |
| 79 | + * // }, |
| 80 | + * // ], |
| 81 | + * // NextToken: "STRING_VALUE", |
| 82 | + * // DistanceUnit: "STRING_VALUE", // required |
| 83 | + * // SpeedUnit: "STRING_VALUE", // required |
| 84 | + * // }; |
| 85 | + * |
| 86 | + * ``` |
| 87 | + * |
| 88 | + * @param ForecastGeofenceEventsCommandInput - {@link ForecastGeofenceEventsCommandInput} |
| 89 | + * @returns {@link ForecastGeofenceEventsCommandOutput} |
| 90 | + * @see {@link ForecastGeofenceEventsCommandInput} for command's `input` shape. |
| 91 | + * @see {@link ForecastGeofenceEventsCommandOutput} for command's `response` shape. |
| 92 | + * @see {@link LocationClientResolvedConfig | config} for LocationClient's `config` shape. |
| 93 | + * |
| 94 | + * @throws {@link AccessDeniedException} (client fault) |
| 95 | + * <p>The request was denied because of insufficient access or permissions. Check with an |
| 96 | + * administrator to verify your permissions.</p> |
| 97 | + * |
| 98 | + * @throws {@link InternalServerException} (server fault) |
| 99 | + * <p>The request has failed to process because of an unknown server error, exception, or failure.</p> |
| 100 | + * |
| 101 | + * @throws {@link ResourceNotFoundException} (client fault) |
| 102 | + * <p>The resource that you've entered was not found in your AWS account.</p> |
| 103 | + * |
| 104 | + * @throws {@link ThrottlingException} (client fault) |
| 105 | + * <p>The request was denied because of request throttling.</p> |
| 106 | + * |
| 107 | + * @throws {@link ValidationException} (client fault) |
| 108 | + * <p>The input failed to meet the constraints specified by the AWS service. </p> |
| 109 | + * |
| 110 | + * @throws {@link LocationServiceException} |
| 111 | + * <p>Base exception class for all service exceptions from Location service.</p> |
| 112 | + * |
| 113 | + * @public |
| 114 | + */ |
| 115 | +export class ForecastGeofenceEventsCommand extends $Command |
| 116 | + .classBuilder< |
| 117 | + ForecastGeofenceEventsCommandInput, |
| 118 | + ForecastGeofenceEventsCommandOutput, |
| 119 | + LocationClientResolvedConfig, |
| 120 | + ServiceInputTypes, |
| 121 | + ServiceOutputTypes |
| 122 | + >() |
| 123 | + .ep({ |
| 124 | + ...commonParams, |
| 125 | + }) |
| 126 | + .m(function (this: any, Command: any, cs: any, config: LocationClientResolvedConfig, o: any) { |
| 127 | + return [ |
| 128 | + getSerdePlugin(config, this.serialize, this.deserialize), |
| 129 | + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), |
| 130 | + ]; |
| 131 | + }) |
| 132 | + .s("LocationService", "ForecastGeofenceEvents", {}) |
| 133 | + .n("LocationClient", "ForecastGeofenceEventsCommand") |
| 134 | + .f(ForecastGeofenceEventsRequestFilterSensitiveLog, ForecastGeofenceEventsResponseFilterSensitiveLog) |
| 135 | + .ser(se_ForecastGeofenceEventsCommand) |
| 136 | + .de(de_ForecastGeofenceEventsCommand) |
| 137 | + .build() {} |
0 commit comments