{-# 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.InventoryRetrievalJobDescription
-- 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.InventoryRetrievalJobDescription where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes the options for a range inventory retrieval job.
--
-- /See:/ 'newInventoryRetrievalJobDescription' smart constructor.
data InventoryRetrievalJobDescription = InventoryRetrievalJobDescription'
  { -- | The output format for the vault inventory list, which is set by the
    -- __InitiateJob__ request when initiating a job to retrieve a vault
    -- inventory. Valid values are @CSV@ and @JSON@.
    InventoryRetrievalJobDescription -> Maybe Text
format :: Prelude.Maybe Prelude.Text,
    -- | 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@.
    InventoryRetrievalJobDescription -> Maybe Text
endDate :: Prelude.Maybe Prelude.Text,
    -- | The start of the date range in Universal Coordinated Time (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@.
    InventoryRetrievalJobDescription -> 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@. For more information,
    -- see
    -- <https://docs.aws.amazon.com/amazonglacier/latest/dev/api-initiate-job-post.html#api-initiate-job-post-vault-inventory-list-filtering Range Inventory Retrieval>.
    InventoryRetrievalJobDescription -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of inventory items returned per vault inventory
    -- retrieval request. This limit is set when initiating the job with the a
    -- __InitiateJob__ request.
    InventoryRetrievalJobDescription -> Maybe Text
limit :: Prelude.Maybe Prelude.Text
  }
  deriving (InventoryRetrievalJobDescription
-> InventoryRetrievalJobDescription -> Bool
(InventoryRetrievalJobDescription
 -> InventoryRetrievalJobDescription -> Bool)
-> (InventoryRetrievalJobDescription
    -> InventoryRetrievalJobDescription -> Bool)
-> Eq InventoryRetrievalJobDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InventoryRetrievalJobDescription
-> InventoryRetrievalJobDescription -> Bool
$c/= :: InventoryRetrievalJobDescription
-> InventoryRetrievalJobDescription -> Bool
== :: InventoryRetrievalJobDescription
-> InventoryRetrievalJobDescription -> Bool
$c== :: InventoryRetrievalJobDescription
-> InventoryRetrievalJobDescription -> Bool
Prelude.Eq, ReadPrec [InventoryRetrievalJobDescription]
ReadPrec InventoryRetrievalJobDescription
Int -> ReadS InventoryRetrievalJobDescription
ReadS [InventoryRetrievalJobDescription]
(Int -> ReadS InventoryRetrievalJobDescription)
-> ReadS [InventoryRetrievalJobDescription]
-> ReadPrec InventoryRetrievalJobDescription
-> ReadPrec [InventoryRetrievalJobDescription]
-> Read InventoryRetrievalJobDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InventoryRetrievalJobDescription]
$creadListPrec :: ReadPrec [InventoryRetrievalJobDescription]
readPrec :: ReadPrec InventoryRetrievalJobDescription
$creadPrec :: ReadPrec InventoryRetrievalJobDescription
readList :: ReadS [InventoryRetrievalJobDescription]
$creadList :: ReadS [InventoryRetrievalJobDescription]
readsPrec :: Int -> ReadS InventoryRetrievalJobDescription
$creadsPrec :: Int -> ReadS InventoryRetrievalJobDescription
Prelude.Read, Int -> InventoryRetrievalJobDescription -> ShowS
[InventoryRetrievalJobDescription] -> ShowS
InventoryRetrievalJobDescription -> String
(Int -> InventoryRetrievalJobDescription -> ShowS)
-> (InventoryRetrievalJobDescription -> String)
-> ([InventoryRetrievalJobDescription] -> ShowS)
-> Show InventoryRetrievalJobDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InventoryRetrievalJobDescription] -> ShowS
$cshowList :: [InventoryRetrievalJobDescription] -> ShowS
show :: InventoryRetrievalJobDescription -> String
$cshow :: InventoryRetrievalJobDescription -> String
showsPrec :: Int -> InventoryRetrievalJobDescription -> ShowS
$cshowsPrec :: Int -> InventoryRetrievalJobDescription -> ShowS
Prelude.Show, (forall x.
 InventoryRetrievalJobDescription
 -> Rep InventoryRetrievalJobDescription x)
-> (forall x.
    Rep InventoryRetrievalJobDescription x
    -> InventoryRetrievalJobDescription)
-> Generic InventoryRetrievalJobDescription
forall x.
Rep InventoryRetrievalJobDescription x
-> InventoryRetrievalJobDescription
forall x.
InventoryRetrievalJobDescription
-> Rep InventoryRetrievalJobDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InventoryRetrievalJobDescription x
-> InventoryRetrievalJobDescription
$cfrom :: forall x.
InventoryRetrievalJobDescription
-> Rep InventoryRetrievalJobDescription x
Prelude.Generic)

-- |
-- Create a value of 'InventoryRetrievalJobDescription' 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:
--
-- 'format', 'inventoryRetrievalJobDescription_format' - The output format for the vault inventory list, which is set by the
-- __InitiateJob__ request when initiating a job to retrieve a vault
-- inventory. Valid values are @CSV@ and @JSON@.
--
-- 'endDate', 'inventoryRetrievalJobDescription_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', 'inventoryRetrievalJobDescription_startDate' - The start of the date range in Universal Coordinated Time (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', 'inventoryRetrievalJobDescription_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@. For more information,
-- see
-- <https://docs.aws.amazon.com/amazonglacier/latest/dev/api-initiate-job-post.html#api-initiate-job-post-vault-inventory-list-filtering Range Inventory Retrieval>.
--
-- 'limit', 'inventoryRetrievalJobDescription_limit' - The maximum number of inventory items returned per vault inventory
-- retrieval request. This limit is set when initiating the job with the a
-- __InitiateJob__ request.
newInventoryRetrievalJobDescription ::
  InventoryRetrievalJobDescription
newInventoryRetrievalJobDescription :: InventoryRetrievalJobDescription
newInventoryRetrievalJobDescription =
  InventoryRetrievalJobDescription' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> InventoryRetrievalJobDescription
InventoryRetrievalJobDescription'
    { $sel:format:InventoryRetrievalJobDescription' :: Maybe Text
format =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:endDate:InventoryRetrievalJobDescription' :: Maybe Text
endDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:startDate:InventoryRetrievalJobDescription' :: Maybe Text
startDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:InventoryRetrievalJobDescription' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:InventoryRetrievalJobDescription' :: Maybe Text
limit = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The output format for the vault inventory list, which is set by the
-- __InitiateJob__ request when initiating a job to retrieve a vault
-- inventory. Valid values are @CSV@ and @JSON@.
inventoryRetrievalJobDescription_format :: Lens.Lens' InventoryRetrievalJobDescription (Prelude.Maybe Prelude.Text)
inventoryRetrievalJobDescription_format :: (Maybe Text -> f (Maybe Text))
-> InventoryRetrievalJobDescription
-> f InventoryRetrievalJobDescription
inventoryRetrievalJobDescription_format = (InventoryRetrievalJobDescription -> Maybe Text)
-> (InventoryRetrievalJobDescription
    -> Maybe Text -> InventoryRetrievalJobDescription)
-> Lens
     InventoryRetrievalJobDescription
     InventoryRetrievalJobDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryRetrievalJobDescription' {Maybe Text
format :: Maybe Text
$sel:format:InventoryRetrievalJobDescription' :: InventoryRetrievalJobDescription -> Maybe Text
format} -> Maybe Text
format) (\s :: InventoryRetrievalJobDescription
s@InventoryRetrievalJobDescription' {} Maybe Text
a -> InventoryRetrievalJobDescription
s {$sel:format:InventoryRetrievalJobDescription' :: Maybe Text
format = Maybe Text
a} :: InventoryRetrievalJobDescription)

-- | 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@.
inventoryRetrievalJobDescription_endDate :: Lens.Lens' InventoryRetrievalJobDescription (Prelude.Maybe Prelude.Text)
inventoryRetrievalJobDescription_endDate :: (Maybe Text -> f (Maybe Text))
-> InventoryRetrievalJobDescription
-> f InventoryRetrievalJobDescription
inventoryRetrievalJobDescription_endDate = (InventoryRetrievalJobDescription -> Maybe Text)
-> (InventoryRetrievalJobDescription
    -> Maybe Text -> InventoryRetrievalJobDescription)
-> Lens
     InventoryRetrievalJobDescription
     InventoryRetrievalJobDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryRetrievalJobDescription' {Maybe Text
endDate :: Maybe Text
$sel:endDate:InventoryRetrievalJobDescription' :: InventoryRetrievalJobDescription -> Maybe Text
endDate} -> Maybe Text
endDate) (\s :: InventoryRetrievalJobDescription
s@InventoryRetrievalJobDescription' {} Maybe Text
a -> InventoryRetrievalJobDescription
s {$sel:endDate:InventoryRetrievalJobDescription' :: Maybe Text
endDate = Maybe Text
a} :: InventoryRetrievalJobDescription)

-- | The start of the date range in Universal Coordinated Time (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@.
inventoryRetrievalJobDescription_startDate :: Lens.Lens' InventoryRetrievalJobDescription (Prelude.Maybe Prelude.Text)
inventoryRetrievalJobDescription_startDate :: (Maybe Text -> f (Maybe Text))
-> InventoryRetrievalJobDescription
-> f InventoryRetrievalJobDescription
inventoryRetrievalJobDescription_startDate = (InventoryRetrievalJobDescription -> Maybe Text)
-> (InventoryRetrievalJobDescription
    -> Maybe Text -> InventoryRetrievalJobDescription)
-> Lens
     InventoryRetrievalJobDescription
     InventoryRetrievalJobDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryRetrievalJobDescription' {Maybe Text
startDate :: Maybe Text
$sel:startDate:InventoryRetrievalJobDescription' :: InventoryRetrievalJobDescription -> Maybe Text
startDate} -> Maybe Text
startDate) (\s :: InventoryRetrievalJobDescription
s@InventoryRetrievalJobDescription' {} Maybe Text
a -> InventoryRetrievalJobDescription
s {$sel:startDate:InventoryRetrievalJobDescription' :: Maybe Text
startDate = Maybe Text
a} :: InventoryRetrievalJobDescription)

-- | 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@. For more information,
-- see
-- <https://docs.aws.amazon.com/amazonglacier/latest/dev/api-initiate-job-post.html#api-initiate-job-post-vault-inventory-list-filtering Range Inventory Retrieval>.
inventoryRetrievalJobDescription_marker :: Lens.Lens' InventoryRetrievalJobDescription (Prelude.Maybe Prelude.Text)
inventoryRetrievalJobDescription_marker :: (Maybe Text -> f (Maybe Text))
-> InventoryRetrievalJobDescription
-> f InventoryRetrievalJobDescription
inventoryRetrievalJobDescription_marker = (InventoryRetrievalJobDescription -> Maybe Text)
-> (InventoryRetrievalJobDescription
    -> Maybe Text -> InventoryRetrievalJobDescription)
-> Lens
     InventoryRetrievalJobDescription
     InventoryRetrievalJobDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryRetrievalJobDescription' {Maybe Text
marker :: Maybe Text
$sel:marker:InventoryRetrievalJobDescription' :: InventoryRetrievalJobDescription -> Maybe Text
marker} -> Maybe Text
marker) (\s :: InventoryRetrievalJobDescription
s@InventoryRetrievalJobDescription' {} Maybe Text
a -> InventoryRetrievalJobDescription
s {$sel:marker:InventoryRetrievalJobDescription' :: Maybe Text
marker = Maybe Text
a} :: InventoryRetrievalJobDescription)

-- | The maximum number of inventory items returned per vault inventory
-- retrieval request. This limit is set when initiating the job with the a
-- __InitiateJob__ request.
inventoryRetrievalJobDescription_limit :: Lens.Lens' InventoryRetrievalJobDescription (Prelude.Maybe Prelude.Text)
inventoryRetrievalJobDescription_limit :: (Maybe Text -> f (Maybe Text))
-> InventoryRetrievalJobDescription
-> f InventoryRetrievalJobDescription
inventoryRetrievalJobDescription_limit = (InventoryRetrievalJobDescription -> Maybe Text)
-> (InventoryRetrievalJobDescription
    -> Maybe Text -> InventoryRetrievalJobDescription)
-> Lens
     InventoryRetrievalJobDescription
     InventoryRetrievalJobDescription
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryRetrievalJobDescription' {Maybe Text
limit :: Maybe Text
$sel:limit:InventoryRetrievalJobDescription' :: InventoryRetrievalJobDescription -> Maybe Text
limit} -> Maybe Text
limit) (\s :: InventoryRetrievalJobDescription
s@InventoryRetrievalJobDescription' {} Maybe Text
a -> InventoryRetrievalJobDescription
s {$sel:limit:InventoryRetrievalJobDescription' :: Maybe Text
limit = Maybe Text
a} :: InventoryRetrievalJobDescription)

instance
  Core.FromJSON
    InventoryRetrievalJobDescription
  where
  parseJSON :: Value -> Parser InventoryRetrievalJobDescription
parseJSON =
    String
-> (Object -> Parser InventoryRetrievalJobDescription)
-> Value
-> Parser InventoryRetrievalJobDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"InventoryRetrievalJobDescription"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> InventoryRetrievalJobDescription
InventoryRetrievalJobDescription'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> InventoryRetrievalJobDescription)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> InventoryRetrievalJobDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Format")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> InventoryRetrievalJobDescription)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> InventoryRetrievalJobDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EndDate")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> InventoryRetrievalJobDescription)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> InventoryRetrievalJobDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StartDate")
            Parser
  (Maybe Text -> Maybe Text -> InventoryRetrievalJobDescription)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> InventoryRetrievalJobDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Marker")
            Parser (Maybe Text -> InventoryRetrievalJobDescription)
-> Parser (Maybe Text) -> Parser InventoryRetrievalJobDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Limit")
      )

instance
  Prelude.Hashable
    InventoryRetrievalJobDescription

instance
  Prelude.NFData
    InventoryRetrievalJobDescription