{-# 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.SecurityHub.GetAdministratorAccount
(
GetAdministratorAccount (..),
newGetAdministratorAccount,
GetAdministratorAccountResponse (..),
newGetAdministratorAccountResponse,
getAdministratorAccountResponse_administrator,
getAdministratorAccountResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.SecurityHub.Types
data GetAdministratorAccount = GetAdministratorAccount'
{
}
deriving (GetAdministratorAccount -> GetAdministratorAccount -> Bool
(GetAdministratorAccount -> GetAdministratorAccount -> Bool)
-> (GetAdministratorAccount -> GetAdministratorAccount -> Bool)
-> Eq GetAdministratorAccount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAdministratorAccount -> GetAdministratorAccount -> Bool
$c/= :: GetAdministratorAccount -> GetAdministratorAccount -> Bool
== :: GetAdministratorAccount -> GetAdministratorAccount -> Bool
$c== :: GetAdministratorAccount -> GetAdministratorAccount -> Bool
Prelude.Eq, ReadPrec [GetAdministratorAccount]
ReadPrec GetAdministratorAccount
Int -> ReadS GetAdministratorAccount
ReadS [GetAdministratorAccount]
(Int -> ReadS GetAdministratorAccount)
-> ReadS [GetAdministratorAccount]
-> ReadPrec GetAdministratorAccount
-> ReadPrec [GetAdministratorAccount]
-> Read GetAdministratorAccount
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAdministratorAccount]
$creadListPrec :: ReadPrec [GetAdministratorAccount]
readPrec :: ReadPrec GetAdministratorAccount
$creadPrec :: ReadPrec GetAdministratorAccount
readList :: ReadS [GetAdministratorAccount]
$creadList :: ReadS [GetAdministratorAccount]
readsPrec :: Int -> ReadS GetAdministratorAccount
$creadsPrec :: Int -> ReadS GetAdministratorAccount
Prelude.Read, Int -> GetAdministratorAccount -> ShowS
[GetAdministratorAccount] -> ShowS
GetAdministratorAccount -> String
(Int -> GetAdministratorAccount -> ShowS)
-> (GetAdministratorAccount -> String)
-> ([GetAdministratorAccount] -> ShowS)
-> Show GetAdministratorAccount
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAdministratorAccount] -> ShowS
$cshowList :: [GetAdministratorAccount] -> ShowS
show :: GetAdministratorAccount -> String
$cshow :: GetAdministratorAccount -> String
showsPrec :: Int -> GetAdministratorAccount -> ShowS
$cshowsPrec :: Int -> GetAdministratorAccount -> ShowS
Prelude.Show, (forall x.
GetAdministratorAccount -> Rep GetAdministratorAccount x)
-> (forall x.
Rep GetAdministratorAccount x -> GetAdministratorAccount)
-> Generic GetAdministratorAccount
forall x. Rep GetAdministratorAccount x -> GetAdministratorAccount
forall x. GetAdministratorAccount -> Rep GetAdministratorAccount x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetAdministratorAccount x -> GetAdministratorAccount
$cfrom :: forall x. GetAdministratorAccount -> Rep GetAdministratorAccount x
Prelude.Generic)
newGetAdministratorAccount ::
GetAdministratorAccount
newGetAdministratorAccount :: GetAdministratorAccount
newGetAdministratorAccount = GetAdministratorAccount
GetAdministratorAccount'
instance Core.AWSRequest GetAdministratorAccount where
type
AWSResponse GetAdministratorAccount =
GetAdministratorAccountResponse
request :: GetAdministratorAccount -> Request GetAdministratorAccount
request = Service
-> GetAdministratorAccount -> Request GetAdministratorAccount
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetAdministratorAccount
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetAdministratorAccount)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetAdministratorAccount))
-> Logger
-> Service
-> Proxy GetAdministratorAccount
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetAdministratorAccount)))
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 Invitation -> Int -> GetAdministratorAccountResponse
GetAdministratorAccountResponse'
(Maybe Invitation -> Int -> GetAdministratorAccountResponse)
-> Either String (Maybe Invitation)
-> Either String (Int -> GetAdministratorAccountResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Key -> Either String (Maybe Invitation)
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Core..?> Key
"Administrator")
Either String (Int -> GetAdministratorAccountResponse)
-> Either String Int
-> Either String GetAdministratorAccountResponse
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))
)
instance Prelude.Hashable GetAdministratorAccount
instance Prelude.NFData GetAdministratorAccount
instance Core.ToHeaders GetAdministratorAccount where
toHeaders :: GetAdministratorAccount -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetAdministratorAccount -> 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 GetAdministratorAccount where
toPath :: GetAdministratorAccount -> ByteString
toPath = ByteString -> GetAdministratorAccount -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/administrator"
instance Core.ToQuery GetAdministratorAccount where
toQuery :: GetAdministratorAccount -> QueryString
toQuery = QueryString -> GetAdministratorAccount -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetAdministratorAccountResponse = GetAdministratorAccountResponse'
{ GetAdministratorAccountResponse -> Maybe Invitation
administrator :: Prelude.Maybe Invitation,
GetAdministratorAccountResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetAdministratorAccountResponse
-> GetAdministratorAccountResponse -> Bool
(GetAdministratorAccountResponse
-> GetAdministratorAccountResponse -> Bool)
-> (GetAdministratorAccountResponse
-> GetAdministratorAccountResponse -> Bool)
-> Eq GetAdministratorAccountResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAdministratorAccountResponse
-> GetAdministratorAccountResponse -> Bool
$c/= :: GetAdministratorAccountResponse
-> GetAdministratorAccountResponse -> Bool
== :: GetAdministratorAccountResponse
-> GetAdministratorAccountResponse -> Bool
$c== :: GetAdministratorAccountResponse
-> GetAdministratorAccountResponse -> Bool
Prelude.Eq, ReadPrec [GetAdministratorAccountResponse]
ReadPrec GetAdministratorAccountResponse
Int -> ReadS GetAdministratorAccountResponse
ReadS [GetAdministratorAccountResponse]
(Int -> ReadS GetAdministratorAccountResponse)
-> ReadS [GetAdministratorAccountResponse]
-> ReadPrec GetAdministratorAccountResponse
-> ReadPrec [GetAdministratorAccountResponse]
-> Read GetAdministratorAccountResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAdministratorAccountResponse]
$creadListPrec :: ReadPrec [GetAdministratorAccountResponse]
readPrec :: ReadPrec GetAdministratorAccountResponse
$creadPrec :: ReadPrec GetAdministratorAccountResponse
readList :: ReadS [GetAdministratorAccountResponse]
$creadList :: ReadS [GetAdministratorAccountResponse]
readsPrec :: Int -> ReadS GetAdministratorAccountResponse
$creadsPrec :: Int -> ReadS GetAdministratorAccountResponse
Prelude.Read, Int -> GetAdministratorAccountResponse -> ShowS
[GetAdministratorAccountResponse] -> ShowS
GetAdministratorAccountResponse -> String
(Int -> GetAdministratorAccountResponse -> ShowS)
-> (GetAdministratorAccountResponse -> String)
-> ([GetAdministratorAccountResponse] -> ShowS)
-> Show GetAdministratorAccountResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAdministratorAccountResponse] -> ShowS
$cshowList :: [GetAdministratorAccountResponse] -> ShowS
show :: GetAdministratorAccountResponse -> String
$cshow :: GetAdministratorAccountResponse -> String
showsPrec :: Int -> GetAdministratorAccountResponse -> ShowS
$cshowsPrec :: Int -> GetAdministratorAccountResponse -> ShowS
Prelude.Show, (forall x.
GetAdministratorAccountResponse
-> Rep GetAdministratorAccountResponse x)
-> (forall x.
Rep GetAdministratorAccountResponse x
-> GetAdministratorAccountResponse)
-> Generic GetAdministratorAccountResponse
forall x.
Rep GetAdministratorAccountResponse x
-> GetAdministratorAccountResponse
forall x.
GetAdministratorAccountResponse
-> Rep GetAdministratorAccountResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetAdministratorAccountResponse x
-> GetAdministratorAccountResponse
$cfrom :: forall x.
GetAdministratorAccountResponse
-> Rep GetAdministratorAccountResponse x
Prelude.Generic)
newGetAdministratorAccountResponse ::
Prelude.Int ->
GetAdministratorAccountResponse
newGetAdministratorAccountResponse :: Int -> GetAdministratorAccountResponse
newGetAdministratorAccountResponse Int
pHttpStatus_ =
GetAdministratorAccountResponse' :: Maybe Invitation -> Int -> GetAdministratorAccountResponse
GetAdministratorAccountResponse'
{ $sel:administrator:GetAdministratorAccountResponse' :: Maybe Invitation
administrator =
Maybe Invitation
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetAdministratorAccountResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getAdministratorAccountResponse_administrator :: Lens.Lens' GetAdministratorAccountResponse (Prelude.Maybe Invitation)
getAdministratorAccountResponse_administrator :: (Maybe Invitation -> f (Maybe Invitation))
-> GetAdministratorAccountResponse
-> f GetAdministratorAccountResponse
getAdministratorAccountResponse_administrator = (GetAdministratorAccountResponse -> Maybe Invitation)
-> (GetAdministratorAccountResponse
-> Maybe Invitation -> GetAdministratorAccountResponse)
-> Lens
GetAdministratorAccountResponse
GetAdministratorAccountResponse
(Maybe Invitation)
(Maybe Invitation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAdministratorAccountResponse' {Maybe Invitation
administrator :: Maybe Invitation
$sel:administrator:GetAdministratorAccountResponse' :: GetAdministratorAccountResponse -> Maybe Invitation
administrator} -> Maybe Invitation
administrator) (\s :: GetAdministratorAccountResponse
s@GetAdministratorAccountResponse' {} Maybe Invitation
a -> GetAdministratorAccountResponse
s {$sel:administrator:GetAdministratorAccountResponse' :: Maybe Invitation
administrator = Maybe Invitation
a} :: GetAdministratorAccountResponse)
getAdministratorAccountResponse_httpStatus :: Lens.Lens' GetAdministratorAccountResponse Prelude.Int
getAdministratorAccountResponse_httpStatus :: (Int -> f Int)
-> GetAdministratorAccountResponse
-> f GetAdministratorAccountResponse
getAdministratorAccountResponse_httpStatus = (GetAdministratorAccountResponse -> Int)
-> (GetAdministratorAccountResponse
-> Int -> GetAdministratorAccountResponse)
-> Lens
GetAdministratorAccountResponse
GetAdministratorAccountResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAdministratorAccountResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetAdministratorAccountResponse' :: GetAdministratorAccountResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetAdministratorAccountResponse
s@GetAdministratorAccountResponse' {} Int
a -> GetAdministratorAccountResponse
s {$sel:httpStatus:GetAdministratorAccountResponse' :: Int
httpStatus = Int
a} :: GetAdministratorAccountResponse)
instance
Prelude.NFData
GetAdministratorAccountResponse