{-# 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 #-}
module Amazonka.S3.Types.InventoryS3BucketDestination 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
import Amazonka.S3.Internal
import Amazonka.S3.Types.InventoryEncryption
import Amazonka.S3.Types.InventoryFormat
data InventoryS3BucketDestination = InventoryS3BucketDestination'
{
InventoryS3BucketDestination -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
InventoryS3BucketDestination -> Maybe InventoryEncryption
encryption :: Prelude.Maybe InventoryEncryption,
InventoryS3BucketDestination -> Maybe Text
prefix :: Prelude.Maybe Prelude.Text,
InventoryS3BucketDestination -> BucketName
bucket :: BucketName,
InventoryS3BucketDestination -> InventoryFormat
format :: InventoryFormat
}
deriving (InventoryS3BucketDestination
-> InventoryS3BucketDestination -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InventoryS3BucketDestination
-> InventoryS3BucketDestination -> Bool
$c/= :: InventoryS3BucketDestination
-> InventoryS3BucketDestination -> Bool
== :: InventoryS3BucketDestination
-> InventoryS3BucketDestination -> Bool
$c== :: InventoryS3BucketDestination
-> InventoryS3BucketDestination -> Bool
Prelude.Eq, Int -> InventoryS3BucketDestination -> ShowS
[InventoryS3BucketDestination] -> ShowS
InventoryS3BucketDestination -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InventoryS3BucketDestination] -> ShowS
$cshowList :: [InventoryS3BucketDestination] -> ShowS
show :: InventoryS3BucketDestination -> String
$cshow :: InventoryS3BucketDestination -> String
showsPrec :: Int -> InventoryS3BucketDestination -> ShowS
$cshowsPrec :: Int -> InventoryS3BucketDestination -> ShowS
Prelude.Show, forall x.
Rep InventoryS3BucketDestination x -> InventoryS3BucketDestination
forall x.
InventoryS3BucketDestination -> Rep InventoryS3BucketDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InventoryS3BucketDestination x -> InventoryS3BucketDestination
$cfrom :: forall x.
InventoryS3BucketDestination -> Rep InventoryS3BucketDestination x
Prelude.Generic)
newInventoryS3BucketDestination ::
BucketName ->
InventoryFormat ->
InventoryS3BucketDestination
newInventoryS3BucketDestination :: BucketName -> InventoryFormat -> InventoryS3BucketDestination
newInventoryS3BucketDestination BucketName
pBucket_ InventoryFormat
pFormat_ =
InventoryS3BucketDestination'
{ $sel:accountId:InventoryS3BucketDestination' :: Maybe Text
accountId =
forall a. Maybe a
Prelude.Nothing,
$sel:encryption:InventoryS3BucketDestination' :: Maybe InventoryEncryption
encryption = forall a. Maybe a
Prelude.Nothing,
$sel:prefix:InventoryS3BucketDestination' :: Maybe Text
prefix = forall a. Maybe a
Prelude.Nothing,
$sel:bucket:InventoryS3BucketDestination' :: BucketName
bucket = BucketName
pBucket_,
$sel:format:InventoryS3BucketDestination' :: InventoryFormat
format = InventoryFormat
pFormat_
}
inventoryS3BucketDestination_accountId :: Lens.Lens' InventoryS3BucketDestination (Prelude.Maybe Prelude.Text)
inventoryS3BucketDestination_accountId :: Lens' InventoryS3BucketDestination (Maybe Text)
inventoryS3BucketDestination_accountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryS3BucketDestination' {Maybe Text
accountId :: Maybe Text
$sel:accountId:InventoryS3BucketDestination' :: InventoryS3BucketDestination -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: InventoryS3BucketDestination
s@InventoryS3BucketDestination' {} Maybe Text
a -> InventoryS3BucketDestination
s {$sel:accountId:InventoryS3BucketDestination' :: Maybe Text
accountId = Maybe Text
a} :: InventoryS3BucketDestination)
inventoryS3BucketDestination_encryption :: Lens.Lens' InventoryS3BucketDestination (Prelude.Maybe InventoryEncryption)
inventoryS3BucketDestination_encryption :: Lens' InventoryS3BucketDestination (Maybe InventoryEncryption)
inventoryS3BucketDestination_encryption = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryS3BucketDestination' {Maybe InventoryEncryption
encryption :: Maybe InventoryEncryption
$sel:encryption:InventoryS3BucketDestination' :: InventoryS3BucketDestination -> Maybe InventoryEncryption
encryption} -> Maybe InventoryEncryption
encryption) (\s :: InventoryS3BucketDestination
s@InventoryS3BucketDestination' {} Maybe InventoryEncryption
a -> InventoryS3BucketDestination
s {$sel:encryption:InventoryS3BucketDestination' :: Maybe InventoryEncryption
encryption = Maybe InventoryEncryption
a} :: InventoryS3BucketDestination)
inventoryS3BucketDestination_prefix :: Lens.Lens' InventoryS3BucketDestination (Prelude.Maybe Prelude.Text)
inventoryS3BucketDestination_prefix :: Lens' InventoryS3BucketDestination (Maybe Text)
inventoryS3BucketDestination_prefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryS3BucketDestination' {Maybe Text
prefix :: Maybe Text
$sel:prefix:InventoryS3BucketDestination' :: InventoryS3BucketDestination -> Maybe Text
prefix} -> Maybe Text
prefix) (\s :: InventoryS3BucketDestination
s@InventoryS3BucketDestination' {} Maybe Text
a -> InventoryS3BucketDestination
s {$sel:prefix:InventoryS3BucketDestination' :: Maybe Text
prefix = Maybe Text
a} :: InventoryS3BucketDestination)
inventoryS3BucketDestination_bucket :: Lens.Lens' InventoryS3BucketDestination BucketName
inventoryS3BucketDestination_bucket :: Lens' InventoryS3BucketDestination BucketName
inventoryS3BucketDestination_bucket = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryS3BucketDestination' {BucketName
bucket :: BucketName
$sel:bucket:InventoryS3BucketDestination' :: InventoryS3BucketDestination -> BucketName
bucket} -> BucketName
bucket) (\s :: InventoryS3BucketDestination
s@InventoryS3BucketDestination' {} BucketName
a -> InventoryS3BucketDestination
s {$sel:bucket:InventoryS3BucketDestination' :: BucketName
bucket = BucketName
a} :: InventoryS3BucketDestination)
inventoryS3BucketDestination_format :: Lens.Lens' InventoryS3BucketDestination InventoryFormat
inventoryS3BucketDestination_format :: Lens' InventoryS3BucketDestination InventoryFormat
inventoryS3BucketDestination_format = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InventoryS3BucketDestination' {InventoryFormat
format :: InventoryFormat
$sel:format:InventoryS3BucketDestination' :: InventoryS3BucketDestination -> InventoryFormat
format} -> InventoryFormat
format) (\s :: InventoryS3BucketDestination
s@InventoryS3BucketDestination' {} InventoryFormat
a -> InventoryS3BucketDestination
s {$sel:format:InventoryS3BucketDestination' :: InventoryFormat
format = InventoryFormat
a} :: InventoryS3BucketDestination)
instance Data.FromXML InventoryS3BucketDestination where
parseXML :: [Node] -> Either String InventoryS3BucketDestination
parseXML [Node]
x =
Maybe Text
-> Maybe InventoryEncryption
-> Maybe Text
-> BucketName
-> InventoryFormat
-> InventoryS3BucketDestination
InventoryS3BucketDestination'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"AccountId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Encryption")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Prefix")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"Bucket")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"Format")
instance
Prelude.Hashable
InventoryS3BucketDestination
where
hashWithSalt :: Int -> InventoryS3BucketDestination -> Int
hashWithSalt Int
_salt InventoryS3BucketDestination' {Maybe Text
Maybe InventoryEncryption
BucketName
InventoryFormat
format :: InventoryFormat
bucket :: BucketName
prefix :: Maybe Text
encryption :: Maybe InventoryEncryption
accountId :: Maybe Text
$sel:format:InventoryS3BucketDestination' :: InventoryS3BucketDestination -> InventoryFormat
$sel:bucket:InventoryS3BucketDestination' :: InventoryS3BucketDestination -> BucketName
$sel:prefix:InventoryS3BucketDestination' :: InventoryS3BucketDestination -> Maybe Text
$sel:encryption:InventoryS3BucketDestination' :: InventoryS3BucketDestination -> Maybe InventoryEncryption
$sel:accountId:InventoryS3BucketDestination' :: InventoryS3BucketDestination -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
accountId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InventoryEncryption
encryption
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
prefix
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` BucketName
bucket
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` InventoryFormat
format
instance Prelude.NFData InventoryS3BucketDestination where
rnf :: InventoryS3BucketDestination -> ()
rnf InventoryS3BucketDestination' {Maybe Text
Maybe InventoryEncryption
BucketName
InventoryFormat
format :: InventoryFormat
bucket :: BucketName
prefix :: Maybe Text
encryption :: Maybe InventoryEncryption
accountId :: Maybe Text
$sel:format:InventoryS3BucketDestination' :: InventoryS3BucketDestination -> InventoryFormat
$sel:bucket:InventoryS3BucketDestination' :: InventoryS3BucketDestination -> BucketName
$sel:prefix:InventoryS3BucketDestination' :: InventoryS3BucketDestination -> Maybe Text
$sel:encryption:InventoryS3BucketDestination' :: InventoryS3BucketDestination -> Maybe InventoryEncryption
$sel:accountId:InventoryS3BucketDestination' :: InventoryS3BucketDestination -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
accountId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe InventoryEncryption
encryption
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
prefix
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf BucketName
bucket
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf InventoryFormat
format
instance Data.ToXML InventoryS3BucketDestination where
toXML :: InventoryS3BucketDestination -> XML
toXML InventoryS3BucketDestination' {Maybe Text
Maybe InventoryEncryption
BucketName
InventoryFormat
format :: InventoryFormat
bucket :: BucketName
prefix :: Maybe Text
encryption :: Maybe InventoryEncryption
accountId :: Maybe Text
$sel:format:InventoryS3BucketDestination' :: InventoryS3BucketDestination -> InventoryFormat
$sel:bucket:InventoryS3BucketDestination' :: InventoryS3BucketDestination -> BucketName
$sel:prefix:InventoryS3BucketDestination' :: InventoryS3BucketDestination -> Maybe Text
$sel:encryption:InventoryS3BucketDestination' :: InventoryS3BucketDestination -> Maybe InventoryEncryption
$sel:accountId:InventoryS3BucketDestination' :: InventoryS3BucketDestination -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ Name
"AccountId" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe Text
accountId,
Name
"Encryption" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe InventoryEncryption
encryption,
Name
"Prefix" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe Text
prefix,
Name
"Bucket" forall a. ToXML a => Name -> a -> XML
Data.@= BucketName
bucket,
Name
"Format" forall a. ToXML a => Name -> a -> XML
Data.@= InventoryFormat
format
]