{-# 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.SharedImagePermissions where
import Amazonka.AppStream.Types.ImagePermissions
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SharedImagePermissions = SharedImagePermissions'
{
SharedImagePermissions -> Text
sharedAccountId :: Prelude.Text,
SharedImagePermissions -> ImagePermissions
imagePermissions :: ImagePermissions
}
deriving (SharedImagePermissions -> SharedImagePermissions -> Bool
(SharedImagePermissions -> SharedImagePermissions -> Bool)
-> (SharedImagePermissions -> SharedImagePermissions -> Bool)
-> Eq SharedImagePermissions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SharedImagePermissions -> SharedImagePermissions -> Bool
$c/= :: SharedImagePermissions -> SharedImagePermissions -> Bool
== :: SharedImagePermissions -> SharedImagePermissions -> Bool
$c== :: SharedImagePermissions -> SharedImagePermissions -> Bool
Prelude.Eq, ReadPrec [SharedImagePermissions]
ReadPrec SharedImagePermissions
Int -> ReadS SharedImagePermissions
ReadS [SharedImagePermissions]
(Int -> ReadS SharedImagePermissions)
-> ReadS [SharedImagePermissions]
-> ReadPrec SharedImagePermissions
-> ReadPrec [SharedImagePermissions]
-> Read SharedImagePermissions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SharedImagePermissions]
$creadListPrec :: ReadPrec [SharedImagePermissions]
readPrec :: ReadPrec SharedImagePermissions
$creadPrec :: ReadPrec SharedImagePermissions
readList :: ReadS [SharedImagePermissions]
$creadList :: ReadS [SharedImagePermissions]
readsPrec :: Int -> ReadS SharedImagePermissions
$creadsPrec :: Int -> ReadS SharedImagePermissions
Prelude.Read, Int -> SharedImagePermissions -> ShowS
[SharedImagePermissions] -> ShowS
SharedImagePermissions -> String
(Int -> SharedImagePermissions -> ShowS)
-> (SharedImagePermissions -> String)
-> ([SharedImagePermissions] -> ShowS)
-> Show SharedImagePermissions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SharedImagePermissions] -> ShowS
$cshowList :: [SharedImagePermissions] -> ShowS
show :: SharedImagePermissions -> String
$cshow :: SharedImagePermissions -> String
showsPrec :: Int -> SharedImagePermissions -> ShowS
$cshowsPrec :: Int -> SharedImagePermissions -> ShowS
Prelude.Show, (forall x. SharedImagePermissions -> Rep SharedImagePermissions x)
-> (forall x.
Rep SharedImagePermissions x -> SharedImagePermissions)
-> Generic SharedImagePermissions
forall x. Rep SharedImagePermissions x -> SharedImagePermissions
forall x. SharedImagePermissions -> Rep SharedImagePermissions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SharedImagePermissions x -> SharedImagePermissions
$cfrom :: forall x. SharedImagePermissions -> Rep SharedImagePermissions x
Prelude.Generic)
newSharedImagePermissions ::
Prelude.Text ->
ImagePermissions ->
SharedImagePermissions
newSharedImagePermissions :: Text -> ImagePermissions -> SharedImagePermissions
newSharedImagePermissions
Text
pSharedAccountId_
ImagePermissions
pImagePermissions_ =
SharedImagePermissions' :: Text -> ImagePermissions -> SharedImagePermissions
SharedImagePermissions'
{ $sel:sharedAccountId:SharedImagePermissions' :: Text
sharedAccountId =
Text
pSharedAccountId_,
$sel:imagePermissions:SharedImagePermissions' :: ImagePermissions
imagePermissions = ImagePermissions
pImagePermissions_
}
sharedImagePermissions_sharedAccountId :: Lens.Lens' SharedImagePermissions Prelude.Text
sharedImagePermissions_sharedAccountId :: (Text -> f Text)
-> SharedImagePermissions -> f SharedImagePermissions
sharedImagePermissions_sharedAccountId = (SharedImagePermissions -> Text)
-> (SharedImagePermissions -> Text -> SharedImagePermissions)
-> Lens SharedImagePermissions SharedImagePermissions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SharedImagePermissions' {Text
sharedAccountId :: Text
$sel:sharedAccountId:SharedImagePermissions' :: SharedImagePermissions -> Text
sharedAccountId} -> Text
sharedAccountId) (\s :: SharedImagePermissions
s@SharedImagePermissions' {} Text
a -> SharedImagePermissions
s {$sel:sharedAccountId:SharedImagePermissions' :: Text
sharedAccountId = Text
a} :: SharedImagePermissions)
sharedImagePermissions_imagePermissions :: Lens.Lens' SharedImagePermissions ImagePermissions
sharedImagePermissions_imagePermissions :: (ImagePermissions -> f ImagePermissions)
-> SharedImagePermissions -> f SharedImagePermissions
sharedImagePermissions_imagePermissions = (SharedImagePermissions -> ImagePermissions)
-> (SharedImagePermissions
-> ImagePermissions -> SharedImagePermissions)
-> Lens
SharedImagePermissions
SharedImagePermissions
ImagePermissions
ImagePermissions
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SharedImagePermissions' {ImagePermissions
imagePermissions :: ImagePermissions
$sel:imagePermissions:SharedImagePermissions' :: SharedImagePermissions -> ImagePermissions
imagePermissions} -> ImagePermissions
imagePermissions) (\s :: SharedImagePermissions
s@SharedImagePermissions' {} ImagePermissions
a -> SharedImagePermissions
s {$sel:imagePermissions:SharedImagePermissions' :: ImagePermissions
imagePermissions = ImagePermissions
a} :: SharedImagePermissions)
instance Core.FromJSON SharedImagePermissions where
parseJSON :: Value -> Parser SharedImagePermissions
parseJSON =
String
-> (Object -> Parser SharedImagePermissions)
-> Value
-> Parser SharedImagePermissions
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SharedImagePermissions"
( \Object
x ->
Text -> ImagePermissions -> SharedImagePermissions
SharedImagePermissions'
(Text -> ImagePermissions -> SharedImagePermissions)
-> Parser Text
-> Parser (ImagePermissions -> SharedImagePermissions)
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
"sharedAccountId")
Parser (ImagePermissions -> SharedImagePermissions)
-> Parser ImagePermissions -> Parser SharedImagePermissions
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ImagePermissions
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"imagePermissions")
)
instance Prelude.Hashable SharedImagePermissions
instance Prelude.NFData SharedImagePermissions