{-# 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.DescribeInstanceInformation
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Describes one or more of your managed nodes, including information about
-- the operating system platform, the version of SSM Agent installed on the
-- managed node, node status, and so on.
--
-- If you specify one or more managed node IDs, it returns information for
-- those managed nodes. If you don\'t specify node IDs, it returns
-- information for all your managed nodes. If you specify a node ID that
-- isn\'t valid or a node that you don\'t own, you receive an error.
--
-- The @IamRole@ field for this API operation is the Identity and Access
-- Management (IAM) role assigned to on-premises managed nodes. This call
-- doesn\'t return the IAM role for EC2 instances.
--
-- This operation returns paginated results.
module Amazonka.SSM.DescribeInstanceInformation
  ( -- * Creating a Request
    DescribeInstanceInformation (..),
    newDescribeInstanceInformation,

    -- * Request Lenses
    describeInstanceInformation_filters,
    describeInstanceInformation_instanceInformationFilterList,
    describeInstanceInformation_maxResults,
    describeInstanceInformation_nextToken,

    -- * Destructuring the Response
    DescribeInstanceInformationResponse (..),
    newDescribeInstanceInformationResponse,

    -- * Response Lenses
    describeInstanceInformationResponse_instanceInformationList,
    describeInstanceInformationResponse_nextToken,
    describeInstanceInformationResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SSM.Types

-- | /See:/ 'newDescribeInstanceInformation' smart constructor.
data DescribeInstanceInformation = DescribeInstanceInformation'
  { -- | One or more filters. Use a filter to return a more specific list of
    -- managed nodes. You can filter based on tags applied to your managed
    -- nodes. Use this @Filters@ data type instead of
    -- @InstanceInformationFilterList@, which is deprecated.
    DescribeInstanceInformation
-> Maybe [InstanceInformationStringFilter]
filters :: Prelude.Maybe [InstanceInformationStringFilter],
    -- | This is a legacy method. We recommend that you don\'t use this method.
    -- Instead, use the @Filters@ data type. @Filters@ enables you to return
    -- node information by filtering based on tags applied to managed nodes.
    --
    -- Attempting to use @InstanceInformationFilterList@ and @Filters@ leads to
    -- an exception error.
    DescribeInstanceInformation -> Maybe [InstanceInformationFilter]
instanceInformationFilterList :: Prelude.Maybe [InstanceInformationFilter],
    -- | 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.
    DescribeInstanceInformation -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next set of items to return. (You received this token
    -- from a previous call.)
    DescribeInstanceInformation -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeInstanceInformation -> DescribeInstanceInformation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeInstanceInformation -> DescribeInstanceInformation -> Bool
$c/= :: DescribeInstanceInformation -> DescribeInstanceInformation -> Bool
== :: DescribeInstanceInformation -> DescribeInstanceInformation -> Bool
$c== :: DescribeInstanceInformation -> DescribeInstanceInformation -> Bool
Prelude.Eq, ReadPrec [DescribeInstanceInformation]
ReadPrec DescribeInstanceInformation
Int -> ReadS DescribeInstanceInformation
ReadS [DescribeInstanceInformation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeInstanceInformation]
$creadListPrec :: ReadPrec [DescribeInstanceInformation]
readPrec :: ReadPrec DescribeInstanceInformation
$creadPrec :: ReadPrec DescribeInstanceInformation
readList :: ReadS [DescribeInstanceInformation]
$creadList :: ReadS [DescribeInstanceInformation]
readsPrec :: Int -> ReadS DescribeInstanceInformation
$creadsPrec :: Int -> ReadS DescribeInstanceInformation
Prelude.Read, Int -> DescribeInstanceInformation -> ShowS
[DescribeInstanceInformation] -> ShowS
DescribeInstanceInformation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeInstanceInformation] -> ShowS
$cshowList :: [DescribeInstanceInformation] -> ShowS
show :: DescribeInstanceInformation -> String
$cshow :: DescribeInstanceInformation -> String
showsPrec :: Int -> DescribeInstanceInformation -> ShowS
$cshowsPrec :: Int -> DescribeInstanceInformation -> ShowS
Prelude.Show, forall x.
Rep DescribeInstanceInformation x -> DescribeInstanceInformation
forall x.
DescribeInstanceInformation -> Rep DescribeInstanceInformation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeInstanceInformation x -> DescribeInstanceInformation
$cfrom :: forall x.
DescribeInstanceInformation -> Rep DescribeInstanceInformation x
Prelude.Generic)

-- |
-- Create a value of 'DescribeInstanceInformation' 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', 'describeInstanceInformation_filters' - One or more filters. Use a filter to return a more specific list of
-- managed nodes. You can filter based on tags applied to your managed
-- nodes. Use this @Filters@ data type instead of
-- @InstanceInformationFilterList@, which is deprecated.
--
-- 'instanceInformationFilterList', 'describeInstanceInformation_instanceInformationFilterList' - This is a legacy method. We recommend that you don\'t use this method.
-- Instead, use the @Filters@ data type. @Filters@ enables you to return
-- node information by filtering based on tags applied to managed nodes.
--
-- Attempting to use @InstanceInformationFilterList@ and @Filters@ leads to
-- an exception error.
--
-- 'maxResults', 'describeInstanceInformation_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.
--
-- 'nextToken', 'describeInstanceInformation_nextToken' - The token for the next set of items to return. (You received this token
-- from a previous call.)
newDescribeInstanceInformation ::
  DescribeInstanceInformation
newDescribeInstanceInformation :: DescribeInstanceInformation
newDescribeInstanceInformation =
  DescribeInstanceInformation'
    { $sel:filters:DescribeInstanceInformation' :: Maybe [InstanceInformationStringFilter]
filters =
        forall a. Maybe a
Prelude.Nothing,
      $sel:instanceInformationFilterList:DescribeInstanceInformation' :: Maybe [InstanceInformationFilter]
instanceInformationFilterList =
        forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeInstanceInformation' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeInstanceInformation' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
    }

-- | One or more filters. Use a filter to return a more specific list of
-- managed nodes. You can filter based on tags applied to your managed
-- nodes. Use this @Filters@ data type instead of
-- @InstanceInformationFilterList@, which is deprecated.
describeInstanceInformation_filters :: Lens.Lens' DescribeInstanceInformation (Prelude.Maybe [InstanceInformationStringFilter])
describeInstanceInformation_filters :: Lens'
  DescribeInstanceInformation
  (Maybe [InstanceInformationStringFilter])
describeInstanceInformation_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstanceInformation' {Maybe [InstanceInformationStringFilter]
filters :: Maybe [InstanceInformationStringFilter]
$sel:filters:DescribeInstanceInformation' :: DescribeInstanceInformation
-> Maybe [InstanceInformationStringFilter]
filters} -> Maybe [InstanceInformationStringFilter]
filters) (\s :: DescribeInstanceInformation
s@DescribeInstanceInformation' {} Maybe [InstanceInformationStringFilter]
a -> DescribeInstanceInformation
s {$sel:filters:DescribeInstanceInformation' :: Maybe [InstanceInformationStringFilter]
filters = Maybe [InstanceInformationStringFilter]
a} :: DescribeInstanceInformation) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | This is a legacy method. We recommend that you don\'t use this method.
-- Instead, use the @Filters@ data type. @Filters@ enables you to return
-- node information by filtering based on tags applied to managed nodes.
--
-- Attempting to use @InstanceInformationFilterList@ and @Filters@ leads to
-- an exception error.
describeInstanceInformation_instanceInformationFilterList :: Lens.Lens' DescribeInstanceInformation (Prelude.Maybe [InstanceInformationFilter])
describeInstanceInformation_instanceInformationFilterList :: Lens'
  DescribeInstanceInformation (Maybe [InstanceInformationFilter])
describeInstanceInformation_instanceInformationFilterList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstanceInformation' {Maybe [InstanceInformationFilter]
instanceInformationFilterList :: Maybe [InstanceInformationFilter]
$sel:instanceInformationFilterList:DescribeInstanceInformation' :: DescribeInstanceInformation -> Maybe [InstanceInformationFilter]
instanceInformationFilterList} -> Maybe [InstanceInformationFilter]
instanceInformationFilterList) (\s :: DescribeInstanceInformation
s@DescribeInstanceInformation' {} Maybe [InstanceInformationFilter]
a -> DescribeInstanceInformation
s {$sel:instanceInformationFilterList:DescribeInstanceInformation' :: Maybe [InstanceInformationFilter]
instanceInformationFilterList = Maybe [InstanceInformationFilter]
a} :: DescribeInstanceInformation) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | The token for the next set of items to return. (You received this token
-- from a previous call.)
describeInstanceInformation_nextToken :: Lens.Lens' DescribeInstanceInformation (Prelude.Maybe Prelude.Text)
describeInstanceInformation_nextToken :: Lens' DescribeInstanceInformation (Maybe Text)
describeInstanceInformation_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstanceInformation' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeInstanceInformation' :: DescribeInstanceInformation -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeInstanceInformation
s@DescribeInstanceInformation' {} Maybe Text
a -> DescribeInstanceInformation
s {$sel:nextToken:DescribeInstanceInformation' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeInstanceInformation)

instance Core.AWSPager DescribeInstanceInformation where
  page :: DescribeInstanceInformation
-> AWSResponse DescribeInstanceInformation
-> Maybe DescribeInstanceInformation
page DescribeInstanceInformation
rq AWSResponse DescribeInstanceInformation
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeInstanceInformation
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeInstanceInformationResponse (Maybe Text)
describeInstanceInformationResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeInstanceInformation
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
  DescribeInstanceInformationResponse (Maybe [InstanceInformation])
describeInstanceInformationResponse_instanceInformationList
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ DescribeInstanceInformation
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeInstanceInformation (Maybe Text)
describeInstanceInformation_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeInstanceInformation
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeInstanceInformationResponse (Maybe Text)
describeInstanceInformationResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest DescribeInstanceInformation where
  type
    AWSResponse DescribeInstanceInformation =
      DescribeInstanceInformationResponse
  request :: (Service -> Service)
-> DescribeInstanceInformation
-> Request DescribeInstanceInformation
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeInstanceInformation
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeInstanceInformation)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [InstanceInformation]
-> Maybe Text -> Int -> DescribeInstanceInformationResponse
DescribeInstanceInformationResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"InstanceInformationList"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable DescribeInstanceInformation where
  hashWithSalt :: Int -> DescribeInstanceInformation -> Int
hashWithSalt Int
_salt DescribeInstanceInformation' {Maybe Natural
Maybe [InstanceInformationFilter]
Maybe [InstanceInformationStringFilter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
instanceInformationFilterList :: Maybe [InstanceInformationFilter]
filters :: Maybe [InstanceInformationStringFilter]
$sel:nextToken:DescribeInstanceInformation' :: DescribeInstanceInformation -> Maybe Text
$sel:maxResults:DescribeInstanceInformation' :: DescribeInstanceInformation -> Maybe Natural
$sel:instanceInformationFilterList:DescribeInstanceInformation' :: DescribeInstanceInformation -> Maybe [InstanceInformationFilter]
$sel:filters:DescribeInstanceInformation' :: DescribeInstanceInformation
-> Maybe [InstanceInformationStringFilter]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [InstanceInformationStringFilter]
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [InstanceInformationFilter]
instanceInformationFilterList
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken

instance Prelude.NFData DescribeInstanceInformation where
  rnf :: DescribeInstanceInformation -> ()
rnf DescribeInstanceInformation' {Maybe Natural
Maybe [InstanceInformationFilter]
Maybe [InstanceInformationStringFilter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
instanceInformationFilterList :: Maybe [InstanceInformationFilter]
filters :: Maybe [InstanceInformationStringFilter]
$sel:nextToken:DescribeInstanceInformation' :: DescribeInstanceInformation -> Maybe Text
$sel:maxResults:DescribeInstanceInformation' :: DescribeInstanceInformation -> Maybe Natural
$sel:instanceInformationFilterList:DescribeInstanceInformation' :: DescribeInstanceInformation -> Maybe [InstanceInformationFilter]
$sel:filters:DescribeInstanceInformation' :: DescribeInstanceInformation
-> Maybe [InstanceInformationStringFilter]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [InstanceInformationStringFilter]
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [InstanceInformationFilter]
instanceInformationFilterList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken

instance Data.ToHeaders DescribeInstanceInformation where
  toHeaders :: DescribeInstanceInformation -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AmazonSSM.DescribeInstanceInformation" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON DescribeInstanceInformation where
  toJSON :: DescribeInstanceInformation -> Value
toJSON DescribeInstanceInformation' {Maybe Natural
Maybe [InstanceInformationFilter]
Maybe [InstanceInformationStringFilter]
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
instanceInformationFilterList :: Maybe [InstanceInformationFilter]
filters :: Maybe [InstanceInformationStringFilter]
$sel:nextToken:DescribeInstanceInformation' :: DescribeInstanceInformation -> Maybe Text
$sel:maxResults:DescribeInstanceInformation' :: DescribeInstanceInformation -> Maybe Natural
$sel:instanceInformationFilterList:DescribeInstanceInformation' :: DescribeInstanceInformation -> Maybe [InstanceInformationFilter]
$sel:filters:DescribeInstanceInformation' :: DescribeInstanceInformation
-> Maybe [InstanceInformationStringFilter]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Filters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [InstanceInformationStringFilter]
filters,
            (Key
"InstanceInformationFilterList" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [InstanceInformationFilter]
instanceInformationFilterList,
            (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken
          ]
      )

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

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

-- | /See:/ 'newDescribeInstanceInformationResponse' smart constructor.
data DescribeInstanceInformationResponse = DescribeInstanceInformationResponse'
  { -- | The managed node information list.
    DescribeInstanceInformationResponse -> Maybe [InstanceInformation]
instanceInformationList :: Prelude.Maybe [InstanceInformation],
    -- | The token to use when requesting the next set of items. If there are no
    -- additional items to return, the string is empty.
    DescribeInstanceInformationResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeInstanceInformationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeInstanceInformationResponse
-> DescribeInstanceInformationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeInstanceInformationResponse
-> DescribeInstanceInformationResponse -> Bool
$c/= :: DescribeInstanceInformationResponse
-> DescribeInstanceInformationResponse -> Bool
== :: DescribeInstanceInformationResponse
-> DescribeInstanceInformationResponse -> Bool
$c== :: DescribeInstanceInformationResponse
-> DescribeInstanceInformationResponse -> Bool
Prelude.Eq, ReadPrec [DescribeInstanceInformationResponse]
ReadPrec DescribeInstanceInformationResponse
Int -> ReadS DescribeInstanceInformationResponse
ReadS [DescribeInstanceInformationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeInstanceInformationResponse]
$creadListPrec :: ReadPrec [DescribeInstanceInformationResponse]
readPrec :: ReadPrec DescribeInstanceInformationResponse
$creadPrec :: ReadPrec DescribeInstanceInformationResponse
readList :: ReadS [DescribeInstanceInformationResponse]
$creadList :: ReadS [DescribeInstanceInformationResponse]
readsPrec :: Int -> ReadS DescribeInstanceInformationResponse
$creadsPrec :: Int -> ReadS DescribeInstanceInformationResponse
Prelude.Read, Int -> DescribeInstanceInformationResponse -> ShowS
[DescribeInstanceInformationResponse] -> ShowS
DescribeInstanceInformationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeInstanceInformationResponse] -> ShowS
$cshowList :: [DescribeInstanceInformationResponse] -> ShowS
show :: DescribeInstanceInformationResponse -> String
$cshow :: DescribeInstanceInformationResponse -> String
showsPrec :: Int -> DescribeInstanceInformationResponse -> ShowS
$cshowsPrec :: Int -> DescribeInstanceInformationResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeInstanceInformationResponse x
-> DescribeInstanceInformationResponse
forall x.
DescribeInstanceInformationResponse
-> Rep DescribeInstanceInformationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeInstanceInformationResponse x
-> DescribeInstanceInformationResponse
$cfrom :: forall x.
DescribeInstanceInformationResponse
-> Rep DescribeInstanceInformationResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeInstanceInformationResponse' 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:
--
-- 'instanceInformationList', 'describeInstanceInformationResponse_instanceInformationList' - The managed node information list.
--
-- 'nextToken', 'describeInstanceInformationResponse_nextToken' - The token to use when requesting the next set of items. If there are no
-- additional items to return, the string is empty.
--
-- 'httpStatus', 'describeInstanceInformationResponse_httpStatus' - The response's http status code.
newDescribeInstanceInformationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeInstanceInformationResponse
newDescribeInstanceInformationResponse :: Int -> DescribeInstanceInformationResponse
newDescribeInstanceInformationResponse Int
pHttpStatus_ =
  DescribeInstanceInformationResponse'
    { $sel:instanceInformationList:DescribeInstanceInformationResponse' :: Maybe [InstanceInformation]
instanceInformationList =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeInstanceInformationResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeInstanceInformationResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The managed node information list.
describeInstanceInformationResponse_instanceInformationList :: Lens.Lens' DescribeInstanceInformationResponse (Prelude.Maybe [InstanceInformation])
describeInstanceInformationResponse_instanceInformationList :: Lens'
  DescribeInstanceInformationResponse (Maybe [InstanceInformation])
describeInstanceInformationResponse_instanceInformationList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstanceInformationResponse' {Maybe [InstanceInformation]
instanceInformationList :: Maybe [InstanceInformation]
$sel:instanceInformationList:DescribeInstanceInformationResponse' :: DescribeInstanceInformationResponse -> Maybe [InstanceInformation]
instanceInformationList} -> Maybe [InstanceInformation]
instanceInformationList) (\s :: DescribeInstanceInformationResponse
s@DescribeInstanceInformationResponse' {} Maybe [InstanceInformation]
a -> DescribeInstanceInformationResponse
s {$sel:instanceInformationList:DescribeInstanceInformationResponse' :: Maybe [InstanceInformation]
instanceInformationList = Maybe [InstanceInformation]
a} :: DescribeInstanceInformationResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token to use when requesting the next set of items. If there are no
-- additional items to return, the string is empty.
describeInstanceInformationResponse_nextToken :: Lens.Lens' DescribeInstanceInformationResponse (Prelude.Maybe Prelude.Text)
describeInstanceInformationResponse_nextToken :: Lens' DescribeInstanceInformationResponse (Maybe Text)
describeInstanceInformationResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInstanceInformationResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeInstanceInformationResponse' :: DescribeInstanceInformationResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeInstanceInformationResponse
s@DescribeInstanceInformationResponse' {} Maybe Text
a -> DescribeInstanceInformationResponse
s {$sel:nextToken:DescribeInstanceInformationResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeInstanceInformationResponse)

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

instance
  Prelude.NFData
    DescribeInstanceInformationResponse
  where
  rnf :: DescribeInstanceInformationResponse -> ()
rnf DescribeInstanceInformationResponse' {Int
Maybe [InstanceInformation]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
instanceInformationList :: Maybe [InstanceInformation]
$sel:httpStatus:DescribeInstanceInformationResponse' :: DescribeInstanceInformationResponse -> Int
$sel:nextToken:DescribeInstanceInformationResponse' :: DescribeInstanceInformationResponse -> Maybe Text
$sel:instanceInformationList:DescribeInstanceInformationResponse' :: DescribeInstanceInformationResponse -> Maybe [InstanceInformation]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [InstanceInformation]
instanceInformationList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus