{-# 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.GroundStation.ListGroundStations
(
ListGroundStations (..),
newListGroundStations,
listGroundStations_maxResults,
listGroundStations_nextToken,
listGroundStations_satelliteId,
ListGroundStationsResponse (..),
newListGroundStationsResponse,
listGroundStationsResponse_groundStationList,
listGroundStationsResponse_nextToken,
listGroundStationsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GroundStation.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListGroundStations = ListGroundStations'
{
ListGroundStations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListGroundStations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListGroundStations -> Maybe Text
satelliteId :: Prelude.Maybe Prelude.Text
}
deriving (ListGroundStations -> ListGroundStations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListGroundStations -> ListGroundStations -> Bool
$c/= :: ListGroundStations -> ListGroundStations -> Bool
== :: ListGroundStations -> ListGroundStations -> Bool
$c== :: ListGroundStations -> ListGroundStations -> Bool
Prelude.Eq, ReadPrec [ListGroundStations]
ReadPrec ListGroundStations
Int -> ReadS ListGroundStations
ReadS [ListGroundStations]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListGroundStations]
$creadListPrec :: ReadPrec [ListGroundStations]
readPrec :: ReadPrec ListGroundStations
$creadPrec :: ReadPrec ListGroundStations
readList :: ReadS [ListGroundStations]
$creadList :: ReadS [ListGroundStations]
readsPrec :: Int -> ReadS ListGroundStations
$creadsPrec :: Int -> ReadS ListGroundStations
Prelude.Read, Int -> ListGroundStations -> ShowS
[ListGroundStations] -> ShowS
ListGroundStations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListGroundStations] -> ShowS
$cshowList :: [ListGroundStations] -> ShowS
show :: ListGroundStations -> String
$cshow :: ListGroundStations -> String
showsPrec :: Int -> ListGroundStations -> ShowS
$cshowsPrec :: Int -> ListGroundStations -> ShowS
Prelude.Show, forall x. Rep ListGroundStations x -> ListGroundStations
forall x. ListGroundStations -> Rep ListGroundStations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListGroundStations x -> ListGroundStations
$cfrom :: forall x. ListGroundStations -> Rep ListGroundStations x
Prelude.Generic)
newListGroundStations ::
ListGroundStations
newListGroundStations :: ListGroundStations
newListGroundStations =
ListGroundStations'
{ $sel:maxResults:ListGroundStations' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListGroundStations' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:satelliteId:ListGroundStations' :: Maybe Text
satelliteId = forall a. Maybe a
Prelude.Nothing
}
listGroundStations_maxResults :: Lens.Lens' ListGroundStations (Prelude.Maybe Prelude.Natural)
listGroundStations_maxResults :: Lens' ListGroundStations (Maybe Natural)
listGroundStations_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroundStations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListGroundStations' :: ListGroundStations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListGroundStations
s@ListGroundStations' {} Maybe Natural
a -> ListGroundStations
s {$sel:maxResults:ListGroundStations' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListGroundStations)
listGroundStations_nextToken :: Lens.Lens' ListGroundStations (Prelude.Maybe Prelude.Text)
listGroundStations_nextToken :: Lens' ListGroundStations (Maybe Text)
listGroundStations_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroundStations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListGroundStations' :: ListGroundStations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListGroundStations
s@ListGroundStations' {} Maybe Text
a -> ListGroundStations
s {$sel:nextToken:ListGroundStations' :: Maybe Text
nextToken = Maybe Text
a} :: ListGroundStations)
listGroundStations_satelliteId :: Lens.Lens' ListGroundStations (Prelude.Maybe Prelude.Text)
listGroundStations_satelliteId :: Lens' ListGroundStations (Maybe Text)
listGroundStations_satelliteId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroundStations' {Maybe Text
satelliteId :: Maybe Text
$sel:satelliteId:ListGroundStations' :: ListGroundStations -> Maybe Text
satelliteId} -> Maybe Text
satelliteId) (\s :: ListGroundStations
s@ListGroundStations' {} Maybe Text
a -> ListGroundStations
s {$sel:satelliteId:ListGroundStations' :: Maybe Text
satelliteId = Maybe Text
a} :: ListGroundStations)
instance Core.AWSPager ListGroundStations where
page :: ListGroundStations
-> AWSResponse ListGroundStations -> Maybe ListGroundStations
page ListGroundStations
rq AWSResponse ListGroundStations
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListGroundStations
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListGroundStationsResponse (Maybe Text)
listGroundStationsResponse_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 ListGroundStations
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListGroundStationsResponse (Maybe [GroundStationData])
listGroundStationsResponse_groundStationList
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
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListGroundStations
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListGroundStations (Maybe Text)
listGroundStations_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListGroundStations
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListGroundStationsResponse (Maybe Text)
listGroundStationsResponse_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 ListGroundStations where
type
AWSResponse ListGroundStations =
ListGroundStationsResponse
request :: (Service -> Service)
-> ListGroundStations -> Request ListGroundStations
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListGroundStations
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListGroundStations)))
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 [GroundStationData]
-> Maybe Text -> Int -> ListGroundStationsResponse
ListGroundStationsResponse'
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
"groundStationList"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
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
"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))
)
instance Prelude.Hashable ListGroundStations where
hashWithSalt :: Int -> ListGroundStations -> Int
hashWithSalt Int
_salt ListGroundStations' {Maybe Natural
Maybe Text
satelliteId :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:satelliteId:ListGroundStations' :: ListGroundStations -> Maybe Text
$sel:nextToken:ListGroundStations' :: ListGroundStations -> Maybe Text
$sel:maxResults:ListGroundStations' :: ListGroundStations -> 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
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
satelliteId
instance Prelude.NFData ListGroundStations where
rnf :: ListGroundStations -> ()
rnf ListGroundStations' {Maybe Natural
Maybe Text
satelliteId :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:satelliteId:ListGroundStations' :: ListGroundStations -> Maybe Text
$sel:nextToken:ListGroundStations' :: ListGroundStations -> Maybe Text
$sel:maxResults:ListGroundStations' :: ListGroundStations -> 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
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
satelliteId
instance Data.ToHeaders ListGroundStations where
toHeaders :: ListGroundStations -> 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.ToPath ListGroundStations where
toPath :: ListGroundStations -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/groundstation"
instance Data.ToQuery ListGroundStations where
toQuery :: ListGroundStations -> QueryString
toQuery ListGroundStations' {Maybe Natural
Maybe Text
satelliteId :: Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:satelliteId:ListGroundStations' :: ListGroundStations -> Maybe Text
$sel:nextToken:ListGroundStations' :: ListGroundStations -> Maybe Text
$sel:maxResults:ListGroundStations' :: ListGroundStations -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"maxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken,
ByteString
"satelliteId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
satelliteId
]
data ListGroundStationsResponse = ListGroundStationsResponse'
{
ListGroundStationsResponse -> Maybe [GroundStationData]
groundStationList :: Prelude.Maybe [GroundStationData],
ListGroundStationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListGroundStationsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListGroundStationsResponse -> ListGroundStationsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListGroundStationsResponse -> ListGroundStationsResponse -> Bool
$c/= :: ListGroundStationsResponse -> ListGroundStationsResponse -> Bool
== :: ListGroundStationsResponse -> ListGroundStationsResponse -> Bool
$c== :: ListGroundStationsResponse -> ListGroundStationsResponse -> Bool
Prelude.Eq, ReadPrec [ListGroundStationsResponse]
ReadPrec ListGroundStationsResponse
Int -> ReadS ListGroundStationsResponse
ReadS [ListGroundStationsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListGroundStationsResponse]
$creadListPrec :: ReadPrec [ListGroundStationsResponse]
readPrec :: ReadPrec ListGroundStationsResponse
$creadPrec :: ReadPrec ListGroundStationsResponse
readList :: ReadS [ListGroundStationsResponse]
$creadList :: ReadS [ListGroundStationsResponse]
readsPrec :: Int -> ReadS ListGroundStationsResponse
$creadsPrec :: Int -> ReadS ListGroundStationsResponse
Prelude.Read, Int -> ListGroundStationsResponse -> ShowS
[ListGroundStationsResponse] -> ShowS
ListGroundStationsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListGroundStationsResponse] -> ShowS
$cshowList :: [ListGroundStationsResponse] -> ShowS
show :: ListGroundStationsResponse -> String
$cshow :: ListGroundStationsResponse -> String
showsPrec :: Int -> ListGroundStationsResponse -> ShowS
$cshowsPrec :: Int -> ListGroundStationsResponse -> ShowS
Prelude.Show, forall x.
Rep ListGroundStationsResponse x -> ListGroundStationsResponse
forall x.
ListGroundStationsResponse -> Rep ListGroundStationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListGroundStationsResponse x -> ListGroundStationsResponse
$cfrom :: forall x.
ListGroundStationsResponse -> Rep ListGroundStationsResponse x
Prelude.Generic)
newListGroundStationsResponse ::
Prelude.Int ->
ListGroundStationsResponse
newListGroundStationsResponse :: Int -> ListGroundStationsResponse
newListGroundStationsResponse Int
pHttpStatus_ =
ListGroundStationsResponse'
{ $sel:groundStationList:ListGroundStationsResponse' :: Maybe [GroundStationData]
groundStationList =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListGroundStationsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListGroundStationsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listGroundStationsResponse_groundStationList :: Lens.Lens' ListGroundStationsResponse (Prelude.Maybe [GroundStationData])
listGroundStationsResponse_groundStationList :: Lens' ListGroundStationsResponse (Maybe [GroundStationData])
listGroundStationsResponse_groundStationList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroundStationsResponse' {Maybe [GroundStationData]
groundStationList :: Maybe [GroundStationData]
$sel:groundStationList:ListGroundStationsResponse' :: ListGroundStationsResponse -> Maybe [GroundStationData]
groundStationList} -> Maybe [GroundStationData]
groundStationList) (\s :: ListGroundStationsResponse
s@ListGroundStationsResponse' {} Maybe [GroundStationData]
a -> ListGroundStationsResponse
s {$sel:groundStationList:ListGroundStationsResponse' :: Maybe [GroundStationData]
groundStationList = Maybe [GroundStationData]
a} :: ListGroundStationsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listGroundStationsResponse_nextToken :: Lens.Lens' ListGroundStationsResponse (Prelude.Maybe Prelude.Text)
listGroundStationsResponse_nextToken :: Lens' ListGroundStationsResponse (Maybe Text)
listGroundStationsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroundStationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListGroundStationsResponse' :: ListGroundStationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListGroundStationsResponse
s@ListGroundStationsResponse' {} Maybe Text
a -> ListGroundStationsResponse
s {$sel:nextToken:ListGroundStationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListGroundStationsResponse)
listGroundStationsResponse_httpStatus :: Lens.Lens' ListGroundStationsResponse Prelude.Int
listGroundStationsResponse_httpStatus :: Lens' ListGroundStationsResponse Int
listGroundStationsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroundStationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListGroundStationsResponse' :: ListGroundStationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListGroundStationsResponse
s@ListGroundStationsResponse' {} Int
a -> ListGroundStationsResponse
s {$sel:httpStatus:ListGroundStationsResponse' :: Int
httpStatus = Int
a} :: ListGroundStationsResponse)
instance Prelude.NFData ListGroundStationsResponse where
rnf :: ListGroundStationsResponse -> ()
rnf ListGroundStationsResponse' {Int
Maybe [GroundStationData]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
groundStationList :: Maybe [GroundStationData]
$sel:httpStatus:ListGroundStationsResponse' :: ListGroundStationsResponse -> Int
$sel:nextToken:ListGroundStationsResponse' :: ListGroundStationsResponse -> Maybe Text
$sel:groundStationList:ListGroundStationsResponse' :: ListGroundStationsResponse -> Maybe [GroundStationData]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [GroundStationData]
groundStationList
seq :: forall a b. a -> b -> b
`Prelude.seq` 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