{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.IoTWireless.Types.SidewalkListDevice where
import qualified Amazonka.Core as Core
import Amazonka.IoTWireless.Types.CertificateList
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SidewalkListDevice = SidewalkListDevice'
{
SidewalkListDevice -> Maybe Text
sidewalkManufacturingSn :: Prelude.Maybe Prelude.Text,
SidewalkListDevice -> Maybe Text
amazonId :: Prelude.Maybe Prelude.Text,
SidewalkListDevice -> Maybe [CertificateList]
deviceCertificates :: Prelude.Maybe [CertificateList],
SidewalkListDevice -> Maybe Text
sidewalkId :: Prelude.Maybe Prelude.Text
}
deriving (SidewalkListDevice -> SidewalkListDevice -> Bool
(SidewalkListDevice -> SidewalkListDevice -> Bool)
-> (SidewalkListDevice -> SidewalkListDevice -> Bool)
-> Eq SidewalkListDevice
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SidewalkListDevice -> SidewalkListDevice -> Bool
$c/= :: SidewalkListDevice -> SidewalkListDevice -> Bool
== :: SidewalkListDevice -> SidewalkListDevice -> Bool
$c== :: SidewalkListDevice -> SidewalkListDevice -> Bool
Prelude.Eq, ReadPrec [SidewalkListDevice]
ReadPrec SidewalkListDevice
Int -> ReadS SidewalkListDevice
ReadS [SidewalkListDevice]
(Int -> ReadS SidewalkListDevice)
-> ReadS [SidewalkListDevice]
-> ReadPrec SidewalkListDevice
-> ReadPrec [SidewalkListDevice]
-> Read SidewalkListDevice
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SidewalkListDevice]
$creadListPrec :: ReadPrec [SidewalkListDevice]
readPrec :: ReadPrec SidewalkListDevice
$creadPrec :: ReadPrec SidewalkListDevice
readList :: ReadS [SidewalkListDevice]
$creadList :: ReadS [SidewalkListDevice]
readsPrec :: Int -> ReadS SidewalkListDevice
$creadsPrec :: Int -> ReadS SidewalkListDevice
Prelude.Read, Int -> SidewalkListDevice -> ShowS
[SidewalkListDevice] -> ShowS
SidewalkListDevice -> String
(Int -> SidewalkListDevice -> ShowS)
-> (SidewalkListDevice -> String)
-> ([SidewalkListDevice] -> ShowS)
-> Show SidewalkListDevice
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SidewalkListDevice] -> ShowS
$cshowList :: [SidewalkListDevice] -> ShowS
show :: SidewalkListDevice -> String
$cshow :: SidewalkListDevice -> String
showsPrec :: Int -> SidewalkListDevice -> ShowS
$cshowsPrec :: Int -> SidewalkListDevice -> ShowS
Prelude.Show, (forall x. SidewalkListDevice -> Rep SidewalkListDevice x)
-> (forall x. Rep SidewalkListDevice x -> SidewalkListDevice)
-> Generic SidewalkListDevice
forall x. Rep SidewalkListDevice x -> SidewalkListDevice
forall x. SidewalkListDevice -> Rep SidewalkListDevice x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SidewalkListDevice x -> SidewalkListDevice
$cfrom :: forall x. SidewalkListDevice -> Rep SidewalkListDevice x
Prelude.Generic)
newSidewalkListDevice ::
SidewalkListDevice
newSidewalkListDevice :: SidewalkListDevice
newSidewalkListDevice =
SidewalkListDevice' :: Maybe Text
-> Maybe Text
-> Maybe [CertificateList]
-> Maybe Text
-> SidewalkListDevice
SidewalkListDevice'
{ $sel:sidewalkManufacturingSn:SidewalkListDevice' :: Maybe Text
sidewalkManufacturingSn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:amazonId:SidewalkListDevice' :: Maybe Text
amazonId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:deviceCertificates:SidewalkListDevice' :: Maybe [CertificateList]
deviceCertificates = Maybe [CertificateList]
forall a. Maybe a
Prelude.Nothing,
$sel:sidewalkId:SidewalkListDevice' :: Maybe Text
sidewalkId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
sidewalkListDevice_sidewalkManufacturingSn :: Lens.Lens' SidewalkListDevice (Prelude.Maybe Prelude.Text)
sidewalkListDevice_sidewalkManufacturingSn :: (Maybe Text -> f (Maybe Text))
-> SidewalkListDevice -> f SidewalkListDevice
sidewalkListDevice_sidewalkManufacturingSn = (SidewalkListDevice -> Maybe Text)
-> (SidewalkListDevice -> Maybe Text -> SidewalkListDevice)
-> Lens
SidewalkListDevice SidewalkListDevice (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SidewalkListDevice' {Maybe Text
sidewalkManufacturingSn :: Maybe Text
$sel:sidewalkManufacturingSn:SidewalkListDevice' :: SidewalkListDevice -> Maybe Text
sidewalkManufacturingSn} -> Maybe Text
sidewalkManufacturingSn) (\s :: SidewalkListDevice
s@SidewalkListDevice' {} Maybe Text
a -> SidewalkListDevice
s {$sel:sidewalkManufacturingSn:SidewalkListDevice' :: Maybe Text
sidewalkManufacturingSn = Maybe Text
a} :: SidewalkListDevice)
sidewalkListDevice_amazonId :: Lens.Lens' SidewalkListDevice (Prelude.Maybe Prelude.Text)
sidewalkListDevice_amazonId :: (Maybe Text -> f (Maybe Text))
-> SidewalkListDevice -> f SidewalkListDevice
sidewalkListDevice_amazonId = (SidewalkListDevice -> Maybe Text)
-> (SidewalkListDevice -> Maybe Text -> SidewalkListDevice)
-> Lens
SidewalkListDevice SidewalkListDevice (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SidewalkListDevice' {Maybe Text
amazonId :: Maybe Text
$sel:amazonId:SidewalkListDevice' :: SidewalkListDevice -> Maybe Text
amazonId} -> Maybe Text
amazonId) (\s :: SidewalkListDevice
s@SidewalkListDevice' {} Maybe Text
a -> SidewalkListDevice
s {$sel:amazonId:SidewalkListDevice' :: Maybe Text
amazonId = Maybe Text
a} :: SidewalkListDevice)
sidewalkListDevice_deviceCertificates :: Lens.Lens' SidewalkListDevice (Prelude.Maybe [CertificateList])
sidewalkListDevice_deviceCertificates :: (Maybe [CertificateList] -> f (Maybe [CertificateList]))
-> SidewalkListDevice -> f SidewalkListDevice
sidewalkListDevice_deviceCertificates = (SidewalkListDevice -> Maybe [CertificateList])
-> (SidewalkListDevice
-> Maybe [CertificateList] -> SidewalkListDevice)
-> Lens
SidewalkListDevice
SidewalkListDevice
(Maybe [CertificateList])
(Maybe [CertificateList])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SidewalkListDevice' {Maybe [CertificateList]
deviceCertificates :: Maybe [CertificateList]
$sel:deviceCertificates:SidewalkListDevice' :: SidewalkListDevice -> Maybe [CertificateList]
deviceCertificates} -> Maybe [CertificateList]
deviceCertificates) (\s :: SidewalkListDevice
s@SidewalkListDevice' {} Maybe [CertificateList]
a -> SidewalkListDevice
s {$sel:deviceCertificates:SidewalkListDevice' :: Maybe [CertificateList]
deviceCertificates = Maybe [CertificateList]
a} :: SidewalkListDevice) ((Maybe [CertificateList] -> f (Maybe [CertificateList]))
-> SidewalkListDevice -> f SidewalkListDevice)
-> ((Maybe [CertificateList] -> f (Maybe [CertificateList]))
-> Maybe [CertificateList] -> f (Maybe [CertificateList]))
-> (Maybe [CertificateList] -> f (Maybe [CertificateList]))
-> SidewalkListDevice
-> f SidewalkListDevice
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[CertificateList]
[CertificateList]
[CertificateList]
[CertificateList]
-> Iso
(Maybe [CertificateList])
(Maybe [CertificateList])
(Maybe [CertificateList])
(Maybe [CertificateList])
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 AnIso
[CertificateList]
[CertificateList]
[CertificateList]
[CertificateList]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
sidewalkListDevice_sidewalkId :: Lens.Lens' SidewalkListDevice (Prelude.Maybe Prelude.Text)
sidewalkListDevice_sidewalkId :: (Maybe Text -> f (Maybe Text))
-> SidewalkListDevice -> f SidewalkListDevice
sidewalkListDevice_sidewalkId = (SidewalkListDevice -> Maybe Text)
-> (SidewalkListDevice -> Maybe Text -> SidewalkListDevice)
-> Lens
SidewalkListDevice SidewalkListDevice (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SidewalkListDevice' {Maybe Text
sidewalkId :: Maybe Text
$sel:sidewalkId:SidewalkListDevice' :: SidewalkListDevice -> Maybe Text
sidewalkId} -> Maybe Text
sidewalkId) (\s :: SidewalkListDevice
s@SidewalkListDevice' {} Maybe Text
a -> SidewalkListDevice
s {$sel:sidewalkId:SidewalkListDevice' :: Maybe Text
sidewalkId = Maybe Text
a} :: SidewalkListDevice)
instance Core.FromJSON SidewalkListDevice where
parseJSON :: Value -> Parser SidewalkListDevice
parseJSON =
String
-> (Object -> Parser SidewalkListDevice)
-> Value
-> Parser SidewalkListDevice
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SidewalkListDevice"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe [CertificateList]
-> Maybe Text
-> SidewalkListDevice
SidewalkListDevice'
(Maybe Text
-> Maybe Text
-> Maybe [CertificateList]
-> Maybe Text
-> SidewalkListDevice)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe [CertificateList] -> Maybe Text -> SidewalkListDevice)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SidewalkManufacturingSn")
Parser
(Maybe Text
-> Maybe [CertificateList] -> Maybe Text -> SidewalkListDevice)
-> Parser (Maybe Text)
-> Parser
(Maybe [CertificateList] -> Maybe Text -> SidewalkListDevice)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AmazonId")
Parser
(Maybe [CertificateList] -> Maybe Text -> SidewalkListDevice)
-> Parser (Maybe [CertificateList])
-> Parser (Maybe Text -> SidewalkListDevice)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [CertificateList]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DeviceCertificates"
Parser (Maybe (Maybe [CertificateList]))
-> Maybe [CertificateList] -> Parser (Maybe [CertificateList])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [CertificateList]
forall a. Monoid a => a
Prelude.mempty
)
Parser (Maybe Text -> SidewalkListDevice)
-> Parser (Maybe Text) -> Parser SidewalkListDevice
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SidewalkId")
)
instance Prelude.Hashable SidewalkListDevice
instance Prelude.NFData SidewalkListDevice