{-# 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.DescribeInventoryDeletions
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Describes a specific delete inventory operation.
--
-- This operation returns paginated results.
module Amazonka.SSM.DescribeInventoryDeletions
  ( -- * Creating a Request
    DescribeInventoryDeletions (..),
    newDescribeInventoryDeletions,

    -- * Request Lenses
    describeInventoryDeletions_nextToken,
    describeInventoryDeletions_maxResults,
    describeInventoryDeletions_deletionId,

    -- * Destructuring the Response
    DescribeInventoryDeletionsResponse (..),
    newDescribeInventoryDeletionsResponse,

    -- * Response Lenses
    describeInventoryDeletionsResponse_inventoryDeletions,
    describeInventoryDeletionsResponse_nextToken,
    describeInventoryDeletionsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDescribeInventoryDeletions' smart constructor.
data DescribeInventoryDeletions = DescribeInventoryDeletions'
  { -- | A token to start the list. Use this token to get the next set of
    -- results.
    DescribeInventoryDeletions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of items to return for this call. The call also
    -- returns a token that you can specify in a subsequent call to get the
    -- next set of results.
    DescribeInventoryDeletions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | Specify the delete inventory ID for which you want information. This ID
    -- was returned by the @DeleteInventory@ operation.
    DescribeInventoryDeletions -> Maybe Text
deletionId :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeInventoryDeletions -> DescribeInventoryDeletions -> Bool
(DescribeInventoryDeletions -> DescribeInventoryDeletions -> Bool)
-> (DescribeInventoryDeletions
    -> DescribeInventoryDeletions -> Bool)
-> Eq DescribeInventoryDeletions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeInventoryDeletions -> DescribeInventoryDeletions -> Bool
$c/= :: DescribeInventoryDeletions -> DescribeInventoryDeletions -> Bool
== :: DescribeInventoryDeletions -> DescribeInventoryDeletions -> Bool
$c== :: DescribeInventoryDeletions -> DescribeInventoryDeletions -> Bool
Prelude.Eq, ReadPrec [DescribeInventoryDeletions]
ReadPrec DescribeInventoryDeletions
Int -> ReadS DescribeInventoryDeletions
ReadS [DescribeInventoryDeletions]
(Int -> ReadS DescribeInventoryDeletions)
-> ReadS [DescribeInventoryDeletions]
-> ReadPrec DescribeInventoryDeletions
-> ReadPrec [DescribeInventoryDeletions]
-> Read DescribeInventoryDeletions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeInventoryDeletions]
$creadListPrec :: ReadPrec [DescribeInventoryDeletions]
readPrec :: ReadPrec DescribeInventoryDeletions
$creadPrec :: ReadPrec DescribeInventoryDeletions
readList :: ReadS [DescribeInventoryDeletions]
$creadList :: ReadS [DescribeInventoryDeletions]
readsPrec :: Int -> ReadS DescribeInventoryDeletions
$creadsPrec :: Int -> ReadS DescribeInventoryDeletions
Prelude.Read, Int -> DescribeInventoryDeletions -> ShowS
[DescribeInventoryDeletions] -> ShowS
DescribeInventoryDeletions -> String
(Int -> DescribeInventoryDeletions -> ShowS)
-> (DescribeInventoryDeletions -> String)
-> ([DescribeInventoryDeletions] -> ShowS)
-> Show DescribeInventoryDeletions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeInventoryDeletions] -> ShowS
$cshowList :: [DescribeInventoryDeletions] -> ShowS
show :: DescribeInventoryDeletions -> String
$cshow :: DescribeInventoryDeletions -> String
showsPrec :: Int -> DescribeInventoryDeletions -> ShowS
$cshowsPrec :: Int -> DescribeInventoryDeletions -> ShowS
Prelude.Show, (forall x.
 DescribeInventoryDeletions -> Rep DescribeInventoryDeletions x)
-> (forall x.
    Rep DescribeInventoryDeletions x -> DescribeInventoryDeletions)
-> Generic DescribeInventoryDeletions
forall x.
Rep DescribeInventoryDeletions x -> DescribeInventoryDeletions
forall x.
DescribeInventoryDeletions -> Rep DescribeInventoryDeletions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeInventoryDeletions x -> DescribeInventoryDeletions
$cfrom :: forall x.
DescribeInventoryDeletions -> Rep DescribeInventoryDeletions x
Prelude.Generic)

-- |
-- Create a value of 'DescribeInventoryDeletions' 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', 'describeInventoryDeletions_nextToken' - A token to start the list. Use this token to get the next set of
-- results.
--
-- 'maxResults', 'describeInventoryDeletions_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.
--
-- 'deletionId', 'describeInventoryDeletions_deletionId' - Specify the delete inventory ID for which you want information. This ID
-- was returned by the @DeleteInventory@ operation.
newDescribeInventoryDeletions ::
  DescribeInventoryDeletions
newDescribeInventoryDeletions :: DescribeInventoryDeletions
newDescribeInventoryDeletions =
  DescribeInventoryDeletions' :: Maybe Text
-> Maybe Natural -> Maybe Text -> DescribeInventoryDeletions
DescribeInventoryDeletions'
    { $sel:nextToken:DescribeInventoryDeletions' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeInventoryDeletions' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:deletionId:DescribeInventoryDeletions' :: Maybe Text
deletionId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

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

-- | Specify the delete inventory ID for which you want information. This ID
-- was returned by the @DeleteInventory@ operation.
describeInventoryDeletions_deletionId :: Lens.Lens' DescribeInventoryDeletions (Prelude.Maybe Prelude.Text)
describeInventoryDeletions_deletionId :: (Maybe Text -> f (Maybe Text))
-> DescribeInventoryDeletions -> f DescribeInventoryDeletions
describeInventoryDeletions_deletionId = (DescribeInventoryDeletions -> Maybe Text)
-> (DescribeInventoryDeletions
    -> Maybe Text -> DescribeInventoryDeletions)
-> Lens
     DescribeInventoryDeletions
     DescribeInventoryDeletions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInventoryDeletions' {Maybe Text
deletionId :: Maybe Text
$sel:deletionId:DescribeInventoryDeletions' :: DescribeInventoryDeletions -> Maybe Text
deletionId} -> Maybe Text
deletionId) (\s :: DescribeInventoryDeletions
s@DescribeInventoryDeletions' {} Maybe Text
a -> DescribeInventoryDeletions
s {$sel:deletionId:DescribeInventoryDeletions' :: Maybe Text
deletionId = Maybe Text
a} :: DescribeInventoryDeletions)

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

instance Prelude.NFData DescribeInventoryDeletions

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

instance Core.ToJSON DescribeInventoryDeletions where
  toJSON :: DescribeInventoryDeletions -> Value
toJSON DescribeInventoryDeletions' {Maybe Natural
Maybe Text
deletionId :: Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:deletionId:DescribeInventoryDeletions' :: DescribeInventoryDeletions -> Maybe Text
$sel:maxResults:DescribeInventoryDeletions' :: DescribeInventoryDeletions -> Maybe Natural
$sel:nextToken:DescribeInventoryDeletions' :: DescribeInventoryDeletions -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Text
"DeletionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
deletionId
          ]
      )

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

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

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

-- |
-- Create a value of 'DescribeInventoryDeletionsResponse' 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:
--
-- 'inventoryDeletions', 'describeInventoryDeletionsResponse_inventoryDeletions' - A list of status items for deleted inventory.
--
-- 'nextToken', 'describeInventoryDeletionsResponse_nextToken' - The token for the next set of items to return. Use this token to get the
-- next set of results.
--
-- 'httpStatus', 'describeInventoryDeletionsResponse_httpStatus' - The response's http status code.
newDescribeInventoryDeletionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeInventoryDeletionsResponse
newDescribeInventoryDeletionsResponse :: Int -> DescribeInventoryDeletionsResponse
newDescribeInventoryDeletionsResponse Int
pHttpStatus_ =
  DescribeInventoryDeletionsResponse' :: Maybe [InventoryDeletionStatusItem]
-> Maybe Text -> Int -> DescribeInventoryDeletionsResponse
DescribeInventoryDeletionsResponse'
    { $sel:inventoryDeletions:DescribeInventoryDeletionsResponse' :: Maybe [InventoryDeletionStatusItem]
inventoryDeletions =
        Maybe [InventoryDeletionStatusItem]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeInventoryDeletionsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeInventoryDeletionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of status items for deleted inventory.
describeInventoryDeletionsResponse_inventoryDeletions :: Lens.Lens' DescribeInventoryDeletionsResponse (Prelude.Maybe [InventoryDeletionStatusItem])
describeInventoryDeletionsResponse_inventoryDeletions :: (Maybe [InventoryDeletionStatusItem]
 -> f (Maybe [InventoryDeletionStatusItem]))
-> DescribeInventoryDeletionsResponse
-> f DescribeInventoryDeletionsResponse
describeInventoryDeletionsResponse_inventoryDeletions = (DescribeInventoryDeletionsResponse
 -> Maybe [InventoryDeletionStatusItem])
-> (DescribeInventoryDeletionsResponse
    -> Maybe [InventoryDeletionStatusItem]
    -> DescribeInventoryDeletionsResponse)
-> Lens'
     DescribeInventoryDeletionsResponse
     (Maybe [InventoryDeletionStatusItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeInventoryDeletionsResponse' {Maybe [InventoryDeletionStatusItem]
inventoryDeletions :: Maybe [InventoryDeletionStatusItem]
$sel:inventoryDeletions:DescribeInventoryDeletionsResponse' :: DescribeInventoryDeletionsResponse
-> Maybe [InventoryDeletionStatusItem]
inventoryDeletions} -> Maybe [InventoryDeletionStatusItem]
inventoryDeletions) (\s :: DescribeInventoryDeletionsResponse
s@DescribeInventoryDeletionsResponse' {} Maybe [InventoryDeletionStatusItem]
a -> DescribeInventoryDeletionsResponse
s {$sel:inventoryDeletions:DescribeInventoryDeletionsResponse' :: Maybe [InventoryDeletionStatusItem]
inventoryDeletions = Maybe [InventoryDeletionStatusItem]
a} :: DescribeInventoryDeletionsResponse) ((Maybe [InventoryDeletionStatusItem]
  -> f (Maybe [InventoryDeletionStatusItem]))
 -> DescribeInventoryDeletionsResponse
 -> f DescribeInventoryDeletionsResponse)
-> ((Maybe [InventoryDeletionStatusItem]
     -> f (Maybe [InventoryDeletionStatusItem]))
    -> Maybe [InventoryDeletionStatusItem]
    -> f (Maybe [InventoryDeletionStatusItem]))
-> (Maybe [InventoryDeletionStatusItem]
    -> f (Maybe [InventoryDeletionStatusItem]))
-> DescribeInventoryDeletionsResponse
-> f DescribeInventoryDeletionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [InventoryDeletionStatusItem]
  [InventoryDeletionStatusItem]
  [InventoryDeletionStatusItem]
  [InventoryDeletionStatusItem]
-> Iso
     (Maybe [InventoryDeletionStatusItem])
     (Maybe [InventoryDeletionStatusItem])
     (Maybe [InventoryDeletionStatusItem])
     (Maybe [InventoryDeletionStatusItem])
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
  [InventoryDeletionStatusItem]
  [InventoryDeletionStatusItem]
  [InventoryDeletionStatusItem]
  [InventoryDeletionStatusItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

instance
  Prelude.NFData
    DescribeInventoryDeletionsResponse