{-# 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.Athena.ListNotebookSessions
(
ListNotebookSessions (..),
newListNotebookSessions,
listNotebookSessions_maxResults,
listNotebookSessions_nextToken,
listNotebookSessions_notebookId,
ListNotebookSessionsResponse (..),
newListNotebookSessionsResponse,
listNotebookSessionsResponse_nextToken,
listNotebookSessionsResponse_httpStatus,
listNotebookSessionsResponse_notebookSessionsList,
)
where
import Amazonka.Athena.Types
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
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListNotebookSessions = ListNotebookSessions'
{
ListNotebookSessions -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListNotebookSessions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListNotebookSessions -> Text
notebookId :: Prelude.Text
}
deriving (ListNotebookSessions -> ListNotebookSessions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListNotebookSessions -> ListNotebookSessions -> Bool
$c/= :: ListNotebookSessions -> ListNotebookSessions -> Bool
== :: ListNotebookSessions -> ListNotebookSessions -> Bool
$c== :: ListNotebookSessions -> ListNotebookSessions -> Bool
Prelude.Eq, ReadPrec [ListNotebookSessions]
ReadPrec ListNotebookSessions
Int -> ReadS ListNotebookSessions
ReadS [ListNotebookSessions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListNotebookSessions]
$creadListPrec :: ReadPrec [ListNotebookSessions]
readPrec :: ReadPrec ListNotebookSessions
$creadPrec :: ReadPrec ListNotebookSessions
readList :: ReadS [ListNotebookSessions]
$creadList :: ReadS [ListNotebookSessions]
readsPrec :: Int -> ReadS ListNotebookSessions
$creadsPrec :: Int -> ReadS ListNotebookSessions
Prelude.Read, Int -> ListNotebookSessions -> ShowS
[ListNotebookSessions] -> ShowS
ListNotebookSessions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListNotebookSessions] -> ShowS
$cshowList :: [ListNotebookSessions] -> ShowS
show :: ListNotebookSessions -> String
$cshow :: ListNotebookSessions -> String
showsPrec :: Int -> ListNotebookSessions -> ShowS
$cshowsPrec :: Int -> ListNotebookSessions -> ShowS
Prelude.Show, forall x. Rep ListNotebookSessions x -> ListNotebookSessions
forall x. ListNotebookSessions -> Rep ListNotebookSessions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListNotebookSessions x -> ListNotebookSessions
$cfrom :: forall x. ListNotebookSessions -> Rep ListNotebookSessions x
Prelude.Generic)
newListNotebookSessions ::
Prelude.Text ->
ListNotebookSessions
newListNotebookSessions :: Text -> ListNotebookSessions
newListNotebookSessions Text
pNotebookId_ =
ListNotebookSessions'
{ $sel:maxResults:ListNotebookSessions' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListNotebookSessions' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:notebookId:ListNotebookSessions' :: Text
notebookId = Text
pNotebookId_
}
listNotebookSessions_maxResults :: Lens.Lens' ListNotebookSessions (Prelude.Maybe Prelude.Natural)
listNotebookSessions_maxResults :: Lens' ListNotebookSessions (Maybe Natural)
listNotebookSessions_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListNotebookSessions' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListNotebookSessions' :: ListNotebookSessions -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListNotebookSessions
s@ListNotebookSessions' {} Maybe Natural
a -> ListNotebookSessions
s {$sel:maxResults:ListNotebookSessions' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListNotebookSessions)
listNotebookSessions_nextToken :: Lens.Lens' ListNotebookSessions (Prelude.Maybe Prelude.Text)
listNotebookSessions_nextToken :: Lens' ListNotebookSessions (Maybe Text)
listNotebookSessions_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListNotebookSessions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListNotebookSessions' :: ListNotebookSessions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListNotebookSessions
s@ListNotebookSessions' {} Maybe Text
a -> ListNotebookSessions
s {$sel:nextToken:ListNotebookSessions' :: Maybe Text
nextToken = Maybe Text
a} :: ListNotebookSessions)
listNotebookSessions_notebookId :: Lens.Lens' ListNotebookSessions Prelude.Text
listNotebookSessions_notebookId :: Lens' ListNotebookSessions Text
listNotebookSessions_notebookId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListNotebookSessions' {Text
notebookId :: Text
$sel:notebookId:ListNotebookSessions' :: ListNotebookSessions -> Text
notebookId} -> Text
notebookId) (\s :: ListNotebookSessions
s@ListNotebookSessions' {} Text
a -> ListNotebookSessions
s {$sel:notebookId:ListNotebookSessions' :: Text
notebookId = Text
a} :: ListNotebookSessions)
instance Core.AWSRequest ListNotebookSessions where
type
AWSResponse ListNotebookSessions =
ListNotebookSessionsResponse
request :: (Service -> Service)
-> ListNotebookSessions -> Request ListNotebookSessions
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 ListNotebookSessions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListNotebookSessions)))
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
-> Int -> [NotebookSessionSummary] -> ListNotebookSessionsResponse
ListNotebookSessionsResponse'
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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
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
"NotebookSessionsList"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable ListNotebookSessions where
hashWithSalt :: Int -> ListNotebookSessions -> Int
hashWithSalt Int
_salt ListNotebookSessions' {Maybe Natural
Maybe Text
Text
notebookId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:notebookId:ListNotebookSessions' :: ListNotebookSessions -> Text
$sel:nextToken:ListNotebookSessions' :: ListNotebookSessions -> Maybe Text
$sel:maxResults:ListNotebookSessions' :: ListNotebookSessions -> 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` Text
notebookId
instance Prelude.NFData ListNotebookSessions where
rnf :: ListNotebookSessions -> ()
rnf ListNotebookSessions' {Maybe Natural
Maybe Text
Text
notebookId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:notebookId:ListNotebookSessions' :: ListNotebookSessions -> Text
$sel:nextToken:ListNotebookSessions' :: ListNotebookSessions -> Maybe Text
$sel:maxResults:ListNotebookSessions' :: ListNotebookSessions -> 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 Text
notebookId
instance Data.ToHeaders ListNotebookSessions where
toHeaders :: ListNotebookSessions -> 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
"AmazonAthena.ListNotebookSessions" ::
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 ListNotebookSessions where
toJSON :: ListNotebookSessions -> Value
toJSON ListNotebookSessions' {Maybe Natural
Maybe Text
Text
notebookId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:notebookId:ListNotebookSessions' :: ListNotebookSessions -> Text
$sel:nextToken:ListNotebookSessions' :: ListNotebookSessions -> Maybe Text
$sel:maxResults:ListNotebookSessions' :: ListNotebookSessions -> 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
"NotebookId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
notebookId)
]
)
instance Data.ToPath ListNotebookSessions where
toPath :: ListNotebookSessions -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListNotebookSessions where
toQuery :: ListNotebookSessions -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListNotebookSessionsResponse = ListNotebookSessionsResponse'
{
ListNotebookSessionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListNotebookSessionsResponse -> Int
httpStatus :: Prelude.Int,
ListNotebookSessionsResponse -> [NotebookSessionSummary]
notebookSessionsList :: [NotebookSessionSummary]
}
deriving (ListNotebookSessionsResponse
-> ListNotebookSessionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListNotebookSessionsResponse
-> ListNotebookSessionsResponse -> Bool
$c/= :: ListNotebookSessionsResponse
-> ListNotebookSessionsResponse -> Bool
== :: ListNotebookSessionsResponse
-> ListNotebookSessionsResponse -> Bool
$c== :: ListNotebookSessionsResponse
-> ListNotebookSessionsResponse -> Bool
Prelude.Eq, ReadPrec [ListNotebookSessionsResponse]
ReadPrec ListNotebookSessionsResponse
Int -> ReadS ListNotebookSessionsResponse
ReadS [ListNotebookSessionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListNotebookSessionsResponse]
$creadListPrec :: ReadPrec [ListNotebookSessionsResponse]
readPrec :: ReadPrec ListNotebookSessionsResponse
$creadPrec :: ReadPrec ListNotebookSessionsResponse
readList :: ReadS [ListNotebookSessionsResponse]
$creadList :: ReadS [ListNotebookSessionsResponse]
readsPrec :: Int -> ReadS ListNotebookSessionsResponse
$creadsPrec :: Int -> ReadS ListNotebookSessionsResponse
Prelude.Read, Int -> ListNotebookSessionsResponse -> ShowS
[ListNotebookSessionsResponse] -> ShowS
ListNotebookSessionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListNotebookSessionsResponse] -> ShowS
$cshowList :: [ListNotebookSessionsResponse] -> ShowS
show :: ListNotebookSessionsResponse -> String
$cshow :: ListNotebookSessionsResponse -> String
showsPrec :: Int -> ListNotebookSessionsResponse -> ShowS
$cshowsPrec :: Int -> ListNotebookSessionsResponse -> ShowS
Prelude.Show, forall x.
Rep ListNotebookSessionsResponse x -> ListNotebookSessionsResponse
forall x.
ListNotebookSessionsResponse -> Rep ListNotebookSessionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListNotebookSessionsResponse x -> ListNotebookSessionsResponse
$cfrom :: forall x.
ListNotebookSessionsResponse -> Rep ListNotebookSessionsResponse x
Prelude.Generic)
newListNotebookSessionsResponse ::
Prelude.Int ->
ListNotebookSessionsResponse
newListNotebookSessionsResponse :: Int -> ListNotebookSessionsResponse
newListNotebookSessionsResponse Int
pHttpStatus_ =
ListNotebookSessionsResponse'
{ $sel:nextToken:ListNotebookSessionsResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListNotebookSessionsResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:notebookSessionsList:ListNotebookSessionsResponse' :: [NotebookSessionSummary]
notebookSessionsList = forall a. Monoid a => a
Prelude.mempty
}
listNotebookSessionsResponse_nextToken :: Lens.Lens' ListNotebookSessionsResponse (Prelude.Maybe Prelude.Text)
listNotebookSessionsResponse_nextToken :: Lens' ListNotebookSessionsResponse (Maybe Text)
listNotebookSessionsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListNotebookSessionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListNotebookSessionsResponse' :: ListNotebookSessionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListNotebookSessionsResponse
s@ListNotebookSessionsResponse' {} Maybe Text
a -> ListNotebookSessionsResponse
s {$sel:nextToken:ListNotebookSessionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListNotebookSessionsResponse)
listNotebookSessionsResponse_httpStatus :: Lens.Lens' ListNotebookSessionsResponse Prelude.Int
listNotebookSessionsResponse_httpStatus :: Lens' ListNotebookSessionsResponse Int
listNotebookSessionsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListNotebookSessionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListNotebookSessionsResponse' :: ListNotebookSessionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListNotebookSessionsResponse
s@ListNotebookSessionsResponse' {} Int
a -> ListNotebookSessionsResponse
s {$sel:httpStatus:ListNotebookSessionsResponse' :: Int
httpStatus = Int
a} :: ListNotebookSessionsResponse)
listNotebookSessionsResponse_notebookSessionsList :: Lens.Lens' ListNotebookSessionsResponse [NotebookSessionSummary]
listNotebookSessionsResponse_notebookSessionsList :: Lens' ListNotebookSessionsResponse [NotebookSessionSummary]
listNotebookSessionsResponse_notebookSessionsList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListNotebookSessionsResponse' {[NotebookSessionSummary]
notebookSessionsList :: [NotebookSessionSummary]
$sel:notebookSessionsList:ListNotebookSessionsResponse' :: ListNotebookSessionsResponse -> [NotebookSessionSummary]
notebookSessionsList} -> [NotebookSessionSummary]
notebookSessionsList) (\s :: ListNotebookSessionsResponse
s@ListNotebookSessionsResponse' {} [NotebookSessionSummary]
a -> ListNotebookSessionsResponse
s {$sel:notebookSessionsList:ListNotebookSessionsResponse' :: [NotebookSessionSummary]
notebookSessionsList = [NotebookSessionSummary]
a} :: ListNotebookSessionsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.NFData ListNotebookSessionsResponse where
rnf :: ListNotebookSessionsResponse -> ()
rnf ListNotebookSessionsResponse' {Int
[NotebookSessionSummary]
Maybe Text
notebookSessionsList :: [NotebookSessionSummary]
httpStatus :: Int
nextToken :: Maybe Text
$sel:notebookSessionsList:ListNotebookSessionsResponse' :: ListNotebookSessionsResponse -> [NotebookSessionSummary]
$sel:httpStatus:ListNotebookSessionsResponse' :: ListNotebookSessionsResponse -> Int
$sel:nextToken:ListNotebookSessionsResponse' :: ListNotebookSessionsResponse -> 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 Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [NotebookSessionSummary]
notebookSessionsList