{-# 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.DescribeActivations
-- 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)
--
-- Describes details about the activation, such as the date and time the
-- activation was created, its expiration date, the Identity and Access
-- Management (IAM) role assigned to the instances in the activation, and
-- the number of instances registered by using this activation.
--
-- This operation returns paginated results.
module Amazonka.SSM.DescribeActivations
  ( -- * Creating a Request
    DescribeActivations (..),
    newDescribeActivations,

    -- * Request Lenses
    describeActivations_filters,
    describeActivations_nextToken,
    describeActivations_maxResults,

    -- * Destructuring the Response
    DescribeActivationsResponse (..),
    newDescribeActivationsResponse,

    -- * Response Lenses
    describeActivationsResponse_activationList,
    describeActivationsResponse_nextToken,
    describeActivationsResponse_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:/ 'newDescribeActivations' smart constructor.
data DescribeActivations = DescribeActivations'
  { -- | A filter to view information about your activations.
    DescribeActivations -> Maybe [DescribeActivationsFilter]
filters :: Prelude.Maybe [DescribeActivationsFilter],
    -- | A token to start the list. Use this token to get the next set of
    -- results.
    DescribeActivations -> 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.
    DescribeActivations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (DescribeActivations -> DescribeActivations -> Bool
(DescribeActivations -> DescribeActivations -> Bool)
-> (DescribeActivations -> DescribeActivations -> Bool)
-> Eq DescribeActivations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeActivations -> DescribeActivations -> Bool
$c/= :: DescribeActivations -> DescribeActivations -> Bool
== :: DescribeActivations -> DescribeActivations -> Bool
$c== :: DescribeActivations -> DescribeActivations -> Bool
Prelude.Eq, ReadPrec [DescribeActivations]
ReadPrec DescribeActivations
Int -> ReadS DescribeActivations
ReadS [DescribeActivations]
(Int -> ReadS DescribeActivations)
-> ReadS [DescribeActivations]
-> ReadPrec DescribeActivations
-> ReadPrec [DescribeActivations]
-> Read DescribeActivations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeActivations]
$creadListPrec :: ReadPrec [DescribeActivations]
readPrec :: ReadPrec DescribeActivations
$creadPrec :: ReadPrec DescribeActivations
readList :: ReadS [DescribeActivations]
$creadList :: ReadS [DescribeActivations]
readsPrec :: Int -> ReadS DescribeActivations
$creadsPrec :: Int -> ReadS DescribeActivations
Prelude.Read, Int -> DescribeActivations -> ShowS
[DescribeActivations] -> ShowS
DescribeActivations -> String
(Int -> DescribeActivations -> ShowS)
-> (DescribeActivations -> String)
-> ([DescribeActivations] -> ShowS)
-> Show DescribeActivations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeActivations] -> ShowS
$cshowList :: [DescribeActivations] -> ShowS
show :: DescribeActivations -> String
$cshow :: DescribeActivations -> String
showsPrec :: Int -> DescribeActivations -> ShowS
$cshowsPrec :: Int -> DescribeActivations -> ShowS
Prelude.Show, (forall x. DescribeActivations -> Rep DescribeActivations x)
-> (forall x. Rep DescribeActivations x -> DescribeActivations)
-> Generic DescribeActivations
forall x. Rep DescribeActivations x -> DescribeActivations
forall x. DescribeActivations -> Rep DescribeActivations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeActivations x -> DescribeActivations
$cfrom :: forall x. DescribeActivations -> Rep DescribeActivations x
Prelude.Generic)

-- |
-- Create a value of 'DescribeActivations' 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:
--
-- 'filters', 'describeActivations_filters' - A filter to view information about your activations.
--
-- 'nextToken', 'describeActivations_nextToken' - A token to start the list. Use this token to get the next set of
-- results.
--
-- 'maxResults', 'describeActivations_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.
newDescribeActivations ::
  DescribeActivations
newDescribeActivations :: DescribeActivations
newDescribeActivations =
  DescribeActivations' :: Maybe [DescribeActivationsFilter]
