{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Location.BatchGetDevicePosition
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the latest device positions for requested devices.
module Amazonka.Location.BatchGetDevicePosition
  ( -- * Creating a Request
    BatchGetDevicePosition (..),
    newBatchGetDevicePosition,

    -- * Request Lenses
    batchGetDevicePosition_deviceIds,
    batchGetDevicePosition_trackerName,

    -- * Destructuring the Response
    BatchGetDevicePositionResponse (..),
    newBatchGetDevicePositionResponse,

    -- * Response Lenses
    batchGetDevicePositionResponse_httpStatus,
    batchGetDevicePositionResponse_devicePositions,
    batchGetDevicePositionResponse_errors,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Location.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newBatchGetDevicePosition' smart constructor.
data BatchGetDevicePosition = BatchGetDevicePosition'
  { -- | Devices whose position you want to retrieve.
    --
    -- -   For example, for two devices:
    --     @device-ids=DeviceId1&device-ids=DeviceId2@
    BatchGetDevicePosition -> NonEmpty Text
deviceIds :: Prelude.NonEmpty Prelude.Text,
    -- | The tracker resource retrieving the device position.
    BatchGetDevicePosition -> Text
trackerName :: Prelude.Text
  }
  deriving (BatchGetDevicePosition -> BatchGetDevicePosition -> Bool
(BatchGetDevicePosition -> BatchGetDevicePosition -> Bool)
-> (BatchGetDevicePosition -> BatchGetDevicePosition -> Bool)
-> Eq BatchGetDevicePosition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetDevicePosition -> BatchGetDevicePosition -> Bool
$c/= :: BatchGetDevicePosition -> BatchGetDevicePosition -> Bool
== :: BatchGetDevicePosition -> BatchGetDevicePosition -> Bool
$c== :: BatchGetDevicePosition -> BatchGetDevicePosition -> Bool
Prelude.Eq, ReadPrec [BatchGetDevicePosition]
ReadPrec BatchGetDevicePosition
Int -> ReadS BatchGetDevicePosition
ReadS [BatchGetDevicePosition]
(Int -> ReadS BatchGetDevicePosition)
-> ReadS [BatchGetDevicePosition]
-> ReadPrec BatchGetDevicePosition
-> ReadPrec [BatchGetDevicePosition]
-> Read BatchGetDevicePosition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetDevicePosition]
$creadListPrec :: ReadPrec [BatchGetDevicePosition]
readPrec :: ReadPrec BatchGetDevicePosition
$creadPrec :: ReadPrec BatchGetDevicePosition
readList :: ReadS [BatchGetDevicePosition]
$creadList :: ReadS [BatchGetDevicePosition]
readsPrec :: Int -> ReadS BatchGetDevicePosition
$creadsPrec :: Int -> ReadS BatchGetDevicePosition
Prelude.Read, Int -> BatchGetDevicePosition -> ShowS
[BatchGetDevicePosition] -> ShowS
BatchGetDevicePosition -> String
(Int -> BatchGetDevicePosition -> ShowS)
-> (BatchGetDevicePosition -> String)
-> ([BatchGetDevicePosition] -> ShowS)
-> Show BatchGetDevicePosition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetDevicePosition] -> ShowS
$cshowList :: [BatchGetDevicePosition] -> ShowS
show :: BatchGetDevicePosition -> String
$cshow :: BatchGetDevicePosition -> String
showsPrec :: Int -> BatchGetDevicePosition -> ShowS
$cshowsPrec :: Int -> BatchGetDevicePosition -> ShowS
Prelude.Show, (forall x. BatchGetDevicePosition -> Rep BatchGetDevicePosition x)
-> (forall x.
    Rep BatchGetDevicePosition x -> BatchGetDevicePosition)
-> Generic BatchGetDevicePosition
forall x. Rep BatchGetDevicePosition x -> BatchGetDevicePosition
forall x. BatchGetDevicePosition -> Rep BatchGetDevicePosition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchGetDevicePosition x -> BatchGetDevicePosition
$cfrom :: forall x. BatchGetDevicePosition -> Rep BatchGetDevicePosition x
Prelude.Generic)

-- |
-- Create a value of 'BatchGetDevicePosition' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'deviceIds', 'batchGetDevicePosition_deviceIds' - Devices whose position you want to retrieve.
--
-- -   For example, for two devices:
--     @device-ids=DeviceId1&device-ids=DeviceId2@
--
-- 'trackerName', 'batchGetDevicePosition_trackerName' - The tracker resource retrieving the device position.
newBatchGetDevicePosition ::
  -- | 'deviceIds'
  Prelude.NonEmpty Prelude.Text ->
  -- | 'trackerName'
  Prelude.Text ->
  BatchGetDevicePosition
newBatchGetDevicePosition :: NonEmpty Text -> Text -> BatchGetDevicePosition
newBatchGetDevicePosition NonEmpty Text
pDeviceIds_ Text
pTrackerName_ =
  BatchGetDevicePosition' :: NonEmpty Text -> Text -> BatchGetDevicePosition
BatchGetDevicePosition'
    { $sel:deviceIds:BatchGetDevicePosition' :: NonEmpty Text
deviceIds =
        Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
 -> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pDeviceIds_,
      $sel:trackerName:BatchGetDevicePosition' :: Text
trackerName = Text
pTrackerName_
    }

-- | Devices whose position you want to retrieve.
--
-- -   For example, for two devices:
--     @device-ids=DeviceId1&device-ids=DeviceId2@
batchGetDevicePosition_deviceIds :: Lens.Lens' BatchGetDevicePosition (Prelude.NonEmpty Prelude.Text)
batchGetDevicePosition_deviceIds :: (NonEmpty Text -> f (NonEmpty Text))
-> BatchGetDevicePosition -> f BatchGetDevicePosition
batchGetDevicePosition_deviceIds = (BatchGetDevicePosition -> NonEmpty Text)
-> (BatchGetDevicePosition
    -> NonEmpty Text -> BatchGetDevicePosition)
-> Lens
     BatchGetDevicePosition
     BatchGetDevicePosition
     (NonEmpty Text)
     (NonEmpty Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetDevicePosition' {NonEmpty Text
deviceIds :: NonEmpty Text
$sel:deviceIds:BatchGetDevicePosition' :: BatchGetDevicePosition -> NonEmpty Text
deviceIds} -> NonEmpty Text
deviceIds) (\s :: BatchGetDevicePosition
s@BatchGetDevicePosition' {} NonEmpty Text
a -> BatchGetDevicePosition
s {$sel:deviceIds:BatchGetDevicePosition' :: NonEmpty Text
deviceIds = NonEmpty Text
a} :: BatchGetDevicePosition) ((NonEmpty Text -> f (NonEmpty Text))
 -> BatchGetDevicePosition -> f BatchGetDevicePosition)
-> ((NonEmpty Text -> f (NonEmpty Text))
    -> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> BatchGetDevicePosition
-> f BatchGetDevicePosition
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The tracker resource retrieving the device position.
batchGetDevicePosition_trackerName :: Lens.Lens' BatchGetDevicePosition Prelude.Text
batchGetDevicePosition_trackerName :: (Text -> f Text)
-> BatchGetDevicePosition -> f BatchGetDevicePosition
batchGetDevicePosition_trackerName = (BatchGetDevicePosition -> Text)
-> (BatchGetDevicePosition -> Text -> BatchGetDevicePosition)
-> Lens BatchGetDevicePosition BatchGetDevicePosition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetDevicePosition' {Text
trackerName :: Text
$sel:trackerName:BatchGetDevicePosition' :: BatchGetDevicePosition -> Text
trackerName} -> Text
trackerName) (\s :: BatchGetDevicePosition
s@BatchGetDevicePosition' {} Text
a -> BatchGetDevicePosition
s {$sel:trackerName:BatchGetDevicePosition' :: Text
trackerName = Text
a} :: BatchGetDevicePosition)

instance Core.AWSRequest BatchGetDevicePosition where
  type
    AWSResponse BatchGetDevicePosition =
      BatchGetDevicePositionResponse
  request :: BatchGetDevicePosition -> Request BatchGetDevicePosition
request = Service -> BatchGetDevicePosition -> Request BatchGetDevicePosition
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy BatchGetDevicePosition
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse BatchGetDevicePosition)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse BatchGetDevicePosition))
-> Logger
-> Service
-> Proxy BatchGetDevicePosition
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse BatchGetDevicePosition)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Int
-> [DevicePosition]
-> [BatchGetDevicePositionError]
-> BatchGetDevicePositionResponse
BatchGetDevicePositionResponse'
            (Int
 -> [DevicePosition]
 -> [BatchGetDevicePositionError]
 -> BatchGetDevicePositionResponse)
-> Either String Int
-> Either
     String
     ([DevicePosition]
      -> [BatchGetDevicePositionError] -> BatchGetDevicePositionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either
  String
  ([DevicePosition]
   -> [BatchGetDevicePositionError] -> BatchGetDevicePositionResponse)
-> Either String [DevicePosition]
-> Either
     String
     ([BatchGetDevicePositionError] -> BatchGetDevicePositionResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe [DevicePosition])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DevicePositions"
                            Either String (Maybe [DevicePosition])
-> [DevicePosition] -> Either String [DevicePosition]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [DevicePosition]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  ([BatchGetDevicePositionError] -> BatchGetDevicePositionResponse)
-> Either String [BatchGetDevicePositionError]
-> Either String BatchGetDevicePositionResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Either String (Maybe [BatchGetDevicePositionError])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Errors" Either String (Maybe [BatchGetDevicePositionError])
-> [BatchGetDevicePositionError]
-> Either String [BatchGetDevicePositionError]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [BatchGetDevicePositionError]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable BatchGetDevicePosition

instance Prelude.NFData BatchGetDevicePosition

instance Core.ToHeaders BatchGetDevicePosition where
  toHeaders :: BatchGetDevicePosition -> ResponseHeaders
toHeaders =
    ResponseHeaders -> BatchGetDevicePosition -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON BatchGetDevicePosition where
  toJSON :: BatchGetDevicePosition -> Value
toJSON BatchGetDevicePosition' {NonEmpty Text
Text
trackerName :: Text
deviceIds :: NonEmpty Text
$sel:trackerName:BatchGetDevicePosition' :: BatchGetDevicePosition -> Text
$sel:deviceIds:BatchGetDevicePosition' :: BatchGetDevicePosition -> NonEmpty Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DeviceIds" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Text
deviceIds)]
      )

instance Core.ToPath BatchGetDevicePosition where
  toPath :: BatchGetDevicePosition -> ByteString
toPath BatchGetDevicePosition' {NonEmpty Text
Text
trackerName :: Text
deviceIds :: NonEmpty Text
$sel:trackerName:BatchGetDevicePosition' :: BatchGetDevicePosition -> Text
$sel:deviceIds:BatchGetDevicePosition' :: BatchGetDevicePosition -> NonEmpty Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/tracking/v0/trackers/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
trackerName,
        ByteString
"/get-positions"
      ]

instance Core.ToQuery BatchGetDevicePosition where
  toQuery :: BatchGetDevicePosition -> QueryString
toQuery = QueryString -> BatchGetDevicePosition -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newBatchGetDevicePositionResponse' smart constructor.
data BatchGetDevicePositionResponse = BatchGetDevicePositionResponse'
  { -- | The response's http status code.
    BatchGetDevicePositionResponse -> Int
httpStatus :: Prelude.Int,
    -- | Contains device position details such as the device ID, position, and
    -- timestamps for when the position was received and sampled.
    BatchGetDevicePositionResponse -> [DevicePosition]
devicePositions :: [DevicePosition],
    -- | Contains error details for each device that failed to send its position
    -- to the tracker resource.
    BatchGetDevicePositionResponse -> [BatchGetDevicePositionError]
errors :: [BatchGetDevicePositionError]
  }
  deriving (BatchGetDevicePositionResponse
-> BatchGetDevicePositionResponse -> Bool
(BatchGetDevicePositionResponse
 -> BatchGetDevicePositionResponse -> Bool)
-> (BatchGetDevicePositionResponse
    -> BatchGetDevicePositionResponse -> Bool)
-> Eq BatchGetDevicePositionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetDevicePositionResponse
-> BatchGetDevicePositionResponse -> Bool
$c/= :: BatchGetDevicePositionResponse
-> BatchGetDevicePositionResponse -> Bool
== :: BatchGetDevicePositionResponse
-> BatchGetDevicePositionResponse -> Bool
$c== :: BatchGetDevicePositionResponse
-> BatchGetDevicePositionResponse -> Bool
Prelude.Eq, Int -> BatchGetDevicePositionResponse -> ShowS
[BatchGetDevicePositionResponse] -> ShowS
BatchGetDevicePositionResponse -> String
(Int -> BatchGetDevicePositionResponse -> ShowS)
-> (BatchGetDevicePositionResponse -> String)
-> ([BatchGetDevicePositionResponse] -> ShowS)
-> Show BatchGetDevicePositionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetDevicePositionResponse] -> ShowS
$cshowList :: [BatchGetDevicePositionResponse] -> ShowS
show :: BatchGetDevicePositionResponse -> String
$cshow :: BatchGetDevicePositionResponse -> String
showsPrec :: Int -> BatchGetDevicePositionResponse -> ShowS
$cshowsPrec :: Int -> BatchGetDevicePositionResponse -> ShowS
Prelude.Show, (forall x.
 BatchGetDevicePositionResponse
 -> Rep BatchGetDevicePositionResponse x)
