{-# 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.IpOwner where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data IpOwner = IpOwner'
{
IpOwner -> Maybe Text
org :: Prelude.Maybe Prelude.Text,
IpOwner -> Maybe Text
asnOrg :: Prelude.Maybe Prelude.Text,
IpOwner -> Maybe Text
asn :: Prelude.Maybe Prelude.Text,
IpOwner -> Maybe Text
isp :: Prelude.Maybe Prelude.Text
}
deriving (IpOwner -> IpOwner -> Bool
(IpOwner -> IpOwner -> Bool)
-> (IpOwner -> IpOwner -> Bool) -> Eq IpOwner
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IpOwner -> IpOwner -> Bool
$c/= :: IpOwner -> IpOwner -> Bool
== :: IpOwner -> IpOwner -> Bool
$c== :: IpOwner -> IpOwner -> Bool
Prelude.Eq, ReadPrec [IpOwner]
ReadPrec IpOwner
Int -> ReadS IpOwner
ReadS [IpOwner]
(Int -> ReadS IpOwner)
-> ReadS [IpOwner]
-> ReadPrec IpOwner
-> ReadPrec [IpOwner]
-> Read IpOwner
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IpOwner]
$creadListPrec :: ReadPrec [IpOwner]
readPrec :: ReadPrec IpOwner
$creadPrec :: ReadPrec IpOwner
readList :: ReadS [IpOwner]
$creadList :: ReadS [IpOwner]
readsPrec :: Int -> ReadS IpOwner
$creadsPrec :: Int -> ReadS IpOwner
Prelude.Read, Int -> IpOwner -> ShowS
[IpOwner] -> ShowS
IpOwner -> String
(Int -> IpOwner -> ShowS)
-> (IpOwner -> String) -> ([IpOwner] -> ShowS) -> Show IpOwner
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IpOwner] -> ShowS
$cshowList :: [IpOwner] -> ShowS
show :: IpOwner -> String
$cshow :: IpOwner -> String
showsPrec :: Int -> IpOwner -> ShowS
$cshowsPrec :: Int -> IpOwner -> ShowS
Prelude.Show, (forall x. IpOwner -> Rep IpOwner x)
-> (forall x. Rep IpOwner x -> IpOwner) -> Generic IpOwner
forall x. Rep IpOwner x -> IpOwner
forall x. IpOwner -> Rep IpOwner x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IpOwner x -> IpOwner
$cfrom :: forall x. IpOwner -> Rep IpOwner x
Prelude.Generic)
newIpOwner ::
IpOwner
newIpOwner :: IpOwner
newIpOwner =
IpOwner' :: Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> IpOwner
IpOwner'
{ $sel:org:IpOwner' :: Maybe Text
org = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:asnOrg:IpOwner' :: Maybe Text
asnOrg = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:asn:IpOwner' :: Maybe Text
asn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:isp:IpOwner' :: Maybe Text
isp = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
ipOwner_org :: Lens.Lens' IpOwner (Prelude.Maybe Prelude.Text)
ipOwner_org :: (Maybe Text -> f (Maybe Text)) -> IpOwner -> f IpOwner
ipOwner_org = (IpOwner -> Maybe Text)
-> (IpOwner -> Maybe Text -> IpOwner)
-> Lens IpOwner IpOwner (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpOwner' {Maybe Text
org :: Maybe Text
$sel:org:IpOwner' :: IpOwner -> Maybe Text
org} -> Maybe Text
org) (\s :: IpOwner
s@IpOwner' {} Maybe Text
a -> IpOwner
s {$sel:org:IpOwner' :: Maybe Text
org = Maybe Text
a} :: IpOwner)
ipOwner_asnOrg :: Lens.Lens' IpOwner (Prelude.Maybe Prelude.Text)
ipOwner_asnOrg :: (Maybe Text -> f (Maybe Text)) -> IpOwner -> f IpOwner
ipOwner_asnOrg = (IpOwner -> Maybe Text)
-> (IpOwner -> Maybe Text -> IpOwner)
-> Lens IpOwner IpOwner (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpOwner' {Maybe Text
asnOrg :: Maybe Text
$sel:asnOrg:IpOwner' :: IpOwner -> Maybe Text
asnOrg} -> Maybe Text
asnOrg) (\s :: IpOwner
s@IpOwner' {} Maybe Text
a -> IpOwner
s {$sel:asnOrg:IpOwner' :: Maybe Text
asnOrg = Maybe Text
a} :: IpOwner)
ipOwner_asn :: Lens.Lens' IpOwner (Prelude.Maybe Prelude.Text)
ipOwner_asn :: (Maybe Text -> f (Maybe Text)) -> IpOwner -> f IpOwner
ipOwner_asn = (IpOwner -> Maybe Text)
-> (IpOwner -> Maybe Text -> IpOwner)
-> Lens IpOwner IpOwner (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpOwner' {Maybe Text
asn :: Maybe Text
$sel:asn:IpOwner' :: IpOwner -> Maybe Text
asn} -> Maybe Text
asn) (\s :: IpOwner
s@IpOwner' {} Maybe Text
a -> IpOwner
s {$sel:asn:IpOwner' :: Maybe Text
asn = Maybe Text
a} :: IpOwner)
ipOwner_isp :: Lens.Lens' IpOwner (Prelude.Maybe Prelude.Text)
ipOwner_isp :: (Maybe Text -> f (Maybe Text)) -> IpOwner -> f IpOwner
ipOwner_isp = (IpOwner -> Maybe Text)
-> (IpOwner -> Maybe Text -> IpOwner)
-> Lens IpOwner IpOwner (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IpOwner' {Maybe Text
isp :: Maybe Text
$sel:isp:IpOwner' :: IpOwner -> Maybe Text
isp} -> Maybe Text
isp) (\s :: IpOwner
s@IpOwner' {} Maybe Text
a -> IpOwner
s {$sel:isp:IpOwner' :: Maybe Text
isp = Maybe Text
a} :: IpOwner)
instance Core.FromJSON IpOwner where
parseJSON :: Value -> Parser IpOwner
parseJSON =
String -> (Object -> Parser IpOwner) -> Value -> Parser IpOwner
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"IpOwner"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> IpOwner
IpOwner'
(Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> IpOwner)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> IpOwner)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"org")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> IpOwner)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> IpOwner)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"asnOrg")
Parser (Maybe Text -> Maybe Text -> IpOwner)
-> Parser (Maybe Text) -> Parser (Maybe Text -> IpOwner)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"asn")
Parser (Maybe Text -> IpOwner)
-> Parser (Maybe Text) -> Parser IpOwner
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"isp")
)
instance Prelude.Hashable IpOwner
instance Prelude.NFData IpOwner