{-# 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.IpAddressDetails where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MacieV2.Types.IpCity
import Amazonka.MacieV2.Types.IpCountry
import Amazonka.MacieV2.Types.IpGeoLocation
import Amazonka.MacieV2.Types.IpOwner
import qualified Amazonka.Prelude as Prelude
data IpAddressDetails = IpAddressDetails'
{
IpAddressDetails -> Maybe Text
ipAddressV4 :: Prelude.Maybe Prelude.Text,
IpAddressDetails -> Maybe IpCity
ipCity :: Prelude.Maybe IpCity,
IpAddressDetails -> Maybe IpCountry
ipCountry :: Prelude.Maybe IpCountry,
IpAddressDetails -> Maybe IpGeoLocation
ipGeoLocation :: Prelude.Maybe IpGeoLocation,
IpAddressDetails -> Maybe IpOwner
ipOwner :: Prelude.Maybe IpOwner
}
deriving (IpAddressDetails -> IpAddressDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IpAddressDetails -> IpAddressDetails -> Bool
$c/= :: IpAddressDetails -> IpAddressDetails -> Bool
== :: IpAddressDetails -> IpAddressDetails -> Bool
$c== :: IpAddressDetails -> IpAddressDetails -> Bool
Prelude.Eq, ReadPrec [IpAddressDetails]
ReadPrec IpAddressDetails
Int -> ReadS IpAddressDetails
ReadS [IpAddressDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IpAddressDetails]
$creadListPrec :: ReadPrec [IpAddressDetails]
readPrec :: ReadPrec IpAddressDetails
$creadPrec :: ReadPrec IpAddressDetails
readList :: ReadS [IpAddressDetails]
$creadList :: ReadS [IpAddressDetails]
readsPrec :: Int -> ReadS IpAddressDetails
$creadsPrec :: Int -> ReadS IpAddressDetails
Prelude.Read, Int -> IpAddressDetails -> ShowS
[IpAddressDetails] -> ShowS
IpAddressDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IpAddressDetails] -> ShowS
$cshowList :: [IpAddressDetails] -> ShowS
show :: IpAddressDetails -> String
$cshow :: IpAddressDetails -> String
showsPrec :: Int -> IpAddressDetails -> ShowS
$cshowsPrec :: Int -> IpAddressDetails -> ShowS
Prelude.Show, forall x. Rep IpAddressDetails x -> IpAddressDetails
forall x. IpAddressDetails -> Rep IpAddressDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IpAddressDetails x -> IpAddressDetails
$cfrom :: forall x. IpAddressDetails -> Rep IpAddressDetails x
Prelude.Generic)
newIpAddressDetails ::
IpAddressDetails
newIpAddressDetails :: IpAddressDetails
newIpAddressDetails =
IpAddressDetails'
{ $sel:ipAddressV4:IpAddressDetails' :: Maybe Text
ipAddressV4 = forall a. Maybe a
Prelude.Nothing,
$sel:ipCity:IpAddressDetails' :: Maybe IpCity
ipCity = forall a. Maybe a
Prelude.Nothing,
$sel:ipCountry:IpAddressDetails' :: Maybe IpCountry
ipCountry = forall a. Maybe a
Prelude.Nothing,
$sel:ipGeoLocation:IpAddressDetails' :: Maybe IpGeoLocation
ipGeoLocation = forall a. Maybe a
Prelude.Nothing,
$sel:ipOwner:IpAddressDetails' :: Maybe IpOwner
ipOwner = forall a. Maybe a
Prelude.Nothing
}
ipAddressDetails_ipAddressV4 :: Lens.Lens' IpAddressDetails (Prelude.Maybe Prelude.Text)
ipAddressDetails_ipAddressV4 :: Lens' IpAddressDetails (Maybe Text)
ipAddressDetails_ipAddressV4 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpAddressDetails' {Maybe Text
ipAddressV4 :: Maybe Text
$sel:ipAddressV4:IpAddressDetails' :: IpAddressDetails -> Maybe Text
ipAddressV4} -> Maybe Text
ipAddressV4) (\s :: IpAddressDetails
s@IpAddressDetails' {} Maybe Text
a -> IpAddressDetails
s {$sel:ipAddressV4:IpAddressDetails' :: Maybe Text
ipAddressV4 = Maybe Text
a} :: IpAddressDetails)
ipAddressDetails_ipCity :: Lens.Lens' IpAddressDetails (Prelude.Maybe IpCity)
ipAddressDetails_ipCity :: Lens' IpAddressDetails (Maybe IpCity)
ipAddressDetails_ipCity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpAddressDetails' {Maybe IpCity
ipCity :: Maybe IpCity
$sel:ipCity:IpAddressDetails' :: IpAddressDetails -> Maybe IpCity
ipCity} -> Maybe IpCity
ipCity) (\s :: IpAddressDetails
s@IpAddressDetails' {} Maybe IpCity
a -> IpAddressDetails
s {$sel:ipCity:IpAddressDetails' :: Maybe IpCity
ipCity = Maybe IpCity
a} :: IpAddressDetails)
ipAddressDetails_ipCountry :: Lens.Lens' IpAddressDetails (Prelude.Maybe IpCountry)
ipAddressDetails_ipCountry :: Lens' IpAddressDetails (Maybe IpCountry)
ipAddressDetails_ipCountry = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpAddressDetails' {Maybe IpCountry
ipCountry :: Maybe IpCountry
$sel:ipCountry:IpAddressDetails' :: IpAddressDetails -> Maybe IpCountry
ipCountry} -> Maybe IpCountry
ipCountry) (\s :: IpAddressDetails
s@IpAddressDetails' {} Maybe IpCountry
a -> IpAddressDetails
s {$sel:ipCountry:IpAddressDetails' :: Maybe IpCountry
ipCountry = Maybe IpCountry
a} :: IpAddressDetails)
ipAddressDetails_ipGeoLocation :: Lens.Lens' IpAddressDetails (Prelude.Maybe IpGeoLocation)
ipAddressDetails_ipGeoLocation :: Lens' IpAddressDetails (Maybe IpGeoLocation)
ipAddressDetails_ipGeoLocation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpAddressDetails' {Maybe IpGeoLocation
ipGeoLocation :: Maybe IpGeoLocation
$sel:ipGeoLocation:IpAddressDetails' :: IpAddressDetails -> Maybe IpGeoLocation
ipGeoLocation} -> Maybe IpGeoLocation
ipGeoLocation) (\s :: IpAddressDetails
s@IpAddressDetails' {} Maybe IpGeoLocation
a -> IpAddressDetails
s {$sel:ipGeoLocation:IpAddressDetails' :: Maybe IpGeoLocation
ipGeoLocation = Maybe IpGeoLocation
a} :: IpAddressDetails)
ipAddressDetails_ipOwner :: Lens.Lens' IpAddressDetails (Prelude.Maybe IpOwner)
ipAddressDetails_ipOwner :: Lens' IpAddressDetails (Maybe IpOwner)
ipAddressDetails_ipOwner = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpAddressDetails' {Maybe IpOwner
ipOwner :: Maybe IpOwner
$sel:ipOwner:IpAddressDetails' :: IpAddressDetails -> Maybe IpOwner
ipOwner} -> Maybe IpOwner
ipOwner) (\s :: IpAddressDetails
s@IpAddressDetails' {} Maybe IpOwner
a -> IpAddressDetails
s {$sel:ipOwner:IpAddressDetails' :: Maybe IpOwner
ipOwner = Maybe IpOwner
a} :: IpAddressDetails)
instance Data.FromJSON IpAddressDetails where
parseJSON :: Value -> Parser IpAddressDetails
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"IpAddressDetails"
( \Object
x ->
Maybe Text
-> Maybe IpCity
-> Maybe IpCountry
-> Maybe IpGeoLocation
-> Maybe IpOwner
-> IpAddressDetails
IpAddressDetails'
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
"ipAddressV4")
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
"ipCity")
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
"ipCountry")
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
"ipGeoLocation")
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
"ipOwner")
)
instance Prelude.Hashable IpAddressDetails where
hashWithSalt :: Int -> IpAddressDetails -> Int
hashWithSalt Int
_salt IpAddressDetails' {Maybe Text
Maybe IpCity
Maybe IpCountry
Maybe IpGeoLocation
Maybe IpOwner
ipOwner :: Maybe IpOwner
ipGeoLocation :: Maybe IpGeoLocation
ipCountry :: Maybe IpCountry
ipCity :: Maybe IpCity
ipAddressV4 :: Maybe Text
$sel:ipOwner:IpAddressDetails' :: IpAddressDetails -> Maybe IpOwner
$sel:ipGeoLocation:IpAddressDetails' :: IpAddressDetails -> Maybe IpGeoLocation
$sel:ipCountry:IpAddressDetails' :: IpAddressDetails -> Maybe IpCountry
$sel:ipCity:IpAddressDetails' :: IpAddressDetails -> Maybe IpCity
$sel:ipAddressV4:IpAddressDetails' :: IpAddressDetails -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ipAddressV4
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IpCity
ipCity
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IpCountry
ipCountry
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IpGeoLocation
ipGeoLocation
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IpOwner
ipOwner
instance Prelude.NFData IpAddressDetails where
rnf :: IpAddressDetails -> ()
rnf IpAddressDetails' {Maybe Text
Maybe IpCity
Maybe IpCountry
Maybe IpGeoLocation
Maybe IpOwner
ipOwner :: Maybe IpOwner
ipGeoLocation :: Maybe IpGeoLocation
ipCountry :: Maybe IpCountry
ipCity :: Maybe IpCity
ipAddressV4 :: Maybe Text
$sel:ipOwner:IpAddressDetails' :: IpAddressDetails -> Maybe IpOwner
$sel:ipGeoLocation:IpAddressDetails' :: IpAddressDetails -> Maybe IpGeoLocation
$sel:ipCountry:IpAddressDetails' :: IpAddressDetails -> Maybe IpCountry
$sel:ipCity:IpAddressDetails' :: IpAddressDetails -> Maybe IpCity
$sel:ipAddressV4:IpAddressDetails' :: IpAddressDetails -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ipAddressV4
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe IpCity
ipCity
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe IpCountry
ipCountry
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe IpGeoLocation
ipGeoLocation
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe IpOwner
ipOwner