{-# 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.KinesisAnalytics.Types.S3Configuration 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 S3Configuration = S3Configuration'
{
S3Configuration -> Text
roleARN :: Prelude.Text,
S3Configuration -> Text
bucketARN :: Prelude.Text,
S3Configuration -> Text
fileKey :: Prelude.Text
}
deriving (S3Configuration -> S3Configuration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3Configuration -> S3Configuration -> Bool
$c/= :: S3Configuration -> S3Configuration -> Bool
== :: S3Configuration -> S3Configuration -> Bool
$c== :: S3Configuration -> S3Configuration -> Bool
Prelude.Eq, ReadPrec [S3Configuration]
ReadPrec S3Configuration
Int -> ReadS S3Configuration
ReadS [S3Configuration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3Configuration]
$creadListPrec :: ReadPrec [S3Configuration]
readPrec :: ReadPrec S3Configuration
$creadPrec :: ReadPrec S3Configuration
readList :: ReadS [S3Configuration]
$creadList :: ReadS [S3Configuration]
readsPrec :: Int -> ReadS S3Configuration
$creadsPrec :: Int -> ReadS S3Configuration
Prelude.Read, Int -> S3Configuration -> ShowS
[S3Configuration] -> ShowS
S3Configuration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3Configuration] -> ShowS
$cshowList :: [S3Configuration] -> ShowS
show :: S3Configuration -> String
$cshow :: S3Configuration -> String
showsPrec :: Int -> S3Configuration -> ShowS
$cshowsPrec :: Int -> S3Configuration -> ShowS
Prelude.Show, forall x. Rep S3Configuration x -> S3Configuration
forall x. S3Configuration -> Rep S3Configuration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep S3Configuration x -> S3Configuration
$cfrom :: forall x. S3Configuration -> Rep S3Configuration x
Prelude.Generic)
newS3Configuration ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
S3Configuration
newS3Configuration :: Text -> Text -> Text -> S3Configuration
newS3Configuration Text
pRoleARN_ Text
pBucketARN_ Text
pFileKey_ =
S3Configuration'
{ $sel:roleARN:S3Configuration' :: Text
roleARN = Text
pRoleARN_,
$sel:bucketARN:S3Configuration' :: Text
bucketARN = Text
pBucketARN_,
$sel:fileKey:S3Configuration' :: Text
fileKey = Text
pFileKey_
}
s3Configuration_roleARN :: Lens.Lens' S3Configuration Prelude.Text
s3Configuration_roleARN :: Lens' S3Configuration Text
s3Configuration_roleARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3Configuration' {Text
roleARN :: Text
$sel:roleARN:S3Configuration' :: S3Configuration -> Text
roleARN} -> Text
roleARN) (\s :: S3Configuration
s@S3Configuration' {} Text
a -> S3Configuration
s {$sel:roleARN:S3Configuration' :: Text
roleARN = Text
a} :: S3Configuration)
s3Configuration_bucketARN :: Lens.Lens' S3Configuration Prelude.Text
s3Configuration_bucketARN :: Lens' S3Configuration Text
s3Configuration_bucketARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3Configuration' {Text
bucketARN :: Text
$sel:bucketARN:S3Configuration' :: S3Configuration -> Text
bucketARN} -> Text
bucketARN) (\s :: S3Configuration
s@S3Configuration' {} Text
a -> S3Configuration
s {$sel:bucketARN:S3Configuration' :: Text
bucketARN = Text
a} :: S3Configuration)
s3Configuration_fileKey :: Lens.Lens' S3Configuration Prelude.Text
s3Configuration_fileKey :: Lens' S3Configuration Text
s3Configuration_fileKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3Configuration' {Text
fileKey :: Text
$sel:fileKey:S3Configuration' :: S3Configuration -> Text
fileKey} -> Text
fileKey) (\s :: S3Configuration
s@S3Configuration' {} Text
a -> S3Configuration
s {$sel:fileKey:S3Configuration' :: Text
fileKey = Text
a} :: S3Configuration)
instance Prelude.Hashable S3Configuration where
hashWithSalt :: Int -> S3Configuration -> Int
hashWithSalt Int
_salt S3Configuration' {Text
fileKey :: Text
bucketARN :: Text
roleARN :: Text
$sel:fileKey:S3Configuration' :: S3Configuration -> Text
$sel:bucketARN:S3Configuration' :: S3Configuration -> Text
$sel:roleARN:S3Configuration' :: S3Configuration -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleARN
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
bucketARN
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
fileKey
instance Prelude.NFData S3Configuration where
rnf :: S3Configuration -> ()
rnf S3Configuration' {Text
fileKey :: Text
bucketARN :: Text
roleARN :: Text
$sel:fileKey:S3Configuration' :: S3Configuration -> Text
$sel:bucketARN:S3Configuration' :: S3Configuration -> Text
$sel:roleARN:S3Configuration' :: S3Configuration -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
roleARN
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
bucketARN
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
fileKey
instance Data.ToJSON S3Configuration where
toJSON :: S3Configuration -> Value
toJSON S3Configuration' {Text
fileKey :: Text
bucketARN :: Text
roleARN :: Text
$sel:fileKey:S3Configuration' :: S3Configuration -> Text
$sel:bucketARN:S3Configuration' :: S3Configuration -> Text
$sel:roleARN:S3Configuration' :: S3Configuration -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"RoleARN" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
roleARN),
forall a. a -> Maybe a
Prelude.Just (Key
"BucketARN" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
bucketARN),
forall a. a -> Maybe a
Prelude.Just (Key
"FileKey" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
fileKey)
]
)