{-# 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.Braket.GetDevice
(
GetDevice (..),
newGetDevice,
getDevice_deviceArn,
GetDeviceResponse (..),
newGetDeviceResponse,
getDeviceResponse_httpStatus,
getDeviceResponse_deviceArn,
getDeviceResponse_deviceCapabilities,
getDeviceResponse_deviceName,
getDeviceResponse_deviceStatus,
getDeviceResponse_deviceType,
getDeviceResponse_providerName,
)
where
import Amazonka.Braket.Types
import qualified Amazonka.Core as Core
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 GetDevice = GetDevice'
{
GetDevice -> Text
deviceArn :: Prelude.Text
}
deriving (GetDevice -> GetDevice -> Bool
(GetDevice -> GetDevice -> Bool)
-> (GetDevice -> GetDevice -> Bool) -> Eq GetDevice
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDevice -> GetDevice -> Bool
$c/= :: GetDevice -> GetDevice -> Bool
== :: GetDevice -> GetDevice -> Bool
$c== :: GetDevice -> GetDevice -> Bool
Prelude.Eq, ReadPrec [GetDevice]
ReadPrec GetDevice
Int -> ReadS GetDevice
ReadS [GetDevice]
(Int -> ReadS GetDevice)
-> ReadS [GetDevice]
-> ReadPrec GetDevice
-> ReadPrec [GetDevice]
-> Read GetDevice
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDevice]
$creadListPrec :: ReadPrec [GetDevice]
readPrec :: ReadPrec GetDevice
$creadPrec :: ReadPrec GetDevice
readList :: ReadS [GetDevice]
$creadList :: ReadS [GetDevice]
readsPrec :: Int -> ReadS GetDevice
$creadsPrec :: Int -> ReadS GetDevice
Prelude.Read, Int -> GetDevice -> ShowS
[GetDevice] -> ShowS
GetDevice -> String
(Int -> GetDevice -> ShowS)
-> (GetDevice -> String)
-> ([GetDevice] -> ShowS)
-> Show GetDevice
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDevice] -> ShowS
$cshowList :: [GetDevice] -> ShowS
show :: GetDevice -> String
$cshow :: GetDevice -> String
showsPrec :: Int -> GetDevice -> ShowS
$cshowsPrec :: Int -> GetDevice -> ShowS
Prelude.Show, (forall x. GetDevice -> Rep GetDevice x)
-> (forall x. Rep GetDevice x -> GetDevice) -> Generic GetDevice
forall x. Rep GetDevice x -> GetDevice
forall x. GetDevice -> Rep GetDevice x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDevice x -> GetDevice
$cfrom :: forall x. GetDevice -> Rep GetDevice x
Prelude.Generic)
newGetDevice ::
Prelude.Text ->
GetDevice
newGetDevice :: Text -> GetDevice
newGetDevice Text
pDeviceArn_ =
GetDevice' :: Text -> GetDevice
GetDevice' {$sel:deviceArn:GetDevice' :: Text
deviceArn = Text
pDeviceArn_}
getDevice_deviceArn :: Lens.Lens' GetDevice Prelude.Text
getDevice_deviceArn :: (Text -> f Text) -> GetDevice -> f GetDevice
getDevice_deviceArn = (GetDevice -> Text)
-> (GetDevice -> Text -> GetDevice)
-> Lens GetDevice GetDevice Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDevice' {Text
deviceArn :: Text
$sel:deviceArn:GetDevice' :: GetDevice -> Text
deviceArn} -> Text
deviceArn) (\s :: GetDevice
s@GetDevice' {} Text
a -> GetDevice
s {$sel:deviceArn:GetDevice' :: Text
deviceArn = Text
a} :: GetDevice)
instance Core.AWSRequest GetDevice where
type AWSResponse GetDevice = GetDeviceResponse
request :: GetDevice -> Request GetDevice
request = Service -> GetDevice -> Request GetDevice
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetDevice
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetDevice)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetDevice))
-> Logger
-> Service
-> Proxy GetDevice
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetDevice)))
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 ->
Int
-> Text
-> Text
-> Text
-> DeviceStatus
-> DeviceType
-> Text
-> GetDeviceResponse
GetDeviceResponse'
(Int
-> Text
-> Text
-> Text
-> DeviceStatus
-> DeviceType
-> Text
-> GetDeviceResponse)
-> Either String Int
-> Either
String
(Text
-> Text
-> Text
-> DeviceStatus
-> DeviceType
-> Text
-> GetDeviceResponse)
forall (f :: * -> *) a b. Functor 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))
Either
String
(Text
-> Text
-> Text
-> DeviceStatus
-> DeviceType
-> Text
-> GetDeviceResponse)
-> Either String Text
-> Either
String
(Text
-> Text -> DeviceStatus -> DeviceType -> Text -> GetDeviceResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"deviceArn")
Either
String
(Text
-> Text -> DeviceStatus -> DeviceType -> Text -> GetDeviceResponse)
-> Either String Text
-> Either
String
(Text -> DeviceStatus -> DeviceType -> Text -> GetDeviceResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"deviceCapabilities")
Either
String
(Text -> DeviceStatus -> DeviceType -> Text -> GetDeviceResponse)
-> Either String Text
-> Either
String (DeviceStatus -> DeviceType -> Text -> GetDeviceResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"deviceName")
Either
String (DeviceStatus -> DeviceType -> Text -> GetDeviceResponse)
-> Either String DeviceStatus
-> Either String (DeviceType -> Text -> GetDeviceResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String DeviceStatus
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"deviceStatus")
Either String (DeviceType -> Text -> GetDeviceResponse)
-> Either String DeviceType
-> Either String (Text -> GetDeviceResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String DeviceType
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"deviceType")
Either String (Text -> GetDeviceResponse)
-> Either String Text -> Either String GetDeviceResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"providerName")
)
instance Prelude.Hashable GetDevice
instance Prelude.NFData GetDevice
instance Core.ToHeaders GetDevice where
toHeaders :: GetDevice -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetDevice -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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.ToPath GetDevice where
toPath :: GetDevice -> ByteString
toPath GetDevice' {Text
deviceArn :: Text
$sel:deviceArn:GetDevice' :: GetDevice -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/device/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
deviceArn]
instance Core.ToQuery GetDevice where
toQuery :: GetDevice -> QueryString
toQuery = QueryString -> GetDevice -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetDeviceResponse = GetDeviceResponse'
{
GetDeviceResponse -> Int
httpStatus :: Prelude.Int,
GetDeviceResponse -> Text
deviceArn :: Prelude.Text,
GetDeviceResponse -> Text
deviceCapabilities :: Prelude.Text,
GetDeviceResponse -> Text
deviceName :: Prelude.Text,
GetDeviceResponse -> DeviceStatus
deviceStatus :: DeviceStatus,
GetDeviceResponse -> DeviceType
deviceType :: DeviceType,
GetDeviceResponse -> Text
providerName :: Prelude.Text
}
deriving (GetDeviceResponse -> GetDeviceResponse -> Bool
(GetDeviceResponse -> GetDeviceResponse -> Bool)
-> (GetDeviceResponse -> GetDeviceResponse -> Bool)
-> Eq GetDeviceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDeviceResponse -> GetDeviceResponse -> Bool
$c/= :: GetDeviceResponse -> GetDeviceResponse -> Bool
== :: GetDeviceResponse -> GetDeviceResponse -> Bool
$c== :: GetDeviceResponse -> GetDeviceResponse -> Bool
Prelude.Eq, ReadPrec [GetDeviceResponse]
ReadPrec GetDeviceResponse
Int -> ReadS GetDeviceResponse
ReadS [GetDeviceResponse]
(Int -> ReadS GetDeviceResponse)
-> ReadS [GetDeviceResponse]
-> ReadPrec GetDeviceResponse
-> ReadPrec [GetDeviceResponse]
-> Read GetDeviceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDeviceResponse]
$creadListPrec :: ReadPrec [GetDeviceResponse]
readPrec :: ReadPrec GetDeviceResponse
$creadPrec :: ReadPrec GetDeviceResponse
readList :: ReadS [GetDeviceResponse]
$creadList :: ReadS [GetDeviceResponse]
readsPrec :: Int -> ReadS GetDeviceResponse
$creadsPrec :: Int -> ReadS GetDeviceResponse
Prelude.Read, Int -> GetDeviceResponse -> ShowS
[GetDeviceResponse] -> ShowS
GetDeviceResponse -> String
(Int -> GetDeviceResponse -> ShowS)
-> (GetDeviceResponse -> String)
-> ([GetDeviceResponse] -> ShowS)
-> Show GetDeviceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDeviceResponse] -> ShowS
$cshowList :: [GetDeviceResponse] -> ShowS
show :: GetDeviceResponse -> String
$cshow :: GetDeviceResponse -> String
showsPrec :: Int -> GetDeviceResponse -> ShowS
$cshowsPrec :: Int -> GetDeviceResponse -> ShowS
Prelude.Show, (forall x. GetDeviceResponse -> Rep GetDeviceResponse x)
-> (forall x. Rep GetDeviceResponse x -> GetDeviceResponse)
-> Generic GetDeviceResponse
forall x. Rep GetDeviceResponse x -> GetDeviceResponse
forall x. GetDeviceResponse -> Rep GetDeviceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDeviceResponse x -> GetDeviceResponse
$cfrom :: forall x. GetDeviceResponse -> Rep GetDeviceResponse x
Prelude.Generic)
newGetDeviceResponse ::
Prelude.Int ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
DeviceStatus ->
DeviceType ->
Prelude.Text ->
GetDeviceResponse
newGetDeviceResponse :: Int
-> Text
-> Text
-> Text
-> DeviceStatus
-> DeviceType
-> Text
-> GetDeviceResponse
newGetDeviceResponse
Int
pHttpStatus_
Text
pDeviceArn_
Text
pDeviceCapabilities_
Text
pDeviceName_
DeviceStatus
pDeviceStatus_
DeviceType
pDeviceType_
Text
pProviderName_ =
GetDeviceResponse' :: Int
-> Text
-> Text
-> Text
-> DeviceStatus
-> DeviceType
-> Text
-> GetDeviceResponse
GetDeviceResponse'
{ $sel:httpStatus:GetDeviceResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:deviceArn:GetDeviceResponse' :: Text
deviceArn = Text
pDeviceArn_,
$sel:deviceCapabilities:GetDeviceResponse' :: Text
deviceCapabilities = Text
pDeviceCapabilities_,
$sel:deviceName:GetDeviceResponse' :: Text
deviceName = Text
pDeviceName_,
$sel:deviceStatus:GetDeviceResponse' :: DeviceStatus
deviceStatus = DeviceStatus
pDeviceStatus_,
$sel:deviceType:GetDeviceResponse' :: DeviceType
deviceType = DeviceType
pDeviceType_,
$sel:providerName:GetDeviceResponse' :: Text
providerName = Text
pProviderName_
}
getDeviceResponse_httpStatus :: Lens.Lens' GetDeviceResponse Prelude.Int
getDeviceResponse_httpStatus :: (Int -> f Int) -> GetDeviceResponse -> f GetDeviceResponse
getDeviceResponse_httpStatus = (GetDeviceResponse -> Int)
-> (GetDeviceResponse -> Int -> GetDeviceResponse)
-> Lens GetDeviceResponse GetDeviceResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeviceResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetDeviceResponse' :: GetDeviceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetDeviceResponse
s@GetDeviceResponse' {} Int
a -> GetDeviceResponse
s {$sel:httpStatus:GetDeviceResponse' :: Int
httpStatus = Int
a} :: GetDeviceResponse)
getDeviceResponse_deviceArn :: Lens.Lens' GetDeviceResponse Prelude.Text
getDeviceResponse_deviceArn :: (Text -> f Text) -> GetDeviceResponse -> f GetDeviceResponse
getDeviceResponse_deviceArn = (GetDeviceResponse -> Text)
-> (GetDeviceResponse -> Text -> GetDeviceResponse)
-> Lens GetDeviceResponse GetDeviceResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeviceResponse' {Text
deviceArn :: Text
$sel:deviceArn:GetDeviceResponse' :: GetDeviceResponse -> Text
deviceArn} -> Text
deviceArn) (\s :: GetDeviceResponse
s@GetDeviceResponse' {} Text
a -> GetDeviceResponse
s {$sel:deviceArn:GetDeviceResponse' :: Text
deviceArn = Text
a} :: GetDeviceResponse)
getDeviceResponse_deviceCapabilities :: Lens.Lens' GetDeviceResponse Prelude.Text
getDeviceResponse_deviceCapabilities :: (Text -> f Text) -> GetDeviceResponse -> f GetDeviceResponse
getDeviceResponse_deviceCapabilities = (GetDeviceResponse -> Text)
-> (GetDeviceResponse -> Text -> GetDeviceResponse)
-> Lens GetDeviceResponse GetDeviceResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeviceResponse' {Text
deviceCapabilities :: Text
$sel:deviceCapabilities:GetDeviceResponse' :: GetDeviceResponse -> Text
deviceCapabilities} -> Text
deviceCapabilities) (\s :: GetDeviceResponse
s@GetDeviceResponse' {} Text
a -> GetDeviceResponse
s {$sel:deviceCapabilities:GetDeviceResponse' :: Text
deviceCapabilities = Text
a} :: GetDeviceResponse)
getDeviceResponse_deviceName :: Lens.Lens' GetDeviceResponse Prelude.Text
getDeviceResponse_deviceName :: (Text -> f Text) -> GetDeviceResponse -> f GetDeviceResponse
getDeviceResponse_deviceName = (GetDeviceResponse -> Text)
-> (GetDeviceResponse -> Text -> GetDeviceResponse)
-> Lens GetDeviceResponse GetDeviceResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeviceResponse' {Text
deviceName :: Text
$sel:deviceName:GetDeviceResponse' :: GetDeviceResponse -> Text
deviceName} -> Text
deviceName) (\s :: GetDeviceResponse
s@GetDeviceResponse' {} Text
a -> GetDeviceResponse
s {$sel:deviceName:GetDeviceResponse' :: Text
deviceName = Text
a} :: GetDeviceResponse)
getDeviceResponse_deviceStatus :: Lens.Lens' GetDeviceResponse DeviceStatus
getDeviceResponse_deviceStatus :: (DeviceStatus -> f DeviceStatus)
-> GetDeviceResponse -> f GetDeviceResponse
getDeviceResponse_deviceStatus = (GetDeviceResponse -> DeviceStatus)
-> (GetDeviceResponse -> DeviceStatus -> GetDeviceResponse)
-> Lens
GetDeviceResponse GetDeviceResponse DeviceStatus DeviceStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeviceResponse' {DeviceStatus
deviceStatus :: DeviceStatus
$sel:deviceStatus:GetDeviceResponse' :: GetDeviceResponse -> DeviceStatus
deviceStatus} -> DeviceStatus
deviceStatus) (\s :: GetDeviceResponse
s@GetDeviceResponse' {} DeviceStatus
a -> GetDeviceResponse
s {$sel:deviceStatus:GetDeviceResponse' :: DeviceStatus
deviceStatus = DeviceStatus
a} :: GetDeviceResponse)
getDeviceResponse_deviceType :: Lens.Lens' GetDeviceResponse DeviceType
getDeviceResponse_deviceType :: (DeviceType -> f DeviceType)
-> GetDeviceResponse -> f GetDeviceResponse
getDeviceResponse_deviceType = (GetDeviceResponse -> DeviceType)
-> (GetDeviceResponse -> DeviceType -> GetDeviceResponse)
-> Lens GetDeviceResponse GetDeviceResponse DeviceType DeviceType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeviceResponse' {DeviceType
deviceType :: DeviceType
$sel:deviceType:GetDeviceResponse' :: GetDeviceResponse -> DeviceType
deviceType} -> DeviceType
deviceType) (\s :: GetDeviceResponse
s@GetDeviceResponse' {} DeviceType
a -> GetDeviceResponse
s {$sel:deviceType:GetDeviceResponse' :: DeviceType
deviceType = DeviceType
a} :: GetDeviceResponse)
getDeviceResponse_providerName :: Lens.Lens' GetDeviceResponse Prelude.Text
getDeviceResponse_providerName :: (Text -> f Text) -> GetDeviceResponse -> f GetDeviceResponse
getDeviceResponse_providerName = (GetDeviceResponse -> Text)
-> (GetDeviceResponse -> Text -> GetDeviceResponse)
-> Lens GetDeviceResponse GetDeviceResponse Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeviceResponse' {Text
providerName :: Text
$sel:providerName:GetDeviceResponse' :: GetDeviceResponse -> Text
providerName} -> Text
providerName) (\s :: GetDeviceResponse
s@GetDeviceResponse' {} Text
a -> GetDeviceResponse
s {$sel:providerName:GetDeviceResponse' :: Text
providerName = Text
a} :: GetDeviceResponse)
instance Prelude.NFData GetDeviceResponse