{-# 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.CustomerProfiles.Types.S3SourceProperties 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
data S3SourceProperties = S3SourceProperties'
{
S3SourceProperties -> Maybe Text
bucketPrefix :: Prelude.Maybe Prelude.Text,
S3SourceProperties -> Text
bucketName :: Prelude.Text
}
deriving (S3SourceProperties -> S3SourceProperties -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3SourceProperties -> S3SourceProperties -> Bool
$c/= :: S3SourceProperties -> S3SourceProperties -> Bool
== :: S3SourceProperties -> S3SourceProperties -> Bool
$c== :: S3SourceProperties -> S3SourceProperties -> Bool
Prelude.Eq, ReadPrec [S3SourceProperties]
ReadPrec S3SourceProperties
Int -> ReadS S3SourceProperties
ReadS [S3SourceProperties]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3SourceProperties]
$creadListPrec :: ReadPrec [S3SourceProperties]
readPrec :: ReadPrec S3SourceProperties
$creadPrec :: ReadPrec S3SourceProperties
readList :: ReadS [S3SourceProperties]
$creadList :: ReadS [S3SourceProperties]
readsPrec :: Int -> ReadS S3SourceProperties
$creadsPrec :: Int -> ReadS S3SourceProperties
Prelude.Read, Int -> S3SourceProperties -> ShowS
[S3SourceProperties] -> ShowS
S3SourceProperties -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3SourceProperties] -> ShowS
$cshowList :: [S3SourceProperties] -> ShowS
show :: S3SourceProperties -> String
$cshow :: S3SourceProperties -> String
showsPrec :: Int -> S3SourceProperties -> ShowS
$cshowsPrec :: Int -> S3SourceProperties -> ShowS
Prelude.Show, forall x. Rep S3SourceProperties x -> S3SourceProperties
forall x. S3SourceProperties -> Rep S3SourceProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep S3SourceProperties x -> S3SourceProperties
$cfrom :: forall x. S3SourceProperties -> Rep S3SourceProperties x
Prelude.Generic)
newS3SourceProperties ::
Prelude.Text ->
S3SourceProperties
newS3SourceProperties :: Text -> S3SourceProperties
newS3SourceProperties Text
pBucketName_ =
S3SourceProperties'
{ $sel:bucketPrefix:S3SourceProperties' :: Maybe Text
bucketPrefix = forall a. Maybe a
Prelude.Nothing,
$sel:bucketName:S3SourceProperties' :: Text
bucketName = Text
pBucketName_
}
s3SourceProperties_bucketPrefix :: Lens.Lens' S3SourceProperties (Prelude.Maybe Prelude.Text)
s3SourceProperties_bucketPrefix :: Lens' S3SourceProperties (Maybe Text)
s3SourceProperties_bucketPrefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3SourceProperties' {Maybe Text
bucketPrefix :: Maybe Text
$sel:bucketPrefix:S3SourceProperties' :: S3SourceProperties -> Maybe Text
bucketPrefix} -> Maybe Text
bucketPrefix) (\s :: S3SourceProperties
s@S3SourceProperties' {} Maybe Text
a -> S3SourceProperties
s {$sel:bucketPrefix:S3SourceProperties' :: Maybe Text
bucketPrefix = Maybe Text
a} :: S3SourceProperties)
s3SourceProperties_bucketName :: Lens.Lens' S3SourceProperties Prelude.Text
s3SourceProperties_bucketName :: Lens' S3SourceProperties Text
s3SourceProperties_bucketName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3SourceProperties' {Text
bucketName :: Text
$sel:bucketName:S3SourceProperties' :: S3SourceProperties -> Text
bucketName} -> Text
bucketName) (\s :: S3SourceProperties
s@S3SourceProperties' {} Text
a -> S3SourceProperties
s {$sel:bucketName:S3SourceProperties' :: Text
bucketName = Text
a} :: S3SourceProperties)
instance Prelude.Hashable S3SourceProperties where
hashWithSalt :: Int -> S3SourceProperties -> Int
hashWithSalt Int
_salt S3SourceProperties' {Maybe Text
Text
bucketName :: Text
bucketPrefix :: Maybe Text
$sel:bucketName:S3SourceProperties' :: S3SourceProperties -> Text
$sel:bucketPrefix:S3SourceProperties' :: S3SourceProperties -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
bucketPrefix
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
bucketName
instance Prelude.NFData S3SourceProperties where
rnf :: S3SourceProperties -> ()
rnf S3SourceProperties' {Maybe Text
Text
bucketName :: Text
bucketPrefix :: Maybe Text
$sel:bucketName:S3SourceProperties' :: S3SourceProperties -> Text
$sel:bucketPrefix:S3SourceProperties' :: S3SourceProperties -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
bucketPrefix
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
bucketName
instance Data.ToJSON S3SourceProperties where
toJSON :: S3SourceProperties -> Value
toJSON S3SourceProperties' {Maybe Text
Text
bucketName :: Text
bucketPrefix :: Maybe Text
$sel:bucketName:S3SourceProperties' :: S3SourceProperties -> Text
$sel:bucketPrefix:S3SourceProperties' :: S3SourceProperties -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"BucketPrefix" 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
bucketPrefix,
forall a. a -> Maybe a
Prelude.Just (Key
"BucketName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
bucketName)
]
)