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