-> (forall x.
    Rep BatchGetDevicePositionResponse x
    -> BatchGetDevicePositionResponse)
-> Generic BatchGetDevicePositionResponse
forall x.
Rep BatchGetDevicePositionResponse x
-> BatchGetDevicePositionResponse
forall x.
BatchGetDevicePositionResponse
-> Rep BatchGetDevicePositionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchGetDevicePositionResponse x
-> BatchGetDevicePositionResponse
$cfrom :: forall x.
BatchGetDevicePositionResponse
-> Rep BatchGetDevicePositionResponse x
Prelude.Generic)

-- |
-- Create a value of 'BatchGetDevicePositionResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'httpStatus', 'batchGetDevicePositionResponse_httpStatus' - The response's http status code.
--
-- 'devicePositions', 'batchGetDevicePositionResponse_devicePositions' - Contains device position details such as the device ID, position, and
-- timestamps for when the position was received and sampled.
--
-- 'errors', 'batchGetDevicePositionResponse_errors' - Contains error details for each device that failed to send its position
-- to the tracker resource.
newBatchGetDevicePositionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  BatchGetDevicePositionResponse
newBatchGetDevicePositionResponse :: Int -> BatchGetDevicePositionResponse
newBatchGetDevicePositionResponse Int
pHttpStatus_ =
  BatchGetDevicePositionResponse' :: Int
-> [DevicePosition]
-> [BatchGetDevicePositionError]
-> BatchGetDevicePositionResponse
BatchGetDevicePositionResponse'
    { $sel:httpStatus:BatchGetDevicePositionResponse' :: Int
httpStatus =
        Int
pHttpStatus_,
      $sel:devicePositions:BatchGetDevicePositionResponse' :: [DevicePosition]
devicePositions = [DevicePosition]
forall a. Monoid a => a
Prelude.mempty,
      $sel:errors:BatchGetDevicePositionResponse' :: [BatchGetDevicePositionError]
errors = [BatchGetDevicePositionError]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The response's http status code.
batchGetDevicePositionResponse_httpStatus :: Lens.Lens' BatchGetDevicePositionResponse Prelude.Int
batchGetDevicePositionResponse_httpStatus :: (Int -> f Int)
-> BatchGetDevicePositionResponse
-> f BatchGetDevicePositionResponse
batchGetDevicePositionResponse_httpStatus = (BatchGetDevicePositionResponse -> Int)
-> (BatchGetDevicePositionResponse
    -> Int -> BatchGetDevicePositionResponse)
-> Lens
     BatchGetDevicePositionResponse
     BatchGetDevicePositionResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetDevicePositionResponse' {Int
httpStatus :: Int
$sel:httpStatus:BatchGetDevicePositionResponse' :: BatchGetDevicePositionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: BatchGetDevicePositionResponse
s@BatchGetDevicePositionResponse' {} Int
a -> BatchGetDevicePositionResponse
s {$sel:httpStatus:BatchGetDevicePositionResponse' :: Int
httpStatus = Int
a} :: BatchGetDevicePositionResponse)

-- | Contains device position details such as the device ID, position, and
-- timestamps for when the position was received and sampled.
batchGetDevicePositionResponse_devicePositions :: Lens.Lens' BatchGetDevicePositionResponse [DevicePosition]
batchGetDevicePositionResponse_devicePositions :: ([DevicePosition] -> f [DevicePosition])
-> BatchGetDevicePositionResponse
-> f BatchGetDevicePositionResponse
batchGetDevicePositionResponse_devicePositions = (BatchGetDevicePositionResponse -> [DevicePosition])
-> (BatchGetDevicePositionResponse
    -> [DevicePosition] -> BatchGetDevicePositionResponse)
-> Lens
     BatchGetDevicePositionResponse
     BatchGetDevicePositionResponse
     [DevicePosition]
     [DevicePosition]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetDevicePositionResponse' {[DevicePosition]
devicePositions :: [DevicePosition]
$sel:devicePositions:BatchGetDevicePositionResponse' :: BatchGetDevicePositionResponse -> [DevicePosition]
devicePositions} -> [DevicePosition]
devicePositions) (\s :: BatchGetDevicePositionResponse
s@BatchGetDevicePositionResponse' {} [DevicePosition]
a -> BatchGetDevicePositionResponse
s {$sel:devicePositions:BatchGetDevicePositionResponse' :: [DevicePosition]
devicePositions = [DevicePosition]
a} :: BatchGetDevicePositionResponse) (([DevicePosition] -> f [DevicePosition])
 -> BatchGetDevicePositionResponse
 -> f BatchGetDevicePositionResponse)
-> (([DevicePosition] -> f [DevicePosition])
    -> [DevicePosition] -> f [DevicePosition])
-> ([DevicePosition] -> f [DevicePosition])
-> BatchGetDevicePositionResponse
-> f BatchGetDevicePositionResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([DevicePosition] -> f [DevicePosition])
-> [DevicePosition] -> f [DevicePosition]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Contains error details for each device that failed to send its position
-- to the tracker resource.
batchGetDevicePositionResponse_errors :: Lens.Lens' BatchGetDevicePositionResponse [BatchGetDevicePositionError]
batchGetDevicePositionResponse_errors :: ([BatchGetDevicePositionError] -> f [BatchGetDevicePositionError])
-> BatchGetDevicePositionResponse
-> f BatchGetDevicePositionResponse
batchGetDevicePositionResponse_errors = (BatchGetDevicePositionResponse -> [BatchGetDevicePositionError])
-> (BatchGetDevicePositionResponse
    -> [BatchGetDevicePositionError] -> BatchGetDevicePositionResponse)
-> Lens
     BatchGetDevicePositionResponse
     BatchGetDevicePositionResponse
     [BatchGetDevicePositionError]
     [BatchGetDevicePositionError]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetDevicePositionResponse' {[BatchGetDevicePositionError]
errors :: [BatchGetDevicePositionError]
$sel:errors:BatchGetDevicePositionResponse' :: BatchGetDevicePositionResponse -> [BatchGetDevicePositionError]
errors} -> [BatchGetDevicePositionError]
errors) (\s :: BatchGetDevicePositionResponse
s@BatchGetDevicePositionResponse' {} [BatchGetDevicePositionError]
a -> BatchGetDevicePositionResponse
s {$sel:errors:BatchGetDevicePositionResponse' :: [BatchGetDevicePositionError]
errors = [BatchGetDevicePositionError]
a} :: BatchGetDevicePositionResponse) (([BatchGetDevicePositionError] -> f [BatchGetDevicePositionError])
 -> BatchGetDevicePositionResponse
 -> f BatchGetDevicePositionResponse)
-> (([BatchGetDevicePositionError]
     -> f [BatchGetDevicePositionError])
    -> [BatchGetDevicePositionError]
    -> f [BatchGetDevicePositionError])
-> ([BatchGetDevicePositionError]
    -> f [BatchGetDevicePositionError])
-> BatchGetDevicePositionResponse
-> f BatchGetDevicePositionResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([BatchGetDevicePositionError] -> f [BatchGetDevicePositionError])
-> [BatchGetDevicePositionError] -> f [BatchGetDevicePositionError]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    BatchGetDevicePositionResponse