{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data SharedImagePermissions = SharedImagePermissions'
{
SharedImagePermissions -> Text
sharedAccountId :: Prelude.Text,
SharedImagePermissions -> ImagePermissions
imagePermissions :: ImagePermissions
}
deriving (SharedImagePermissions -> SharedImagePermissions -> Bool
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]
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
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. 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'
{ $sel:sharedAccountId:SharedImagePermissions' :: Text
sharedAccountId =
Text
pSharedAccountId_,
$sel:imagePermissions:SharedImagePermissions' :: ImagePermissions
imagePermissions = ImagePermissions
pImagePermissions_
}
sharedImagePermissions_sharedAccountId :: Lens.Lens' SharedImagePermissions Prelude.Text
sharedImagePermissions_sharedAccountId :: Lens' SharedImagePermissions Text
sharedImagePermissions_sharedAccountId = 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 :: Lens' SharedImagePermissions ImagePermissions
sharedImagePermissions_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 Data.FromJSON SharedImagePermissions where
parseJSON :: Value -> Parser SharedImagePermissions
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SharedImagePermissions"
( \Object
x ->
Text -> ImagePermissions -> SharedImagePermissions
SharedImagePermissions'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"sharedAccountId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"imagePermissions")
)
instance Prelude.Hashable SharedImagePermissions where
hashWithSalt :: Int -> SharedImagePermissions -> Int
hashWithSalt Int
_salt SharedImagePermissions' {Text
ImagePermissions
imagePermissions :: ImagePermissions
sharedAccountId :: Text
$sel:imagePermissions:SharedImagePermissions' :: SharedImagePermissions -> ImagePermissions
$sel:sharedAccountId:SharedImagePermissions' :: SharedImagePermissions -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
sharedAccountId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ImagePermissions
imagePermissions
instance Prelude.NFData SharedImagePermissions where
rnf :: SharedImagePermissions -> ()
rnf SharedImagePermissions' {Text
ImagePermissions
imagePermissions :: ImagePermissions
sharedAccountId :: Text
$sel:imagePermissions:SharedImagePermissions' :: SharedImagePermissions -> ImagePermissions
$sel:sharedAccountId:SharedImagePermissions' :: SharedImagePermissions -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
sharedAccountId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ImagePermissions
imagePermissions