{-# 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.DeviceFarm.Types.Radios where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data Radios = Radios'
{
Radios -> Maybe Bool
bluetooth :: Prelude.Maybe Prelude.Bool,
Radios -> Maybe Bool
gps :: Prelude.Maybe Prelude.Bool,
Radios -> Maybe Bool
nfc :: Prelude.Maybe Prelude.Bool,
Radios -> Maybe Bool
wifi :: Prelude.Maybe Prelude.Bool
}
deriving (Radios -> Radios -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Radios -> Radios -> Bool
$c/= :: Radios -> Radios -> Bool
== :: Radios -> Radios -> Bool
$c== :: Radios -> Radios -> Bool
Prelude.Eq, ReadPrec [Radios]
ReadPrec Radios
Int -> ReadS Radios
ReadS [Radios]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Radios]
$creadListPrec :: ReadPrec [Radios]
readPrec :: ReadPrec Radios
$creadPrec :: ReadPrec Radios
readList :: ReadS [Radios]
$creadList :: ReadS [Radios]
readsPrec :: Int -> ReadS Radios
$creadsPrec :: Int -> ReadS Radios
Prelude.Read, Int -> Radios -> ShowS
[Radios] -> ShowS
Radios -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Radios] -> ShowS
$cshowList :: [Radios] -> ShowS
show :: Radios -> String
$cshow :: Radios -> String
showsPrec :: Int -> Radios -> ShowS
$cshowsPrec :: Int -> Radios -> ShowS
Prelude.Show, forall x. Rep Radios x -> Radios
forall x. Radios -> Rep Radios x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Radios x -> Radios
$cfrom :: forall x. Radios -> Rep Radios x
Prelude.Generic)
newRadios ::
Radios
newRadios :: Radios
newRadios =
Radios'
{ $sel:bluetooth:Radios' :: Maybe Bool
bluetooth = forall a. Maybe a
Prelude.Nothing,
$sel:gps:Radios' :: Maybe Bool
gps = forall a. Maybe a
Prelude.Nothing,
$sel:nfc:Radios' :: Maybe Bool
nfc = forall a. Maybe a
Prelude.Nothing,
$sel:wifi:Radios' :: Maybe Bool
wifi = forall a. Maybe a
Prelude.Nothing
}
radios_bluetooth :: Lens.Lens' Radios (Prelude.Maybe Prelude.Bool)
radios_bluetooth :: Lens' Radios (Maybe Bool)
radios_bluetooth = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Radios' {Maybe Bool
bluetooth :: Maybe Bool
$sel:bluetooth:Radios' :: Radios -> Maybe Bool
bluetooth} -> Maybe Bool
bluetooth) (\s :: Radios
s@Radios' {} Maybe Bool
a -> Radios
s {$sel:bluetooth:Radios' :: Maybe Bool
bluetooth = Maybe Bool
a} :: Radios)
radios_gps :: Lens.Lens' Radios (Prelude.Maybe Prelude.Bool)
radios_gps :: Lens' Radios (Maybe Bool)
radios_gps = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Radios' {Maybe Bool
gps :: Maybe Bool
$sel:gps:Radios' :: Radios -> Maybe Bool
gps} -> Maybe Bool
gps) (\s :: Radios
s@Radios' {} Maybe Bool
a -> Radios
s {$sel:gps:Radios' :: Maybe Bool
gps = Maybe Bool
a} :: Radios)
radios_nfc :: Lens.Lens' Radios (Prelude.Maybe Prelude.Bool)
radios_nfc :: Lens' Radios (Maybe Bool)
radios_nfc = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Radios' {Maybe Bool
nfc :: Maybe Bool
$sel:nfc:Radios' :: Radios -> Maybe Bool
nfc} -> Maybe Bool
nfc) (\s :: Radios
s@Radios' {} Maybe Bool
a -> Radios
s {$sel:nfc:Radios' :: Maybe Bool
nfc = Maybe Bool
a} :: Radios)
radios_wifi :: Lens.Lens' Radios (Prelude.Maybe Prelude.Bool)
radios_wifi :: Lens' Radios (Maybe Bool)
radios_wifi = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Radios' {Maybe Bool
wifi :: Maybe Bool
$sel:wifi:Radios' :: Radios -> Maybe Bool
wifi} -> Maybe Bool
wifi) (\s :: Radios
s@Radios' {} Maybe Bool
a -> Radios
s {$sel:wifi:Radios' :: Maybe Bool
wifi = Maybe Bool
a} :: Radios)
instance Data.FromJSON Radios where
parseJSON :: Value -> Parser Radios
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Radios"
( \Object
x ->
Maybe Bool -> Maybe Bool -> Maybe Bool -> Maybe Bool -> Radios
Radios'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"bluetooth")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"gps")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"nfc")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"wifi")
)
instance Prelude.Hashable Radios where
hashWithSalt :: Int -> Radios -> Int
hashWithSalt Int
_salt Radios' {Maybe Bool
wifi :: Maybe Bool
nfc :: Maybe Bool
gps :: Maybe Bool
bluetooth :: Maybe Bool
$sel:wifi:Radios' :: Radios -> Maybe Bool
$sel:nfc:Radios' :: Radios -> Maybe Bool
$sel:gps:Radios' :: Radios -> Maybe Bool
$sel:bluetooth:Radios' :: Radios -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
bluetooth
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
gps
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
nfc
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
wifi
instance Prelude.NFData Radios where
rnf :: Radios -> ()
rnf Radios' {Maybe Bool
wifi :: Maybe Bool
nfc :: Maybe Bool
gps :: Maybe Bool
bluetooth :: Maybe Bool
$sel:wifi:Radios' :: Radios -> Maybe Bool
$sel:nfc:Radios' :: Radios -> Maybe Bool
$sel:gps:Radios' :: Radios -> Maybe Bool
$sel:bluetooth:Radios' :: Radios -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
bluetooth
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
gps
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
nfc
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
wifi
instance Data.ToJSON Radios where
toJSON :: Radios -> Value
toJSON Radios' {Maybe Bool
wifi :: Maybe Bool
nfc :: Maybe Bool
gps :: Maybe Bool
bluetooth :: Maybe Bool
$sel:wifi:Radios' :: Radios -> Maybe Bool
$sel:nfc:Radios' :: Radios -> Maybe Bool
$sel:gps:Radios' :: Radios -> Maybe Bool
$sel:bluetooth:Radios' :: Radios -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"bluetooth" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
bluetooth,
(Key
"gps" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
gps,
(Key
"nfc" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
nfc,
(Key
"wifi" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
wifi
]
)