{-# 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 #-}
module Amazonka.Location.ListGeofenceCollections
(
ListGeofenceCollections (..),
newListGeofenceCollections,
listGeofenceCollections_maxResults,
listGeofenceCollections_nextToken,
ListGeofenceCollectionsResponse (..),
newListGeofenceCollectionsResponse,
listGeofenceCollectionsResponse_nextToken,
listGeofenceCollectionsResponse_httpStatus,
listGeofenceCollectionsResponse_entries,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Location.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListGeofenceCollections = ListGeofenceCollections'
{
ListGeofenceCollections -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListGeofenceCollections -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListGeofenceCollections -> ListGeofenceCollections -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListGeofenceCollections -> ListGeofenceCollections -> Bool
$c/= :: ListGeofenceCollections -> ListGeofenceCollections -> Bool
== :: ListGeofenceCollections -> ListGeofenceCollections -> Bool
$c== :: ListGeofenceCollections -> ListGeofenceCollections -> Bool
Prelude.Eq, ReadPrec [ListGeofenceCollections]
ReadPrec ListGeofenceCollections
Int -> ReadS ListGeofenceCollections
ReadS [ListGeofenceCollections]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListGeofenceCollections]
$creadListPrec :: ReadPrec [ListGeofenceCollections]
readPrec :: ReadPrec ListGeofenceCollections
$creadPrec :: ReadPrec ListGeofenceCollections
readList :: ReadS [ListGeofenceCollections]
$creadList :: ReadS [ListGeofenceCollections]
readsPrec :: Int -> ReadS ListGeofenceCollections
$creadsPrec :: Int -> ReadS ListGeofenceCollections
Prelude.Read, Int -> ListGeofenceCollections -> ShowS
[ListGeofenceCollections] -> ShowS
ListGeofenceCollections -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListGeofenceCollections] -> ShowS
$cshowList :: [ListGeofenceCollections] -> ShowS
show :: ListGeofenceCollections -> String
$cshow :: ListGeofenceCollections -> String
showsPrec :: Int -> ListGeofenceCollections -> ShowS
$cshowsPrec :: Int -> ListGeofenceCollections -> ShowS
Prelude.Show, forall x. Rep ListGeofenceCollections x -> ListGeofenceCollections
forall x. ListGeofenceCollections -> Rep ListGeofenceCollections x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListGeofenceCollections x -> ListGeofenceCollections
$cfrom :: forall x. ListGeofenceCollections -> Rep ListGeofenceCollections x
Prelude.Generic)
newListGeofenceCollections ::
ListGeofenceCollections
newListGeofenceCollections :: ListGeofenceCollections
newListGeofenceCollections =
ListGeofenceCollections'
{ $sel:maxResults:ListGeofenceCollections' :: Maybe Natural
maxResults =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListGeofenceCollections' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listGeofenceCollections_maxResults :: Lens.Lens' ListGeofenceCollections (Prelude.Maybe Prelude.Natural)
listGeofenceCollections_maxResults :: Lens' ListGeofenceCollections (Maybe Natural)
listGeofenceCollections_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGeofenceCollections' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListGeofenceCollections' :: ListGeofenceCollections -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListGeofenceCollections
s@ListGeofenceCollections' {} Maybe Natural
a -> ListGeofenceCollections
s {$sel:maxResults:ListGeofenceCollections' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListGeofenceCollections)
listGeofenceCollections_nextToken :: Lens.Lens' ListGeofenceCollections (Prelude.Maybe Prelude.Text)
listGeofenceCollections_nextToken :: Lens' ListGeofenceCollections (Maybe Text)
listGeofenceCollections_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGeofenceCollections' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListGeofenceCollections' :: ListGeofenceCollections -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListGeofenceCollections
s@ListGeofenceCollections' {} Maybe Text
a -> ListGeofenceCollections
s {$sel:nextToken:ListGeofenceCollections' :: Maybe Text
nextToken = Maybe Text
a} :: ListGeofenceCollections)
instance Core.AWSPager ListGeofenceCollections where
page :: ListGeofenceCollections
-> AWSResponse ListGeofenceCollections
-> Maybe ListGeofenceCollections
page ListGeofenceCollections
rq AWSResponse ListGeofenceCollections
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListGeofenceCollections
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListGeofenceCollectionsResponse (Maybe Text)
listGeofenceCollectionsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| forall a. AWSTruncated a => a -> Bool
Core.stop
(AWSResponse ListGeofenceCollections
rs forall s a. s -> Getting a s a -> a
Lens.^. Lens'
ListGeofenceCollectionsResponse
[ListGeofenceCollectionsResponseEntry]
listGeofenceCollectionsResponse_entries) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListGeofenceCollections
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListGeofenceCollections (Maybe Text)
listGeofenceCollections_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListGeofenceCollections
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListGeofenceCollectionsResponse (Maybe Text)
listGeofenceCollectionsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest ListGeofenceCollections where
type
AWSResponse ListGeofenceCollections =
ListGeofenceCollectionsResponse
request :: (Service -> Service)
-> ListGeofenceCollections -> Request ListGeofenceCollections
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListGeofenceCollections
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListGeofenceCollections)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Int
-> [ListGeofenceCollectionsResponseEntry]
-> ListGeofenceCollectionsResponse
ListGeofenceCollectionsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Entries" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable ListGeofenceCollections where
hashWithSalt :: Int -> ListGeofenceCollections -> Int
hashWithSalt Int
_salt ListGeofenceCollections' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListGeofenceCollections' :: ListGeofenceCollections -> Maybe Text
$sel:maxResults:ListGeofenceCollections' :: ListGeofenceCollections -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
instance Prelude.NFData ListGeofenceCollections where
rnf :: ListGeofenceCollections -> ()
rnf ListGeofenceCollections' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListGeofenceCollections' :: ListGeofenceCollections -> Maybe Text
$sel:maxResults:ListGeofenceCollections' :: ListGeofenceCollections -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
instance Data.ToHeaders ListGeofenceCollections where
toHeaders :: ListGeofenceCollections -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON ListGeofenceCollections where
toJSON :: ListGeofenceCollections -> Value
toJSON ListGeofenceCollections' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListGeofenceCollections' :: ListGeofenceCollections -> Maybe Text
$sel:maxResults:ListGeofenceCollections' :: ListGeofenceCollections -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
(Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken
]
)
instance Data.ToPath ListGeofenceCollections where
toPath :: ListGeofenceCollections -> ByteString
toPath =
forall a b. a -> b -> a
Prelude.const ByteString
"/geofencing/v0/list-collections"
instance Data.ToQuery ListGeofenceCollections where
toQuery :: ListGeofenceCollections -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListGeofenceCollectionsResponse = ListGeofenceCollectionsResponse'
{
ListGeofenceCollectionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListGeofenceCollectionsResponse -> Int
httpStatus :: Prelude.Int,
ListGeofenceCollectionsResponse
-> [ListGeofenceCollectionsResponseEntry]
entries :: [ListGeofenceCollectionsResponseEntry]
}
deriving (ListGeofenceCollectionsResponse
-> ListGeofenceCollectionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListGeofenceCollectionsResponse
-> ListGeofenceCollectionsResponse -> Bool
$c/= :: ListGeofenceCollectionsResponse
-> ListGeofenceCollectionsResponse -> Bool
== :: ListGeofenceCollectionsResponse
-> ListGeofenceCollectionsResponse -> Bool
$c== :: ListGeofenceCollectionsResponse
-> ListGeofenceCollectionsResponse -> Bool
Prelude.Eq, ReadPrec [ListGeofenceCollectionsResponse]
ReadPrec ListGeofenceCollectionsResponse
Int -> ReadS ListGeofenceCollectionsResponse
ReadS [ListGeofenceCollectionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListGeofenceCollectionsResponse]
$creadListPrec :: ReadPrec [ListGeofenceCollectionsResponse]
readPrec :: ReadPrec ListGeofenceCollectionsResponse
$creadPrec :: ReadPrec ListGeofenceCollectionsResponse
readList :: ReadS [ListGeofenceCollectionsResponse]
$creadList :: ReadS [ListGeofenceCollectionsResponse]
readsPrec :: Int -> ReadS ListGeofenceCollectionsResponse
$creadsPrec :: Int -> ReadS ListGeofenceCollectionsResponse
Prelude.Read, Int -> ListGeofenceCollectionsResponse -> ShowS
[ListGeofenceCollectionsResponse] -> ShowS
ListGeofenceCollectionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListGeofenceCollectionsResponse] -> ShowS
$cshowList :: [ListGeofenceCollectionsResponse] -> ShowS
show :: ListGeofenceCollectionsResponse -> String
$cshow :: ListGeofenceCollectionsResponse -> String
showsPrec :: Int -> ListGeofenceCollectionsResponse -> ShowS
$cshowsPrec :: Int -> ListGeofenceCollectionsResponse -> ShowS
Prelude.Show, forall x.
Rep ListGeofenceCollectionsResponse x
-> ListGeofenceCollectionsResponse
forall x.
ListGeofenceCollectionsResponse
-> Rep ListGeofenceCollectionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListGeofenceCollectionsResponse x
-> ListGeofenceCollectionsResponse
$cfrom :: forall x.
ListGeofenceCollectionsResponse
-> Rep ListGeofenceCollectionsResponse x
Prelude.Generic)
newListGeofenceCollectionsResponse ::
Prelude.Int ->
ListGeofenceCollectionsResponse
newListGeofenceCollectionsResponse :: Int -> ListGeofenceCollectionsResponse
newListGeofenceCollectionsResponse Int
pHttpStatus_ =
ListGeofenceCollectionsResponse'
{ $sel:nextToken:ListGeofenceCollectionsResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListGeofenceCollectionsResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:entries:ListGeofenceCollectionsResponse' :: [ListGeofenceCollectionsResponseEntry]
entries = forall a. Monoid a => a
Prelude.mempty
}
listGeofenceCollectionsResponse_nextToken :: Lens.Lens' ListGeofenceCollectionsResponse (Prelude.Maybe Prelude.Text)
listGeofenceCollectionsResponse_nextToken :: Lens' ListGeofenceCollectionsResponse (Maybe Text)
listGeofenceCollectionsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGeofenceCollectionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListGeofenceCollectionsResponse' :: ListGeofenceCollectionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListGeofenceCollectionsResponse
s@ListGeofenceCollectionsResponse' {} Maybe Text
a -> ListGeofenceCollectionsResponse
s {$sel:nextToken:ListGeofenceCollectionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListGeofenceCollectionsResponse)
listGeofenceCollectionsResponse_httpStatus :: Lens.Lens' ListGeofenceCollectionsResponse Prelude.Int
listGeofenceCollectionsResponse_httpStatus :: Lens' ListGeofenceCollectionsResponse Int
listGeofenceCollectionsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGeofenceCollectionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListGeofenceCollectionsResponse' :: ListGeofenceCollectionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListGeofenceCollectionsResponse
s@ListGeofenceCollectionsResponse' {} Int
a -> ListGeofenceCollectionsResponse
s {$sel:httpStatus:ListGeofenceCollectionsResponse' :: Int
httpStatus = Int
a} :: ListGeofenceCollectionsResponse)
listGeofenceCollectionsResponse_entries :: Lens.Lens' ListGeofenceCollectionsResponse [ListGeofenceCollectionsResponseEntry]
listGeofenceCollectionsResponse_entries :: Lens'
ListGeofenceCollectionsResponse
[ListGeofenceCollectionsResponseEntry]
listGeofenceCollectionsResponse_entries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGeofenceCollectionsResponse' {[ListGeofenceCollectionsResponseEntry]
entries :: [ListGeofenceCollectionsResponseEntry]
$sel:entries:ListGeofenceCollectionsResponse' :: ListGeofenceCollectionsResponse
-> [ListGeofenceCollectionsResponseEntry]
entries} -> [ListGeofenceCollectionsResponseEntry]
entries) (\s :: ListGeofenceCollectionsResponse
s@ListGeofenceCollectionsResponse' {} [ListGeofenceCollectionsResponseEntry]
a -> ListGeofenceCollectionsResponse
s {$sel:entries:ListGeofenceCollectionsResponse' :: [ListGeofenceCollectionsResponseEntry]
entries = [ListGeofenceCollectionsResponseEntry]
a} :: ListGeofenceCollectionsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance
Prelude.NFData
ListGeofenceCollectionsResponse
where
rnf :: ListGeofenceCollectionsResponse -> ()
rnf ListGeofenceCollectionsResponse' {Int
[ListGeofenceCollectionsResponseEntry]
Maybe Text
entries :: [ListGeofenceCollectionsResponseEntry]
httpStatus :: Int
nextToken :: Maybe Text
$sel:entries:ListGeofenceCollectionsResponse' :: ListGeofenceCollectionsResponse
-> [ListGeofenceCollectionsResponseEntry]
$sel:httpStatus:ListGeofenceCollectionsResponse' :: ListGeofenceCollectionsResponse -> Int
$sel:nextToken:ListGeofenceCollectionsResponse' :: ListGeofenceCollectionsResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [ListGeofenceCollectionsResponseEntry]
entries