{-# 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.RemoteIpDetails where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GuardDuty.Types.City
import Amazonka.GuardDuty.Types.Country
import Amazonka.GuardDuty.Types.GeoLocation
import Amazonka.GuardDuty.Types.Organization
import qualified Amazonka.Prelude as Prelude
data RemoteIpDetails = RemoteIpDetails'
{
RemoteIpDetails -> Maybe City
city :: Prelude.Maybe City,
RemoteIpDetails -> Maybe Country
country :: Prelude.Maybe Country,
RemoteIpDetails -> Maybe GeoLocation
geoLocation :: Prelude.Maybe GeoLocation,
RemoteIpDetails -> Maybe Text
ipAddressV4 :: Prelude.Maybe Prelude.Text,
RemoteIpDetails -> Maybe Organization
organization :: Prelude.Maybe Organization
}
deriving (RemoteIpDetails -> RemoteIpDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RemoteIpDetails -> RemoteIpDetails -> Bool
$c/= :: RemoteIpDetails -> RemoteIpDetails -> Bool
== :: RemoteIpDetails -> RemoteIpDetails -> Bool
$c== :: RemoteIpDetails -> RemoteIpDetails -> Bool
Prelude.Eq, ReadPrec [RemoteIpDetails]
ReadPrec RemoteIpDetails
Int -> ReadS RemoteIpDetails
ReadS [RemoteIpDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RemoteIpDetails]
$creadListPrec :: ReadPrec [RemoteIpDetails]
readPrec :: ReadPrec RemoteIpDetails
$creadPrec :: ReadPrec RemoteIpDetails
readList :: ReadS [RemoteIpDetails]
$creadList :: ReadS [RemoteIpDetails]
readsPrec :: Int -> ReadS RemoteIpDetails
$creadsPrec :: Int -> ReadS RemoteIpDetails
Prelude.Read, Int -> RemoteIpDetails -> ShowS
[RemoteIpDetails] -> ShowS
RemoteIpDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemoteIpDetails] -> ShowS
$cshowList :: [RemoteIpDetails] -> ShowS
show :: RemoteIpDetails -> String
$cshow :: RemoteIpDetails -> String
showsPrec :: Int -> RemoteIpDetails -> ShowS
$cshowsPrec :: Int -> RemoteIpDetails -> ShowS
Prelude.Show, forall x. Rep RemoteIpDetails x -> RemoteIpDetails
forall x. RemoteIpDetails -> Rep RemoteIpDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RemoteIpDetails x -> RemoteIpDetails
$cfrom :: forall x. RemoteIpDetails -> Rep RemoteIpDetails x
Prelude.Generic)
newRemoteIpDetails ::
RemoteIpDetails
newRemoteIpDetails :: RemoteIpDetails
newRemoteIpDetails =
RemoteIpDetails'
{ $sel:city:RemoteIpDetails' :: Maybe City
city = forall a. Maybe a
Prelude.Nothing,
$sel:country:RemoteIpDetails' :: Maybe Country
country = forall a. Maybe a
Prelude.Nothing,
$sel:geoLocation:RemoteIpDetails' :: Maybe GeoLocation
geoLocation = forall a. Maybe a
Prelude.Nothing,
$sel:ipAddressV4:RemoteIpDetails' :: Maybe Text
ipAddressV4 = forall a. Maybe a
Prelude.Nothing,
$sel:organization:RemoteIpDetails' :: Maybe Organization
organization = forall a. Maybe a
Prelude.Nothing
}
remoteIpDetails_city :: Lens.Lens' RemoteIpDetails (Prelude.Maybe City)
remoteIpDetails_city :: Lens' RemoteIpDetails (Maybe City)
remoteIpDetails_city = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoteIpDetails' {Maybe City
city :: Maybe City
$sel:city:RemoteIpDetails' :: RemoteIpDetails -> Maybe City
city} -> Maybe City
city) (\s :: RemoteIpDetails
s@RemoteIpDetails' {} Maybe City
a -> RemoteIpDetails
s {$sel:city:RemoteIpDetails' :: Maybe City
city = Maybe City
a} :: RemoteIpDetails)
remoteIpDetails_country :: Lens.Lens' RemoteIpDetails (Prelude.Maybe Country)
remoteIpDetails_country :: Lens' RemoteIpDetails (Maybe Country)
remoteIpDetails_country = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoteIpDetails' {Maybe Country
country :: Maybe Country
$sel:country:RemoteIpDetails' :: RemoteIpDetails -> Maybe Country
country} -> Maybe Country
country) (\s :: RemoteIpDetails
s@RemoteIpDetails' {} Maybe Country
a -> RemoteIpDetails
s {$sel:country:RemoteIpDetails' :: Maybe Country
country = Maybe Country
a} :: RemoteIpDetails)
remoteIpDetails_geoLocation :: Lens.Lens' RemoteIpDetails (Prelude.Maybe GeoLocation)
remoteIpDetails_geoLocation :: Lens' RemoteIpDetails (Maybe GeoLocation)
remoteIpDetails_geoLocation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoteIpDetails' {Maybe GeoLocation
geoLocation :: Maybe GeoLocation
$sel:geoLocation:RemoteIpDetails' :: RemoteIpDetails -> Maybe GeoLocation
geoLocation} -> Maybe GeoLocation
geoLocation) (\s :: RemoteIpDetails
s@RemoteIpDetails' {} Maybe GeoLocation
a -> RemoteIpDetails
s {$sel:geoLocation:RemoteIpDetails' :: Maybe GeoLocation
geoLocation = Maybe GeoLocation
a} :: RemoteIpDetails)
remoteIpDetails_ipAddressV4 :: Lens.Lens' RemoteIpDetails (Prelude.Maybe Prelude.Text)
remoteIpDetails_ipAddressV4 :: Lens' RemoteIpDetails (Maybe Text)
remoteIpDetails_ipAddressV4 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoteIpDetails' {Maybe Text
ipAddressV4 :: Maybe Text
$sel:ipAddressV4:RemoteIpDetails' :: RemoteIpDetails -> Maybe Text
ipAddressV4} -> Maybe Text
ipAddressV4) (\s :: RemoteIpDetails
s@RemoteIpDetails' {} Maybe Text
a -> RemoteIpDetails
s {$sel:ipAddressV4:RemoteIpDetails' :: Maybe Text
ipAddressV4 = Maybe Text
a} :: RemoteIpDetails)
remoteIpDetails_organization :: Lens.Lens' RemoteIpDetails (Prelude.Maybe Organization)
remoteIpDetails_organization :: Lens' RemoteIpDetails (Maybe Organization)
remoteIpDetails_organization = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemoteIpDetails' {Maybe Organization
organization :: Maybe Organization
$sel:organization:RemoteIpDetails' :: RemoteIpDetails -> Maybe Organization
organization} -> Maybe Organization
organization) (\s :: RemoteIpDetails
s@RemoteIpDetails' {} Maybe Organization
a -> RemoteIpDetails
s {$sel:organization:RemoteIpDetails' :: Maybe Organization
organization = Maybe Organization
a} :: RemoteIpDetails)
instance Data.FromJSON RemoteIpDetails where
parseJSON :: Value -> Parser RemoteIpDetails
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"RemoteIpDetails"
( \Object
x ->
Maybe City
-> Maybe Country
-> Maybe GeoLocation
-> Maybe Text
-> Maybe Organization
-> RemoteIpDetails
RemoteIpDetails'
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
"city")
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
"country")
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
"geoLocation")
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
"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
"organization")
)
instance Prelude.Hashable RemoteIpDetails where
hashWithSalt :: Int -> RemoteIpDetails -> Int
hashWithSalt Int
_salt RemoteIpDetails' {Maybe Text
Maybe City
Maybe Country
Maybe GeoLocation
Maybe Organization
organization :: Maybe Organization
ipAddressV4 :: Maybe Text
geoLocation :: Maybe GeoLocation
country :: Maybe Country
city :: Maybe City
$sel:organization:RemoteIpDetails' :: RemoteIpDetails -> Maybe Organization
$sel:ipAddressV4:RemoteIpDetails' :: RemoteIpDetails -> Maybe Text
$sel:geoLocation:RemoteIpDetails' :: RemoteIpDetails -> Maybe GeoLocation
$sel:country:RemoteIpDetails' :: RemoteIpDetails -> Maybe Country
$sel:city:RemoteIpDetails' :: RemoteIpDetails -> Maybe City
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe City
city
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Country
country
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe GeoLocation
geoLocation
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ipAddressV4
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Organization
organization
instance Prelude.NFData RemoteIpDetails where
rnf :: RemoteIpDetails -> ()
rnf RemoteIpDetails' {Maybe Text
Maybe City
Maybe Country
Maybe GeoLocation
Maybe Organization
organization :: Maybe Organization
ipAddressV4 :: Maybe Text
geoLocation :: Maybe GeoLocation
country :: Maybe Country
city :: Maybe City
$sel:organization:RemoteIpDetails' :: RemoteIpDetails -> Maybe Organization
$sel:ipAddressV4:RemoteIpDetails' :: RemoteIpDetails -> Maybe Text
$sel:geoLocation:RemoteIpDetails' :: RemoteIpDetails -> Maybe GeoLocation
$sel:country:RemoteIpDetails' :: RemoteIpDetails -> Maybe Country
$sel:city:RemoteIpDetails' :: RemoteIpDetails -> Maybe City
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe City
city
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Country
country
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe GeoLocation
geoLocation
seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Organization
organization