{-# 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.AuditManager.StartAssessmentFrameworkShare
(
StartAssessmentFrameworkShare (..),
newStartAssessmentFrameworkShare,
startAssessmentFrameworkShare_comment,
startAssessmentFrameworkShare_frameworkId,
startAssessmentFrameworkShare_destinationAccount,
startAssessmentFrameworkShare_destinationRegion,
StartAssessmentFrameworkShareResponse (..),
newStartAssessmentFrameworkShareResponse,
startAssessmentFrameworkShareResponse_assessmentFrameworkShareRequest,
startAssessmentFrameworkShareResponse_httpStatus,
)
where
import Amazonka.AuditManager.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data StartAssessmentFrameworkShare = StartAssessmentFrameworkShare'
{
:: Prelude.Maybe Prelude.Text,
StartAssessmentFrameworkShare -> Text
frameworkId :: Prelude.Text,
StartAssessmentFrameworkShare -> Text
destinationAccount :: Prelude.Text,
StartAssessmentFrameworkShare -> Text
destinationRegion :: Prelude.Text
}
deriving (StartAssessmentFrameworkShare
-> StartAssessmentFrameworkShare -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartAssessmentFrameworkShare
-> StartAssessmentFrameworkShare -> Bool
$c/= :: StartAssessmentFrameworkShare
-> StartAssessmentFrameworkShare -> Bool
== :: StartAssessmentFrameworkShare
-> StartAssessmentFrameworkShare -> Bool
$c== :: StartAssessmentFrameworkShare
-> StartAssessmentFrameworkShare -> Bool
Prelude.Eq, ReadPrec [StartAssessmentFrameworkShare]
ReadPrec StartAssessmentFrameworkShare
Int -> ReadS StartAssessmentFrameworkShare
ReadS [StartAssessmentFrameworkShare]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartAssessmentFrameworkShare]
$creadListPrec :: ReadPrec [StartAssessmentFrameworkShare]
readPrec :: ReadPrec StartAssessmentFrameworkShare
$creadPrec :: ReadPrec StartAssessmentFrameworkShare
readList :: ReadS [StartAssessmentFrameworkShare]
$creadList :: ReadS [StartAssessmentFrameworkShare]
readsPrec :: Int -> ReadS StartAssessmentFrameworkShare
$creadsPrec :: Int -> ReadS StartAssessmentFrameworkShare
Prelude.Read, Int -> StartAssessmentFrameworkShare -> ShowS
[StartAssessmentFrameworkShare] -> ShowS
StartAssessmentFrameworkShare -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartAssessmentFrameworkShare] -> ShowS
$cshowList :: [StartAssessmentFrameworkShare] -> ShowS
show :: StartAssessmentFrameworkShare -> String
$cshow :: StartAssessmentFrameworkShare -> String
showsPrec :: Int -> StartAssessmentFrameworkShare -> ShowS
$cshowsPrec :: Int -> StartAssessmentFrameworkShare -> ShowS
Prelude.Show, forall x.
Rep StartAssessmentFrameworkShare x
-> StartAssessmentFrameworkShare
forall x.
StartAssessmentFrameworkShare
-> Rep StartAssessmentFrameworkShare x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartAssessmentFrameworkShare x
-> StartAssessmentFrameworkShare
$cfrom :: forall x.
StartAssessmentFrameworkShare
-> Rep StartAssessmentFrameworkShare x
Prelude.Generic)
newStartAssessmentFrameworkShare ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
StartAssessmentFrameworkShare
newStartAssessmentFrameworkShare :: Text -> Text -> Text -> StartAssessmentFrameworkShare
newStartAssessmentFrameworkShare
Text
pFrameworkId_
Text
pDestinationAccount_
Text
pDestinationRegion_ =
StartAssessmentFrameworkShare'
{ $sel:comment:StartAssessmentFrameworkShare' :: Maybe Text
comment =
forall a. Maybe a
Prelude.Nothing,
$sel:frameworkId:StartAssessmentFrameworkShare' :: Text
frameworkId = Text
pFrameworkId_,
$sel:destinationAccount:StartAssessmentFrameworkShare' :: Text
destinationAccount = Text
pDestinationAccount_,
$sel:destinationRegion:StartAssessmentFrameworkShare' :: Text
destinationRegion = Text
pDestinationRegion_
}
startAssessmentFrameworkShare_comment :: Lens.Lens' StartAssessmentFrameworkShare (Prelude.Maybe Prelude.Text)
= forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartAssessmentFrameworkShare' {Maybe Text
comment :: Maybe Text
$sel:comment:StartAssessmentFrameworkShare' :: StartAssessmentFrameworkShare -> Maybe Text
comment} -> Maybe Text
comment) (\s :: StartAssessmentFrameworkShare
s@StartAssessmentFrameworkShare' {} Maybe Text
a -> StartAssessmentFrameworkShare
s {$sel:comment:StartAssessmentFrameworkShare' :: Maybe Text
comment = Maybe Text
a} :: StartAssessmentFrameworkShare)
startAssessmentFrameworkShare_frameworkId :: Lens.Lens' StartAssessmentFrameworkShare Prelude.Text
startAssessmentFrameworkShare_frameworkId :: Lens' StartAssessmentFrameworkShare Text
startAssessmentFrameworkShare_frameworkId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartAssessmentFrameworkShare' {Text
frameworkId :: Text
$sel:frameworkId:StartAssessmentFrameworkShare' :: StartAssessmentFrameworkShare -> Text
frameworkId} -> Text
frameworkId) (\s :: StartAssessmentFrameworkShare
s@StartAssessmentFrameworkShare' {} Text
a -> StartAssessmentFrameworkShare
s {$sel:frameworkId:StartAssessmentFrameworkShare' :: Text
frameworkId = Text
a} :: StartAssessmentFrameworkShare)
startAssessmentFrameworkShare_destinationAccount :: Lens.Lens' StartAssessmentFrameworkShare Prelude.Text
startAssessmentFrameworkShare_destinationAccount :: Lens' StartAssessmentFrameworkShare Text
startAssessmentFrameworkShare_destinationAccount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartAssessmentFrameworkShare' {Text
destinationAccount :: Text
$sel:destinationAccount:StartAssessmentFrameworkShare' :: StartAssessmentFrameworkShare -> Text
destinationAccount} -> Text
destinationAccount) (\s :: StartAssessmentFrameworkShare
s@StartAssessmentFrameworkShare' {} Text
a -> StartAssessmentFrameworkShare
s {$sel:destinationAccount:StartAssessmentFrameworkShare' :: Text
destinationAccount = Text
a} :: StartAssessmentFrameworkShare)
startAssessmentFrameworkShare_destinationRegion :: Lens.Lens' StartAssessmentFrameworkShare Prelude.Text
startAssessmentFrameworkShare_destinationRegion :: Lens' StartAssessmentFrameworkShare Text
startAssessmentFrameworkShare_destinationRegion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartAssessmentFrameworkShare' {Text
destinationRegion :: Text
$sel:destinationRegion:StartAssessmentFrameworkShare' :: StartAssessmentFrameworkShare -> Text
destinationRegion} -> Text
destinationRegion) (\s :: StartAssessmentFrameworkShare
s@StartAssessmentFrameworkShare' {} Text
a -> StartAssessmentFrameworkShare
s {$sel:destinationRegion:StartAssessmentFrameworkShare' :: Text
destinationRegion = Text
a} :: StartAssessmentFrameworkShare)
instance
Core.AWSRequest
StartAssessmentFrameworkShare
where
type
AWSResponse StartAssessmentFrameworkShare =
StartAssessmentFrameworkShareResponse
request :: (Service -> Service)
-> StartAssessmentFrameworkShare
-> Request StartAssessmentFrameworkShare
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy StartAssessmentFrameworkShare
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartAssessmentFrameworkShare)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe AssessmentFrameworkShareRequest
-> Int -> StartAssessmentFrameworkShareResponse
StartAssessmentFrameworkShareResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"assessmentFrameworkShareRequest")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance
Prelude.Hashable
StartAssessmentFrameworkShare
where
hashWithSalt :: Int -> StartAssessmentFrameworkShare -> Int
hashWithSalt Int
_salt StartAssessmentFrameworkShare' {Maybe Text
Text
destinationRegion :: Text
destinationAccount :: Text
frameworkId :: Text
comment :: Maybe Text
$sel:destinationRegion:StartAssessmentFrameworkShare' :: StartAssessmentFrameworkShare -> Text
$sel:destinationAccount:StartAssessmentFrameworkShare' :: StartAssessmentFrameworkShare -> Text
$sel:frameworkId:StartAssessmentFrameworkShare' :: StartAssessmentFrameworkShare -> Text
$sel:comment:StartAssessmentFrameworkShare' :: StartAssessmentFrameworkShare -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
comment
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
frameworkId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
destinationAccount
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
destinationRegion
instance Prelude.NFData StartAssessmentFrameworkShare where
rnf :: StartAssessmentFrameworkShare -> ()
rnf StartAssessmentFrameworkShare' {Maybe Text
Text
destinationRegion :: Text
destinationAccount :: Text
frameworkId :: Text
comment :: Maybe Text
$sel:destinationRegion:StartAssessmentFrameworkShare' :: StartAssessmentFrameworkShare -> Text
$sel:destinationAccount:StartAssessmentFrameworkShare' :: StartAssessmentFrameworkShare -> Text
$sel:frameworkId:StartAssessmentFrameworkShare' :: StartAssessmentFrameworkShare -> Text
$sel:comment:StartAssessmentFrameworkShare' :: StartAssessmentFrameworkShare -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
comment
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
frameworkId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
destinationAccount
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
destinationRegion
instance Data.ToHeaders StartAssessmentFrameworkShare where
toHeaders :: StartAssessmentFrameworkShare -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON StartAssessmentFrameworkShare where
toJSON :: StartAssessmentFrameworkShare -> Value
toJSON StartAssessmentFrameworkShare' {Maybe Text
Text
destinationRegion :: Text
destinationAccount :: Text
frameworkId :: Text
comment :: Maybe Text
$sel:destinationRegion:StartAssessmentFrameworkShare' :: StartAssessmentFrameworkShare -> Text
$sel:destinationAccount:StartAssessmentFrameworkShare' :: StartAssessmentFrameworkShare -> Text
$sel:frameworkId:StartAssessmentFrameworkShare' :: StartAssessmentFrameworkShare -> Text
$sel:comment:StartAssessmentFrameworkShare' :: StartAssessmentFrameworkShare -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"comment" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
comment,
forall a. a -> Maybe a
Prelude.Just
(Key
"destinationAccount" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
destinationAccount),
forall a. a -> Maybe a
Prelude.Just
(Key
"destinationRegion" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
destinationRegion)
]
)
instance Data.ToPath StartAssessmentFrameworkShare where
toPath :: StartAssessmentFrameworkShare -> ByteString
toPath StartAssessmentFrameworkShare' {Maybe Text
Text
destinationRegion :: Text
destinationAccount :: Text
frameworkId :: Text
comment :: Maybe Text
$sel:destinationRegion:StartAssessmentFrameworkShare' :: StartAssessmentFrameworkShare -> Text
$sel:destinationAccount:StartAssessmentFrameworkShare' :: StartAssessmentFrameworkShare -> Text
$sel:frameworkId:StartAssessmentFrameworkShare' :: StartAssessmentFrameworkShare -> Text
$sel:comment:StartAssessmentFrameworkShare' :: StartAssessmentFrameworkShare -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/assessmentFrameworks/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
frameworkId,
ByteString
"/shareRequests"
]
instance Data.ToQuery StartAssessmentFrameworkShare where
toQuery :: StartAssessmentFrameworkShare -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data StartAssessmentFrameworkShareResponse = StartAssessmentFrameworkShareResponse'
{
StartAssessmentFrameworkShareResponse
-> Maybe AssessmentFrameworkShareRequest
assessmentFrameworkShareRequest :: Prelude.Maybe AssessmentFrameworkShareRequest,
StartAssessmentFrameworkShareResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StartAssessmentFrameworkShareResponse
-> StartAssessmentFrameworkShareResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartAssessmentFrameworkShareResponse
-> StartAssessmentFrameworkShareResponse -> Bool
$c/= :: StartAssessmentFrameworkShareResponse
-> StartAssessmentFrameworkShareResponse -> Bool
== :: StartAssessmentFrameworkShareResponse
-> StartAssessmentFrameworkShareResponse -> Bool
$c== :: StartAssessmentFrameworkShareResponse
-> StartAssessmentFrameworkShareResponse -> Bool
Prelude.Eq, ReadPrec [StartAssessmentFrameworkShareResponse]
ReadPrec StartAssessmentFrameworkShareResponse
Int -> ReadS StartAssessmentFrameworkShareResponse
ReadS [StartAssessmentFrameworkShareResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartAssessmentFrameworkShareResponse]
$creadListPrec :: ReadPrec [StartAssessmentFrameworkShareResponse]
readPrec :: ReadPrec StartAssessmentFrameworkShareResponse
$creadPrec :: ReadPrec StartAssessmentFrameworkShareResponse
readList :: ReadS [StartAssessmentFrameworkShareResponse]
$creadList :: ReadS [StartAssessmentFrameworkShareResponse]
readsPrec :: Int -> ReadS StartAssessmentFrameworkShareResponse
$creadsPrec :: Int -> ReadS StartAssessmentFrameworkShareResponse
Prelude.Read, Int -> StartAssessmentFrameworkShareResponse -> ShowS
[StartAssessmentFrameworkShareResponse] -> ShowS
StartAssessmentFrameworkShareResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartAssessmentFrameworkShareResponse] -> ShowS
$cshowList :: [StartAssessmentFrameworkShareResponse] -> ShowS
show :: StartAssessmentFrameworkShareResponse -> String
$cshow :: StartAssessmentFrameworkShareResponse -> String
showsPrec :: Int -> StartAssessmentFrameworkShareResponse -> ShowS
$cshowsPrec :: Int -> StartAssessmentFrameworkShareResponse -> ShowS
Prelude.Show, forall x.
Rep StartAssessmentFrameworkShareResponse x
-> StartAssessmentFrameworkShareResponse
forall x.
StartAssessmentFrameworkShareResponse
-> Rep StartAssessmentFrameworkShareResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartAssessmentFrameworkShareResponse x
-> StartAssessmentFrameworkShareResponse
$cfrom :: forall x.
StartAssessmentFrameworkShareResponse
-> Rep StartAssessmentFrameworkShareResponse x
Prelude.Generic)
newStartAssessmentFrameworkShareResponse ::
Prelude.Int ->
StartAssessmentFrameworkShareResponse
newStartAssessmentFrameworkShareResponse :: Int -> StartAssessmentFrameworkShareResponse
newStartAssessmentFrameworkShareResponse Int
pHttpStatus_ =
StartAssessmentFrameworkShareResponse'
{ $sel:assessmentFrameworkShareRequest:StartAssessmentFrameworkShareResponse' :: Maybe AssessmentFrameworkShareRequest
assessmentFrameworkShareRequest =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StartAssessmentFrameworkShareResponse' :: Int
httpStatus = Int
pHttpStatus_
}
startAssessmentFrameworkShareResponse_assessmentFrameworkShareRequest :: Lens.Lens' StartAssessmentFrameworkShareResponse (Prelude.Maybe AssessmentFrameworkShareRequest)
startAssessmentFrameworkShareResponse_assessmentFrameworkShareRequest :: Lens'
StartAssessmentFrameworkShareResponse
(Maybe AssessmentFrameworkShareRequest)
startAssessmentFrameworkShareResponse_assessmentFrameworkShareRequest = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartAssessmentFrameworkShareResponse' {Maybe AssessmentFrameworkShareRequest
assessmentFrameworkShareRequest :: Maybe AssessmentFrameworkShareRequest
$sel:assessmentFrameworkShareRequest:StartAssessmentFrameworkShareResponse' :: StartAssessmentFrameworkShareResponse
-> Maybe AssessmentFrameworkShareRequest
assessmentFrameworkShareRequest} -> Maybe AssessmentFrameworkShareRequest
assessmentFrameworkShareRequest) (\s :: StartAssessmentFrameworkShareResponse
s@StartAssessmentFrameworkShareResponse' {} Maybe AssessmentFrameworkShareRequest
a -> StartAssessmentFrameworkShareResponse
s {$sel:assessmentFrameworkShareRequest:StartAssessmentFrameworkShareResponse' :: Maybe AssessmentFrameworkShareRequest
assessmentFrameworkShareRequest = Maybe AssessmentFrameworkShareRequest
a} :: StartAssessmentFrameworkShareResponse)
startAssessmentFrameworkShareResponse_httpStatus :: Lens.Lens' StartAssessmentFrameworkShareResponse Prelude.Int
startAssessmentFrameworkShareResponse_httpStatus :: Lens' StartAssessmentFrameworkShareResponse Int
startAssessmentFrameworkShareResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartAssessmentFrameworkShareResponse' {Int
httpStatus :: Int
$sel:httpStatus:StartAssessmentFrameworkShareResponse' :: StartAssessmentFrameworkShareResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StartAssessmentFrameworkShareResponse
s@StartAssessmentFrameworkShareResponse' {} Int
a -> StartAssessmentFrameworkShareResponse
s {$sel:httpStatus:StartAssessmentFrameworkShareResponse' :: Int
httpStatus = Int
a} :: StartAssessmentFrameworkShareResponse)
instance
Prelude.NFData
StartAssessmentFrameworkShareResponse
where
rnf :: StartAssessmentFrameworkShareResponse -> ()
rnf StartAssessmentFrameworkShareResponse' {Int
Maybe AssessmentFrameworkShareRequest
httpStatus :: Int
assessmentFrameworkShareRequest :: Maybe AssessmentFrameworkShareRequest
$sel:httpStatus:StartAssessmentFrameworkShareResponse' :: StartAssessmentFrameworkShareResponse -> Int
$sel:assessmentFrameworkShareRequest:StartAssessmentFrameworkShareResponse' :: StartAssessmentFrameworkShareResponse
-> Maybe AssessmentFrameworkShareRequest
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe AssessmentFrameworkShareRequest
assessmentFrameworkShareRequest
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus