{-# 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.ImageBuilder.Types.S3ExportConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ImageBuilder.Types.DiskImageFormat
import qualified Amazonka.Prelude as Prelude
data S3ExportConfiguration = S3ExportConfiguration'
{
S3ExportConfiguration -> Maybe Text
s3Prefix :: Prelude.Maybe Prelude.Text,
S3ExportConfiguration -> Text
roleName :: Prelude.Text,
S3ExportConfiguration -> DiskImageFormat
diskImageFormat :: DiskImageFormat,
S3ExportConfiguration -> Text
s3Bucket :: Prelude.Text
}
deriving (S3ExportConfiguration -> S3ExportConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3ExportConfiguration -> S3ExportConfiguration -> Bool
$c/= :: S3ExportConfiguration -> S3ExportConfiguration -> Bool
== :: S3ExportConfiguration -> S3ExportConfiguration -> Bool
$c== :: S3ExportConfiguration -> S3ExportConfiguration -> Bool
Prelude.Eq, ReadPrec [S3ExportConfiguration]
ReadPrec S3ExportConfiguration
Int -> ReadS S3ExportConfiguration
ReadS [S3ExportConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3ExportConfiguration]
$creadListPrec :: ReadPrec [S3ExportConfiguration]
readPrec :: ReadPrec S3ExportConfiguration
$creadPrec :: ReadPrec S3ExportConfiguration
readList :: ReadS [S3ExportConfiguration]
$creadList :: ReadS [S3ExportConfiguration]
readsPrec :: Int -> ReadS S3ExportConfiguration
$creadsPrec :: Int -> ReadS S3ExportConfiguration
Prelude.Read, Int -> S3ExportConfiguration -> ShowS
[S3ExportConfiguration] -> ShowS
S3ExportConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3ExportConfiguration] -> ShowS
$cshowList :: [S3ExportConfiguration] -> ShowS
show :: S3ExportConfiguration -> String
$cshow :: S3ExportConfiguration -> String
showsPrec :: Int -> S3ExportConfiguration -> ShowS
$cshowsPrec :: Int -> S3ExportConfiguration -> ShowS
Prelude.Show, forall x. Rep S3ExportConfiguration x -> S3ExportConfiguration
forall x. S3ExportConfiguration -> Rep S3ExportConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep S3ExportConfiguration x -> S3ExportConfiguration
$cfrom :: forall x. S3ExportConfiguration -> Rep S3ExportConfiguration x
Prelude.Generic)
newS3ExportConfiguration ::
Prelude.Text ->
DiskImageFormat ->
Prelude.Text ->
S3ExportConfiguration
newS3ExportConfiguration :: Text -> DiskImageFormat -> Text -> S3ExportConfiguration
newS3ExportConfiguration
Text
pRoleName_
DiskImageFormat
pDiskImageFormat_
Text
pS3Bucket_ =
S3ExportConfiguration'
{ $sel:s3Prefix:S3ExportConfiguration' :: Maybe Text
s3Prefix = forall a. Maybe a
Prelude.Nothing,
$sel:roleName:S3ExportConfiguration' :: Text
roleName = Text
pRoleName_,
$sel:diskImageFormat:S3ExportConfiguration' :: DiskImageFormat
diskImageFormat = DiskImageFormat
pDiskImageFormat_,
$sel:s3Bucket:S3ExportConfiguration' :: Text
s3Bucket = Text
pS3Bucket_
}
s3ExportConfiguration_s3Prefix :: Lens.Lens' S3ExportConfiguration (Prelude.Maybe Prelude.Text)
s3ExportConfiguration_s3Prefix :: Lens' S3ExportConfiguration (Maybe Text)
s3ExportConfiguration_s3Prefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ExportConfiguration' {Maybe Text
s3Prefix :: Maybe Text
$sel:s3Prefix:S3ExportConfiguration' :: S3ExportConfiguration -> Maybe Text
s3Prefix} -> Maybe Text
s3Prefix) (\s :: S3ExportConfiguration
s@S3ExportConfiguration' {} Maybe Text
a -> S3ExportConfiguration
s {$sel:s3Prefix:S3ExportConfiguration' :: Maybe Text
s3Prefix = Maybe Text
a} :: S3ExportConfiguration)
s3ExportConfiguration_roleName :: Lens.Lens' S3ExportConfiguration Prelude.Text
s3ExportConfiguration_roleName :: Lens' S3ExportConfiguration Text
s3ExportConfiguration_roleName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ExportConfiguration' {Text
roleName :: Text
$sel:roleName:S3ExportConfiguration' :: S3ExportConfiguration -> Text
roleName} -> Text
roleName) (\s :: S3ExportConfiguration
s@S3ExportConfiguration' {} Text
a -> S3ExportConfiguration
s {$sel:roleName:S3ExportConfiguration' :: Text
roleName = Text
a} :: S3ExportConfiguration)
s3ExportConfiguration_diskImageFormat :: Lens.Lens' S3ExportConfiguration DiskImageFormat
s3ExportConfiguration_diskImageFormat :: Lens' S3ExportConfiguration DiskImageFormat
s3ExportConfiguration_diskImageFormat = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ExportConfiguration' {DiskImageFormat
diskImageFormat :: DiskImageFormat
$sel:diskImageFormat:S3ExportConfiguration' :: S3ExportConfiguration -> DiskImageFormat
diskImageFormat} -> DiskImageFormat
diskImageFormat) (\s :: S3ExportConfiguration
s@S3ExportConfiguration' {} DiskImageFormat
a -> S3ExportConfiguration
s {$sel:diskImageFormat:S3ExportConfiguration' :: DiskImageFormat
diskImageFormat = DiskImageFormat
a} :: S3ExportConfiguration)
s3ExportConfiguration_s3Bucket :: Lens.Lens' S3ExportConfiguration Prelude.Text
s3ExportConfiguration_s3Bucket :: Lens' S3ExportConfiguration Text
s3ExportConfiguration_s3Bucket = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3ExportConfiguration' {Text
s3Bucket :: Text
$sel:s3Bucket:S3ExportConfiguration' :: S3ExportConfiguration -> Text
s3Bucket} -> Text
s3Bucket) (\s :: S3ExportConfiguration
s@S3ExportConfiguration' {} Text
a -> S3ExportConfiguration
s {$sel:s3Bucket:S3ExportConfiguration' :: Text
s3Bucket = Text
a} :: S3ExportConfiguration)
instance Data.FromJSON S3ExportConfiguration where
parseJSON :: Value -> Parser S3ExportConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"S3ExportConfiguration"
( \Object
x ->
Maybe Text
-> Text -> DiskImageFormat -> Text -> S3ExportConfiguration
S3ExportConfiguration'
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
"s3Prefix")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"roleName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"diskImageFormat")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"s3Bucket")
)
instance Prelude.Hashable S3ExportConfiguration where
hashWithSalt :: Int -> S3ExportConfiguration -> Int
hashWithSalt Int
_salt S3ExportConfiguration' {Maybe Text
Text
DiskImageFormat
s3Bucket :: Text
diskImageFormat :: DiskImageFormat
roleName :: Text
s3Prefix :: Maybe Text
$sel:s3Bucket:S3ExportConfiguration' :: S3ExportConfiguration -> Text
$sel:diskImageFormat:S3ExportConfiguration' :: S3ExportConfiguration -> DiskImageFormat
$sel:roleName:S3ExportConfiguration' :: S3ExportConfiguration -> Text
$sel:s3Prefix:S3ExportConfiguration' :: S3ExportConfiguration -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
s3Prefix
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` DiskImageFormat
diskImageFormat
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
s3Bucket
instance Prelude.NFData S3ExportConfiguration where
rnf :: S3ExportConfiguration -> ()
rnf S3ExportConfiguration' {Maybe Text
Text
DiskImageFormat
s3Bucket :: Text
diskImageFormat :: DiskImageFormat
roleName :: Text
s3Prefix :: Maybe Text
$sel:s3Bucket:S3ExportConfiguration' :: S3ExportConfiguration -> Text
$sel:diskImageFormat:S3ExportConfiguration' :: S3ExportConfiguration -> DiskImageFormat
$sel:roleName:S3ExportConfiguration' :: S3ExportConfiguration -> Text
$sel:s3Prefix:S3ExportConfiguration' :: S3ExportConfiguration -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
s3Prefix
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
roleName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf DiskImageFormat
diskImageFormat
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
s3Bucket
instance Data.ToJSON S3ExportConfiguration where
toJSON :: S3ExportConfiguration -> Value
toJSON S3ExportConfiguration' {Maybe Text
Text
DiskImageFormat
s3Bucket :: Text
diskImageFormat :: DiskImageFormat
roleName :: Text
s3Prefix :: Maybe Text
$sel:s3Bucket:S3ExportConfiguration' :: S3ExportConfiguration -> Text
$sel:diskImageFormat:S3ExportConfiguration' :: S3ExportConfiguration -> DiskImageFormat
$sel:roleName:S3ExportConfiguration' :: S3ExportConfiguration -> Text
$sel:s3Prefix:S3ExportConfiguration' :: S3ExportConfiguration -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"s3Prefix" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
s3Prefix,
forall a. a -> Maybe a
Prelude.Just (Key
"roleName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
roleName),
forall a. a -> Maybe a
Prelude.Just
(Key
"diskImageFormat" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= DiskImageFormat
diskImageFormat),
forall a. a -> Maybe a
Prelude.Just (Key
"s3Bucket" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
s3Bucket)
]
)