{-# 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.Omics.ListReferenceStores
(
ListReferenceStores (..),
newListReferenceStores,
listReferenceStores_filter,
listReferenceStores_maxResults,
listReferenceStores_nextToken,
ListReferenceStoresResponse (..),
newListReferenceStoresResponse,
listReferenceStoresResponse_nextToken,
listReferenceStoresResponse_httpStatus,
listReferenceStoresResponse_referenceStores,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Omics.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListReferenceStores = ListReferenceStores'
{
ListReferenceStores -> Maybe ReferenceStoreFilter
filter' :: Prelude.Maybe ReferenceStoreFilter,
ListReferenceStores -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListReferenceStores -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListReferenceStores -> ListReferenceStores -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListReferenceStores -> ListReferenceStores -> Bool
$c/= :: ListReferenceStores -> ListReferenceStores -> Bool
== :: ListReferenceStores -> ListReferenceStores -> Bool
$c== :: ListReferenceStores -> ListReferenceStores -> Bool
Prelude.Eq, ReadPrec [ListReferenceStores]
ReadPrec ListReferenceStores
Int -> ReadS ListReferenceStores
ReadS [ListReferenceStores]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListReferenceStores]
$creadListPrec :: ReadPrec [ListReferenceStores]
readPrec :: ReadPrec ListReferenceStores
$creadPrec :: ReadPrec ListReferenceStores
readList :: ReadS [ListReferenceStores]
$creadList :: ReadS [ListReferenceStores]
readsPrec :: Int -> ReadS ListReferenceStores
$creadsPrec :: Int -> ReadS ListReferenceStores
Prelude.Read, Int -> ListReferenceStores -> ShowS
[ListReferenceStores] -> ShowS
ListReferenceStores -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListReferenceStores] -> ShowS
$cshowList :: [ListReferenceStores] -> ShowS
show :: ListReferenceStores -> String
$cshow :: ListReferenceStores -> String
showsPrec :: Int -> ListReferenceStores -> ShowS
$cshowsPrec :: Int -> ListReferenceStores -> ShowS
Prelude.Show, forall x. Rep ListReferenceStores x -> ListReferenceStores
forall x. ListReferenceStores -> Rep ListReferenceStores x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListReferenceStores x -> ListReferenceStores
$cfrom :: forall x. ListReferenceStores -> Rep ListReferenceStores x
Prelude.Generic)
newListReferenceStores ::
ListReferenceStores
newListReferenceStores :: ListReferenceStores
newListReferenceStores =
ListReferenceStores'
{ $sel:filter':ListReferenceStores' :: Maybe ReferenceStoreFilter
filter' = forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListReferenceStores' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListReferenceStores' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listReferenceStores_filter :: Lens.Lens' ListReferenceStores (Prelude.Maybe ReferenceStoreFilter)
listReferenceStores_filter :: Lens' ListReferenceStores (Maybe ReferenceStoreFilter)
listReferenceStores_filter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReferenceStores' {Maybe ReferenceStoreFilter
filter' :: Maybe ReferenceStoreFilter
$sel:filter':ListReferenceStores' :: ListReferenceStores -> Maybe ReferenceStoreFilter
filter'} -> Maybe ReferenceStoreFilter
filter') (\s :: ListReferenceStores
s@ListReferenceStores' {} Maybe ReferenceStoreFilter
a -> ListReferenceStores
s {$sel:filter':ListReferenceStores' :: Maybe ReferenceStoreFilter
filter' = Maybe ReferenceStoreFilter
a} :: ListReferenceStores)
listReferenceStores_maxResults :: Lens.Lens' ListReferenceStores (Prelude.Maybe Prelude.Natural)
listReferenceStores_maxResults :: Lens' ListReferenceStores (Maybe Natural)
listReferenceStores_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReferenceStores' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListReferenceStores' :: ListReferenceStores -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListReferenceStores
s@ListReferenceStores' {} Maybe Natural
a -> ListReferenceStores
s {$sel:maxResults:ListReferenceStores' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListReferenceStores)
listReferenceStores_nextToken :: Lens.Lens' ListReferenceStores (Prelude.Maybe Prelude.Text)
listReferenceStores_nextToken :: Lens' ListReferenceStores (Maybe Text)
listReferenceStores_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReferenceStores' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListReferenceStores' :: ListReferenceStores -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListReferenceStores
s@ListReferenceStores' {} Maybe Text
a -> ListReferenceStores
s {$sel:nextToken:ListReferenceStores' :: Maybe Text
nextToken = Maybe Text
a} :: ListReferenceStores)
instance Core.AWSPager ListReferenceStores where
page :: ListReferenceStores
-> AWSResponse ListReferenceStores -> Maybe ListReferenceStores
page ListReferenceStores
rq AWSResponse ListReferenceStores
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListReferenceStores
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListReferenceStoresResponse (Maybe Text)
listReferenceStoresResponse_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 ListReferenceStores
rs
forall s a. s -> Getting a s a -> a
Lens.^. Lens' ListReferenceStoresResponse [ReferenceStoreDetail]
listReferenceStoresResponse_referenceStores
) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListReferenceStores
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListReferenceStores (Maybe Text)
listReferenceStores_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListReferenceStores
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListReferenceStoresResponse (Maybe Text)
listReferenceStoresResponse_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 ListReferenceStores where
type
AWSResponse ListReferenceStores =
ListReferenceStoresResponse
request :: (Service -> Service)
-> ListReferenceStores -> Request ListReferenceStores
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 ListReferenceStores
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListReferenceStores)))
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 -> [ReferenceStoreDetail] -> ListReferenceStoresResponse
ListReferenceStoresResponse'
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
"referenceStores"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable ListReferenceStores where
hashWithSalt :: Int -> ListReferenceStores -> Int
hashWithSalt Int
_salt ListReferenceStores' {Maybe Natural
Maybe Text
Maybe ReferenceStoreFilter
nextToken :: Maybe Text
maxResults :: Maybe Natural
filter' :: Maybe ReferenceStoreFilter
$sel:nextToken:ListReferenceStores' :: ListReferenceStores -> Maybe Text
$sel:maxResults:ListReferenceStores' :: ListReferenceStores -> Maybe Natural
$sel:filter':ListReferenceStores' :: ListReferenceStores -> Maybe ReferenceStoreFilter
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ReferenceStoreFilter
filter'
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 ListReferenceStores where
rnf :: ListReferenceStores -> ()
rnf ListReferenceStores' {Maybe Natural
Maybe Text
Maybe ReferenceStoreFilter
nextToken :: Maybe Text
maxResults :: Maybe Natural
filter' :: Maybe ReferenceStoreFilter
$sel:nextToken:ListReferenceStores' :: ListReferenceStores -> Maybe Text
$sel:maxResults:ListReferenceStores' :: ListReferenceStores -> Maybe Natural
$sel:filter':ListReferenceStores' :: ListReferenceStores -> Maybe ReferenceStoreFilter
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ReferenceStoreFilter
filter'
seq :: forall a b. a -> b -> b
`Prelude.seq` 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 ListReferenceStores where
toHeaders :: ListReferenceStores -> 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 ListReferenceStores where
toJSON :: ListReferenceStores -> Value
toJSON ListReferenceStores' {Maybe Natural
Maybe Text
Maybe ReferenceStoreFilter
nextToken :: Maybe Text
maxResults :: Maybe Natural
filter' :: Maybe ReferenceStoreFilter
$sel:nextToken:ListReferenceStores' :: ListReferenceStores -> Maybe Text
$sel:maxResults:ListReferenceStores' :: ListReferenceStores -> Maybe Natural
$sel:filter':ListReferenceStores' :: ListReferenceStores -> Maybe ReferenceStoreFilter
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Key
"filter" 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 ReferenceStoreFilter
filter']
)
instance Data.ToPath ListReferenceStores where
toPath :: ListReferenceStores -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/referencestores"
instance Data.ToQuery ListReferenceStores where
toQuery :: ListReferenceStores -> QueryString
toQuery ListReferenceStores' {Maybe Natural
Maybe Text
Maybe ReferenceStoreFilter
nextToken :: Maybe Text
maxResults :: Maybe Natural
filter' :: Maybe ReferenceStoreFilter
$sel:nextToken:ListReferenceStores' :: ListReferenceStores -> Maybe Text
$sel:maxResults:ListReferenceStores' :: ListReferenceStores -> Maybe Natural
$sel:filter':ListReferenceStores' :: ListReferenceStores -> Maybe ReferenceStoreFilter
..} =
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
]
data ListReferenceStoresResponse = ListReferenceStoresResponse'
{
ListReferenceStoresResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListReferenceStoresResponse -> Int
httpStatus :: Prelude.Int,
ListReferenceStoresResponse -> [ReferenceStoreDetail]
referenceStores :: [ReferenceStoreDetail]
}
deriving (ListReferenceStoresResponse -> ListReferenceStoresResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListReferenceStoresResponse -> ListReferenceStoresResponse -> Bool
$c/= :: ListReferenceStoresResponse -> ListReferenceStoresResponse -> Bool
== :: ListReferenceStoresResponse -> ListReferenceStoresResponse -> Bool
$c== :: ListReferenceStoresResponse -> ListReferenceStoresResponse -> Bool
Prelude.Eq, ReadPrec [ListReferenceStoresResponse]
ReadPrec ListReferenceStoresResponse
Int -> ReadS ListReferenceStoresResponse
ReadS [ListReferenceStoresResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListReferenceStoresResponse]
$creadListPrec :: ReadPrec [ListReferenceStoresResponse]
readPrec :: ReadPrec ListReferenceStoresResponse
$creadPrec :: ReadPrec ListReferenceStoresResponse
readList :: ReadS [ListReferenceStoresResponse]
$creadList :: ReadS [ListReferenceStoresResponse]
readsPrec :: Int -> ReadS ListReferenceStoresResponse
$creadsPrec :: Int -> ReadS ListReferenceStoresResponse
Prelude.Read, Int -> ListReferenceStoresResponse -> ShowS
[ListReferenceStoresResponse] -> ShowS
ListReferenceStoresResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListReferenceStoresResponse] -> ShowS
$cshowList :: [ListReferenceStoresResponse] -> ShowS
show :: ListReferenceStoresResponse -> String
$cshow :: ListReferenceStoresResponse -> String
showsPrec :: Int -> ListReferenceStoresResponse -> ShowS
$cshowsPrec :: Int -> ListReferenceStoresResponse -> ShowS
Prelude.Show, forall x.
Rep ListReferenceStoresResponse x -> ListReferenceStoresResponse
forall x.
ListReferenceStoresResponse -> Rep ListReferenceStoresResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListReferenceStoresResponse x -> ListReferenceStoresResponse
$cfrom :: forall x.
ListReferenceStoresResponse -> Rep ListReferenceStoresResponse x
Prelude.Generic)
newListReferenceStoresResponse ::
Prelude.Int ->
ListReferenceStoresResponse
newListReferenceStoresResponse :: Int -> ListReferenceStoresResponse
newListReferenceStoresResponse Int
pHttpStatus_ =
ListReferenceStoresResponse'
{ $sel:nextToken:ListReferenceStoresResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListReferenceStoresResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:referenceStores:ListReferenceStoresResponse' :: [ReferenceStoreDetail]
referenceStores = forall a. Monoid a => a
Prelude.mempty
}
listReferenceStoresResponse_nextToken :: Lens.Lens' ListReferenceStoresResponse (Prelude.Maybe Prelude.Text)
listReferenceStoresResponse_nextToken :: Lens' ListReferenceStoresResponse (Maybe Text)
listReferenceStoresResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReferenceStoresResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListReferenceStoresResponse' :: ListReferenceStoresResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListReferenceStoresResponse
s@ListReferenceStoresResponse' {} Maybe Text
a -> ListReferenceStoresResponse
s {$sel:nextToken:ListReferenceStoresResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListReferenceStoresResponse)
listReferenceStoresResponse_httpStatus :: Lens.Lens' ListReferenceStoresResponse Prelude.Int
listReferenceStoresResponse_httpStatus :: Lens' ListReferenceStoresResponse Int
listReferenceStoresResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReferenceStoresResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListReferenceStoresResponse' :: ListReferenceStoresResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListReferenceStoresResponse
s@ListReferenceStoresResponse' {} Int
a -> ListReferenceStoresResponse
s {$sel:httpStatus:ListReferenceStoresResponse' :: Int
httpStatus = Int
a} :: ListReferenceStoresResponse)
listReferenceStoresResponse_referenceStores :: Lens.Lens' ListReferenceStoresResponse [ReferenceStoreDetail]
listReferenceStoresResponse_referenceStores :: Lens' ListReferenceStoresResponse [ReferenceStoreDetail]
listReferenceStoresResponse_referenceStores = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListReferenceStoresResponse' {[ReferenceStoreDetail]
referenceStores :: [ReferenceStoreDetail]
$sel:referenceStores:ListReferenceStoresResponse' :: ListReferenceStoresResponse -> [ReferenceStoreDetail]
referenceStores} -> [ReferenceStoreDetail]
referenceStores) (\s :: ListReferenceStoresResponse
s@ListReferenceStoresResponse' {} [ReferenceStoreDetail]
a -> ListReferenceStoresResponse
s {$sel:referenceStores:ListReferenceStoresResponse' :: [ReferenceStoreDetail]
referenceStores = [ReferenceStoreDetail]
a} :: ListReferenceStoresResponse) 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 ListReferenceStoresResponse where
rnf :: ListReferenceStoresResponse -> ()
rnf ListReferenceStoresResponse' {Int
[ReferenceStoreDetail]
Maybe Text
referenceStores :: [ReferenceStoreDetail]
httpStatus :: Int
nextToken :: Maybe Text
$sel:referenceStores:ListReferenceStoresResponse' :: ListReferenceStoresResponse -> [ReferenceStoreDetail]
$sel:httpStatus:ListReferenceStoresResponse' :: ListReferenceStoresResponse -> Int
$sel:nextToken:ListReferenceStoresResponse' :: ListReferenceStoresResponse -> 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 [ReferenceStoreDetail]
referenceStores