{-# 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.RegisterCrossAccountAccessRole
(
RegisterCrossAccountAccessRole (..),
newRegisterCrossAccountAccessRole,
registerCrossAccountAccessRole_roleArn,
RegisterCrossAccountAccessRoleResponse (..),
newRegisterCrossAccountAccessRoleResponse,
)
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 RegisterCrossAccountAccessRole = RegisterCrossAccountAccessRole'
{
RegisterCrossAccountAccessRole -> Text
roleArn :: Prelude.Text
}
deriving (RegisterCrossAccountAccessRole
-> RegisterCrossAccountAccessRole -> Bool
(RegisterCrossAccountAccessRole
-> RegisterCrossAccountAccessRole -> Bool)
-> (RegisterCrossAccountAccessRole
-> RegisterCrossAccountAccessRole -> Bool)
-> Eq RegisterCrossAccountAccessRole
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisterCrossAccountAccessRole
-> RegisterCrossAccountAccessRole -> Bool
$c/= :: RegisterCrossAccountAccessRole
-> RegisterCrossAccountAccessRole -> Bool
== :: RegisterCrossAccountAccessRole
-> RegisterCrossAccountAccessRole -> Bool
$c== :: RegisterCrossAccountAccessRole
-> RegisterCrossAccountAccessRole -> Bool
Prelude.Eq, ReadPrec [RegisterCrossAccountAccessRole]
ReadPrec RegisterCrossAccountAccessRole
Int -> ReadS RegisterCrossAccountAccessRole
ReadS [RegisterCrossAccountAccessRole]
(Int -> ReadS RegisterCrossAccountAccessRole)
-> ReadS [RegisterCrossAccountAccessRole]
-> ReadPrec RegisterCrossAccountAccessRole
-> ReadPrec [RegisterCrossAccountAccessRole]
-> Read RegisterCrossAccountAccessRole
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisterCrossAccountAccessRole]
$creadListPrec :: ReadPrec [RegisterCrossAccountAccessRole]
readPrec :: ReadPrec RegisterCrossAccountAccessRole
$creadPrec :: ReadPrec RegisterCrossAccountAccessRole
readList :: ReadS [RegisterCrossAccountAccessRole]
$creadList :: ReadS [RegisterCrossAccountAccessRole]
readsPrec :: Int -> ReadS RegisterCrossAccountAccessRole
$creadsPrec :: Int -> ReadS RegisterCrossAccountAccessRole
Prelude.Read, Int -> RegisterCrossAccountAccessRole -> ShowS
[RegisterCrossAccountAccessRole] -> ShowS
RegisterCrossAccountAccessRole -> String
(Int -> RegisterCrossAccountAccessRole -> ShowS)
-> (RegisterCrossAccountAccessRole -> String)
-> ([RegisterCrossAccountAccessRole] -> ShowS)
-> Show RegisterCrossAccountAccessRole
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisterCrossAccountAccessRole] -> ShowS
$cshowList :: [RegisterCrossAccountAccessRole] -> ShowS
show :: RegisterCrossAccountAccessRole -> String
$cshow :: RegisterCrossAccountAccessRole -> String
showsPrec :: Int -> RegisterCrossAccountAccessRole -> ShowS
$cshowsPrec :: Int -> RegisterCrossAccountAccessRole -> ShowS
Prelude.Show, (forall x.
RegisterCrossAccountAccessRole
-> Rep RegisterCrossAccountAccessRole x)
-> (forall x.
Rep RegisterCrossAccountAccessRole x
-> RegisterCrossAccountAccessRole)
-> Generic RegisterCrossAccountAccessRole
forall x.
Rep RegisterCrossAccountAccessRole x
-> RegisterCrossAccountAccessRole
forall x.
RegisterCrossAccountAccessRole
-> Rep RegisterCrossAccountAccessRole x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RegisterCrossAccountAccessRole x
-> RegisterCrossAccountAccessRole
$cfrom :: forall x.
RegisterCrossAccountAccessRole
-> Rep RegisterCrossAccountAccessRole x
Prelude.Generic)
newRegisterCrossAccountAccessRole ::
Prelude.Text ->
RegisterCrossAccountAccessRole
newRegisterCrossAccountAccessRole :: Text -> RegisterCrossAccountAccessRole
newRegisterCrossAccountAccessRole Text
pRoleArn_ =
RegisterCrossAccountAccessRole' :: Text -> RegisterCrossAccountAccessRole
RegisterCrossAccountAccessRole'
{ $sel:roleArn:RegisterCrossAccountAccessRole' :: Text
roleArn =
Text
pRoleArn_
}
registerCrossAccountAccessRole_roleArn :: Lens.Lens' RegisterCrossAccountAccessRole Prelude.Text
registerCrossAccountAccessRole_roleArn :: (Text -> f Text)
-> RegisterCrossAccountAccessRole
-> f RegisterCrossAccountAccessRole
registerCrossAccountAccessRole_roleArn = (RegisterCrossAccountAccessRole -> Text)
-> (RegisterCrossAccountAccessRole
-> Text -> RegisterCrossAccountAccessRole)
-> Lens
RegisterCrossAccountAccessRole
RegisterCrossAccountAccessRole
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegisterCrossAccountAccessRole' {Text
roleArn :: Text
$sel:roleArn:RegisterCrossAccountAccessRole' :: RegisterCrossAccountAccessRole -> Text
roleArn} -> Text
roleArn) (\s :: RegisterCrossAccountAccessRole
s@RegisterCrossAccountAccessRole' {} Text
a -> RegisterCrossAccountAccessRole
s {$sel:roleArn:RegisterCrossAccountAccessRole' :: Text
roleArn = Text
a} :: RegisterCrossAccountAccessRole)
instance
Core.AWSRequest
RegisterCrossAccountAccessRole
where
type
AWSResponse RegisterCrossAccountAccessRole =
RegisterCrossAccountAccessRoleResponse
request :: RegisterCrossAccountAccessRole
-> Request RegisterCrossAccountAccessRole
request = Service
-> RegisterCrossAccountAccessRole
-> Request RegisterCrossAccountAccessRole
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy RegisterCrossAccountAccessRole
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse RegisterCrossAccountAccessRole)))
response =
AWSResponse RegisterCrossAccountAccessRole
-> Logger
-> Service
-> Proxy RegisterCrossAccountAccessRole
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse RegisterCrossAccountAccessRole)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse RegisterCrossAccountAccessRole
RegisterCrossAccountAccessRoleResponse
RegisterCrossAccountAccessRoleResponse'
instance
Prelude.Hashable
RegisterCrossAccountAccessRole
instance
Prelude.NFData
RegisterCrossAccountAccessRole
instance
Core.ToHeaders
RegisterCrossAccountAccessRole
where
toHeaders :: RegisterCrossAccountAccessRole -> [Header]
toHeaders =
[Header] -> RegisterCrossAccountAccessRole -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"InspectorService.RegisterCrossAccountAccessRole" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON RegisterCrossAccountAccessRole where
toJSON :: RegisterCrossAccountAccessRole -> Value
toJSON RegisterCrossAccountAccessRole' {Text
roleArn :: Text
$sel:roleArn:RegisterCrossAccountAccessRole' :: RegisterCrossAccountAccessRole -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"roleArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
roleArn)]
)
instance Core.ToPath RegisterCrossAccountAccessRole where
toPath :: RegisterCrossAccountAccessRole -> ByteString
toPath = ByteString -> RegisterCrossAccountAccessRole -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery RegisterCrossAccountAccessRole where
toQuery :: RegisterCrossAccountAccessRole -> QueryString
toQuery = QueryString -> RegisterCrossAccountAccessRole -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data RegisterCrossAccountAccessRoleResponse = RegisterCrossAccountAccessRoleResponse'
{
}
deriving (RegisterCrossAccountAccessRoleResponse
-> RegisterCrossAccountAccessRoleResponse -> Bool
(RegisterCrossAccountAccessRoleResponse
-> RegisterCrossAccountAccessRoleResponse -> Bool)
-> (RegisterCrossAccountAccessRoleResponse
-> RegisterCrossAccountAccessRoleResponse -> Bool)
-> Eq RegisterCrossAccountAccessRoleResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegisterCrossAccountAccessRoleResponse
-> RegisterCrossAccountAccessRoleResponse -> Bool
$c/= :: RegisterCrossAccountAccessRoleResponse
-> RegisterCrossAccountAccessRoleResponse -> Bool
== :: RegisterCrossAccountAccessRoleResponse
-> RegisterCrossAccountAccessRoleResponse -> Bool
$c== :: RegisterCrossAccountAccessRoleResponse
-> RegisterCrossAccountAccessRoleResponse -> Bool
Prelude.Eq, ReadPrec [RegisterCrossAccountAccessRoleResponse]
ReadPrec RegisterCrossAccountAccessRoleResponse
Int -> ReadS RegisterCrossAccountAccessRoleResponse
ReadS [RegisterCrossAccountAccessRoleResponse]
(Int -> ReadS RegisterCrossAccountAccessRoleResponse)
-> ReadS [RegisterCrossAccountAccessRoleResponse]
-> ReadPrec RegisterCrossAccountAccessRoleResponse
-> ReadPrec [RegisterCrossAccountAccessRoleResponse]
-> Read RegisterCrossAccountAccessRoleResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegisterCrossAccountAccessRoleResponse]
$creadListPrec :: ReadPrec [RegisterCrossAccountAccessRoleResponse]
readPrec :: ReadPrec RegisterCrossAccountAccessRoleResponse
$creadPrec :: ReadPrec RegisterCrossAccountAccessRoleResponse
readList :: ReadS [RegisterCrossAccountAccessRoleResponse]
$creadList :: ReadS [RegisterCrossAccountAccessRoleResponse]
readsPrec :: Int -> ReadS RegisterCrossAccountAccessRoleResponse
$creadsPrec :: Int -> ReadS RegisterCrossAccountAccessRoleResponse
Prelude.Read, Int -> RegisterCrossAccountAccessRoleResponse -> ShowS
[RegisterCrossAccountAccessRoleResponse] -> ShowS
RegisterCrossAccountAccessRoleResponse -> String
(Int -> RegisterCrossAccountAccessRoleResponse -> ShowS)
-> (RegisterCrossAccountAccessRoleResponse -> String)
-> ([RegisterCrossAccountAccessRoleResponse] -> ShowS)
-> Show RegisterCrossAccountAccessRoleResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegisterCrossAccountAccessRoleResponse] -> ShowS
$cshowList :: [RegisterCrossAccountAccessRoleResponse] -> ShowS
show :: RegisterCrossAccountAccessRoleResponse -> String
$cshow :: RegisterCrossAccountAccessRoleResponse -> String
showsPrec :: Int -> RegisterCrossAccountAccessRoleResponse -> ShowS
$cshowsPrec :: Int -> RegisterCrossAccountAccessRoleResponse -> ShowS
Prelude.Show, (forall x.
RegisterCrossAccountAccessRoleResponse
-> Rep RegisterCrossAccountAccessRoleResponse x)
-> (forall x.
Rep RegisterCrossAccountAccessRoleResponse x
-> RegisterCrossAccountAccessRoleResponse)
-> Generic RegisterCrossAccountAccessRoleResponse
forall x.
Rep RegisterCrossAccountAccessRoleResponse x
-> RegisterCrossAccountAccessRoleResponse
forall x.
RegisterCrossAccountAccessRoleResponse
-> Rep RegisterCrossAccountAccessRoleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RegisterCrossAccountAccessRoleResponse x
-> RegisterCrossAccountAccessRoleResponse
$cfrom :: forall x.
RegisterCrossAccountAccessRoleResponse
-> Rep RegisterCrossAccountAccessRoleResponse x
Prelude.Generic)
newRegisterCrossAccountAccessRoleResponse ::
RegisterCrossAccountAccessRoleResponse
newRegisterCrossAccountAccessRoleResponse :: RegisterCrossAccountAccessRoleResponse
newRegisterCrossAccountAccessRoleResponse =
RegisterCrossAccountAccessRoleResponse
RegisterCrossAccountAccessRoleResponse'
instance
Prelude.NFData
RegisterCrossAccountAccessRoleResponse