{-# 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.GreengrassV2.ListInstalledComponents
-- 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 a paginated list of the components that a Greengrass core
-- device runs.
--
-- This operation returns paginated results.
module Amazonka.GreengrassV2.ListInstalledComponents
  ( -- * Creating a Request
    ListInstalledComponents (..),
    newListInstalledComponents,

    -- * Request Lenses
    listInstalledComponents_nextToken,
    listInstalledComponents_maxResults,
    listInstalledComponents_coreDeviceThingName,

    -- * Destructuring the Response
    ListInstalledComponentsResponse (..),
    newListInstalledComponentsResponse,

    -- * Response Lenses
    listInstalledComponentsResponse_installedComponents,
    listInstalledComponentsResponse_nextToken,
    listInstalledComponentsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.GreengrassV2.Types
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:/ 'newListInstalledComponents' smart constructor.
data ListInstalledComponents = ListInstalledComponents'
  { -- | The token to be used for the next set of paginated results.
    ListInstalledComponents -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to be returned per paginated request.
    ListInstalledComponents -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The name of the core device. This is also the name of the IoT thing.
    ListInstalledComponents -> Text
coreDeviceThingName :: Prelude.Text
  }
  deriving (ListInstalledComponents -> ListInstalledComponents -> Bool
(ListInstalledComponents -> ListInstalledComponents -> Bool)
-> (ListInstalledComponents -> ListInstalledComponents -> Bool)
-> Eq ListInstalledComponents
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListInstalledComponents -> ListInstalledComponents -> Bool
$c/= :: ListInstalledComponents -> ListInstalledComponents -> Bool
== :: ListInstalledComponents -> ListInstalledComponents -> Bool
$c== :: ListInstalledComponents -> ListInstalledComponents -> Bool
Prelude.Eq, ReadPrec [ListInstalledComponents]
ReadPrec ListInstalledComponents
Int -> ReadS ListInstalledComponents
ReadS [ListInstalledComponents]
(Int -> ReadS ListInstalledComponents)
-> ReadS [ListInstalledComponents]
-> ReadPrec ListInstalledComponents
-> ReadPrec [ListInstalledComponents]
-> Read ListInstalledComponents
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListInstalledComponents]
$creadListPrec :: ReadPrec [ListInstalledComponents]
readPrec :: ReadPrec ListInstalledComponents
$creadPrec :: ReadPrec ListInstalledComponents
readList :: ReadS [ListInstalledComponents]
$creadList :: ReadS [ListInstalledComponents]
readsPrec :: Int -> ReadS ListInstalledComponents
$creadsPrec :: Int -> ReadS ListInstalledComponents
Prelude.Read, Int -> ListInstalledComponents -> ShowS
[ListInstalledComponents] -> ShowS
ListInstalledComponents -> String
(Int -> ListInstalledComponents -> ShowS)
-> (ListInstalledComponents -> String)
-> ([ListInstalledComponents] -> ShowS)
-> Show ListInstalledComponents
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListInstalledComponents] -> ShowS
$cshowList :: [ListInstalledComponents] -> ShowS
show :: ListInstalledComponents -> String
$cshow :: ListInstalledComponents -> String
showsPrec :: Int -> ListInstalledComponents -> ShowS
$cshowsPrec :: Int -> ListInstalledComponents -> ShowS
Prelude.Show, (forall x.
 ListInstalledComponents -> Rep ListInstalledComponents x)
-> (forall x.
    Rep ListInstalledComponents x -> ListInstalledComponents)
-> Generic ListInstalledComponents
forall x. Rep ListInstalledComponents x -> ListInstalledComponents
forall x. ListInstalledComponents -> Rep ListInstalledComponents x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListInstalledComponents x -> ListInstalledComponents
$cfrom :: forall x. ListInstalledComponents -> Rep ListInstalledComponents x
Prelude.Generic)

-- |
-- Create a value of 'ListInstalledComponents' 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', 'listInstalledComponents_nextToken' - The token to be used for the next set of paginated results.
--
-- 'maxResults', 'listInstalledComponents_maxResults' - The maximum number of results to be returned per paginated request.
--
-- 'coreDeviceThingName', 'listInstalledComponents_coreDeviceThingName' - The name of the core device. This is also the name of the IoT thing.
newListInstalledComponents ::
  -- | 'coreDeviceThingName'
  Prelude.Text ->
  ListInstalledComponents
newListInstalledComponents :: Text -> ListInstalledComponents
newListInstalledComponents Text
pCoreDeviceThingName_ =
  ListInstalledComponents' :: Maybe Text -> Maybe Natural -> Text -> ListInstalledComponents
ListInstalledComponents'
    { $sel:nextToken:ListInstalledComponents' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListInstalledComponents' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:coreDeviceThingName:ListInstalledComponents' :: Text
coreDeviceThingName = Text
pCoreDeviceThingName_
    }

-- | The token to be used for the next set of paginated results.
listInstalledComponents_nextToken :: Lens.Lens' ListInstalledComponents (Prelude.Maybe Prelude.Text)
listInstalledComponents_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListInstalledComponents -> f ListInstalledComponents
listInstalledComponents_nextToken = (ListInstalledComponents -> Maybe Text)
-> (ListInstalledComponents
    -> Maybe Text -> ListInstalledComponents)
-> Lens
     ListInstalledComponents
     ListInstalledComponents
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstalledComponents' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListInstalledComponents' :: ListInstalledComponents -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListInstalledComponents
s@ListInstalledComponents' {} Maybe Text
a -> ListInstalledComponents
s {$sel:nextToken:ListInstalledComponents' :: Maybe Text
nextToken = Maybe Text
a} :: ListInstalledComponents)

-- | The maximum number of results to be returned per paginated request.
listInstalledComponents_maxResults :: Lens.Lens' ListInstalledComponents (Prelude.Maybe Prelude.Natural)
listInstalledComponents_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListInstalledComponents -> f ListInstalledComponents
listInstalledComponents_maxResults = (ListInstalledComponents -> Maybe Natural)
-> (ListInstalledComponents
    -> Maybe Natural -> ListInstalledComponents)
-> Lens
     ListInstalledComponents
     ListInstalledComponents
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstalledComponents' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListInstalledComponents' :: ListInstalledComponents -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListInstalledComponents
s@ListInstalledComponents' {} Maybe Natural
a -> ListInstalledComponents
s {$sel:maxResults:ListInstalledComponents' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListInstalledComponents)

-- | The name of the core device. This is also the name of the IoT thing.
listInstalledComponents_coreDeviceThingName :: Lens.Lens' ListInstalledComponents Prelude.Text
listInstalledComponents_coreDeviceThingName :: (Text -> f Text)
-> ListInstalledComponents -> f ListInstalledComponents
listInstalledComponents_coreDeviceThingName = (ListInstalledComponents -> Text)
-> (ListInstalledComponents -> Text -> ListInstalledComponents)
-> Lens ListInstalledComponents ListInstalledComponents Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstalledComponents' {Text
coreDeviceThingName :: Text
$sel:coreDeviceThingName:ListInstalledComponents' :: ListInstalledComponents -> Text
coreDeviceThingName} -> Text
coreDeviceThingName) (\s :: ListInstalledComponents
s@ListInstalledComponents' {} Text
a -> ListInstalledComponents
s {$sel:coreDeviceThingName:ListInstalledComponents' :: Text
coreDeviceThingName = Text
a} :: ListInstalledComponents)

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

instance Prelude.NFData ListInstalledComponents

instance Core.ToHeaders ListInstalledComponents where
  toHeaders :: ListInstalledComponents -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListInstalledComponents -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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.ToPath ListInstalledComponents where
  toPath :: ListInstalledComponents -> ByteString
toPath ListInstalledComponents' {Maybe Natural
Maybe Text
Text
coreDeviceThingName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:coreDeviceThingName:ListInstalledComponents' :: ListInstalledComponents -> Text
$sel:maxResults:ListInstalledComponents' :: ListInstalledComponents -> Maybe Natural
$sel:nextToken:ListInstalledComponents' :: ListInstalledComponents -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/greengrass/v2/coreDevices/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
coreDeviceThingName,
        ByteString
"/installedComponents"
      ]

instance Core.ToQuery ListInstalledComponents where
  toQuery :: ListInstalledComponents -> QueryString
