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