{-# 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.Greengrass.Types.ResourceDownloadOwnerSetting where
import qualified Amazonka.Core as Core
import Amazonka.Greengrass.Types.Permission
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ResourceDownloadOwnerSetting = ResourceDownloadOwnerSetting'
{
ResourceDownloadOwnerSetting -> Text
groupOwner :: Prelude.Text,
ResourceDownloadOwnerSetting -> Permission
groupPermission :: Permission
}
deriving (ResourceDownloadOwnerSetting
-> ResourceDownloadOwnerSetting -> Bool
(ResourceDownloadOwnerSetting
-> ResourceDownloadOwnerSetting -> Bool)
-> (ResourceDownloadOwnerSetting
-> ResourceDownloadOwnerSetting -> Bool)
-> Eq ResourceDownloadOwnerSetting
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourceDownloadOwnerSetting
-> ResourceDownloadOwnerSetting -> Bool
$c/= :: ResourceDownloadOwnerSetting
-> ResourceDownloadOwnerSetting -> Bool
== :: ResourceDownloadOwnerSetting
-> ResourceDownloadOwnerSetting -> Bool
$c== :: ResourceDownloadOwnerSetting
-> ResourceDownloadOwnerSetting -> Bool
Prelude.Eq, ReadPrec [ResourceDownloadOwnerSetting]
ReadPrec ResourceDownloadOwnerSetting
Int -> ReadS ResourceDownloadOwnerSetting
ReadS [ResourceDownloadOwnerSetting]
(Int -> ReadS ResourceDownloadOwnerSetting)
-> ReadS [ResourceDownloadOwnerSetting]
-> ReadPrec ResourceDownloadOwnerSetting
-> ReadPrec [ResourceDownloadOwnerSetting]
-> Read ResourceDownloadOwnerSetting
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResourceDownloadOwnerSetting]
$creadListPrec :: ReadPrec [ResourceDownloadOwnerSetting]
readPrec :: ReadPrec ResourceDownloadOwnerSetting
$creadPrec :: ReadPrec ResourceDownloadOwnerSetting
readList :: ReadS [ResourceDownloadOwnerSetting]
$creadList :: ReadS [ResourceDownloadOwnerSetting]
readsPrec :: Int -> ReadS ResourceDownloadOwnerSetting
$creadsPrec :: Int -> ReadS ResourceDownloadOwnerSetting
Prelude.Read, Int -> ResourceDownloadOwnerSetting -> ShowS
[ResourceDownloadOwnerSetting] -> ShowS
ResourceDownloadOwnerSetting -> String
(Int -> ResourceDownloadOwnerSetting -> ShowS)
-> (ResourceDownloadOwnerSetting -> String)
-> ([ResourceDownloadOwnerSetting] -> ShowS)
-> Show ResourceDownloadOwnerSetting
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourceDownloadOwnerSetting] -> ShowS
$cshowList :: [ResourceDownloadOwnerSetting] -> ShowS
show :: ResourceDownloadOwnerSetting -> String
$cshow :: ResourceDownloadOwnerSetting -> String
showsPrec :: Int -> ResourceDownloadOwnerSetting -> ShowS
$cshowsPrec :: Int -> ResourceDownloadOwnerSetting -> ShowS
Prelude.Show, (forall x.
ResourceDownloadOwnerSetting -> Rep ResourceDownloadOwnerSetting x)
-> (forall x.
Rep ResourceDownloadOwnerSetting x -> ResourceDownloadOwnerSetting)
-> Generic ResourceDownloadOwnerSetting
forall x.
Rep ResourceDownloadOwnerSetting x -> ResourceDownloadOwnerSetting
forall x.
ResourceDownloadOwnerSetting -> Rep ResourceDownloadOwnerSetting x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ResourceDownloadOwnerSetting x -> ResourceDownloadOwnerSetting
$cfrom :: forall x.
ResourceDownloadOwnerSetting -> Rep ResourceDownloadOwnerSetting x
Prelude.Generic)
newResourceDownloadOwnerSetting ::
Prelude.Text ->
Permission ->
ResourceDownloadOwnerSetting
newResourceDownloadOwnerSetting :: Text -> Permission -> ResourceDownloadOwnerSetting
newResourceDownloadOwnerSetting
Text
pGroupOwner_
Permission
pGroupPermission_ =
ResourceDownloadOwnerSetting' :: Text -> Permission -> ResourceDownloadOwnerSetting
ResourceDownloadOwnerSetting'
{ $sel:groupOwner:ResourceDownloadOwnerSetting' :: Text
groupOwner =
Text
pGroupOwner_,
$sel:groupPermission:ResourceDownloadOwnerSetting' :: Permission
groupPermission = Permission
pGroupPermission_
}
resourceDownloadOwnerSetting_groupOwner :: Lens.Lens' ResourceDownloadOwnerSetting Prelude.Text
resourceDownloadOwnerSetting_groupOwner :: (Text -> f Text)
-> ResourceDownloadOwnerSetting -> f ResourceDownloadOwnerSetting
resourceDownloadOwnerSetting_groupOwner = (ResourceDownloadOwnerSetting -> Text)
-> (ResourceDownloadOwnerSetting
-> Text -> ResourceDownloadOwnerSetting)
-> Lens
ResourceDownloadOwnerSetting ResourceDownloadOwnerSetting Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceDownloadOwnerSetting' {Text
groupOwner :: Text
$sel:groupOwner:ResourceDownloadOwnerSetting' :: ResourceDownloadOwnerSetting -> Text
groupOwner} -> Text
groupOwner) (\s :: ResourceDownloadOwnerSetting
s@ResourceDownloadOwnerSetting' {} Text
a -> ResourceDownloadOwnerSetting
s {$sel:groupOwner:ResourceDownloadOwnerSetting' :: Text
groupOwner = Text
a} :: ResourceDownloadOwnerSetting)
resourceDownloadOwnerSetting_groupPermission :: Lens.Lens' ResourceDownloadOwnerSetting Permission
resourceDownloadOwnerSetting_groupPermission :: (Permission -> f Permission)
-> ResourceDownloadOwnerSetting -> f ResourceDownloadOwnerSetting
resourceDownloadOwnerSetting_groupPermission = (ResourceDownloadOwnerSetting -> Permission)
-> (ResourceDownloadOwnerSetting
-> Permission -> ResourceDownloadOwnerSetting)
-> Lens
ResourceDownloadOwnerSetting
ResourceDownloadOwnerSetting
Permission
Permission
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceDownloadOwnerSetting' {Permission
groupPermission :: Permission
$sel:groupPermission:ResourceDownloadOwnerSetting' :: ResourceDownloadOwnerSetting -> Permission
groupPermission} -> Permission
groupPermission) (\s :: ResourceDownloadOwnerSetting
s@ResourceDownloadOwnerSetting' {} Permission
a -> ResourceDownloadOwnerSetting
s {$sel:groupPermission:ResourceDownloadOwnerSetting' :: Permission
groupPermission = Permission
a} :: ResourceDownloadOwnerSetting)
instance Core.FromJSON ResourceDownloadOwnerSetting where
parseJSON :: Value -> Parser ResourceDownloadOwnerSetting
parseJSON =
String
-> (Object -> Parser ResourceDownloadOwnerSetting)
-> Value
-> Parser ResourceDownloadOwnerSetting
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ResourceDownloadOwnerSetting"
( \Object
x ->
Text -> Permission -> ResourceDownloadOwnerSetting
ResourceDownloadOwnerSetting'
(Text -> Permission -> ResourceDownloadOwnerSetting)
-> Parser Text
-> Parser (Permission -> ResourceDownloadOwnerSetting)
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
"GroupOwner")
Parser (Permission -> ResourceDownloadOwnerSetting)
-> Parser Permission -> Parser ResourceDownloadOwnerSetting
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Permission
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"GroupPermission")
)
instance
Prelude.Hashable
ResourceDownloadOwnerSetting
instance Prelude.NFData ResourceDownloadOwnerSetting
instance Core.ToJSON ResourceDownloadOwnerSetting where
toJSON :: ResourceDownloadOwnerSetting -> Value
toJSON ResourceDownloadOwnerSetting' {Text
Permission
groupPermission :: Permission
groupOwner :: Text
$sel:groupPermission:ResourceDownloadOwnerSetting' :: ResourceDownloadOwnerSetting -> Permission
$sel:groupOwner:ResourceDownloadOwnerSetting' :: ResourceDownloadOwnerSetting -> 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
"GroupOwner" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
groupOwner),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"GroupPermission" Text -> Permission -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Permission
groupPermission)
]
)