{-# 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.GetMulticastGroup
(
GetMulticastGroup (..),
newGetMulticastGroup,
getMulticastGroup_id,
GetMulticastGroupResponse (..),
newGetMulticastGroupResponse,
getMulticastGroupResponse_arn,
getMulticastGroupResponse_createdAt,
getMulticastGroupResponse_description,
getMulticastGroupResponse_id,
getMulticastGroupResponse_loRaWAN,
getMulticastGroupResponse_name,
getMulticastGroupResponse_status,
getMulticastGroupResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTWireless.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetMulticastGroup = GetMulticastGroup'
{ GetMulticastGroup -> Text
id :: Prelude.Text
}
deriving (GetMulticastGroup -> GetMulticastGroup -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetMulticastGroup -> GetMulticastGroup -> Bool
$c/= :: GetMulticastGroup -> GetMulticastGroup -> Bool
== :: GetMulticastGroup -> GetMulticastGroup -> Bool
$c== :: GetMulticastGroup -> GetMulticastGroup -> Bool
Prelude.Eq, ReadPrec [GetMulticastGroup]
ReadPrec GetMulticastGroup
Int -> ReadS GetMulticastGroup
ReadS [GetMulticastGroup]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetMulticastGroup]
$creadListPrec :: ReadPrec [GetMulticastGroup]
readPrec :: ReadPrec GetMulticastGroup
$creadPrec :: ReadPrec GetMulticastGroup
readList :: ReadS [GetMulticastGroup]
$creadList :: ReadS [GetMulticastGroup]
readsPrec :: Int -> ReadS GetMulticastGroup
$creadsPrec :: Int -> ReadS GetMulticastGroup
Prelude.Read, Int -> GetMulticastGroup -> ShowS
[GetMulticastGroup] -> ShowS
GetMulticastGroup -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetMulticastGroup] -> ShowS
$cshowList :: [GetMulticastGroup] -> ShowS
show :: GetMulticastGroup -> String
$cshow :: GetMulticastGroup -> String
showsPrec :: Int -> GetMulticastGroup -> ShowS
$cshowsPrec :: Int -> GetMulticastGroup -> ShowS
Prelude.Show, forall x. Rep GetMulticastGroup x -> GetMulticastGroup
forall x. GetMulticastGroup -> Rep GetMulticastGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetMulticastGroup x -> GetMulticastGroup
$cfrom :: forall x. GetMulticastGroup -> Rep GetMulticastGroup x
Prelude.Generic)
newGetMulticastGroup ::
Prelude.Text ->
GetMulticastGroup
newGetMulticastGroup :: Text -> GetMulticastGroup
newGetMulticastGroup Text
pId_ =
GetMulticastGroup' {$sel:id:GetMulticastGroup' :: Text
id = Text
pId_}
getMulticastGroup_id :: Lens.Lens' GetMulticastGroup Prelude.Text
getMulticastGroup_id :: Lens' GetMulticastGroup Text
getMulticastGroup_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMulticastGroup' {Text
id :: Text
$sel:id:GetMulticastGroup' :: GetMulticastGroup -> Text
id} -> Text
id) (\s :: GetMulticastGroup
s@GetMulticastGroup' {} Text
a -> GetMulticastGroup
s {$sel:id:GetMulticastGroup' :: Text
id = Text
a} :: GetMulticastGroup)
instance Core.AWSRequest GetMulticastGroup where
type
AWSResponse GetMulticastGroup =
GetMulticastGroupResponse
request :: (Service -> Service)
-> GetMulticastGroup -> Request GetMulticastGroup
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetMulticastGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetMulticastGroup)))
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 POSIX
-> Maybe Text
-> Maybe Text
-> Maybe LoRaWANMulticastGet
-> Maybe Text
-> Maybe Text
-> Int
-> GetMulticastGroupResponse
GetMulticastGroupResponse'
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
"Arn")
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
"CreatedAt")
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
"Description")
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
"Id")
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
"LoRaWAN")
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
"Name")
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
"Status")
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 GetMulticastGroup where
hashWithSalt :: Int -> GetMulticastGroup -> Int
hashWithSalt Int
_salt GetMulticastGroup' {Text
id :: Text
$sel:id:GetMulticastGroup' :: GetMulticastGroup -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
instance Prelude.NFData GetMulticastGroup where
rnf :: GetMulticastGroup -> ()
rnf GetMulticastGroup' {Text
id :: Text
$sel:id:GetMulticastGroup' :: GetMulticastGroup -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
id
instance Data.ToHeaders GetMulticastGroup where
toHeaders :: GetMulticastGroup -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath GetMulticastGroup where
toPath :: GetMulticastGroup -> ByteString
toPath GetMulticastGroup' {Text
id :: Text
$sel:id:GetMulticastGroup' :: GetMulticastGroup -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/multicast-groups/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
id]
instance Data.ToQuery GetMulticastGroup where
toQuery :: GetMulticastGroup -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetMulticastGroupResponse = GetMulticastGroupResponse'
{ GetMulticastGroupResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
GetMulticastGroupResponse -> Maybe POSIX
createdAt :: Prelude.Maybe Data.POSIX,
GetMulticastGroupResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
GetMulticastGroupResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
GetMulticastGroupResponse -> Maybe LoRaWANMulticastGet
loRaWAN :: Prelude.Maybe LoRaWANMulticastGet,
GetMulticastGroupResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
GetMulticastGroupResponse -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
GetMulticastGroupResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetMulticastGroupResponse -> GetMulticastGroupResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetMulticastGroupResponse -> GetMulticastGroupResponse -> Bool
$c/= :: GetMulticastGroupResponse -> GetMulticastGroupResponse -> Bool
== :: GetMulticastGroupResponse -> GetMulticastGroupResponse -> Bool
$c== :: GetMulticastGroupResponse -> GetMulticastGroupResponse -> Bool
Prelude.Eq, ReadPrec [GetMulticastGroupResponse]
ReadPrec GetMulticastGroupResponse
Int -> ReadS GetMulticastGroupResponse
ReadS [GetMulticastGroupResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetMulticastGroupResponse]
$creadListPrec :: ReadPrec [GetMulticastGroupResponse]
readPrec :: ReadPrec GetMulticastGroupResponse
$creadPrec :: ReadPrec GetMulticastGroupResponse
readList :: ReadS [GetMulticastGroupResponse]
$creadList :: ReadS [GetMulticastGroupResponse]
readsPrec :: Int -> ReadS GetMulticastGroupResponse
$creadsPrec :: Int -> ReadS GetMulticastGroupResponse
Prelude.Read, Int -> GetMulticastGroupResponse -> ShowS
[GetMulticastGroupResponse] -> ShowS
GetMulticastGroupResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetMulticastGroupResponse] -> ShowS
$cshowList :: [GetMulticastGroupResponse] -> ShowS
show :: GetMulticastGroupResponse -> String
$cshow :: GetMulticastGroupResponse -> String
showsPrec :: Int -> GetMulticastGroupResponse -> ShowS
$cshowsPrec :: Int -> GetMulticastGroupResponse -> ShowS
Prelude.Show, forall x.
Rep GetMulticastGroupResponse x -> GetMulticastGroupResponse
forall x.
GetMulticastGroupResponse -> Rep GetMulticastGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetMulticastGroupResponse x -> GetMulticastGroupResponse
$cfrom :: forall x.
GetMulticastGroupResponse -> Rep GetMulticastGroupResponse x
Prelude.Generic)
newGetMulticastGroupResponse ::
Prelude.Int ->
GetMulticastGroupResponse
newGetMulticastGroupResponse :: Int -> GetMulticastGroupResponse
newGetMulticastGroupResponse Int
pHttpStatus_ =
GetMulticastGroupResponse'
{ $sel:arn:GetMulticastGroupResponse' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:createdAt:GetMulticastGroupResponse' :: Maybe POSIX
createdAt = forall a. Maybe a
Prelude.Nothing,
$sel:description:GetMulticastGroupResponse' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
$sel:id:GetMulticastGroupResponse' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
$sel:loRaWAN:GetMulticastGroupResponse' :: Maybe LoRaWANMulticastGet
loRaWAN = forall a. Maybe a
Prelude.Nothing,
$sel:name:GetMulticastGroupResponse' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:status:GetMulticastGroupResponse' :: Maybe Text
status = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetMulticastGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getMulticastGroupResponse_arn :: Lens.Lens' GetMulticastGroupResponse (Prelude.Maybe Prelude.Text)
getMulticastGroupResponse_arn :: Lens' GetMulticastGroupResponse (Maybe Text)
getMulticastGroupResponse_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMulticastGroupResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:GetMulticastGroupResponse' :: GetMulticastGroupResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: GetMulticastGroupResponse
s@GetMulticastGroupResponse' {} Maybe Text
a -> GetMulticastGroupResponse
s {$sel:arn:GetMulticastGroupResponse' :: Maybe Text
arn = Maybe Text
a} :: GetMulticastGroupResponse)
getMulticastGroupResponse_createdAt :: Lens.Lens' GetMulticastGroupResponse (Prelude.Maybe Prelude.UTCTime)
getMulticastGroupResponse_createdAt :: Lens' GetMulticastGroupResponse (Maybe UTCTime)
getMulticastGroupResponse_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMulticastGroupResponse' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:GetMulticastGroupResponse' :: GetMulticastGroupResponse -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: GetMulticastGroupResponse
s@GetMulticastGroupResponse' {} Maybe POSIX
a -> GetMulticastGroupResponse
s {$sel:createdAt:GetMulticastGroupResponse' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: GetMulticastGroupResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
getMulticastGroupResponse_description :: Lens.Lens' GetMulticastGroupResponse (Prelude.Maybe Prelude.Text)
getMulticastGroupResponse_description :: Lens' GetMulticastGroupResponse (Maybe Text)
getMulticastGroupResponse_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMulticastGroupResponse' {Maybe Text
description :: Maybe Text
$sel:description:GetMulticastGroupResponse' :: GetMulticastGroupResponse -> Maybe Text
description} -> Maybe Text
description) (\s :: GetMulticastGroupResponse
s@GetMulticastGroupResponse' {} Maybe Text
a -> GetMulticastGroupResponse
s {$sel:description:GetMulticastGroupResponse' :: Maybe Text
description = Maybe Text
a} :: GetMulticastGroupResponse)
getMulticastGroupResponse_id :: Lens.Lens' GetMulticastGroupResponse (Prelude.Maybe Prelude.Text)
getMulticastGroupResponse_id :: Lens' GetMulticastGroupResponse (Maybe Text)
getMulticastGroupResponse_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMulticastGroupResponse' {Maybe Text
id :: Maybe Text
$sel:id:GetMulticastGroupResponse' :: GetMulticastGroupResponse -> Maybe Text
id} -> Maybe Text
id) (\s :: GetMulticastGroupResponse
s@GetMulticastGroupResponse' {} Maybe Text
a -> GetMulticastGroupResponse
s {$sel:id:GetMulticastGroupResponse' :: Maybe Text
id = Maybe Text
a} :: GetMulticastGroupResponse)
getMulticastGroupResponse_loRaWAN :: Lens.Lens' GetMulticastGroupResponse (Prelude.Maybe LoRaWANMulticastGet)
getMulticastGroupResponse_loRaWAN :: Lens' GetMulticastGroupResponse (Maybe LoRaWANMulticastGet)
getMulticastGroupResponse_loRaWAN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMulticastGroupResponse' {Maybe LoRaWANMulticastGet
loRaWAN :: Maybe LoRaWANMulticastGet
$sel:loRaWAN:GetMulticastGroupResponse' :: GetMulticastGroupResponse -> Maybe LoRaWANMulticastGet
loRaWAN} -> Maybe LoRaWANMulticastGet
loRaWAN) (\s :: GetMulticastGroupResponse
s@GetMulticastGroupResponse' {} Maybe LoRaWANMulticastGet
a -> GetMulticastGroupResponse
s {$sel:loRaWAN:GetMulticastGroupResponse' :: Maybe LoRaWANMulticastGet
loRaWAN = Maybe LoRaWANMulticastGet
a} :: GetMulticastGroupResponse)
getMulticastGroupResponse_name :: Lens.Lens' GetMulticastGroupResponse (Prelude.Maybe Prelude.Text)
getMulticastGroupResponse_name :: Lens' GetMulticastGroupResponse (Maybe Text)
getMulticastGroupResponse_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMulticastGroupResponse' {Maybe Text
name :: Maybe Text
$sel:name:GetMulticastGroupResponse' :: GetMulticastGroupResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: GetMulticastGroupResponse
s@GetMulticastGroupResponse' {} Maybe Text
a -> GetMulticastGroupResponse
s {$sel:name:GetMulticastGroupResponse' :: Maybe Text
name = Maybe Text
a} :: GetMulticastGroupResponse)
getMulticastGroupResponse_status :: Lens.Lens' GetMulticastGroupResponse (Prelude.Maybe Prelude.Text)
getMulticastGroupResponse_status :: Lens' GetMulticastGroupResponse (Maybe Text)
getMulticastGroupResponse_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMulticastGroupResponse' {Maybe Text
status :: Maybe Text
$sel:status:GetMulticastGroupResponse' :: GetMulticastGroupResponse -> Maybe Text
status} -> Maybe Text
status) (\s :: GetMulticastGroupResponse
s@GetMulticastGroupResponse' {} Maybe Text
a -> GetMulticastGroupResponse
s {$sel:status:GetMulticastGroupResponse' :: Maybe Text
status = Maybe Text
a} :: GetMulticastGroupResponse)
getMulticastGroupResponse_httpStatus :: Lens.Lens' GetMulticastGroupResponse Prelude.Int
getMulticastGroupResponse_httpStatus :: Lens' GetMulticastGroupResponse Int
getMulticastGroupResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMulticastGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetMulticastGroupResponse' :: GetMulticastGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetMulticastGroupResponse
s@GetMulticastGroupResponse' {} Int
a -> GetMulticastGroupResponse
s {$sel:httpStatus:GetMulticastGroupResponse' :: Int
httpStatus = Int
a} :: GetMulticastGroupResponse)
instance Prelude.NFData GetMulticastGroupResponse where
rnf :: GetMulticastGroupResponse -> ()
rnf GetMulticastGroupResponse' {Int
Maybe Text
Maybe POSIX
Maybe LoRaWANMulticastGet
httpStatus :: Int
status :: Maybe Text
name :: Maybe Text
loRaWAN :: Maybe LoRaWANMulticastGet
id :: Maybe Text
description :: Maybe Text
createdAt :: Maybe POSIX
arn :: Maybe Text
$sel:httpStatus:GetMulticastGroupResponse' :: GetMulticastGroupResponse -> Int
$sel:status:GetMulticastGroupResponse' :: GetMulticastGroupResponse -> Maybe Text
$sel:name:GetMulticastGroupResponse' :: GetMulticastGroupResponse -> Maybe Text
$sel:loRaWAN:GetMulticastGroupResponse' :: GetMulticastGroupResponse -> Maybe LoRaWANMulticastGet
$sel:id:GetMulticastGroupResponse' :: GetMulticastGroupResponse -> Maybe Text
$sel:description:GetMulticastGroupResponse' :: GetMulticastGroupResponse -> Maybe Text
$sel:createdAt:GetMulticastGroupResponse' :: GetMulticastGroupResponse -> Maybe POSIX
$sel:arn:GetMulticastGroupResponse' :: GetMulticastGroupResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdAt
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LoRaWANMulticastGet
loRaWAN
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
status
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus