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