{-# 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.MacieV2.Types.IpCity 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 IpCity = IpCity'
{
IpCity -> Maybe Text
name :: Prelude.Maybe Prelude.Text
}
deriving (IpCity -> IpCity -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IpCity -> IpCity -> Bool
$c/= :: IpCity -> IpCity -> Bool
== :: IpCity -> IpCity -> Bool
$c== :: IpCity -> IpCity -> Bool
Prelude.Eq, ReadPrec [IpCity]
ReadPrec IpCity
Int -> ReadS IpCity
ReadS [IpCity]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IpCity]
$creadListPrec :: ReadPrec [IpCity]
readPrec :: ReadPrec IpCity
$creadPrec :: ReadPrec IpCity
readList :: ReadS [IpCity]
$creadList :: ReadS [IpCity]
readsPrec :: Int -> ReadS IpCity
$creadsPrec :: Int -> ReadS IpCity
Prelude.Read, Int -> IpCity -> ShowS
[IpCity] -> ShowS
IpCity -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IpCity] -> ShowS
$cshowList :: [IpCity] -> ShowS
show :: IpCity -> String
$cshow :: IpCity -> String
showsPrec :: Int -> IpCity -> ShowS
$cshowsPrec :: Int -> IpCity -> ShowS
Prelude.Show, forall x. Rep IpCity x -> IpCity
forall x. IpCity -> Rep IpCity x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IpCity x -> IpCity
$cfrom :: forall x. IpCity -> Rep IpCity x
Prelude.Generic)
newIpCity ::
IpCity
newIpCity :: IpCity
newIpCity = IpCity' {$sel:name:IpCity' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing}
ipCity_name :: Lens.Lens' IpCity (Prelude.Maybe Prelude.Text)
ipCity_name :: Lens' IpCity (Maybe Text)
ipCity_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpCity' {Maybe Text
name :: Maybe Text
$sel:name:IpCity' :: IpCity -> Maybe Text
name} -> Maybe Text
name) (\s :: IpCity
s@IpCity' {} Maybe Text
a -> IpCity
s {$sel:name:IpCity' :: Maybe Text
name = Maybe Text
a} :: IpCity)
instance Data.FromJSON IpCity where
parseJSON :: Value -> Parser IpCity
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"IpCity"
(\Object
x -> Maybe Text -> IpCity
IpCity' 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
"name"))
instance Prelude.Hashable IpCity where
hashWithSalt :: Int -> IpCity -> Int
hashWithSalt Int
_salt IpCity' {Maybe Text
name :: Maybe Text
$sel:name:IpCity' :: IpCity -> Maybe Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
instance Prelude.NFData IpCity where
rnf :: IpCity -> ()
rnf IpCity' {Maybe Text
name :: Maybe Text
$sel:name:IpCity' :: IpCity -> Maybe Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name