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

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

-- | Contains the Amazon S3 Glacier response to your request.
--
-- /See:/ 'newDescribeVaultOutput' smart constructor.
data DescribeVaultOutput = DescribeVaultOutput'
  { -- | The name of the vault.
    DescribeVaultOutput -> Maybe Text
vaultName :: Prelude.Maybe Prelude.Text,
    -- | Total size, in bytes, of the archives in the vault as of the last
    -- inventory date. This field will return null if an inventory has not yet
    -- run on the vault, for example if you just created the vault.
    DescribeVaultOutput -> Maybe Integer
sizeInBytes :: Prelude.Maybe Prelude.Integer,
    -- | The Universal Coordinated Time (UTC) date when Amazon S3 Glacier
    -- completed the last vault inventory. This value should be a string in the
    -- ISO 8601 date format, for example @2012-03-20T17:03:43.221Z@.
    DescribeVaultOutput -> Maybe Text
lastInventoryDate :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the vault.
    DescribeVaultOutput -> Maybe Text
vaultARN :: Prelude.Maybe Prelude.Text,
    -- | The Universal Coordinated Time (UTC) date when the vault was created.
    -- This value should be a string in the ISO 8601 date format, for example
    -- @2012-03-20T17:03:43.221Z@.
    DescribeVaultOutput -> Maybe Text
creationDate :: Prelude.Maybe Prelude.Text,
    -- | The number of archives in the vault as of the last inventory date. This
    -- field will return @null@ if an inventory has not yet run on the vault,
    -- for example if you just created the vault.
    DescribeVaultOutput -> Maybe Integer
numberOfArchives :: Prelude.Maybe Prelude.Integer
  }
  deriving (DescribeVaultOutput -> DescribeVaultOutput -> Bool
(DescribeVaultOutput -> DescribeVaultOutput -> Bool)
-> (DescribeVaultOutput -> DescribeVaultOutput -> Bool)
-> Eq DescribeVaultOutput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeVaultOutput -> DescribeVaultOutput -> Bool
$c/= :: DescribeVaultOutput -> DescribeVaultOutput -> Bool
== :: DescribeVaultOutput -> DescribeVaultOutput -> Bool
$c== :: DescribeVaultOutput -> DescribeVaultOutput -> Bool
Prelude.Eq, ReadPrec [DescribeVaultOutput]
ReadPrec DescribeVaultOutput
Int -> ReadS DescribeVaultOutput
ReadS [DescribeVaultOutput]
(Int -> ReadS DescribeVaultOutput)
-> ReadS [DescribeVaultOutput]
-> ReadPrec DescribeVaultOutput
-> ReadPrec [DescribeVaultOutput]
-> Read DescribeVaultOutput
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeVaultOutput]
$creadListPrec :: ReadPrec [DescribeVaultOutput]
readPrec :: ReadPrec DescribeVaultOutput
$creadPrec :: ReadPrec DescribeVaultOutput
readList :: ReadS [DescribeVaultOutput]
$creadList :: ReadS [DescribeVaultOutput]
readsPrec :: Int -> ReadS DescribeVaultOutput
$creadsPrec :: Int -> ReadS DescribeVaultOutput
Prelude.Read, Int -> DescribeVaultOutput -> ShowS
[DescribeVaultOutput] -> ShowS
DescribeVaultOutput -> String
(Int -> DescribeVaultOutput -> ShowS)
-> (DescribeVaultOutput -> String)
-> ([DescribeVaultOutput] -> ShowS)
-> Show DescribeVaultOutput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeVaultOutput] -> ShowS
$cshowList :: [DescribeVaultOutput] -> ShowS
show :: DescribeVaultOutput -> String
$cshow :: DescribeVaultOutput -> String
showsPrec :: Int -> DescribeVaultOutput -> ShowS
$cshowsPrec :: Int -> DescribeVaultOutput -> ShowS
Prelude.Show, (forall x. DescribeVaultOutput -> Rep DescribeVaultOutput x)
-> (forall x. Rep DescribeVaultOutput x -> DescribeVaultOutput)
-> Generic DescribeVaultOutput
forall x. Rep DescribeVaultOutput x -> DescribeVaultOutput
forall x. DescribeVaultOutput -> Rep DescribeVaultOutput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeVaultOutput x -> DescribeVaultOutput
$cfrom :: forall x. DescribeVaultOutput -> Rep DescribeVaultOutput x
Prelude.Generic)

-- |
-- Create a value of 'DescribeVaultOutput' 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:
--
-- 'vaultName', 'describeVaultOutput_vaultName' - The name of the vault.
--
-- 'sizeInBytes', 'describeVaultOutput_sizeInBytes' - Total size, in bytes, of the archives in the vault as of the last
-- inventory date. This field will return null if an inventory has not yet
-- run on the vault, for example if you just created the vault.
--
-- 'lastInventoryDate', 'describeVaultOutput_lastInventoryDate' - The Universal Coordinated Time (UTC) date when Amazon S3 Glacier
-- completed the last vault inventory. This value should be a string in the
-- ISO 8601 date format, for example @2012-03-20T17:03:43.221Z@.
--
-- 'vaultARN', 'describeVaultOutput_vaultARN' - The Amazon Resource Name (ARN) of the vault.
--
-- 'creationDate', 'describeVaultOutput_creationDate' - The Universal Coordinated Time (UTC) date when the vault was created.
-- This value should be a string in the ISO 8601 date format, for example
-- @2012-03-20T17:03:43.221Z@.
--
-- 'numberOfArchives', 'describeVaultOutput_numberOfArchives' - The number of archives in the vault as of the last inventory date. This
-- field will return @null@ if an inventory has not yet run on the vault,
-- for example if you just created the vault.
newDescribeVaultOutput ::
  DescribeVaultOutput
newDescribeVaultOutput :: DescribeVaultOutput
newDescribeVaultOutput =
  DescribeVaultOutput' :: Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> DescribeVaultOutput
DescribeVaultOutput'
    { $sel:vaultName:DescribeVaultOutput' :: Maybe Text
vaultName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sizeInBytes:DescribeVaultOutput' :: Maybe Integer
sizeInBytes = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:lastInventoryDate:DescribeVaultOutput' :: Maybe Text
lastInventoryDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vaultARN:DescribeVaultOutput' :: Maybe Text
vaultARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:DescribeVaultOutput' :: Maybe Text
creationDate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:numberOfArchives:DescribeVaultOutput' :: Maybe Integer
numberOfArchives = Maybe Integer
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the vault.
describeVaultOutput_vaultName :: Lens.Lens' DescribeVaultOutput (Prelude.Maybe Prelude.Text)
describeVaultOutput_vaultName :: (Maybe Text -> f (Maybe Text))
-> DescribeVaultOutput -> f DescribeVaultOutput
describeVaultOutput_vaultName = (DescribeVaultOutput -> Maybe Text)
-> (DescribeVaultOutput -> Maybe Text -> DescribeVaultOutput)
-> Lens
     DescribeVaultOutput DescribeVaultOutput (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVaultOutput' {Maybe Text
vaultName :: Maybe Text
$sel:vaultName:DescribeVaultOutput' :: DescribeVaultOutput -> Maybe Text
vaultName} -> Maybe Text
vaultName) (\s :: DescribeVaultOutput
s@DescribeVaultOutput' {} Maybe Text
a -> DescribeVaultOutput
s {$sel:vaultName:DescribeVaultOutput' :: Maybe Text
vaultName = Maybe Text
a} :: DescribeVaultOutput)

-- | Total size, in bytes, of the archives in the vault as of the last
-- inventory date. This field will return null if an inventory has not yet
-- run on the vault, for example if you just created the vault.
describeVaultOutput_sizeInBytes :: Lens.Lens' DescribeVaultOutput (Prelude.Maybe Prelude.Integer)
describeVaultOutput_sizeInBytes :: (Maybe Integer -> f (Maybe Integer))
-> DescribeVaultOutput -> f DescribeVaultOutput
describeVaultOutput_sizeInBytes = (DescribeVaultOutput -> Maybe Integer)
-> (DescribeVaultOutput -> Maybe Integer -> DescribeVaultOutput)
-> Lens
     DescribeVaultOutput
     DescribeVaultOutput
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVaultOutput' {Maybe Integer
sizeInBytes :: Maybe Integer
$sel:sizeInBytes:DescribeVaultOutput' :: DescribeVaultOutput -> Maybe Integer
sizeInBytes} -> Maybe Integer
sizeInBytes) (\s :: DescribeVaultOutput
s@DescribeVaultOutput' {} Maybe Integer
a -> DescribeVaultOutput
s {$sel:sizeInBytes:DescribeVaultOutput' :: Maybe Integer
sizeInBytes = Maybe Integer
a} :: DescribeVaultOutput)

-- | The Universal Coordinated Time (UTC) date when Amazon S3 Glacier
-- completed the last vault inventory. This value should be a string in the
-- ISO 8601 date format, for example @2012-03-20T17:03:43.221Z@.
describeVaultOutput_lastInventoryDate :: Lens.Lens' DescribeVaultOutput (Prelude.Maybe Prelude.Text)
describeVaultOutput_lastInventoryDate :: (Maybe Text -> f (Maybe Text))
-> DescribeVaultOutput -> f DescribeVaultOutput
describeVaultOutput_lastInventoryDate = (DescribeVaultOutput -> Maybe Text)
-> (DescribeVaultOutput -> Maybe Text -> DescribeVaultOutput)
-> Lens
     DescribeVaultOutput DescribeVaultOutput (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVaultOutput' {Maybe Text
lastInventoryDate :: Maybe Text
$sel:lastInventoryDate:DescribeVaultOutput' :: DescribeVaultOutput -> Maybe Text
lastInventoryDate} -> Maybe Text
lastInventoryDate) (\s :: DescribeVaultOutput
s@DescribeVaultOutput' {} Maybe Text
a -> DescribeVaultOutput
s {$sel:lastInventoryDate:DescribeVaultOutput' :: Maybe Text
lastInventoryDate = Maybe Text
a} :: DescribeVaultOutput)

