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