{-# 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.BatchLookupPolicy where
import Amazonka.CloudDirectory.Types.ObjectReference
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data BatchLookupPolicy = BatchLookupPolicy'
{
BatchLookupPolicy -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
BatchLookupPolicy -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
BatchLookupPolicy -> ObjectReference
objectReference :: ObjectReference
}
deriving (BatchLookupPolicy -> BatchLookupPolicy -> Bool
(BatchLookupPolicy -> BatchLookupPolicy -> Bool)
-> (BatchLookupPolicy -> BatchLookupPolicy -> Bool)
-> Eq BatchLookupPolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchLookupPolicy -> BatchLookupPolicy -> Bool
$c/= :: BatchLookupPolicy -> BatchLookupPolicy -> Bool
== :: BatchLookupPolicy -> BatchLookupPolicy -> Bool
$c== :: BatchLookupPolicy -> BatchLookupPolicy -> Bool
Prelude.Eq, ReadPrec [BatchLookupPolicy]
ReadPrec BatchLookupPolicy
Int -> ReadS BatchLookupPolicy
ReadS [BatchLookupPolicy]
(Int -> ReadS BatchLookupPolicy)
-> ReadS [BatchLookupPolicy]
-> ReadPrec BatchLookupPolicy
-> ReadPrec [BatchLookupPolicy]
-> Read BatchLookupPolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchLookupPolicy]
$creadListPrec :: ReadPrec [BatchLookupPolicy]
readPrec :: ReadPrec BatchLookupPolicy
$creadPrec :: ReadPrec BatchLookupPolicy
readList :: ReadS [BatchLookupPolicy]
$creadList :: ReadS [BatchLookupPolicy]
readsPrec :: Int -> ReadS BatchLookupPolicy
$creadsPrec :: Int -> ReadS BatchLookupPolicy
Prelude.Read, Int -> BatchLookupPolicy -> ShowS
[BatchLookupPolicy] -> ShowS
BatchLookupPolicy -> String
(Int -> BatchLookupPolicy -> ShowS)
-> (BatchLookupPolicy -> String)
-> ([BatchLookupPolicy] -> ShowS)
-> Show BatchLookupPolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchLookupPolicy] -> ShowS
$cshowList :: [BatchLookupPolicy] -> ShowS
show :: BatchLookupPolicy -> String
$cshow :: BatchLookupPolicy -> String
showsPrec :: Int -> BatchLookupPolicy -> ShowS
$cshowsPrec :: Int -> BatchLookupPolicy -> ShowS
Prelude.Show, (forall x. BatchLookupPolicy -> Rep BatchLookupPolicy x)
-> (forall x. Rep BatchLookupPolicy x -> BatchLookupPolicy)
-> Generic BatchLookupPolicy
forall x. Rep BatchLookupPolicy x -> BatchLookupPolicy
forall x. BatchLookupPolicy -> Rep BatchLookupPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchLookupPolicy x -> BatchLookupPolicy
$cfrom :: forall x. BatchLookupPolicy -> Rep BatchLookupPolicy x
Prelude.Generic)
newBatchLookupPolicy ::
ObjectReference ->
BatchLookupPolicy
newBatchLookupPolicy :: ObjectReference -> BatchLookupPolicy
newBatchLookupPolicy ObjectReference
pObjectReference_ =
BatchLookupPolicy' :: Maybe Text -> Maybe Natural -> ObjectReference -> BatchLookupPolicy
BatchLookupPolicy'
{ $sel:nextToken:BatchLookupPolicy' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:BatchLookupPolicy' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:objectReference:BatchLookupPolicy' :: ObjectReference
objectReference = ObjectReference
pObjectReference_
}
batchLookupPolicy_nextToken :: Lens.Lens' BatchLookupPolicy (Prelude.Maybe Prelude.Text)
batchLookupPolicy_nextToken :: (Maybe Text -> f (Maybe Text))
-> BatchLookupPolicy -> f BatchLookupPolicy
batchLookupPolicy_nextToken = (BatchLookupPolicy -> Maybe Text)
-> (BatchLookupPolicy -> Maybe Text -> BatchLookupPolicy)
-> Lens
BatchLookupPolicy BatchLookupPolicy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchLookupPolicy' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:BatchLookupPolicy' :: BatchLookupPolicy -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: BatchLookupPolicy
s@BatchLookupPolicy' {} Maybe Text
a -> BatchLookupPolicy
s {$sel:nextToken:BatchLookupPolicy' :: Maybe Text
nextToken = Maybe Text
a} :: BatchLookupPolicy)
batchLookupPolicy_maxResults :: Lens.Lens' BatchLookupPolicy (Prelude.Maybe Prelude.Natural)
batchLookupPolicy_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> BatchLookupPolicy -> f BatchLookupPolicy
batchLookupPolicy_maxResults = (BatchLookupPolicy -> Maybe Natural)
-> (BatchLookupPolicy -> Maybe Natural -> BatchLookupPolicy)
-> Lens
BatchLookupPolicy BatchLookupPolicy (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchLookupPolicy' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:BatchLookupPolicy' :: BatchLookupPolicy -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: BatchLookupPolicy
s@BatchLookupPolicy' {} Maybe Natural
a -> BatchLookupPolicy
s {$sel:maxResults:BatchLookupPolicy' :: Maybe Natural
maxResults = Maybe Natural
a} :: BatchLookupPolicy)
batchLookupPolicy_objectReference :: Lens.Lens' BatchLookupPolicy ObjectReference
batchLookupPolicy_objectReference :: (ObjectReference -> f ObjectReference)
-> BatchLookupPolicy -> f BatchLookupPolicy
batchLookupPolicy_objectReference = (BatchLookupPolicy -> ObjectReference)
-> (BatchLookupPolicy -> ObjectReference -> BatchLookupPolicy)
-> Lens
BatchLookupPolicy BatchLookupPolicy ObjectReference ObjectReference
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchLookupPolicy' {ObjectReference
objectReference :: ObjectReference
$sel:objectReference:BatchLookupPolicy' :: BatchLookupPolicy -> ObjectReference
objectReference} -> ObjectReference
objectReference) (\s :: BatchLookupPolicy
s@BatchLookupPolicy' {} ObjectReference
a -> BatchLookupPolicy
s {$sel:objectReference:BatchLookupPolicy' :: ObjectReference
objectReference = ObjectReference
a} :: BatchLookupPolicy)
instance Prelude.Hashable BatchLookupPolicy
instance Prelude.NFData BatchLookupPolicy
instance Core.ToJSON BatchLookupPolicy where
toJSON :: BatchLookupPolicy -> Value
toJSON BatchLookupPolicy' {Maybe Natural
Maybe Text
ObjectReference
objectReference :: ObjectReference
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:objectReference:BatchLookupPolicy' :: BatchLookupPolicy -> ObjectReference
$sel:maxResults:BatchLookupPolicy' :: BatchLookupPolicy -> Maybe Natural
$sel:nextToken:BatchLookupPolicy' :: BatchLookupPolicy -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"NextToken" 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
nextToken,
(Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ObjectReference" Text -> ObjectReference -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ObjectReference
objectReference)
]
)