{-# 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.UpdateAssessmentFrameworkShare
(
UpdateAssessmentFrameworkShare (..),
newUpdateAssessmentFrameworkShare,
updateAssessmentFrameworkShare_requestId,
updateAssessmentFrameworkShare_requestType,
updateAssessmentFrameworkShare_action,
UpdateAssessmentFrameworkShareResponse (..),
newUpdateAssessmentFrameworkShareResponse,
updateAssessmentFrameworkShareResponse_assessmentFrameworkShareRequest,
updateAssessmentFrameworkShareResponse_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 UpdateAssessmentFrameworkShare = UpdateAssessmentFrameworkShare'
{
UpdateAssessmentFrameworkShare -> Text
requestId :: Prelude.Text,
UpdateAssessmentFrameworkShare -> ShareRequestType
requestType :: ShareRequestType,
UpdateAssessmentFrameworkShare -> ShareRequestAction
action :: ShareRequestAction
}
deriving (UpdateAssessmentFrameworkShare
-> UpdateAssessmentFrameworkShare -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAssessmentFrameworkShare
-> UpdateAssessmentFrameworkShare -> Bool
$c/= :: UpdateAssessmentFrameworkShare
-> UpdateAssessmentFrameworkShare -> Bool
== :: UpdateAssessmentFrameworkShare
-> UpdateAssessmentFrameworkShare -> Bool
$c== :: UpdateAssessmentFrameworkShare
-> UpdateAssessmentFrameworkShare -> Bool
Prelude.Eq, ReadPrec [UpdateAssessmentFrameworkShare]
ReadPrec UpdateAssessmentFrameworkShare
Int -> ReadS UpdateAssessmentFrameworkShare
ReadS [UpdateAssessmentFrameworkShare]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAssessmentFrameworkShare]
$creadListPrec :: ReadPrec [UpdateAssessmentFrameworkShare]
readPrec :: ReadPrec UpdateAssessmentFrameworkShare
$creadPrec :: ReadPrec UpdateAssessmentFrameworkShare
readList :: ReadS [UpdateAssessmentFrameworkShare]
$creadList :: ReadS [UpdateAssessmentFrameworkShare]
readsPrec :: Int -> ReadS UpdateAssessmentFrameworkShare
$creadsPrec :: Int -> ReadS UpdateAssessmentFrameworkShare
Prelude.Read, Int -> UpdateAssessmentFrameworkShare -> ShowS
[UpdateAssessmentFrameworkShare] -> ShowS
UpdateAssessmentFrameworkShare -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAssessmentFrameworkShare] -> ShowS
$cshowList :: [UpdateAssessmentFrameworkShare] -> ShowS
show :: UpdateAssessmentFrameworkShare -> String
$cshow :: UpdateAssessmentFrameworkShare -> String
showsPrec :: Int -> UpdateAssessmentFrameworkShare -> ShowS
$cshowsPrec :: Int -> UpdateAssessmentFrameworkShare -> ShowS
Prelude.Show, forall x.
Rep UpdateAssessmentFrameworkShare x
-> UpdateAssessmentFrameworkShare
forall x.
UpdateAssessmentFrameworkShare
-> Rep UpdateAssessmentFrameworkShare x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateAssessmentFrameworkShare x
-> UpdateAssessmentFrameworkShare
$cfrom :: forall x.
UpdateAssessmentFrameworkShare
-> Rep UpdateAssessmentFrameworkShare x
Prelude.Generic)
newUpdateAssessmentFrameworkShare ::
Prelude.Text ->
ShareRequestType ->
ShareRequestAction ->
UpdateAssessmentFrameworkShare
newUpdateAssessmentFrameworkShare :: Text
-> ShareRequestType
-> ShareRequestAction
-> UpdateAssessmentFrameworkShare
newUpdateAssessmentFrameworkShare
Text
pRequestId_
ShareRequestType
pRequestType_
ShareRequestAction
pAction_ =
UpdateAssessmentFrameworkShare'
{ $sel:requestId:UpdateAssessmentFrameworkShare' :: Text
requestId =
Text
pRequestId_,
$sel:requestType:UpdateAssessmentFrameworkShare' :: ShareRequestType
requestType = ShareRequestType
pRequestType_,
$sel:action:UpdateAssessmentFrameworkShare' :: ShareRequestAction
action = ShareRequestAction
pAction_
}
updateAssessmentFrameworkShare_requestId :: Lens.Lens' UpdateAssessmentFrameworkShare Prelude.Text
updateAssessmentFrameworkShare_requestId :: Lens' UpdateAssessmentFrameworkShare Text
updateAssessmentFrameworkShare_requestId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssessmentFrameworkShare' {Text
requestId :: Text
$sel:requestId:UpdateAssessmentFrameworkShare' :: UpdateAssessmentFrameworkShare -> Text
requestId} -> Text
requestId) (\s :: UpdateAssessmentFrameworkShare
s@UpdateAssessmentFrameworkShare' {} Text
a -> UpdateAssessmentFrameworkShare
s {$sel:requestId:UpdateAssessmentFrameworkShare' :: Text
requestId = Text
a} :: UpdateAssessmentFrameworkShare)
updateAssessmentFrameworkShare_requestType :: Lens.Lens' UpdateAssessmentFrameworkShare ShareRequestType
updateAssessmentFrameworkShare_requestType :: Lens' UpdateAssessmentFrameworkShare ShareRequestType
updateAssessmentFrameworkShare_requestType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssessmentFrameworkShare' {ShareRequestType
requestType :: ShareRequestType
$sel:requestType:UpdateAssessmentFrameworkShare' :: UpdateAssessmentFrameworkShare -> ShareRequestType
requestType} -> ShareRequestType
requestType) (\s :: UpdateAssessmentFrameworkShare
s@UpdateAssessmentFrameworkShare' {} ShareRequestType
a -> UpdateAssessmentFrameworkShare
s {$sel:requestType:UpdateAssessmentFrameworkShare' :: ShareRequestType
requestType = ShareRequestType
a} :: UpdateAssessmentFrameworkShare)
updateAssessmentFrameworkShare_action :: Lens.Lens' UpdateAssessmentFrameworkShare ShareRequestAction
updateAssessmentFrameworkShare_action :: Lens' UpdateAssessmentFrameworkShare ShareRequestAction
updateAssessmentFrameworkShare_action = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssessmentFrameworkShare' {ShareRequestAction
action :: ShareRequestAction
$sel:action:UpdateAssessmentFrameworkShare' :: UpdateAssessmentFrameworkShare -> ShareRequestAction
action} -> ShareRequestAction
action) (\s :: UpdateAssessmentFrameworkShare
s@UpdateAssessmentFrameworkShare' {} ShareRequestAction
a -> UpdateAssessmentFrameworkShare
s {$sel:action:UpdateAssessmentFrameworkShare' :: ShareRequestAction
action = ShareRequestAction
a} :: UpdateAssessmentFrameworkShare)
instance
Core.AWSRequest
UpdateAssessmentFrameworkShare
where
type
AWSResponse UpdateAssessmentFrameworkShare =
UpdateAssessmentFrameworkShareResponse
request :: (Service -> Service)
-> UpdateAssessmentFrameworkShare
-> Request UpdateAssessmentFrameworkShare
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateAssessmentFrameworkShare
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse UpdateAssessmentFrameworkShare)))
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 -> UpdateAssessmentFrameworkShareResponse
UpdateAssessmentFrameworkShareResponse'
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
UpdateAssessmentFrameworkShare
where
hashWithSalt :: Int -> UpdateAssessmentFrameworkShare -> Int
hashWithSalt
Int
_salt
UpdateAssessmentFrameworkShare' {Text
ShareRequestAction
ShareRequestType
action :: ShareRequestAction
requestType :: ShareRequestType
requestId :: Text
$sel:action:UpdateAssessmentFrameworkShare' :: UpdateAssessmentFrameworkShare -> ShareRequestAction
$sel:requestType:UpdateAssessmentFrameworkShare' :: UpdateAssessmentFrameworkShare -> ShareRequestType
$sel:requestId:UpdateAssessmentFrameworkShare' :: UpdateAssessmentFrameworkShare -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
requestId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ShareRequestType
requestType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ShareRequestAction
action
instance
Prelude.NFData
UpdateAssessmentFrameworkShare
where
rnf :: UpdateAssessmentFrameworkShare -> ()
rnf UpdateAssessmentFrameworkShare' {Text
ShareRequestAction
ShareRequestType
action :: ShareRequestAction
requestType :: ShareRequestType
requestId :: Text
$sel:action:UpdateAssessmentFrameworkShare' :: UpdateAssessmentFrameworkShare -> ShareRequestAction
$sel:requestType:UpdateAssessmentFrameworkShare' :: UpdateAssessmentFrameworkShare -> ShareRequestType
$sel:requestId:UpdateAssessmentFrameworkShare' :: UpdateAssessmentFrameworkShare -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
requestId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ShareRequestType
requestType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ShareRequestAction
action
instance
Data.ToHeaders
UpdateAssessmentFrameworkShare
where
toHeaders :: UpdateAssessmentFrameworkShare -> 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 UpdateAssessmentFrameworkShare where
toJSON :: UpdateAssessmentFrameworkShare -> Value
toJSON UpdateAssessmentFrameworkShare' {Text
ShareRequestAction
ShareRequestType
action :: ShareRequestAction
requestType :: ShareRequestType
requestId :: Text
$sel:action:UpdateAssessmentFrameworkShare' :: UpdateAssessmentFrameworkShare -> ShareRequestAction
$sel:requestType:UpdateAssessmentFrameworkShare' :: UpdateAssessmentFrameworkShare -> ShareRequestType
$sel:requestId:UpdateAssessmentFrameworkShare' :: UpdateAssessmentFrameworkShare -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"requestType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ShareRequestType
requestType),
forall a. a -> Maybe a
Prelude.Just (Key
"action" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ShareRequestAction
action)
]
)
instance Data.ToPath UpdateAssessmentFrameworkShare where
toPath :: UpdateAssessmentFrameworkShare -> ByteString
toPath UpdateAssessmentFrameworkShare' {Text
ShareRequestAction
ShareRequestType
action :: ShareRequestAction
requestType :: ShareRequestType
requestId :: Text
$sel:action:UpdateAssessmentFrameworkShare' :: UpdateAssessmentFrameworkShare -> ShareRequestAction
$sel:requestType:UpdateAssessmentFrameworkShare' :: UpdateAssessmentFrameworkShare -> ShareRequestType
$sel:requestId:UpdateAssessmentFrameworkShare' :: UpdateAssessmentFrameworkShare -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/assessmentFrameworkShareRequests/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
requestId
]
instance Data.ToQuery UpdateAssessmentFrameworkShare where
toQuery :: UpdateAssessmentFrameworkShare -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateAssessmentFrameworkShareResponse = UpdateAssessmentFrameworkShareResponse'
{
UpdateAssessmentFrameworkShareResponse
-> Maybe AssessmentFrameworkShareRequest
assessmentFrameworkShareRequest :: Prelude.Maybe AssessmentFrameworkShareRequest,
UpdateAssessmentFrameworkShareResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateAssessmentFrameworkShareResponse
-> UpdateAssessmentFrameworkShareResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAssessmentFrameworkShareResponse
-> UpdateAssessmentFrameworkShareResponse -> Bool
$c/= :: UpdateAssessmentFrameworkShareResponse
-> UpdateAssessmentFrameworkShareResponse -> Bool
== :: UpdateAssessmentFrameworkShareResponse
-> UpdateAssessmentFrameworkShareResponse -> Bool
$c== :: UpdateAssessmentFrameworkShareResponse
-> UpdateAssessmentFrameworkShareResponse -> Bool
Prelude.Eq, ReadPrec [UpdateAssessmentFrameworkShareResponse]
ReadPrec UpdateAssessmentFrameworkShareResponse
Int -> ReadS UpdateAssessmentFrameworkShareResponse
ReadS [UpdateAssessmentFrameworkShareResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAssessmentFrameworkShareResponse]
$creadListPrec :: ReadPrec [UpdateAssessmentFrameworkShareResponse]
readPrec :: ReadPrec UpdateAssessmentFrameworkShareResponse
$creadPrec :: ReadPrec UpdateAssessmentFrameworkShareResponse
readList :: ReadS [UpdateAssessmentFrameworkShareResponse]
$creadList :: ReadS [UpdateAssessmentFrameworkShareResponse]
readsPrec :: Int -> ReadS UpdateAssessmentFrameworkShareResponse
$creadsPrec :: Int -> ReadS UpdateAssessmentFrameworkShareResponse
Prelude.Read, Int -> UpdateAssessmentFrameworkShareResponse -> ShowS
[UpdateAssessmentFrameworkShareResponse] -> ShowS
UpdateAssessmentFrameworkShareResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAssessmentFrameworkShareResponse] -> ShowS
$cshowList :: [UpdateAssessmentFrameworkShareResponse] -> ShowS
show :: UpdateAssessmentFrameworkShareResponse -> String
$cshow :: UpdateAssessmentFrameworkShareResponse -> String
showsPrec :: Int -> UpdateAssessmentFrameworkShareResponse -> ShowS
$cshowsPrec :: Int -> UpdateAssessmentFrameworkShareResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateAssessmentFrameworkShareResponse x
-> UpdateAssessmentFrameworkShareResponse
forall x.
UpdateAssessmentFrameworkShareResponse
-> Rep UpdateAssessmentFrameworkShareResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateAssessmentFrameworkShareResponse x
-> UpdateAssessmentFrameworkShareResponse
$cfrom :: forall x.
UpdateAssessmentFrameworkShareResponse
-> Rep UpdateAssessmentFrameworkShareResponse x
Prelude.Generic)
newUpdateAssessmentFrameworkShareResponse ::
Prelude.Int ->
UpdateAssessmentFrameworkShareResponse
newUpdateAssessmentFrameworkShareResponse :: Int -> UpdateAssessmentFrameworkShareResponse
newUpdateAssessmentFrameworkShareResponse
Int
pHttpStatus_ =
UpdateAssessmentFrameworkShareResponse'
{ $sel:assessmentFrameworkShareRequest:UpdateAssessmentFrameworkShareResponse' :: Maybe AssessmentFrameworkShareRequest
assessmentFrameworkShareRequest =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UpdateAssessmentFrameworkShareResponse' :: Int
httpStatus = Int
pHttpStatus_
}
updateAssessmentFrameworkShareResponse_assessmentFrameworkShareRequest :: Lens.Lens' UpdateAssessmentFrameworkShareResponse (Prelude.Maybe AssessmentFrameworkShareRequest)
updateAssessmentFrameworkShareResponse_assessmentFrameworkShareRequest :: Lens'
UpdateAssessmentFrameworkShareResponse
(Maybe AssessmentFrameworkShareRequest)
updateAssessmentFrameworkShareResponse_assessmentFrameworkShareRequest = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssessmentFrameworkShareResponse' {Maybe AssessmentFrameworkShareRequest
assessmentFrameworkShareRequest :: Maybe AssessmentFrameworkShareRequest
$sel:assessmentFrameworkShareRequest:UpdateAssessmentFrameworkShareResponse' :: UpdateAssessmentFrameworkShareResponse
-> Maybe AssessmentFrameworkShareRequest
assessmentFrameworkShareRequest} -> Maybe AssessmentFrameworkShareRequest
assessmentFrameworkShareRequest) (\s :: UpdateAssessmentFrameworkShareResponse
s@UpdateAssessmentFrameworkShareResponse' {} Maybe AssessmentFrameworkShareRequest
a -> UpdateAssessmentFrameworkShareResponse
s {$sel:assessmentFrameworkShareRequest:UpdateAssessmentFrameworkShareResponse' :: Maybe AssessmentFrameworkShareRequest
assessmentFrameworkShareRequest = Maybe AssessmentFrameworkShareRequest
a} :: UpdateAssessmentFrameworkShareResponse)
updateAssessmentFrameworkShareResponse_httpStatus :: Lens.Lens' UpdateAssessmentFrameworkShareResponse Prelude.Int
updateAssessmentFrameworkShareResponse_httpStatus :: Lens' UpdateAssessmentFrameworkShareResponse Int
updateAssessmentFrameworkShareResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAssessmentFrameworkShareResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateAssessmentFrameworkShareResponse' :: UpdateAssessmentFrameworkShareResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateAssessmentFrameworkShareResponse
s@UpdateAssessmentFrameworkShareResponse' {} Int
a -> UpdateAssessmentFrameworkShareResponse
s {$sel:httpStatus:UpdateAssessmentFrameworkShareResponse' :: Int
httpStatus = Int
a} :: UpdateAssessmentFrameworkShareResponse)
instance
Prelude.NFData
UpdateAssessmentFrameworkShareResponse
where
rnf :: UpdateAssessmentFrameworkShareResponse -> ()
rnf UpdateAssessmentFrameworkShareResponse' {Int
Maybe AssessmentFrameworkShareRequest
httpStatus :: Int
assessmentFrameworkShareRequest :: Maybe AssessmentFrameworkShareRequest
$sel:httpStatus:UpdateAssessmentFrameworkShareResponse' :: UpdateAssessmentFrameworkShareResponse -> Int
$sel:assessmentFrameworkShareRequest:UpdateAssessmentFrameworkShareResponse' :: UpdateAssessmentFrameworkShareResponse
-> 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