{-# 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.SageMakerEdge.GetDeviceRegistration
(
GetDeviceRegistration (..),
newGetDeviceRegistration,
getDeviceRegistration_deviceName,
getDeviceRegistration_deviceFleetName,
GetDeviceRegistrationResponse (..),
newGetDeviceRegistrationResponse,
getDeviceRegistrationResponse_cacheTTL,
getDeviceRegistrationResponse_deviceRegistration,
getDeviceRegistrationResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SageMakerEdge.Types
data GetDeviceRegistration = GetDeviceRegistration'
{
GetDeviceRegistration -> Text
deviceName :: Prelude.Text,
GetDeviceRegistration -> Text
deviceFleetName :: Prelude.Text
}
deriving (GetDeviceRegistration -> GetDeviceRegistration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDeviceRegistration -> GetDeviceRegistration -> Bool
$c/= :: GetDeviceRegistration -> GetDeviceRegistration -> Bool
== :: GetDeviceRegistration -> GetDeviceRegistration -> Bool
$c== :: GetDeviceRegistration -> GetDeviceRegistration -> Bool
Prelude.Eq, ReadPrec [GetDeviceRegistration]
ReadPrec GetDeviceRegistration
Int -> ReadS GetDeviceRegistration
ReadS [GetDeviceRegistration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDeviceRegistration]
$creadListPrec :: ReadPrec [GetDeviceRegistration]
readPrec :: ReadPrec GetDeviceRegistration
$creadPrec :: ReadPrec GetDeviceRegistration
readList :: ReadS [GetDeviceRegistration]
$creadList :: ReadS [GetDeviceRegistration]
readsPrec :: Int -> ReadS GetDeviceRegistration
$creadsPrec :: Int -> ReadS GetDeviceRegistration
Prelude.Read, Int -> GetDeviceRegistration -> ShowS
[GetDeviceRegistration] -> ShowS
GetDeviceRegistration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDeviceRegistration] -> ShowS
$cshowList :: [GetDeviceRegistration] -> ShowS
show :: GetDeviceRegistration -> String
$cshow :: GetDeviceRegistration -> String
showsPrec :: Int -> GetDeviceRegistration -> ShowS
$cshowsPrec :: Int -> GetDeviceRegistration -> ShowS
Prelude.Show, forall x. Rep GetDeviceRegistration x -> GetDeviceRegistration
forall x. GetDeviceRegistration -> Rep GetDeviceRegistration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDeviceRegistration x -> GetDeviceRegistration
$cfrom :: forall x. GetDeviceRegistration -> Rep GetDeviceRegistration x
Prelude.Generic)
newGetDeviceRegistration ::
Prelude.Text ->
Prelude.Text ->
GetDeviceRegistration
newGetDeviceRegistration :: Text -> Text -> GetDeviceRegistration
newGetDeviceRegistration
Text
pDeviceName_
Text
pDeviceFleetName_ =
GetDeviceRegistration'
{ $sel:deviceName:GetDeviceRegistration' :: Text
deviceName = Text
pDeviceName_,
$sel:deviceFleetName:GetDeviceRegistration' :: Text
deviceFleetName = Text
pDeviceFleetName_
}
getDeviceRegistration_deviceName :: Lens.Lens' GetDeviceRegistration Prelude.Text
getDeviceRegistration_deviceName :: Lens' GetDeviceRegistration Text
getDeviceRegistration_deviceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeviceRegistration' {Text
deviceName :: Text
$sel:deviceName:GetDeviceRegistration' :: GetDeviceRegistration -> Text
deviceName} -> Text
deviceName) (\s :: GetDeviceRegistration
s@GetDeviceRegistration' {} Text
a -> GetDeviceRegistration
s {$sel:deviceName:GetDeviceRegistration' :: Text
deviceName = Text
a} :: GetDeviceRegistration)
getDeviceRegistration_deviceFleetName :: Lens.Lens' GetDeviceRegistration Prelude.Text
getDeviceRegistration_deviceFleetName :: Lens' GetDeviceRegistration Text
getDeviceRegistration_deviceFleetName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeviceRegistration' {Text
deviceFleetName :: Text
$sel:deviceFleetName:GetDeviceRegistration' :: GetDeviceRegistration -> Text
deviceFleetName} -> Text
deviceFleetName) (\s :: GetDeviceRegistration
s@GetDeviceRegistration' {} Text
a -> GetDeviceRegistration
s {$sel:deviceFleetName:GetDeviceRegistration' :: Text
deviceFleetName = Text
a} :: GetDeviceRegistration)
instance Core.AWSRequest GetDeviceRegistration where
type
AWSResponse GetDeviceRegistration =
GetDeviceRegistrationResponse
request :: (Service -> Service)
-> GetDeviceRegistration -> Request GetDeviceRegistration
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 GetDeviceRegistration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetDeviceRegistration)))
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 Text -> Int -> GetDeviceRegistrationResponse
GetDeviceRegistrationResponse'
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
"CacheTTL")
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
"DeviceRegistration")
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 GetDeviceRegistration where
hashWithSalt :: Int -> GetDeviceRegistration -> Int
hashWithSalt Int
_salt GetDeviceRegistration' {Text
deviceFleetName :: Text
deviceName :: Text
$sel:deviceFleetName:GetDeviceRegistration' :: GetDeviceRegistration -> Text
$sel:deviceName:GetDeviceRegistration' :: GetDeviceRegistration -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
deviceName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
deviceFleetName
instance Prelude.NFData GetDeviceRegistration where
rnf :: GetDeviceRegistration -> ()
rnf GetDeviceRegistration' {Text
deviceFleetName :: Text
deviceName :: Text
$sel:deviceFleetName:GetDeviceRegistration' :: GetDeviceRegistration -> Text
$sel:deviceName:GetDeviceRegistration' :: GetDeviceRegistration -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
deviceName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
deviceFleetName
instance Data.ToHeaders GetDeviceRegistration where
toHeaders :: GetDeviceRegistration -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON GetDeviceRegistration where
toJSON :: GetDeviceRegistration -> Value
toJSON GetDeviceRegistration' {Text
deviceFleetName :: Text
deviceName :: Text
$sel:deviceFleetName:GetDeviceRegistration' :: GetDeviceRegistration -> Text
$sel:deviceName:GetDeviceRegistration' :: GetDeviceRegistration -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"DeviceName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
deviceName),
forall a. a -> Maybe a
Prelude.Just
(Key
"DeviceFleetName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
deviceFleetName)
]
)
instance Data.ToPath GetDeviceRegistration where
toPath :: GetDeviceRegistration -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/GetDeviceRegistration"
instance Data.ToQuery GetDeviceRegistration where
toQuery :: GetDeviceRegistration -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetDeviceRegistrationResponse = GetDeviceRegistrationResponse'
{
GetDeviceRegistrationResponse -> Maybe Text
cacheTTL :: Prelude.Maybe Prelude.Text,
GetDeviceRegistrationResponse -> Maybe Text
deviceRegistration :: Prelude.Maybe Prelude.Text,
GetDeviceRegistrationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetDeviceRegistrationResponse
-> GetDeviceRegistrationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDeviceRegistrationResponse
-> GetDeviceRegistrationResponse -> Bool
$c/= :: GetDeviceRegistrationResponse
-> GetDeviceRegistrationResponse -> Bool
== :: GetDeviceRegistrationResponse
-> GetDeviceRegistrationResponse -> Bool
$c== :: GetDeviceRegistrationResponse
-> GetDeviceRegistrationResponse -> Bool
Prelude.Eq, ReadPrec [GetDeviceRegistrationResponse]
ReadPrec GetDeviceRegistrationResponse
Int -> ReadS GetDeviceRegistrationResponse
ReadS [GetDeviceRegistrationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDeviceRegistrationResponse]
$creadListPrec :: ReadPrec [GetDeviceRegistrationResponse]
readPrec :: ReadPrec GetDeviceRegistrationResponse
$creadPrec :: ReadPrec GetDeviceRegistrationResponse
readList :: ReadS [GetDeviceRegistrationResponse]
$creadList :: ReadS [GetDeviceRegistrationResponse]
readsPrec :: Int -> ReadS GetDeviceRegistrationResponse
$creadsPrec :: Int -> ReadS GetDeviceRegistrationResponse
Prelude.Read, Int -> GetDeviceRegistrationResponse -> ShowS
[GetDeviceRegistrationResponse] -> ShowS
GetDeviceRegistrationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDeviceRegistrationResponse] -> ShowS
$cshowList :: [GetDeviceRegistrationResponse] -> ShowS
show :: GetDeviceRegistrationResponse -> String
$cshow :: GetDeviceRegistrationResponse -> String
showsPrec :: Int -> GetDeviceRegistrationResponse -> ShowS
$cshowsPrec :: Int -> GetDeviceRegistrationResponse -> ShowS
Prelude.Show, forall x.
Rep GetDeviceRegistrationResponse x
-> GetDeviceRegistrationResponse
forall x.
GetDeviceRegistrationResponse
-> Rep GetDeviceRegistrationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetDeviceRegistrationResponse x
-> GetDeviceRegistrationResponse
$cfrom :: forall x.
GetDeviceRegistrationResponse
-> Rep GetDeviceRegistrationResponse x
Prelude.Generic)
newGetDeviceRegistrationResponse ::
Prelude.Int ->
GetDeviceRegistrationResponse
newGetDeviceRegistrationResponse :: Int -> GetDeviceRegistrationResponse
newGetDeviceRegistrationResponse Int
pHttpStatus_ =
GetDeviceRegistrationResponse'
{ $sel:cacheTTL:GetDeviceRegistrationResponse' :: Maybe Text
cacheTTL =
forall a. Maybe a
Prelude.Nothing,
$sel:deviceRegistration:GetDeviceRegistrationResponse' :: Maybe Text
deviceRegistration = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetDeviceRegistrationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getDeviceRegistrationResponse_cacheTTL :: Lens.Lens' GetDeviceRegistrationResponse (Prelude.Maybe Prelude.Text)
getDeviceRegistrationResponse_cacheTTL :: Lens' GetDeviceRegistrationResponse (Maybe Text)
getDeviceRegistrationResponse_cacheTTL = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeviceRegistrationResponse' {Maybe Text
cacheTTL :: Maybe Text
$sel:cacheTTL:GetDeviceRegistrationResponse' :: GetDeviceRegistrationResponse -> Maybe Text
cacheTTL} -> Maybe Text
cacheTTL) (\s :: GetDeviceRegistrationResponse
s@GetDeviceRegistrationResponse' {} Maybe Text
a -> GetDeviceRegistrationResponse
s {$sel:cacheTTL:GetDeviceRegistrationResponse' :: Maybe Text
cacheTTL = Maybe Text
a} :: GetDeviceRegistrationResponse)
getDeviceRegistrationResponse_deviceRegistration :: Lens.Lens' GetDeviceRegistrationResponse (Prelude.Maybe Prelude.Text)
getDeviceRegistrationResponse_deviceRegistration :: Lens' GetDeviceRegistrationResponse (Maybe Text)
getDeviceRegistrationResponse_deviceRegistration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeviceRegistrationResponse' {Maybe Text
deviceRegistration :: Maybe Text
$sel:deviceRegistration:GetDeviceRegistrationResponse' :: GetDeviceRegistrationResponse -> Maybe Text
deviceRegistration} -> Maybe Text
deviceRegistration) (\s :: GetDeviceRegistrationResponse
s@GetDeviceRegistrationResponse' {} Maybe Text
a -> GetDeviceRegistrationResponse
s {$sel:deviceRegistration:GetDeviceRegistrationResponse' :: Maybe Text
deviceRegistration = Maybe Text
a} :: GetDeviceRegistrationResponse)
getDeviceRegistrationResponse_httpStatus :: Lens.Lens' GetDeviceRegistrationResponse Prelude.Int
getDeviceRegistrationResponse_httpStatus :: Lens' GetDeviceRegistrationResponse Int
getDeviceRegistrationResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeviceRegistrationResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetDeviceRegistrationResponse' :: GetDeviceRegistrationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetDeviceRegistrationResponse
s@GetDeviceRegistrationResponse' {} Int
a -> GetDeviceRegistrationResponse
s {$sel:httpStatus:GetDeviceRegistrationResponse' :: Int
httpStatus = Int
a} :: GetDeviceRegistrationResponse)
instance Prelude.NFData GetDeviceRegistrationResponse where
rnf :: GetDeviceRegistrationResponse -> ()
rnf GetDeviceRegistrationResponse' {Int
Maybe Text
httpStatus :: Int
deviceRegistration :: Maybe Text
cacheTTL :: Maybe Text
$sel:httpStatus:GetDeviceRegistrationResponse' :: GetDeviceRegistrationResponse -> Int
$sel:deviceRegistration:GetDeviceRegistrationResponse' :: GetDeviceRegistrationResponse -> Maybe Text
$sel:cacheTTL:GetDeviceRegistrationResponse' :: GetDeviceRegistrationResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
cacheTTL
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deviceRegistration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus