{-# 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.AccessPolicySummary where
import qualified Amazonka.Core as Core
import Amazonka.IoTSiteWise.Types.Identity
import Amazonka.IoTSiteWise.Types.Permission
import Amazonka.IoTSiteWise.Types.Resource
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AccessPolicySummary = AccessPolicySummary'
{
AccessPolicySummary -> Maybe POSIX
lastUpdateDate :: Prelude.Maybe Core.POSIX,
AccessPolicySummary -> Maybe POSIX
creationDate :: Prelude.Maybe Core.POSIX,
AccessPolicySummary -> Text
id :: Prelude.Text,
AccessPolicySummary -> Identity
identity :: Identity,
AccessPolicySummary -> Resource
resource :: Resource,
AccessPolicySummary -> Permission
permission :: Permission
}
deriving (AccessPolicySummary -> AccessPolicySummary -> Bool
(AccessPolicySummary -> AccessPolicySummary -> Bool)
-> (AccessPolicySummary -> AccessPolicySummary -> Bool)
-> Eq AccessPolicySummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccessPolicySummary -> AccessPolicySummary -> Bool
$c/= :: AccessPolicySummary -> AccessPolicySummary -> Bool
== :: AccessPolicySummary -> AccessPolicySummary -> Bool
$c== :: AccessPolicySummary -> AccessPolicySummary -> Bool
Prelude.Eq, ReadPrec [AccessPolicySummary]
ReadPrec AccessPolicySummary
Int -> ReadS AccessPolicySummary
ReadS [AccessPolicySummary]
(Int -> ReadS AccessPolicySummary)
-> ReadS [AccessPolicySummary]
-> ReadPrec AccessPolicySummary
-> ReadPrec [AccessPolicySummary]
-> Read AccessPolicySummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AccessPolicySummary]
$creadListPrec :: ReadPrec [AccessPolicySummary]
readPrec :: ReadPrec AccessPolicySummary
$creadPrec :: ReadPrec AccessPolicySummary
readList :: ReadS [AccessPolicySummary]
$creadList :: ReadS [AccessPolicySummary]
readsPrec :: Int -> ReadS AccessPolicySummary
$creadsPrec :: Int -> ReadS AccessPolicySummary
Prelude.Read, Int -> AccessPolicySummary -> ShowS
[AccessPolicySummary] -> ShowS
AccessPolicySummary -> String
(Int -> AccessPolicySummary -> ShowS)
-> (AccessPolicySummary -> String)
-> ([AccessPolicySummary] -> ShowS)
-> Show AccessPolicySummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccessPolicySummary] -> ShowS
$cshowList :: [AccessPolicySummary] -> ShowS
show :: AccessPolicySummary -> String
$cshow :: AccessPolicySummary -> String
showsPrec :: Int -> AccessPolicySummary -> ShowS
$cshowsPrec :: Int -> AccessPolicySummary -> ShowS
Prelude.Show, (forall x. AccessPolicySummary -> Rep AccessPolicySummary x)
-> (forall x. Rep AccessPolicySummary x -> AccessPolicySummary)
-> Generic AccessPolicySummary
forall x. Rep AccessPolicySummary x -> AccessPolicySummary
forall x. AccessPolicySummary -> Rep AccessPolicySummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AccessPolicySummary x -> AccessPolicySummary
$cfrom :: forall x. AccessPolicySummary -> Rep AccessPolicySummary x
Prelude.Generic)
newAccessPolicySummary ::
Prelude.Text ->
Identity ->
Resource ->
Permission ->
AccessPolicySummary
newAccessPolicySummary :: Text -> Identity -> Resource -> Permission -> AccessPolicySummary
newAccessPolicySummary
Text
pId_
Identity
pIdentity_
Resource
pResource_
Permission
pPermission_ =
AccessPolicySummary' :: Maybe POSIX
-> Maybe POSIX
-> Text
-> Identity
-> Resource
-> Permission
-> AccessPolicySummary
AccessPolicySummary'
{ $sel:lastUpdateDate:AccessPolicySummary' :: Maybe POSIX
lastUpdateDate =
Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:creationDate:AccessPolicySummary' :: Maybe POSIX
creationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:id:AccessPolicySummary' :: Text
id = Text
pId_,
$sel:identity:AccessPolicySummary' :: Identity
identity = Identity
pIdentity_,
$sel:resource:AccessPolicySummary' :: Resource
resource = Resource
pResource_,
$sel:permission:AccessPolicySummary' :: Permission
permission = Permission
pPermission_
}
accessPolicySummary_lastUpdateDate :: Lens.Lens' AccessPolicySummary (Prelude.Maybe Prelude.UTCTime)
accessPolicySummary_lastUpdateDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> AccessPolicySummary -> f AccessPolicySummary
accessPolicySummary_lastUpdateDate = (AccessPolicySummary -> Maybe POSIX)
-> (AccessPolicySummary -> Maybe POSIX -> AccessPolicySummary)
-> Lens
AccessPolicySummary AccessPolicySummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPolicySummary' {Maybe POSIX
lastUpdateDate :: Maybe POSIX
$sel:lastUpdateDate:AccessPolicySummary' :: AccessPolicySummary -> Maybe POSIX
lastUpdateDate} -> Maybe POSIX
lastUpdateDate) (\s :: AccessPolicySummary
s@AccessPolicySummary' {} Maybe POSIX
a -> AccessPolicySummary
s {$sel:lastUpdateDate:AccessPolicySummary' :: Maybe POSIX
lastUpdateDate = Maybe POSIX
a} :: AccessPolicySummary) ((Maybe POSIX -> f (Maybe POSIX))
-> AccessPolicySummary -> f AccessPolicySummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AccessPolicySummary
-> f AccessPolicySummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
accessPolicySummary_creationDate :: Lens.Lens' AccessPolicySummary (Prelude.Maybe Prelude.UTCTime)
accessPolicySummary_creationDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> AccessPolicySummary -> f AccessPolicySummary
accessPolicySummary_creationDate = (AccessPolicySummary -> Maybe POSIX)
-> (AccessPolicySummary -> Maybe POSIX -> AccessPolicySummary)
-> Lens
AccessPolicySummary AccessPolicySummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPolicySummary' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:AccessPolicySummary' :: AccessPolicySummary -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: AccessPolicySummary
s@AccessPolicySummary' {} Maybe POSIX
a -> AccessPolicySummary
s {$sel:creationDate:AccessPolicySummary' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: AccessPolicySummary) ((Maybe POSIX -> f (Maybe POSIX))
-> AccessPolicySummary -> f AccessPolicySummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AccessPolicySummary
-> f AccessPolicySummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
accessPolicySummary_id :: Lens.Lens' AccessPolicySummary Prelude.Text
accessPolicySummary_id :: (Text -> f Text) -> AccessPolicySummary -> f AccessPolicySummary
accessPolicySummary_id = (AccessPolicySummary -> Text)
-> (AccessPolicySummary -> Text -> AccessPolicySummary)
-> Lens AccessPolicySummary AccessPolicySummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPolicySummary' {Text
id :: Text
$sel:id:AccessPolicySummary' :: AccessPolicySummary -> Text
id} -> Text
id) (\s :: AccessPolicySummary
s@AccessPolicySummary' {} Text
a -> AccessPolicySummary
s {$sel:id:AccessPolicySummary' :: Text
id = Text
a} :: AccessPolicySummary)
accessPolicySummary_identity :: Lens.Lens' AccessPolicySummary Identity
accessPolicySummary_identity :: (Identity -> f Identity)
-> AccessPolicySummary -> f AccessPolicySummary
accessPolicySummary_identity = (AccessPolicySummary -> Identity)
-> (AccessPolicySummary -> Identity -> AccessPolicySummary)
-> Lens AccessPolicySummary AccessPolicySummary Identity Identity
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPolicySummary' {Identity
identity :: Identity
$sel:identity:AccessPolicySummary' :: AccessPolicySummary -> Identity
identity} -> Identity
identity) (\s :: AccessPolicySummary
s@AccessPolicySummary' {} Identity
a -> AccessPolicySummary
s {$sel:identity:AccessPolicySummary' :: Identity
identity = Identity
a} :: AccessPolicySummary)
accessPolicySummary_resource :: Lens.Lens' AccessPolicySummary Resource
accessPolicySummary_resource :: (Resource -> f Resource)
-> AccessPolicySummary -> f AccessPolicySummary
accessPolicySummary_resource = (AccessPolicySummary -> Resource)
-> (AccessPolicySummary -> Resource -> AccessPolicySummary)
-> Lens AccessPolicySummary AccessPolicySummary Resource Resource
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPolicySummary' {Resource
resource :: Resource
$sel:resource:AccessPolicySummary' :: AccessPolicySummary -> Resource
resource} -> Resource
resource) (\s :: AccessPolicySummary
s@AccessPolicySummary' {} Resource
a -> AccessPolicySummary
s {$sel:resource:AccessPolicySummary' :: Resource
resource = Resource
a} :: AccessPolicySummary)
accessPolicySummary_permission :: Lens.Lens' AccessPolicySummary Permission
accessPolicySummary_permission :: (Permission -> f Permission)
-> AccessPolicySummary -> f AccessPolicySummary
accessPolicySummary_permission = (AccessPolicySummary -> Permission)
-> (AccessPolicySummary -> Permission -> AccessPolicySummary)
-> Lens
AccessPolicySummary AccessPolicySummary Permission Permission
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPolicySummary' {Permission
permission :: Permission
$sel:permission:AccessPolicySummary' :: AccessPolicySummary -> Permission
permission} -> Permission
permission) (\s :: AccessPolicySummary
s@AccessPolicySummary' {} Permission
a -> AccessPolicySummary
s {$sel:permission:AccessPolicySummary' :: Permission
permission = Permission
a} :: AccessPolicySummary)
instance Core.FromJSON AccessPolicySummary where
parseJSON :: Value -> Parser AccessPolicySummary
parseJSON =
String
-> (Object -> Parser AccessPolicySummary)
-> Value
-> Parser AccessPolicySummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AccessPolicySummary"
( \Object
x ->
Maybe POSIX
-> Maybe POSIX
-> Text
-> Identity
-> Resource
-> Permission
-> AccessPolicySummary
AccessPolicySummary'
(Maybe POSIX
-> Maybe POSIX
-> Text
-> Identity
-> Resource
-> Permission
-> AccessPolicySummary)
-> Parser (Maybe POSIX)
-> Parser
(Maybe POSIX
-> Text
-> Identity
-> Resource
-> Permission
-> AccessPolicySummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastUpdateDate")
Parser
(Maybe POSIX
-> Text
-> Identity
-> Resource
-> Permission
-> AccessPolicySummary)
-> Parser (Maybe POSIX)
-> Parser
(Text -> Identity -> Resource -> Permission -> AccessPolicySummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"creationDate")
Parser
(Text -> Identity -> Resource -> Permission -> AccessPolicySummary)
-> Parser Text
-> Parser
(Identity -> Resource -> Permission -> AccessPolicySummary)
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
"id")
Parser (Identity -> Resource -> Permission -> AccessPolicySummary)
-> Parser Identity
-> Parser (Resource -> Permission -> AccessPolicySummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Identity
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"identity")
Parser (Resource -> Permission -> AccessPolicySummary)
-> Parser Resource -> Parser (Permission -> AccessPolicySummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Resource
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"resource")
Parser (Permission -> AccessPolicySummary)
-> Parser Permission -> Parser AccessPolicySummary
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
"permission")
)
instance Prelude.Hashable AccessPolicySummary
instance Prelude.NFData AccessPolicySummary