{-# 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.StopRemoteAccessSession
(
StopRemoteAccessSession (..),
newStopRemoteAccessSession,
stopRemoteAccessSession_arn,
StopRemoteAccessSessionResponse (..),
newStopRemoteAccessSessionResponse,
stopRemoteAccessSessionResponse_remoteAccessSession,
stopRemoteAccessSessionResponse_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 StopRemoteAccessSession = StopRemoteAccessSession'
{
StopRemoteAccessSession -> Text
arn :: Prelude.Text
}
deriving (StopRemoteAccessSession -> StopRemoteAccessSession -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopRemoteAccessSession -> StopRemoteAccessSession -> Bool
$c/= :: StopRemoteAccessSession -> StopRemoteAccessSession -> Bool
== :: StopRemoteAccessSession -> StopRemoteAccessSession -> Bool
$c== :: StopRemoteAccessSession -> StopRemoteAccessSession -> Bool
Prelude.Eq, ReadPrec [StopRemoteAccessSession]
ReadPrec StopRemoteAccessSession
Int -> ReadS StopRemoteAccessSession
ReadS [StopRemoteAccessSession]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopRemoteAccessSession]
$creadListPrec :: ReadPrec [StopRemoteAccessSession]
readPrec :: ReadPrec StopRemoteAccessSession
$creadPrec :: ReadPrec StopRemoteAccessSession
readList :: ReadS [StopRemoteAccessSession]
$creadList :: ReadS [StopRemoteAccessSession]
readsPrec :: Int -> ReadS StopRemoteAccessSession
$creadsPrec :: Int -> ReadS StopRemoteAccessSession
Prelude.Read, Int -> StopRemoteAccessSession -> ShowS
[StopRemoteAccessSession] -> ShowS
StopRemoteAccessSession -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopRemoteAccessSession] -> ShowS
$cshowList :: [StopRemoteAccessSession] -> ShowS
show :: StopRemoteAccessSession -> String
$cshow :: StopRemoteAccessSession -> String
showsPrec :: Int -> StopRemoteAccessSession -> ShowS
$cshowsPrec :: Int -> StopRemoteAccessSession -> ShowS
Prelude.Show, forall x. Rep StopRemoteAccessSession x -> StopRemoteAccessSession
forall x. StopRemoteAccessSession -> Rep StopRemoteAccessSession x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopRemoteAccessSession x -> StopRemoteAccessSession
$cfrom :: forall x. StopRemoteAccessSession -> Rep StopRemoteAccessSession x
Prelude.Generic)
newStopRemoteAccessSession ::
Prelude.Text ->
StopRemoteAccessSession
newStopRemoteAccessSession :: Text -> StopRemoteAccessSession
newStopRemoteAccessSession Text
pArn_ =
StopRemoteAccessSession' {$sel:arn:StopRemoteAccessSession' :: Text
arn = Text
pArn_}
stopRemoteAccessSession_arn :: Lens.Lens' StopRemoteAccessSession Prelude.Text
stopRemoteAccessSession_arn :: Lens' StopRemoteAccessSession Text
stopRemoteAccessSession_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopRemoteAccessSession' {Text
arn :: Text
$sel:arn:StopRemoteAccessSession' :: StopRemoteAccessSession -> Text
arn} -> Text
arn) (\s :: StopRemoteAccessSession
s@StopRemoteAccessSession' {} Text
a -> StopRemoteAccessSession
s {$sel:arn:StopRemoteAccessSession' :: Text
arn = Text
a} :: StopRemoteAccessSession)
instance Core.AWSRequest StopRemoteAccessSession where
type
AWSResponse StopRemoteAccessSession =
StopRemoteAccessSessionResponse
request :: (Service -> Service)
-> StopRemoteAccessSession -> Request StopRemoteAccessSession
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 StopRemoteAccessSession
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StopRemoteAccessSession)))
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 RemoteAccessSession -> Int -> StopRemoteAccessSessionResponse
StopRemoteAccessSessionResponse'
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
"remoteAccessSession")
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 StopRemoteAccessSession where
hashWithSalt :: Int -> StopRemoteAccessSession -> Int
hashWithSalt Int
_salt StopRemoteAccessSession' {Text
arn :: Text
$sel:arn:StopRemoteAccessSession' :: StopRemoteAccessSession -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
arn
instance Prelude.NFData StopRemoteAccessSession where
rnf :: StopRemoteAccessSession -> ()
rnf StopRemoteAccessSession' {Text
arn :: Text
$sel:arn:StopRemoteAccessSession' :: StopRemoteAccessSession -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
arn
instance Data.ToHeaders StopRemoteAccessSession where
toHeaders :: StopRemoteAccessSession -> 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.StopRemoteAccessSession" ::
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 StopRemoteAccessSession where
toJSON :: StopRemoteAccessSession -> Value
toJSON StopRemoteAccessSession' {Text
arn :: Text
$sel:arn:StopRemoteAccessSession' :: StopRemoteAccessSession -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[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 StopRemoteAccessSession where
toPath :: StopRemoteAccessSession -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery StopRemoteAccessSession where
toQuery :: StopRemoteAccessSession -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data StopRemoteAccessSessionResponse = StopRemoteAccessSessionResponse'
{
StopRemoteAccessSessionResponse -> Maybe RemoteAccessSession
remoteAccessSession :: Prelude.Maybe RemoteAccessSession,
StopRemoteAccessSessionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopRemoteAccessSessionResponse
-> StopRemoteAccessSessionResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopRemoteAccessSessionResponse
-> StopRemoteAccessSessionResponse -> Bool
$c/= :: StopRemoteAccessSessionResponse
-> StopRemoteAccessSessionResponse -> Bool
== :: StopRemoteAccessSessionResponse
-> StopRemoteAccessSessionResponse -> Bool
$c== :: StopRemoteAccessSessionResponse
-> StopRemoteAccessSessionResponse -> Bool
Prelude.Eq, ReadPrec [StopRemoteAccessSessionResponse]
ReadPrec StopRemoteAccessSessionResponse
Int -> ReadS StopRemoteAccessSessionResponse
ReadS [StopRemoteAccessSessionResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopRemoteAccessSessionResponse]
$creadListPrec :: ReadPrec [StopRemoteAccessSessionResponse]
readPrec :: ReadPrec StopRemoteAccessSessionResponse
$creadPrec :: ReadPrec StopRemoteAccessSessionResponse
readList :: ReadS [StopRemoteAccessSessionResponse]
$creadList :: ReadS [StopRemoteAccessSessionResponse]
readsPrec :: Int -> ReadS StopRemoteAccessSessionResponse
$creadsPrec :: Int -> ReadS StopRemoteAccessSessionResponse
Prelude.Read, Int -> StopRemoteAccessSessionResponse -> ShowS
[StopRemoteAccessSessionResponse] -> ShowS
StopRemoteAccessSessionResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopRemoteAccessSessionResponse] -> ShowS
$cshowList :: [StopRemoteAccessSessionResponse] -> ShowS
show :: StopRemoteAccessSessionResponse -> String
$cshow :: StopRemoteAccessSessionResponse -> String
showsPrec :: Int -> StopRemoteAccessSessionResponse -> ShowS
$cshowsPrec :: Int -> StopRemoteAccessSessionResponse -> ShowS
Prelude.Show, forall x.
Rep StopRemoteAccessSessionResponse x
-> StopRemoteAccessSessionResponse
forall x.
StopRemoteAccessSessionResponse
-> Rep StopRemoteAccessSessionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StopRemoteAccessSessionResponse x
-> StopRemoteAccessSessionResponse
$cfrom :: forall x.
StopRemoteAccessSessionResponse
-> Rep StopRemoteAccessSessionResponse x
Prelude.Generic)
newStopRemoteAccessSessionResponse ::
Prelude.Int ->
StopRemoteAccessSessionResponse
newStopRemoteAccessSessionResponse :: Int -> StopRemoteAccessSessionResponse
newStopRemoteAccessSessionResponse Int
pHttpStatus_ =
StopRemoteAccessSessionResponse'
{ $sel:remoteAccessSession:StopRemoteAccessSessionResponse' :: Maybe RemoteAccessSession
remoteAccessSession =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StopRemoteAccessSessionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
stopRemoteAccessSessionResponse_remoteAccessSession :: Lens.Lens' StopRemoteAccessSessionResponse (Prelude.Maybe RemoteAccessSession)
stopRemoteAccessSessionResponse_remoteAccessSession :: Lens' StopRemoteAccessSessionResponse (Maybe RemoteAccessSession)
stopRemoteAccessSessionResponse_remoteAccessSession = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopRemoteAccessSessionResponse' {Maybe RemoteAccessSession
remoteAccessSession :: Maybe RemoteAccessSession
$sel:remoteAccessSession:StopRemoteAccessSessionResponse' :: StopRemoteAccessSessionResponse -> Maybe RemoteAccessSession
remoteAccessSession} -> Maybe RemoteAccessSession
remoteAccessSession) (\s :: StopRemoteAccessSessionResponse
s@StopRemoteAccessSessionResponse' {} Maybe RemoteAccessSession
a -> StopRemoteAccessSessionResponse
s {$sel:remoteAccessSession:StopRemoteAccessSessionResponse' :: Maybe RemoteAccessSession
remoteAccessSession = Maybe RemoteAccessSession
a} :: StopRemoteAccessSessionResponse)
stopRemoteAccessSessionResponse_httpStatus :: Lens.Lens' StopRemoteAccessSessionResponse Prelude.Int
stopRemoteAccessSessionResponse_httpStatus :: Lens' StopRemoteAccessSessionResponse Int
stopRemoteAccessSessionResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopRemoteAccessSessionResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopRemoteAccessSessionResponse' :: StopRemoteAccessSessionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopRemoteAccessSessionResponse
s@StopRemoteAccessSessionResponse' {} Int
a -> StopRemoteAccessSessionResponse
s {$sel:httpStatus:StopRemoteAccessSessionResponse' :: Int
httpStatus = Int
a} :: StopRemoteAccessSessionResponse)
instance
Prelude.NFData
StopRemoteAccessSessionResponse
where
rnf :: StopRemoteAccessSessionResponse -> ()
rnf StopRemoteAccessSessionResponse' {Int
Maybe RemoteAccessSession
httpStatus :: Int
remoteAccessSession :: Maybe RemoteAccessSession
$sel:httpStatus:StopRemoteAccessSessionResponse' :: StopRemoteAccessSessionResponse -> Int
$sel:remoteAccessSession:StopRemoteAccessSessionResponse' :: StopRemoteAccessSessionResponse -> Maybe RemoteAccessSession
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe RemoteAccessSession
remoteAccessSession
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus