{-# 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.SageMaker.ListContexts
(
ListContexts (..),
newListContexts,
listContexts_createdAfter,
listContexts_nextToken,
listContexts_sortOrder,
listContexts_contextType,
listContexts_sourceUri,
listContexts_maxResults,
listContexts_createdBefore,
listContexts_sortBy,
ListContextsResponse (..),
newListContextsResponse,
listContextsResponse_contextSummaries,
listContextsResponse_nextToken,
listContextsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SageMaker.Types
data ListContexts = ListContexts'
{
ListContexts -> Maybe POSIX
createdAfter :: Prelude.Maybe Core.POSIX,
ListContexts -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListContexts -> Maybe SortOrder
sortOrder :: Prelude.Maybe SortOrder,
ListContexts -> Maybe Text
contextType :: Prelude.Maybe Prelude.Text,
ListContexts -> Maybe Text
sourceUri :: Prelude.Maybe Prelude.Text,
ListContexts -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListContexts -> Maybe POSIX
createdBefore :: Prelude.Maybe Core.POSIX,
ListContexts -> Maybe SortContextsBy
sortBy :: Prelude.Maybe SortContextsBy
}
deriving (ListContexts -> ListContexts -> Bool
(ListContexts -> ListContexts -> Bool)
-> (ListContexts -> ListContexts -> Bool) -> Eq ListContexts
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListContexts -> ListContexts -> Bool
$c/= :: ListContexts -> ListContexts -> Bool
== :: ListContexts -> ListContexts -> Bool
$c== :: ListContexts -> ListContexts -> Bool
Prelude.Eq, ReadPrec [ListContexts]
ReadPrec ListContexts
Int -> ReadS ListContexts
ReadS [ListContexts]
(Int -> ReadS ListContexts)
-> ReadS [ListContexts]
-> ReadPrec ListContexts
-> ReadPrec [ListContexts]
-> Read ListContexts
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListContexts]
$creadListPrec :: ReadPrec [ListContexts]
readPrec :: ReadPrec ListContexts
$creadPrec :: ReadPrec ListContexts
readList :: ReadS [ListContexts]
$creadList :: ReadS [ListContexts]
readsPrec :: Int -> ReadS ListContexts
$creadsPrec :: Int -> ReadS ListContexts
Prelude.Read, Int -> ListContexts -> ShowS
[ListContexts] -> ShowS
ListContexts -> String
(Int -> ListContexts -> ShowS)
-> (ListContexts -> String)
-> ([ListContexts] -> ShowS)
-> Show ListContexts
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListContexts] -> ShowS
$cshowList :: [ListContexts] -> ShowS
show :: ListContexts -> String
$cshow :: ListContexts -> String
showsPrec :: Int -> ListContexts -> ShowS
$cshowsPrec :: Int -> ListContexts -> ShowS
Prelude.Show, (forall x. ListContexts -> Rep ListContexts x)
-> (forall x. Rep ListContexts x -> ListContexts)
-> Generic ListContexts
forall x. Rep ListContexts x -> ListContexts
forall x. ListContexts -> Rep ListContexts x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListContexts x -> ListContexts
$cfrom :: forall x. ListContexts -> Rep ListContexts x
Prelude.Generic)
newListContexts ::
ListContexts
newListContexts :: ListContexts
newListContexts =
ListContexts' :: Maybe POSIX
-> Maybe Text
-> Maybe SortOrder
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe POSIX
-> Maybe SortContextsBy
-> ListContexts
ListContexts'
{ $sel:createdAfter:ListContexts' :: Maybe POSIX
createdAfter = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListContexts' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sortOrder:ListContexts' :: Maybe SortOrder
sortOrder = Maybe SortOrder
forall a. Maybe a
Prelude.Nothing,
$sel:contextType:ListContexts' :: Maybe Text
contextType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sourceUri:ListContexts' :: Maybe Text
sourceUri = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListContexts' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:createdBefore:ListContexts' :: Maybe POSIX
createdBefore = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:sortBy:ListContexts' :: Maybe SortContextsBy
sortBy = Maybe SortContextsBy
forall a. Maybe a
Prelude.Nothing
}
listContexts_createdAfter :: Lens.Lens' ListContexts (Prelude.Maybe Prelude.UTCTime)
listContexts_createdAfter :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListContexts -> f ListContexts
listContexts_createdAfter = (ListContexts -> Maybe POSIX)
-> (ListContexts -> Maybe POSIX -> ListContexts)
-> Lens ListContexts ListContexts (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListContexts' {Maybe POSIX
createdAfter :: Maybe POSIX
$sel:createdAfter:ListContexts' :: ListContexts -> Maybe POSIX
createdAfter} -> Maybe POSIX
createdAfter) (\s :: ListContexts
s@ListContexts' {} Maybe POSIX
a -> ListContexts
s {$sel:createdAfter:ListContexts' :: Maybe POSIX
createdAfter = Maybe POSIX
a} :: ListContexts) ((Maybe POSIX -> f (Maybe POSIX))
-> ListContexts -> f ListContexts)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListContexts
-> f ListContexts
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
listContexts_nextToken :: Lens.Lens' ListContexts (Prelude.Maybe Prelude.Text)
listContexts_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListContexts -> f ListContexts
listContexts_nextToken = (ListContexts -> Maybe Text)
-> (ListContexts -> Maybe Text -> ListContexts)
-> Lens ListContexts ListContexts (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListContexts' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListContexts' :: ListContexts -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListContexts
s@ListContexts' {} Maybe Text
a -> ListContexts
s {$sel:nextToken:ListContexts' :: Maybe Text
nextToken = Maybe Text
a} :: ListContexts)
listContexts_sortOrder :: Lens.Lens' ListContexts (Prelude.Maybe SortOrder)
listContexts_sortOrder :: (Maybe SortOrder -> f (Maybe SortOrder))
-> ListContexts -> f ListContexts
listContexts_sortOrder = (ListContexts -> Maybe SortOrder)
-> (ListContexts -> Maybe SortOrder -> ListContexts)
-> Lens
ListContexts ListContexts (Maybe SortOrder) (Maybe SortOrder)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListContexts' {Maybe SortOrder
sortOrder :: Maybe SortOrder
$sel:sortOrder:ListContexts' :: ListContexts -> Maybe SortOrder
sortOrder} -> Maybe SortOrder
sortOrder) (\s :: ListContexts
s@ListContexts' {} Maybe SortOrder
a -> ListContexts
s {$sel:sortOrder:ListContexts' :: Maybe SortOrder
sortOrder = Maybe SortOrder
a} :: ListContexts)
listContexts_contextType :: Lens.Lens' ListContexts (Prelude.Maybe Prelude.Text)
listContexts_contextType :: (Maybe Text -> f (Maybe Text)) -> ListContexts -> f ListContexts
listContexts_contextType = (ListContexts -> Maybe Text)
-> (ListContexts -> Maybe Text -> ListContexts)
-> Lens ListContexts ListContexts (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListContexts' {Maybe Text
contextType :: Maybe Text
$sel:contextType:ListContexts' :: ListContexts -> Maybe Text
contextType} -> Maybe Text
contextType) (\s :: ListContexts
s@ListContexts' {} Maybe Text
a -> ListContexts
s {$sel:contextType:ListContexts' :: Maybe Text
contextType = Maybe Text
a} :: ListContexts)
listContexts_sourceUri :: Lens.Lens' ListContexts (Prelude.Maybe Prelude.Text)
listContexts_sourceUri :: (Maybe Text -> f (Maybe Text)) -> ListContexts -> f ListContexts
listContexts_sourceUri = (ListContexts -> Maybe Text)
-> (ListContexts -> Maybe Text -> ListContexts)
-> Lens ListContexts ListContexts (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListContexts' {Maybe Text
sourceUri :: Maybe Text
$sel:sourceUri:ListContexts' :: ListContexts -> Maybe Text
sourceUri} -> Maybe Text
sourceUri) (\s :: ListContexts
s@ListContexts' {} Maybe Text
a -> ListContexts
s {$sel:sourceUri:ListContexts' :: Maybe Text
sourceUri = Maybe Text
a} :: ListContexts)
listContexts_maxResults :: Lens.Lens' ListContexts (Prelude.Maybe Prelude.Natural)
listContexts_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListContexts -> f ListContexts
listContexts_maxResults = (ListContexts -> Maybe Natural)
-> (ListContexts -> Maybe Natural -> ListContexts)
-> Lens ListContexts ListContexts (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListContexts' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListContexts' :: ListContexts -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListContexts
s@ListContexts' {} Maybe Natural
a -> ListContexts
s {$sel:maxResults:ListContexts' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListContexts)
listContexts_createdBefore :: Lens.Lens' ListContexts (Prelude.Maybe Prelude.UTCTime)
listContexts_createdBefore :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListContexts -> f ListContexts
listContexts_createdBefore = (ListContexts -> Maybe POSIX)
-> (ListContexts -> Maybe POSIX -> ListContexts)
-> Lens ListContexts ListContexts (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListContexts' {Maybe POSIX
createdBefore :: Maybe POSIX
$sel:createdBefore:ListContexts' :: ListContexts -> Maybe POSIX
createdBefore} -> Maybe POSIX
createdBefore) (\s :: ListContexts
s@ListContexts' {} Maybe POSIX
a -> ListContexts
s {$sel:createdBefore:ListContexts' :: Maybe POSIX
createdBefore = Maybe POSIX
a} :: ListContexts) ((Maybe POSIX -> f (Maybe POSIX))
-> ListContexts -> f ListContexts)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListContexts
-> f ListContexts
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
listContexts_sortBy :: Lens.Lens' ListContexts (Prelude.Maybe SortContextsBy)
listContexts_sortBy :: (Maybe SortContextsBy -> f (Maybe SortContextsBy))
-> ListContexts -> f ListContexts
listContexts_sortBy = (ListContexts -> Maybe SortContextsBy)
-> (ListContexts -> Maybe SortContextsBy -> ListContexts)
-> Lens
ListContexts
ListContexts
(Maybe SortContextsBy)
(Maybe SortContextsBy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListContexts' {Maybe SortContextsBy
sortBy :: Maybe SortContextsBy
$sel:sortBy:ListContexts' :: ListContexts -> Maybe SortContextsBy
sortBy} -> Maybe SortContextsBy
sortBy) (\s :: ListContexts
s@ListContexts' {} Maybe SortContextsBy
a -> ListContexts
s {$sel:sortBy:ListContexts' :: Maybe SortContextsBy
sortBy = Maybe SortContextsBy
a} :: ListContexts)
instance Core.AWSPager ListContexts where
page :: ListContexts -> AWSResponse ListContexts -> Maybe ListContexts
page ListContexts
rq AWSResponse ListContexts
rs
| Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListContexts
ListContextsResponse
rs
ListContextsResponse
-> Getting (First Text) ListContextsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListContextsResponse -> Const (First Text) ListContextsResponse
Lens' ListContextsResponse (Maybe Text)
listContextsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
-> ListContextsResponse -> Const (First Text) ListContextsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListContextsResponse 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 ListContexts
forall a. Maybe a
Prelude.Nothing
| Maybe [ContextSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListContexts
ListContextsResponse
rs
ListContextsResponse
-> Getting
(First [ContextSummary]) ListContextsResponse [ContextSummary]
-> Maybe [ContextSummary]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ContextSummary]
-> Const (First [ContextSummary]) (Maybe [ContextSummary]))
-> ListContextsResponse
-> Const (First [ContextSummary]) ListContextsResponse
Lens' ListContextsResponse (Maybe [ContextSummary])
listContextsResponse_contextSummaries
((Maybe [ContextSummary]
-> Const (First [ContextSummary]) (Maybe [ContextSummary]))
-> ListContextsResponse
-> Const (First [ContextSummary]) ListContextsResponse)
-> (([ContextSummary]
-> Const (First [ContextSummary]) [ContextSummary])
-> Maybe [ContextSummary]
-> Const (First [ContextSummary]) (Maybe [ContextSummary]))
-> Getting
(First [ContextSummary]) ListContextsResponse [ContextSummary]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ContextSummary]
-> Const (First [ContextSummary]) [ContextSummary])
-> Maybe [ContextSummary]
-> Const (First [ContextSummary]) (Maybe [ContextSummary])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe ListContexts
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
ListContexts -> Maybe ListContexts
forall a. a -> Maybe a
Prelude.Just (ListContexts -> Maybe ListContexts)
-> ListContexts -> Maybe ListContexts
forall a b. (a -> b) -> a -> b
Prelude.$
ListContexts
rq
ListContexts -> (ListContexts -> ListContexts) -> ListContexts
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListContexts -> Identity ListContexts
Lens ListContexts ListContexts (Maybe Text) (Maybe Text)
listContexts_nextToken
((Maybe Text -> Identity (Maybe Text))
-> ListContexts -> Identity ListContexts)
-> Maybe Text -> ListContexts -> ListContexts
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListContexts
ListContextsResponse
rs
ListContextsResponse
-> Getting (First Text) ListContextsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListContextsResponse -> Const (First Text) ListContextsResponse
Lens' ListContextsResponse (Maybe Text)
listContextsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
-> ListContextsResponse -> Const (First Text) ListContextsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListContextsResponse 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 ListContexts where
type AWSResponse ListContexts = ListContextsResponse
request :: ListContexts -> Request ListContexts
request = Service -> ListContexts -> Request ListContexts
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy ListContexts
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListContexts)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListContexts))
-> Logger
-> Service
-> Proxy ListContexts
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListContexts)))
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 [ContextSummary] -> Maybe Text -> Int -> ListContextsResponse
ListContextsResponse'
(Maybe [ContextSummary]
-> Maybe Text -> Int -> ListContextsResponse)
-> Either String (Maybe [ContextSummary])
-> Either String (Maybe Text -> Int -> ListContextsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Either String (Maybe (Maybe [ContextSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ContextSummaries"
Either String (Maybe (Maybe [ContextSummary]))
-> Maybe [ContextSummary] -> Either String (Maybe [ContextSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ContextSummary]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Maybe Text -> Int -> ListContextsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListContextsResponse)
forall (f :: * -> *) a b. Applicative f => 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 -> ListContextsResponse)
-> Either String Int -> Either String ListContextsResponse
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))
)
instance Prelude.Hashable ListContexts
instance Prelude.NFData ListContexts
instance Core.ToHeaders ListContexts where
toHeaders :: ListContexts -> ResponseHeaders
toHeaders =
ResponseHeaders -> ListContexts -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"SageMaker.ListContexts" :: Prelude.ByteString),
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 ListContexts where
toJSON :: ListContexts -> Value
toJSON ListContexts' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe SortContextsBy
Maybe SortOrder
sortBy :: Maybe SortContextsBy
createdBefore :: Maybe POSIX
maxResults :: Maybe Natural
sourceUri :: Maybe Text
contextType :: Maybe Text
sortOrder :: Maybe SortOrder
nextToken :: Maybe Text
createdAfter :: Maybe POSIX
$sel:sortBy:ListContexts' :: ListContexts -> Maybe SortContextsBy
$sel:createdBefore:ListContexts' :: ListContexts -> Maybe POSIX
$sel:maxResults:ListContexts' :: ListContexts -> Maybe Natural
$sel:sourceUri:ListContexts' :: ListContexts -> Maybe Text
$sel:contextType:ListContexts' :: ListContexts -> Maybe Text
$sel:sortOrder:ListContexts' :: ListContexts -> Maybe SortOrder
$sel:nextToken:ListContexts' :: ListContexts -> Maybe Text
$sel:createdAfter:ListContexts' :: ListContexts -> Maybe POSIX
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"CreatedAfter" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
createdAfter,
(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
"SortOrder" Text -> SortOrder -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SortOrder -> Pair) -> Maybe SortOrder -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SortOrder
sortOrder,
(Text
"ContextType" 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
contextType,
(Text
"SourceUri" 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
sourceUri,
(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,
(Text
"CreatedBefore" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
createdBefore,
(Text
"SortBy" Text -> SortContextsBy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SortContextsBy -> Pair) -> Maybe SortContextsBy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SortContextsBy
sortBy
]
)
instance Core.ToPath ListContexts where
toPath :: ListContexts -> ByteString
toPath = ByteString -> ListContexts -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ListContexts where
toQuery :: ListContexts -> QueryString
toQuery = QueryString -> ListContexts -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data ListContextsResponse = ListContextsResponse'
{
ListContextsResponse -> Maybe [ContextSummary]
contextSummaries :: Prelude.Maybe [ContextSummary],
ListContextsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListContextsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListContextsResponse -> ListContextsResponse -> Bool
(ListContextsResponse -> ListContextsResponse -> Bool)
-> (ListContextsResponse -> ListContextsResponse -> Bool)
-> Eq ListContextsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListContextsResponse -> ListContextsResponse -> Bool
$c/= :: ListContextsResponse -> ListContextsResponse -> Bool
== :: ListContextsResponse -> ListContextsResponse -> Bool
$c== :: ListContextsResponse -> ListContextsResponse -> Bool
Prelude.Eq, ReadPrec [ListContextsResponse]
ReadPrec ListContextsResponse
Int -> ReadS ListContextsResponse
ReadS [ListContextsResponse]
(Int -> ReadS ListContextsResponse)
-> ReadS [ListContextsResponse]
-> ReadPrec ListContextsResponse
-> ReadPrec [ListContextsResponse]
-> Read ListContextsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListContextsResponse]
$creadListPrec :: ReadPrec [ListContextsResponse]
readPrec :: ReadPrec ListContextsResponse
$creadPrec :: ReadPrec ListContextsResponse
readList :: ReadS [ListContextsResponse]
$creadList :: ReadS [ListContextsResponse]
readsPrec :: Int -> ReadS ListContextsResponse
$creadsPrec :: Int -> ReadS ListContextsResponse
Prelude.Read, Int -> ListContextsResponse -> ShowS
[ListContextsResponse] -> ShowS
ListContextsResponse -> String
(Int -> ListContextsResponse -> ShowS)
-> (ListContextsResponse -> String)
-> ([ListContextsResponse] -> ShowS)
-> Show ListContextsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListContextsResponse] -> ShowS
$cshowList :: [ListContextsResponse] -> ShowS
show :: ListContextsResponse -> String
$cshow :: ListContextsResponse -> String
showsPrec :: Int -> ListContextsResponse -> ShowS
$cshowsPrec :: Int -> ListContextsResponse -> ShowS
Prelude.Show, (forall x. ListContextsResponse -> Rep ListContextsResponse x)
-> (forall x. Rep ListContextsResponse x -> ListContextsResponse)
-> Generic ListContextsResponse
forall x. Rep ListContextsResponse x -> ListContextsResponse
forall x. ListContextsResponse -> Rep ListContextsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListContextsResponse x -> ListContextsResponse
$cfrom :: forall x. ListContextsResponse -> Rep ListContextsResponse x
Prelude.Generic)
newListContextsResponse ::
Prelude.Int ->
ListContextsResponse
newListContextsResponse :: Int -> ListContextsResponse
newListContextsResponse Int
pHttpStatus_ =
ListContextsResponse' :: Maybe [ContextSummary] -> Maybe Text -> Int -> ListContextsResponse
ListContextsResponse'
{ $sel:contextSummaries:ListContextsResponse' :: Maybe [ContextSummary]
contextSummaries =
Maybe [ContextSummary]
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListContextsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListContextsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listContextsResponse_contextSummaries :: Lens.Lens' ListContextsResponse (Prelude.Maybe [ContextSummary])
listContextsResponse_contextSummaries :: (Maybe [ContextSummary] -> f (Maybe [ContextSummary]))
-> ListContextsResponse -> f ListContextsResponse
listContextsResponse_contextSummaries = (ListContextsResponse -> Maybe [ContextSummary])
-> (ListContextsResponse
-> Maybe [ContextSummary] -> ListContextsResponse)
-> Lens' ListContextsResponse (Maybe [ContextSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListContextsResponse' {Maybe [ContextSummary]
contextSummaries :: Maybe [ContextSummary]
$sel:contextSummaries:ListContextsResponse' :: ListContextsResponse -> Maybe [ContextSummary]
contextSummaries} -> Maybe [ContextSummary]
contextSummaries) (\s :: ListContextsResponse
s@ListContextsResponse' {} Maybe [ContextSummary]
a -> ListContextsResponse
s {$sel:contextSummaries:ListContextsResponse' :: Maybe [ContextSummary]
contextSummaries = Maybe [ContextSummary]
a} :: ListContextsResponse) ((Maybe [ContextSummary] -> f (Maybe [ContextSummary]))
-> ListContextsResponse -> f ListContextsResponse)
-> ((Maybe [ContextSummary] -> f (Maybe [ContextSummary]))
-> Maybe [ContextSummary] -> f (Maybe [ContextSummary]))
-> (Maybe [ContextSummary] -> f (Maybe [ContextSummary]))
-> ListContextsResponse
-> f ListContextsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ContextSummary] [ContextSummary] [ContextSummary] [ContextSummary]
-> Iso
(Maybe [ContextSummary])
(Maybe [ContextSummary])
(Maybe [ContextSummary])
(Maybe [ContextSummary])
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 AnIso
[ContextSummary] [ContextSummary] [ContextSummary] [ContextSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listContextsResponse_nextToken :: Lens.Lens' ListContextsResponse (Prelude.Maybe Prelude.Text)
listContextsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListContextsResponse -> f ListContextsResponse
listContextsResponse_nextToken = (ListContextsResponse -> Maybe Text)
-> (ListContextsResponse -> Maybe Text -> ListContextsResponse)
-> Lens' ListContextsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListContextsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListContextsResponse' :: ListContextsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListContextsResponse
s@ListContextsResponse' {} Maybe Text
a -> ListContextsResponse
s {$sel:nextToken:ListContextsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListContextsResponse)
listContextsResponse_httpStatus :: Lens.Lens' ListContextsResponse Prelude.Int
listContextsResponse_httpStatus :: (Int -> f Int) -> ListContextsResponse -> f ListContextsResponse
listContextsResponse_httpStatus = (ListContextsResponse -> Int)
-> (ListContextsResponse -> Int -> ListContextsResponse)
-> Lens ListContextsResponse ListContextsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListContextsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListContextsResponse' :: ListContextsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListContextsResponse
s@ListContextsResponse' {} Int
a -> ListContextsResponse
s {$sel:httpStatus:ListContextsResponse' :: Int
httpStatus = Int
a} :: ListContextsResponse)
instance Prelude.NFData ListContextsResponse