{-# 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.ListRemoteAccessSessions
(
ListRemoteAccessSessions (..),
newListRemoteAccessSessions,
listRemoteAccessSessions_nextToken,
listRemoteAccessSessions_arn,
ListRemoteAccessSessionsResponse (..),
newListRemoteAccessSessionsResponse,
listRemoteAccessSessionsResponse_nextToken,
listRemoteAccessSessionsResponse_remoteAccessSessions,
listRemoteAccessSessionsResponse_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 ListRemoteAccessSessions = ListRemoteAccessSessions'
{
ListRemoteAccessSessions -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListRemoteAccessSessions -> Text
arn :: Prelude.Text
}
deriving (ListRemoteAccessSessions -> ListRemoteAccessSessions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRemoteAccessSessions -> ListRemoteAccessSessions -> Bool
$c/= :: ListRemoteAccessSessions -> ListRemoteAccessSessions -> Bool
== :: ListRemoteAccessSessions -> ListRemoteAccessSessions -> Bool
$c== :: ListRemoteAccessSessions -> ListRemoteAccessSessions -> Bool
Prelude.Eq, ReadPrec [ListRemoteAccessSessions]
ReadPrec ListRemoteAccessSessions
Int -> ReadS ListRemoteAccessSessions
ReadS [ListRemoteAccessSessions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRemoteAccessSessions]
$creadListPrec :: ReadPrec [ListRemoteAccessSessions]
readPrec :: ReadPrec ListRemoteAccessSessions
$creadPrec :: ReadPrec ListRemoteAccessSessions
readList :: ReadS [ListRemoteAccessSessions]
$creadList :: ReadS [ListRemoteAccessSessions]
readsPrec :: Int -> ReadS ListRemoteAccessSessions
$creadsPrec :: Int -> ReadS ListRemoteAccessSessions
Prelude.Read, Int -> ListRemoteAccessSessions -> ShowS
[ListRemoteAccessSessions] -> ShowS
ListRemoteAccessSessions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRemoteAccessSessions] -> ShowS
$cshowList :: [ListRemoteAccessSessions] -> ShowS
show :: ListRemoteAccessSessions -> String
$cshow :: ListRemoteAccessSessions -> String
showsPrec :: Int -> ListRemoteAccessSessions -> ShowS
$cshowsPrec :: Int -> ListRemoteAccessSessions -> ShowS
Prelude.Show, forall x.
Rep ListRemoteAccessSessions x -> ListRemoteAccessSessions
forall x.
ListRemoteAccessSessions -> Rep ListRemoteAccessSessions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListRemoteAccessSessions x -> ListRemoteAccessSessions
$cfrom :: forall x.
ListRemoteAccessSessions -> Rep ListRemoteAccessSessions x
Prelude.Generic)
newListRemoteAccessSessions ::
Prelude.Text ->
ListRemoteAccessSessions
newListRemoteAccessSessions :: Text -> ListRemoteAccessSessions
newListRemoteAccessSessions Text
pArn_ =
ListRemoteAccessSessions'
{ $sel:nextToken:ListRemoteAccessSessions' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:arn:ListRemoteAccessSessions' :: Text
arn = Text
pArn_
}
listRemoteAccessSessions_nextToken :: Lens.Lens' ListRemoteAccessSessions (Prelude.Maybe Prelude.Text)
listRemoteAccessSessions_nextToken :: Lens' ListRemoteAccessSessions (Maybe Text)
listRemoteAccessSessions_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRemoteAccessSessions' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRemoteAccessSessions' :: ListRemoteAccessSessions -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRemoteAccessSessions
s@ListRemoteAccessSessions' {} Maybe Text
a -> ListRemoteAccessSessions
s {$sel:nextToken:ListRemoteAccessSessions' :: Maybe Text
nextToken = Maybe Text
a} :: ListRemoteAccessSessions)
listRemoteAccessSessions_arn :: Lens.Lens' ListRemoteAccessSessions Prelude.Text
listRemoteAccessSessions_arn :: Lens' ListRemoteAccessSessions Text
listRemoteAccessSessions_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRemoteAccessSessions' {Text
arn :: Text
$sel:arn:ListRemoteAccessSessions' :: ListRemoteAccessSessions -> Text
arn} -> Text
arn) (\s :: ListRemoteAccessSessions
s@ListRemoteAccessSessions' {} Text
a -> ListRemoteAccessSessions
s {$sel:arn:ListRemoteAccessSessions' :: Text
arn = Text
a} :: ListRemoteAccessSessions)
instance Core.AWSPager ListRemoteAccessSessions where
page :: ListRemoteAccessSessions
-> AWSResponse ListRemoteAccessSessions
-> Maybe ListRemoteAccessSessions
page ListRemoteAccessSessions
rq AWSResponse ListRemoteAccessSessions
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListRemoteAccessSessions
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListRemoteAccessSessionsResponse (Maybe Text)
listRemoteAccessSessionsResponse_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 ListRemoteAccessSessions
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
ListRemoteAccessSessionsResponse (Maybe [RemoteAccessSession])
listRemoteAccessSessionsResponse_remoteAccessSessions
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.$ ListRemoteAccessSessions
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListRemoteAccessSessions (Maybe Text)
listRemoteAccessSessions_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListRemoteAccessSessions
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListRemoteAccessSessionsResponse (Maybe Text)
listRemoteAccessSessionsResponse_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 ListRemoteAccessSessions where
type
AWSResponse ListRemoteAccessSessions =
ListRemoteAccessSessionsResponse
request :: (Service -> Service)
-> ListRemoteAccessSessions -> Request ListRemoteAccessSessions
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 ListRemoteAccessSessions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListRemoteAccessSessions)))
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 [RemoteAccessSession]
-> Int
-> ListRemoteAccessSessionsResponse
ListRemoteAccessSessionsResponse'
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
"remoteAccessSessions"
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 ListRemoteAccessSessions where
hashWithSalt :: Int -> ListRemoteAccessSessions -> Int
hashWithSalt Int
_salt ListRemoteAccessSessions' {Maybe Text
Text
arn :: Text
nextToken :: Maybe Text
$sel:arn:ListRemoteAccessSessions' :: ListRemoteAccessSessions -> Text
$sel:nextToken:ListRemoteAccessSessions' :: ListRemoteAccessSessions -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn
instance Prelude.NFData ListRemoteAccessSessions where
rnf :: ListRemoteAccessSessions -> ()
rnf ListRemoteAccessSessions' {Maybe Text
Text
arn :: Text
nextToken :: Maybe Text
$sel:arn:ListRemoteAccessSessions' :: ListRemoteAccessSessions -> Text
$sel:nextToken:ListRemoteAccessSessions' :: ListRemoteAccessSessions -> 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 Text
arn
instance Data.ToHeaders ListRemoteAccessSessions where
toHeaders :: ListRemoteAccessSessions -> 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.ListRemoteAccessSessions" ::
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 ListRemoteAccessSessions where
toJSON :: ListRemoteAccessSessions -> Value
toJSON ListRemoteAccessSessions' {Maybe Text
Text
arn :: Text
nextToken :: Maybe Text
$sel:arn:ListRemoteAccessSessions' :: ListRemoteAccessSessions -> Text
$sel:nextToken:ListRemoteAccessSessions' :: ListRemoteAccessSessions -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (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
"arn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
arn)
]
)
instance Data.ToPath ListRemoteAccessSessions where
toPath :: ListRemoteAccessSessions -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListRemoteAccessSessions where
toQuery :: ListRemoteAccessSessions -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListRemoteAccessSessionsResponse = ListRemoteAccessSessionsResponse'
{
ListRemoteAccessSessionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListRemoteAccessSessionsResponse -> Maybe [RemoteAccessSession]
remoteAccessSessions :: Prelude.Maybe [RemoteAccessSession],
ListRemoteAccessSessionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListRemoteAccessSessionsResponse
-> ListRemoteAccessSessionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListRemoteAccessSessionsResponse
-> ListRemoteAccessSessionsResponse -> Bool
$c/= :: ListRemoteAccessSessionsResponse
-> ListRemoteAccessSessionsResponse -> Bool
== :: ListRemoteAccessSessionsResponse
-> ListRemoteAccessSessionsResponse -> Bool
$c== :: ListRemoteAccessSessionsResponse
-> ListRemoteAccessSessionsResponse -> Bool
Prelude.Eq, ReadPrec [ListRemoteAccessSessionsResponse]
ReadPrec ListRemoteAccessSessionsResponse
Int -> ReadS ListRemoteAccessSessionsResponse
ReadS [ListRemoteAccessSessionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListRemoteAccessSessionsResponse]
$creadListPrec :: ReadPrec [ListRemoteAccessSessionsResponse]
readPrec :: ReadPrec ListRemoteAccessSessionsResponse
$creadPrec :: ReadPrec ListRemoteAccessSessionsResponse
readList :: ReadS [ListRemoteAccessSessionsResponse]
$creadList :: ReadS [ListRemoteAccessSessionsResponse]
readsPrec :: Int -> ReadS ListRemoteAccessSessionsResponse
$creadsPrec :: Int -> ReadS ListRemoteAccessSessionsResponse
Prelude.Read, Int -> ListRemoteAccessSessionsResponse -> ShowS
[ListRemoteAccessSessionsResponse] -> ShowS
ListRemoteAccessSessionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListRemoteAccessSessionsResponse] -> ShowS
$cshowList :: [ListRemoteAccessSessionsResponse] -> ShowS
show :: ListRemoteAccessSessionsResponse -> String
$cshow :: ListRemoteAccessSessionsResponse -> String
showsPrec :: Int -> ListRemoteAccessSessionsResponse -> ShowS
$cshowsPrec :: Int -> ListRemoteAccessSessionsResponse -> ShowS
Prelude.Show, forall x.
Rep ListRemoteAccessSessionsResponse x
-> ListRemoteAccessSessionsResponse
forall x.
ListRemoteAccessSessionsResponse
-> Rep ListRemoteAccessSessionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListRemoteAccessSessionsResponse x
-> ListRemoteAccessSessionsResponse
$cfrom :: forall x.
ListRemoteAccessSessionsResponse
-> Rep ListRemoteAccessSessionsResponse x
Prelude.Generic)
newListRemoteAccessSessionsResponse ::
Prelude.Int ->
ListRemoteAccessSessionsResponse
newListRemoteAccessSessionsResponse :: Int -> ListRemoteAccessSessionsResponse
newListRemoteAccessSessionsResponse Int
pHttpStatus_ =
ListRemoteAccessSessionsResponse'
{ $sel:nextToken:ListRemoteAccessSessionsResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:remoteAccessSessions:ListRemoteAccessSessionsResponse' :: Maybe [RemoteAccessSession]
remoteAccessSessions = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListRemoteAccessSessionsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listRemoteAccessSessionsResponse_nextToken :: Lens.Lens' ListRemoteAccessSessionsResponse (Prelude.Maybe Prelude.Text)
listRemoteAccessSessionsResponse_nextToken :: Lens' ListRemoteAccessSessionsResponse (Maybe Text)
listRemoteAccessSessionsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRemoteAccessSessionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListRemoteAccessSessionsResponse' :: ListRemoteAccessSessionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListRemoteAccessSessionsResponse
s@ListRemoteAccessSessionsResponse' {} Maybe Text
a -> ListRemoteAccessSessionsResponse
s {$sel:nextToken:ListRemoteAccessSessionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListRemoteAccessSessionsResponse)
listRemoteAccessSessionsResponse_remoteAccessSessions :: Lens.Lens' ListRemoteAccessSessionsResponse (Prelude.Maybe [RemoteAccessSession])
listRemoteAccessSessionsResponse_remoteAccessSessions :: Lens'
ListRemoteAccessSessionsResponse (Maybe [RemoteAccessSession])
listRemoteAccessSessionsResponse_remoteAccessSessions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRemoteAccessSessionsResponse' {Maybe [RemoteAccessSession]
remoteAccessSessions :: Maybe [RemoteAccessSession]
$sel:remoteAccessSessions:ListRemoteAccessSessionsResponse' :: ListRemoteAccessSessionsResponse -> Maybe [RemoteAccessSession]
remoteAccessSessions} -> Maybe [RemoteAccessSession]
remoteAccessSessions) (\s :: ListRemoteAccessSessionsResponse
s@ListRemoteAccessSessionsResponse' {} Maybe [RemoteAccessSession]
a -> ListRemoteAccessSessionsResponse
s {$sel:remoteAccessSessions:ListRemoteAccessSessionsResponse' :: Maybe [RemoteAccessSession]
remoteAccessSessions = Maybe [RemoteAccessSession]
a} :: ListRemoteAccessSessionsResponse) 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
listRemoteAccessSessionsResponse_httpStatus :: Lens.Lens' ListRemoteAccessSessionsResponse Prelude.Int
listRemoteAccessSessionsResponse_httpStatus :: Lens' ListRemoteAccessSessionsResponse Int
listRemoteAccessSessionsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListRemoteAccessSessionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListRemoteAccessSessionsResponse' :: ListRemoteAccessSessionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListRemoteAccessSessionsResponse
s@ListRemoteAccessSessionsResponse' {} Int
a -> ListRemoteAccessSessionsResponse
s {$sel:httpStatus:ListRemoteAccessSessionsResponse' :: Int
httpStatus = Int
a} :: ListRemoteAccessSessionsResponse)
instance
Prelude.NFData
ListRemoteAccessSessionsResponse
where
rnf :: ListRemoteAccessSessionsResponse -> ()
rnf ListRemoteAccessSessionsResponse' {Int
Maybe [RemoteAccessSession]
Maybe Text
httpStatus :: Int
remoteAccessSessions :: Maybe [RemoteAccessSession]
nextToken :: Maybe Text
$sel:httpStatus:ListRemoteAccessSessionsResponse' :: ListRemoteAccessSessionsResponse -> Int
$sel:remoteAccessSessions:ListRemoteAccessSessionsResponse' :: ListRemoteAccessSessionsResponse -> Maybe [RemoteAccessSession]
$sel:nextToken:ListRemoteAccessSessionsResponse' :: ListRemoteAccessSessionsResponse -> 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 [RemoteAccessSession]
remoteAccessSessions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus