{-# 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-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)
module Amazonka.Glacier.Types.InventoryRetrievalJobInput where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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,
    -- | 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,
    -- | 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,
    -- | 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
  }
  deriving (InventoryRetrievalJobInput -> InventoryRetrievalJobInput -> Bool
(InventoryRetrievalJobInput -> InventoryRetrievalJobInput -> Bool)
-> (InventoryRetrievalJobInput
    -> InventoryRetrievalJobInput -> Bool)
-> Eq InventoryRetrievalJobInput
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]
(Int -> ReadS InventoryRetrievalJobInput)
-> ReadS [InventoryRetrievalJobInput]
-> ReadPrec InventoryRetrievalJobInput
-> ReadPrec [InventoryRetrievalJobInput]
-> Read 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
(Int -> InventoryRetrievalJobInput -> ShowS)
-> (InventoryRetrievalJobInput -> String)
-> ([InventoryRetrievalJobInput] -> ShowS)
-> Show InventoryRetrievalJobInput
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.
 InventoryRetrievalJobInput -> Rep InventoryRetrievalJobInput x)
-> (forall x.
    Rep InventoryRetrievalJobInput x -> InventoryRetrievalJobInput)
-> Generic InventoryRetrievalJobInput
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@.
--
-- '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@.
--
-- '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@.
--
-- '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.
newInventoryRetrievalJobInput ::
  InventoryRetrievalJobInput
newInventoryRetrievalJobInput :: InventoryRetrievalJobInput
newInventoryRetrievalJobInput =
  InventoryRetrievalJobInput' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> InventoryRetrievalJobInput
InventoryRetrievalJobInput'
    { $sel:endDate:InventoryRetrievalJobInput' :: Maybe Text
endDate =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:startDate:InventoryRetrievalJobInput' :: Maybe Text
startDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:InventoryRetrievalJobInput' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:InventoryRetrievalJobInput' :: Maybe Text
limit = Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> InventoryRetrievalJobInput -> f InventoryRetrievalJobInput
inventoryRetrievalJobInput_endDate = (InventoryRetrievalJobInput -> Maybe Text)
-> (InventoryRetrievalJobInput
    -> Maybe Text -> InventoryRetrievalJobInput)
-> Lens
     InventoryRetrievalJobInput
     InventoryRetrievalJobInput
     (Maybe Text)
     (Maybe Text)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> InventoryRetrievalJobInput -> f InventoryRetrievalJobInput
inventoryRetrievalJobInput_startDate = (InventoryRetrievalJobInput -> Maybe Text)
-> (InventoryRetrievalJobInput
    -> Maybe Text -> InventoryRetrievalJobInput)
-> Lens
     InventoryRetrievalJobInput
     InventoryRetrievalJobInput
     (Maybe Text)
     (Maybe Text)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> InventoryRetrievalJobInput -> f InventoryRetrievalJobInput
inventoryRetrievalJobInput_marker = (InventoryRetrievalJobInput -> Maybe Text)
-> (InventoryRetrievalJobInput
    -> Maybe Text -> InventoryRetrievalJobInput)
-> Lens
     InventoryRetrievalJobInput
     InventoryRetrievalJobInput
     (Maybe Text)
     (Maybe Text)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> InventoryRetrievalJobInput -> f InventoryRetrievalJobInput
inventoryRetrievalJobInput_limit = (InventoryRetrievalJobInput -> Maybe Text)
-> (InventoryRetrievalJobInput
    -> Maybe Text -> InventoryRetrievalJobInput)
-> Lens
     InventoryRetrievalJobInput
     InventoryRetrievalJobInput
     (Maybe Text)
     (Maybe Text)
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)

instance Prelude.Hashable InventoryRetrievalJobInput

instance Prelude.NFData InventoryRetrievalJobInput

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