{-# 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.AutoScaling.DescribeLaunchConfigurations
-- 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)
--
-- Gets information about the launch configurations in the account and
-- Region.
--
-- This operation returns paginated results.
module Amazonka.AutoScaling.DescribeLaunchConfigurations
  ( -- * Creating a Request
    DescribeLaunchConfigurations (..),
    newDescribeLaunchConfigurations,

    -- * Request Lenses
    describeLaunchConfigurations_launchConfigurationNames,
    describeLaunchConfigurations_nextToken,
    describeLaunchConfigurations_maxRecords,

    -- * Destructuring the Response
    DescribeLaunchConfigurationsResponse (..),
    newDescribeLaunchConfigurationsResponse,

    -- * Response Lenses
    describeLaunchConfigurationsResponse_nextToken,
    describeLaunchConfigurationsResponse_httpStatus,
    describeLaunchConfigurationsResponse_launchConfigurations,
  )
where

import Amazonka.AutoScaling.Types
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

-- | /See:/ 'newDescribeLaunchConfigurations' smart constructor.
data DescribeLaunchConfigurations = DescribeLaunchConfigurations'
  { -- | The launch configuration names. If you omit this parameter, all launch
    -- configurations are described.
    --
    -- Array Members: Maximum number of 50 items.
    DescribeLaunchConfigurations -> Maybe [Text]
launchConfigurationNames :: Prelude.Maybe [Prelude.Text],
    -- | The token for the next set of items to return. (You received this token
    -- from a previous call.)
    DescribeLaunchConfigurations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of items to return with this call. The default value
    -- is @50@ and the maximum value is @100@.
    DescribeLaunchConfigurations -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int
  }
  deriving (DescribeLaunchConfigurations
-> DescribeLaunchConfigurations -> Bool
(DescribeLaunchConfigurations
 -> DescribeLaunchConfigurations -> Bool)
-> (DescribeLaunchConfigurations
    -> DescribeLaunchConfigurations -> Bool)
-> Eq DescribeLaunchConfigurations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeLaunchConfigurations
-> DescribeLaunchConfigurations -> Bool
$c/= :: DescribeLaunchConfigurations
-> DescribeLaunchConfigurations -> Bool
== :: DescribeLaunchConfigurations
-> DescribeLaunchConfigurations -> Bool
$c== :: DescribeLaunchConfigurations
-> DescribeLaunchConfigurations -> Bool
Prelude.Eq, ReadPrec [DescribeLaunchConfigurations]
ReadPrec DescribeLaunchConfigurations
Int -> ReadS DescribeLaunchConfigurations
ReadS [DescribeLaunchConfigurations]
(Int -> ReadS DescribeLaunchConfigurations)
-> ReadS [DescribeLaunchConfigurations]
-> ReadPrec DescribeLaunchConfigurations
-> ReadPrec [DescribeLaunchConfigurations]
-> Read DescribeLaunchConfigurations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeLaunchConfigurations]
$creadListPrec :: ReadPrec [DescribeLaunchConfigurations]
readPrec :: ReadPrec DescribeLaunchConfigurations
$creadPrec :: ReadPrec DescribeLaunchConfigurations
readList :: ReadS [DescribeLaunchConfigurations]
$creadList :: ReadS [DescribeLaunchConfigurations]
readsPrec :: Int -> ReadS DescribeLaunchConfigurations
$creadsPrec :: Int -> ReadS DescribeLaunchConfigurations
Prelude.Read, Int -> DescribeLaunchConfigurations -> ShowS
[DescribeLaunchConfigurations] -> ShowS
DescribeLaunchConfigurations -> String
(Int -> DescribeLaunchConfigurations -> ShowS)
-> (DescribeLaunchConfigurations -> String)
-> ([DescribeLaunchConfigurations] -> ShowS)
-> Show DescribeLaunchConfigurations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeLaunchConfigurations] -> ShowS
$cshowList :: [DescribeLaunchConfigurations] -> ShowS
show :: DescribeLaunchConfigurations -> String
$cshow :: DescribeLaunchConfigurations -> String
showsPrec :: Int -> DescribeLaunchConfigurations -> ShowS
$cshowsPrec :: Int -> DescribeLaunchConfigurations -> ShowS
Prelude.Show, (forall x.
 DescribeLaunchConfigurations -> Rep DescribeLaunchConfigurations x)