-- | The Amazon Resource Name (ARN) of the vault.
describeVaultOutput_vaultARN :: Lens.Lens' DescribeVaultOutput (Prelude.Maybe Prelude.Text)
describeVaultOutput_vaultARN :: (Maybe Text -> f (Maybe Text))
-> DescribeVaultOutput -> f DescribeVaultOutput
describeVaultOutput_vaultARN = (DescribeVaultOutput -> Maybe Text)
-> (DescribeVaultOutput -> Maybe Text -> DescribeVaultOutput)
-> Lens
     DescribeVaultOutput DescribeVaultOutput (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVaultOutput' {Maybe Text
vaultARN :: Maybe Text
$sel:vaultARN:DescribeVaultOutput' :: DescribeVaultOutput -> Maybe Text
vaultARN} -> Maybe Text
vaultARN) (\s :: DescribeVaultOutput
s@DescribeVaultOutput' {} Maybe Text
a -> DescribeVaultOutput
s {$sel:vaultARN:DescribeVaultOutput' :: Maybe Text
vaultARN = Maybe Text
a} :: DescribeVaultOutput)

-- | The Universal Coordinated Time (UTC) date when the vault was created.
-- This value should be a string in the ISO 8601 date format, for example
-- @2012-03-20T17:03:43.221Z@.
describeVaultOutput_creationDate :: Lens.Lens' DescribeVaultOutput (Prelude.Maybe Prelude.Text)
describeVaultOutput_creationDate :: (Maybe Text -> f (Maybe Text))
-> DescribeVaultOutput -> f DescribeVaultOutput
describeVaultOutput_creationDate = (DescribeVaultOutput -> Maybe Text)
-> (DescribeVaultOutput -> Maybe Text -> DescribeVaultOutput)
-> Lens
     DescribeVaultOutput DescribeVaultOutput (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVaultOutput' {Maybe Text
creationDate :: Maybe Text
$sel:creationDate:DescribeVaultOutput' :: DescribeVaultOutput -> Maybe Text
creationDate} -> Maybe Text
creationDate) (\s :: DescribeVaultOutput
s@DescribeVaultOutput' {} Maybe Text
a -> DescribeVaultOutput
s {$sel:creationDate:DescribeVaultOutput' :: Maybe Text
creationDate = Maybe Text
a} :: DescribeVaultOutput)

-- | The number of archives in the vault as of the last inventory date. This
-- field will return @null@ if an inventory has not yet run on the vault,
-- for example if you just created the vault.
describeVaultOutput_numberOfArchives :: Lens.Lens' DescribeVaultOutput (Prelude.Maybe Prelude.Integer)
describeVaultOutput_numberOfArchives :: (Maybe Integer -> f (Maybe Integer))
-> DescribeVaultOutput -> f DescribeVaultOutput
describeVaultOutput_numberOfArchives = (DescribeVaultOutput -> Maybe Integer)
-> (DescribeVaultOutput -> Maybe Integer -> DescribeVaultOutput)
-> Lens
     DescribeVaultOutput
     DescribeVaultOutput
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeVaultOutput' {Maybe Integer
numberOfArchives :: Maybe Integer
$sel:numberOfArchives:DescribeVaultOutput' :: DescribeVaultOutput -> Maybe Integer
numberOfArchives} -> Maybe Integer
numberOfArchives) (\s :: DescribeVaultOutput
s@DescribeVaultOutput' {} Maybe Integer
a -> DescribeVaultOutput
s {$sel:numberOfArchives:DescribeVaultOutput' :: Maybe Integer
numberOfArchives = Maybe Integer
a} :: DescribeVaultOutput)

instance Core.FromJSON DescribeVaultOutput where
  parseJSON :: Value -> Parser DescribeVaultOutput
parseJSON =
    String
-> (Object -> Parser DescribeVaultOutput)
-> Value
-> Parser DescribeVaultOutput
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DescribeVaultOutput"
      ( \Object
x ->
          Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> DescribeVaultOutput
DescribeVaultOutput'
            (Maybe Text
 -> Maybe Integer
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Integer
 -> DescribeVaultOutput)
-> Parser (Maybe Text)
-> Parser
     (Maybe Integer
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> DescribeVaultOutput)
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
"VaultName")
            Parser
  (Maybe Integer
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> DescribeVaultOutput)
-> Parser (Maybe Integer)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Integer
      -> DescribeVaultOutput)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SizeInBytes")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Integer
   -> DescribeVaultOutput)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Integer -> DescribeVaultOutput)
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
"LastInventoryDate")
            Parser
  (Maybe Text -> Maybe Text -> Maybe Integer -> DescribeVaultOutput)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Integer -> DescribeVaultOutput)
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
"VaultARN")
            Parser (Maybe Text -> Maybe Integer -> DescribeVaultOutput)
-> Parser (Maybe Text)
-> Parser (Maybe Integer -> DescribeVaultOutput)
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
"CreationDate")
            Parser (Maybe Integer -> DescribeVaultOutput)
-> Parser (Maybe Integer) -> Parser DescribeVaultOutput
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NumberOfArchives")
      )

instance Prelude.Hashable DescribeVaultOutput

instance Prelude.NFData DescribeVaultOutput