{-# 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.GetServiceProfile
(
GetServiceProfile (..),
newGetServiceProfile,
getServiceProfile_id,
GetServiceProfileResponse (..),
newGetServiceProfileResponse,
getServiceProfileResponse_arn,
getServiceProfileResponse_loRaWAN,
getServiceProfileResponse_name,
getServiceProfileResponse_id,
getServiceProfileResponse_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 GetServiceProfile = GetServiceProfile'
{
GetServiceProfile -> Text
id :: Prelude.Text
}
deriving (GetServiceProfile -> GetServiceProfile -> Bool
(GetServiceProfile -> GetServiceProfile -> Bool)
-> (GetServiceProfile -> GetServiceProfile -> Bool)
-> Eq GetServiceProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetServiceProfile -> GetServiceProfile -> Bool
$c/= :: GetServiceProfile -> GetServiceProfile -> Bool
== :: GetServiceProfile -> GetServiceProfile -> Bool
$c== :: GetServiceProfile -> GetServiceProfile -> Bool
Prelude.Eq, ReadPrec [GetServiceProfile]
ReadPrec GetServiceProfile
Int -> ReadS GetServiceProfile
ReadS [GetServiceProfile]
(Int -> ReadS GetServiceProfile)
-> ReadS [GetServiceProfile]
-> ReadPrec GetServiceProfile
-> ReadPrec [GetServiceProfile]
-> Read GetServiceProfile
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetServiceProfile]
$creadListPrec :: ReadPrec [GetServiceProfile]
readPrec :: ReadPrec GetServiceProfile
$creadPrec :: ReadPrec GetServiceProfile
readList :: ReadS [GetServiceProfile]
$creadList :: ReadS [GetServiceProfile]
readsPrec :: Int -> ReadS GetServiceProfile
$creadsPrec :: Int -> ReadS GetServiceProfile
Prelude.Read, Int -> GetServiceProfile -> ShowS
[GetServiceProfile] -> ShowS
GetServiceProfile -> String
(Int -> GetServiceProfile -> ShowS)
-> (GetServiceProfile -> String)
-> ([GetServiceProfile] -> ShowS)
-> Show GetServiceProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetServiceProfile] -> ShowS
$cshowList :: [GetServiceProfile] -> ShowS
show :: GetServiceProfile -> String
$cshow :: GetServiceProfile -> String
showsPrec :: Int -> GetServiceProfile -> ShowS
$cshowsPrec :: Int -> GetServiceProfile -> ShowS
Prelude.Show, (forall x. GetServiceProfile -> Rep GetServiceProfile x)
-> (forall x. Rep GetServiceProfile x -> GetServiceProfile)
-> Generic GetServiceProfile
forall x. Rep GetServiceProfile x -> GetServiceProfile
forall x. GetServiceProfile -> Rep GetServiceProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetServiceProfile x -> GetServiceProfile
$cfrom :: forall x. GetServiceProfile -> Rep GetServiceProfile x
Prelude.Generic)
newGetServiceProfile ::
Prelude.Text ->
GetServiceProfile
newGetServiceProfile :: Text -> GetServiceProfile
newGetServiceProfile Text
pId_ =
GetServiceProfile' :: Text -> GetServiceProfile
GetServiceProfile' {$sel:id:GetServiceProfile' :: Text
id = Text
pId_}
getServiceProfile_id :: Lens.Lens' GetServiceProfile Prelude.Text
getServiceProfile_id :: (Text -> f Text) -> GetServiceProfile -> f GetServiceProfile
getServiceProfile_id = (GetServiceProfile -> Text)
-> (GetServiceProfile -> Text -> GetServiceProfile)
-> Lens GetServiceProfile GetServiceProfile Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetServiceProfile' {Text
id :: Text
$sel:id:GetServiceProfile' :: GetServiceProfile -> Text
id} -> Text
id) (\s :: GetServiceProfile
s@GetServiceProfile' {} Text
a -> GetServiceProfile
s {$sel:id:GetServiceProfile' :: Text
id = Text
a} :: GetServiceProfile)
instance Core.AWSRequest GetServiceProfile where
type
AWSResponse GetServiceProfile =
GetServiceProfileResponse
request :: GetServiceProfile -> Request GetServiceProfile
request = Service -> GetServiceProfile -> Request GetServiceProfile
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetServiceProfile
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetServiceProfile)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetServiceProfile))
-> Logger
-> Service
-> Proxy GetServiceProfile
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetServiceProfile)))
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 LoRaWANGetServiceProfileInfo
-> Maybe Text
-> Maybe Text
-> Int
-> GetServiceProfileResponse
GetServiceProfileResponse'
(Maybe Text
-> Maybe LoRaWANGetServiceProfileInfo
-> Maybe Text
-> Maybe Text
-> Int
-> GetServiceProfileResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe LoRaWANGetServiceProfileInfo
-> Maybe Text -> Maybe Text -> Int -> GetServiceProfileResponse)
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 LoRaWANGetServiceProfileInfo
-> Maybe Text -> Maybe Text -> Int -> GetServiceProfileResponse)
-> Either String (Maybe LoRaWANGetServiceProfileInfo)
-> Either
String
(Maybe Text -> Maybe Text -> Int -> GetServiceProfileResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Either String (Maybe LoRaWANGetServiceProfileInfo)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"LoRaWAN")
Either
String
(Maybe Text -> Maybe Text -> Int -> GetServiceProfileResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> GetServiceProfileResponse)
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 -> GetServiceProfileResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetServiceProfileResponse)
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 -> GetServiceProfileResponse)
-> Either String Int -> Either String GetServiceProfileResponse
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 GetServiceProfile
instance Prelude.NFData GetServiceProfile
instance Core.ToHeaders GetServiceProfile where
toHeaders :: GetServiceProfile -> ResponseHeaders
toHeaders = ResponseHeaders -> GetServiceProfile -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath GetServiceProfile where
toPath :: GetServiceProfile -> ByteString
toPath GetServiceProfile' {Text
id :: Text
$sel:id:GetServiceProfile' :: GetServiceProfile -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/service-profiles/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
id]
instance Core.ToQuery GetServiceProfile where
toQuery :: GetServiceProfile -> QueryString
toQuery = QueryString -> GetServiceProfile -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetServiceProfileResponse = GetServiceProfileResponse'
{
GetServiceProfileResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
GetServiceProfileResponse -> Maybe LoRaWANGetServiceProfileInfo
loRaWAN :: Prelude.Maybe LoRaWANGetServiceProfileInfo,
GetServiceProfileResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
GetServiceProfileResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
GetServiceProfileResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetServiceProfileResponse -> GetServiceProfileResponse -> Bool
(GetServiceProfileResponse -> GetServiceProfileResponse -> Bool)
-> (GetServiceProfileResponse -> GetServiceProfileResponse -> Bool)
-> Eq GetServiceProfileResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetServiceProfileResponse -> GetServiceProfileResponse -> Bool
$c/= :: GetServiceProfileResponse -> GetServiceProfileResponse -> Bool
== :: GetServiceProfileResponse -> GetServiceProfileResponse -> Bool
$c== :: GetServiceProfileResponse -> GetServiceProfileResponse -> Bool
Prelude.Eq, ReadPrec [GetServiceProfileResponse]
ReadPrec GetServiceProfileResponse
Int -> ReadS GetServiceProfileResponse
ReadS [GetServiceProfileResponse]
(Int -> ReadS GetServiceProfileResponse)
-> ReadS [GetServiceProfileResponse]
-> ReadPrec GetServiceProfileResponse
-> ReadPrec [GetServiceProfileResponse]
-> Read GetServiceProfileResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetServiceProfileResponse]
$creadListPrec :: ReadPrec [GetServiceProfileResponse]
readPrec :: ReadPrec GetServiceProfileResponse
$creadPrec :: ReadPrec GetServiceProfileResponse
readList :: ReadS [GetServiceProfileResponse]
$creadList :: ReadS [GetServiceProfileResponse]
readsPrec :: Int -> ReadS GetServiceProfileResponse
$creadsPrec :: Int -> ReadS GetServiceProfileResponse
Prelude.Read, Int -> GetServiceProfileResponse -> ShowS
[GetServiceProfileResponse] -> ShowS
GetServiceProfileResponse -> String
(Int -> GetServiceProfileResponse -> ShowS)
-> (GetServiceProfileResponse -> String)
-> ([GetServiceProfileResponse] -> ShowS)
-> Show GetServiceProfileResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetServiceProfileResponse] -> ShowS
$cshowList :: [GetServiceProfileResponse] -> ShowS
show :: GetServiceProfileResponse -> String
$cshow :: GetServiceProfileResponse -> String
showsPrec :: Int -> GetServiceProfileResponse -> ShowS
$cshowsPrec :: Int -> GetServiceProfileResponse -> ShowS
Prelude.Show, (forall x.
GetServiceProfileResponse -> Rep GetServiceProfileResponse x)
-> (forall x.
Rep GetServiceProfileResponse x -> GetServiceProfileResponse)
-> Generic GetServiceProfileResponse
forall x.
Rep GetServiceProfileResponse x -> GetServiceProfileResponse
forall x.
GetServiceProfileResponse -> Rep GetServiceProfileResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetServiceProfileResponse x -> GetServiceProfileResponse
$cfrom :: forall x.
GetServiceProfileResponse -> Rep GetServiceProfileResponse x
Prelude.Generic)
newGetServiceProfileResponse ::
Prelude.Int ->
GetServiceProfileResponse
newGetServiceProfileResponse :: Int -> GetServiceProfileResponse
newGetServiceProfileResponse Int
pHttpStatus_ =
GetServiceProfileResponse' :: Maybe Text
-> Maybe LoRaWANGetServiceProfileInfo
-> Maybe Text
-> Maybe Text
-> Int
-> GetServiceProfileResponse
GetServiceProfileResponse'
{ $sel:arn:GetServiceProfileResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:loRaWAN:GetServiceProfileResponse' :: Maybe LoRaWANGetServiceProfileInfo
loRaWAN = Maybe LoRaWANGetServiceProfileInfo
forall a. Maybe a
Prelude.Nothing,
$sel:name:GetServiceProfileResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:GetServiceProfileResponse' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetServiceProfileResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getServiceProfileResponse_arn :: Lens.Lens' GetServiceProfileResponse (Prelude.Maybe Prelude.Text)
getServiceProfileResponse_arn :: (Maybe Text -> f (Maybe Text))
-> GetServiceProfileResponse -> f GetServiceProfileResponse
getServiceProfileResponse_arn = (GetServiceProfileResponse -> Maybe Text)
-> (GetServiceProfileResponse
-> Maybe Text -> GetServiceProfileResponse)
-> Lens
GetServiceProfileResponse
GetServiceProfileResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetServiceProfileResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:GetServiceProfileResponse' :: GetServiceProfileResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: GetServiceProfileResponse
s@GetServiceProfileResponse' {} Maybe Text
a -> GetServiceProfileResponse
s {$sel:arn:GetServiceProfileResponse' :: Maybe Text
arn = Maybe Text
a} :: GetServiceProfileResponse)
getServiceProfileResponse_loRaWAN :: Lens.Lens' GetServiceProfileResponse (Prelude.Maybe LoRaWANGetServiceProfileInfo)
getServiceProfileResponse_loRaWAN :: (Maybe LoRaWANGetServiceProfileInfo
-> f (Maybe LoRaWANGetServiceProfileInfo))
-> GetServiceProfileResponse -> f GetServiceProfileResponse
getServiceProfileResponse_loRaWAN = (GetServiceProfileResponse -> Maybe LoRaWANGetServiceProfileInfo)
-> (GetServiceProfileResponse
-> Maybe LoRaWANGetServiceProfileInfo -> GetServiceProfileResponse)
-> Lens
GetServiceProfileResponse
GetServiceProfileResponse
(Maybe LoRaWANGetServiceProfileInfo)
(Maybe LoRaWANGetServiceProfileInfo)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetServiceProfileResponse' {Maybe LoRaWANGetServiceProfileInfo
loRaWAN :: Maybe LoRaWANGetServiceProfileInfo
$sel:loRaWAN:GetServiceProfileResponse' :: GetServiceProfileResponse -> Maybe LoRaWANGetServiceProfileInfo
loRaWAN} -> Maybe LoRaWANGetServiceProfileInfo
loRaWAN) (\s :: GetServiceProfileResponse
s@GetServiceProfileResponse' {} Maybe LoRaWANGetServiceProfileInfo
a -> GetServiceProfileResponse
s {$sel:loRaWAN:GetServiceProfileResponse' :: Maybe LoRaWANGetServiceProfileInfo
loRaWAN = Maybe LoRaWANGetServiceProfileInfo
a} :: GetServiceProfileResponse)
getServiceProfileResponse_name :: Lens.Lens' GetServiceProfileResponse (Prelude.Maybe Prelude.Text)
getServiceProfileResponse_name :: (Maybe Text -> f (Maybe Text))
-> GetServiceProfileResponse -> f GetServiceProfileResponse
getServiceProfileResponse_name = (GetServiceProfileResponse -> Maybe Text)
-> (GetServiceProfileResponse
-> Maybe Text -> GetServiceProfileResponse)
-> Lens
GetServiceProfileResponse
GetServiceProfileResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetServiceProfileResponse' {Maybe Text
name :: Maybe Text
$sel:name:GetServiceProfileResponse' :: GetServiceProfileResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: GetServiceProfileResponse
s@GetServiceProfileResponse' {} Maybe Text
a -> GetServiceProfileResponse
s {$sel:name:GetServiceProfileResponse' :: Maybe Text
name = Maybe Text
a} :: GetServiceProfileResponse)
getServiceProfileResponse_id :: Lens.Lens' GetServiceProfileResponse (Prelude.Maybe Prelude.Text)
getServiceProfileResponse_id :: (Maybe Text -> f (Maybe Text))
-> GetServiceProfileResponse -> f GetServiceProfileResponse
getServiceProfileResponse_id = (GetServiceProfileResponse -> Maybe Text)
-> (GetServiceProfileResponse
-> Maybe Text -> GetServiceProfileResponse)
-> Lens
GetServiceProfileResponse
GetServiceProfileResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetServiceProfileResponse' {Maybe Text
id :: Maybe Text
$sel:id:GetServiceProfileResponse' :: GetServiceProfileResponse -> Maybe Text
id} -> Maybe Text
id) (\s :: GetServiceProfileResponse
s@GetServiceProfileResponse' {} Maybe Text
a -> GetServiceProfileResponse
s {$sel:id:GetServiceProfileResponse' :: Maybe Text
id = Maybe Text
a} :: GetServiceProfileResponse)
getServiceProfileResponse_httpStatus :: Lens.Lens' GetServiceProfileResponse Prelude.Int
getServiceProfileResponse_httpStatus :: (Int -> f Int)
-> GetServiceProfileResponse -> f GetServiceProfileResponse
getServiceProfileResponse_httpStatus = (GetServiceProfileResponse -> Int)
-> (GetServiceProfileResponse -> Int -> GetServiceProfileResponse)
-> Lens GetServiceProfileResponse GetServiceProfileResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetServiceProfileResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetServiceProfileResponse' :: GetServiceProfileResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetServiceProfileResponse
s@GetServiceProfileResponse' {} Int
a -> GetServiceProfileResponse
s {$sel:httpStatus:GetServiceProfileResponse' :: Int
httpStatus = Int
a} :: GetServiceProfileResponse)
instance Prelude.NFData GetServiceProfileResponse