{-# 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.Lens as Lens
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
(IndexAttachment -> IndexAttachment -> Bool)
-> (IndexAttachment -> IndexAttachment -> Bool)
-> Eq IndexAttachment
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]
(Int -> ReadS IndexAttachment)
-> ReadS [IndexAttachment]
-> ReadPrec IndexAttachment
-> ReadPrec [IndexAttachment]
-> Read 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
(Int -> IndexAttachment -> ShowS)
-> (IndexAttachment -> String)
-> ([IndexAttachment] -> ShowS)
-> Show IndexAttachment
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. IndexAttachment -> Rep IndexAttachment x)
-> (forall x. Rep IndexAttachment x -> IndexAttachment)
-> Generic IndexAttachment
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' :: Maybe [AttributeKeyAndValue] -> Maybe Text -> IndexAttachment
IndexAttachment'
{ $sel:indexedAttributes:IndexAttachment' :: Maybe [AttributeKeyAndValue]
indexedAttributes =
Maybe [AttributeKeyAndValue]
forall a. Maybe a
Prelude.Nothing,
$sel:objectIdentifier:IndexAttachment' :: Maybe Text
objectIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
indexAttachment_indexedAttributes :: Lens.Lens' IndexAttachment (Prelude.Maybe [AttributeKeyAndValue])
indexAttachment_indexedAttributes :: (Maybe [AttributeKeyAndValue] -> f (Maybe [AttributeKeyAndValue]))
-> IndexAttachment -> f IndexAttachment
indexAttachment_indexedAttributes = (IndexAttachment -> Maybe [AttributeKeyAndValue])
-> (IndexAttachment
-> Maybe [AttributeKeyAndValue] -> IndexAttachment)
-> Lens
IndexAttachment
IndexAttachment
(Maybe [AttributeKeyAndValue])
(Maybe [AttributeKeyAndValue])
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) ((Maybe [AttributeKeyAndValue] -> f (Maybe [AttributeKeyAndValue]))
-> IndexAttachment -> f IndexAttachment)
-> ((Maybe [AttributeKeyAndValue]
-> f (Maybe [AttributeKeyAndValue]))
-> Maybe [AttributeKeyAndValue]
-> f (Maybe [AttributeKeyAndValue]))
-> (Maybe [AttributeKeyAndValue]
-> f (Maybe [AttributeKeyAndValue]))
-> IndexAttachment
-> f IndexAttachment
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[AttributeKeyAndValue]
[AttributeKeyAndValue]
[AttributeKeyAndValue]
[AttributeKeyAndValue]
-> Iso
(Maybe [AttributeKeyAndValue])
(Maybe [AttributeKeyAndValue])
(Maybe [AttributeKeyAndValue])
(Maybe [AttributeKeyAndValue])
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
[AttributeKeyAndValue]
[AttributeKeyAndValue]
[AttributeKeyAndValue]
[AttributeKeyAndValue]
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 :: (Maybe Text -> f (Maybe Text))
-> IndexAttachment -> f IndexAttachment
indexAttachment_objectIdentifier = (IndexAttachment -> Maybe Text)
-> (IndexAttachment -> Maybe Text -> IndexAttachment)
-> Lens IndexAttachment IndexAttachment (Maybe Text) (Maybe Text)
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 Core.FromJSON IndexAttachment where
parseJSON :: Value -> Parser IndexAttachment
parseJSON =
String
-> (Object -> Parser IndexAttachment)
-> Value
-> Parser IndexAttachment
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"IndexAttachment"
( \Object
x ->
Maybe [AttributeKeyAndValue] -> Maybe Text -> IndexAttachment
IndexAttachment'
(Maybe [AttributeKeyAndValue] -> Maybe Text -> IndexAttachment)
-> Parser (Maybe [AttributeKeyAndValue])
-> Parser (Maybe Text -> IndexAttachment)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe [AttributeKeyAndValue]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IndexedAttributes"
Parser (Maybe (Maybe [AttributeKeyAndValue]))
-> Maybe [AttributeKeyAndValue]
-> Parser (Maybe [AttributeKeyAndValue])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AttributeKeyAndValue]
forall a. Monoid a => a
Prelude.mempty
)
Parser (Maybe Text -> IndexAttachment)
-> Parser (Maybe Text) -> Parser IndexAttachment
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ObjectIdentifier")
)
instance Prelude.Hashable IndexAttachment
instance Prelude.NFData IndexAttachment