-> (forall x.
    Rep DescribeLaunchConfigurations x -> DescribeLaunchConfigurations)
-> Generic DescribeLaunchConfigurations
forall x.
Rep DescribeLaunchConfigurations x -> DescribeLaunchConfigurations
forall x.
DescribeLaunchConfigurations -> Rep DescribeLaunchConfigurations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeLaunchConfigurations x -> DescribeLaunchConfigurations
$cfrom :: forall x.
DescribeLaunchConfigurations -> Rep DescribeLaunchConfigurations x
Prelude.Generic)

-- |
-- Create a value of 'DescribeLaunchConfigurations' 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:
--
-- 'launchConfigurationNames', 'describeLaunchConfigurations_launchConfigurationNames' - The launch configuration names. If you omit this parameter, all launch
-- configurations are described.
--
-- Array Members: Maximum number of 50 items.
--
-- 'nextToken', 'describeLaunchConfigurations_nextToken' - The token for the next set of items to return. (You received this token
-- from a previous call.)
--
-- 'maxRecords', 'describeLaunchConfigurations_maxRecords' - The maximum number of items to return with this call. The default value
-- is @50@ and the maximum value is @100@.
newDescribeLaunchConfigurations ::
  DescribeLaunchConfigurations
newDescribeLaunchConfigurations :: DescribeLaunchConfigurations
newDescribeLaunchConfigurations =
  DescribeLaunchConfigurations' :: Maybe [Text]
-> Maybe Text -> Maybe Int -> DescribeLaunchConfigurations
DescribeLaunchConfigurations'
    { $sel:launchConfigurationNames:DescribeLaunchConfigurations' :: Maybe [Text]
launchConfigurationNames =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeLaunchConfigurations' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeLaunchConfigurations' :: Maybe Int
maxRecords = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | The launch configuration names. If you omit this parameter, all launch
-- configurations are described.
--
-- Array Members: Maximum number of 50 items.
describeLaunchConfigurations_launchConfigurationNames :: Lens.Lens' DescribeLaunchConfigurations (Prelude.Maybe [Prelude.Text])
describeLaunchConfigurations_launchConfigurationNames :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeLaunchConfigurations -> f DescribeLaunchConfigurations
describeLaunchConfigurations_launchConfigurationNames = (DescribeLaunchConfigurations -> Maybe [Text])
-> (DescribeLaunchConfigurations
    -> Maybe [Text] -> DescribeLaunchConfigurations)
-> Lens
     DescribeLaunchConfigurations
     DescribeLaunchConfigurations
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLaunchConfigurations' {Maybe [Text]
launchConfigurationNames :: Maybe [Text]
$sel:launchConfigurationNames:DescribeLaunchConfigurations' :: DescribeLaunchConfigurations -> Maybe [Text]
launchConfigurationNames} -> Maybe [Text]
launchConfigurationNames) (\s :: DescribeLaunchConfigurations
s@DescribeLaunchConfigurations' {} Maybe [Text]
a -> DescribeLaunchConfigurations
s {$sel:launchConfigurationNames:DescribeLaunchConfigurations' :: Maybe [Text]
launchConfigurationNames = Maybe [Text]
a} :: DescribeLaunchConfigurations) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeLaunchConfigurations -> f DescribeLaunchConfigurations)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeLaunchConfigurations
-> f DescribeLaunchConfigurations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
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. (You received this token
-- from a previous call.)
describeLaunchConfigurations_nextToken :: Lens.Lens' DescribeLaunchConfigurations (Prelude.Maybe Prelude.Text)
describeLaunchConfigurations_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeLaunchConfigurations -> f DescribeLaunchConfigurations
describeLaunchConfigurations_nextToken = (DescribeLaunchConfigurations -> Maybe Text)
-> (DescribeLaunchConfigurations
    -> Maybe Text -> DescribeLaunchConfigurations)
-> Lens
     DescribeLaunchConfigurations
     DescribeLaunchConfigurations
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLaunchConfigurations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeLaunchConfigurations' :: DescribeLaunchConfigurations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeLaunchConfigurations
s@DescribeLaunchConfigurations' {} Maybe Text
a -> DescribeLaunchConfigurations
s {$sel:nextToken:DescribeLaunchConfigurations' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeLaunchConfigurations)

-- | The maximum number of items to return with this call. The default value
-- is @50@ and the maximum value is @100@.
describeLaunchConfigurations_maxRecords :: Lens.Lens' DescribeLaunchConfigurations (Prelude.Maybe Prelude.Int)
describeLaunchConfigurations_maxRecords :: (Maybe Int -> f (Maybe Int))
-> DescribeLaunchConfigurations -> f DescribeLaunchConfigurations
describeLaunchConfigurations_maxRecords = (DescribeLaunchConfigurations -> Maybe Int)
-> (DescribeLaunchConfigurations
    -> Maybe Int -> DescribeLaunchConfigurations)
-> Lens
     DescribeLaunchConfigurations
     DescribeLaunchConfigurations
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLaunchConfigurations' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeLaunchConfigurations' :: DescribeLaunchConfigurations -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeLaunchConfigurations
s@DescribeLaunchConfigurations' {} Maybe Int
a -> DescribeLaunchConfigurations
s {$sel:maxRecords:DescribeLaunchConfigurations' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeLaunchConfigurations)

instance Core.AWSPager DescribeLaunchConfigurations where
  page :: DescribeLaunchConfigurations
-> AWSResponse DescribeLaunchConfigurations
-> Maybe DescribeLaunchConfigurations
page DescribeLaunchConfigurations
rq AWSResponse DescribeLaunchConfigurations
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeLaunchConfigurations
DescribeLaunchConfigurationsResponse
rs
            DescribeLaunchConfigurationsResponse
-> Getting (First Text) DescribeLaunchConfigurationsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeLaunchConfigurationsResponse
-> Const (First Text) DescribeLaunchConfigurationsResponse
Lens' DescribeLaunchConfigurationsResponse (Maybe Text)
describeLaunchConfigurationsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeLaunchConfigurationsResponse
 -> Const (First Text) DescribeLaunchConfigurationsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeLaunchConfigurationsResponse 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 DescribeLaunchConfigurations
forall a. Maybe a
Prelude.Nothing
    | [LaunchConfiguration] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeLaunchConfigurations
DescribeLaunchConfigurationsResponse
rs
            DescribeLaunchConfigurationsResponse
-> Getting
     [LaunchConfiguration]
     DescribeLaunchConfigurationsResponse
     [LaunchConfiguration]
-> [LaunchConfiguration]
forall s a. s -> Getting a s a -> a
Lens.^. Getting
  [LaunchConfiguration]
  DescribeLaunchConfigurationsResponse
  [LaunchConfiguration]
Lens' DescribeLaunchConfigurationsResponse [LaunchConfiguration]
describeLaunchConfigurationsResponse_launchConfigurations
        ) =
      Maybe DescribeLaunchConfigurations
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeLaunchConfigurations -> Maybe DescribeLaunchConfigurations
forall a. a -> Maybe a
Prelude.Just (DescribeLaunchConfigurations
 -> Maybe DescribeLaunchConfigurations)
-> DescribeLaunchConfigurations
-> Maybe DescribeLaunchConfigurations
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeLaunchConfigurations
rq
          DescribeLaunchConfigurations
-> (DescribeLaunchConfigurations -> DescribeLaunchConfigurations)
-> DescribeLaunchConfigurations
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeLaunchConfigurations
-> Identity DescribeLaunchConfigurations
Lens
  DescribeLaunchConfigurations
  DescribeLaunchConfigurations
  (Maybe Text)
  (Maybe Text)
describeLaunchConfigurations_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeLaunchConfigurations
 -> Identity DescribeLaunchConfigurations)
-> Maybe Text
-> DescribeLaunchConfigurations
-> DescribeLaunchConfigurations
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeLaunchConfigurations
DescribeLaunchConfigurationsResponse
rs
          DescribeLaunchConfigurationsResponse
-> Getting (First Text) DescribeLaunchConfigurationsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeLaunchConfigurationsResponse
-> Const (First Text) DescribeLaunchConfigurationsResponse
Lens' DescribeLaunchConfigurationsResponse (Maybe Text)
describeLaunchConfigurationsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeLaunchConfigurationsResponse
 -> Const (First Text) DescribeLaunchConfigurationsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeLaunchConfigurationsResponse 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 DescribeLaunchConfigurations where
  type
    AWSResponse DescribeLaunchConfigurations =
      DescribeLaunchConfigurationsResponse
  request :: DescribeLaunchConfigurations
-> Request DescribeLaunchConfigurations
request = Service
-> DescribeLaunchConfigurations
-> Request DescribeLaunchConfigurations
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeLaunchConfigurations
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeLaunchConfigurations)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse DescribeLaunchConfigurations))
-> Logger
-> Service
-> Proxy DescribeLaunchConfigurations
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeLaunchConfigurations)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"DescribeLaunchConfigurationsResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text
-> Int
-> [LaunchConfiguration]
-> DescribeLaunchConfigurationsResponse
DescribeLaunchConfigurationsResponse'
            (Maybe Text
 -> Int
 -> [LaunchConfiguration]
 -> DescribeLaunchConfigurationsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Int
      -> [LaunchConfiguration] -> DescribeLaunchConfigurationsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"NextToken")
            Either
  String
  (Int
   -> [LaunchConfiguration] -> DescribeLaunchConfigurationsResponse)
-> Either String Int
-> Either
     String
     ([LaunchConfiguration] -> DescribeLaunchConfigurationsResponse)
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))
            Either
  String
  ([LaunchConfiguration] -> DescribeLaunchConfigurationsResponse)
-> Either String [LaunchConfiguration]
-> Either String DescribeLaunchConfigurationsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"LaunchConfigurations"
                            Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String [LaunchConfiguration])
-> Either String [LaunchConfiguration]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= Text -> [Node] -> Either String [LaunchConfiguration]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member"
                        )
      )

instance
  Prelude.Hashable
    DescribeLaunchConfigurations

instance Prelude.NFData DescribeLaunchConfigurations

instance Core.ToHeaders DescribeLaunchConfigurations where
  toHeaders :: DescribeLaunchConfigurations -> ResponseHeaders
toHeaders = ResponseHeaders -> DescribeLaunchConfigurations -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

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

instance Core.ToQuery DescribeLaunchConfigurations where
  toQuery :: DescribeLaunchConfigurations -> QueryString
toQuery DescribeLaunchConfigurations' {Maybe Int
Maybe [Text]
Maybe Text
maxRecords :: Maybe Int
nextToken :: Maybe Text
launchConfigurationNames :: Maybe [Text]
$sel:maxRecords:DescribeLaunchConfigurations' :: DescribeLaunchConfigurations -> Maybe Int
$sel:nextToken:DescribeLaunchConfigurations' :: DescribeLaunchConfigurations -> Maybe Text
$sel:launchConfigurationNames:DescribeLaunchConfigurations' :: DescribeLaunchConfigurations -> Maybe [Text]
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"DescribeLaunchConfigurations" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2011-01-01" :: Prelude.ByteString),
        ByteString
"LaunchConfigurationNames"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            ( ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member"
                ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
launchConfigurationNames
            ),
        ByteString
"NextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"MaxRecords" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
maxRecords
      ]

