{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data BatchLookupPolicy = BatchLookupPolicy'
{
BatchLookupPolicy -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
BatchLookupPolicy -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
BatchLookupPolicy -> ObjectReference
objectReference :: ObjectReference
}
deriving (BatchLookupPolicy -> BatchLookupPolicy -> Bool
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]
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
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. 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'
{ $sel:maxResults:BatchLookupPolicy' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:BatchLookupPolicy' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:objectReference:BatchLookupPolicy' :: ObjectReference
objectReference = ObjectReference
pObjectReference_
}
batchLookupPolicy_maxResults :: Lens.Lens' BatchLookupPolicy (Prelude.Maybe Prelude.Natural)
batchLookupPolicy_maxResults :: Lens' BatchLookupPolicy (Maybe Natural)
batchLookupPolicy_maxResults = 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_nextToken :: Lens.Lens' BatchLookupPolicy (Prelude.Maybe Prelude.Text)
batchLookupPolicy_nextToken :: Lens' BatchLookupPolicy (Maybe Text)
batchLookupPolicy_nextToken = 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_objectReference :: Lens.Lens' BatchLookupPolicy ObjectReference
batchLookupPolicy_objectReference :: Lens' BatchLookupPolicy ObjectReference
batchLookupPolicy_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 where
hashWithSalt :: Int -> BatchLookupPolicy -> Int
hashWithSalt Int
_salt BatchLookupPolicy' {Maybe Natural
Maybe Text
ObjectReference
objectReference :: ObjectReference
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:objectReference:BatchLookupPolicy' :: BatchLookupPolicy -> ObjectReference
$sel:nextToken:BatchLookupPolicy' :: BatchLookupPolicy -> Maybe Text
$sel:maxResults:BatchLookupPolicy' :: BatchLookupPolicy -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ObjectReference
objectReference
instance Prelude.NFData BatchLookupPolicy where
rnf :: BatchLookupPolicy -> ()
rnf BatchLookupPolicy' {Maybe Natural
Maybe Text
ObjectReference
objectReference :: ObjectReference
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:objectReference:BatchLookupPolicy' :: BatchLookupPolicy -> ObjectReference
$sel:nextToken:BatchLookupPolicy' :: BatchLookupPolicy -> Maybe Text
$sel:maxResults:BatchLookupPolicy' :: BatchLookupPolicy -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ObjectReference
objectReference
instance Data.ToJSON BatchLookupPolicy where
toJSON :: BatchLookupPolicy -> Value
toJSON BatchLookupPolicy' {Maybe Natural
Maybe Text
ObjectReference
objectReference :: ObjectReference
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:objectReference:BatchLookupPolicy' :: BatchLookupPolicy -> ObjectReference
$sel:nextToken:BatchLookupPolicy' :: BatchLookupPolicy -> Maybe Text
$sel:maxResults:BatchLookupPolicy' :: BatchLookupPolicy -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
(Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
forall a. a -> Maybe a
Prelude.Just
(Key
"ObjectReference" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ObjectReference
objectReference)
]
)