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

-- | Describes the options for a range inventory retrieval job.
--
-- /See:/ 'newInventoryRetrievalJobDescription' smart constructor.
data InventoryRetrievalJobDescription = 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 -> Maybe Text
endDate :: Prelude.Maybe Prelude.Text,
    -- | 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 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,
    -- | 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 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
  }
  deriving (InventoryRetrievalJobDescription
-> InventoryRetrievalJobDescription -> Bool
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]
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
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.
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:
--
-- '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@.
--
-- '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@.
--
-- '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.
--
-- '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>.
--
-- '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@.
newInventoryRetrievalJobDescription ::
  InventoryRetrievalJobDescription
newInventoryRetrievalJobDescription :: InventoryRetrievalJobDescription
newInventoryRetrievalJobDescription =
  InventoryRetrievalJobDescription'
    { $sel:endDate:InventoryRetrievalJobDescription' :: Maybe Text
endDate =
        forall a. Maybe a
Prelude.Nothing,
      $sel:format:InventoryRetrievalJobDescription' :: Maybe Text
format = forall a. Maybe a
Prelude.Nothing,
      $sel:limit:InventoryRetrievalJobDescription' :: Maybe Text
limit = forall a. Maybe a
Prelude.Nothing,
      $sel:marker:InventoryRetrievalJobDescription' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:startDate:InventoryRetrievalJobDescription' :: 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@.
inventoryRetrievalJobDescription_endDate :: Lens.Lens' InventoryRetrievalJobDescription (Prelude.Maybe Prelude.Text)
inventoryRetrievalJobDescription_endDate :: Lens' InventoryRetrievalJobDescription (Maybe Text)
inventoryRetrievalJobDescription_endDate = 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 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 :: Lens' InventoryRetrievalJobDescription (Maybe Text)
inventoryRetrievalJobDescription_format = 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 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 :: Lens' InventoryRetrievalJobDescription (Maybe Text)
inventoryRetrievalJobDescription_limit = 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)

-- | 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 :: Lens' InventoryRetrievalJobDescription (Maybe Text)
inventoryRetrievalJobDescription_marker = 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 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 :: Lens' InventoryRetrievalJobDescription (Maybe Text)
inventoryRetrievalJobDescription_startDate = 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)

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

instance
  Prelude.Hashable
    InventoryRetrievalJobDescription
  where
  hashWithSalt :: Int -> InventoryRetrievalJobDescription -> Int
hashWithSalt
    Int
_salt
    InventoryRetrievalJobDescription' {Maybe Text
startDate :: Maybe Text
marker :: Maybe Text
limit :: Maybe Text
format :: Maybe Text
endDate :: Maybe Text
$sel:startDate:InventoryRetrievalJobDescription' :: InventoryRetrievalJobDescription -> Maybe Text
$sel:marker:InventoryRetrievalJobDescription' :: InventoryRetrievalJobDescription -> Maybe Text
$sel:limit:InventoryRetrievalJobDescription' :: InventoryRetrievalJobDescription -> Maybe Text
$sel:format:InventoryRetrievalJobDescription' :: InventoryRetrievalJobDescription -> Maybe Text
$sel:endDate:InventoryRetrievalJobDescription' :: InventoryRetrievalJobDescription -> 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
format
        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
    InventoryRetrievalJobDescription
  where
  rnf :: InventoryRetrievalJobDescription -> ()
rnf InventoryRetrievalJobDescription' {Maybe Text
startDate :: Maybe Text
marker :: Maybe Text
limit :: Maybe Text
format :: Maybe Text
endDate :: Maybe Text
$sel:startDate:InventoryRetrievalJobDescription' :: InventoryRetrievalJobDescription -> Maybe Text
$sel:marker:InventoryRetrievalJobDescription' :: InventoryRetrievalJobDescription -> Maybe Text
$sel:limit:InventoryRetrievalJobDescription' :: InventoryRetrievalJobDescription -> Maybe Text
$sel:format:InventoryRetrievalJobDescription' :: InventoryRetrievalJobDescription -> Maybe Text
$sel:endDate:InventoryRetrievalJobDescription' :: InventoryRetrievalJobDescription -> 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
format
      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