{-# 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.ChannelStorage where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTAnalytics.Types.CustomerManagedChannelS3Storage
import Amazonka.IoTAnalytics.Types.ServiceManagedChannelS3Storage
import qualified Amazonka.Prelude as Prelude
data ChannelStorage = ChannelStorage'
{
ChannelStorage -> Maybe CustomerManagedChannelS3Storage
customerManagedS3 :: Prelude.Maybe CustomerManagedChannelS3Storage,
ChannelStorage -> Maybe ServiceManagedChannelS3Storage
serviceManagedS3 :: Prelude.Maybe ServiceManagedChannelS3Storage
}
deriving (ChannelStorage -> ChannelStorage -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChannelStorage -> ChannelStorage -> Bool
$c/= :: ChannelStorage -> ChannelStorage -> Bool
== :: ChannelStorage -> ChannelStorage -> Bool
$c== :: ChannelStorage -> ChannelStorage -> Bool
Prelude.Eq, ReadPrec [ChannelStorage]
ReadPrec ChannelStorage
Int -> ReadS ChannelStorage
ReadS [ChannelStorage]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChannelStorage]
$creadListPrec :: ReadPrec [ChannelStorage]
readPrec :: ReadPrec ChannelStorage
$creadPrec :: ReadPrec ChannelStorage
readList :: ReadS [ChannelStorage]
$creadList :: ReadS [ChannelStorage]
readsPrec :: Int -> ReadS ChannelStorage
$creadsPrec :: Int -> ReadS ChannelStorage
Prelude.Read, Int -> ChannelStorage -> ShowS
[ChannelStorage] -> ShowS
ChannelStorage -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChannelStorage] -> ShowS
$cshowList :: [ChannelStorage] -> ShowS
show :: ChannelStorage -> String
$cshow :: ChannelStorage -> String
showsPrec :: Int -> ChannelStorage -> ShowS
$cshowsPrec :: Int -> ChannelStorage -> ShowS
Prelude.Show, forall x. Rep ChannelStorage x -> ChannelStorage
forall x. ChannelStorage -> Rep ChannelStorage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChannelStorage x -> ChannelStorage
$cfrom :: forall x. ChannelStorage -> Rep ChannelStorage x
Prelude.Generic)
newChannelStorage ::
ChannelStorage
newChannelStorage :: ChannelStorage
newChannelStorage =
ChannelStorage'
{ $sel:customerManagedS3:ChannelStorage' :: Maybe CustomerManagedChannelS3Storage
customerManagedS3 =
forall a. Maybe a
Prelude.Nothing,
$sel:serviceManagedS3:ChannelStorage' :: Maybe ServiceManagedChannelS3Storage
serviceManagedS3 = forall a. Maybe a
Prelude.Nothing
}
channelStorage_customerManagedS3 :: Lens.Lens' ChannelStorage (Prelude.Maybe CustomerManagedChannelS3Storage)
channelStorage_customerManagedS3 :: Lens' ChannelStorage (Maybe CustomerManagedChannelS3Storage)
channelStorage_customerManagedS3 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelStorage' {Maybe CustomerManagedChannelS3Storage
customerManagedS3 :: Maybe CustomerManagedChannelS3Storage
$sel:customerManagedS3:ChannelStorage' :: ChannelStorage -> Maybe CustomerManagedChannelS3Storage
customerManagedS3} -> Maybe CustomerManagedChannelS3Storage
customerManagedS3) (\s :: ChannelStorage
s@ChannelStorage' {} Maybe CustomerManagedChannelS3Storage
a -> ChannelStorage
s {$sel:customerManagedS3:ChannelStorage' :: Maybe CustomerManagedChannelS3Storage
customerManagedS3 = Maybe CustomerManagedChannelS3Storage
a} :: ChannelStorage)
channelStorage_serviceManagedS3 :: Lens.Lens' ChannelStorage (Prelude.Maybe ServiceManagedChannelS3Storage)
channelStorage_serviceManagedS3 :: Lens' ChannelStorage (Maybe ServiceManagedChannelS3Storage)
channelStorage_serviceManagedS3 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChannelStorage' {Maybe ServiceManagedChannelS3Storage
serviceManagedS3 :: Maybe ServiceManagedChannelS3Storage
$sel:serviceManagedS3:ChannelStorage' :: ChannelStorage -> Maybe ServiceManagedChannelS3Storage
serviceManagedS3} -> Maybe ServiceManagedChannelS3Storage
serviceManagedS3) (\s :: ChannelStorage
s@ChannelStorage' {} Maybe ServiceManagedChannelS3Storage
a -> ChannelStorage
s {$sel:serviceManagedS3:ChannelStorage' :: Maybe ServiceManagedChannelS3Storage
serviceManagedS3 = Maybe ServiceManagedChannelS3Storage
a} :: ChannelStorage)
instance Data.FromJSON ChannelStorage where
parseJSON :: Value -> Parser ChannelStorage
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ChannelStorage"
( \Object
x ->
Maybe CustomerManagedChannelS3Storage
-> Maybe ServiceManagedChannelS3Storage -> ChannelStorage
ChannelStorage'
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
"customerManagedS3")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"serviceManagedS3")
)
instance Prelude.Hashable ChannelStorage where
hashWithSalt :: Int -> ChannelStorage -> Int
hashWithSalt Int
_salt ChannelStorage' {Maybe CustomerManagedChannelS3Storage
Maybe ServiceManagedChannelS3Storage
serviceManagedS3 :: Maybe ServiceManagedChannelS3Storage
customerManagedS3 :: Maybe CustomerManagedChannelS3Storage
$sel:serviceManagedS3:ChannelStorage' :: ChannelStorage -> Maybe ServiceManagedChannelS3Storage
$sel:customerManagedS3:ChannelStorage' :: ChannelStorage -> Maybe CustomerManagedChannelS3Storage
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CustomerManagedChannelS3Storage
customerManagedS3
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ServiceManagedChannelS3Storage
serviceManagedS3
instance Prelude.NFData ChannelStorage where
rnf :: ChannelStorage -> ()
rnf ChannelStorage' {Maybe CustomerManagedChannelS3Storage
Maybe ServiceManagedChannelS3Storage
serviceManagedS3 :: Maybe ServiceManagedChannelS3Storage
customerManagedS3 :: Maybe CustomerManagedChannelS3Storage
$sel:serviceManagedS3:ChannelStorage' :: ChannelStorage -> Maybe ServiceManagedChannelS3Storage
$sel:customerManagedS3:ChannelStorage' :: ChannelStorage -> Maybe CustomerManagedChannelS3Storage
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe CustomerManagedChannelS3Storage
customerManagedS3
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ServiceManagedChannelS3Storage
serviceManagedS3
instance Data.ToJSON ChannelStorage where
toJSON :: ChannelStorage -> Value
toJSON ChannelStorage' {Maybe CustomerManagedChannelS3Storage
Maybe ServiceManagedChannelS3Storage
serviceManagedS3 :: Maybe ServiceManagedChannelS3Storage
customerManagedS3 :: Maybe CustomerManagedChannelS3Storage
$sel:serviceManagedS3:ChannelStorage' :: ChannelStorage -> Maybe ServiceManagedChannelS3Storage
$sel:customerManagedS3:ChannelStorage' :: ChannelStorage -> Maybe CustomerManagedChannelS3Storage
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"customerManagedS3" 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 CustomerManagedChannelS3Storage
customerManagedS3,
(Key
"serviceManagedS3" 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 ServiceManagedChannelS3Storage
serviceManagedS3
]
)