{-# 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.Detective.ListGraphs
(
ListGraphs (..),
newListGraphs,
listGraphs_maxResults,
listGraphs_nextToken,
ListGraphsResponse (..),
newListGraphsResponse,
listGraphsResponse_graphList,
listGraphsResponse_nextToken,
listGraphsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Detective.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListGraphs = ListGraphs'
{
ListGraphs -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListGraphs -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListGraphs -> ListGraphs -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListGraphs -> ListGraphs -> Bool
$c/= :: ListGraphs -> ListGraphs -> Bool
== :: ListGraphs -> ListGraphs -> Bool
$c== :: ListGraphs -> ListGraphs -> Bool
Prelude.Eq, ReadPrec [ListGraphs]
ReadPrec ListGraphs
Int -> ReadS ListGraphs
ReadS [ListGraphs]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListGraphs]
$creadListPrec :: ReadPrec [ListGraphs]
readPrec :: ReadPrec ListGraphs
$creadPrec :: ReadPrec ListGraphs
readList :: ReadS [ListGraphs]
$creadList :: ReadS [ListGraphs]
readsPrec :: Int -> ReadS ListGraphs
$creadsPrec :: Int -> ReadS ListGraphs
Prelude.Read, Int -> ListGraphs -> ShowS
[ListGraphs] -> ShowS
ListGraphs -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListGraphs] -> ShowS
$cshowList :: [ListGraphs] -> ShowS
show :: ListGraphs -> String
$cshow :: ListGraphs -> String
showsPrec :: Int -> ListGraphs -> ShowS
$cshowsPrec :: Int -> ListGraphs -> ShowS
Prelude.Show, forall x. Rep ListGraphs x -> ListGraphs
forall x. ListGraphs -> Rep ListGraphs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListGraphs x -> ListGraphs
$cfrom :: forall x. ListGraphs -> Rep ListGraphs x
Prelude.Generic)
newListGraphs ::
ListGraphs
newListGraphs :: ListGraphs
newListGraphs =
ListGraphs'
{ $sel:maxResults:ListGraphs' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListGraphs' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listGraphs_maxResults :: Lens.Lens' ListGraphs (Prelude.Maybe Prelude.Natural)
listGraphs_maxResults :: Lens' ListGraphs (Maybe Natural)
listGraphs_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGraphs' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListGraphs' :: ListGraphs -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListGraphs
s@ListGraphs' {} Maybe Natural
a -> ListGraphs
s {$sel:maxResults:ListGraphs' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListGraphs)
listGraphs_nextToken :: Lens.Lens' ListGraphs (Prelude.Maybe Prelude.Text)
listGraphs_nextToken :: Lens' ListGraphs (Maybe Text)
listGraphs_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGraphs' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListGraphs' :: ListGraphs -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListGraphs
s@ListGraphs' {} Maybe Text
a -> ListGraphs
s {$sel:nextToken:ListGraphs' :: Maybe Text
nextToken = Maybe Text
a} :: ListGraphs)
instance Core.AWSRequest ListGraphs where
type AWSResponse ListGraphs = ListGraphsResponse
request :: (Service -> Service) -> ListGraphs -> Request ListGraphs
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 ListGraphs
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListGraphs)))
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 [Graph] -> Maybe Text -> Int -> ListGraphsResponse
ListGraphsResponse'
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
"GraphList" 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.<*> (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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListGraphs where
hashWithSalt :: Int -> ListGraphs -> Int
hashWithSalt Int
_salt ListGraphs' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListGraphs' :: ListGraphs -> Maybe Text
$sel:maxResults:ListGraphs' :: ListGraphs -> 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
instance Prelude.NFData ListGraphs where
rnf :: ListGraphs -> ()
rnf ListGraphs' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListGraphs' :: ListGraphs -> Maybe Text
$sel:maxResults:ListGraphs' :: ListGraphs -> 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
instance Data.ToHeaders ListGraphs where
toHeaders :: ListGraphs -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON ListGraphs where
toJSON :: ListGraphs -> Value
toJSON ListGraphs' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListGraphs' :: ListGraphs -> Maybe Text
$sel:maxResults:ListGraphs' :: ListGraphs -> 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
]
)
instance Data.ToPath ListGraphs where
toPath :: ListGraphs -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/graphs/list"
instance Data.ToQuery ListGraphs where
toQuery :: ListGraphs -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListGraphsResponse = ListGraphsResponse'
{
ListGraphsResponse -> Maybe [Graph]
graphList :: Prelude.Maybe [Graph],
ListGraphsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListGraphsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListGraphsResponse -> ListGraphsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListGraphsResponse -> ListGraphsResponse -> Bool
$c/= :: ListGraphsResponse -> ListGraphsResponse -> Bool
== :: ListGraphsResponse -> ListGraphsResponse -> Bool
$c== :: ListGraphsResponse -> ListGraphsResponse -> Bool
Prelude.Eq, ReadPrec [ListGraphsResponse]
ReadPrec ListGraphsResponse
Int -> ReadS ListGraphsResponse
ReadS [ListGraphsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListGraphsResponse]
$creadListPrec :: ReadPrec [ListGraphsResponse]
readPrec :: ReadPrec ListGraphsResponse
$creadPrec :: ReadPrec ListGraphsResponse
readList :: ReadS [ListGraphsResponse]
$creadList :: ReadS [ListGraphsResponse]
readsPrec :: Int -> ReadS ListGraphsResponse
$creadsPrec :: Int -> ReadS ListGraphsResponse
Prelude.Read, Int -> ListGraphsResponse -> ShowS
[ListGraphsResponse] -> ShowS
ListGraphsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListGraphsResponse] -> ShowS
$cshowList :: [ListGraphsResponse] -> ShowS
show :: ListGraphsResponse -> String
$cshow :: ListGraphsResponse -> String
showsPrec :: Int -> ListGraphsResponse -> ShowS
$cshowsPrec :: Int -> ListGraphsResponse -> ShowS
Prelude.Show, forall x. Rep ListGraphsResponse x -> ListGraphsResponse
forall x. ListGraphsResponse -> Rep ListGraphsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListGraphsResponse x -> ListGraphsResponse
$cfrom :: forall x. ListGraphsResponse -> Rep ListGraphsResponse x
Prelude.Generic)
newListGraphsResponse ::
Prelude.Int ->
ListGraphsResponse
newListGraphsResponse :: Int -> ListGraphsResponse
newListGraphsResponse Int
pHttpStatus_ =
ListGraphsResponse'
{ $sel:graphList:ListGraphsResponse' :: Maybe [Graph]
graphList = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListGraphsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListGraphsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listGraphsResponse_graphList :: Lens.Lens' ListGraphsResponse (Prelude.Maybe [Graph])
listGraphsResponse_graphList :: Lens' ListGraphsResponse (Maybe [Graph])
listGraphsResponse_graphList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGraphsResponse' {Maybe [Graph]
graphList :: Maybe [Graph]
$sel:graphList:ListGraphsResponse' :: ListGraphsResponse -> Maybe [Graph]
graphList} -> Maybe [Graph]
graphList) (\s :: ListGraphsResponse
s@ListGraphsResponse' {} Maybe [Graph]
a -> ListGraphsResponse
s {$sel:graphList:ListGraphsResponse' :: Maybe [Graph]
graphList = Maybe [Graph]
a} :: ListGraphsResponse) 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
listGraphsResponse_nextToken :: Lens.Lens' ListGraphsResponse (Prelude.Maybe Prelude.Text)
listGraphsResponse_nextToken :: Lens' ListGraphsResponse (Maybe Text)
listGraphsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGraphsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListGraphsResponse' :: ListGraphsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListGraphsResponse
s@ListGraphsResponse' {} Maybe Text
a -> ListGraphsResponse
s {$sel:nextToken:ListGraphsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListGraphsResponse)
listGraphsResponse_httpStatus :: Lens.Lens' ListGraphsResponse Prelude.Int
listGraphsResponse_httpStatus :: Lens' ListGraphsResponse Int
listGraphsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGraphsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListGraphsResponse' :: ListGraphsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListGraphsResponse
s@ListGraphsResponse' {} Int
a -> ListGraphsResponse
s {$sel:httpStatus:ListGraphsResponse' :: Int
httpStatus = Int
a} :: ListGraphsResponse)
instance Prelude.NFData ListGraphsResponse where
rnf :: ListGraphsResponse -> ()
rnf ListGraphsResponse' {Int
Maybe [Graph]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
graphList :: Maybe [Graph]
$sel:httpStatus:ListGraphsResponse' :: ListGraphsResponse -> Int
$sel:nextToken:ListGraphsResponse' :: ListGraphsResponse -> Maybe Text
$sel:graphList:ListGraphsResponse' :: ListGraphsResponse -> Maybe [Graph]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Graph]
graphList
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 Int
httpStatus