-- | /See:/ 'newDescribeLaunchConfigurationsResponse' smart constructor.
data DescribeLaunchConfigurationsResponse = DescribeLaunchConfigurationsResponse'
  { -- | A string that indicates that the response contains more items than can
    -- be returned in a single response. To receive additional items, specify
    -- this string for the @NextToken@ value when requesting the next set of
    -- items. This value is null when there are no more items to return.
    DescribeLaunchConfigurationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeLaunchConfigurationsResponse -> Int
httpStatus :: Prelude.Int,
    -- | The launch configurations.
    DescribeLaunchConfigurationsResponse -> [LaunchConfiguration]
launchConfigurations :: [LaunchConfiguration]
  }
  deriving (DescribeLaunchConfigurationsResponse
-> DescribeLaunchConfigurationsResponse -> Bool
(DescribeLaunchConfigurationsResponse
 -> DescribeLaunchConfigurationsResponse -> Bool)
-> (DescribeLaunchConfigurationsResponse
    -> DescribeLaunchConfigurationsResponse -> Bool)
-> Eq DescribeLaunchConfigurationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeLaunchConfigurationsResponse
-> DescribeLaunchConfigurationsResponse -> Bool
$c/= :: DescribeLaunchConfigurationsResponse
-> DescribeLaunchConfigurationsResponse -> Bool
== :: DescribeLaunchConfigurationsResponse
-> DescribeLaunchConfigurationsResponse -> Bool
$c== :: DescribeLaunchConfigurationsResponse
-> DescribeLaunchConfigurationsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeLaunchConfigurationsResponse]
ReadPrec DescribeLaunchConfigurationsResponse
Int -> ReadS DescribeLaunchConfigurationsResponse
ReadS [DescribeLaunchConfigurationsResponse]
(Int -> ReadS DescribeLaunchConfigurationsResponse)
-> ReadS [DescribeLaunchConfigurationsResponse]
-> ReadPrec DescribeLaunchConfigurationsResponse
-> ReadPrec [DescribeLaunchConfigurationsResponse]
-> Read DescribeLaunchConfigurationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeLaunchConfigurationsResponse]
$creadListPrec :: ReadPrec [DescribeLaunchConfigurationsResponse]
readPrec :: ReadPrec DescribeLaunchConfigurationsResponse
$creadPrec :: ReadPrec DescribeLaunchConfigurationsResponse
readList :: ReadS [DescribeLaunchConfigurationsResponse]
$creadList :: ReadS [DescribeLaunchConfigurationsResponse]
readsPrec :: Int -> ReadS DescribeLaunchConfigurationsResponse
$creadsPrec :: Int -> ReadS DescribeLaunchConfigurationsResponse
Prelude.Read, Int -> DescribeLaunchConfigurationsResponse -> ShowS
[DescribeLaunchConfigurationsResponse] -> ShowS
DescribeLaunchConfigurationsResponse -> String
(Int -> DescribeLaunchConfigurationsResponse -> ShowS)
-> (DescribeLaunchConfigurationsResponse -> String)
-> ([DescribeLaunchConfigurationsResponse] -> ShowS)
-> Show DescribeLaunchConfigurationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeLaunchConfigurationsResponse] -> ShowS
$cshowList :: [DescribeLaunchConfigurationsResponse] -> ShowS
show :: DescribeLaunchConfigurationsResponse -> String
$cshow :: DescribeLaunchConfigurationsResponse -> String
showsPrec :: Int -> DescribeLaunchConfigurationsResponse -> ShowS
$cshowsPrec :: Int -> DescribeLaunchConfigurationsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeLaunchConfigurationsResponse
 -> Rep DescribeLaunchConfigurationsResponse x)
-> (forall x.
    Rep DescribeLaunchConfigurationsResponse x
    -> DescribeLaunchConfigurationsResponse)
-> Generic DescribeLaunchConfigurationsResponse
forall x.
Rep DescribeLaunchConfigurationsResponse x
-> DescribeLaunchConfigurationsResponse
forall x.
DescribeLaunchConfigurationsResponse
-> Rep DescribeLaunchConfigurationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeLaunchConfigurationsResponse x
-> DescribeLaunchConfigurationsResponse
$cfrom :: forall x.
DescribeLaunchConfigurationsResponse
-> Rep DescribeLaunchConfigurationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeLaunchConfigurationsResponse' 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', 'describeLaunchConfigurationsResponse_nextToken' - A string that indicates that the response contains more items than can
-- be returned in a single response. To receive additional items, specify
-- this string for the @NextToken@ value when requesting the next set of
-- items. This value is null when there are no more items to return.
--
-- 'httpStatus', 'describeLaunchConfigurationsResponse_httpStatus' - The response's http status code.
--
-- 'launchConfigurations', 'describeLaunchConfigurationsResponse_launchConfigurations' - The launch configurations.
newDescribeLaunchConfigurationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeLaunchConfigurationsResponse
newDescribeLaunchConfigurationsResponse :: Int -> DescribeLaunchConfigurationsResponse
newDescribeLaunchConfigurationsResponse Int
pHttpStatus_ =
  DescribeLaunchConfigurationsResponse' :: Maybe Text
-> Int
-> [LaunchConfiguration]
-> DescribeLaunchConfigurationsResponse
DescribeLaunchConfigurationsResponse'
    { $sel:nextToken:DescribeLaunchConfigurationsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeLaunchConfigurationsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:launchConfigurations:DescribeLaunchConfigurationsResponse' :: [LaunchConfiguration]
launchConfigurations = [LaunchConfiguration]
forall a. Monoid a => a
Prelude.mempty
    }

-- | A string that indicates that the response contains more items than can
-- be returned in a single response. To receive additional items, specify
-- this string for the @NextToken@ value when requesting the next set of
-- items. This value is null when there are no more items to return.
describeLaunchConfigurationsResponse_nextToken :: Lens.Lens' DescribeLaunchConfigurationsResponse (Prelude.Maybe Prelude.Text)
describeLaunchConfigurationsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeLaunchConfigurationsResponse
-> f DescribeLaunchConfigurationsResponse
describeLaunchConfigurationsResponse_nextToken = (DescribeLaunchConfigurationsResponse -> Maybe Text)
-> (DescribeLaunchConfigurationsResponse
    -> Maybe Text -> DescribeLaunchConfigurationsResponse)
-> Lens' DescribeLaunchConfigurationsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLaunchConfigurationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeLaunchConfigurationsResponse' :: DescribeLaunchConfigurationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeLaunchConfigurationsResponse
s@DescribeLaunchConfigurationsResponse' {} Maybe Text
a -> DescribeLaunchConfigurationsResponse
s {$sel:nextToken:DescribeLaunchConfigurationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeLaunchConfigurationsResponse)

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

-- | The launch configurations.
describeLaunchConfigurationsResponse_launchConfigurations :: Lens.Lens' DescribeLaunchConfigurationsResponse [LaunchConfiguration]
describeLaunchConfigurationsResponse_launchConfigurations :: ([LaunchConfiguration] -> f [LaunchConfiguration])
-> DescribeLaunchConfigurationsResponse
-> f DescribeLaunchConfigurationsResponse
describeLaunchConfigurationsResponse_launchConfigurations = (DescribeLaunchConfigurationsResponse -> [LaunchConfiguration])
-> (DescribeLaunchConfigurationsResponse
    -> [LaunchConfiguration] -> DescribeLaunchConfigurationsResponse)
-> Lens' DescribeLaunchConfigurationsResponse [LaunchConfiguration]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeLaunchConfigurationsResponse' {[LaunchConfiguration]
launchConfigurations :: [LaunchConfiguration]
$sel:launchConfigurations:DescribeLaunchConfigurationsResponse' :: DescribeLaunchConfigurationsResponse -> [LaunchConfiguration]
launchConfigurations} -> [LaunchConfiguration]
launchConfigurations) (\s :: DescribeLaunchConfigurationsResponse
s@DescribeLaunchConfigurationsResponse' {} [LaunchConfiguration]
a -> DescribeLaunchConfigurationsResponse
s {$sel:launchConfigurations:DescribeLaunchConfigurationsResponse' :: [LaunchConfiguration]
launchConfigurations = [LaunchConfiguration]
a} :: DescribeLaunchConfigurationsResponse) (([LaunchConfiguration] -> f [LaunchConfiguration])
 -> DescribeLaunchConfigurationsResponse
 -> f DescribeLaunchConfigurationsResponse)
-> (([LaunchConfiguration] -> f [LaunchConfiguration])
    -> [LaunchConfiguration] -> f [LaunchConfiguration])
-> ([LaunchConfiguration] -> f [LaunchConfiguration])
-> DescribeLaunchConfigurationsResponse
-> f DescribeLaunchConfigurationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([LaunchConfiguration] -> f [LaunchConfiguration])
-> [LaunchConfiguration] -> f [LaunchConfiguration]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    DescribeLaunchConfigurationsResponse