{-# 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.Ip 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 Ip = Ip'
{
Ip -> Text
ipAddress :: Prelude.Text
}
deriving (Ip -> Ip -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Ip -> Ip -> Bool
$c/= :: Ip -> Ip -> Bool
== :: Ip -> Ip -> Bool
$c== :: Ip -> Ip -> Bool
Prelude.Eq, ReadPrec [Ip]
ReadPrec Ip
Int -> ReadS Ip
ReadS [Ip]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Ip]
$creadListPrec :: ReadPrec [Ip]
readPrec :: ReadPrec Ip
$creadPrec :: ReadPrec Ip
readList :: ReadS [Ip]
$creadList :: ReadS [Ip]
readsPrec :: Int -> ReadS Ip
$creadsPrec :: Int -> ReadS Ip
Prelude.Read, Int -> Ip -> ShowS
[Ip] -> ShowS
Ip -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Ip] -> ShowS
$cshowList :: [Ip] -> ShowS
show :: Ip -> String
$cshow :: Ip -> String
showsPrec :: Int -> Ip -> ShowS
$cshowsPrec :: Int -> Ip -> ShowS
Prelude.Show, forall x. Rep Ip x -> Ip
forall x. Ip -> Rep Ip x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Ip x -> Ip
$cfrom :: forall x. Ip -> Rep Ip x
Prelude.Generic)
newIp ::
Prelude.Text ->
Ip
newIp :: Text -> Ip
newIp Text
pIpAddress_ = Ip' {$sel:ipAddress:Ip' :: Text
ipAddress = Text
pIpAddress_}
ip_ipAddress :: Lens.Lens' Ip Prelude.Text
ip_ipAddress :: Lens' Ip Text
ip_ipAddress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ip' {Text
ipAddress :: Text
$sel:ipAddress:Ip' :: Ip -> Text
ipAddress} -> Text
ipAddress) (\s :: Ip
s@Ip' {} Text
a -> Ip
s {$sel:ipAddress:Ip' :: Text
ipAddress = Text
a} :: Ip)
instance Prelude.Hashable Ip where
hashWithSalt :: Int -> Ip -> Int
hashWithSalt Int
_salt Ip' {Text
ipAddress :: Text
$sel:ipAddress:Ip' :: Ip -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ipAddress
instance Prelude.NFData Ip where
rnf :: Ip -> ()
rnf Ip' {Text
ipAddress :: Text
$sel:ipAddress:Ip' :: Ip -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
ipAddress
instance Data.ToJSON Ip where
toJSON :: Ip -> Value
toJSON Ip' {Text
ipAddress :: Text
$sel:ipAddress:Ip' :: Ip -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"IpAddress" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
ipAddress)]
)