{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.GuardDuty.DescribeOrganizationConfiguration
(
DescribeOrganizationConfiguration (..),
newDescribeOrganizationConfiguration,
describeOrganizationConfiguration_detectorId,
DescribeOrganizationConfigurationResponse (..),
newDescribeOrganizationConfigurationResponse,
describeOrganizationConfigurationResponse_dataSources,
describeOrganizationConfigurationResponse_httpStatus,
describeOrganizationConfigurationResponse_autoEnable,
describeOrganizationConfigurationResponse_memberAccountLimitReached,
)
where
import qualified Amazonka.Core as Core
import Amazonka.GuardDuty.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeOrganizationConfiguration = DescribeOrganizationConfiguration'
{
DescribeOrganizationConfiguration -> Text
detectorId :: Prelude.Text
}
deriving (DescribeOrganizationConfiguration
-> DescribeOrganizationConfiguration -> Bool
(DescribeOrganizationConfiguration
-> DescribeOrganizationConfiguration -> Bool)
-> (DescribeOrganizationConfiguration
-> DescribeOrganizationConfiguration -> Bool)
-> Eq DescribeOrganizationConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeOrganizationConfiguration
-> DescribeOrganizationConfiguration -> Bool
$c/= :: DescribeOrganizationConfiguration
-> DescribeOrganizationConfiguration -> Bool
== :: DescribeOrganizationConfiguration
-> DescribeOrganizationConfiguration -> Bool
$c== :: DescribeOrganizationConfiguration
-> DescribeOrganizationConfiguration -> Bool
Prelude.Eq, ReadPrec [DescribeOrganizationConfiguration]
ReadPrec DescribeOrganizationConfiguration
Int -> ReadS DescribeOrganizationConfiguration
ReadS [DescribeOrganizationConfiguration]
(Int -> ReadS DescribeOrganizationConfiguration)
-> ReadS [DescribeOrganizationConfiguration]
-> ReadPrec DescribeOrganizationConfiguration
-> ReadPrec [DescribeOrganizationConfiguration]
-> Read DescribeOrganizationConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeOrganizationConfiguration]
$creadListPrec :: ReadPrec [DescribeOrganizationConfiguration]
readPrec :: ReadPrec DescribeOrganizationConfiguration
$creadPrec :: ReadPrec DescribeOrganizationConfiguration
readList :: ReadS [DescribeOrganizationConfiguration]
$creadList :: ReadS [DescribeOrganizationConfiguration]
readsPrec :: Int -> ReadS DescribeOrganizationConfiguration
$creadsPrec :: Int -> ReadS DescribeOrganizationConfiguration
Prelude.Read, Int -> DescribeOrganizationConfiguration -> ShowS
[DescribeOrganizationConfiguration] -> ShowS
DescribeOrganizationConfiguration -> String
(Int -> DescribeOrganizationConfiguration -> ShowS)
-> (DescribeOrganizationConfiguration -> String)
-> ([DescribeOrganizationConfiguration] -> ShowS)
-> Show DescribeOrganizationConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeOrganizationConfiguration] -> ShowS
$cshowList :: [DescribeOrganizationConfiguration] -> ShowS
show :: DescribeOrganizationConfiguration -> String
$cshow :: DescribeOrganizationConfiguration -> String
showsPrec :: Int -> DescribeOrganizationConfiguration -> ShowS
$cshowsPrec :: Int -> DescribeOrganizationConfiguration -> ShowS
Prelude.Show, (forall x.
DescribeOrganizationConfiguration
-> Rep DescribeOrganizationConfiguration x)
-> (forall x.
Rep DescribeOrganizationConfiguration x
-> DescribeOrganizationConfiguration)
-> Generic DescribeOrganizationConfiguration
forall x.
Rep DescribeOrganizationConfiguration x
-> DescribeOrganizationConfiguration
forall x.
DescribeOrganizationConfiguration
-> Rep DescribeOrganizationConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeOrganizationConfiguration x
-> DescribeOrganizationConfiguration
$cfrom :: forall x.
DescribeOrganizationConfiguration
-> Rep DescribeOrganizationConfiguration x
Prelude.Generic)
newDescribeOrganizationConfiguration ::
Prelude.Text ->
DescribeOrganizationConfiguration
newDescribeOrganizationConfiguration :: Text -> DescribeOrganizationConfiguration
newDescribeOrganizationConfiguration Text
pDetectorId_ =
DescribeOrganizationConfiguration' :: Text -> DescribeOrganizationConfiguration
DescribeOrganizationConfiguration'
{ $sel:detectorId:DescribeOrganizationConfiguration' :: Text
detectorId =
Text
pDetectorId_
}
describeOrganizationConfiguration_detectorId :: Lens.Lens' DescribeOrganizationConfiguration Prelude.Text
describeOrganizationConfiguration_detectorId :: (Text -> f Text)
-> DescribeOrganizationConfiguration
-> f DescribeOrganizationConfiguration
describeOrganizationConfiguration_detectorId = (DescribeOrganizationConfiguration -> Text)
-> (DescribeOrganizationConfiguration
-> Text -> DescribeOrganizationConfiguration)
-> Lens
DescribeOrganizationConfiguration
DescribeOrganizationConfiguration
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOrganizationConfiguration' {Text
detectorId :: Text
$sel:detectorId:DescribeOrganizationConfiguration' :: DescribeOrganizationConfiguration -> Text
detectorId} -> Text
detectorId) (\s :: DescribeOrganizationConfiguration
s@DescribeOrganizationConfiguration' {} Text
a -> DescribeOrganizationConfiguration
s {$sel:detectorId:DescribeOrganizationConfiguration' :: Text
detectorId = Text
a} :: DescribeOrganizationConfiguration)
instance
Core.AWSRequest
DescribeOrganizationConfiguration
where
type
AWSResponse DescribeOrganizationConfiguration =
DescribeOrganizationConfigurationResponse
request :: DescribeOrganizationConfiguration
-> Request DescribeOrganizationConfiguration
request = Service
-> DescribeOrganizationConfiguration
-> Request DescribeOrganizationConfiguration
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeOrganizationConfiguration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DescribeOrganizationConfiguration)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeOrganizationConfiguration))
-> Logger
-> Service
-> Proxy DescribeOrganizationConfiguration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DescribeOrganizationConfiguration)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe OrganizationDataSourceConfigurationsResult
-> Int -> Bool -> Bool -> DescribeOrganizationConfigurationResponse
DescribeOrganizationConfigurationResponse'
(Maybe OrganizationDataSourceConfigurationsResult
-> Int
-> Bool
-> Bool
-> DescribeOrganizationConfigurationResponse)
-> Either String (Maybe OrganizationDataSourceConfigurationsResult)
-> Either
String
(Int -> Bool -> Bool -> DescribeOrganizationConfigurationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text
-> Either String (Maybe OrganizationDataSourceConfigurationsResult)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"dataSources")
Either
String
(Int -> Bool -> Bool -> DescribeOrganizationConfigurationResponse)
-> Either String Int
-> Either
String (Bool -> Bool -> DescribeOrganizationConfigurationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
Either
String (Bool -> Bool -> DescribeOrganizationConfigurationResponse)
-> Either String Bool
-> Either
String (Bool -> DescribeOrganizationConfigurationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Bool
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"autoEnable")
Either String (Bool -> DescribeOrganizationConfigurationResponse)
-> Either String Bool
-> Either String DescribeOrganizationConfigurationResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Bool
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"memberAccountLimitReached")
)
instance
Prelude.Hashable
DescribeOrganizationConfiguration
instance
Prelude.NFData
DescribeOrganizationConfiguration
instance
Core.ToHeaders
DescribeOrganizationConfiguration
where
toHeaders :: DescribeOrganizationConfiguration -> ResponseHeaders
toHeaders =
ResponseHeaders
-> DescribeOrganizationConfiguration -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance
Core.ToPath
DescribeOrganizationConfiguration
where
toPath :: DescribeOrganizationConfiguration -> ByteString
toPath DescribeOrganizationConfiguration' {Text
detectorId :: Text
$sel:detectorId:DescribeOrganizationConfiguration' :: DescribeOrganizationConfiguration -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/detector/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
detectorId, ByteString
"/admin"]
instance
Core.ToQuery
DescribeOrganizationConfiguration
where
toQuery :: DescribeOrganizationConfiguration -> QueryString
toQuery = QueryString -> DescribeOrganizationConfiguration -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeOrganizationConfigurationResponse = DescribeOrganizationConfigurationResponse'
{
DescribeOrganizationConfigurationResponse
-> Maybe OrganizationDataSourceConfigurationsResult
dataSources :: Prelude.Maybe OrganizationDataSourceConfigurationsResult,
DescribeOrganizationConfigurationResponse -> Int
httpStatus :: Prelude.Int,
DescribeOrganizationConfigurationResponse -> Bool
autoEnable :: Prelude.Bool,
DescribeOrganizationConfigurationResponse -> Bool
memberAccountLimitReached :: Prelude.Bool
}
deriving (DescribeOrganizationConfigurationResponse
-> DescribeOrganizationConfigurationResponse -> Bool
(DescribeOrganizationConfigurationResponse
-> DescribeOrganizationConfigurationResponse -> Bool)
-> (DescribeOrganizationConfigurationResponse
-> DescribeOrganizationConfigurationResponse -> Bool)
-> Eq DescribeOrganizationConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeOrganizationConfigurationResponse
-> DescribeOrganizationConfigurationResponse -> Bool
$c/= :: DescribeOrganizationConfigurationResponse
-> DescribeOrganizationConfigurationResponse -> Bool
== :: DescribeOrganizationConfigurationResponse
-> DescribeOrganizationConfigurationResponse -> Bool
$c== :: DescribeOrganizationConfigurationResponse
-> DescribeOrganizationConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [DescribeOrganizationConfigurationResponse]
ReadPrec DescribeOrganizationConfigurationResponse
Int -> ReadS DescribeOrganizationConfigurationResponse
ReadS [DescribeOrganizationConfigurationResponse]
(Int -> ReadS DescribeOrganizationConfigurationResponse)
-> ReadS [DescribeOrganizationConfigurationResponse]
-> ReadPrec DescribeOrganizationConfigurationResponse
-> ReadPrec [DescribeOrganizationConfigurationResponse]
-> Read DescribeOrganizationConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeOrganizationConfigurationResponse]
$creadListPrec :: ReadPrec [DescribeOrganizationConfigurationResponse]
readPrec :: ReadPrec DescribeOrganizationConfigurationResponse
$creadPrec :: ReadPrec DescribeOrganizationConfigurationResponse
readList :: ReadS [DescribeOrganizationConfigurationResponse]
$creadList :: ReadS [DescribeOrganizationConfigurationResponse]
readsPrec :: Int -> ReadS DescribeOrganizationConfigurationResponse
$creadsPrec :: Int -> ReadS DescribeOrganizationConfigurationResponse
Prelude.Read, Int -> DescribeOrganizationConfigurationResponse -> ShowS
[DescribeOrganizationConfigurationResponse] -> ShowS
DescribeOrganizationConfigurationResponse -> String
(Int -> DescribeOrganizationConfigurationResponse -> ShowS)
-> (DescribeOrganizationConfigurationResponse -> String)
-> ([DescribeOrganizationConfigurationResponse] -> ShowS)
-> Show DescribeOrganizationConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeOrganizationConfigurationResponse] -> ShowS
$cshowList :: [DescribeOrganizationConfigurationResponse] -> ShowS
show :: DescribeOrganizationConfigurationResponse -> String
$cshow :: DescribeOrganizationConfigurationResponse -> String
showsPrec :: Int -> DescribeOrganizationConfigurationResponse -> ShowS
$cshowsPrec :: Int -> DescribeOrganizationConfigurationResponse -> ShowS
Prelude.Show, (forall x.
DescribeOrganizationConfigurationResponse
-> Rep DescribeOrganizationConfigurationResponse x)
-> (forall x.
Rep DescribeOrganizationConfigurationResponse x
-> DescribeOrganizationConfigurationResponse)
-> Generic DescribeOrganizationConfigurationResponse
forall x.
Rep DescribeOrganizationConfigurationResponse x
-> DescribeOrganizationConfigurationResponse
forall x.
DescribeOrganizationConfigurationResponse
-> Rep DescribeOrganizationConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeOrganizationConfigurationResponse x
-> DescribeOrganizationConfigurationResponse
$cfrom :: forall x.
DescribeOrganizationConfigurationResponse
-> Rep DescribeOrganizationConfigurationResponse x
Prelude.Generic)
newDescribeOrganizationConfigurationResponse ::
Prelude.Int ->
Prelude.Bool ->
Prelude.Bool ->
DescribeOrganizationConfigurationResponse
newDescribeOrganizationConfigurationResponse :: Int -> Bool -> Bool -> DescribeOrganizationConfigurationResponse
newDescribeOrganizationConfigurationResponse
Int
pHttpStatus_
Bool
pAutoEnable_
Bool
pMemberAccountLimitReached_ =
DescribeOrganizationConfigurationResponse' :: Maybe OrganizationDataSourceConfigurationsResult
-> Int -> Bool -> Bool -> DescribeOrganizationConfigurationResponse
DescribeOrganizationConfigurationResponse'
{ $sel:dataSources:DescribeOrganizationConfigurationResponse' :: Maybe OrganizationDataSourceConfigurationsResult
dataSources =
Maybe OrganizationDataSourceConfigurationsResult
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeOrganizationConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:autoEnable:DescribeOrganizationConfigurationResponse' :: Bool
autoEnable = Bool
pAutoEnable_,
$sel:memberAccountLimitReached:DescribeOrganizationConfigurationResponse' :: Bool
memberAccountLimitReached =
Bool
pMemberAccountLimitReached_
}
describeOrganizationConfigurationResponse_dataSources :: Lens.Lens' DescribeOrganizationConfigurationResponse (Prelude.Maybe OrganizationDataSourceConfigurationsResult)
describeOrganizationConfigurationResponse_dataSources :: (Maybe OrganizationDataSourceConfigurationsResult
-> f (Maybe OrganizationDataSourceConfigurationsResult))
-> DescribeOrganizationConfigurationResponse
-> f DescribeOrganizationConfigurationResponse
describeOrganizationConfigurationResponse_dataSources = (DescribeOrganizationConfigurationResponse
-> Maybe OrganizationDataSourceConfigurationsResult)
-> (DescribeOrganizationConfigurationResponse
-> Maybe OrganizationDataSourceConfigurationsResult
-> DescribeOrganizationConfigurationResponse)
-> Lens
DescribeOrganizationConfigurationResponse
DescribeOrganizationConfigurationResponse
(Maybe OrganizationDataSourceConfigurationsResult)
(Maybe OrganizationDataSourceConfigurationsResult)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOrganizationConfigurationResponse' {Maybe OrganizationDataSourceConfigurationsResult
dataSources :: Maybe OrganizationDataSourceConfigurationsResult
$sel:dataSources:DescribeOrganizationConfigurationResponse' :: DescribeOrganizationConfigurationResponse
-> Maybe OrganizationDataSourceConfigurationsResult
dataSources} -> Maybe OrganizationDataSourceConfigurationsResult
dataSources) (\s :: DescribeOrganizationConfigurationResponse
s@DescribeOrganizationConfigurationResponse' {} Maybe OrganizationDataSourceConfigurationsResult
a -> DescribeOrganizationConfigurationResponse
s {$sel:dataSources:DescribeOrganizationConfigurationResponse' :: Maybe OrganizationDataSourceConfigurationsResult
dataSources = Maybe OrganizationDataSourceConfigurationsResult
a} :: DescribeOrganizationConfigurationResponse)
describeOrganizationConfigurationResponse_httpStatus :: Lens.Lens' DescribeOrganizationConfigurationResponse Prelude.Int
describeOrganizationConfigurationResponse_httpStatus :: (Int -> f Int)
-> DescribeOrganizationConfigurationResponse
-> f DescribeOrganizationConfigurationResponse
describeOrganizationConfigurationResponse_httpStatus = (DescribeOrganizationConfigurationResponse -> Int)
-> (DescribeOrganizationConfigurationResponse
-> Int -> DescribeOrganizationConfigurationResponse)
-> Lens
DescribeOrganizationConfigurationResponse
DescribeOrganizationConfigurationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOrganizationConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeOrganizationConfigurationResponse' :: DescribeOrganizationConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeOrganizationConfigurationResponse
s@DescribeOrganizationConfigurationResponse' {} Int
a -> DescribeOrganizationConfigurationResponse
s {$sel:httpStatus:DescribeOrganizationConfigurationResponse' :: Int
httpStatus = Int
a} :: DescribeOrganizationConfigurationResponse)
describeOrganizationConfigurationResponse_autoEnable :: Lens.Lens' DescribeOrganizationConfigurationResponse Prelude.Bool
describeOrganizationConfigurationResponse_autoEnable :: (Bool -> f Bool)
-> DescribeOrganizationConfigurationResponse
-> f DescribeOrganizationConfigurationResponse
describeOrganizationConfigurationResponse_autoEnable = (DescribeOrganizationConfigurationResponse -> Bool)
-> (DescribeOrganizationConfigurationResponse
-> Bool -> DescribeOrganizationConfigurationResponse)
-> Lens
DescribeOrganizationConfigurationResponse
DescribeOrganizationConfigurationResponse
Bool
Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOrganizationConfigurationResponse' {Bool
autoEnable :: Bool
$sel:autoEnable:DescribeOrganizationConfigurationResponse' :: DescribeOrganizationConfigurationResponse -> Bool
autoEnable} -> Bool
autoEnable) (\s :: DescribeOrganizationConfigurationResponse
s@DescribeOrganizationConfigurationResponse' {} Bool
a -> DescribeOrganizationConfigurationResponse
s {$sel:autoEnable:DescribeOrganizationConfigurationResponse' :: Bool
autoEnable = Bool
a} :: DescribeOrganizationConfigurationResponse)
describeOrganizationConfigurationResponse_memberAccountLimitReached :: Lens.Lens' DescribeOrganizationConfigurationResponse Prelude.Bool
describeOrganizationConfigurationResponse_memberAccountLimitReached :: (Bool -> f Bool)
-> DescribeOrganizationConfigurationResponse
-> f DescribeOrganizationConfigurationResponse
describeOrganizationConfigurationResponse_memberAccountLimitReached = (DescribeOrganizationConfigurationResponse -> Bool)
-> (DescribeOrganizationConfigurationResponse
-> Bool -> DescribeOrganizationConfigurationResponse)
-> Lens
DescribeOrganizationConfigurationResponse
DescribeOrganizationConfigurationResponse
Bool
Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeOrganizationConfigurationResponse' {Bool
memberAccountLimitReached :: Bool
$sel:memberAccountLimitReached:DescribeOrganizationConfigurationResponse' :: DescribeOrganizationConfigurationResponse -> Bool
memberAccountLimitReached} -> Bool
memberAccountLimitReached) (\s :: DescribeOrganizationConfigurationResponse
s@DescribeOrganizationConfigurationResponse' {} Bool
a -> DescribeOrganizationConfigurationResponse
s {$sel:memberAccountLimitReached:DescribeOrganizationConfigurationResponse' :: Bool
memberAccountLimitReached = Bool
a} :: DescribeOrganizationConfigurationResponse)
instance
Prelude.NFData
DescribeOrganizationConfigurationResponse