{-# 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.IndexAttachment where
import Amazonka.CloudDirectory.Types.AttributeKeyAndValue
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 IndexAttachment = IndexAttachment'
{
IndexAttachment -> Maybe [AttributeKeyAndValue]
indexedAttributes :: Prelude.Maybe [AttributeKeyAndValue],
IndexAttachment -> Maybe Text
objectIdentifier :: Prelude.Maybe Prelude.Text
}
deriving (IndexAttachment -> IndexAttachment -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IndexAttachment -> IndexAttachment -> Bool
$c/= :: IndexAttachment -> IndexAttachment -> Bool
== :: IndexAttachment -> IndexAttachment -> Bool
$c== :: IndexAttachment -> IndexAttachment -> Bool
Prelude.Eq, ReadPrec [IndexAttachment]
ReadPrec IndexAttachment
Int -> ReadS IndexAttachment
ReadS [IndexAttachment]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IndexAttachment]
$creadListPrec :: ReadPrec [IndexAttachment]
readPrec :: ReadPrec IndexAttachment
$creadPrec :: ReadPrec IndexAttachment
readList :: ReadS [IndexAttachment]
$creadList :: ReadS [IndexAttachment]
readsPrec :: Int -> ReadS IndexAttachment
$creadsPrec :: Int -> ReadS IndexAttachment
Prelude.Read, Int -> IndexAttachment -> ShowS
[IndexAttachment] -> ShowS
IndexAttachment -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IndexAttachment] -> ShowS
$cshowList :: [IndexAttachment] -> ShowS
show :: IndexAttachment -> String
$cshow :: IndexAttachment -> String
showsPrec :: Int -> IndexAttachment -> ShowS
$cshowsPrec :: Int -> IndexAttachment -> ShowS
Prelude.Show, forall x. Rep IndexAttachment x -> IndexAttachment
forall x. IndexAttachment -> Rep IndexAttachment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IndexAttachment x -> IndexAttachment
$cfrom :: forall x. IndexAttachment -> Rep IndexAttachment x
Prelude.Generic)
newIndexAttachment ::
IndexAttachment
newIndexAttachment :: IndexAttachment
newIndexAttachment =
IndexAttachment'
{ $sel:indexedAttributes:IndexAttachment' :: Maybe [AttributeKeyAndValue]
indexedAttributes =
forall a. Maybe a
Prelude.Nothing,
$sel:objectIdentifier:IndexAttachment' :: Maybe Text
objectIdentifier = forall a. Maybe a
Prelude.Nothing
}
indexAttachment_indexedAttributes :: Lens.Lens' IndexAttachment (Prelude.Maybe [AttributeKeyAndValue])
indexAttachment_indexedAttributes :: Lens' IndexAttachment (Maybe [AttributeKeyAndValue])
indexAttachment_indexedAttributes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IndexAttachment' {Maybe [AttributeKeyAndValue]
indexedAttributes :: Maybe [AttributeKeyAndValue]
$sel:indexedAttributes:IndexAttachment' :: IndexAttachment -> Maybe [AttributeKeyAndValue]
indexedAttributes} -> Maybe [AttributeKeyAndValue]
indexedAttributes) (\s :: IndexAttachment
s@IndexAttachment' {} Maybe [AttributeKeyAndValue]
a -> IndexAttachment
s {$sel:indexedAttributes:IndexAttachment' :: Maybe [AttributeKeyAndValue]
indexedAttributes = Maybe [AttributeKeyAndValue]
a} :: IndexAttachment) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
indexAttachment_objectIdentifier :: Lens.Lens' IndexAttachment (Prelude.Maybe Prelude.Text)
indexAttachment_objectIdentifier :: Lens' IndexAttachment (Maybe Text)
indexAttachment_objectIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IndexAttachment' {Maybe Text
objectIdentifier :: Maybe Text
$sel:objectIdentifier:IndexAttachment' :: IndexAttachment -> Maybe Text
objectIdentifier} -> Maybe Text
objectIdentifier) (\s :: IndexAttachment
s@IndexAttachment' {} Maybe Text
a -> IndexAttachment
s {$sel:objectIdentifier:IndexAttachment' :: Maybe Text
objectIdentifier = Maybe Text
a} :: IndexAttachment)
instance Data.FromJSON IndexAttachment where
parseJSON :: Value -> Parser IndexAttachment
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"IndexAttachment"
( \Object
x ->
Maybe [AttributeKeyAndValue] -> Maybe Text -> IndexAttachment
IndexAttachment'
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
"IndexedAttributes"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
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
"ObjectIdentifier")
)
instance Prelude.Hashable IndexAttachment where
hashWithSalt :: Int -> IndexAttachment -> Int
hashWithSalt Int
_salt IndexAttachment' {Maybe [AttributeKeyAndValue]
Maybe Text
objectIdentifier :: Maybe Text
indexedAttributes :: Maybe [AttributeKeyAndValue]
$sel:objectIdentifier:IndexAttachment' :: IndexAttachment -> Maybe Text
$sel:indexedAttributes:IndexAttachment' :: IndexAttachment -> Maybe [AttributeKeyAndValue]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [AttributeKeyAndValue]
indexedAttributes
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
objectIdentifier
instance Prelude.NFData IndexAttachment where
rnf :: IndexAttachment -> ()
rnf IndexAttachment' {Maybe [AttributeKeyAndValue]
Maybe Text
objectIdentifier :: Maybe Text
indexedAttributes :: Maybe [AttributeKeyAndValue]
$sel:objectIdentifier:IndexAttachment' :: IndexAttachment -> Maybe Text
$sel:indexedAttributes:IndexAttachment' :: IndexAttachment -> Maybe [AttributeKeyAndValue]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [AttributeKeyAndValue]
indexedAttributes
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
objectIdentifier