{-# 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.CloudDirectory.Types.PolicyAttachment where
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 PolicyAttachment = PolicyAttachment'
{
PolicyAttachment -> Maybe Text
objectIdentifier :: Prelude.Maybe Prelude.Text,
PolicyAttachment -> Maybe Text
policyId :: Prelude.Maybe Prelude.Text,
PolicyAttachment -> Maybe Text
policyType :: Prelude.Maybe Prelude.Text
}
deriving (PolicyAttachment -> PolicyAttachment -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PolicyAttachment -> PolicyAttachment -> Bool
$c/= :: PolicyAttachment -> PolicyAttachment -> Bool
== :: PolicyAttachment -> PolicyAttachment -> Bool
$c== :: PolicyAttachment -> PolicyAttachment -> Bool
Prelude.Eq, ReadPrec [PolicyAttachment]
ReadPrec PolicyAttachment
Int -> ReadS PolicyAttachment
ReadS [PolicyAttachment]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PolicyAttachment]
$creadListPrec :: ReadPrec [PolicyAttachment]
readPrec :: ReadPrec PolicyAttachment
$creadPrec :: ReadPrec PolicyAttachment
readList :: ReadS [PolicyAttachment]
$creadList :: ReadS [PolicyAttachment]
readsPrec :: Int -> ReadS PolicyAttachment
$creadsPrec :: Int -> ReadS PolicyAttachment
Prelude.Read, Int -> PolicyAttachment -> ShowS
[PolicyAttachment] -> ShowS
PolicyAttachment -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PolicyAttachment] -> ShowS
$cshowList :: [PolicyAttachment] -> ShowS
show :: PolicyAttachment -> String
$cshow :: PolicyAttachment -> String
showsPrec :: Int -> PolicyAttachment -> ShowS
$cshowsPrec :: Int -> PolicyAttachment -> ShowS
Prelude.Show, forall x. Rep PolicyAttachment x -> PolicyAttachment
forall x. PolicyAttachment -> Rep PolicyAttachment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PolicyAttachment x -> PolicyAttachment
$cfrom :: forall x. PolicyAttachment -> Rep PolicyAttachment x
Prelude.Generic)
newPolicyAttachment ::
PolicyAttachment
newPolicyAttachment :: PolicyAttachment
newPolicyAttachment =
PolicyAttachment'
{ $sel:objectIdentifier:PolicyAttachment' :: Maybe Text
objectIdentifier =
forall a. Maybe a
Prelude.Nothing,
$sel:policyId:PolicyAttachment' :: Maybe Text
policyId = forall a. Maybe a
Prelude.Nothing,
$sel:policyType:PolicyAttachment' :: Maybe Text
policyType = forall a. Maybe a
Prelude.Nothing
}
policyAttachment_objectIdentifier :: Lens.Lens' PolicyAttachment (Prelude.Maybe Prelude.Text)
policyAttachment_objectIdentifier :: Lens' PolicyAttachment (Maybe Text)
policyAttachment_objectIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyAttachment' {Maybe Text
objectIdentifier :: Maybe Text
$sel:objectIdentifier:PolicyAttachment' :: PolicyAttachment -> Maybe Text
objectIdentifier} -> Maybe Text
objectIdentifier) (\s :: PolicyAttachment
s@PolicyAttachment' {} Maybe Text
a -> PolicyAttachment
s {$sel:objectIdentifier:PolicyAttachment' :: Maybe Text
objectIdentifier = Maybe Text
a} :: PolicyAttachment)
policyAttachment_policyId :: Lens.Lens' PolicyAttachment (Prelude.Maybe Prelude.Text)
policyAttachment_policyId :: Lens' PolicyAttachment (Maybe Text)
policyAttachment_policyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyAttachment' {Maybe Text
policyId :: Maybe Text
$sel:policyId:PolicyAttachment' :: PolicyAttachment -> Maybe Text
policyId} -> Maybe Text
policyId) (\s :: PolicyAttachment
s@PolicyAttachment' {} Maybe Text
a -> PolicyAttachment
s {$sel:policyId:PolicyAttachment' :: Maybe Text
policyId = Maybe Text
a} :: PolicyAttachment)
policyAttachment_policyType :: Lens.Lens' PolicyAttachment (Prelude.Maybe Prelude.Text)
policyAttachment_policyType :: Lens' PolicyAttachment (Maybe Text)
policyAttachment_policyType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyAttachment' {Maybe Text
policyType :: Maybe Text
$sel:policyType:PolicyAttachment' :: PolicyAttachment -> Maybe Text
policyType} -> Maybe Text
policyType) (\s :: PolicyAttachment
s@PolicyAttachment' {} Maybe Text
a -> PolicyAttachment
s {$sel:policyType:PolicyAttachment' :: Maybe Text
policyType = Maybe Text
a} :: PolicyAttachment)
instance Data.FromJSON PolicyAttachment where
parseJSON :: Value -> Parser PolicyAttachment
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"PolicyAttachment"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> PolicyAttachment
PolicyAttachment'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ObjectIdentifier")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"PolicyId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"PolicyType")
)
instance Prelude.Hashable PolicyAttachment where
hashWithSalt :: Int -> PolicyAttachment -> Int
hashWithSalt Int
_salt PolicyAttachment' {Maybe Text
policyType :: Maybe Text
policyId :: Maybe Text
objectIdentifier :: Maybe Text
$sel:policyType:PolicyAttachment' :: PolicyAttachment -> Maybe Text
$sel:policyId:PolicyAttachment' :: PolicyAttachment -> Maybe Text
$sel:objectIdentifier:PolicyAttachment' :: PolicyAttachment -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
objectIdentifier
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
policyId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
policyType
instance Prelude.NFData PolicyAttachment where
rnf :: PolicyAttachment -> ()
rnf PolicyAttachment' {Maybe Text
policyType :: Maybe Text
policyId :: Maybe Text
objectIdentifier :: Maybe Text
$sel:policyType:PolicyAttachment' :: PolicyAttachment -> Maybe Text
$sel:policyId:PolicyAttachment' :: PolicyAttachment -> Maybe Text
$sel:objectIdentifier:PolicyAttachment' :: PolicyAttachment -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
objectIdentifier
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
policyId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
policyType