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