{-# 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.Inspector.DescribeCrossAccountAccessRole
(
DescribeCrossAccountAccessRole (..),
newDescribeCrossAccountAccessRole,
DescribeCrossAccountAccessRoleResponse (..),
newDescribeCrossAccountAccessRoleResponse,
describeCrossAccountAccessRoleResponse_httpStatus,
describeCrossAccountAccessRoleResponse_roleArn,
describeCrossAccountAccessRoleResponse_valid,
describeCrossAccountAccessRoleResponse_registeredAt,
)
where
import qualified Amazonka.Core as Core
import Amazonka.Inspector.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 DescribeCrossAccountAccessRole = DescribeCrossAccountAccessRole'
{
}
deriving (DescribeCrossAccountAccessRole
-> DescribeCrossAccountAccessRole -> Bool
(DescribeCrossAccountAccessRole
-> DescribeCrossAccountAccessRole -> Bool)
-> (DescribeCrossAccountAccessRole
-> DescribeCrossAccountAccessRole -> Bool)
-> Eq DescribeCrossAccountAccessRole
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCrossAccountAccessRole
-> DescribeCrossAccountAccessRole -> Bool
$c/= :: DescribeCrossAccountAccessRole
-> DescribeCrossAccountAccessRole -> Bool
== :: DescribeCrossAccountAccessRole
-> DescribeCrossAccountAccessRole -> Bool
$c== :: DescribeCrossAccountAccessRole
-> DescribeCrossAccountAccessRole -> Bool
Prelude.Eq, ReadPrec [DescribeCrossAccountAccessRole]
ReadPrec DescribeCrossAccountAccessRole
Int -> ReadS DescribeCrossAccountAccessRole
ReadS [DescribeCrossAccountAccessRole]
(Int -> ReadS DescribeCrossAccountAccessRole)
-> ReadS [DescribeCrossAccountAccessRole]
-> ReadPrec DescribeCrossAccountAccessRole
-> ReadPrec [DescribeCrossAccountAccessRole]
-> Read DescribeCrossAccountAccessRole
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCrossAccountAccessRole]
$creadListPrec :: ReadPrec [DescribeCrossAccountAccessRole]
readPrec :: ReadPrec DescribeCrossAccountAccessRole
$creadPrec :: ReadPrec DescribeCrossAccountAccessRole
readList :: ReadS [DescribeCrossAccountAccessRole]
$creadList :: ReadS [DescribeCrossAccountAccessRole]
readsPrec :: Int -> ReadS DescribeCrossAccountAccessRole
$creadsPrec :: Int -> ReadS DescribeCrossAccountAccessRole
Prelude.Read, Int -> DescribeCrossAccountAccessRole -> ShowS
[DescribeCrossAccountAccessRole] -> ShowS
DescribeCrossAccountAccessRole -> String
(Int -> DescribeCrossAccountAccessRole -> ShowS)
-> (DescribeCrossAccountAccessRole -> String)
-> ([DescribeCrossAccountAccessRole] -> ShowS)
-> Show DescribeCrossAccountAccessRole
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCrossAccountAccessRole] -> ShowS
$cshowList :: [DescribeCrossAccountAccessRole] -> ShowS
show :: DescribeCrossAccountAccessRole -> String
$cshow :: DescribeCrossAccountAccessRole -> String
showsPrec :: Int -> DescribeCrossAccountAccessRole -> ShowS
$cshowsPrec :: Int -> DescribeCrossAccountAccessRole -> ShowS
Prelude.Show, (forall x.
DescribeCrossAccountAccessRole
-> Rep DescribeCrossAccountAccessRole x)
-> (forall x.
Rep DescribeCrossAccountAccessRole x
-> DescribeCrossAccountAccessRole)
-> Generic DescribeCrossAccountAccessRole
forall x.
Rep DescribeCrossAccountAccessRole x
-> DescribeCrossAccountAccessRole
forall x.
DescribeCrossAccountAccessRole
-> Rep DescribeCrossAccountAccessRole x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeCrossAccountAccessRole x
-> DescribeCrossAccountAccessRole
$cfrom :: forall x.
DescribeCrossAccountAccessRole
-> Rep DescribeCrossAccountAccessRole x
Prelude.Generic)
newDescribeCrossAccountAccessRole ::
DescribeCrossAccountAccessRole
newDescribeCrossAccountAccessRole :: DescribeCrossAccountAccessRole
newDescribeCrossAccountAccessRole =
DescribeCrossAccountAccessRole
DescribeCrossAccountAccessRole'
instance
Core.AWSRequest
DescribeCrossAccountAccessRole
where
type
AWSResponse DescribeCrossAccountAccessRole =
DescribeCrossAccountAccessRoleResponse
request :: DescribeCrossAccountAccessRole
-> Request DescribeCrossAccountAccessRole
request = Service
-> DescribeCrossAccountAccessRole
-> Request DescribeCrossAccountAccessRole
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeCrossAccountAccessRole
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DescribeCrossAccountAccessRole)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeCrossAccountAccessRole))
-> Logger
-> Service
-> Proxy DescribeCrossAccountAccessRole
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DescribeCrossAccountAccessRole)))
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 ->
Int
-> Text -> Bool -> POSIX -> DescribeCrossAccountAccessRoleResponse
DescribeCrossAccountAccessRoleResponse'
(Int
-> Text -> Bool -> POSIX -> DescribeCrossAccountAccessRoleResponse)
-> Either String Int
-> Either
String
(Text -> Bool -> POSIX -> DescribeCrossAccountAccessRoleResponse)
forall (f :: * -> *) a b. Functor 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
(Text -> Bool -> POSIX -> DescribeCrossAccountAccessRoleResponse)
-> Either String Text
-> Either
String (Bool -> POSIX -> DescribeCrossAccountAccessRoleResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"roleArn")
Either
String (Bool -> POSIX -> DescribeCrossAccountAccessRoleResponse)
-> Either String Bool
-> Either String (POSIX -> DescribeCrossAccountAccessRoleResponse)
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
"valid")
Either String (POSIX -> DescribeCrossAccountAccessRoleResponse)
-> Either String POSIX
-> Either String DescribeCrossAccountAccessRoleResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String POSIX
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"registeredAt")
)
instance
Prelude.Hashable
DescribeCrossAccountAccessRole
instance
Prelude.NFData
DescribeCrossAccountAccessRole
instance
Core.ToHeaders
DescribeCrossAccountAccessRole
where
toHeaders :: DescribeCrossAccountAccessRole -> ResponseHeaders
toHeaders =
ResponseHeaders
-> DescribeCrossAccountAccessRole -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"InspectorService.DescribeCrossAccountAccessRole" ::
Prelude.ByteString
),
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.ToJSON DescribeCrossAccountAccessRole where
toJSON :: DescribeCrossAccountAccessRole -> Value
toJSON = Value -> DescribeCrossAccountAccessRole -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)
instance Core.ToPath DescribeCrossAccountAccessRole where
toPath :: DescribeCrossAccountAccessRole -> ByteString
toPath = ByteString -> DescribeCrossAccountAccessRole -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeCrossAccountAccessRole where
toQuery :: DescribeCrossAccountAccessRole -> QueryString
toQuery = QueryString -> DescribeCrossAccountAccessRole -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeCrossAccountAccessRoleResponse = DescribeCrossAccountAccessRoleResponse'
{
DescribeCrossAccountAccessRoleResponse -> Int
httpStatus :: Prelude.Int,
DescribeCrossAccountAccessRoleResponse -> Text
roleArn :: Prelude.Text,
DescribeCrossAccountAccessRoleResponse -> Bool
valid :: Prelude.Bool,
DescribeCrossAccountAccessRoleResponse -> POSIX
registeredAt :: Core.POSIX
}
deriving (DescribeCrossAccountAccessRoleResponse
-> DescribeCrossAccountAccessRoleResponse -> Bool
(DescribeCrossAccountAccessRoleResponse
-> DescribeCrossAccountAccessRoleResponse -> Bool)
-> (DescribeCrossAccountAccessRoleResponse
-> DescribeCrossAccountAccessRoleResponse -> Bool)
-> Eq DescribeCrossAccountAccessRoleResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeCrossAccountAccessRoleResponse
-> DescribeCrossAccountAccessRoleResponse -> Bool
$c/= :: DescribeCrossAccountAccessRoleResponse
-> DescribeCrossAccountAccessRoleResponse -> Bool
== :: DescribeCrossAccountAccessRoleResponse
-> DescribeCrossAccountAccessRoleResponse -> Bool
$c== :: DescribeCrossAccountAccessRoleResponse
-> DescribeCrossAccountAccessRoleResponse -> Bool
Prelude.Eq, ReadPrec [DescribeCrossAccountAccessRoleResponse]
ReadPrec DescribeCrossAccountAccessRoleResponse
Int -> ReadS DescribeCrossAccountAccessRoleResponse
ReadS [DescribeCrossAccountAccessRoleResponse]
(Int -> ReadS DescribeCrossAccountAccessRoleResponse)
-> ReadS [DescribeCrossAccountAccessRoleResponse]
-> ReadPrec DescribeCrossAccountAccessRoleResponse
-> ReadPrec [DescribeCrossAccountAccessRoleResponse]
-> Read DescribeCrossAccountAccessRoleResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeCrossAccountAccessRoleResponse]
$creadListPrec :: ReadPrec [DescribeCrossAccountAccessRoleResponse]
readPrec :: ReadPrec DescribeCrossAccountAccessRoleResponse
$creadPrec :: ReadPrec DescribeCrossAccountAccessRoleResponse
readList :: ReadS [DescribeCrossAccountAccessRoleResponse]
$creadList :: ReadS [DescribeCrossAccountAccessRoleResponse]
readsPrec :: Int -> ReadS DescribeCrossAccountAccessRoleResponse
$creadsPrec :: Int -> ReadS DescribeCrossAccountAccessRoleResponse
Prelude.Read, Int -> DescribeCrossAccountAccessRoleResponse -> ShowS
[DescribeCrossAccountAccessRoleResponse] -> ShowS
DescribeCrossAccountAccessRoleResponse -> String
(Int -> DescribeCrossAccountAccessRoleResponse -> ShowS)
-> (DescribeCrossAccountAccessRoleResponse -> String)
-> ([DescribeCrossAccountAccessRoleResponse] -> ShowS)
-> Show DescribeCrossAccountAccessRoleResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeCrossAccountAccessRoleResponse] -> ShowS
$cshowList :: [DescribeCrossAccountAccessRoleResponse] -> ShowS
show :: DescribeCrossAccountAccessRoleResponse -> String
$cshow :: DescribeCrossAccountAccessRoleResponse -> String
showsPrec :: Int -> DescribeCrossAccountAccessRoleResponse -> ShowS
$cshowsPrec :: Int -> DescribeCrossAccountAccessRoleResponse -> ShowS
Prelude.Show, (forall x.
DescribeCrossAccountAccessRoleResponse
-> Rep DescribeCrossAccountAccessRoleResponse x)
-> (forall x.
Rep DescribeCrossAccountAccessRoleResponse x
-> DescribeCrossAccountAccessRoleResponse)
-> Generic DescribeCrossAccountAccessRoleResponse
forall x.
Rep DescribeCrossAccountAccessRoleResponse x
-> DescribeCrossAccountAccessRoleResponse
forall x.
DescribeCrossAccountAccessRoleResponse
-> Rep DescribeCrossAccountAccessRoleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeCrossAccountAccessRoleResponse x
-> DescribeCrossAccountAccessRoleResponse
$cfrom :: forall x.
DescribeCrossAccountAccessRoleResponse
-> Rep DescribeCrossAccountAccessRoleResponse x
Prelude.Generic)
newDescribeCrossAccountAccessRoleResponse ::
Prelude.Int ->
Prelude.Text ->
Prelude.Bool ->
Prelude.UTCTime ->
DescribeCrossAccountAccessRoleResponse
newDescribeCrossAccountAccessRoleResponse :: Int
-> Text
-> Bool
-> UTCTime
-> DescribeCrossAccountAccessRoleResponse
newDescribeCrossAccountAccessRoleResponse
Int
pHttpStatus_
Text
pRoleArn_
Bool
pValid_
UTCTime
pRegisteredAt_ =
DescribeCrossAccountAccessRoleResponse' :: Int
-> Text -> Bool -> POSIX -> DescribeCrossAccountAccessRoleResponse
DescribeCrossAccountAccessRoleResponse'
{ $sel:httpStatus:DescribeCrossAccountAccessRoleResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:roleArn:DescribeCrossAccountAccessRoleResponse' :: Text
roleArn = Text
pRoleArn_,
$sel:valid:DescribeCrossAccountAccessRoleResponse' :: Bool
valid = Bool
pValid_,
$sel:registeredAt:DescribeCrossAccountAccessRoleResponse' :: POSIX
registeredAt =
Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pRegisteredAt_
}
describeCrossAccountAccessRoleResponse_httpStatus :: Lens.Lens' DescribeCrossAccountAccessRoleResponse Prelude.Int
describeCrossAccountAccessRoleResponse_httpStatus :: (Int -> f Int)
-> DescribeCrossAccountAccessRoleResponse
-> f DescribeCrossAccountAccessRoleResponse
describeCrossAccountAccessRoleResponse_httpStatus = (DescribeCrossAccountAccessRoleResponse -> Int)
-> (DescribeCrossAccountAccessRoleResponse
-> Int -> DescribeCrossAccountAccessRoleResponse)
-> Lens
DescribeCrossAccountAccessRoleResponse
DescribeCrossAccountAccessRoleResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCrossAccountAccessRoleResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeCrossAccountAccessRoleResponse' :: DescribeCrossAccountAccessRoleResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeCrossAccountAccessRoleResponse
s@DescribeCrossAccountAccessRoleResponse' {} Int
a -> DescribeCrossAccountAccessRoleResponse
s {$sel:httpStatus:DescribeCrossAccountAccessRoleResponse' :: Int
httpStatus = Int
a} :: DescribeCrossAccountAccessRoleResponse)
describeCrossAccountAccessRoleResponse_roleArn :: Lens.Lens' DescribeCrossAccountAccessRoleResponse Prelude.Text
describeCrossAccountAccessRoleResponse_roleArn :: (Text -> f Text)
-> DescribeCrossAccountAccessRoleResponse
-> f DescribeCrossAccountAccessRoleResponse
describeCrossAccountAccessRoleResponse_roleArn = (DescribeCrossAccountAccessRoleResponse -> Text)
-> (DescribeCrossAccountAccessRoleResponse
-> Text -> DescribeCrossAccountAccessRoleResponse)
-> Lens
DescribeCrossAccountAccessRoleResponse
DescribeCrossAccountAccessRoleResponse
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCrossAccountAccessRoleResponse' {Text
roleArn :: Text
$sel:roleArn:DescribeCrossAccountAccessRoleResponse' :: DescribeCrossAccountAccessRoleResponse -> Text
roleArn} -> Text
roleArn) (\s :: DescribeCrossAccountAccessRoleResponse
s@DescribeCrossAccountAccessRoleResponse' {} Text
a -> DescribeCrossAccountAccessRoleResponse
s {$sel:roleArn:DescribeCrossAccountAccessRoleResponse' :: Text
roleArn = Text
a} :: DescribeCrossAccountAccessRoleResponse)
describeCrossAccountAccessRoleResponse_valid :: Lens.Lens' DescribeCrossAccountAccessRoleResponse Prelude.Bool
describeCrossAccountAccessRoleResponse_valid :: (Bool -> f Bool)
-> DescribeCrossAccountAccessRoleResponse
-> f DescribeCrossAccountAccessRoleResponse
describeCrossAccountAccessRoleResponse_valid = (DescribeCrossAccountAccessRoleResponse -> Bool)
-> (DescribeCrossAccountAccessRoleResponse
-> Bool -> DescribeCrossAccountAccessRoleResponse)
-> Lens
DescribeCrossAccountAccessRoleResponse
DescribeCrossAccountAccessRoleResponse
Bool
Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCrossAccountAccessRoleResponse' {Bool
valid :: Bool
$sel:valid:DescribeCrossAccountAccessRoleResponse' :: DescribeCrossAccountAccessRoleResponse -> Bool
valid} -> Bool
valid) (\s :: DescribeCrossAccountAccessRoleResponse
s@DescribeCrossAccountAccessRoleResponse' {} Bool
a -> DescribeCrossAccountAccessRoleResponse
s {$sel:valid:DescribeCrossAccountAccessRoleResponse' :: Bool
valid = Bool
a} :: DescribeCrossAccountAccessRoleResponse)
describeCrossAccountAccessRoleResponse_registeredAt :: Lens.Lens' DescribeCrossAccountAccessRoleResponse Prelude.UTCTime
describeCrossAccountAccessRoleResponse_registeredAt :: (UTCTime -> f UTCTime)
-> DescribeCrossAccountAccessRoleResponse
-> f DescribeCrossAccountAccessRoleResponse
describeCrossAccountAccessRoleResponse_registeredAt = (DescribeCrossAccountAccessRoleResponse -> POSIX)
-> (DescribeCrossAccountAccessRoleResponse
-> POSIX -> DescribeCrossAccountAccessRoleResponse)
-> Lens
DescribeCrossAccountAccessRoleResponse
DescribeCrossAccountAccessRoleResponse
POSIX
POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeCrossAccountAccessRoleResponse' {POSIX
registeredAt :: POSIX
$sel:registeredAt:DescribeCrossAccountAccessRoleResponse' :: DescribeCrossAccountAccessRoleResponse -> POSIX
registeredAt} -> POSIX
registeredAt) (\s :: DescribeCrossAccountAccessRoleResponse
s@DescribeCrossAccountAccessRoleResponse' {} POSIX
a -> DescribeCrossAccountAccessRoleResponse
s {$sel:registeredAt:DescribeCrossAccountAccessRoleResponse' :: POSIX
registeredAt = POSIX
a} :: DescribeCrossAccountAccessRoleResponse) ((POSIX -> f POSIX)
-> DescribeCrossAccountAccessRoleResponse
-> f DescribeCrossAccountAccessRoleResponse)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> DescribeCrossAccountAccessRoleResponse
-> f DescribeCrossAccountAccessRoleResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance
Prelude.NFData
DescribeCrossAccountAccessRoleResponse