{-# 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.InstallToRemoteAccessSession
(
InstallToRemoteAccessSession (..),
newInstallToRemoteAccessSession,
installToRemoteAccessSession_remoteAccessSessionArn,
installToRemoteAccessSession_appArn,
InstallToRemoteAccessSessionResponse (..),
newInstallToRemoteAccessSessionResponse,
installToRemoteAccessSessionResponse_appUpload,
installToRemoteAccessSessionResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.DeviceFarm.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data InstallToRemoteAccessSession = InstallToRemoteAccessSession'
{
InstallToRemoteAccessSession -> Text
remoteAccessSessionArn :: Prelude.Text,
InstallToRemoteAccessSession -> Text
appArn :: Prelude.Text
}
deriving (InstallToRemoteAccessSession
-> InstallToRemoteAccessSession -> Bool
(InstallToRemoteAccessSession
-> InstallToRemoteAccessSession -> Bool)
-> (InstallToRemoteAccessSession
-> InstallToRemoteAccessSession -> Bool)
-> Eq InstallToRemoteAccessSession
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstallToRemoteAccessSession
-> InstallToRemoteAccessSession -> Bool
$c/= :: InstallToRemoteAccessSession
-> InstallToRemoteAccessSession -> Bool
== :: InstallToRemoteAccessSession
-> InstallToRemoteAccessSession -> Bool
$c== :: InstallToRemoteAccessSession
-> InstallToRemoteAccessSession -> Bool
Prelude.Eq, ReadPrec [InstallToRemoteAccessSession]
ReadPrec InstallToRemoteAccessSession
Int -> ReadS InstallToRemoteAccessSession
ReadS [InstallToRemoteAccessSession]
(Int -> ReadS InstallToRemoteAccessSession)
-> ReadS [InstallToRemoteAccessSession]
-> ReadPrec InstallToRemoteAccessSession
-> ReadPrec [InstallToRemoteAccessSession]
-> Read InstallToRemoteAccessSession
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstallToRemoteAccessSession]
$creadListPrec :: ReadPrec [InstallToRemoteAccessSession]
readPrec :: ReadPrec InstallToRemoteAccessSession
$creadPrec :: ReadPrec InstallToRemoteAccessSession
readList :: ReadS [InstallToRemoteAccessSession]
$creadList :: ReadS [InstallToRemoteAccessSession]
readsPrec :: Int -> ReadS InstallToRemoteAccessSession
$creadsPrec :: Int -> ReadS InstallToRemoteAccessSession
Prelude.Read, Int -> InstallToRemoteAccessSession -> ShowS
[InstallToRemoteAccessSession] -> ShowS
InstallToRemoteAccessSession -> String
(Int -> InstallToRemoteAccessSession -> ShowS)
-> (InstallToRemoteAccessSession -> String)
-> ([InstallToRemoteAccessSession] -> ShowS)
-> Show InstallToRemoteAccessSession
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstallToRemoteAccessSession] -> ShowS
$cshowList :: [InstallToRemoteAccessSession] -> ShowS
show :: InstallToRemoteAccessSession -> String
$cshow :: InstallToRemoteAccessSession -> String
showsPrec :: Int -> InstallToRemoteAccessSession -> ShowS
$cshowsPrec :: Int -> InstallToRemoteAccessSession -> ShowS
Prelude.Show, (forall x.
InstallToRemoteAccessSession -> Rep InstallToRemoteAccessSession x)
-> (forall x.
Rep InstallToRemoteAccessSession x -> InstallToRemoteAccessSession)
-> Generic InstallToRemoteAccessSession
forall x.
Rep InstallToRemoteAccessSession x -> InstallToRemoteAccessSession
forall x.
InstallToRemoteAccessSession -> Rep InstallToRemoteAccessSession x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InstallToRemoteAccessSession x -> InstallToRemoteAccessSession
$cfrom :: forall x.
InstallToRemoteAccessSession -> Rep InstallToRemoteAccessSession x
Prelude.Generic)
newInstallToRemoteAccessSession ::
Prelude.Text ->
Prelude.Text ->
InstallToRemoteAccessSession
newInstallToRemoteAccessSession :: Text -> Text -> InstallToRemoteAccessSession
newInstallToRemoteAccessSession
Text
pRemoteAccessSessionArn_
Text
pAppArn_ =
InstallToRemoteAccessSession' :: Text -> Text -> InstallToRemoteAccessSession
InstallToRemoteAccessSession'
{ $sel:remoteAccessSessionArn:InstallToRemoteAccessSession' :: Text
remoteAccessSessionArn =
Text
pRemoteAccessSessionArn_,
$sel:appArn:InstallToRemoteAccessSession' :: Text
appArn = Text
pAppArn_
}
installToRemoteAccessSession_remoteAccessSessionArn :: Lens.Lens' InstallToRemoteAccessSession Prelude.Text
installToRemoteAccessSession_remoteAccessSessionArn :: (Text -> f Text)
-> InstallToRemoteAccessSession -> f InstallToRemoteAccessSession
installToRemoteAccessSession_remoteAccessSessionArn = (InstallToRemoteAccessSession -> Text)
-> (InstallToRemoteAccessSession
-> Text -> InstallToRemoteAccessSession)
-> Lens
InstallToRemoteAccessSession InstallToRemoteAccessSession Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstallToRemoteAccessSession' {Text
remoteAccessSessionArn :: Text
$sel:remoteAccessSessionArn:InstallToRemoteAccessSession' :: InstallToRemoteAccessSession -> Text
remoteAccessSessionArn} -> Text
remoteAccessSessionArn) (\s :: InstallToRemoteAccessSession
s@InstallToRemoteAccessSession' {} Text
a -> InstallToRemoteAccessSession
s {$sel:remoteAccessSessionArn:InstallToRemoteAccessSession' :: Text
remoteAccessSessionArn = Text
a} :: InstallToRemoteAccessSession)
installToRemoteAccessSession_appArn :: Lens.Lens' InstallToRemoteAccessSession Prelude.Text
installToRemoteAccessSession_appArn :: (Text -> f Text)
-> InstallToRemoteAccessSession -> f InstallToRemoteAccessSession
installToRemoteAccessSession_appArn = (InstallToRemoteAccessSession -> Text)
-> (InstallToRemoteAccessSession
-> Text -> InstallToRemoteAccessSession)
-> Lens
InstallToRemoteAccessSession InstallToRemoteAccessSession Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstallToRemoteAccessSession' {Text
appArn :: Text
$sel:appArn:InstallToRemoteAccessSession' :: InstallToRemoteAccessSession -> Text
appArn} -> Text
appArn) (\s :: InstallToRemoteAccessSession
s@InstallToRemoteAccessSession' {} Text
a -> InstallToRemoteAccessSession
s {$sel:appArn:InstallToRemoteAccessSession' :: Text
appArn = Text
a} :: InstallToRemoteAccessSession)
instance Core.AWSRequest InstallToRemoteAccessSession where
type
AWSResponse InstallToRemoteAccessSession =
InstallToRemoteAccessSessionResponse
request :: InstallToRemoteAccessSession
-> Request InstallToRemoteAccessSession
request = Service
-> InstallToRemoteAccessSession
-> Request InstallToRemoteAccessSession
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy InstallToRemoteAccessSession
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse InstallToRemoteAccessSession)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse InstallToRemoteAccessSession))
-> Logger
-> Service
-> Proxy InstallToRemoteAccessSession
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse InstallToRemoteAccessSession)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Upload -> Int -> InstallToRemoteAccessSessionResponse
InstallToRemoteAccessSessionResponse'
(Maybe Upload -> Int -> InstallToRemoteAccessSessionResponse)
-> Either String (Maybe Upload)
-> Either String (Int -> InstallToRemoteAccessSessionResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Upload)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"appUpload")
Either String (Int -> InstallToRemoteAccessSessionResponse)
-> Either String Int
-> Either String InstallToRemoteAccessSessionResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance
Prelude.Hashable
InstallToRemoteAccessSession
instance Prelude.NFData InstallToRemoteAccessSession
instance Core.ToHeaders InstallToRemoteAccessSession where
toHeaders :: InstallToRemoteAccessSession -> ResponseHeaders
toHeaders =
ResponseHeaders -> InstallToRemoteAccessSession -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"DeviceFarm_20150623.InstallToRemoteAccessSession" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON InstallToRemoteAccessSession where
toJSON :: InstallToRemoteAccessSession -> Value
toJSON InstallToRemoteAccessSession' {Text
appArn :: Text
remoteAccessSessionArn :: Text
$sel:appArn:InstallToRemoteAccessSession' :: InstallToRemoteAccessSession -> Text
$sel:remoteAccessSessionArn:InstallToRemoteAccessSession' :: InstallToRemoteAccessSession -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"remoteAccessSessionArn"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
remoteAccessSessionArn
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"appArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
appArn)
]
)
instance Core.ToPath InstallToRemoteAccessSession where
toPath :: InstallToRemoteAccessSession -> ByteString
toPath = ByteString -> InstallToRemoteAccessSession -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery InstallToRemoteAccessSession where
toQuery :: InstallToRemoteAccessSession -> QueryString
toQuery = QueryString -> InstallToRemoteAccessSession -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data InstallToRemoteAccessSessionResponse = InstallToRemoteAccessSessionResponse'
{
InstallToRemoteAccessSessionResponse -> Maybe Upload
appUpload :: Prelude.Maybe Upload,
InstallToRemoteAccessSessionResponse -> Int
httpStatus :: Prelude.Int
}
deriving (InstallToRemoteAccessSessionResponse
-> InstallToRemoteAccessSessionResponse -> Bool
(InstallToRemoteAccessSessionResponse
-> InstallToRemoteAccessSessionResponse -> Bool)
-> (InstallToRemoteAccessSessionResponse
-> InstallToRemoteAccessSessionResponse -> Bool)
-> Eq InstallToRemoteAccessSessionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstallToRemoteAccessSessionResponse
-> InstallToRemoteAccessSessionResponse -> Bool
$c/= :: InstallToRemoteAccessSessionResponse
-> InstallToRemoteAccessSessionResponse -> Bool
== :: InstallToRemoteAccessSessionResponse
-> InstallToRemoteAccessSessionResponse -> Bool
$c== :: InstallToRemoteAccessSessionResponse
-> InstallToRemoteAccessSessionResponse -> Bool
Prelude.Eq, Int -> InstallToRemoteAccessSessionResponse -> ShowS
[InstallToRemoteAccessSessionResponse] -> ShowS
InstallToRemoteAccessSessionResponse -> String
(Int -> InstallToRemoteAccessSessionResponse -> ShowS)
-> (InstallToRemoteAccessSessionResponse -> String)
-> ([InstallToRemoteAccessSessionResponse] -> ShowS)
-> Show InstallToRemoteAccessSessionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstallToRemoteAccessSessionResponse] -> ShowS
$cshowList :: [InstallToRemoteAccessSessionResponse] -> ShowS
show :: InstallToRemoteAccessSessionResponse -> String
$cshow :: InstallToRemoteAccessSessionResponse -> String
showsPrec :: Int -> InstallToRemoteAccessSessionResponse -> ShowS
$cshowsPrec :: Int -> InstallToRemoteAccessSessionResponse -> ShowS
Prelude.Show, (forall x.
InstallToRemoteAccessSessionResponse
-> Rep InstallToRemoteAccessSessionResponse x)
-> (forall x.
Rep InstallToRemoteAccessSessionResponse x
-> InstallToRemoteAccessSessionResponse)
-> Generic InstallToRemoteAccessSessionResponse
forall x.
Rep InstallToRemoteAccessSessionResponse x
-> InstallToRemoteAccessSessionResponse
forall x.
InstallToRemoteAccessSessionResponse
-> Rep InstallToRemoteAccessSessionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InstallToRemoteAccessSessionResponse x
-> InstallToRemoteAccessSessionResponse
$cfrom :: forall x.
InstallToRemoteAccessSessionResponse
-> Rep InstallToRemoteAccessSessionResponse x
Prelude.Generic)
newInstallToRemoteAccessSessionResponse ::
Prelude.Int ->
InstallToRemoteAccessSessionResponse
newInstallToRemoteAccessSessionResponse :: Int -> InstallToRemoteAccessSessionResponse
newInstallToRemoteAccessSessionResponse Int
pHttpStatus_ =
InstallToRemoteAccessSessionResponse' :: Maybe Upload -> Int -> InstallToRemoteAccessSessionResponse
InstallToRemoteAccessSessionResponse'
{ $sel:appUpload:InstallToRemoteAccessSessionResponse' :: Maybe Upload
appUpload =
Maybe Upload
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:InstallToRemoteAccessSessionResponse' :: Int
httpStatus = Int
pHttpStatus_
}
installToRemoteAccessSessionResponse_appUpload :: Lens.Lens' InstallToRemoteAccessSessionResponse (Prelude.Maybe Upload)
installToRemoteAccessSessionResponse_appUpload :: (Maybe Upload -> f (Maybe Upload))
-> InstallToRemoteAccessSessionResponse
-> f InstallToRemoteAccessSessionResponse
installToRemoteAccessSessionResponse_appUpload = (InstallToRemoteAccessSessionResponse -> Maybe Upload)
-> (InstallToRemoteAccessSessionResponse
-> Maybe Upload -> InstallToRemoteAccessSessionResponse)
-> Lens
InstallToRemoteAccessSessionResponse
InstallToRemoteAccessSessionResponse
(Maybe Upload)
(Maybe Upload)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstallToRemoteAccessSessionResponse' {Maybe Upload
appUpload :: Maybe Upload
$sel:appUpload:InstallToRemoteAccessSessionResponse' :: InstallToRemoteAccessSessionResponse -> Maybe Upload
appUpload} -> Maybe Upload
appUpload) (\s :: InstallToRemoteAccessSessionResponse
s@InstallToRemoteAccessSessionResponse' {} Maybe Upload
a -> InstallToRemoteAccessSessionResponse
s {$sel:appUpload:InstallToRemoteAccessSessionResponse' :: Maybe Upload
appUpload = Maybe Upload
a} :: InstallToRemoteAccessSessionResponse)
installToRemoteAccessSessionResponse_httpStatus :: Lens.Lens' InstallToRemoteAccessSessionResponse Prelude.Int
installToRemoteAccessSessionResponse_httpStatus :: (Int -> f Int)
-> InstallToRemoteAccessSessionResponse
-> f InstallToRemoteAccessSessionResponse
installToRemoteAccessSessionResponse_httpStatus = (InstallToRemoteAccessSessionResponse -> Int)
-> (InstallToRemoteAccessSessionResponse
-> Int -> InstallToRemoteAccessSessionResponse)
-> Lens
InstallToRemoteAccessSessionResponse
InstallToRemoteAccessSessionResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstallToRemoteAccessSessionResponse' {Int
httpStatus :: Int
$sel:httpStatus:InstallToRemoteAccessSessionResponse' :: InstallToRemoteAccessSessionResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: InstallToRemoteAccessSessionResponse
s@InstallToRemoteAccessSessionResponse' {} Int
a -> InstallToRemoteAccessSessionResponse
s {$sel:httpStatus:InstallToRemoteAccessSessionResponse' :: Int
httpStatus = Int
a} :: InstallToRemoteAccessSessionResponse)
instance
Prelude.NFData
InstallToRemoteAccessSessionResponse