{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.DirectoryService.ListSchemaExtensions
(
ListSchemaExtensions (..),
newListSchemaExtensions,
listSchemaExtensions_limit,
listSchemaExtensions_nextToken,
listSchemaExtensions_directoryId,
ListSchemaExtensionsResponse (..),
newListSchemaExtensionsResponse,
listSchemaExtensionsResponse_nextToken,
listSchemaExtensionsResponse_schemaExtensionsInfo,
listSchemaExtensionsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DirectoryService.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListSchemaExtensions = ListSchemaExtensions'
{
ListSchemaExtensions -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
ListSchemaExtensions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListSchemaExtensions -> Text
directoryId :: Prelude.Text
}
deriving (ListSchemaExtensions -> ListSchemaExtensions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSchemaExtensions -> ListSchemaExtensions -> Bool
$c/= :: ListSchemaExtensions -> ListSchemaExtensions -> Bool
== :: ListSchemaExtensions -> ListSchemaExtensions -> Bool
$c== :: ListSchemaExtensions -> ListSchemaExtensions -> Bool
Prelude.Eq, ReadPrec [ListSchemaExtensions]
ReadPrec ListSchemaExtensions
Int -> ReadS ListSchemaExtensions
ReadS [ListSchemaExtensions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSchemaExtensions]
$creadListPrec :: ReadPrec [ListSchemaExtensions]
readPrec :: ReadPrec ListSchemaExtensions
$creadPrec :: ReadPrec ListSchemaExtensions
readList :: ReadS [ListSchemaExtensions]
$creadList :: ReadS [ListSchemaExtensions]
readsPrec :: Int -> ReadS ListSchemaExtensions
$creadsPrec :: Int -> ReadS ListSchemaExtensions
Prelude.Read, Int -> ListSchemaExtensions -> ShowS
[ListSchemaExtensions] -> ShowS
ListSchemaExtensions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSchemaExtensions] -> ShowS
$cshowList :: [ListSchemaExtensions] -> ShowS
show :: ListSchemaExtensions -> String
$cshow :: ListSchemaExtensions -> String
showsPrec :: Int -> ListSchemaExtensions -> ShowS
$cshowsPrec :: Int -> ListSchemaExtensions -> ShowS
Prelude.Show, forall x. Rep ListSchemaExtensions x -> ListSchemaExtensions
forall x. ListSchemaExtensions -> Rep ListSchemaExtensions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListSchemaExtensions x -> ListSchemaExtensions
$cfrom :: forall x. ListSchemaExtensions -> Rep ListSchemaExtensions x
Prelude.Generic)
newListSchemaExtensions ::
Prelude.Text ->
ListSchemaExtensions
newListSchemaExtensions :: Text -> ListSchemaExtensions
newListSchemaExtensions Text
pDirectoryId_ =
ListSchemaExtensions'
{ $sel:limit:ListSchemaExtensions' :: Maybe Natural
limit = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListSchemaExtensions' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:directoryId:ListSchemaExtensions' :: Text
directoryId = Text
pDirectoryId_
}
listSchemaExtensions_limit :: Lens.Lens' ListSchemaExtensions (Prelude.Maybe Prelude.Natural)
listSchemaExtensions_limit :: Lens' ListSchemaExtensions (Maybe Natural)
listSchemaExtensions_limit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSchemaExtensions' {Maybe Natural
limit :: Maybe Natural
$sel:limit:ListSchemaExtensions' :: ListSchemaExtensions -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: ListSchemaExtensions
s@ListSchemaExtensions' {} Maybe Natural
a -> ListSchemaExtensions
s {$sel:limit:ListSchemaExtensions' :: Maybe Natural
limit = Maybe Natural
a} :: ListSchemaExtensions)
listSchemaExtensions_nextToken :: Lens.Lens' ListSchemaExtensions (Prelude.Maybe Prelude.Text)
listSchemaExtensions_nextToken :: Lens' ListSchemaExtensions (Maybe Text)
listSchemaExtensions_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSchemaExtensions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSchemaExtensions' :: ListSchemaExtensions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSchemaExtensions
s@ListSchemaExtensions' {} Maybe Text
a -> ListSchemaExtensions
s {$sel:nextToken:ListSchemaExtensions' :: Maybe Text
nextToken = Maybe Text
a} :: ListSchemaExtensions)
listSchemaExtensions_directoryId :: Lens.Lens' ListSchemaExtensions Prelude.Text
listSchemaExtensions_directoryId :: Lens' ListSchemaExtensions Text
listSchemaExtensions_directoryId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSchemaExtensions' {Text
directoryId :: Text
$sel:directoryId:ListSchemaExtensions' :: ListSchemaExtensions -> Text
directoryId} -> Text
directoryId) (\s :: ListSchemaExtensions
s@ListSchemaExtensions' {} Text
a -> ListSchemaExtensions
s {$sel:directoryId:ListSchemaExtensions' :: Text
directoryId = Text
a} :: ListSchemaExtensions)
instance Core.AWSPager ListSchemaExtensions where
page :: ListSchemaExtensions
-> AWSResponse ListSchemaExtensions -> Maybe ListSchemaExtensions
page ListSchemaExtensions
rq AWSResponse ListSchemaExtensions
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListSchemaExtensions
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListSchemaExtensionsResponse (Maybe Text)
listSchemaExtensionsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListSchemaExtensions
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListSchemaExtensionsResponse (Maybe [SchemaExtensionInfo])
listSchemaExtensionsResponse_schemaExtensionsInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListSchemaExtensions
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListSchemaExtensions (Maybe Text)
listSchemaExtensions_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListSchemaExtensions
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListSchemaExtensionsResponse (Maybe Text)
listSchemaExtensionsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest ListSchemaExtensions where
type
AWSResponse ListSchemaExtensions =
ListSchemaExtensionsResponse
request :: (Service -> Service)
-> ListSchemaExtensions -> Request ListSchemaExtensions
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListSchemaExtensions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListSchemaExtensions)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Maybe [SchemaExtensionInfo]
-> Int
-> ListSchemaExtensionsResponse
ListSchemaExtensionsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"SchemaExtensionsInfo"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListSchemaExtensions where
hashWithSalt :: Int -> ListSchemaExtensions -> Int
hashWithSalt Int
_salt ListSchemaExtensions' {Maybe Natural
Maybe Text
Text
directoryId :: Text
nextToken :: Maybe Text
limit :: Maybe Natural
$sel:directoryId:ListSchemaExtensions' :: ListSchemaExtensions -> Text
$sel:nextToken:ListSchemaExtensions' :: ListSchemaExtensions -> Maybe Text
$sel:limit:ListSchemaExtensions' :: ListSchemaExtensions -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
limit
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
directoryId
instance Prelude.NFData ListSchemaExtensions where
rnf :: ListSchemaExtensions -> ()
rnf ListSchemaExtensions' {Maybe Natural
Maybe Text
Text
directoryId :: Text
nextToken :: Maybe Text
limit :: Maybe Natural
$sel:directoryId:ListSchemaExtensions' :: ListSchemaExtensions -> Text
$sel:nextToken:ListSchemaExtensions' :: ListSchemaExtensions -> Maybe Text
$sel:limit:ListSchemaExtensions' :: ListSchemaExtensions -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
limit
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 Text
directoryId
instance Data.ToHeaders ListSchemaExtensions where
toHeaders :: ListSchemaExtensions -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"DirectoryService_20150416.ListSchemaExtensions" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON ListSchemaExtensions where
toJSON :: ListSchemaExtensions -> Value
toJSON ListSchemaExtensions' {Maybe Natural
Maybe Text
Text
directoryId :: Text
nextToken :: Maybe Text
limit :: Maybe Natural
$sel:directoryId:ListSchemaExtensions' :: ListSchemaExtensions -> Text
$sel:nextToken:ListSchemaExtensions' :: ListSchemaExtensions -> Maybe Text
$sel:limit:ListSchemaExtensions' :: ListSchemaExtensions -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Limit" 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
limit,
(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
"DirectoryId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
directoryId)
]
)
instance Data.ToPath ListSchemaExtensions where
toPath :: ListSchemaExtensions -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListSchemaExtensions where
toQuery :: ListSchemaExtensions -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListSchemaExtensionsResponse = ListSchemaExtensionsResponse'
{
ListSchemaExtensionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListSchemaExtensionsResponse -> Maybe [SchemaExtensionInfo]
schemaExtensionsInfo :: Prelude.Maybe [SchemaExtensionInfo],
ListSchemaExtensionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListSchemaExtensionsResponse
-> ListSchemaExtensionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSchemaExtensionsResponse
-> ListSchemaExtensionsResponse -> Bool
$c/= :: ListSchemaExtensionsResponse
-> ListSchemaExtensionsResponse -> Bool
== :: ListSchemaExtensionsResponse
-> ListSchemaExtensionsResponse -> Bool
$c== :: ListSchemaExtensionsResponse
-> ListSchemaExtensionsResponse -> Bool
Prelude.Eq, ReadPrec [ListSchemaExtensionsResponse]
ReadPrec ListSchemaExtensionsResponse
Int -> ReadS ListSchemaExtensionsResponse
ReadS [ListSchemaExtensionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSchemaExtensionsResponse]
$creadListPrec :: ReadPrec [ListSchemaExtensionsResponse]
readPrec :: ReadPrec ListSchemaExtensionsResponse
$creadPrec :: ReadPrec ListSchemaExtensionsResponse
readList :: ReadS [ListSchemaExtensionsResponse]
$creadList :: ReadS [ListSchemaExtensionsResponse]
readsPrec :: Int -> ReadS ListSchemaExtensionsResponse
$creadsPrec :: Int -> ReadS ListSchemaExtensionsResponse
Prelude.Read, Int -> ListSchemaExtensionsResponse -> ShowS
[ListSchemaExtensionsResponse] -> ShowS
ListSchemaExtensionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSchemaExtensionsResponse] -> ShowS
$cshowList :: [ListSchemaExtensionsResponse] -> ShowS
show :: ListSchemaExtensionsResponse -> String
$cshow :: ListSchemaExtensionsResponse -> String
showsPrec :: Int -> ListSchemaExtensionsResponse -> ShowS
$cshowsPrec :: Int -> ListSchemaExtensionsResponse -> ShowS
Prelude.Show, forall x.
Rep ListSchemaExtensionsResponse x -> ListSchemaExtensionsResponse
forall x.
ListSchemaExtensionsResponse -> Rep ListSchemaExtensionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListSchemaExtensionsResponse x -> ListSchemaExtensionsResponse
$cfrom :: forall x.
ListSchemaExtensionsResponse -> Rep ListSchemaExtensionsResponse x
Prelude.Generic)
newListSchemaExtensionsResponse ::
Prelude.Int ->
ListSchemaExtensionsResponse
newListSchemaExtensionsResponse :: Int -> ListSchemaExtensionsResponse
newListSchemaExtensionsResponse Int
pHttpStatus_ =
ListSchemaExtensionsResponse'
{ $sel:nextToken:ListSchemaExtensionsResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:schemaExtensionsInfo:ListSchemaExtensionsResponse' :: Maybe [SchemaExtensionInfo]
schemaExtensionsInfo = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListSchemaExtensionsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listSchemaExtensionsResponse_nextToken :: Lens.Lens' ListSchemaExtensionsResponse (Prelude.Maybe Prelude.Text)
listSchemaExtensionsResponse_nextToken :: Lens' ListSchemaExtensionsResponse (Maybe Text)
listSchemaExtensionsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSchemaExtensionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSchemaExtensionsResponse' :: ListSchemaExtensionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSchemaExtensionsResponse
s@ListSchemaExtensionsResponse' {} Maybe Text
a -> ListSchemaExtensionsResponse
s {$sel:nextToken:ListSchemaExtensionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListSchemaExtensionsResponse)
listSchemaExtensionsResponse_schemaExtensionsInfo :: Lens.Lens' ListSchemaExtensionsResponse (Prelude.Maybe [SchemaExtensionInfo])
listSchemaExtensionsResponse_schemaExtensionsInfo :: Lens' ListSchemaExtensionsResponse (Maybe [SchemaExtensionInfo])
listSchemaExtensionsResponse_schemaExtensionsInfo = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSchemaExtensionsResponse' {Maybe [SchemaExtensionInfo]
schemaExtensionsInfo :: Maybe [SchemaExtensionInfo]
$sel:schemaExtensionsInfo:ListSchemaExtensionsResponse' :: ListSchemaExtensionsResponse -> Maybe [SchemaExtensionInfo]
schemaExtensionsInfo} -> Maybe [SchemaExtensionInfo]
schemaExtensionsInfo) (\s :: ListSchemaExtensionsResponse
s@ListSchemaExtensionsResponse' {} Maybe [SchemaExtensionInfo]
a -> ListSchemaExtensionsResponse
s {$sel:schemaExtensionsInfo:ListSchemaExtensionsResponse' :: Maybe [SchemaExtensionInfo]
schemaExtensionsInfo = Maybe [SchemaExtensionInfo]
a} :: ListSchemaExtensionsResponse) 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
listSchemaExtensionsResponse_httpStatus :: Lens.Lens' ListSchemaExtensionsResponse Prelude.Int
listSchemaExtensionsResponse_httpStatus :: Lens' ListSchemaExtensionsResponse Int
listSchemaExtensionsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSchemaExtensionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListSchemaExtensionsResponse' :: ListSchemaExtensionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListSchemaExtensionsResponse
s@ListSchemaExtensionsResponse' {} Int
a -> ListSchemaExtensionsResponse
s {$sel:httpStatus:ListSchemaExtensionsResponse' :: Int
httpStatus = Int
a} :: ListSchemaExtensionsResponse)
instance Prelude.NFData ListSchemaExtensionsResponse where
rnf :: ListSchemaExtensionsResponse -> ()
rnf ListSchemaExtensionsResponse' {Int
Maybe [SchemaExtensionInfo]
Maybe Text
httpStatus :: Int
schemaExtensionsInfo :: Maybe [SchemaExtensionInfo]
nextToken :: Maybe Text
$sel:httpStatus:ListSchemaExtensionsResponse' :: ListSchemaExtensionsResponse -> Int
$sel:schemaExtensionsInfo:ListSchemaExtensionsResponse' :: ListSchemaExtensionsResponse -> Maybe [SchemaExtensionInfo]
$sel:nextToken:ListSchemaExtensionsResponse' :: ListSchemaExtensionsResponse -> Maybe Text
..} =
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 Maybe [SchemaExtensionInfo]
schemaExtensionsInfo
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus