{-# 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.BatchCreateIndex where
import Amazonka.CloudDirectory.Types.AttributeKey
import Amazonka.CloudDirectory.Types.ObjectReference
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data BatchCreateIndex = BatchCreateIndex'
{
BatchCreateIndex -> Maybe ObjectReference
parentReference :: Prelude.Maybe ObjectReference,
BatchCreateIndex -> Maybe Text
linkName :: Prelude.Maybe Prelude.Text,
BatchCreateIndex -> Maybe Text
batchReferenceName :: Prelude.Maybe Prelude.Text,
BatchCreateIndex -> [AttributeKey]
orderedIndexedAttributeList :: [AttributeKey],
BatchCreateIndex -> Bool
isUnique :: Prelude.Bool
}
deriving (BatchCreateIndex -> BatchCreateIndex -> Bool
(BatchCreateIndex -> BatchCreateIndex -> Bool)
-> (BatchCreateIndex -> BatchCreateIndex -> Bool)
-> Eq BatchCreateIndex
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchCreateIndex -> BatchCreateIndex -> Bool
$c/= :: BatchCreateIndex -> BatchCreateIndex -> Bool
== :: BatchCreateIndex -> BatchCreateIndex -> Bool
$c== :: BatchCreateIndex -> BatchCreateIndex -> Bool
Prelude.Eq, ReadPrec [BatchCreateIndex]
ReadPrec BatchCreateIndex
Int -> ReadS BatchCreateIndex
ReadS [BatchCreateIndex]
(Int -> ReadS BatchCreateIndex)
-> ReadS [BatchCreateIndex]
-> ReadPrec BatchCreateIndex
-> ReadPrec [BatchCreateIndex]
-> Read BatchCreateIndex
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchCreateIndex]
$creadListPrec :: ReadPrec [BatchCreateIndex]
readPrec :: ReadPrec BatchCreateIndex
$creadPrec :: ReadPrec BatchCreateIndex
readList :: ReadS [BatchCreateIndex]
$creadList :: ReadS [BatchCreateIndex]
readsPrec :: Int -> ReadS BatchCreateIndex
$creadsPrec :: Int -> ReadS BatchCreateIndex
Prelude.Read, Int -> BatchCreateIndex -> ShowS
[BatchCreateIndex] -> ShowS
BatchCreateIndex -> String
(Int -> BatchCreateIndex -> ShowS)
-> (BatchCreateIndex -> String)
-> ([BatchCreateIndex] -> ShowS)
-> Show BatchCreateIndex
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchCreateIndex] -> ShowS
$cshowList :: [BatchCreateIndex] -> ShowS
show :: BatchCreateIndex -> String
$cshow :: BatchCreateIndex -> String
showsPrec :: Int -> BatchCreateIndex -> ShowS
$cshowsPrec :: Int -> BatchCreateIndex -> ShowS
Prelude.Show, (forall x. BatchCreateIndex -> Rep BatchCreateIndex x)
-> (forall x. Rep BatchCreateIndex x -> BatchCreateIndex)
-> Generic BatchCreateIndex
forall x. Rep BatchCreateIndex x -> BatchCreateIndex
forall x. BatchCreateIndex -> Rep BatchCreateIndex x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchCreateIndex x -> BatchCreateIndex
$cfrom :: forall x. BatchCreateIndex -> Rep BatchCreateIndex x
Prelude.Generic)
newBatchCreateIndex ::
Prelude.Bool ->
BatchCreateIndex
newBatchCreateIndex :: Bool -> BatchCreateIndex
newBatchCreateIndex Bool
pIsUnique_ =
BatchCreateIndex' :: Maybe ObjectReference
-> Maybe Text
-> Maybe Text
-> [AttributeKey]
-> Bool
-> BatchCreateIndex
BatchCreateIndex'
{ $sel:parentReference:BatchCreateIndex' :: Maybe ObjectReference
parentReference =
Maybe ObjectReference
forall a. Maybe a
Prelude.Nothing,
$sel:linkName:BatchCreateIndex' :: Maybe Text
linkName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:batchReferenceName:BatchCreateIndex' :: Maybe Text
batchReferenceName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:orderedIndexedAttributeList:BatchCreateIndex' :: [AttributeKey]
orderedIndexedAttributeList = [AttributeKey]
forall a. Monoid a => a
Prelude.mempty,
$sel:isUnique:BatchCreateIndex' :: Bool
isUnique = Bool
pIsUnique_
}
batchCreateIndex_parentReference :: Lens.Lens' BatchCreateIndex (Prelude.Maybe ObjectReference)
batchCreateIndex_parentReference :: (Maybe ObjectReference -> f (Maybe ObjectReference))
-> BatchCreateIndex -> f BatchCreateIndex
batchCreateIndex_parentReference = (BatchCreateIndex -> Maybe ObjectReference)
-> (BatchCreateIndex -> Maybe ObjectReference -> BatchCreateIndex)
-> Lens
BatchCreateIndex
BatchCreateIndex
(Maybe ObjectReference)
(Maybe ObjectReference)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchCreateIndex' {Maybe ObjectReference
parentReference :: Maybe ObjectReference
$sel:parentReference:BatchCreateIndex' :: BatchCreateIndex -> Maybe ObjectReference
parentReference} -> Maybe ObjectReference
parentReference) (\s :: BatchCreateIndex
s@BatchCreateIndex' {} Maybe ObjectReference
a -> BatchCreateIndex
s {$sel:parentReference:BatchCreateIndex' :: Maybe ObjectReference
parentReference = Maybe ObjectReference
a} :: BatchCreateIndex)
batchCreateIndex_linkName :: Lens.Lens' BatchCreateIndex (Prelude.Maybe Prelude.Text)
batchCreateIndex_linkName :: (Maybe Text -> f (Maybe Text))
-> BatchCreateIndex -> f BatchCreateIndex
batchCreateIndex_linkName = (BatchCreateIndex -> Maybe Text)
-> (BatchCreateIndex -> Maybe Text -> BatchCreateIndex)
-> Lens BatchCreateIndex BatchCreateIndex (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchCreateIndex' {Maybe Text
linkName :: Maybe Text
$sel:linkName:BatchCreateIndex' :: BatchCreateIndex -> Maybe Text
linkName} -> Maybe Text
linkName) (\s :: BatchCreateIndex
s@BatchCreateIndex' {} Maybe Text
a -> BatchCreateIndex
s {$sel:linkName:BatchCreateIndex' :: Maybe Text
linkName = Maybe Text
a} :: BatchCreateIndex)
batchCreateIndex_batchReferenceName :: Lens.Lens' BatchCreateIndex (Prelude.Maybe Prelude.Text)
batchCreateIndex_batchReferenceName :: (Maybe Text -> f (Maybe Text))
-> BatchCreateIndex -> f BatchCreateIndex
batchCreateIndex_batchReferenceName = (BatchCreateIndex -> Maybe Text)
-> (BatchCreateIndex -> Maybe Text -> BatchCreateIndex)
-> Lens BatchCreateIndex BatchCreateIndex (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchCreateIndex' {Maybe Text
batchReferenceName :: Maybe Text
$sel:batchReferenceName:BatchCreateIndex' :: BatchCreateIndex -> Maybe Text
batchReferenceName} -> Maybe Text
batchReferenceName) (\s :: BatchCreateIndex
s@BatchCreateIndex' {} Maybe Text
a -> BatchCreateIndex
s {$sel:batchReferenceName:BatchCreateIndex' :: Maybe Text
batchReferenceName = Maybe Text
a} :: BatchCreateIndex)
batchCreateIndex_orderedIndexedAttributeList :: Lens.Lens' BatchCreateIndex [AttributeKey]
batchCreateIndex_orderedIndexedAttributeList :: ([AttributeKey] -> f [AttributeKey])
-> BatchCreateIndex -> f BatchCreateIndex
batchCreateIndex_orderedIndexedAttributeList = (BatchCreateIndex -> [AttributeKey])
-> (BatchCreateIndex -> [AttributeKey] -> BatchCreateIndex)
-> Lens
BatchCreateIndex BatchCreateIndex [AttributeKey] [AttributeKey]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchCreateIndex' {[AttributeKey]
orderedIndexedAttributeList :: [AttributeKey]
$sel:orderedIndexedAttributeList:BatchCreateIndex' :: BatchCreateIndex -> [AttributeKey]
orderedIndexedAttributeList} -> [AttributeKey]
orderedIndexedAttributeList) (\s :: BatchCreateIndex
s@BatchCreateIndex' {} [AttributeKey]
a -> BatchCreateIndex
s {$sel:orderedIndexedAttributeList:BatchCreateIndex' :: [AttributeKey]
orderedIndexedAttributeList = [AttributeKey]
a} :: BatchCreateIndex) (([AttributeKey] -> f [AttributeKey])
-> BatchCreateIndex -> f BatchCreateIndex)
-> (([AttributeKey] -> f [AttributeKey])
-> [AttributeKey] -> f [AttributeKey])
-> ([AttributeKey] -> f [AttributeKey])
-> BatchCreateIndex
-> f BatchCreateIndex
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AttributeKey] -> f [AttributeKey])
-> [AttributeKey] -> f [AttributeKey]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
batchCreateIndex_isUnique :: Lens.Lens' BatchCreateIndex Prelude.Bool
batchCreateIndex_isUnique :: (Bool -> f Bool) -> BatchCreateIndex -> f BatchCreateIndex
batchCreateIndex_isUnique = (BatchCreateIndex -> Bool)
-> (BatchCreateIndex -> Bool -> BatchCreateIndex)
-> Lens BatchCreateIndex BatchCreateIndex Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchCreateIndex' {Bool
isUnique :: Bool
$sel:isUnique:BatchCreateIndex' :: BatchCreateIndex -> Bool
isUnique} -> Bool
isUnique) (\s :: BatchCreateIndex
s@BatchCreateIndex' {} Bool
a -> BatchCreateIndex
s {$sel:isUnique:BatchCreateIndex' :: Bool
isUnique = Bool
a} :: BatchCreateIndex)
instance Prelude.Hashable BatchCreateIndex
instance Prelude.NFData BatchCreateIndex
instance Core.ToJSON BatchCreateIndex where
toJSON :: BatchCreateIndex -> Value
toJSON BatchCreateIndex' {Bool
[AttributeKey]
Maybe Text
Maybe ObjectReference
isUnique :: Bool
orderedIndexedAttributeList :: [AttributeKey]
batchReferenceName :: Maybe Text
linkName :: Maybe Text
parentReference :: Maybe ObjectReference
$sel:isUnique:BatchCreateIndex' :: BatchCreateIndex -> Bool
$sel:orderedIndexedAttributeList:BatchCreateIndex' :: BatchCreateIndex -> [AttributeKey]
$sel:batchReferenceName:BatchCreateIndex' :: BatchCreateIndex -> Maybe Text
$sel:linkName:BatchCreateIndex' :: BatchCreateIndex -> Maybe Text
$sel:parentReference:BatchCreateIndex' :: BatchCreateIndex -> Maybe ObjectReference
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ParentReference" Text -> ObjectReference -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ObjectReference -> Pair) -> Maybe ObjectReference -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ObjectReference
parentReference,
(Text
"LinkName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
linkName,
(Text
"BatchReferenceName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
batchReferenceName,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"OrderedIndexedAttributeList"
Text -> [AttributeKey] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [AttributeKey]
orderedIndexedAttributeList
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"IsUnique" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Bool
isUnique)
]
)