{-# 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.GetInventory
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Query inventory information. This includes managed node status, such as
-- @Stopped@ or @Terminated@.
--
-- This operation returns paginated results.
module Amazonka.SSM.GetInventory
  ( -- * Creating a Request
    GetInventory (..),
    newGetInventory,

    -- * Request Lenses
    getInventory_aggregators,
    getInventory_filters,
    getInventory_maxResults,
    getInventory_nextToken,
    getInventory_resultAttributes,

    -- * Destructuring the Response
    GetInventoryResponse (..),
    newGetInventoryResponse,

    -- * Response Lenses
    getInventoryResponse_entities,
    getInventoryResponse_nextToken,
    getInventoryResponse_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:/ 'newGetInventory' smart constructor.
data GetInventory = GetInventory'
  { -- | Returns counts of inventory types based on one or more expressions. For
    -- example, if you aggregate by using an expression that uses the
    -- @AWS:InstanceInformation.PlatformType@ type, you can see a count of how
    -- many Windows and Linux managed nodes exist in your inventoried fleet.
    GetInventory -> Maybe (NonEmpty InventoryAggregator)
aggregators :: Prelude.Maybe (Prelude.NonEmpty InventoryAggregator),
    -- | One or more filters. Use a filter to return a more specific list of
    -- results.
    GetInventory -> Maybe (NonEmpty InventoryFilter)
filters :: Prelude.Maybe (Prelude.NonEmpty InventoryFilter),
    -- | 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.
    GetInventory -> 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.)
    GetInventory -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The list of inventory item types to return.
    GetInventory -> Maybe (NonEmpty ResultAttribute)
resultAttributes :: Prelude.Maybe (Prelude.NonEmpty ResultAttribute)
  }
  deriving (GetInventory -> GetInventory -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetInventory -> GetInventory -> Bool
$c/= :: GetInventory -> GetInventory -> Bool
== :: GetInventory -> GetInventory -> Bool
$c== :: GetInventory -> GetInventory -> Bool
Prelude.Eq, ReadPrec [GetInventory]
ReadPrec GetInventory
Int -> ReadS GetInventory
ReadS [GetInventory]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetInventory]
$creadListPrec :: ReadPrec [GetInventory]
readPrec :: ReadPrec GetInventory
$creadPrec :: ReadPrec GetInventory
readList :: ReadS [GetInventory]
$creadList :: ReadS [GetInventory]
readsPrec :: Int -> ReadS GetInventory
$creadsPrec :: Int -> ReadS GetInventory
Prelude.Read, Int -> GetInventory -> ShowS
[GetInventory] -> ShowS
GetInventory -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetInventory] -> ShowS
$cshowList :: [GetInventory] -> ShowS
show :: GetInventory -> String
$cshow :: GetInventory -> String
showsPrec :: Int -> GetInventory -> ShowS
$cshowsPrec :: Int -> GetInventory -> ShowS
Prelude.Show, forall x. Rep GetInventory x -> GetInventory
forall x. GetInventory -> Rep GetInventory x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetInventory x -> GetInventory
$cfrom :: forall x. GetInventory -> Rep GetInventory x
Prelude.Generic)

-- |
-- Create a value of 'GetInventory' 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:
--
-- 'aggregators', 'getInventory_aggregators' - Returns counts of inventory types based on one or more expressions. For
-- example, if you aggregate by using an expression that uses the
-- @AWS:InstanceInformation.PlatformType@ type, you can see a count of how
-- many Windows and Linux managed nodes exist in your inventoried fleet.
--
-- 'filters', 'getInventory_filters' - One or more filters. Use a filter to return a more specific list of
-- results.
--
-- 'maxResults', 'getInventory_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', 'getInventory_nextToken' - The token for the next set of items to return. (You received this token
-- from a previous call.)
--
-- 'resultAttributes', 'getInventory_resultAttributes' - The list of inventory item types to return.
newGetInventory ::
  GetInventory
newGetInventory :: GetInventory
newGetInventory =
  GetInventory'
    { $sel:aggregators:GetInventory' :: Maybe (NonEmpty InventoryAggregator)
aggregators = forall a. Maybe a
Prelude.Nothing,
      $sel:filters:GetInventory' :: Maybe (NonEmpty InventoryFilter)
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetInventory' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetInventory' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:resultAttributes:GetInventory' :: Maybe (NonEmpty ResultAttribute)
resultAttributes = forall a. Maybe a
Prelude.Nothing
    }

-- | Returns counts of inventory types based on one or more expressions. For
-- example, if you aggregate by using an expression that uses the
-- @AWS:InstanceInformation.PlatformType@ type, you can see a count of how
-- many Windows and Linux managed nodes exist in your inventoried fleet.
getInventory_aggregators :: Lens.Lens' GetInventory (Prelude.Maybe (Prelude.NonEmpty InventoryAggregator))
getInventory_aggregators :: Lens' GetInventory (Maybe (NonEmpty InventoryAggregator))
getInventory_aggregators = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInventory' {Maybe (NonEmpty InventoryAggregator)
aggregators :: Maybe (NonEmpty InventoryAggregator)
$sel:aggregators:GetInventory' :: GetInventory -> Maybe (NonEmpty InventoryAggregator)
aggregators} -> Maybe (NonEmpty InventoryAggregator)
aggregators) (\s :: GetInventory
s@GetInventory' {} Maybe (NonEmpty InventoryAggregator)
a -> GetInventory
s {$sel:aggregators:GetInventory' :: Maybe (NonEmpty InventoryAggregator)
aggregators = Maybe (NonEmpty InventoryAggregator)
a} :: GetInventory) 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

-- | One or more filters. Use a filter to return a more specific list of
-- results.
getInventory_filters :: Lens.Lens' GetInventory (Prelude.Maybe (Prelude.NonEmpty InventoryFilter))
getInventory_filters :: Lens' GetInventory (Maybe (NonEmpty InventoryFilter))
getInventory_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInventory' {Maybe (NonEmpty InventoryFilter)
filters :: Maybe (NonEmpty InventoryFilter)
$sel:filters:GetInventory' :: GetInventory -> Maybe (NonEmpty InventoryFilter)
filters} -> Maybe (NonEmpty InventoryFilter)
filters) (\s :: GetInventory
s@GetInventory' {} Maybe (NonEmpty InventoryFilter)
a -> GetInventory
s {$sel:filters:GetInventory' :: Maybe (NonEmpty InventoryFilter)
filters = Maybe (NonEmpty InventoryFilter)
a} :: GetInventory) 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.
getInventory_maxResults :: Lens.Lens' GetInventory (Prelude.Maybe Prelude.Natural)
getInventory_maxResults :: Lens' GetInventory (Maybe Natural)
getInventory_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInventory' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetInventory' :: GetInventory -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetInventory
s@GetInventory' {} Maybe Natural
a -> GetInventory
s {$sel:maxResults:GetInventory' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetInventory)

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

-- | The list of inventory item types to return.
getInventory_resultAttributes :: Lens.Lens' GetInventory (Prelude.Maybe (Prelude.NonEmpty ResultAttribute))
getInventory_resultAttributes :: Lens' GetInventory (Maybe (NonEmpty ResultAttribute))
getInventory_resultAttributes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInventory' {Maybe (NonEmpty ResultAttribute)
resultAttributes :: Maybe (NonEmpty ResultAttribute)
$sel:resultAttributes:GetInventory' :: GetInventory -> Maybe (NonEmpty ResultAttribute)
resultAttributes} -> Maybe (NonEmpty ResultAttribute)
resultAttributes) (\s :: GetInventory
s@GetInventory' {} Maybe (NonEmpty ResultAttribute)
a -> GetInventory
s {$sel:resultAttributes:GetInventory' :: Maybe (NonEmpty ResultAttribute)
resultAttributes = Maybe (NonEmpty ResultAttribute)
a} :: GetInventory) 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

instance Core.AWSPager GetInventory where
  page :: GetInventory -> AWSResponse GetInventory -> Maybe GetInventory
page GetInventory
rq AWSResponse GetInventory
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetInventory
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetInventoryResponse (Maybe Text)
getInventoryResponse_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 GetInventory
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetInventoryResponse (Maybe [InventoryResultEntity])
getInventoryResponse_entities
            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.$ GetInventory
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' GetInventory (Maybe Text)
getInventory_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetInventory
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetInventoryResponse (Maybe Text)
getInventoryResponse_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 GetInventory where
  type AWSResponse GetInventory = GetInventoryResponse
  request :: (Service -> Service) -> GetInventory -> Request GetInventory
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 GetInventory
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetInventory)))
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 [InventoryResultEntity]
-> Maybe Text -> Int -> GetInventoryResponse
GetInventoryResponse'
            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
"Entities" 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 GetInventory where
  hashWithSalt :: Int -> GetInventory -> Int
hashWithSalt Int
_salt GetInventory' {Maybe Natural
Maybe (NonEmpty InventoryFilter)
Maybe (NonEmpty InventoryAggregator)
Maybe (NonEmpty ResultAttribute)
Maybe Text
resultAttributes :: Maybe (NonEmpty ResultAttribute)
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe (NonEmpty InventoryFilter)
aggregators :: Maybe (NonEmpty InventoryAggregator)
$sel:resultAttributes:GetInventory' :: GetInventory -> Maybe (NonEmpty ResultAttribute)
$sel:nextToken:GetInventory' :: GetInventory -> Maybe Text
$sel:maxResults:GetInventory' :: GetInventory -> Maybe Natural
$sel:filters:GetInventory' :: GetInventory -> Maybe (NonEmpty InventoryFilter)
$sel:aggregators:GetInventory' :: GetInventory -> Maybe (NonEmpty InventoryAggregator)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty InventoryAggregator)
aggregators
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty InventoryFilter)
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty ResultAttribute)
resultAttributes

instance Prelude.NFData GetInventory where
  rnf :: GetInventory -> ()
rnf GetInventory' {Maybe Natural
Maybe (NonEmpty InventoryFilter)
Maybe (NonEmpty InventoryAggregator)
Maybe (NonEmpty ResultAttribute)
Maybe Text
resultAttributes :: Maybe (NonEmpty ResultAttribute)
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe (NonEmpty InventoryFilter)
aggregators :: Maybe (NonEmpty InventoryAggregator)
$sel:resultAttributes:GetInventory' :: GetInventory -> Maybe (NonEmpty ResultAttribute)
$sel:nextToken:GetInventory' :: GetInventory -> Maybe Text
$sel:maxResults:GetInventory' :: GetInventory -> Maybe Natural
$sel:filters:GetInventory' :: GetInventory -> Maybe (NonEmpty InventoryFilter)
$sel:aggregators:GetInventory' :: GetInventory -> Maybe (NonEmpty InventoryAggregator)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty InventoryAggregator)
aggregators
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty InventoryFilter)
filters
      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
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty ResultAttribute)
resultAttributes

instance Data.ToHeaders GetInventory where
  toHeaders :: GetInventory -> 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.GetInventory" :: 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 GetInventory where
  toJSON :: GetInventory -> Value
toJSON GetInventory' {Maybe Natural
Maybe (NonEmpty InventoryFilter)
Maybe (NonEmpty InventoryAggregator)
Maybe (NonEmpty ResultAttribute)
Maybe Text
resultAttributes :: Maybe (NonEmpty ResultAttribute)
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe (NonEmpty InventoryFilter)
aggregators :: Maybe (NonEmpty InventoryAggregator)
$sel:resultAttributes:GetInventory' :: GetInventory -> Maybe (NonEmpty ResultAttribute)
$sel:nextToken:GetInventory' :: GetInventory -> Maybe Text
$sel:maxResults:GetInventory' :: GetInventory -> Maybe Natural
$sel:filters:GetInventory' :: GetInventory -> Maybe (NonEmpty InventoryFilter)
$sel:aggregators:GetInventory' :: GetInventory -> Maybe (NonEmpty InventoryAggregator)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Aggregators" 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 (NonEmpty InventoryAggregator)
aggregators,
            (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 (NonEmpty InventoryFilter)
filters,
            (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,
            (Key
"ResultAttributes" 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 (NonEmpty ResultAttribute)
resultAttributes
          ]
      )

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

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

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

-- |
-- Create a value of 'GetInventoryResponse' 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:
--
-- 'entities', 'getInventoryResponse_entities' - Collection of inventory entities such as a collection of managed node
-- inventory.
--
-- 'nextToken', 'getInventoryResponse_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', 'getInventoryResponse_httpStatus' - The response's http status code.
newGetInventoryResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetInventoryResponse
newGetInventoryResponse :: Int -> GetInventoryResponse
newGetInventoryResponse Int
pHttpStatus_ =
  GetInventoryResponse'
    { $sel:entities:GetInventoryResponse' :: Maybe [InventoryResultEntity]
entities = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetInventoryResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetInventoryResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Collection of inventory entities such as a collection of managed node
-- inventory.
getInventoryResponse_entities :: Lens.Lens' GetInventoryResponse (Prelude.Maybe [InventoryResultEntity])
getInventoryResponse_entities :: Lens' GetInventoryResponse (Maybe [InventoryResultEntity])
getInventoryResponse_entities = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInventoryResponse' {Maybe [InventoryResultEntity]
entities :: Maybe [InventoryResultEntity]
$sel:entities:GetInventoryResponse' :: GetInventoryResponse -> Maybe [InventoryResultEntity]
entities} -> Maybe [InventoryResultEntity]
entities) (\s :: GetInventoryResponse
s@GetInventoryResponse' {} Maybe [InventoryResultEntity]
a -> GetInventoryResponse
s {$sel:entities:GetInventoryResponse' :: Maybe [InventoryResultEntity]
entities = Maybe [InventoryResultEntity]
a} :: GetInventoryResponse) 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.
getInventoryResponse_nextToken :: Lens.Lens' GetInventoryResponse (Prelude.Maybe Prelude.Text)
getInventoryResponse_nextToken :: Lens' GetInventoryResponse (Maybe Text)
getInventoryResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInventoryResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetInventoryResponse' :: GetInventoryResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetInventoryResponse
s@GetInventoryResponse' {} Maybe Text
a -> GetInventoryResponse
s {$sel:nextToken:GetInventoryResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetInventoryResponse)

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

instance Prelude.NFData GetInventoryResponse where
  rnf :: GetInventoryResponse -> ()
rnf GetInventoryResponse' {Int
Maybe [InventoryResultEntity]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
entities :: Maybe [InventoryResultEntity]
$sel:httpStatus:GetInventoryResponse' :: GetInventoryResponse -> Int
$sel:nextToken:GetInventoryResponse' :: GetInventoryResponse -> Maybe Text
$sel:entities:GetInventoryResponse' :: GetInventoryResponse -> Maybe [InventoryResultEntity]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [InventoryResultEntity]
entities
      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