{-# 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.IoTDeviceAdvisor.Types.DeviceUnderTest where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DeviceUnderTest = DeviceUnderTest'
{
DeviceUnderTest -> Maybe Text
certificateArn :: Prelude.Maybe Prelude.Text,
DeviceUnderTest -> Maybe Text
thingArn :: Prelude.Maybe Prelude.Text
}
deriving (DeviceUnderTest -> DeviceUnderTest -> Bool
(DeviceUnderTest -> DeviceUnderTest -> Bool)
-> (DeviceUnderTest -> DeviceUnderTest -> Bool)
-> Eq DeviceUnderTest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeviceUnderTest -> DeviceUnderTest -> Bool
$c/= :: DeviceUnderTest -> DeviceUnderTest -> Bool
== :: DeviceUnderTest -> DeviceUnderTest -> Bool
$c== :: DeviceUnderTest -> DeviceUnderTest -> Bool
Prelude.Eq, ReadPrec [DeviceUnderTest]
ReadPrec DeviceUnderTest
Int -> ReadS DeviceUnderTest
ReadS [DeviceUnderTest]
(Int -> ReadS DeviceUnderTest)
-> ReadS [DeviceUnderTest]
-> ReadPrec DeviceUnderTest
-> ReadPrec [DeviceUnderTest]
-> Read DeviceUnderTest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeviceUnderTest]
$creadListPrec :: ReadPrec [DeviceUnderTest]
readPrec :: ReadPrec DeviceUnderTest
$creadPrec :: ReadPrec DeviceUnderTest
readList :: ReadS [DeviceUnderTest]
$creadList :: ReadS [DeviceUnderTest]
readsPrec :: Int -> ReadS DeviceUnderTest
$creadsPrec :: Int -> ReadS DeviceUnderTest
Prelude.Read, Int -> DeviceUnderTest -> ShowS
[DeviceUnderTest] -> ShowS
DeviceUnderTest -> String
(Int -> DeviceUnderTest -> ShowS)
-> (DeviceUnderTest -> String)
-> ([DeviceUnderTest] -> ShowS)
-> Show DeviceUnderTest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeviceUnderTest] -> ShowS
$cshowList :: [DeviceUnderTest] -> ShowS
show :: DeviceUnderTest -> String
$cshow :: DeviceUnderTest -> String
showsPrec :: Int -> DeviceUnderTest -> ShowS
$cshowsPrec :: Int -> DeviceUnderTest -> ShowS
Prelude.Show, (forall x. DeviceUnderTest -> Rep DeviceUnderTest x)
-> (forall x. Rep DeviceUnderTest x -> DeviceUnderTest)
-> Generic DeviceUnderTest
forall x. Rep DeviceUnderTest x -> DeviceUnderTest
forall x. DeviceUnderTest -> Rep DeviceUnderTest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeviceUnderTest x -> DeviceUnderTest
$cfrom :: forall x. DeviceUnderTest -> Rep DeviceUnderTest x
Prelude.Generic)
newDeviceUnderTest ::
DeviceUnderTest
newDeviceUnderTest :: DeviceUnderTest
newDeviceUnderTest =
DeviceUnderTest' :: Maybe Text -> Maybe Text -> DeviceUnderTest
DeviceUnderTest'
{ $sel:certificateArn:DeviceUnderTest' :: Maybe Text
certificateArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:thingArn:DeviceUnderTest' :: Maybe Text
thingArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
deviceUnderTest_certificateArn :: Lens.Lens' DeviceUnderTest (Prelude.Maybe Prelude.Text)
deviceUnderTest_certificateArn :: (Maybe Text -> f (Maybe Text))
-> DeviceUnderTest -> f DeviceUnderTest
deviceUnderTest_certificateArn = (DeviceUnderTest -> Maybe Text)
-> (DeviceUnderTest -> Maybe Text -> DeviceUnderTest)
-> Lens DeviceUnderTest DeviceUnderTest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceUnderTest' {Maybe Text
certificateArn :: Maybe Text
$sel:certificateArn:DeviceUnderTest' :: DeviceUnderTest -> Maybe Text
certificateArn} -> Maybe Text
certificateArn) (\s :: DeviceUnderTest
s@DeviceUnderTest' {} Maybe Text
a -> DeviceUnderTest
s {$sel:certificateArn:DeviceUnderTest' :: Maybe Text
certificateArn = Maybe Text
a} :: DeviceUnderTest)
deviceUnderTest_thingArn :: Lens.Lens' DeviceUnderTest (Prelude.Maybe Prelude.Text)
deviceUnderTest_thingArn :: (Maybe Text -> f (Maybe Text))
-> DeviceUnderTest -> f DeviceUnderTest
deviceUnderTest_thingArn = (DeviceUnderTest -> Maybe Text)
-> (DeviceUnderTest -> Maybe Text -> DeviceUnderTest)
-> Lens DeviceUnderTest DeviceUnderTest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeviceUnderTest' {Maybe Text
thingArn :: Maybe Text
$sel:thingArn:DeviceUnderTest' :: DeviceUnderTest -> Maybe Text
thingArn} -> Maybe Text
thingArn) (\s :: DeviceUnderTest
s@DeviceUnderTest' {} Maybe Text
a -> DeviceUnderTest
s {$sel:thingArn:DeviceUnderTest' :: Maybe Text
thingArn = Maybe Text
a} :: DeviceUnderTest)
instance Core.FromJSON DeviceUnderTest where
parseJSON :: Value -> Parser DeviceUnderTest
parseJSON =
String
-> (Object -> Parser DeviceUnderTest)
-> Value
-> Parser DeviceUnderTest
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DeviceUnderTest"
( \Object
x ->
Maybe Text -> Maybe Text -> DeviceUnderTest
DeviceUnderTest'
(Maybe Text -> Maybe Text -> DeviceUnderTest)
-> Parser (Maybe Text) -> Parser (Maybe Text -> DeviceUnderTest)
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
"certificateArn")
Parser (Maybe Text -> DeviceUnderTest)
-> Parser (Maybe Text) -> Parser DeviceUnderTest
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
"thingArn")
)
instance Prelude.Hashable DeviceUnderTest
instance Prelude.NFData DeviceUnderTest
instance Core.ToJSON DeviceUnderTest where
toJSON :: DeviceUnderTest -> Value
toJSON DeviceUnderTest' {Maybe Text
thingArn :: Maybe Text
certificateArn :: Maybe Text
$sel:thingArn:DeviceUnderTest' :: DeviceUnderTest -> Maybe Text
$sel:certificateArn:DeviceUnderTest' :: DeviceUnderTest -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"certificateArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
certificateArn,
(Text
"thingArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
thingArn
]
)