{-# 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.ListDevicePositions
-- 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)
--
-- A batch request to retrieve all device positions.
--
-- This operation returns paginated results.
module Amazonka.Location.ListDevicePositions
  ( -- * Creating a Request
    ListDevicePositions (..),
    newListDevicePositions,

    -- * Request Lenses
    listDevicePositions_nextToken,
    listDevicePositions_maxResults,
    listDevicePositions_trackerName,

    -- * Destructuring the Response
    ListDevicePositionsResponse (..),
    newListDevicePositionsResponse,

    -- * Response Lenses
    listDevicePositionsResponse_nextToken,
    listDevicePositionsResponse_httpStatus,
    listDevicePositionsResponse_entries,
  )
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:/ 'newListDevicePositions' smart constructor.
data ListDevicePositions = ListDevicePositions'
  { -- | The pagination token specifying which page of results to return in the
    -- response. If no token is provided, the default page is the first page.
    --
    -- Default value: @null@
    ListDevicePositions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An optional limit for the number of entries returned in a single call.
    --
    -- Default value: @100@
    ListDevicePositions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The tracker resource containing the requested devices.
    ListDevicePositions -> Text
trackerName :: Prelude.Text
  }
  deriving (ListDevicePositions -> ListDevicePositions -> Bool
(ListDevicePositions -> ListDevicePositions -> Bool)
-> (ListDevicePositions -> ListDevicePositions -> Bool)
-> Eq ListDevicePositions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDevicePositions -> ListDevicePositions -> Bool
$c/= :: ListDevicePositions -> ListDevicePositions -> Bool
== :: ListDevicePositions -> ListDevicePositions -> Bool
$c== :: ListDevicePositions -> ListDevicePositions -> Bool
Prelude.Eq, ReadPrec [ListDevicePositions]
ReadPrec ListDevicePositions
Int -> ReadS ListDevicePositions
ReadS [ListDevicePositions]
(Int -> ReadS ListDevicePositions)
-> ReadS [ListDevicePositions]
-> ReadPrec ListDevicePositions
-> ReadPrec [ListDevicePositions]
-> Read ListDevicePositions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDevicePositions]
$creadListPrec :: ReadPrec [ListDevicePositions]
readPrec :: ReadPrec ListDevicePositions
$creadPrec :: ReadPrec ListDevicePositions
readList :: ReadS [ListDevicePositions]
$creadList :: ReadS [ListDevicePositions]
readsPrec :: Int -> ReadS ListDevicePositions
$creadsPrec :: Int -> ReadS ListDevicePositions
Prelude.Read, Int -> ListDevicePositions -> ShowS
[ListDevicePositions] -> ShowS
ListDevicePositions -> String
(Int -> ListDevicePositions -> ShowS)
-> (ListDevicePositions -> String)
-> ([ListDevicePositions] -> ShowS)
-> Show ListDevicePositions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDevicePositions] -> ShowS
$cshowList :: [ListDevicePositions] -> ShowS
show :: ListDevicePositions -> String
$cshow :: ListDevicePositions -> String
showsPrec :: Int -> ListDevicePositions -> ShowS
$cshowsPrec :: Int -> ListDevicePositions -> ShowS
Prelude.Show, (forall x. ListDevicePositions -> Rep ListDevicePositions x)
-> (forall x. Rep ListDevicePositions x -> ListDevicePositions)
-> Generic ListDevicePositions
forall x. Rep ListDevicePositions x -> ListDevicePositions
forall x. ListDevicePositions -> Rep ListDevicePositions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDevicePositions x -> ListDevicePositions
$cfrom :: forall x. ListDevicePositions -> Rep ListDevicePositions x
Prelude.Generic)

-- |
-- Create a value of 'ListDevicePositions' 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:
--
-- 'nextToken', 'listDevicePositions_nextToken' - The pagination token specifying which page of results to return in the
-- response. If no token is provided, the default page is the first page.
--
-- Default value: @null@
--
-- 'maxResults', 'listDevicePositions_maxResults' - An optional limit for the number of entries returned in a single call.
--
-- Default value: @100@
--
-- 'trackerName', 'listDevicePositions_trackerName' - The tracker resource containing the requested devices.
newListDevicePositions ::
  -- | 'trackerName'
  Prelude.Text ->
  ListDevicePositions
newListDevicePositions :: Text -> ListDevicePositions
newListDevicePositions Text
pTrackerName_ =
  ListDevicePositions' :: Maybe Text -> Maybe Natural -> Text -> ListDevicePositions
ListDevicePositions'
    { $sel:nextToken:ListDevicePositions' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListDevicePositions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:trackerName:ListDevicePositions' :: Text
trackerName = Text
pTrackerName_
    }

-- | The pagination token specifying which page of results to return in the
-- response. If no token is provided, the default page is the first page.
--
-- Default value: @null@
listDevicePositions_nextToken :: Lens.Lens' ListDevicePositions (Prelude.Maybe Prelude.Text)
listDevicePositions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDevicePositions -> f ListDevicePositions
listDevicePositions_nextToken = (ListDevicePositions -> Maybe Text)
-> (ListDevicePositions -> Maybe Text -> ListDevicePositions)
-> Lens
     ListDevicePositions ListDevicePositions (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDevicePositions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDevicePositions' :: ListDevicePositions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDevicePositions
s@ListDevicePositions' {} Maybe Text
a -> ListDevicePositions
s {$sel:nextToken:ListDevicePositions' :: Maybe Text
nextToken = Maybe Text
a} :: ListDevicePositions)

-- | An optional limit for the number of entries returned in a single call.
--
-- Default value: @100@
listDevicePositions_maxResults :: Lens.Lens' ListDevicePositions (Prelude.Maybe Prelude.Natural)
listDevicePositions_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListDevicePositions -> f ListDevicePositions
listDevicePositions_maxResults = (ListDevicePositions -> Maybe Natural)
-> (ListDevicePositions -> Maybe Natural -> ListDevicePositions)
-> Lens
     ListDevicePositions
     ListDevicePositions
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDevicePositions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListDevicePositions' :: ListDevicePositions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListDevicePositions
s@ListDevicePositions' {} Maybe Natural
a -> ListDevicePositions
s {$sel:maxResults:ListDevicePositions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListDevicePositions)

-- | The tracker resource containing the requested devices.
listDevicePositions_trackerName :: Lens.Lens' ListDevicePositions Prelude.Text
listDevicePositions_trackerName :: (Text -> f Text) -> ListDevicePositions -> f ListDevicePositions
listDevicePositions_trackerName = (ListDevicePositions -> Text)
-> (ListDevicePositions -> Text -> ListDevicePositions)
-> Lens ListDevicePositions ListDevicePositions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDevicePositions' {Text
trackerName :: Text
$sel:trackerName:ListDevicePositions' :: ListDevicePositions -> Text
trackerName} -> Text
trackerName) (\s :: ListDevicePositions
s@ListDevicePositions' {} Text
a -> ListDevicePositions
s {$sel:trackerName:ListDevicePositions' :: Text
trackerName = Text
a} :: ListDevicePositions)

instance Core.AWSPager ListDevicePositions where
  page :: ListDevicePositions
-> AWSResponse ListDevicePositions -> Maybe ListDevicePositions
page ListDevicePositions
rq AWSResponse ListDevicePositions
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListDevicePositions
ListDevicePositionsResponse
rs
            ListDevicePositionsResponse
-> Getting (First Text) ListDevicePositionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListDevicePositionsResponse
-> Const (First Text) ListDevicePositionsResponse
Lens' ListDevicePositionsResponse (Maybe Text)
listDevicePositionsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListDevicePositionsResponse
 -> Const (First Text) ListDevicePositionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListDevicePositionsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListDevicePositions
forall a. Maybe a
Prelude.Nothing
    | [ListDevicePositionsResponseEntry] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        (AWSResponse ListDevicePositions
ListDevicePositionsResponse
rs ListDevicePositionsResponse
-> Getting
     [ListDevicePositionsResponseEntry]
     ListDevicePositionsResponse
     [ListDevicePositionsResponseEntry]
-> [ListDevicePositionsResponseEntry]
forall s a. s -> Getting a s a -> a
Lens.^. Getting
  [ListDevicePositionsResponseEntry]
  ListDevicePositionsResponse
  [ListDevicePositionsResponseEntry]
Lens'
  ListDevicePositionsResponse [ListDevicePositionsResponseEntry]
listDevicePositionsResponse_entries) =
      Maybe ListDevicePositions
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListDevicePositions -> Maybe ListDevicePositions
forall a. a -> Maybe a
Prelude.Just (ListDevicePositions -> Maybe ListDevicePositions)
-> ListDevicePositions -> Maybe ListDevicePositions
forall a b. (a -> b) -> a -> b
Prelude.$
        ListDevicePositions
rq
          ListDevicePositions
-> (ListDevicePositions -> ListDevicePositions)
-> ListDevicePositions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListDevicePositions -> Identity ListDevicePositions
Lens
  ListDevicePositions ListDevicePositions (Maybe Text) (Maybe Text)
listDevicePositions_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListDevicePositions -> Identity ListDevicePositions)
-> Maybe Text -> ListDevicePositions -> ListDevicePositions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListDevicePositions
ListDevicePositionsResponse
rs
          ListDevicePositionsResponse
-> Getting (First Text) ListDevicePositionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListDevicePositionsResponse
-> Const (First Text) ListDevicePositionsResponse
Lens' ListDevicePositionsResponse (Maybe Text)
listDevicePositionsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListDevicePositionsResponse
 -> Const (First Text) ListDevicePositionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListDevicePositionsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListDevicePositions where
  type
    AWSResponse ListDevicePositions =
      ListDevicePositionsResponse
  request :: ListDevicePositions -> Request ListDevicePositions
request = Service -> ListDevicePositions -> Request ListDevicePositions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListDevicePositions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListDevicePositions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListDevicePositions))
-> Logger
-> Service
-> Proxy ListDevicePositions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListDevicePositions)))
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 ->
          Maybe Text
-> Int
-> [ListDevicePositionsResponseEntry]
-> ListDevicePositionsResponse
ListDevicePositionsResponse'
            (Maybe Text
 -> Int
 -> [ListDevicePositionsResponseEntry]
 -> ListDevicePositionsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Int
      -> [ListDevicePositionsResponseEntry]
      -> ListDevicePositionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either
  String
  (Int
   -> [ListDevicePositionsResponseEntry]
   -> ListDevicePositionsResponse)
-> Either String Int
-> Either
     String
     ([ListDevicePositionsResponseEntry] -> ListDevicePositionsResponse)
forall (f :: * -> *) a b. Applicative f => 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
  ([ListDevicePositionsResponseEntry] -> ListDevicePositionsResponse)
-> Either String [ListDevicePositionsResponseEntry]
-> Either String ListDevicePositionsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Either String (Maybe [ListDevicePositionsResponseEntry])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Entries" Either String (Maybe [ListDevicePositionsResponseEntry])
-> [ListDevicePositionsResponseEntry]
-> Either String [ListDevicePositionsResponseEntry]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [ListDevicePositionsResponseEntry]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable ListDevicePositions

instance Prelude.NFData ListDevicePositions

instance Core.ToHeaders ListDevicePositions where
  toHeaders :: ListDevicePositions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListDevicePositions -> 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 ListDevicePositions where
  toJSON :: ListDevicePositions -> Value
toJSON ListDevicePositions' {Maybe Natural
Maybe Text
Text
trackerName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:trackerName:ListDevicePositions' :: ListDevicePositions -> Text
$sel:maxResults:ListDevicePositions' :: ListDevicePositions -> Maybe Natural
$sel:nextToken:ListDevicePositions' :: ListDevicePositions -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults
          ]
      )