toQuery ListInstalledComponents' {Maybe Natural
Maybe Text
Text
coreDeviceThingName :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:coreDeviceThingName:ListInstalledComponents' :: ListInstalledComponents -> Text
$sel:maxResults:ListInstalledComponents' :: ListInstalledComponents -> Maybe Natural
$sel:nextToken:ListInstalledComponents' :: ListInstalledComponents -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListInstalledComponentsResponse' smart constructor.
data ListInstalledComponentsResponse = ListInstalledComponentsResponse'
  { -- | A list that summarizes each component on the core device.
    ListInstalledComponentsResponse -> Maybe [InstalledComponent]
installedComponents :: Prelude.Maybe [InstalledComponent],
    -- | The token for the next set of results, or null if there are no
    -- additional results.
    ListInstalledComponentsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListInstalledComponentsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListInstalledComponentsResponse
-> ListInstalledComponentsResponse -> Bool
(ListInstalledComponentsResponse
 -> ListInstalledComponentsResponse -> Bool)
-> (ListInstalledComponentsResponse
    -> ListInstalledComponentsResponse -> Bool)
-> Eq ListInstalledComponentsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListInstalledComponentsResponse
-> ListInstalledComponentsResponse -> Bool
$c/= :: ListInstalledComponentsResponse
-> ListInstalledComponentsResponse -> Bool
== :: ListInstalledComponentsResponse
-> ListInstalledComponentsResponse -> Bool
$c== :: ListInstalledComponentsResponse
-> ListInstalledComponentsResponse -> Bool
Prelude.Eq, ReadPrec [ListInstalledComponentsResponse]
ReadPrec ListInstalledComponentsResponse
Int -> ReadS ListInstalledComponentsResponse
ReadS [ListInstalledComponentsResponse]
(Int -> ReadS ListInstalledComponentsResponse)
-> ReadS [ListInstalledComponentsResponse]
-> ReadPrec ListInstalledComponentsResponse
-> ReadPrec [ListInstalledComponentsResponse]
-> Read ListInstalledComponentsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListInstalledComponentsResponse]
$creadListPrec :: ReadPrec [ListInstalledComponentsResponse]
readPrec :: ReadPrec ListInstalledComponentsResponse
$creadPrec :: ReadPrec ListInstalledComponentsResponse
readList :: ReadS [ListInstalledComponentsResponse]
$creadList :: ReadS [ListInstalledComponentsResponse]
readsPrec :: Int -> ReadS ListInstalledComponentsResponse
$creadsPrec :: Int -> ReadS ListInstalledComponentsResponse
Prelude.Read, Int -> ListInstalledComponentsResponse -> ShowS
[ListInstalledComponentsResponse] -> ShowS
ListInstalledComponentsResponse -> String
(Int -> ListInstalledComponentsResponse -> ShowS)
-> (ListInstalledComponentsResponse -> String)
-> ([ListInstalledComponentsResponse] -> ShowS)
-> Show ListInstalledComponentsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListInstalledComponentsResponse] -> ShowS
$cshowList :: [ListInstalledComponentsResponse] -> ShowS
show :: ListInstalledComponentsResponse -> String
$cshow :: ListInstalledComponentsResponse -> String
showsPrec :: Int -> ListInstalledComponentsResponse -> ShowS
$cshowsPrec :: Int -> ListInstalledComponentsResponse -> ShowS
Prelude.Show, (forall x.
 ListInstalledComponentsResponse
 -> Rep ListInstalledComponentsResponse x)
-> (forall x.
    Rep ListInstalledComponentsResponse x
    -> ListInstalledComponentsResponse)
-> Generic ListInstalledComponentsResponse
forall x.
Rep ListInstalledComponentsResponse x
-> ListInstalledComponentsResponse
forall x.
ListInstalledComponentsResponse
-> Rep ListInstalledComponentsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListInstalledComponentsResponse x
-> ListInstalledComponentsResponse
$cfrom :: forall x.
ListInstalledComponentsResponse
-> Rep ListInstalledComponentsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListInstalledComponentsResponse' 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:
--
-- 'installedComponents', 'listInstalledComponentsResponse_installedComponents' - A list that summarizes each component on the core device.
--
-- 'nextToken', 'listInstalledComponentsResponse_nextToken' - The token for the next set of results, or null if there are no
-- additional results.
--
-- 'httpStatus', 'listInstalledComponentsResponse_httpStatus' - The response's http status code.
newListInstalledComponentsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListInstalledComponentsResponse
newListInstalledComponentsResponse :: Int -> ListInstalledComponentsResponse
newListInstalledComponentsResponse Int
pHttpStatus_ =
  ListInstalledComponentsResponse' :: Maybe [InstalledComponent]
-> Maybe Text -> Int -> ListInstalledComponentsResponse
ListInstalledComponentsResponse'
    { $sel:installedComponents:ListInstalledComponentsResponse' :: Maybe [InstalledComponent]
installedComponents =
        Maybe [InstalledComponent]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListInstalledComponentsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListInstalledComponentsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list that summarizes each component on the core device.
listInstalledComponentsResponse_installedComponents :: Lens.Lens' ListInstalledComponentsResponse (Prelude.Maybe [InstalledComponent])
listInstalledComponentsResponse_installedComponents :: (Maybe [InstalledComponent] -> f (Maybe [InstalledComponent]))
-> ListInstalledComponentsResponse
-> f ListInstalledComponentsResponse
listInstalledComponentsResponse_installedComponents = (ListInstalledComponentsResponse -> Maybe [InstalledComponent])
-> (ListInstalledComponentsResponse
    -> Maybe [InstalledComponent] -> ListInstalledComponentsResponse)
-> Lens'
     ListInstalledComponentsResponse (Maybe [InstalledComponent])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstalledComponentsResponse' {Maybe [InstalledComponent]
installedComponents :: Maybe [InstalledComponent]
$sel:installedComponents:ListInstalledComponentsResponse' :: ListInstalledComponentsResponse -> Maybe [InstalledComponent]
installedComponents} -> Maybe [InstalledComponent]
installedComponents) (\s :: ListInstalledComponentsResponse
s@ListInstalledComponentsResponse' {} Maybe [InstalledComponent]
a -> ListInstalledComponentsResponse
s {$sel:installedComponents:ListInstalledComponentsResponse' :: Maybe [InstalledComponent]
installedComponents = Maybe [InstalledComponent]
a} :: ListInstalledComponentsResponse) ((Maybe [InstalledComponent] -> f (Maybe [InstalledComponent]))
 -> ListInstalledComponentsResponse
 -> f ListInstalledComponentsResponse)
-> ((Maybe [InstalledComponent] -> f (Maybe [InstalledComponent]))
    -> Maybe [InstalledComponent] -> f (Maybe [InstalledComponent]))
-> (Maybe [InstalledComponent] -> f (Maybe [InstalledComponent]))
-> ListInstalledComponentsResponse
-> f ListInstalledComponentsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [InstalledComponent]
  [InstalledComponent]
  [InstalledComponent]
  [InstalledComponent]
-> Iso
     (Maybe [InstalledComponent])
     (Maybe [InstalledComponent])
     (Maybe [InstalledComponent])
     (Maybe [InstalledComponent])
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
  [InstalledComponent]
  [InstalledComponent]
  [InstalledComponent]
  [InstalledComponent]
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 results, or null if there are no
-- additional results.
listInstalledComponentsResponse_nextToken :: Lens.Lens' ListInstalledComponentsResponse (Prelude.Maybe Prelude.Text)
listInstalledComponentsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListInstalledComponentsResponse
-> f ListInstalledComponentsResponse
listInstalledComponentsResponse_nextToken = (ListInstalledComponentsResponse -> Maybe Text)
-> (ListInstalledComponentsResponse
    -> Maybe Text -> ListInstalledComponentsResponse)
-> Lens' ListInstalledComponentsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstalledComponentsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListInstalledComponentsResponse' :: ListInstalledComponentsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListInstalledComponentsResponse
s@ListInstalledComponentsResponse' {} Maybe Text
a -> ListInstalledComponentsResponse
s {$sel:nextToken:ListInstalledComponentsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListInstalledComponentsResponse)

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

instance
  Prelude.NFData
    ListInstalledComponentsResponse