{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SSM.ListAssociationVersions
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Retrieves all versions of an association for a specific association ID.
--
-- This operation returns paginated results.
module Amazonka.SSM.ListAssociationVersions
  ( -- * Creating a Request
    ListAssociationVersions (..),
    newListAssociationVersions,

    -- * Request Lenses
    listAssociationVersions_nextToken,
    listAssociationVersions_maxResults,
    listAssociationVersions_associationId,

    -- * Destructuring the Response
    ListAssociationVersionsResponse (..),
    newListAssociationVersionsResponse,

    -- * Response Lenses
    listAssociationVersionsResponse_nextToken,
    listAssociationVersionsResponse_associationVersions,
    listAssociationVersionsResponse_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.SSM.Types

-- | /See:/ 'newListAssociationVersions' smart constructor.
data ListAssociationVersions = ListAssociationVersions'
  { -- | A token to start the list. Use this token to get the next set of
    -- results.
    ListAssociationVersions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of items to return for this call. The call also
    -- returns a token that you can specify in a subsequent call to get the
    -- next set of results.
    ListAssociationVersions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The association ID for which you want to view all versions.
    ListAssociationVersions -> Text
associationId :: Prelude.Text
  }
  deriving (ListAssociationVersions -> ListAssociationVersions -> Bool
(ListAssociationVersions -> ListAssociationVersions -> Bool)
-> (ListAssociationVersions -> ListAssociationVersions -> Bool)
-> Eq ListAssociationVersions
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]
(Int -> ReadS ListAssociationVersions)
-> ReadS [ListAssociationVersions]
-> ReadPrec ListAssociationVersions
-> ReadPrec [ListAssociationVersions]
-> Read 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
(Int -> ListAssociationVersions -> ShowS)
-> (ListAssociationVersions -> String)
-> ([ListAssociationVersions] -> ShowS)
-> Show ListAssociationVersions
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.
 ListAssociationVersions -> Rep ListAssociationVersions x)
-> (forall x.
    Rep ListAssociationVersions x -> ListAssociationVersions)
-> Generic ListAssociationVersions
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)

-- |
-- Create a value of 'ListAssociationVersions' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'listAssociationVersions_nextToken' - A token to start the list. Use this token to get the next set of
-- results.
--
-- 'maxResults', 'listAssociationVersions_maxResults' - The maximum number of items to return for this call. The call also
-- returns a token that you can specify in a subsequent call to get the
-- next set of results.
--
-- 'associationId', 'listAssociationVersions_associationId' - The association ID for which you want to view all versions.
newListAssociationVersions ::
  -- | 'associationId'
  Prelude.Text ->
  ListAssociationVersions
newListAssociationVersions :: Text -> ListAssociationVersions
newListAssociationVersions Text
pAssociationId_ =
  ListAssociationVersions' :: Maybe Text -> Maybe Natural -> Text -> ListAssociationVersions
ListAssociationVersions'
    { $sel:nextToken:ListAssociationVersions' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListAssociationVersions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:associationId:ListAssociationVersions' :: Text
associationId = Text
pAssociationId_
    }

-- | A token to start the list. Use this token to get the next set of
-- results.
listAssociationVersions_nextToken :: Lens.Lens' ListAssociationVersions (Prelude.Maybe Prelude.Text)
listAssociationVersions_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListAssociationVersions -> f ListAssociationVersions
listAssociationVersions_nextToken = (ListAssociationVersions -> Maybe Text)
-> (ListAssociationVersions
    -> Maybe Text -> ListAssociationVersions)
-> Lens
     ListAssociationVersions
     ListAssociationVersions
     (Maybe Text)
     (Maybe Text)
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)

-- | The maximum number of items to return for this call. The call also
-- returns a token that you can specify in a subsequent call to get the
-- next set of results.
listAssociationVersions_maxResults :: Lens.Lens' ListAssociationVersions (Prelude.Maybe Prelude.Natural)
listAssociationVersions_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListAssociationVersions -> f ListAssociationVersions
listAssociationVersions_maxResults = (ListAssociationVersions -> Maybe Natural)
-> (ListAssociationVersions
    -> Maybe Natural -> ListAssociationVersions)
-> Lens
     ListAssociationVersions
     ListAssociationVersions
     (Maybe Natural)
     (Maybe Natural)
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)

-- | The association ID for which you want to view all versions.
listAssociationVersions_associationId :: Lens.Lens' ListAssociationVersions Prelude.Text
listAssociationVersions_associationId :: (Text -> f Text)
-> ListAssociationVersions -> f ListAssociationVersions
listAssociationVersions_associationId = (ListAssociationVersions -> Text)
-> (ListAssociationVersions -> Text -> ListAssociationVersions)
-> Lens ListAssociationVersions ListAssociationVersions Text Text
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
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAssociationVersions
ListAssociationVersionsResponse
rs
            ListAssociationVersionsResponse
-> Getting (First Text) ListAssociationVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListAssociationVersionsResponse
-> Const (First Text) ListAssociationVersionsResponse
Lens' ListAssociationVersionsResponse (Maybe Text)
listAssociationVersionsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListAssociationVersionsResponse
 -> Const (First Text) ListAssociationVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListAssociationVersionsResponse 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 ListAssociationVersions
forall a. Maybe a
Prelude.Nothing
    | Maybe [AssociationVersionInfo] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListAssociationVersions
ListAssociationVersionsResponse
rs
            ListAssociationVersionsResponse
-> Getting
     (First [AssociationVersionInfo])
     ListAssociationVersionsResponse
     [AssociationVersionInfo]
-> Maybe [AssociationVersionInfo]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe (NonEmpty AssociationVersionInfo)
 -> Const
      (First [AssociationVersionInfo])
      (Maybe (NonEmpty AssociationVersionInfo)))
-> ListAssociationVersionsResponse
-> Const
     (First [AssociationVersionInfo]) ListAssociationVersionsResponse
Lens'
  ListAssociationVersionsResponse
  (Maybe (NonEmpty AssociationVersionInfo))
listAssociationVersionsResponse_associationVersions
              ((Maybe (NonEmpty AssociationVersionInfo)
  -> Const
       (First [AssociationVersionInfo])
       (Maybe (NonEmpty AssociationVersionInfo)))
 -> ListAssociationVersionsResponse
 -> Const
      (First [AssociationVersionInfo]) ListAssociationVersionsResponse)
-> (([AssociationVersionInfo]
     -> Const (First [AssociationVersionInfo]) [AssociationVersionInfo])
    -> Maybe (NonEmpty AssociationVersionInfo)
    -> Const
         (First [AssociationVersionInfo])
         (Maybe (NonEmpty AssociationVersionInfo)))
-> Getting
     (First [AssociationVersionInfo])
     ListAssociationVersionsResponse
     [AssociationVersionInfo]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty AssociationVersionInfo
 -> Const
      (First [AssociationVersionInfo]) (NonEmpty AssociationVersionInfo))
-> Maybe (NonEmpty AssociationVersionInfo)
-> Const
     (First [AssociationVersionInfo])
     (Maybe (NonEmpty AssociationVersionInfo))
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
              ((NonEmpty AssociationVersionInfo
  -> Const
       (First [AssociationVersionInfo]) (NonEmpty AssociationVersionInfo))
 -> Maybe (NonEmpty AssociationVersionInfo)
 -> Const
      (First [AssociationVersionInfo])
      (Maybe (NonEmpty AssociationVersionInfo)))
-> (([AssociationVersionInfo]
     -> Const (First [AssociationVersionInfo]) [AssociationVersionInfo])
    -> NonEmpty AssociationVersionInfo
    -> Const
         (First [AssociationVersionInfo]) (NonEmpty AssociationVersionInfo))
-> ([AssociationVersionInfo]
    -> Const (First [AssociationVersionInfo]) [AssociationVersionInfo])
-> Maybe (NonEmpty AssociationVersionInfo)
-> Const
     (First [AssociationVersionInfo])
     (Maybe (NonEmpty AssociationVersionInfo))
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty AssociationVersionInfo -> [AssociationVersionInfo])
-> ([AssociationVersionInfo]
    -> Const (First [AssociationVersionInfo]) [AssociationVersionInfo])
-> NonEmpty AssociationVersionInfo
-> Const
     (First [AssociationVersionInfo]) (NonEmpty AssociationVersionInfo)
forall (p :: * -> * -> *) (f :: * -> *) s a.
(Profunctor p, Contravariant f) =>
(s -> a) -> Optic' p f s a
Lens.to NonEmpty AssociationVersionInfo -> [AssociationVersionInfo]
forall l. IsList l => l -> [Item l]
Prelude.toList
        ) =
      Maybe ListAssociationVersions
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListAssociationVersions -> Maybe ListAssociationVersions
forall a. a -> Maybe a
Prelude.Just (ListAssociationVersions -> Maybe ListAssociationVersions)
-> ListAssociationVersions -> Maybe ListAssociationVersions
forall a b. (a -> b) -> a -> b
Prelude.$
        ListAssociationVersions
rq
          ListAssociationVersions
-> (ListAssociationVersions -> ListAssociationVersions)
-> ListAssociationVersions
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListAssociationVersions -> Identity ListAssociationVersions
Lens
  ListAssociationVersions
  ListAssociationVersions
  (Maybe Text)
  (Maybe Text)
listAssociationVersions_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListAssociationVersions -> Identity ListAssociationVersions)
-> Maybe Text -> ListAssociationVersions -> ListAssociationVersions
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListAssociationVersions
ListAssociationVersionsResponse
rs
          ListAssociationVersionsResponse
-> Getting (First Text) ListAssociationVersionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListAssociationVersionsResponse
-> Const (First Text) ListAssociationVersionsResponse
Lens' ListAssociationVersionsResponse (Maybe Text)
listAssociationVersionsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListAssociationVersionsResponse
 -> Const (First Text) ListAssociationVersionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListAssociationVersionsResponse 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 ListAssociationVersions where
  type
    AWSResponse ListAssociationVersions =
      ListAssociationVersionsResponse
  request :: ListAssociationVersions -> Request ListAssociationVersions
request = Service
-> ListAssociationVersions -> Request ListAssociationVersions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListAssociationVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListAssociationVersions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListAssociationVersions))
-> Logger
-> Service
-> Proxy ListAssociationVersions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListAssociationVersions)))
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 (NonEmpty AssociationVersionInfo)
-> Int
-> ListAssociationVersionsResponse
ListAssociationVersionsResponse'
            (Maybe Text
 -> Maybe (NonEmpty AssociationVersionInfo)
 -> Int
 -> ListAssociationVersionsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe (NonEmpty AssociationVersionInfo)
      -> Int -> ListAssociationVersionsResponse)
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 (NonEmpty AssociationVersionInfo)
   -> Int -> ListAssociationVersionsResponse)
-> Either String (Maybe (NonEmpty AssociationVersionInfo))
-> Either String (Int -> ListAssociationVersionsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Either String (Maybe (NonEmpty AssociationVersionInfo))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"AssociationVersions")
            Either String (Int -> ListAssociationVersionsResponse)
-> Either String Int
-> Either String ListAssociationVersionsResponse
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 ListAssociationVersions

instance Prelude.NFData ListAssociationVersions

instance Core.ToHeaders ListAssociationVersions where
  toHeaders :: ListAssociationVersions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListAssociationVersions -> 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
"AmazonSSM.ListAssociationVersions" ::
                          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 ListAssociationVersions where
  toJSON :: ListAssociationVersions -> Value
toJSON ListAssociationVersions' {Maybe Natural
Maybe Text
Text
associationId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:associationId:ListAssociationVersions' :: ListAssociationVersions -> Text
$sel:maxResults:ListAssociationVersions' :: ListAssociationVersions -> Maybe Natural
$sel:nextToken:ListAssociationVersions' :: ListAssociationVersions -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
"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,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"AssociationId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
associationId)
          ]
      )

instance Core.ToPath ListAssociationVersions where
  toPath :: ListAssociationVersions -> ByteString
toPath = ByteString -> ListAssociationVersions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery ListAssociationVersions where
  toQuery :: ListAssociationVersions -> QueryString
toQuery = QueryString -> ListAssociationVersions -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newListAssociationVersionsResponse' smart constructor.
data ListAssociationVersionsResponse = ListAssociationVersionsResponse'
  { -- | The token for the next set of items to return. Use this token to get the
    -- next set of results.
    ListAssociationVersionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Information about all versions of the association for the specified
    -- association ID.
    ListAssociationVersionsResponse
-> Maybe (NonEmpty AssociationVersionInfo)
associationVersions :: Prelude.Maybe (Prelude.NonEmpty AssociationVersionInfo),
    -- | The response's http status code.
    ListAssociationVersionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListAssociationVersionsResponse
-> ListAssociationVersionsResponse -> Bool
(ListAssociationVersionsResponse
 -> ListAssociationVersionsResponse -> Bool)
-> (ListAssociationVersionsResponse
    -> ListAssociationVersionsResponse -> Bool)
-> Eq ListAssociationVersionsResponse
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, ReadPrec [ListAssociationVersionsResponse]
ReadPrec ListAssociationVersionsResponse
Int -> ReadS ListAssociationVersionsResponse
ReadS [ListAssociationVersionsResponse]
(Int -> ReadS ListAssociationVersionsResponse)
-> ReadS [ListAssociationVersionsResponse]
-> ReadPrec ListAssociationVersionsResponse
-> ReadPrec [ListAssociationVersionsResponse]
-> Read ListAssociationVersionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAssociationVersionsResponse]
$creadListPrec :: ReadPrec [ListAssociationVersionsResponse]
readPrec :: ReadPrec ListAssociationVersionsResponse
$creadPrec :: ReadPrec ListAssociationVersionsResponse
readList :: ReadS [ListAssociationVersionsResponse]
$creadList :: ReadS [ListAssociationVersionsResponse]
readsPrec :: Int -> ReadS ListAssociationVersionsResponse
$creadsPrec :: Int -> ReadS ListAssociationVersionsResponse
Prelude.Read, Int -> ListAssociationVersionsResponse -> ShowS
[ListAssociationVersionsResponse] -> ShowS
ListAssociationVersionsResponse -> String
(Int -> ListAssociationVersionsResponse -> ShowS)
-> (ListAssociationVersionsResponse -> String)
-> ([ListAssociationVersionsResponse] -> ShowS)
-> Show ListAssociationVersionsResponse
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.
 ListAssociationVersionsResponse
 -> Rep ListAssociationVersionsResponse x)
-> (forall x.
    Rep ListAssociationVersionsResponse x
    -> ListAssociationVersionsResponse)
-> Generic ListAssociationVersionsResponse
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)

-- |
-- Create a value of 'ListAssociationVersionsResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'listAssociationVersionsResponse_nextToken' - The token for the next set of items to return. Use this token to get the
-- next set of results.
--
-- 'associationVersions', 'listAssociationVersionsResponse_associationVersions' - Information about all versions of the association for the specified
-- association ID.
--
-- 'httpStatus', 'listAssociationVersionsResponse_httpStatus' - The response's http status code.
newListAssociationVersionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListAssociationVersionsResponse
newListAssociationVersionsResponse :: Int -> ListAssociationVersionsResponse
newListAssociationVersionsResponse Int
pHttpStatus_ =
  ListAssociationVersionsResponse' :: Maybe Text
