{-# 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.ListAssociations
(
ListAssociations (..),
newListAssociations,
listAssociations_createdAfter,
listAssociations_sourceType,
listAssociations_sourceArn,
listAssociations_associationType,
listAssociations_destinationArn,
listAssociations_nextToken,
listAssociations_destinationType,
listAssociations_sortOrder,
listAssociations_maxResults,
listAssociations_createdBefore,
listAssociations_sortBy,
ListAssociationsResponse (..),
newListAssociationsResponse,
listAssociationsResponse_nextToken,
listAssociationsResponse_associationSummaries,
listAssociationsResponse_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 ListAssociations = ListAssociations'
{
ListAssociations -> Maybe POSIX
createdAfter :: Prelude.Maybe Core.POSIX,
ListAssociations -> Maybe Text
sourceType :: Prelude.Maybe Prelude.Text,
ListAssociations -> Maybe Text
sourceArn :: Prelude.Maybe Prelude.Text,
ListAssociations -> Maybe AssociationEdgeType
associationType :: Prelude.Maybe AssociationEdgeType,
ListAssociations -> Maybe Text
destinationArn :: Prelude.Maybe Prelude.Text,
ListAssociations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListAssociations -> Maybe Text
destinationType :: Prelude.Maybe Prelude.Text,
ListAssociations -> Maybe SortOrder
sortOrder :: Prelude.Maybe SortOrder,
ListAssociations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListAssociations -> Maybe POSIX
createdBefore :: Prelude.Maybe Core.POSIX,
ListAssociations -> Maybe SortAssociationsBy
sortBy :: Prelude.Maybe SortAssociationsBy
}
deriving (ListAssociations -> ListAssociations -> Bool
(ListAssociations -> ListAssociations -> Bool)
-> (ListAssociations -> ListAssociations -> Bool)
-> Eq ListAssociations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAssociations -> ListAssociations -> Bool
$c/= :: ListAssociations -> ListAssociations -> Bool
== :: ListAssociations -> ListAssociations -> Bool
$c== :: ListAssociations -> ListAssociations -> Bool
Prelude.Eq, ReadPrec [ListAssociations]
ReadPrec ListAssociations
Int -> ReadS ListAssociations
ReadS [ListAssociations]
(Int -> ReadS ListAssociations)
-> ReadS [ListAssociations]
-> ReadPrec ListAssociations
-> ReadPrec [ListAssociations]
-> Read ListAssociations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAssociations]
$creadListPrec :: ReadPrec [ListAssociations]
readPrec :: ReadPrec ListAssociations
$creadPrec :: ReadPrec ListAssociations
readList :: ReadS [ListAssociations]
$creadList :: ReadS [ListAssociations]
readsPrec :: Int -> ReadS ListAssociations
$creadsPrec :: Int -> ReadS ListAssociations
Prelude.Read, Int -> ListAssociations -> ShowS
[ListAssociations] -> ShowS
ListAssociations -> String
(Int -> ListAssociations -> ShowS)
-> (ListAssociations -> String)
-> ([ListAssociations] -> ShowS)
-> Show ListAssociations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAssociations] -> ShowS
$cshowList :: [ListAssociations] -> ShowS
show :: ListAssociations -> String
$cshow :: ListAssociations -> String
showsPrec :: Int -> ListAssociations -> ShowS
$cshowsPrec :: Int -> ListAssociations -> ShowS
Prelude.Show, (forall x. ListAssociations -> Rep ListAssociations x)
-> (forall x. Rep ListAssociations x -> ListAssociations)
-> Generic ListAssociations
forall x. Rep ListAssociations x -> ListAssociations
forall x. ListAssociations -> Rep ListAssociations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAssociations x -> ListAssociations
$cfrom :: forall x. ListAssociations -> Rep ListAssociations x
Prelude.Generic)
newListAssociations ::
ListAssociations
newListAssociations :: ListAssociations
newListAssociations =
ListAssociations' :: Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe AssociationEdgeType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe SortOrder
-> Maybe Natural
-> Maybe POSIX
-> Maybe SortAssociationsBy
-> ListAssociations
ListAssociations'
{ $sel:createdAfter:ListAssociations' :: Maybe POSIX
createdAfter = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:sourceType:ListAssociations' :: Maybe Text
sourceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sourceArn:ListAssociations' :: Maybe Text
sourceArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:associationType:ListAssociations' :: Maybe AssociationEdgeType
associationType = Maybe AssociationEdgeType
forall a. Maybe a
Prelude.Nothing,
$sel:destinationArn:ListAssociations' :: Maybe Text
destinationArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListAssociations' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:destinationType:ListAssociations' :: Maybe Text
destinationType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sortOrder:ListAssociations' :: Maybe SortOrder
sortOrder = Maybe SortOrder
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListAssociations' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:createdBefore:ListAssociations' :: Maybe POSIX
createdBefore = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:sortBy:ListAssociations' :: Maybe SortAssociationsBy
sortBy = Maybe SortAssociationsBy
forall a. Maybe a
Prelude.Nothing
}
listAssociations_createdAfter :: Lens.Lens' ListAssociations (Prelude.Maybe Prelude.UTCTime)
listAssociations_createdAfter :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListAssociations -> f ListAssociations
listAssociations_createdAfter = (ListAssociations -> Maybe POSIX)
-> (ListAssociations -> Maybe POSIX -> ListAssociations)
-> Lens
ListAssociations ListAssociations (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociations' {Maybe POSIX
createdAfter :: Maybe POSIX
$sel:createdAfter:ListAssociations' :: ListAssociations -> Maybe POSIX
createdAfter} -> Maybe POSIX
createdAfter) (\s :: ListAssociations
s@ListAssociations' {} Maybe POSIX
a -> ListAssociations
s {$sel:createdAfter:ListAssociations' :: Maybe POSIX
createdAfter = Maybe POSIX
a} :: ListAssociations) ((Maybe POSIX -> f (Maybe POSIX))
-> ListAssociations -> f ListAssociations)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListAssociations
-> f ListAssociations
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
listAssociations_sourceType :: Lens.Lens' ListAssociations (Prelude.Maybe Prelude.Text)
listAssociations_sourceType :: (Maybe Text -> f (Maybe Text))
-> ListAssociations -> f ListAssociations
listAssociations_sourceType = (ListAssociations -> Maybe Text)
-> (ListAssociations -> Maybe Text -> ListAssociations)
-> Lens ListAssociations ListAssociations (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociations' {Maybe Text
sourceType :: Maybe Text
$sel:sourceType:ListAssociations' :: ListAssociations -> Maybe Text
sourceType} -> Maybe Text
sourceType) (\s :: ListAssociations
s@ListAssociations' {} Maybe Text
a -> ListAssociations
s {$sel:sourceType:ListAssociations' :: Maybe Text
sourceType = Maybe Text
a} :: ListAssociations)
listAssociations_sourceArn :: Lens.Lens' ListAssociations (Prelude.Maybe Prelude.Text)
listAssociations_sourceArn :: (Maybe Text -> f (Maybe Text))
-> ListAssociations -> f ListAssociations
listAssociations_sourceArn = (ListAssociations -> Maybe Text)
-> (ListAssociations -> Maybe Text -> ListAssociations)
-> Lens ListAssociations ListAssociations (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociations' {Maybe Text
sourceArn :: Maybe Text
$sel:sourceArn:ListAssociations' :: ListAssociations -> Maybe Text
sourceArn} -> Maybe Text
sourceArn) (\s :: ListAssociations
s@ListAssociations' {} Maybe Text
a -> ListAssociations
s {$sel:sourceArn:ListAssociations' :: Maybe Text
sourceArn = Maybe Text
a} :: ListAssociations)
listAssociations_associationType :: Lens.Lens' ListAssociations (Prelude.Maybe AssociationEdgeType)
listAssociations_associationType :: (Maybe AssociationEdgeType -> f (Maybe AssociationEdgeType))
-> ListAssociations -> f ListAssociations
listAssociations_associationType = (ListAssociations -> Maybe AssociationEdgeType)
-> (ListAssociations
-> Maybe AssociationEdgeType -> ListAssociations)
-> Lens
ListAssociations
ListAssociations
(Maybe AssociationEdgeType)
(Maybe AssociationEdgeType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociations' {Maybe AssociationEdgeType
associationType :: Maybe AssociationEdgeType
$sel:associationType:ListAssociations' :: ListAssociations -> Maybe AssociationEdgeType
associationType} -> Maybe AssociationEdgeType
associationType) (\s :: ListAssociations
s@ListAssociations' {} Maybe AssociationEdgeType
a -> ListAssociations
s {$sel:associationType:ListAssociations' :: Maybe AssociationEdgeType
associationType = Maybe AssociationEdgeType
a} :: ListAssociations)
listAssociations_destinationArn :: Lens.Lens' ListAssociations (Prelude.Maybe Prelude.Text)
listAssociations_destinationArn :: (Maybe Text -> f (Maybe Text))
-> ListAssociations -> f ListAssociations
listAssociations_destinationArn = (ListAssociations -> Maybe Text)
-> (ListAssociations -> Maybe Text -> ListAssociations)
-> Lens ListAssociations ListAssociations (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociations' {Maybe Text
destinationArn :: Maybe Text
$sel:destinationArn:ListAssociations' :: ListAssociations -> Maybe Text
destinationArn} -> Maybe Text
destinationArn) (\s :: ListAssociations
s@ListAssociations' {} Maybe Text
a -> ListAssociations
s {$sel:destinationArn:ListAssociations' :: Maybe Text
destinationArn = Maybe Text
a} :: ListAssociations)
listAssociations_nextToken :: Lens.Lens' ListAssociations (Prelude.Maybe Prelude.Text)
listAssociations_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListAssociations -> f ListAssociations
listAssociations_nextToken = (ListAssociations -> Maybe Text)
-> (ListAssociations -> Maybe Text -> ListAssociations)
-> Lens ListAssociations ListAssociations (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAssociations' :: ListAssociations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAssociations
s@ListAssociations' {} Maybe Text
a -> ListAssociations
s {$sel:nextToken:ListAssociations' :: Maybe Text
nextToken = Maybe Text
a} :: ListAssociations)
listAssociations_destinationType :: Lens.Lens' ListAssociations (Prelude.Maybe Prelude.Text)
listAssociations_destinationType :: (Maybe Text -> f (Maybe Text))
-> ListAssociations -> f ListAssociations
listAssociations_destinationType = (ListAssociations -> Maybe Text)
-> (ListAssociations -> Maybe Text -> ListAssociations)
-> Lens ListAssociations ListAssociations (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociations' {Maybe Text
destinationType :: Maybe Text
$sel:destinationType:ListAssociations' :: ListAssociations -> Maybe Text
destinationType} -> Maybe Text
destinationType) (\s :: ListAssociations
s@ListAssociations' {} Maybe Text
a -> ListAssociations
s {$sel:destinationType:ListAssociations' :: Maybe Text
destinationType = Maybe Text
a} :: ListAssociations)
listAssociations_sortOrder :: Lens.Lens' ListAssociations (Prelude.Maybe SortOrder)
listAssociations_sortOrder :: (Maybe SortOrder -> f (Maybe SortOrder))
-> ListAssociations -> f ListAssociations
listAssociations_sortOrder = (ListAssociations -> Maybe SortOrder)
-> (ListAssociations -> Maybe SortOrder -> ListAssociations)
-> Lens
ListAssociations
ListAssociations
(Maybe SortOrder)
(Maybe SortOrder)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociations' {Maybe SortOrder
sortOrder :: Maybe SortOrder
$sel:sortOrder:ListAssociations' :: ListAssociations -> Maybe SortOrder
sortOrder} -> Maybe SortOrder
sortOrder) (\s :: ListAssociations
s@ListAssociations' {} Maybe SortOrder
a -> ListAssociations
s {$sel:sortOrder:ListAssociations' :: Maybe SortOrder
sortOrder = Maybe SortOrder
a} :: ListAssociations)
listAssociations_maxResults :: Lens.Lens' ListAssociations (Prelude.Maybe Prelude.Natural)
listAssociations_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListAssociations -> f ListAssociations
listAssociations_maxResults = (ListAssociations -> Maybe Natural)
-> (ListAssociations -> Maybe Natural -> ListAssociations)
-> Lens
ListAssociations ListAssociations (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListAssociations' :: ListAssociations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListAssociations
s@ListAssociations' {} Maybe Natural
a -> ListAssociations
s {$sel:maxResults:ListAssociations' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListAssociations)
listAssociations_createdBefore :: Lens.Lens' ListAssociations (Prelude.Maybe Prelude.UTCTime)
listAssociations_createdBefore :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ListAssociations -> f ListAssociations
listAssociations_createdBefore = (ListAssociations -> Maybe POSIX)
-> (ListAssociations -> Maybe POSIX -> ListAssociations)
-> Lens
ListAssociations ListAssociations (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociations' {Maybe POSIX
createdBefore :: Maybe POSIX
$sel:createdBefore:ListAssociations' :: ListAssociations -> Maybe POSIX
createdBefore} -> Maybe POSIX
createdBefore) (\s :: ListAssociations
s@ListAssociations' {} Maybe POSIX
a -> ListAssociations
s {$sel:createdBefore:ListAssociations' :: Maybe POSIX
createdBefore = Maybe POSIX
a} :: ListAssociations) ((Maybe POSIX -> f (Maybe POSIX))
-> ListAssociations -> f ListAssociations)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ListAssociations
-> f ListAssociations
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
listAssociations_sortBy :: Lens.Lens' ListAssociations (Prelude.Maybe SortAssociationsBy)
listAssociations_sortBy :: (Maybe SortAssociationsBy -> f (Maybe SortAssociationsBy))
-> ListAssociations -> f ListAssociations
listAssociations_sortBy = (ListAssociations -> Maybe SortAssociationsBy)
-> (ListAssociations
-> Maybe SortAssociationsBy -> ListAssociations)
-> Lens
ListAssociations
ListAssociations
(Maybe SortAssociationsBy)
(Maybe SortAssociationsBy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociations' {Maybe SortAssociationsBy
sortBy :: Maybe SortAssociationsBy
$sel:sortBy:ListAssociations' :: ListAssociations -> Maybe SortAssociationsBy
sortBy} -> Maybe SortAssociationsBy
sortBy) (\s :: ListAssociations
s@ListAssociations' {} Maybe SortAssociationsBy
a -> ListAssociations
s {$sel:sortBy:ListAssociations' :: Maybe SortAssociationsBy
sortBy = Maybe SortAssociationsBy
a} :: ListAssociations)
instance Core.AWSPager ListAssociations where
page :: ListAssociations
-> AWSResponse ListAssociations -> Maybe ListAssociations
page ListAssociations
rq AWSResponse ListAssociations
rs
| Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListAssociations
ListAssociationsResponse
rs
ListAssociationsResponse
-> Getting (First Text) ListAssociationsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListAssociationsResponse
-> Const (First Text) ListAssociationsResponse
Lens' ListAssociationsResponse (Maybe Text)
listAssociationsResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> ListAssociationsResponse
-> Const (First Text) ListAssociationsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListAssociationsResponse 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 ListAssociations
forall a. Maybe a
Prelude.Nothing
| Maybe [AssociationSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListAssociations
ListAssociationsResponse
rs
ListAssociationsResponse
-> Getting
(First [AssociationSummary])
ListAssociationsResponse
[AssociationSummary]
-> Maybe [AssociationSummary]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [AssociationSummary]
-> Const (First [AssociationSummary]) (Maybe [AssociationSummary]))
-> ListAssociationsResponse
-> Const (First [AssociationSummary]) ListAssociationsResponse
Lens' ListAssociationsResponse (Maybe [AssociationSummary])
listAssociationsResponse_associationSummaries
((Maybe [AssociationSummary]
-> Const (First [AssociationSummary]) (Maybe [AssociationSummary]))
-> ListAssociationsResponse
-> Const (First [AssociationSummary]) ListAssociationsResponse)
-> (([AssociationSummary]
-> Const (First [AssociationSummary]) [AssociationSummary])
-> Maybe [AssociationSummary]
-> Const (First [AssociationSummary]) (Maybe [AssociationSummary]))
-> Getting
(First [AssociationSummary])
ListAssociationsResponse
[AssociationSummary]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AssociationSummary]
-> Const (First [AssociationSummary]) [AssociationSummary])
-> Maybe [AssociationSummary]
-> Const (First [AssociationSummary]) (Maybe [AssociationSummary])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe ListAssociations
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
ListAssociations -> Maybe ListAssociations
forall a. a -> Maybe a
Prelude.Just (ListAssociations -> Maybe ListAssociations)
-> ListAssociations -> Maybe ListAssociations
forall a b. (a -> b) -> a -> b
Prelude.$
ListAssociations
rq
ListAssociations
-> (ListAssociations -> ListAssociations) -> ListAssociations
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListAssociations -> Identity ListAssociations
Lens ListAssociations ListAssociations (Maybe Text) (Maybe Text)
listAssociations_nextToken
((Maybe Text -> Identity (Maybe Text))
-> ListAssociations -> Identity ListAssociations)
-> Maybe Text -> ListAssociations -> ListAssociations
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListAssociations
ListAssociationsResponse
rs
ListAssociationsResponse
-> Getting (First Text) ListAssociationsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListAssociationsResponse
-> Const (First Text) ListAssociationsResponse
Lens' ListAssociationsResponse (Maybe Text)
listAssociationsResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> ListAssociationsResponse
-> Const (First Text) ListAssociationsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListAssociationsResponse 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 ListAssociations where
type
AWSResponse ListAssociations =
ListAssociationsResponse
request :: ListAssociations -> Request ListAssociations
request = Service -> ListAssociations -> Request ListAssociations
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy ListAssociations
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListAssociations)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListAssociations))
-> Logger
-> Service
-> Proxy ListAssociations
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListAssociations)))
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
-> Maybe [AssociationSummary] -> Int -> ListAssociationsResponse
ListAssociationsResponse'
(Maybe Text
-> Maybe [AssociationSummary] -> Int -> ListAssociationsResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe [AssociationSummary] -> Int -> ListAssociationsResponse)
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
(Maybe [AssociationSummary] -> Int -> ListAssociationsResponse)
-> Either String (Maybe [AssociationSummary])
-> Either String (Int -> ListAssociationsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [AssociationSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AssociationSummaries"
Either String (Maybe (Maybe [AssociationSummary]))
-> Maybe [AssociationSummary]
-> Either String (Maybe [AssociationSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [AssociationSummary]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> ListAssociationsResponse)
-> Either String Int -> Either String ListAssociationsResponse
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 ListAssociations
instance Prelude.NFData ListAssociations
instance Core.ToHeaders ListAssociations where
toHeaders :: ListAssociations -> ResponseHeaders
toHeaders =
ResponseHeaders -> ListAssociations -> 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.ListAssociations" :: 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 ListAssociations where
toJSON :: ListAssociations -> Value
toJSON ListAssociations' {Maybe Natural
Maybe Text
Maybe POSIX
Maybe AssociationEdgeType
Maybe SortAssociationsBy
Maybe SortOrder
sortBy :: Maybe SortAssociationsBy
createdBefore :: Maybe POSIX
maxResults :: Maybe Natural
sortOrder :: Maybe SortOrder
destinationType :: Maybe Text
nextToken :: Maybe Text
destinationArn :: Maybe Text
associationType :: Maybe AssociationEdgeType
sourceArn :: Maybe Text
sourceType :: Maybe Text
createdAfter :: Maybe POSIX
$sel:sortBy:ListAssociations' :: ListAssociations -> Maybe SortAssociationsBy
$sel:createdBefore:ListAssociations' :: ListAssociations -> Maybe POSIX
$sel:maxResults:ListAssociations' :: ListAssociations -> Maybe Natural
$sel:sortOrder:ListAssociations' :: ListAssociations -> Maybe SortOrder
$sel:destinationType:ListAssociations' :: ListAssociations -> Maybe Text
$sel:nextToken:ListAssociations' :: ListAssociations -> Maybe Text
$sel:destinationArn:ListAssociations' :: ListAssociations -> Maybe Text
$sel:associationType:ListAssociations' :: ListAssociations -> Maybe AssociationEdgeType
$sel:sourceArn:ListAssociations' :: ListAssociations -> Maybe Text
$sel:sourceType:ListAssociations' :: ListAssociations -> Maybe Text
$sel:createdAfter:ListAssociations' :: ListAssociations -> 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
"SourceType" 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
sourceType,
(Text
"SourceArn" 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
sourceArn,
(Text
"AssociationType" Text -> AssociationEdgeType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(AssociationEdgeType -> Pair)
-> Maybe AssociationEdgeType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AssociationEdgeType
associationType,
(Text
"DestinationArn" 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
destinationArn,
(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
"DestinationType" 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
destinationType,
(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
"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 -> SortAssociationsBy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SortAssociationsBy -> Pair)
-> Maybe SortAssociationsBy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SortAssociationsBy
sortBy
]
)
instance Core.ToPath ListAssociations where
toPath :: ListAssociations -> ByteString
toPath = ByteString -> ListAssociations -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ListAssociations where
toQuery :: ListAssociations -> QueryString
toQuery = QueryString -> ListAssociations -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data ListAssociationsResponse = ListAssociationsResponse'
{
ListAssociationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListAssociationsResponse -> Maybe [AssociationSummary]
associationSummaries :: Prelude.Maybe [AssociationSummary],
ListAssociationsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListAssociationsResponse -> ListAssociationsResponse -> Bool
(ListAssociationsResponse -> ListAssociationsResponse -> Bool)
-> (ListAssociationsResponse -> ListAssociationsResponse -> Bool)
-> Eq ListAssociationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAssociationsResponse -> ListAssociationsResponse -> Bool
$c/= :: ListAssociationsResponse -> ListAssociationsResponse -> Bool
== :: ListAssociationsResponse -> ListAssociationsResponse -> Bool
$c== :: ListAssociationsResponse -> ListAssociationsResponse -> Bool
Prelude.Eq, ReadPrec [ListAssociationsResponse]
ReadPrec ListAssociationsResponse
Int -> ReadS ListAssociationsResponse
ReadS [ListAssociationsResponse]
(Int -> ReadS ListAssociationsResponse)
-> ReadS [ListAssociationsResponse]
-> ReadPrec ListAssociationsResponse
-> ReadPrec [ListAssociationsResponse]
-> Read ListAssociationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAssociationsResponse]
$creadListPrec :: ReadPrec [ListAssociationsResponse]
readPrec :: ReadPrec ListAssociationsResponse
$creadPrec :: ReadPrec ListAssociationsResponse
readList :: ReadS [ListAssociationsResponse]
$creadList :: ReadS [ListAssociationsResponse]
readsPrec :: Int -> ReadS ListAssociationsResponse
$creadsPrec :: Int -> ReadS ListAssociationsResponse
Prelude.Read, Int -> ListAssociationsResponse -> ShowS
[ListAssociationsResponse] -> ShowS
ListAssociationsResponse -> String
(Int -> ListAssociationsResponse -> ShowS)
-> (ListAssociationsResponse -> String)
-> ([ListAssociationsResponse] -> ShowS)
-> Show ListAssociationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAssociationsResponse] -> ShowS
$cshowList :: [ListAssociationsResponse] -> ShowS
show :: ListAssociationsResponse -> String
$cshow :: ListAssociationsResponse -> String
showsPrec :: Int -> ListAssociationsResponse -> ShowS
$cshowsPrec :: Int -> ListAssociationsResponse -> ShowS
Prelude.Show, (forall x.
ListAssociationsResponse -> Rep ListAssociationsResponse x)
-> (forall x.
Rep ListAssociationsResponse x -> ListAssociationsResponse)
-> Generic ListAssociationsResponse
forall x.
Rep ListAssociationsResponse x -> ListAssociationsResponse
forall x.
ListAssociationsResponse -> Rep ListAssociationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListAssociationsResponse x -> ListAssociationsResponse
$cfrom :: forall x.
ListAssociationsResponse -> Rep ListAssociationsResponse x
Prelude.Generic)
newListAssociationsResponse ::
Prelude.Int ->
ListAssociationsResponse
newListAssociationsResponse :: Int -> ListAssociationsResponse
newListAssociationsResponse Int
pHttpStatus_ =
ListAssociationsResponse' :: Maybe Text
-> Maybe [AssociationSummary] -> Int -> ListAssociationsResponse
ListAssociationsResponse'
{ $sel:nextToken:ListAssociationsResponse' :: Maybe Text
nextToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:associationSummaries:ListAssociationsResponse' :: Maybe [AssociationSummary]
associationSummaries = Maybe [AssociationSummary]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListAssociationsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listAssociationsResponse_nextToken :: Lens.Lens' ListAssociationsResponse (Prelude.Maybe Prelude.Text)
listAssociationsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListAssociationsResponse -> f ListAssociationsResponse
listAssociationsResponse_nextToken = (ListAssociationsResponse -> Maybe Text)
-> (ListAssociationsResponse
-> Maybe Text -> ListAssociationsResponse)
-> Lens' ListAssociationsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAssociationsResponse' :: ListAssociationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAssociationsResponse
s@ListAssociationsResponse' {} Maybe Text
a -> ListAssociationsResponse
s {$sel:nextToken:ListAssociationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAssociationsResponse)
listAssociationsResponse_associationSummaries :: Lens.Lens' ListAssociationsResponse (Prelude.Maybe [AssociationSummary])
listAssociationsResponse_associationSummaries :: (Maybe [AssociationSummary] -> f (Maybe [AssociationSummary]))
-> ListAssociationsResponse -> f ListAssociationsResponse
listAssociationsResponse_associationSummaries = (ListAssociationsResponse -> Maybe [AssociationSummary])
-> (ListAssociationsResponse
-> Maybe [AssociationSummary] -> ListAssociationsResponse)
-> Lens' ListAssociationsResponse (Maybe [AssociationSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociationsResponse' {Maybe [AssociationSummary]
associationSummaries :: Maybe [AssociationSummary]
$sel:associationSummaries:ListAssociationsResponse' :: ListAssociationsResponse -> Maybe [AssociationSummary]
associationSummaries} -> Maybe [AssociationSummary]
associationSummaries) (\s :: ListAssociationsResponse
s@ListAssociationsResponse' {} Maybe [AssociationSummary]
a -> ListAssociationsResponse
s {$sel:associationSummaries:ListAssociationsResponse' :: Maybe [AssociationSummary]
associationSummaries = Maybe [AssociationSummary]
a} :: ListAssociationsResponse) ((Maybe [AssociationSummary] -> f (Maybe [AssociationSummary]))
-> ListAssociationsResponse -> f ListAssociationsResponse)
-> ((Maybe [AssociationSummary] -> f (Maybe [AssociationSummary]))
-> Maybe [AssociationSummary] -> f (Maybe [AssociationSummary]))
-> (Maybe [AssociationSummary] -> f (Maybe [AssociationSummary]))
-> ListAssociationsResponse
-> f ListAssociationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[AssociationSummary]
[AssociationSummary]
[AssociationSummary]
[AssociationSummary]
-> Iso
(Maybe [AssociationSummary])
(Maybe [AssociationSummary])
(Maybe [AssociationSummary])
(Maybe [AssociationSummary])
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
[AssociationSummary]
[AssociationSummary]
[AssociationSummary]
[AssociationSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listAssociationsResponse_httpStatus :: Lens.Lens' ListAssociationsResponse Prelude.Int
listAssociationsResponse_httpStatus :: (Int -> f Int)
-> ListAssociationsResponse -> f ListAssociationsResponse
listAssociationsResponse_httpStatus = (ListAssociationsResponse -> Int)
-> (ListAssociationsResponse -> Int -> ListAssociationsResponse)
-> Lens ListAssociationsResponse ListAssociationsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListAssociationsResponse' :: ListAssociationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListAssociationsResponse
s@ListAssociationsResponse' {} Int
a -> ListAssociationsResponse
s {$sel:httpStatus:ListAssociationsResponse' :: Int
httpStatus = Int
a} :: ListAssociationsResponse)
instance Prelude.NFData ListAssociationsResponse