instance Core.ToPath ListDevicePositions where
  toPath :: ListDevicePositions -> ByteString
toPath ListDevicePositions' {Maybe Natural
Maybe Text
Text
trackerName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:trackerName:ListDevicePositions' :: ListDevicePositions -> Text
$sel:maxResults:ListDevicePositions' :: ListDevicePositions -> Maybe Natural
$sel:nextToken:ListDevicePositions' :: ListDevicePositions -> Maybe 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
"/list-positions"
      ]

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

-- | /See:/ 'newListDevicePositionsResponse' smart constructor.
data ListDevicePositionsResponse = ListDevicePositionsResponse'
  { -- | A pagination token indicating there are additional pages available. You
    -- can use the token in a following request to fetch the next set of
    -- results.
    ListDevicePositionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListDevicePositionsResponse -> Int
httpStatus :: Prelude.Int,
    -- | Contains details about each device\'s last known position. These details
    -- includes the device ID, the time when the position was sampled on the
    -- device, the time that the service received the update, and the most
    -- recent coordinates.
    ListDevicePositionsResponse -> [ListDevicePositionsResponseEntry]
entries :: [ListDevicePositionsResponseEntry]
  }
  deriving (ListDevicePositionsResponse -> ListDevicePositionsResponse -> Bool
(ListDevicePositionsResponse
 -> ListDevicePositionsResponse -> Bool)
-> (ListDevicePositionsResponse
    -> ListDevicePositionsResponse -> Bool)
-> Eq ListDevicePositionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDevicePositionsResponse -> ListDevicePositionsResponse -> Bool
$c/= :: ListDevicePositionsResponse -> ListDevicePositionsResponse -> Bool
== :: ListDevicePositionsResponse -> ListDevicePositionsResponse -> Bool
$c== :: ListDevicePositionsResponse -> ListDevicePositionsResponse -> Bool
Prelude.Eq, Int -> ListDevicePositionsResponse -> ShowS
[ListDevicePositionsResponse] -> ShowS
ListDevicePositionsResponse -> String
(Int -> ListDevicePositionsResponse -> ShowS)
-> (ListDevicePositionsResponse -> String)
-> ([ListDevicePositionsResponse] -> ShowS)
-> Show ListDevicePositionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDevicePositionsResponse] -> ShowS
$cshowList :: [ListDevicePositionsResponse] -> ShowS
show :: ListDevicePositionsResponse -> String
$cshow :: ListDevicePositionsResponse -> String
showsPrec :: Int -> ListDevicePositionsResponse -> ShowS
$cshowsPrec :: Int -> ListDevicePositionsResponse -> ShowS
Prelude.Show, (forall x.
 ListDevicePositionsResponse -> Rep ListDevicePositionsResponse x)
-> (forall x.
    Rep ListDevicePositionsResponse x -> ListDevicePositionsResponse)
-> Generic ListDevicePositionsResponse
forall x.
Rep ListDevicePositionsResponse x -> ListDevicePositionsResponse
forall x.
ListDevicePositionsResponse -> Rep ListDevicePositionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDevicePositionsResponse x -> ListDevicePositionsResponse
$cfrom :: forall x.
ListDevicePositionsResponse -> Rep ListDevicePositionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListDevicePositionsResponse' 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:
--
-- 'nextToken', 'listDevicePositionsResponse_nextToken' - A pagination token indicating there are additional pages available. You
-- can use the token in a following request to fetch the next set of
-- results.
--
-- 'httpStatus', 'listDevicePositionsResponse_httpStatus' - The response's http status code.
--
-- 'entries', 'listDevicePositionsResponse_entries' - Contains details about each device\'s last known position. These details
-- includes the device ID, the time when the position was sampled on the
-- device, the time that the service received the update, and the most
-- recent coordinates.
newListDevicePositionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListDevicePositionsResponse
newListDevicePositionsResponse :: Int -> ListDevicePositionsResponse
newListDevicePositionsResponse Int
pHttpStatus_ =
  ListDevicePositionsResponse' :: Maybe Text
-> Int
-> [ListDevicePositionsResponseEntry]
-> ListDevicePositionsResponse
ListDevicePositionsResponse'
    { $sel:nextToken:ListDevicePositionsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListDevicePositionsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:entries:ListDevicePositionsResponse' :: [ListDevicePositionsResponseEntry]
entries = [ListDevicePositionsResponseEntry]
forall a. Monoid a => a
Prelude.mempty
    }

-- | A pagination token indicating there are additional pages available. You
-- can use the token in a following request to fetch the next set of
-- results.
listDevicePositionsResponse_nextToken :: Lens.Lens' ListDevicePositionsResponse (Prelude.Maybe Prelude.Text)
listDevicePositionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDevicePositionsResponse -> f ListDevicePositionsResponse
listDevicePositionsResponse_nextToken = (ListDevicePositionsResponse -> Maybe Text)
-> (ListDevicePositionsResponse
    -> Maybe Text -> ListDevicePositionsResponse)
-> Lens' ListDevicePositionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDevicePositionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDevicePositionsResponse' :: ListDevicePositionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDevicePositionsResponse
s@ListDevicePositionsResponse' {} Maybe Text
a -> ListDevicePositionsResponse
s {$sel:nextToken:ListDevicePositionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDevicePositionsResponse)

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

-- | Contains details about each device\'s last known position. These details
-- includes the device ID, the time when the position was sampled on the
-- device, the time that the service received the update, and the most
-- recent coordinates.
listDevicePositionsResponse_entries :: Lens.Lens' ListDevicePositionsResponse [ListDevicePositionsResponseEntry]
listDevicePositionsResponse_entries :: ([ListDevicePositionsResponseEntry]
 -> f [ListDevicePositionsResponseEntry])
-> ListDevicePositionsResponse -> f ListDevicePositionsResponse
listDevicePositionsResponse_entries = (ListDevicePositionsResponse -> [ListDevicePositionsResponseEntry])
-> (ListDevicePositionsResponse
    -> [ListDevicePositionsResponseEntry]
    -> ListDevicePositionsResponse)
-> Lens'
     ListDevicePositionsResponse [ListDevicePositionsResponseEntry]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDevicePositionsResponse' {[ListDevicePositionsResponseEntry]
entries :: [ListDevicePositionsResponseEntry]
$sel:entries:ListDevicePositionsResponse' :: ListDevicePositionsResponse -> [ListDevicePositionsResponseEntry]
entries} -> [ListDevicePositionsResponseEntry]
entries) (\s :: ListDevicePositionsResponse
s@ListDevicePositionsResponse' {} [ListDevicePositionsResponseEntry]
a -> ListDevicePositionsResponse
s {$sel:entries:ListDevicePositionsResponse' :: [ListDevicePositionsResponseEntry]
entries = [ListDevicePositionsResponseEntry]
a} :: ListDevicePositionsResponse) (([ListDevicePositionsResponseEntry]
  -> f [ListDevicePositionsResponseEntry])
 -> ListDevicePositionsResponse -> f ListDevicePositionsResponse)
-> (([ListDevicePositionsResponseEntry]
     -> f [ListDevicePositionsResponseEntry])
    -> [ListDevicePositionsResponseEntry]
    -> f [ListDevicePositionsResponseEntry])
-> ([ListDevicePositionsResponseEntry]
    -> f [ListDevicePositionsResponseEntry])
-> ListDevicePositionsResponse
-> f ListDevicePositionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ListDevicePositionsResponseEntry]
 -> f [ListDevicePositionsResponseEntry])
-> [ListDevicePositionsResponseEntry]
-> f [ListDevicePositionsResponseEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListDevicePositionsResponse