{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Glacier.Types.InventoryRetrievalJobInput
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Glacier.Types.InventoryRetrievalJobInput 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

-- | Provides options for specifying a range inventory retrieval job.
--
-- /See:/ 'newInventoryRetrievalJobInput' smart constructor.
data InventoryRetrievalJobInput = InventoryRetrievalJobInput'
  { -- | The end of the date range in UTC for vault inventory retrieval that
    -- includes archives created before this date. This value should be a
    -- string in the ISO 8601 date format, for example @2013-03-20T17:03:43Z@.
    InventoryRetrievalJobInput -> Maybe Text
endDate :: Prelude.Maybe Prelude.Text,
    -- | Specifies the maximum number of inventory items returned per vault
    -- inventory retrieval request. Valid values are greater than or equal to
    -- 1.
    InventoryRetrievalJobInput -> Maybe Text
limit :: Prelude.Maybe Prelude.Text,
    -- | An opaque string that represents where to continue pagination of the
    -- vault inventory retrieval results. You use the marker in a new
    -- __InitiateJob__ request to obtain additional inventory items. If there
    -- are no more inventory items, this value is @null@.
    InventoryRetrievalJobInput -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The start of the date range in UTC for vault inventory retrieval that
    -- includes archives created on or after this date. This value should be a
    -- string in the ISO 8601 date format, for example @2013-03-20T17:03:43Z@.
    InventoryRetrievalJobInput -> Maybe Text
startDate :: Prelude.Maybe Prelude.Text
  }
  deriving (InventoryRetrievalJobInput -> InventoryRetrievalJobInput -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InventoryRetrievalJobInput -> InventoryRetrievalJobInput -> Bool
$c/= :: InventoryRetrievalJobInput -> InventoryRetrievalJobInput -> Bool
== :: InventoryRetrievalJobInput -> InventoryRetrievalJobInput -> Bool
$c== :: InventoryRetrievalJobInput -> InventoryRetrievalJobInput -> Bool
Prelude.Eq, ReadPrec [InventoryRetrievalJobInput]
ReadPrec InventoryRetrievalJobInput
Int -> ReadS InventoryRetrievalJobInput
ReadS [InventoryRetrievalJobInput]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InventoryRetrievalJobInput]
$creadListPrec :: ReadPrec [InventoryRetrievalJobInput]
readPrec :: ReadPrec InventoryRetrievalJobInput
$creadPrec :: ReadPrec InventoryRetrievalJobInput
readList :: ReadS [InventoryRetrievalJobInput]
$creadList :: ReadS [InventoryRetrievalJobInput]
readsPrec :: Int -> ReadS InventoryRetrievalJobInput
$creadsPrec :: Int -> ReadS InventoryRetrievalJobInput
Prelude.Read, Int -> InventoryRetrievalJobInput -> ShowS
[InventoryRetrievalJobInput] -> ShowS
InventoryRetrievalJobInput -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InventoryRetrievalJobInput] -> ShowS
$cshowList :: [InventoryRetrievalJobInput] -> ShowS
show :: InventoryRetrievalJobInput -> String
$cshow :: InventoryRetrievalJobInput -> String
showsPrec :: Int -> InventoryRetrievalJobInput -> ShowS
$cshowsPrec :: Int -> InventoryRetrievalJobInput -> ShowS
Prelude.Show, forall x.
Rep InventoryRetrievalJobInput x -> InventoryRetrievalJobInput
forall x.
InventoryRetrievalJobInput -> Rep InventoryRetrievalJobInput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InventoryRetrievalJobInput x -> InventoryRetrievalJobInput
$cfrom :: forall x.
InventoryRetrievalJobInput -> Rep InventoryRetrievalJobInput x
Prelude.Generic)

-- |
-- Create a value of 'InventoryRetrievalJobInput' 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:
--
-- 'endDate', 'inventoryRetrievalJobInput_endDate' - The end of the date range in UTC for vault inventory retrieval that
-- includes archives created before this date. This value should be a
-- string in the ISO 8601 date format, for example @2013-03-20T17:03:43Z@.
--
-- 'limit', 'inventoryRetrievalJobInput_limit' - Specifies the maximum number of inventory items returned per vault
-- inventory retrieval request. Valid values are greater than or equal to
-- 1.
--
-- 'marker', 'inventoryRetrievalJobInput_marker' - An opaque string that represents where to continue pagination of the
-- vault inventory retrieval results. You use the marker in a new
-- __InitiateJob__ request to obtain additional inventory items. If there
-- are no more inventory items, this value is @null@.
--
-- 'startDate', 'inventoryRetrievalJobInput_startDate' - The start of the date range in UTC for vault inventory retrieval that
-- includes archives created on or after this date. This value should be a
-- string in the ISO 8601 date format, for example @2013-03-20T17:03:43Z@.
newInventoryRetrievalJobInput ::
  InventoryRetrievalJobInput
newInventoryRetrievalJobInput :: InventoryRetrievalJobInput
newInventoryRetrievalJobInput =
  InventoryRetrievalJobInput'
    { $sel:endDate:InventoryRetrievalJobInput' :: Maybe Text
endDate =
        forall a. Maybe a
Prelude.Nothing,
      $sel:limit:InventoryRetrievalJobInput' :: Maybe Text
limit = forall a. Maybe a
Prelude.Nothing,
      $sel:marker:InventoryRetrievalJobInput' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:startDate:InventoryRetrievalJobInput' :: Maybe Text
startDate = forall a. Maybe a
Prelude.Nothing
    }

-- | The end of the date range in UTC for vault inventory retrieval that
-- includes archives created before this date. This value should be a
-- string in the ISO 8601 date format, for example @2013-03-20T17:03:43Z@.
inventoryRetrievalJobInput_endDate :: Lens.Lens' InventoryRetrievalJobInput (Prelude.Maybe Prelude.Text)
inventoryRetrievalJobInput_endDate :: Lens' InventoryRetrievalJobInput (Maybe Text)
inventoryRetrievalJobInput_endDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryRetrievalJobInput' {Maybe Text
endDate :: Maybe Text
$sel:endDate:InventoryRetrievalJobInput' :: InventoryRetrievalJobInput -> Maybe Text
endDate} -> Maybe Text
endDate) (\s :: InventoryRetrievalJobInput
s@InventoryRetrievalJobInput' {} Maybe Text
a -> InventoryRetrievalJobInput
s {$sel:endDate:InventoryRetrievalJobInput' :: Maybe Text
endDate = Maybe Text
a} :: InventoryRetrievalJobInput)

-- | Specifies the maximum number of inventory items returned per vault
-- inventory retrieval request. Valid values are greater than or equal to
-- 1.
inventoryRetrievalJobInput_limit :: Lens.Lens' InventoryRetrievalJobInput (Prelude.Maybe Prelude.Text)
inventoryRetrievalJobInput_limit :: Lens' InventoryRetrievalJobInput (Maybe Text)
inventoryRetrievalJobInput_limit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryRetrievalJobInput' {Maybe Text
limit :: Maybe Text
$sel:limit:InventoryRetrievalJobInput' :: InventoryRetrievalJobInput -> Maybe Text
limit} -> Maybe Text
limit) (\s :: InventoryRetrievalJobInput
s@InventoryRetrievalJobInput' {} Maybe Text
a -> InventoryRetrievalJobInput
s {$sel:limit:InventoryRetrievalJobInput' :: Maybe Text
limit = Maybe Text
a} :: InventoryRetrievalJobInput)

-- | An opaque string that represents where to continue pagination of the
-- vault inventory retrieval results. You use the marker in a new
-- __InitiateJob__ request to obtain additional inventory items. If there
-- are no more inventory items, this value is @null@.
inventoryRetrievalJobInput_marker :: Lens.Lens' InventoryRetrievalJobInput (Prelude.Maybe Prelude.Text)
inventoryRetrievalJobInput_marker :: Lens' InventoryRetrievalJobInput (Maybe Text)
inventoryRetrievalJobInput_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryRetrievalJobInput' {Maybe Text
marker :: Maybe Text
$sel:marker:InventoryRetrievalJobInput' :: InventoryRetrievalJobInput -> Maybe Text
marker} -> Maybe Text
marker) (\s :: InventoryRetrievalJobInput
s@InventoryRetrievalJobInput' {} Maybe Text
a -> InventoryRetrievalJobInput
s {$sel:marker:InventoryRetrievalJobInput' :: Maybe Text
marker = Maybe Text
a} :: InventoryRetrievalJobInput)

-- | The start of the date range in UTC for vault inventory retrieval that
-- includes archives created on or after this date. This value should be a
-- string in the ISO 8601 date format, for example @2013-03-20T17:03:43Z@.
inventoryRetrievalJobInput_startDate :: Lens.Lens' InventoryRetrievalJobInput (Prelude.Maybe Prelude.Text)
inventoryRetrievalJobInput_startDate :: Lens' InventoryRetrievalJobInput (Maybe Text)
inventoryRetrievalJobInput_startDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryRetrievalJobInput' {Maybe Text
startDate :: Maybe Text
$sel:startDate:InventoryRetrievalJobInput' :: InventoryRetrievalJobInput -> Maybe Text
startDate} -> Maybe Text
startDate) (\s :: InventoryRetrievalJobInput
s@InventoryRetrievalJobInput' {} Maybe Text
a -> InventoryRetrievalJobInput
s {$sel:startDate:InventoryRetrievalJobInput' :: Maybe Text
startDate = Maybe Text
a} :: InventoryRetrievalJobInput)

instance Prelude.Hashable InventoryRetrievalJobInput where
  hashWithSalt :: Int -> InventoryRetrievalJobInput -> Int
hashWithSalt Int
_salt InventoryRetrievalJobInput' {Maybe Text
startDate :: Maybe Text
marker :: Maybe Text
limit :: Maybe Text
endDate :: Maybe Text
$sel:startDate:InventoryRetrievalJobInput' :: InventoryRetrievalJobInput -> Maybe Text
$sel:marker:InventoryRetrievalJobInput' :: InventoryRetrievalJobInput -> Maybe Text
$sel:limit:InventoryRetrievalJobInput' :: InventoryRetrievalJobInput -> Maybe Text
$sel:endDate:InventoryRetrievalJobInput' :: InventoryRetrievalJobInput -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
endDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
limit
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
startDate

instance Prelude.NFData InventoryRetrievalJobInput where
  rnf :: InventoryRetrievalJobInput -> ()
rnf InventoryRetrievalJobInput' {Maybe Text
startDate :: Maybe Text
marker :: Maybe Text
limit :: Maybe Text
endDate :: Maybe Text
$sel:startDate:InventoryRetrievalJobInput' :: InventoryRetrievalJobInput -> Maybe Text
$sel:marker:InventoryRetrievalJobInput' :: InventoryRetrievalJobInput -> Maybe Text
$sel:limit:InventoryRetrievalJobInput' :: InventoryRetrievalJobInput -> Maybe Text
$sel:endDate:InventoryRetrievalJobInput' :: InventoryRetrievalJobInput -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
endDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
limit
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
startDate

instance Data.ToJSON InventoryRetrievalJobInput where
  toJSON :: InventoryRetrievalJobInput -> Value
toJSON InventoryRetrievalJobInput' {Maybe Text
startDate :: Maybe Text
marker :: Maybe Text
limit :: Maybe Text
endDate :: Maybe Text
$sel:startDate:InventoryRetrievalJobInput' :: InventoryRetrievalJobInput -> Maybe Text
$sel:marker:InventoryRetrievalJobInput' :: InventoryRetrievalJobInput -> Maybe Text
$sel:limit:InventoryRetrievalJobInput' :: InventoryRetrievalJobInput -> Maybe Text
$sel:endDate:InventoryRetrievalJobInput' :: InventoryRetrievalJobInput -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"EndDate" 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
endDate,
            (Key
"Limit" 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
limit,
            (Key
"Marker" 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
marker,
            (Key
"StartDate" 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
startDate
          ]
      )