{-# 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.SSM.ListAssociationVersions
(
ListAssociationVersions (..),
newListAssociationVersions,
listAssociationVersions_maxResults,
listAssociationVersions_nextToken,
listAssociationVersions_associationId,
ListAssociationVersionsResponse (..),
newListAssociationVersionsResponse,
listAssociationVersionsResponse_associationVersions,
listAssociationVersionsResponse_nextToken,
listAssociationVersionsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SSM.Types
data ListAssociationVersions = ListAssociationVersions'
{
ListAssociationVersions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListAssociationVersions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListAssociationVersions -> Text
associationId :: Prelude.Text
}
deriving (ListAssociationVersions -> ListAssociationVersions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAssociationVersions -> ListAssociationVersions -> Bool
$c/= :: ListAssociationVersions -> ListAssociationVersions -> Bool
== :: ListAssociationVersions -> ListAssociationVersions -> Bool
$c== :: ListAssociationVersions -> ListAssociationVersions -> Bool
Prelude.Eq, ReadPrec [ListAssociationVersions]
ReadPrec ListAssociationVersions
Int -> ReadS ListAssociationVersions
ReadS [ListAssociationVersions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAssociationVersions]
$creadListPrec :: ReadPrec [ListAssociationVersions]
readPrec :: ReadPrec ListAssociationVersions
$creadPrec :: ReadPrec ListAssociationVersions
readList :: ReadS [ListAssociationVersions]
$creadList :: ReadS [ListAssociationVersions]
readsPrec :: Int -> ReadS ListAssociationVersions
$creadsPrec :: Int -> ReadS ListAssociationVersions
Prelude.Read, Int -> ListAssociationVersions -> ShowS
[ListAssociationVersions] -> ShowS
ListAssociationVersions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAssociationVersions] -> ShowS
$cshowList :: [ListAssociationVersions] -> ShowS
show :: ListAssociationVersions -> String
$cshow :: ListAssociationVersions -> String
showsPrec :: Int -> ListAssociationVersions -> ShowS
$cshowsPrec :: Int -> ListAssociationVersions -> ShowS
Prelude.Show, forall x. Rep ListAssociationVersions x -> ListAssociationVersions
forall x. ListAssociationVersions -> Rep ListAssociationVersions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAssociationVersions x -> ListAssociationVersions
$cfrom :: forall x. ListAssociationVersions -> Rep ListAssociationVersions x
Prelude.Generic)
newListAssociationVersions ::
Prelude.Text ->
ListAssociationVersions
newListAssociationVersions :: Text -> ListAssociationVersions
newListAssociationVersions Text
pAssociationId_ =
ListAssociationVersions'
{ $sel:maxResults:ListAssociationVersions' :: Maybe Natural
maxResults =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListAssociationVersions' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:associationId:ListAssociationVersions' :: Text
associationId = Text
pAssociationId_
}
listAssociationVersions_maxResults :: Lens.Lens' ListAssociationVersions (Prelude.Maybe Prelude.Natural)
listAssociationVersions_maxResults :: Lens' ListAssociationVersions (Maybe Natural)
listAssociationVersions_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociationVersions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListAssociationVersions' :: ListAssociationVersions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListAssociationVersions
s@ListAssociationVersions' {} Maybe Natural
a -> ListAssociationVersions
s {$sel:maxResults:ListAssociationVersions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListAssociationVersions)
listAssociationVersions_nextToken :: Lens.Lens' ListAssociationVersions (Prelude.Maybe Prelude.Text)
listAssociationVersions_nextToken :: Lens' ListAssociationVersions (Maybe Text)
listAssociationVersions_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociationVersions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAssociationVersions' :: ListAssociationVersions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAssociationVersions
s@ListAssociationVersions' {} Maybe Text
a -> ListAssociationVersions
s {$sel:nextToken:ListAssociationVersions' :: Maybe Text
nextToken = Maybe Text
a} :: ListAssociationVersions)
listAssociationVersions_associationId :: Lens.Lens' ListAssociationVersions Prelude.Text
listAssociationVersions_associationId :: Lens' ListAssociationVersions Text
listAssociationVersions_associationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociationVersions' {Text
associationId :: Text
$sel:associationId:ListAssociationVersions' :: ListAssociationVersions -> Text
associationId} -> Text
associationId) (\s :: ListAssociationVersions
s@ListAssociationVersions' {} Text
a -> ListAssociationVersions
s {$sel:associationId:ListAssociationVersions' :: Text
associationId = Text
a} :: ListAssociationVersions)
instance Core.AWSPager ListAssociationVersions where
page :: ListAssociationVersions
-> AWSResponse ListAssociationVersions
-> Maybe ListAssociationVersions
page ListAssociationVersions
rq AWSResponse ListAssociationVersions
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListAssociationVersions
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAssociationVersionsResponse (Maybe Text)
listAssociationVersionsResponse_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 ListAssociationVersions
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
ListAssociationVersionsResponse
(Maybe (NonEmpty AssociationVersionInfo))
listAssociationVersionsResponse_associationVersions
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to forall l. IsList l => l -> [Item l]
Prelude.toList
) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListAssociationVersions
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListAssociationVersions (Maybe Text)
listAssociationVersions_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListAssociationVersions
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListAssociationVersionsResponse (Maybe Text)
listAssociationVersionsResponse_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 ListAssociationVersions where
type
AWSResponse ListAssociationVersions =
ListAssociationVersionsResponse
request :: (Service -> Service)
-> ListAssociationVersions -> Request ListAssociationVersions
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 ListAssociationVersions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListAssociationVersions)))
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 (NonEmpty AssociationVersionInfo)
-> Maybe Text -> Int -> ListAssociationVersionsResponse
ListAssociationVersionsResponse'
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
"AssociationVersions")
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 ListAssociationVersions where
hashWithSalt :: Int -> ListAssociationVersions -> Int
hashWithSalt Int
_salt ListAssociationVersions' {Maybe Natural
Maybe Text
Text
associationId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:associationId:ListAssociationVersions' :: ListAssociationVersions -> Text
$sel:nextToken:ListAssociationVersions' :: ListAssociationVersions -> Maybe Text
$sel:maxResults:ListAssociationVersions' :: ListAssociationVersions -> 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` Text
associationId
instance Prelude.NFData ListAssociationVersions where
rnf :: ListAssociationVersions -> ()
rnf ListAssociationVersions' {Maybe Natural
Maybe Text
Text
associationId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:associationId:ListAssociationVersions' :: ListAssociationVersions -> Text
$sel:nextToken:ListAssociationVersions' :: ListAssociationVersions -> Maybe Text
$sel:maxResults:ListAssociationVersions' :: ListAssociationVersions -> 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 Text
associationId
instance Data.ToHeaders ListAssociationVersions where
toHeaders :: ListAssociationVersions -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AmazonSSM.ListAssociationVersions" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON ListAssociationVersions where
toJSON :: ListAssociationVersions -> Value
toJSON ListAssociationVersions' {Maybe Natural
Maybe Text
Text
associationId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:associationId:ListAssociationVersions' :: ListAssociationVersions -> Text
$sel:nextToken:ListAssociationVersions' :: ListAssociationVersions -> Maybe Text
$sel:maxResults:ListAssociationVersions' :: ListAssociationVersions -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
(Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
forall a. a -> Maybe a
Prelude.Just
(Key
"AssociationId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
associationId)
]
)
instance Data.ToPath ListAssociationVersions where
toPath :: ListAssociationVersions -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListAssociationVersions where
toQuery :: ListAssociationVersions -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListAssociationVersionsResponse = ListAssociationVersionsResponse'
{
ListAssociationVersionsResponse
-> Maybe (NonEmpty AssociationVersionInfo)
associationVersions :: Prelude.Maybe (Prelude.NonEmpty AssociationVersionInfo),
ListAssociationVersionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListAssociationVersionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListAssociationVersionsResponse
-> ListAssociationVersionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAssociationVersionsResponse
-> ListAssociationVersionsResponse -> Bool
$c/= :: ListAssociationVersionsResponse
-> ListAssociationVersionsResponse -> Bool
== :: ListAssociationVersionsResponse
-> ListAssociationVersionsResponse -> Bool
$c== :: ListAssociationVersionsResponse
-> ListAssociationVersionsResponse -> Bool
Prelude.Eq, Int -> ListAssociationVersionsResponse -> ShowS
[ListAssociationVersionsResponse] -> ShowS
ListAssociationVersionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAssociationVersionsResponse] -> ShowS
$cshowList :: [ListAssociationVersionsResponse] -> ShowS
show :: ListAssociationVersionsResponse -> String
$cshow :: ListAssociationVersionsResponse -> String
showsPrec :: Int -> ListAssociationVersionsResponse -> ShowS
$cshowsPrec :: Int -> ListAssociationVersionsResponse -> ShowS
Prelude.Show, forall x.
Rep ListAssociationVersionsResponse x
-> ListAssociationVersionsResponse
forall x.
ListAssociationVersionsResponse
-> Rep ListAssociationVersionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListAssociationVersionsResponse x
-> ListAssociationVersionsResponse
$cfrom :: forall x.
ListAssociationVersionsResponse
-> Rep ListAssociationVersionsResponse x
Prelude.Generic)
newListAssociationVersionsResponse ::
Prelude.Int ->
ListAssociationVersionsResponse
newListAssociationVersionsResponse :: Int -> ListAssociationVersionsResponse
newListAssociationVersionsResponse Int
pHttpStatus_ =
ListAssociationVersionsResponse'
{ $sel:associationVersions:ListAssociationVersionsResponse' :: Maybe (NonEmpty AssociationVersionInfo)
associationVersions =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListAssociationVersionsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListAssociationVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listAssociationVersionsResponse_associationVersions :: Lens.Lens' ListAssociationVersionsResponse (Prelude.Maybe (Prelude.NonEmpty AssociationVersionInfo))
listAssociationVersionsResponse_associationVersions :: Lens'
ListAssociationVersionsResponse
(Maybe (NonEmpty AssociationVersionInfo))
listAssociationVersionsResponse_associationVersions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociationVersionsResponse' {Maybe (NonEmpty AssociationVersionInfo)
associationVersions :: Maybe (NonEmpty AssociationVersionInfo)
$sel:associationVersions:ListAssociationVersionsResponse' :: ListAssociationVersionsResponse
-> Maybe (NonEmpty AssociationVersionInfo)
associationVersions} -> Maybe (NonEmpty AssociationVersionInfo)
associationVersions) (\s :: ListAssociationVersionsResponse
s@ListAssociationVersionsResponse' {} Maybe (NonEmpty AssociationVersionInfo)
a -> ListAssociationVersionsResponse
s {$sel:associationVersions:ListAssociationVersionsResponse' :: Maybe (NonEmpty AssociationVersionInfo)
associationVersions = Maybe (NonEmpty AssociationVersionInfo)
a} :: ListAssociationVersionsResponse) 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
listAssociationVersionsResponse_nextToken :: Lens.Lens' ListAssociationVersionsResponse (Prelude.Maybe Prelude.Text)
listAssociationVersionsResponse_nextToken :: Lens' ListAssociationVersionsResponse (Maybe Text)
listAssociationVersionsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociationVersionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAssociationVersionsResponse' :: ListAssociationVersionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAssociationVersionsResponse
s@ListAssociationVersionsResponse' {} Maybe Text
a -> ListAssociationVersionsResponse
s {$sel:nextToken:ListAssociationVersionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAssociationVersionsResponse)
listAssociationVersionsResponse_httpStatus :: Lens.Lens' ListAssociationVersionsResponse Prelude.Int
listAssociationVersionsResponse_httpStatus :: Lens' ListAssociationVersionsResponse Int
listAssociationVersionsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociationVersionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListAssociationVersionsResponse' :: ListAssociationVersionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListAssociationVersionsResponse
s@ListAssociationVersionsResponse' {} Int
a -> ListAssociationVersionsResponse
s {$sel:httpStatus:ListAssociationVersionsResponse' :: Int
httpStatus = Int
a} :: ListAssociationVersionsResponse)
instance
Prelude.NFData
ListAssociationVersionsResponse
where
rnf :: ListAssociationVersionsResponse -> ()
rnf ListAssociationVersionsResponse' {Int
Maybe (NonEmpty AssociationVersionInfo)
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
associationVersions :: Maybe (NonEmpty AssociationVersionInfo)
$sel:httpStatus:ListAssociationVersionsResponse' :: ListAssociationVersionsResponse -> Int
$sel:nextToken:ListAssociationVersionsResponse' :: ListAssociationVersionsResponse -> Maybe Text
$sel:associationVersions:ListAssociationVersionsResponse' :: ListAssociationVersionsResponse
-> Maybe (NonEmpty AssociationVersionInfo)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty AssociationVersionInfo)
associationVersions
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