{-# 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.DeviceFarm.ListTestGridSessionActions
(
ListTestGridSessionActions (..),
newListTestGridSessionActions,
listTestGridSessionActions_maxResult,
listTestGridSessionActions_nextToken,
listTestGridSessionActions_sessionArn,
ListTestGridSessionActionsResponse (..),
newListTestGridSessionActionsResponse,
listTestGridSessionActionsResponse_actions,
listTestGridSessionActionsResponse_nextToken,
listTestGridSessionActionsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DeviceFarm.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListTestGridSessionActions = ListTestGridSessionActions'
{
ListTestGridSessionActions -> Maybe Natural
maxResult :: Prelude.Maybe Prelude.Natural,
ListTestGridSessionActions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListTestGridSessionActions -> Text
sessionArn :: Prelude.Text
}
deriving (ListTestGridSessionActions -> ListTestGridSessionActions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTestGridSessionActions -> ListTestGridSessionActions -> Bool
$c/= :: ListTestGridSessionActions -> ListTestGridSessionActions -> Bool
== :: ListTestGridSessionActions -> ListTestGridSessionActions -> Bool
$c== :: ListTestGridSessionActions -> ListTestGridSessionActions -> Bool
Prelude.Eq, ReadPrec [ListTestGridSessionActions]
ReadPrec ListTestGridSessionActions
Int -> ReadS ListTestGridSessionActions
ReadS [ListTestGridSessionActions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTestGridSessionActions]
$creadListPrec :: ReadPrec [ListTestGridSessionActions]
readPrec :: ReadPrec ListTestGridSessionActions
$creadPrec :: ReadPrec ListTestGridSessionActions
readList :: ReadS [ListTestGridSessionActions]
$creadList :: ReadS [ListTestGridSessionActions]
readsPrec :: Int -> ReadS ListTestGridSessionActions
$creadsPrec :: Int -> ReadS ListTestGridSessionActions
Prelude.Read, Int -> ListTestGridSessionActions -> ShowS
[ListTestGridSessionActions] -> ShowS
ListTestGridSessionActions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTestGridSessionActions] -> ShowS
$cshowList :: [ListTestGridSessionActions] -> ShowS
show :: ListTestGridSessionActions -> String
$cshow :: ListTestGridSessionActions -> String
showsPrec :: Int -> ListTestGridSessionActions -> ShowS
$cshowsPrec :: Int -> ListTestGridSessionActions -> ShowS
Prelude.Show, forall x.
Rep ListTestGridSessionActions x -> ListTestGridSessionActions
forall x.
ListTestGridSessionActions -> Rep ListTestGridSessionActions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListTestGridSessionActions x -> ListTestGridSessionActions
$cfrom :: forall x.
ListTestGridSessionActions -> Rep ListTestGridSessionActions x
Prelude.Generic)
newListTestGridSessionActions ::
Prelude.Text ->
ListTestGridSessionActions
newListTestGridSessionActions :: Text -> ListTestGridSessionActions
newListTestGridSessionActions Text
pSessionArn_ =
ListTestGridSessionActions'
{ $sel:maxResult:ListTestGridSessionActions' :: Maybe Natural
maxResult =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListTestGridSessionActions' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:sessionArn:ListTestGridSessionActions' :: Text
sessionArn = Text
pSessionArn_
}
listTestGridSessionActions_maxResult :: Lens.Lens' ListTestGridSessionActions (Prelude.Maybe Prelude.Natural)
listTestGridSessionActions_maxResult :: Lens' ListTestGridSessionActions (Maybe Natural)
listTestGridSessionActions_maxResult = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTestGridSessionActions' {Maybe Natural
maxResult :: Maybe Natural
$sel:maxResult:ListTestGridSessionActions' :: ListTestGridSessionActions -> Maybe Natural
maxResult} -> Maybe Natural
maxResult) (\s :: ListTestGridSessionActions
s@ListTestGridSessionActions' {} Maybe Natural
a -> ListTestGridSessionActions
s {$sel:maxResult:ListTestGridSessionActions' :: Maybe Natural
maxResult = Maybe Natural
a} :: ListTestGridSessionActions)
listTestGridSessionActions_nextToken :: Lens.Lens' ListTestGridSessionActions (Prelude.Maybe Prelude.Text)
listTestGridSessionActions_nextToken :: Lens' ListTestGridSessionActions (Maybe Text)
listTestGridSessionActions_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTestGridSessionActions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTestGridSessionActions' :: ListTestGridSessionActions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTestGridSessionActions
s@ListTestGridSessionActions' {} Maybe Text
a -> ListTestGridSessionActions
s {$sel:nextToken:ListTestGridSessionActions' :: Maybe Text
nextToken = Maybe Text
a} :: ListTestGridSessionActions)
listTestGridSessionActions_sessionArn :: Lens.Lens' ListTestGridSessionActions Prelude.Text
listTestGridSessionActions_sessionArn :: Lens' ListTestGridSessionActions Text
listTestGridSessionActions_sessionArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTestGridSessionActions' {Text
sessionArn :: Text
$sel:sessionArn:ListTestGridSessionActions' :: ListTestGridSessionActions -> Text
sessionArn} -> Text
sessionArn) (\s :: ListTestGridSessionActions
s@ListTestGridSessionActions' {} Text
a -> ListTestGridSessionActions
s {$sel:sessionArn:ListTestGridSessionActions' :: Text
sessionArn = Text
a} :: ListTestGridSessionActions)
instance Core.AWSRequest ListTestGridSessionActions where
type
AWSResponse ListTestGridSessionActions =
ListTestGridSessionActionsResponse
request :: (Service -> Service)
-> ListTestGridSessionActions -> Request ListTestGridSessionActions
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 ListTestGridSessionActions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListTestGridSessionActions)))
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 [TestGridSessionAction]
-> Maybe Text -> Int -> ListTestGridSessionActionsResponse
ListTestGridSessionActionsResponse'
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
"actions" 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 ListTestGridSessionActions where
hashWithSalt :: Int -> ListTestGridSessionActions -> Int
hashWithSalt Int
_salt ListTestGridSessionActions' {Maybe Natural
Maybe Text
Text
sessionArn :: Text
nextToken :: Maybe Text
maxResult :: Maybe Natural
$sel:sessionArn:ListTestGridSessionActions' :: ListTestGridSessionActions -> Text
$sel:nextToken:ListTestGridSessionActions' :: ListTestGridSessionActions -> Maybe Text
$sel:maxResult:ListTestGridSessionActions' :: ListTestGridSessionActions -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResult
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
sessionArn
instance Prelude.NFData ListTestGridSessionActions where
rnf :: ListTestGridSessionActions -> ()
rnf ListTestGridSessionActions' {Maybe Natural
Maybe Text
Text
sessionArn :: Text
nextToken :: Maybe Text
maxResult :: Maybe Natural
$sel:sessionArn:ListTestGridSessionActions' :: ListTestGridSessionActions -> Text
$sel:nextToken:ListTestGridSessionActions' :: ListTestGridSessionActions -> Maybe Text
$sel:maxResult:ListTestGridSessionActions' :: ListTestGridSessionActions -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResult
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
sessionArn
instance Data.ToHeaders ListTestGridSessionActions where
toHeaders :: ListTestGridSessionActions -> 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
"DeviceFarm_20150623.ListTestGridSessionActions" ::
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 ListTestGridSessionActions where
toJSON :: ListTestGridSessionActions -> Value
toJSON ListTestGridSessionActions' {Maybe Natural
Maybe Text
Text
sessionArn :: Text
nextToken :: Maybe Text
maxResult :: Maybe Natural
$sel:sessionArn:ListTestGridSessionActions' :: ListTestGridSessionActions -> Text
$sel:nextToken:ListTestGridSessionActions' :: ListTestGridSessionActions -> Maybe Text
$sel:maxResult:ListTestGridSessionActions' :: ListTestGridSessionActions -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"maxResult" 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
maxResult,
(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
"sessionArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
sessionArn)
]
)
instance Data.ToPath ListTestGridSessionActions where
toPath :: ListTestGridSessionActions -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListTestGridSessionActions where
toQuery :: ListTestGridSessionActions -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListTestGridSessionActionsResponse = ListTestGridSessionActionsResponse'
{
ListTestGridSessionActionsResponse -> Maybe [TestGridSessionAction]
actions :: Prelude.Maybe [TestGridSessionAction],
ListTestGridSessionActionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListTestGridSessionActionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListTestGridSessionActionsResponse
-> ListTestGridSessionActionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTestGridSessionActionsResponse
-> ListTestGridSessionActionsResponse -> Bool
$c/= :: ListTestGridSessionActionsResponse
-> ListTestGridSessionActionsResponse -> Bool
== :: ListTestGridSessionActionsResponse
-> ListTestGridSessionActionsResponse -> Bool
$c== :: ListTestGridSessionActionsResponse
-> ListTestGridSessionActionsResponse -> Bool
Prelude.Eq, ReadPrec [ListTestGridSessionActionsResponse]
ReadPrec ListTestGridSessionActionsResponse
Int -> ReadS ListTestGridSessionActionsResponse
ReadS [ListTestGridSessionActionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTestGridSessionActionsResponse]
$creadListPrec :: ReadPrec [ListTestGridSessionActionsResponse]
readPrec :: ReadPrec ListTestGridSessionActionsResponse
$creadPrec :: ReadPrec ListTestGridSessionActionsResponse
readList :: ReadS [ListTestGridSessionActionsResponse]
$creadList :: ReadS [ListTestGridSessionActionsResponse]
readsPrec :: Int -> ReadS ListTestGridSessionActionsResponse
$creadsPrec :: Int -> ReadS ListTestGridSessionActionsResponse
Prelude.Read, Int -> ListTestGridSessionActionsResponse -> ShowS
[ListTestGridSessionActionsResponse] -> ShowS
ListTestGridSessionActionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTestGridSessionActionsResponse] -> ShowS
$cshowList :: [ListTestGridSessionActionsResponse] -> ShowS
show :: ListTestGridSessionActionsResponse -> String
$cshow :: ListTestGridSessionActionsResponse -> String
showsPrec :: Int -> ListTestGridSessionActionsResponse -> ShowS
$cshowsPrec :: Int -> ListTestGridSessionActionsResponse -> ShowS
Prelude.Show, forall x.
Rep ListTestGridSessionActionsResponse x
-> ListTestGridSessionActionsResponse
forall x.
ListTestGridSessionActionsResponse
-> Rep ListTestGridSessionActionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListTestGridSessionActionsResponse x
-> ListTestGridSessionActionsResponse
$cfrom :: forall x.
ListTestGridSessionActionsResponse
-> Rep ListTestGridSessionActionsResponse x
Prelude.Generic)
newListTestGridSessionActionsResponse ::
Prelude.Int ->
ListTestGridSessionActionsResponse
newListTestGridSessionActionsResponse :: Int -> ListTestGridSessionActionsResponse
newListTestGridSessionActionsResponse Int
pHttpStatus_ =
ListTestGridSessionActionsResponse'
{ $sel:actions:ListTestGridSessionActionsResponse' :: Maybe [TestGridSessionAction]
actions =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListTestGridSessionActionsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListTestGridSessionActionsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listTestGridSessionActionsResponse_actions :: Lens.Lens' ListTestGridSessionActionsResponse (Prelude.Maybe [TestGridSessionAction])
listTestGridSessionActionsResponse_actions :: Lens'
ListTestGridSessionActionsResponse (Maybe [TestGridSessionAction])
listTestGridSessionActionsResponse_actions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTestGridSessionActionsResponse' {Maybe [TestGridSessionAction]
actions :: Maybe [TestGridSessionAction]
$sel:actions:ListTestGridSessionActionsResponse' :: ListTestGridSessionActionsResponse -> Maybe [TestGridSessionAction]
actions} -> Maybe [TestGridSessionAction]
actions) (\s :: ListTestGridSessionActionsResponse
s@ListTestGridSessionActionsResponse' {} Maybe [TestGridSessionAction]
a -> ListTestGridSessionActionsResponse
s {$sel:actions:ListTestGridSessionActionsResponse' :: Maybe [TestGridSessionAction]
actions = Maybe [TestGridSessionAction]
a} :: ListTestGridSessionActionsResponse) 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
listTestGridSessionActionsResponse_nextToken :: Lens.Lens' ListTestGridSessionActionsResponse (Prelude.Maybe Prelude.Text)
listTestGridSessionActionsResponse_nextToken :: Lens' ListTestGridSessionActionsResponse (Maybe Text)
listTestGridSessionActionsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTestGridSessionActionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListTestGridSessionActionsResponse' :: ListTestGridSessionActionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListTestGridSessionActionsResponse
s@ListTestGridSessionActionsResponse' {} Maybe Text
a -> ListTestGridSessionActionsResponse
s {$sel:nextToken:ListTestGridSessionActionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListTestGridSessionActionsResponse)
listTestGridSessionActionsResponse_httpStatus :: Lens.Lens' ListTestGridSessionActionsResponse Prelude.Int
listTestGridSessionActionsResponse_httpStatus :: Lens' ListTestGridSessionActionsResponse Int
listTestGridSessionActionsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTestGridSessionActionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListTestGridSessionActionsResponse' :: ListTestGridSessionActionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListTestGridSessionActionsResponse
s@ListTestGridSessionActionsResponse' {} Int
a -> ListTestGridSessionActionsResponse
s {$sel:httpStatus:ListTestGridSessionActionsResponse' :: Int
httpStatus = Int
a} :: ListTestGridSessionActionsResponse)
instance
Prelude.NFData
ListTestGridSessionActionsResponse
where
rnf :: ListTestGridSessionActionsResponse -> ()
rnf ListTestGridSessionActionsResponse' {Int
Maybe [TestGridSessionAction]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
actions :: Maybe [TestGridSessionAction]
$sel:httpStatus:ListTestGridSessionActionsResponse' :: ListTestGridSessionActionsResponse -> Int
$sel:nextToken:ListTestGridSessionActionsResponse' :: ListTestGridSessionActionsResponse -> Maybe Text
$sel:actions:ListTestGridSessionActionsResponse' :: ListTestGridSessionActionsResponse -> Maybe [TestGridSessionAction]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [TestGridSessionAction]
actions
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