{-# 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.IoTWireless.GetDeviceProfile
(
GetDeviceProfile (..),
newGetDeviceProfile,
getDeviceProfile_id,
GetDeviceProfileResponse (..),
newGetDeviceProfileResponse,
getDeviceProfileResponse_arn,
getDeviceProfileResponse_loRaWAN,
getDeviceProfileResponse_name,
getDeviceProfileResponse_id,
getDeviceProfileResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IoTWireless.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 GetDeviceProfile = GetDeviceProfile'
{
GetDeviceProfile -> Text
id :: Prelude.Text
}
deriving (GetDeviceProfile -> GetDeviceProfile -> Bool
(GetDeviceProfile -> GetDeviceProfile -> Bool)
-> (GetDeviceProfile -> GetDeviceProfile -> Bool)
-> Eq GetDeviceProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDeviceProfile -> GetDeviceProfile -> Bool
$c/= :: GetDeviceProfile -> GetDeviceProfile -> Bool
== :: GetDeviceProfile -> GetDeviceProfile -> Bool
$c== :: GetDeviceProfile -> GetDeviceProfile -> Bool
Prelude.Eq, ReadPrec [GetDeviceProfile]
ReadPrec GetDeviceProfile
Int -> ReadS GetDeviceProfile
ReadS [GetDeviceProfile]
(Int -> ReadS GetDeviceProfile)
-> ReadS [GetDeviceProfile]
-> ReadPrec GetDeviceProfile
-> ReadPrec [GetDeviceProfile]
-> Read GetDeviceProfile
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDeviceProfile]
$creadListPrec :: ReadPrec [GetDeviceProfile]
readPrec :: ReadPrec GetDeviceProfile
$creadPrec :: ReadPrec GetDeviceProfile
readList :: ReadS [GetDeviceProfile]
$creadList :: ReadS [GetDeviceProfile]
readsPrec :: Int -> ReadS GetDeviceProfile
$creadsPrec :: Int -> ReadS GetDeviceProfile
Prelude.Read, Int -> GetDeviceProfile -> ShowS
[GetDeviceProfile] -> ShowS
GetDeviceProfile -> String
(Int -> GetDeviceProfile -> ShowS)
-> (GetDeviceProfile -> String)
-> ([GetDeviceProfile] -> ShowS)
-> Show GetDeviceProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDeviceProfile] -> ShowS
$cshowList :: [GetDeviceProfile] -> ShowS
show :: GetDeviceProfile -> String
$cshow :: GetDeviceProfile -> String
showsPrec :: Int -> GetDeviceProfile -> ShowS
$cshowsPrec :: Int -> GetDeviceProfile -> ShowS
Prelude.Show, (forall x. GetDeviceProfile -> Rep GetDeviceProfile x)
-> (forall x. Rep GetDeviceProfile x -> GetDeviceProfile)
-> Generic GetDeviceProfile
forall x. Rep GetDeviceProfile x -> GetDeviceProfile
forall x. GetDeviceProfile -> Rep GetDeviceProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetDeviceProfile x -> GetDeviceProfile
$cfrom :: forall x. GetDeviceProfile -> Rep GetDeviceProfile x
Prelude.Generic)
newGetDeviceProfile ::
Prelude.Text ->
GetDeviceProfile
newGetDeviceProfile :: Text -> GetDeviceProfile
newGetDeviceProfile Text
pId_ =
GetDeviceProfile' :: Text -> GetDeviceProfile
GetDeviceProfile' {$sel:id:GetDeviceProfile' :: Text
id = Text
pId_}
getDeviceProfile_id :: Lens.Lens' GetDeviceProfile Prelude.Text
getDeviceProfile_id :: (Text -> f Text) -> GetDeviceProfile -> f GetDeviceProfile
getDeviceProfile_id = (GetDeviceProfile -> Text)
-> (GetDeviceProfile -> Text -> GetDeviceProfile)
-> Lens GetDeviceProfile GetDeviceProfile Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeviceProfile' {Text
id :: Text
$sel:id:GetDeviceProfile' :: GetDeviceProfile -> Text
id} -> Text
id) (\s :: GetDeviceProfile
s@GetDeviceProfile' {} Text
a -> GetDeviceProfile
s {$sel:id:GetDeviceProfile' :: Text
id = Text
a} :: GetDeviceProfile)
instance Core.AWSRequest GetDeviceProfile where
type
AWSResponse GetDeviceProfile =
GetDeviceProfileResponse
request :: GetDeviceProfile -> Request GetDeviceProfile
request = Service -> GetDeviceProfile -> Request GetDeviceProfile
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetDeviceProfile
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetDeviceProfile)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetDeviceProfile))
-> Logger
-> Service
-> Proxy GetDeviceProfile
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetDeviceProfile)))
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 Text
-> Maybe LoRaWANDeviceProfile
-> Maybe Text
-> Maybe Text
-> Int
-> GetDeviceProfileResponse
GetDeviceProfileResponse'
(Maybe Text
-> Maybe LoRaWANDeviceProfile
-> Maybe Text
-> Maybe Text
-> Int
-> GetDeviceProfileResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe LoRaWANDeviceProfile
-> Maybe Text -> Maybe Text -> Int -> GetDeviceProfileResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Arn")
Either
String
(Maybe LoRaWANDeviceProfile
-> Maybe Text -> Maybe Text -> Int -> GetDeviceProfileResponse)
-> Either String (Maybe LoRaWANDeviceProfile)
-> Either
String
(Maybe Text -> Maybe Text -> Int -> GetDeviceProfileResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe LoRaWANDeviceProfile)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LoRaWAN")
Either
String
(Maybe Text -> Maybe Text -> Int -> GetDeviceProfileResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> GetDeviceProfileResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Name")
Either String (Maybe Text -> Int -> GetDeviceProfileResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetDeviceProfileResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Id")
Either String (Int -> GetDeviceProfileResponse)
-> Either String Int -> Either String GetDeviceProfileResponse
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 GetDeviceProfile
instance Prelude.NFData GetDeviceProfile
instance Core.ToHeaders GetDeviceProfile where
toHeaders :: GetDeviceProfile -> ResponseHeaders
toHeaders = ResponseHeaders -> GetDeviceProfile -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath GetDeviceProfile where
toPath :: GetDeviceProfile -> ByteString
toPath GetDeviceProfile' {Text
id :: Text
$sel:id:GetDeviceProfile' :: GetDeviceProfile -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/device-profiles/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
id]
instance Core.ToQuery GetDeviceProfile where
toQuery :: GetDeviceProfile -> QueryString
toQuery = QueryString -> GetDeviceProfile -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetDeviceProfileResponse = GetDeviceProfileResponse'
{
GetDeviceProfileResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
GetDeviceProfileResponse -> Maybe LoRaWANDeviceProfile
loRaWAN :: Prelude.Maybe LoRaWANDeviceProfile,
GetDeviceProfileResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
GetDeviceProfileResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
GetDeviceProfileResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetDeviceProfileResponse -> GetDeviceProfileResponse -> Bool
(GetDeviceProfileResponse -> GetDeviceProfileResponse -> Bool)
-> (GetDeviceProfileResponse -> GetDeviceProfileResponse -> Bool)
-> Eq GetDeviceProfileResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetDeviceProfileResponse -> GetDeviceProfileResponse -> Bool
$c/= :: GetDeviceProfileResponse -> GetDeviceProfileResponse -> Bool
== :: GetDeviceProfileResponse -> GetDeviceProfileResponse -> Bool
$c== :: GetDeviceProfileResponse -> GetDeviceProfileResponse -> Bool
Prelude.Eq, ReadPrec [GetDeviceProfileResponse]
ReadPrec GetDeviceProfileResponse
Int -> ReadS GetDeviceProfileResponse
ReadS [GetDeviceProfileResponse]
(Int -> ReadS GetDeviceProfileResponse)
-> ReadS [GetDeviceProfileResponse]
-> ReadPrec GetDeviceProfileResponse
-> ReadPrec [GetDeviceProfileResponse]
-> Read GetDeviceProfileResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetDeviceProfileResponse]
$creadListPrec :: ReadPrec [GetDeviceProfileResponse]
readPrec :: ReadPrec GetDeviceProfileResponse
$creadPrec :: ReadPrec GetDeviceProfileResponse
readList :: ReadS [GetDeviceProfileResponse]
$creadList :: ReadS [GetDeviceProfileResponse]
readsPrec :: Int -> ReadS GetDeviceProfileResponse
$creadsPrec :: Int -> ReadS GetDeviceProfileResponse
Prelude.Read, Int -> GetDeviceProfileResponse -> ShowS
[GetDeviceProfileResponse] -> ShowS
GetDeviceProfileResponse -> String
(Int -> GetDeviceProfileResponse -> ShowS)
-> (GetDeviceProfileResponse -> String)
-> ([GetDeviceProfileResponse] -> ShowS)
-> Show GetDeviceProfileResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetDeviceProfileResponse] -> ShowS
$cshowList :: [GetDeviceProfileResponse] -> ShowS
show :: GetDeviceProfileResponse -> String
$cshow :: GetDeviceProfileResponse -> String
showsPrec :: Int -> GetDeviceProfileResponse -> ShowS
$cshowsPrec :: Int -> GetDeviceProfileResponse -> ShowS
Prelude.Show, (forall x.
GetDeviceProfileResponse -> Rep GetDeviceProfileResponse x)
-> (forall x.
Rep GetDeviceProfileResponse x -> GetDeviceProfileResponse)
-> Generic GetDeviceProfileResponse
forall x.
Rep GetDeviceProfileResponse x -> GetDeviceProfileResponse
forall x.
GetDeviceProfileResponse -> Rep GetDeviceProfileResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetDeviceProfileResponse x -> GetDeviceProfileResponse
$cfrom :: forall x.
GetDeviceProfileResponse -> Rep GetDeviceProfileResponse x
Prelude.Generic)
newGetDeviceProfileResponse ::
Prelude.Int ->
GetDeviceProfileResponse
newGetDeviceProfileResponse :: Int -> GetDeviceProfileResponse
newGetDeviceProfileResponse Int
pHttpStatus_ =
GetDeviceProfileResponse' :: Maybe Text
-> Maybe LoRaWANDeviceProfile
-> Maybe Text
-> Maybe Text
-> Int
-> GetDeviceProfileResponse
GetDeviceProfileResponse'
{ $sel:arn:GetDeviceProfileResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:loRaWAN:GetDeviceProfileResponse' :: Maybe LoRaWANDeviceProfile
loRaWAN = Maybe LoRaWANDeviceProfile
forall a. Maybe a
Prelude.Nothing,
$sel:name:GetDeviceProfileResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:GetDeviceProfileResponse' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetDeviceProfileResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getDeviceProfileResponse_arn :: Lens.Lens' GetDeviceProfileResponse (Prelude.Maybe Prelude.Text)
getDeviceProfileResponse_arn :: (Maybe Text -> f (Maybe Text))
-> GetDeviceProfileResponse -> f GetDeviceProfileResponse
getDeviceProfileResponse_arn = (GetDeviceProfileResponse -> Maybe Text)
-> (GetDeviceProfileResponse
-> Maybe Text -> GetDeviceProfileResponse)
-> Lens
GetDeviceProfileResponse
GetDeviceProfileResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeviceProfileResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:GetDeviceProfileResponse' :: GetDeviceProfileResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: GetDeviceProfileResponse
s@GetDeviceProfileResponse' {} Maybe Text
a -> GetDeviceProfileResponse
s {$sel:arn:GetDeviceProfileResponse' :: Maybe Text
arn = Maybe Text
a} :: GetDeviceProfileResponse)
getDeviceProfileResponse_loRaWAN :: Lens.Lens' GetDeviceProfileResponse (Prelude.Maybe LoRaWANDeviceProfile)
getDeviceProfileResponse_loRaWAN :: (Maybe LoRaWANDeviceProfile -> f (Maybe LoRaWANDeviceProfile))
-> GetDeviceProfileResponse -> f GetDeviceProfileResponse
getDeviceProfileResponse_loRaWAN = (GetDeviceProfileResponse -> Maybe LoRaWANDeviceProfile)
-> (GetDeviceProfileResponse
-> Maybe LoRaWANDeviceProfile -> GetDeviceProfileResponse)
-> Lens
GetDeviceProfileResponse
GetDeviceProfileResponse
(Maybe LoRaWANDeviceProfile)
(Maybe LoRaWANDeviceProfile)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeviceProfileResponse' {Maybe LoRaWANDeviceProfile
loRaWAN :: Maybe LoRaWANDeviceProfile
$sel:loRaWAN:GetDeviceProfileResponse' :: GetDeviceProfileResponse -> Maybe LoRaWANDeviceProfile
loRaWAN} -> Maybe LoRaWANDeviceProfile
loRaWAN) (\s :: GetDeviceProfileResponse
s@GetDeviceProfileResponse' {} Maybe LoRaWANDeviceProfile
a -> GetDeviceProfileResponse
s {$sel:loRaWAN:GetDeviceProfileResponse' :: Maybe LoRaWANDeviceProfile
loRaWAN = Maybe LoRaWANDeviceProfile
a} :: GetDeviceProfileResponse)
getDeviceProfileResponse_name :: Lens.Lens' GetDeviceProfileResponse (Prelude.Maybe Prelude.Text)
getDeviceProfileResponse_name :: (Maybe Text -> f (Maybe Text))
-> GetDeviceProfileResponse -> f GetDeviceProfileResponse
getDeviceProfileResponse_name = (GetDeviceProfileResponse -> Maybe Text)
-> (GetDeviceProfileResponse
-> Maybe Text -> GetDeviceProfileResponse)
-> Lens
GetDeviceProfileResponse
GetDeviceProfileResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeviceProfileResponse' {Maybe Text
name :: Maybe Text
$sel:name:GetDeviceProfileResponse' :: GetDeviceProfileResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: GetDeviceProfileResponse
s@GetDeviceProfileResponse' {} Maybe Text
a -> GetDeviceProfileResponse
s {$sel:name:GetDeviceProfileResponse' :: Maybe Text
name = Maybe Text
a} :: GetDeviceProfileResponse)
getDeviceProfileResponse_id :: Lens.Lens' GetDeviceProfileResponse (Prelude.Maybe Prelude.Text)
getDeviceProfileResponse_id :: (Maybe Text -> f (Maybe Text))
-> GetDeviceProfileResponse -> f GetDeviceProfileResponse
getDeviceProfileResponse_id = (GetDeviceProfileResponse -> Maybe Text)
-> (GetDeviceProfileResponse
-> Maybe Text -> GetDeviceProfileResponse)
-> Lens
GetDeviceProfileResponse
GetDeviceProfileResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeviceProfileResponse' {Maybe Text
id :: Maybe Text
$sel:id:GetDeviceProfileResponse' :: GetDeviceProfileResponse -> Maybe Text
id} -> Maybe Text
id) (\s :: GetDeviceProfileResponse
s@GetDeviceProfileResponse' {} Maybe Text
a -> GetDeviceProfileResponse
s {$sel:id:GetDeviceProfileResponse' :: Maybe Text
id = Maybe Text
a} :: GetDeviceProfileResponse)
getDeviceProfileResponse_httpStatus :: Lens.Lens' GetDeviceProfileResponse Prelude.Int
getDeviceProfileResponse_httpStatus :: (Int -> f Int)
-> GetDeviceProfileResponse -> f GetDeviceProfileResponse
getDeviceProfileResponse_httpStatus = (GetDeviceProfileResponse -> Int)
-> (GetDeviceProfileResponse -> Int -> GetDeviceProfileResponse)
-> Lens GetDeviceProfileResponse GetDeviceProfileResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetDeviceProfileResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetDeviceProfileResponse' :: GetDeviceProfileResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetDeviceProfileResponse
s@GetDeviceProfileResponse' {} Int
a -> GetDeviceProfileResponse
s {$sel:httpStatus:GetDeviceProfileResponse' :: Int
httpStatus = Int
a} :: GetDeviceProfileResponse)
instance Prelude.NFData GetDeviceProfileResponse