-> Maybe Text -> Maybe Natural -> DescribeActivations
DescribeActivations'
    { $sel:filters:DescribeActivations' :: Maybe [DescribeActivationsFilter]
filters = Maybe [DescribeActivationsFilter]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeActivations' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeActivations' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | A filter to view information about your activations.
describeActivations_filters :: Lens.Lens' DescribeActivations (Prelude.Maybe [DescribeActivationsFilter])
describeActivations_filters :: (Maybe [DescribeActivationsFilter]
 -> f (Maybe [DescribeActivationsFilter]))
-> DescribeActivations -> f DescribeActivations
describeActivations_filters = (DescribeActivations -> Maybe [DescribeActivationsFilter])
-> (DescribeActivations
    -> Maybe [DescribeActivationsFilter] -> DescribeActivations)
-> Lens
     DescribeActivations
     DescribeActivations
     (Maybe [DescribeActivationsFilter])
     (Maybe [DescribeActivationsFilter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeActivations' {Maybe [DescribeActivationsFilter]
filters :: Maybe [DescribeActivationsFilter]
$sel:filters:DescribeActivations' :: DescribeActivations -> Maybe [DescribeActivationsFilter]
filters} -> Maybe [DescribeActivationsFilter]
filters) (\s :: DescribeActivations
s@DescribeActivations' {} Maybe [DescribeActivationsFilter]
a -> DescribeActivations
s {$sel:filters:DescribeActivations' :: Maybe [DescribeActivationsFilter]
filters = Maybe [DescribeActivationsFilter]
a} :: DescribeActivations) ((Maybe [DescribeActivationsFilter]
  -> f (Maybe [DescribeActivationsFilter]))
 -> DescribeActivations -> f DescribeActivations)
-> ((Maybe [DescribeActivationsFilter]
     -> f (Maybe [DescribeActivationsFilter]))
    -> Maybe [DescribeActivationsFilter]
    -> f (Maybe [DescribeActivationsFilter]))
-> (Maybe [DescribeActivationsFilter]
    -> f (Maybe [DescribeActivationsFilter]))
-> DescribeActivations
-> f DescribeActivations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DescribeActivationsFilter]
  [DescribeActivationsFilter]
  [DescribeActivationsFilter]
  [DescribeActivationsFilter]
-> Iso
     (Maybe [DescribeActivationsFilter])
     (Maybe [DescribeActivationsFilter])
     (Maybe [DescribeActivationsFilter])
     (Maybe [DescribeActivationsFilter])
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
  [DescribeActivationsFilter]
  [DescribeActivationsFilter]
  [DescribeActivationsFilter]
  [DescribeActivationsFilter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A token to start the list. Use this token to get the next set of
-- results.
describeActivations_nextToken :: Lens.Lens' DescribeActivations (Prelude.Maybe Prelude.Text)
describeActivations_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeActivations -> f DescribeActivations
describeActivations_nextToken = (DescribeActivations -> Maybe Text)
-> (DescribeActivations -> Maybe Text -> DescribeActivations)
-> Lens
     DescribeActivations DescribeActivations (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeActivations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeActivations' :: DescribeActivations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeActivations
s@DescribeActivations' {} Maybe Text
a -> DescribeActivations
s {$sel:nextToken:DescribeActivations' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeActivations)

-- | 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.
describeActivations_maxResults :: Lens.Lens' DescribeActivations (Prelude.Maybe Prelude.Natural)
describeActivations_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> DescribeActivations -> f DescribeActivations
describeActivations_maxResults = (DescribeActivations -> Maybe Natural)
-> (DescribeActivations -> Maybe Natural -> DescribeActivations)
-> Lens
     DescribeActivations
     DescribeActivations
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeActivations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeActivations' :: DescribeActivations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeActivations
s@DescribeActivations' {} Maybe Natural
a -> DescribeActivations
s {$sel:maxResults:DescribeActivations' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeActivations)

instance Core.AWSPager DescribeActivations where
  page :: DescribeActivations
-> AWSResponse DescribeActivations -> Maybe DescribeActivations
page DescribeActivations
rq AWSResponse DescribeActivations
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeActivations
DescribeActivationsResponse
rs
            DescribeActivationsResponse
-> Getting (First Text) DescribeActivationsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeActivationsResponse
-> Const (First Text) DescribeActivationsResponse
Lens' DescribeActivationsResponse (Maybe Text)
describeActivationsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeActivationsResponse
 -> Const (First Text) DescribeActivationsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeActivationsResponse 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 DescribeActivations
forall a. Maybe a
Prelude.Nothing
    | Maybe [Activation] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeActivations
DescribeActivationsResponse
rs
            DescribeActivationsResponse
-> Getting
     (First [Activation]) DescribeActivationsResponse [Activation]
-> Maybe [Activation]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Activation]
 -> Const (First [Activation]) (Maybe [Activation]))
-> DescribeActivationsResponse
-> Const (First [Activation]) DescribeActivationsResponse
Lens' DescribeActivationsResponse (Maybe [Activation])
describeActivationsResponse_activationList
              ((Maybe [Activation]
  -> Const (First [Activation]) (Maybe [Activation]))
 -> DescribeActivationsResponse
 -> Const (First [Activation]) DescribeActivationsResponse)
-> (([Activation] -> Const (First [Activation]) [Activation])
    -> Maybe [Activation]
    -> Const (First [Activation]) (Maybe [Activation]))
-> Getting
     (First [Activation]) DescribeActivationsResponse [Activation]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Activation] -> Const (First [Activation]) [Activation])
-> Maybe [Activation]
-> Const (First [Activation]) (Maybe [Activation])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeActivations
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeActivations -> Maybe DescribeActivations
forall a. a -> Maybe a
Prelude.Just (DescribeActivations -> Maybe DescribeActivations)
-> DescribeActivations -> Maybe DescribeActivations
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeActivations
rq
          DescribeActivations
-> (DescribeActivations -> DescribeActivations)
-> DescribeActivations
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeActivations -> Identity DescribeActivations
Lens
  DescribeActivations DescribeActivations (Maybe Text) (Maybe Text)
describeActivations_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeActivations -> Identity DescribeActivations)
-> Maybe Text -> DescribeActivations -> DescribeActivations
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeActivations
DescribeActivationsResponse
rs
          DescribeActivationsResponse
-> Getting (First Text) DescribeActivationsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeActivationsResponse
-> Const (First Text) DescribeActivationsResponse
Lens' DescribeActivationsResponse (Maybe Text)
describeActivationsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeActivationsResponse
 -> Const (First Text) DescribeActivationsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeActivationsResponse 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 DescribeActivations where
  type
    AWSResponse DescribeActivations =
      DescribeActivationsResponse
  request :: DescribeActivations -> Request DescribeActivations
request = Service -> DescribeActivations -> Request DescribeActivations
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeActivations
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeActivations)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeActivations))
-> Logger
-> Service
-> Proxy DescribeActivations
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeActivations)))
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 [Activation]
-> Maybe Text -> Int -> DescribeActivationsResponse
DescribeActivationsResponse'
            (Maybe [Activation]
 -> Maybe Text -> Int -> DescribeActivationsResponse)
-> Either String (Maybe [Activation])
-> Either String (Maybe Text -> Int -> DescribeActivationsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [Activation]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ActivationList" Either String (Maybe (Maybe [Activation]))
-> Maybe [Activation] -> Either String (Maybe [Activation])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Activation]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> DescribeActivationsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeActivationsResponse)
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 -> DescribeActivationsResponse)
-> Either String Int -> Either String DescribeActivationsResponse
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 DescribeActivations

instance Prelude.NFData DescribeActivations

instance Core.ToHeaders DescribeActivations where
  toHeaders :: DescribeActivations -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeActivations -> 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.DescribeActivations" ::
                          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 DescribeActivations where
  toJSON :: DescribeActivations -> Value
toJSON DescribeActivations' {Maybe Natural
Maybe [DescribeActivationsFilter]
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
filters :: Maybe [DescribeActivationsFilter]
$sel:maxResults:DescribeActivations' :: DescribeActivations -> Maybe Natural
$sel:nextToken:DescribeActivations' :: DescribeActivations -> Maybe Text
$sel:filters:DescribeActivations' :: DescribeActivations -> Maybe [DescribeActivationsFilter]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Filters" Text -> [DescribeActivationsFilter] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([DescribeActivationsFilter] -> Pair)
-> Maybe [DescribeActivationsFilter] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [DescribeActivationsFilter]
filters,
            (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
          ]
      )

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

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

-- | /See:/ 'newDescribeActivationsResponse' smart constructor.
data DescribeActivationsResponse = DescribeActivationsResponse'
  { -- | A list of activations for your Amazon Web Services account.
    DescribeActivationsResponse -> Maybe [Activation]
activationList :: Prelude.Maybe [Activation],
    -- | The token for the next set of items to return. Use this token to get the
    -- next set of results.
    DescribeActivationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeActivationsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeActivationsResponse -> DescribeActivationsResponse -> Bool
(DescribeActivationsResponse
 -> DescribeActivationsResponse -> Bool)
-> (DescribeActivationsResponse
    -> DescribeActivationsResponse -> Bool)
-> Eq DescribeActivationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeActivationsResponse -> DescribeActivationsResponse -> Bool
$c/= :: DescribeActivationsResponse -> DescribeActivationsResponse -> Bool
== :: DescribeActivationsResponse -> DescribeActivationsResponse -> Bool
$c== :: DescribeActivationsResponse -> DescribeActivationsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeActivationsResponse]
ReadPrec DescribeActivationsResponse
Int -> ReadS DescribeActivationsResponse
ReadS [DescribeActivationsResponse]
(Int -> ReadS DescribeActivationsResponse)
-> ReadS [DescribeActivationsResponse]
-> ReadPrec DescribeActivationsResponse
-> ReadPrec [DescribeActivationsResponse]
-> Read DescribeActivationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeActivationsResponse]
$creadListPrec :: ReadPrec [DescribeActivationsResponse]
readPrec :: ReadPrec DescribeActivationsResponse
$creadPrec :: ReadPrec DescribeActivationsResponse
readList :: ReadS [DescribeActivationsResponse]
$creadList :: ReadS [DescribeActivationsResponse]
readsPrec :: Int -> ReadS DescribeActivationsResponse
$creadsPrec :: Int -> ReadS DescribeActivationsResponse
Prelude.Read, Int -> DescribeActivationsResponse -> ShowS
[DescribeActivationsResponse] -> ShowS
DescribeActivationsResponse -> String
(Int -> DescribeActivationsResponse -> ShowS)
-> (DescribeActivationsResponse -> String)
-> ([DescribeActivationsResponse] -> ShowS)
-> Show DescribeActivationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeActivationsResponse] -> ShowS
$cshowList :: [DescribeActivationsResponse] -> ShowS
show :: DescribeActivationsResponse -> String
$cshow :: DescribeActivationsResponse -> String
showsPrec :: Int -> DescribeActivationsResponse -> ShowS
$cshowsPrec :: Int -> DescribeActivationsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeActivationsResponse -> Rep DescribeActivationsResponse x)
-> (forall x.
    Rep DescribeActivationsResponse x -> DescribeActivationsResponse)
-> Generic DescribeActivationsResponse
forall x.
Rep DescribeActivationsResponse x -> DescribeActivationsResponse
forall x.
DescribeActivationsResponse -> Rep DescribeActivationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeActivationsResponse x -> DescribeActivationsResponse
$cfrom :: forall x.
DescribeActivationsResponse -> Rep DescribeActivationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeActivationsResponse' 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:
--
-- 'activationList', 'describeActivationsResponse_activationList' - A list of activations for your Amazon Web Services account.
--
-- 'nextToken', 'describeActivationsResponse_nextToken' - The token for the next set of items to return. Use this token to get the
-- next set of results.
--
-- 'httpStatus', 'describeActivationsResponse_httpStatus' - The response's http status code.
newDescribeActivationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeActivationsResponse
newDescribeActivationsResponse :: Int -> DescribeActivationsResponse
newDescribeActivationsResponse Int
pHttpStatus_ =
  DescribeActivationsResponse' :: Maybe [Activation]
-> Maybe Text -> Int -> DescribeActivationsResponse
DescribeActivationsResponse'
    { $sel:activationList:DescribeActivationsResponse' :: Maybe [Activation]
activationList =
        Maybe [Activation]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeActivationsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeActivationsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of activations for your Amazon Web Services account.
describeActivationsResponse_activationList :: Lens.Lens' DescribeActivationsResponse (Prelude.Maybe [Activation])
describeActivationsResponse_activationList :: (Maybe [Activation] -> f (Maybe [Activation]))
-> DescribeActivationsResponse -> f DescribeActivationsResponse
describeActivationsResponse_activationList = (DescribeActivationsResponse -> Maybe [Activation])
-> (DescribeActivationsResponse
    -> Maybe [Activation] -> DescribeActivationsResponse)
-> Lens' DescribeActivationsResponse (Maybe [Activation])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeActivationsResponse' {Maybe [Activation]
activationList :: Maybe [Activation]
$sel:activationList:DescribeActivationsResponse' :: DescribeActivationsResponse -> Maybe [Activation]
activationList} -> Maybe [Activation]
activationList) (\s :: DescribeActivationsResponse
s@DescribeActivationsResponse' {} Maybe [Activation]
a -> DescribeActivationsResponse
s {$sel:activationList:DescribeActivationsResponse' :: Maybe [Activation]
activationList = Maybe [Activation]
a} :: DescribeActivationsResponse) ((Maybe [Activation] -> f (Maybe [Activation]))
 -> DescribeActivationsResponse -> f DescribeActivationsResponse)
-> ((Maybe [Activation] -> f (Maybe [Activation]))
    -> Maybe [Activation] -> f (Maybe [Activation]))
-> (Maybe [Activation] -> f (Maybe [Activation]))
-> DescribeActivationsResponse
-> f DescribeActivationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Activation] [Activation] [Activation] [Activation]
-> Iso
     (Maybe [Activation])
     (Maybe [Activation])
     (Maybe [Activation])
     (Maybe [Activation])
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 [Activation] [Activation] [Activation] [Activation]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token for the next set of items to return. Use this token to get the
-- next set of results.
describeActivationsResponse_nextToken :: Lens.Lens' DescribeActivationsResponse (Prelude.Maybe Prelude.Text)
describeActivationsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeActivationsResponse -> f DescribeActivationsResponse
describeActivationsResponse_nextToken = (DescribeActivationsResponse -> Maybe Text)
-> (DescribeActivationsResponse
    -> Maybe Text -> DescribeActivationsResponse)
-> Lens' DescribeActivationsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeActivationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeActivationsResponse' :: DescribeActivationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeActivationsResponse
s@DescribeActivationsResponse' {} Maybe Text
a -> DescribeActivationsResponse
s {$sel:nextToken:DescribeActivationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeActivationsResponse)

-- | The response's http status code.
describeActivationsResponse_httpStatus :: Lens.Lens' DescribeActivationsResponse Prelude.Int
describeActivationsResponse_httpStatus :: (Int -> f Int)
-> DescribeActivationsResponse -> f DescribeActivationsResponse
describeActivationsResponse_httpStatus = (DescribeActivationsResponse -> Int)
-> (DescribeActivationsResponse
    -> Int -> DescribeActivationsResponse)
-> Lens
     DescribeActivationsResponse DescribeActivationsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeActivationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeActivationsResponse' :: DescribeActivationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeActivationsResponse
s@DescribeActivationsResponse' {} Int
a -> DescribeActivationsResponse
s {$sel:httpStatus:DescribeActivationsResponse' :: Int
httpStatus = Int
a} :: DescribeActivationsResponse)

instance Prelude.NFData DescribeActivationsResponse