{-# 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.GroundStation.Types.S3RecordingConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data S3RecordingConfig = S3RecordingConfig'
{
S3RecordingConfig -> Maybe Text
prefix :: Prelude.Maybe Prelude.Text,
S3RecordingConfig -> Text
bucketArn :: Prelude.Text,
S3RecordingConfig -> Text
roleArn :: Prelude.Text
}
deriving (S3RecordingConfig -> S3RecordingConfig -> Bool
(S3RecordingConfig -> S3RecordingConfig -> Bool)
-> (S3RecordingConfig -> S3RecordingConfig -> Bool)
-> Eq S3RecordingConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3RecordingConfig -> S3RecordingConfig -> Bool
$c/= :: S3RecordingConfig -> S3RecordingConfig -> Bool
== :: S3RecordingConfig -> S3RecordingConfig -> Bool
$c== :: S3RecordingConfig -> S3RecordingConfig -> Bool
Prelude.Eq, ReadPrec [S3RecordingConfig]
ReadPrec S3RecordingConfig
Int -> ReadS S3RecordingConfig
ReadS [S3RecordingConfig]
(Int -> ReadS S3RecordingConfig)
-> ReadS [S3RecordingConfig]
-> ReadPrec S3RecordingConfig
-> ReadPrec [S3RecordingConfig]
-> Read S3RecordingConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3RecordingConfig]
$creadListPrec :: ReadPrec [S3RecordingConfig]
readPrec :: ReadPrec S3RecordingConfig
$creadPrec :: ReadPrec S3RecordingConfig
readList :: ReadS [S3RecordingConfig]
$creadList :: ReadS [S3RecordingConfig]
readsPrec :: Int -> ReadS S3RecordingConfig
$creadsPrec :: Int -> ReadS S3RecordingConfig
Prelude.Read, Int -> S3RecordingConfig -> ShowS
[S3RecordingConfig] -> ShowS
S3RecordingConfig -> String
(Int -> S3RecordingConfig -> ShowS)
-> (S3RecordingConfig -> String)
-> ([S3RecordingConfig] -> ShowS)
-> Show S3RecordingConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3RecordingConfig] -> ShowS
$cshowList :: [S3RecordingConfig] -> ShowS
show :: S3RecordingConfig -> String
$cshow :: S3RecordingConfig -> String
showsPrec :: Int -> S3RecordingConfig -> ShowS
$cshowsPrec :: Int -> S3RecordingConfig -> ShowS
Prelude.Show, (forall x. S3RecordingConfig -> Rep S3RecordingConfig x)
-> (forall x. Rep S3RecordingConfig x -> S3RecordingConfig)
-> Generic S3RecordingConfig
forall x. Rep S3RecordingConfig x -> S3RecordingConfig
forall x. S3RecordingConfig -> Rep S3RecordingConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep S3RecordingConfig x -> S3RecordingConfig
$cfrom :: forall x. S3RecordingConfig -> Rep S3RecordingConfig x
Prelude.Generic)
newS3RecordingConfig ::
Prelude.Text ->
Prelude.Text ->
S3RecordingConfig
newS3RecordingConfig :: Text -> Text -> S3RecordingConfig
newS3RecordingConfig Text
pBucketArn_ Text
pRoleArn_ =
S3RecordingConfig' :: Maybe Text -> Text -> Text -> S3RecordingConfig
S3RecordingConfig'
{ $sel:prefix:S3RecordingConfig' :: Maybe Text
prefix = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:bucketArn:S3RecordingConfig' :: Text
bucketArn = Text
pBucketArn_,
$sel:roleArn:S3RecordingConfig' :: Text
roleArn = Text
pRoleArn_
}
s3RecordingConfig_prefix :: Lens.Lens' S3RecordingConfig (Prelude.Maybe Prelude.Text)
s3RecordingConfig_prefix :: (Maybe Text -> f (Maybe Text))
-> S3RecordingConfig -> f S3RecordingConfig
s3RecordingConfig_prefix = (S3RecordingConfig -> Maybe Text)
-> (S3RecordingConfig -> Maybe Text -> S3RecordingConfig)
-> Lens
S3RecordingConfig S3RecordingConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3RecordingConfig' {Maybe Text
prefix :: Maybe Text
$sel:prefix:S3RecordingConfig' :: S3RecordingConfig -> Maybe Text
prefix} -> Maybe Text
prefix) (\s :: S3RecordingConfig
s@S3RecordingConfig' {} Maybe Text
a -> S3RecordingConfig
s {$sel:prefix:S3RecordingConfig' :: Maybe Text
prefix = Maybe Text
a} :: S3RecordingConfig)
s3RecordingConfig_bucketArn :: Lens.Lens' S3RecordingConfig Prelude.Text
s3RecordingConfig_bucketArn :: (Text -> f Text) -> S3RecordingConfig -> f S3RecordingConfig
s3RecordingConfig_bucketArn = (S3RecordingConfig -> Text)
-> (S3RecordingConfig -> Text -> S3RecordingConfig)
-> Lens S3RecordingConfig S3RecordingConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3RecordingConfig' {Text
bucketArn :: Text
$sel:bucketArn:S3RecordingConfig' :: S3RecordingConfig -> Text
bucketArn} -> Text
bucketArn) (\s :: S3RecordingConfig
s@S3RecordingConfig' {} Text
a -> S3RecordingConfig
s {$sel:bucketArn:S3RecordingConfig' :: Text
bucketArn = Text
a} :: S3RecordingConfig)
s3RecordingConfig_roleArn :: Lens.Lens' S3RecordingConfig Prelude.Text
s3RecordingConfig_roleArn :: (Text -> f Text) -> S3RecordingConfig -> f S3RecordingConfig
s3RecordingConfig_roleArn = (S3RecordingConfig -> Text)
-> (S3RecordingConfig -> Text -> S3RecordingConfig)
-> Lens S3RecordingConfig S3RecordingConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3RecordingConfig' {Text
roleArn :: Text
$sel:roleArn:S3RecordingConfig' :: S3RecordingConfig -> Text
roleArn} -> Text
roleArn) (\s :: S3RecordingConfig
s@S3RecordingConfig' {} Text
a -> S3RecordingConfig
s {$sel:roleArn:S3RecordingConfig' :: Text
roleArn = Text
a} :: S3RecordingConfig)
instance Core.FromJSON S3RecordingConfig where
parseJSON :: Value -> Parser S3RecordingConfig
parseJSON =
String
-> (Object -> Parser S3RecordingConfig)
-> Value
-> Parser S3RecordingConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"S3RecordingConfig"
( \Object
x ->
Maybe Text -> Text -> Text -> S3RecordingConfig
S3RecordingConfig'
(Maybe Text -> Text -> Text -> S3RecordingConfig)
-> Parser (Maybe Text)
-> Parser (Text -> Text -> S3RecordingConfig)
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
"prefix")
Parser (Text -> Text -> S3RecordingConfig)
-> Parser Text -> Parser (Text -> S3RecordingConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"bucketArn")
Parser (Text -> S3RecordingConfig)
-> Parser Text -> Parser S3RecordingConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"roleArn")
)
instance Prelude.Hashable S3RecordingConfig
instance Prelude.NFData S3RecordingConfig
instance Core.ToJSON S3RecordingConfig where
toJSON :: S3RecordingConfig -> Value
toJSON S3RecordingConfig' {Maybe Text
Text
roleArn :: Text
bucketArn :: Text
prefix :: Maybe Text
$sel:roleArn:S3RecordingConfig' :: S3RecordingConfig -> Text
$sel:bucketArn:S3RecordingConfig' :: S3RecordingConfig -> Text
$sel:prefix:S3RecordingConfig' :: S3RecordingConfig -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"prefix" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
prefix,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"bucketArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
bucketArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"roleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
roleArn)
]
)