-> Maybe (NonEmpty AssociationVersionInfo)
-> Int
-> ListAssociationVersionsResponse
ListAssociationVersionsResponse'
    { $sel:nextToken:ListAssociationVersionsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:associationVersions:ListAssociationVersionsResponse' :: Maybe (NonEmpty AssociationVersionInfo)
associationVersions = Maybe (NonEmpty AssociationVersionInfo)
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListAssociationVersionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The token for the next set of items to return. Use this token to get the
-- next set of results.
listAssociationVersionsResponse_nextToken :: Lens.Lens' ListAssociationVersionsResponse (Prelude.Maybe Prelude.Text)
listAssociationVersionsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListAssociationVersionsResponse
-> f ListAssociationVersionsResponse
listAssociationVersionsResponse_nextToken = (ListAssociationVersionsResponse -> Maybe Text)
-> (ListAssociationVersionsResponse
    -> Maybe Text -> ListAssociationVersionsResponse)
-> Lens' ListAssociationVersionsResponse (Maybe Text)
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)

-- | Information about all versions of the association for the specified
-- association ID.
listAssociationVersionsResponse_associationVersions :: Lens.Lens' ListAssociationVersionsResponse (Prelude.Maybe (Prelude.NonEmpty AssociationVersionInfo))
listAssociationVersionsResponse_associationVersions :: (Maybe (NonEmpty AssociationVersionInfo)
 -> f (Maybe (NonEmpty AssociationVersionInfo)))
-> ListAssociationVersionsResponse
-> f ListAssociationVersionsResponse
listAssociationVersionsResponse_associationVersions = (ListAssociationVersionsResponse
 -> Maybe (NonEmpty AssociationVersionInfo))
-> (ListAssociationVersionsResponse
    -> Maybe (NonEmpty AssociationVersionInfo)
    -> ListAssociationVersionsResponse)
-> Lens'
     ListAssociationVersionsResponse
     (Maybe (NonEmpty AssociationVersionInfo))
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) ((Maybe (NonEmpty AssociationVersionInfo)
  -> f (Maybe (NonEmpty AssociationVersionInfo)))
 -> ListAssociationVersionsResponse
 -> f ListAssociationVersionsResponse)
-> ((Maybe (NonEmpty AssociationVersionInfo)
     -> f (Maybe (NonEmpty AssociationVersionInfo)))
    -> Maybe (NonEmpty AssociationVersionInfo)
    -> f (Maybe (NonEmpty AssociationVersionInfo)))
-> (Maybe (NonEmpty AssociationVersionInfo)
    -> f (Maybe (NonEmpty AssociationVersionInfo)))
-> ListAssociationVersionsResponse
-> f ListAssociationVersionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty AssociationVersionInfo)
  (NonEmpty AssociationVersionInfo)
  (NonEmpty AssociationVersionInfo)
  (NonEmpty AssociationVersionInfo)
-> Iso
     (Maybe (NonEmpty AssociationVersionInfo))
     (Maybe (NonEmpty AssociationVersionInfo))
     (Maybe (NonEmpty AssociationVersionInfo))
     (Maybe (NonEmpty AssociationVersionInfo))
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
  (NonEmpty AssociationVersionInfo)
  (NonEmpty AssociationVersionInfo)
  (NonEmpty AssociationVersionInfo)
  (NonEmpty AssociationVersionInfo)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
listAssociationVersionsResponse_httpStatus :: Lens.Lens' ListAssociationVersionsResponse Prelude.Int
listAssociationVersionsResponse_httpStatus :: (Int -> f Int)
-> ListAssociationVersionsResponse
-> f ListAssociationVersionsResponse
listAssociationVersionsResponse_httpStatus = (ListAssociationVersionsResponse -> Int)
-> (ListAssociationVersionsResponse
    -> Int -> ListAssociationVersionsResponse)
-> Lens
     ListAssociationVersionsResponse
     ListAssociationVersionsResponse
     Int
     Int
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