{-# 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.AccessAnalyzer.UpdateArchiveRule
(
UpdateArchiveRule (..),
newUpdateArchiveRule,
updateArchiveRule_clientToken,
updateArchiveRule_analyzerName,
updateArchiveRule_filter,
updateArchiveRule_ruleName,
UpdateArchiveRuleResponse (..),
newUpdateArchiveRuleResponse,
)
where
import Amazonka.AccessAnalyzer.Types
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
data UpdateArchiveRule = UpdateArchiveRule'
{
UpdateArchiveRule -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
UpdateArchiveRule -> Text
analyzerName :: Prelude.Text,
UpdateArchiveRule -> HashMap Text Criterion
filter' :: Prelude.HashMap Prelude.Text Criterion,
UpdateArchiveRule -> Text
ruleName :: Prelude.Text
}
deriving (UpdateArchiveRule -> UpdateArchiveRule -> Bool
(UpdateArchiveRule -> UpdateArchiveRule -> Bool)
-> (UpdateArchiveRule -> UpdateArchiveRule -> Bool)
-> Eq UpdateArchiveRule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateArchiveRule -> UpdateArchiveRule -> Bool
$c/= :: UpdateArchiveRule -> UpdateArchiveRule -> Bool
== :: UpdateArchiveRule -> UpdateArchiveRule -> Bool
$c== :: UpdateArchiveRule -> UpdateArchiveRule -> Bool
Prelude.Eq, ReadPrec [UpdateArchiveRule]
ReadPrec UpdateArchiveRule
Int -> ReadS UpdateArchiveRule
ReadS [UpdateArchiveRule]
(Int -> ReadS UpdateArchiveRule)
-> ReadS [UpdateArchiveRule]
-> ReadPrec UpdateArchiveRule
-> ReadPrec [UpdateArchiveRule]
-> Read UpdateArchiveRule
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateArchiveRule]
$creadListPrec :: ReadPrec [UpdateArchiveRule]
readPrec :: ReadPrec UpdateArchiveRule
$creadPrec :: ReadPrec UpdateArchiveRule
readList :: ReadS [UpdateArchiveRule]
$creadList :: ReadS [UpdateArchiveRule]
readsPrec :: Int -> ReadS UpdateArchiveRule
$creadsPrec :: Int -> ReadS UpdateArchiveRule
Prelude.Read, Int -> UpdateArchiveRule -> ShowS
[UpdateArchiveRule] -> ShowS
UpdateArchiveRule -> String
(Int -> UpdateArchiveRule -> ShowS)
-> (UpdateArchiveRule -> String)
-> ([UpdateArchiveRule] -> ShowS)
-> Show UpdateArchiveRule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateArchiveRule] -> ShowS
$cshowList :: [UpdateArchiveRule] -> ShowS
show :: UpdateArchiveRule -> String
$cshow :: UpdateArchiveRule -> String
showsPrec :: Int -> UpdateArchiveRule -> ShowS
$cshowsPrec :: Int -> UpdateArchiveRule -> ShowS
Prelude.Show, (forall x. UpdateArchiveRule -> Rep UpdateArchiveRule x)
-> (forall x. Rep UpdateArchiveRule x -> UpdateArchiveRule)
-> Generic UpdateArchiveRule
forall x. Rep UpdateArchiveRule x -> UpdateArchiveRule
forall x. UpdateArchiveRule -> Rep UpdateArchiveRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateArchiveRule x -> UpdateArchiveRule
$cfrom :: forall x. UpdateArchiveRule -> Rep UpdateArchiveRule x
Prelude.Generic)
newUpdateArchiveRule ::
Prelude.Text ->
Prelude.Text ->
UpdateArchiveRule
newUpdateArchiveRule :: Text -> Text -> UpdateArchiveRule
newUpdateArchiveRule Text
pAnalyzerName_ Text
pRuleName_ =
UpdateArchiveRule' :: Maybe Text
-> Text -> HashMap Text Criterion -> Text -> UpdateArchiveRule
UpdateArchiveRule'
{ $sel:clientToken:UpdateArchiveRule' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:analyzerName:UpdateArchiveRule' :: Text
analyzerName = Text
pAnalyzerName_,
$sel:filter':UpdateArchiveRule' :: HashMap Text Criterion
filter' = HashMap Text Criterion
forall a. Monoid a => a
Prelude.mempty,
$sel:ruleName:UpdateArchiveRule' :: Text
ruleName = Text
pRuleName_
}
updateArchiveRule_clientToken :: Lens.Lens' UpdateArchiveRule (Prelude.Maybe Prelude.Text)
updateArchiveRule_clientToken :: (Maybe Text -> f (Maybe Text))
-> UpdateArchiveRule -> f UpdateArchiveRule
updateArchiveRule_clientToken = (UpdateArchiveRule -> Maybe Text)
-> (UpdateArchiveRule -> Maybe Text -> UpdateArchiveRule)
-> Lens
UpdateArchiveRule UpdateArchiveRule (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateArchiveRule' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:UpdateArchiveRule' :: UpdateArchiveRule -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: UpdateArchiveRule
s@UpdateArchiveRule' {} Maybe Text
a -> UpdateArchiveRule
s {$sel:clientToken:UpdateArchiveRule' :: Maybe Text
clientToken = Maybe Text
a} :: UpdateArchiveRule)
updateArchiveRule_analyzerName :: Lens.Lens' UpdateArchiveRule Prelude.Text
updateArchiveRule_analyzerName :: (Text -> f Text) -> UpdateArchiveRule -> f UpdateArchiveRule
updateArchiveRule_analyzerName = (UpdateArchiveRule -> Text)
-> (UpdateArchiveRule -> Text -> UpdateArchiveRule)
-> Lens UpdateArchiveRule UpdateArchiveRule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateArchiveRule' {Text
analyzerName :: Text
$sel:analyzerName:UpdateArchiveRule' :: UpdateArchiveRule -> Text
analyzerName} -> Text
analyzerName) (\s :: UpdateArchiveRule
s@UpdateArchiveRule' {} Text
a -> UpdateArchiveRule
s {$sel:analyzerName:UpdateArchiveRule' :: Text
analyzerName = Text
a} :: UpdateArchiveRule)
updateArchiveRule_filter :: Lens.Lens' UpdateArchiveRule (Prelude.HashMap Prelude.Text Criterion)
updateArchiveRule_filter :: (HashMap Text Criterion -> f (HashMap Text Criterion))
-> UpdateArchiveRule -> f UpdateArchiveRule
updateArchiveRule_filter = (UpdateArchiveRule -> HashMap Text Criterion)
-> (UpdateArchiveRule
-> HashMap Text Criterion -> UpdateArchiveRule)
-> Lens
UpdateArchiveRule
UpdateArchiveRule
(HashMap Text Criterion)
(HashMap Text Criterion)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateArchiveRule' {HashMap Text Criterion
filter' :: HashMap Text Criterion
$sel:filter':UpdateArchiveRule' :: UpdateArchiveRule -> HashMap Text Criterion
filter'} -> HashMap Text Criterion
filter') (\s :: UpdateArchiveRule
s@UpdateArchiveRule' {} HashMap Text Criterion
a -> UpdateArchiveRule
s {$sel:filter':UpdateArchiveRule' :: HashMap Text Criterion
filter' = HashMap Text Criterion
a} :: UpdateArchiveRule) ((HashMap Text Criterion -> f (HashMap Text Criterion))
-> UpdateArchiveRule -> f UpdateArchiveRule)
-> ((HashMap Text Criterion -> f (HashMap Text Criterion))
-> HashMap Text Criterion -> f (HashMap Text Criterion))
-> (HashMap Text Criterion -> f (HashMap Text Criterion))
-> UpdateArchiveRule
-> f UpdateArchiveRule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (HashMap Text Criterion -> f (HashMap Text Criterion))
-> HashMap Text Criterion -> f (HashMap Text Criterion)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
updateArchiveRule_ruleName :: Lens.Lens' UpdateArchiveRule Prelude.Text
updateArchiveRule_ruleName :: (Text -> f Text) -> UpdateArchiveRule -> f UpdateArchiveRule
updateArchiveRule_ruleName = (UpdateArchiveRule -> Text)
-> (UpdateArchiveRule -> Text -> UpdateArchiveRule)
-> Lens UpdateArchiveRule UpdateArchiveRule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateArchiveRule' {Text
ruleName :: Text
$sel:ruleName:UpdateArchiveRule' :: UpdateArchiveRule -> Text
ruleName} -> Text
ruleName) (\s :: UpdateArchiveRule
s@UpdateArchiveRule' {} Text
a -> UpdateArchiveRule
s {$sel:ruleName:UpdateArchiveRule' :: Text
ruleName = Text
a} :: UpdateArchiveRule)
instance Core.AWSRequest UpdateArchiveRule where
type
AWSResponse UpdateArchiveRule =
UpdateArchiveRuleResponse
request :: UpdateArchiveRule -> Request UpdateArchiveRule
request = Service -> UpdateArchiveRule -> Request UpdateArchiveRule
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateArchiveRule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateArchiveRule)))
response =
AWSResponse UpdateArchiveRule
-> Logger
-> Service
-> Proxy UpdateArchiveRule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateArchiveRule)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse UpdateArchiveRule
UpdateArchiveRuleResponse
UpdateArchiveRuleResponse'
instance Prelude.Hashable UpdateArchiveRule
instance Prelude.NFData UpdateArchiveRule
instance Core.ToHeaders UpdateArchiveRule where
toHeaders :: UpdateArchiveRule -> [Header]
toHeaders =
[Header] -> UpdateArchiveRule -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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 UpdateArchiveRule where
toJSON :: UpdateArchiveRule -> Value
toJSON UpdateArchiveRule' {Maybe Text
Text
HashMap Text Criterion
ruleName :: Text
filter' :: HashMap Text Criterion
analyzerName :: Text
clientToken :: Maybe Text
$sel:ruleName:UpdateArchiveRule' :: UpdateArchiveRule -> Text
$sel:filter':UpdateArchiveRule' :: UpdateArchiveRule -> HashMap Text Criterion
$sel:analyzerName:UpdateArchiveRule' :: UpdateArchiveRule -> Text
$sel:clientToken:UpdateArchiveRule' :: UpdateArchiveRule -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"clientToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientToken,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"filter" Text -> HashMap Text Criterion -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= HashMap Text Criterion
filter')
]
)
instance Core.ToPath UpdateArchiveRule where
toPath :: UpdateArchiveRule -> ByteString
toPath UpdateArchiveRule' {Maybe Text
Text
HashMap Text Criterion
ruleName :: Text
filter' :: HashMap Text Criterion
analyzerName :: Text
clientToken :: Maybe Text
$sel:ruleName:UpdateArchiveRule' :: UpdateArchiveRule -> Text
$sel:filter':UpdateArchiveRule' :: UpdateArchiveRule -> HashMap Text Criterion
$sel:analyzerName:UpdateArchiveRule' :: UpdateArchiveRule -> Text
$sel:clientToken:UpdateArchiveRule' :: UpdateArchiveRule -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/analyzer/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
analyzerName,
ByteString
"/archive-rule/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
ruleName
]
instance Core.ToQuery UpdateArchiveRule where
toQuery :: UpdateArchiveRule -> QueryString
toQuery = QueryString -> UpdateArchiveRule -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateArchiveRuleResponse = UpdateArchiveRuleResponse'
{
}
deriving (UpdateArchiveRuleResponse -> UpdateArchiveRuleResponse -> Bool
(UpdateArchiveRuleResponse -> UpdateArchiveRuleResponse -> Bool)
-> (UpdateArchiveRuleResponse -> UpdateArchiveRuleResponse -> Bool)
-> Eq UpdateArchiveRuleResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateArchiveRuleResponse -> UpdateArchiveRuleResponse -> Bool
$c/= :: UpdateArchiveRuleResponse -> UpdateArchiveRuleResponse -> Bool
== :: UpdateArchiveRuleResponse -> UpdateArchiveRuleResponse -> Bool
$c== :: UpdateArchiveRuleResponse -> UpdateArchiveRuleResponse -> Bool
Prelude.Eq, ReadPrec [UpdateArchiveRuleResponse]
ReadPrec UpdateArchiveRuleResponse
Int -> ReadS UpdateArchiveRuleResponse
ReadS [UpdateArchiveRuleResponse]
(Int -> ReadS UpdateArchiveRuleResponse)
-> ReadS [UpdateArchiveRuleResponse]
-> ReadPrec UpdateArchiveRuleResponse
-> ReadPrec [UpdateArchiveRuleResponse]
-> Read UpdateArchiveRuleResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateArchiveRuleResponse]
$creadListPrec :: ReadPrec [UpdateArchiveRuleResponse]
readPrec :: ReadPrec UpdateArchiveRuleResponse
$creadPrec :: ReadPrec UpdateArchiveRuleResponse
readList :: ReadS [UpdateArchiveRuleResponse]
$creadList :: ReadS [UpdateArchiveRuleResponse]
readsPrec :: Int -> ReadS UpdateArchiveRuleResponse
$creadsPrec :: Int -> ReadS UpdateArchiveRuleResponse
Prelude.Read, Int -> UpdateArchiveRuleResponse -> ShowS
[UpdateArchiveRuleResponse] -> ShowS
UpdateArchiveRuleResponse -> String
(Int -> UpdateArchiveRuleResponse -> ShowS)
-> (UpdateArchiveRuleResponse -> String)
-> ([UpdateArchiveRuleResponse] -> ShowS)
-> Show UpdateArchiveRuleResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateArchiveRuleResponse] -> ShowS
$cshowList :: [UpdateArchiveRuleResponse] -> ShowS
show :: UpdateArchiveRuleResponse -> String
$cshow :: UpdateArchiveRuleResponse -> String
showsPrec :: Int -> UpdateArchiveRuleResponse -> ShowS
$cshowsPrec :: Int -> UpdateArchiveRuleResponse -> ShowS
Prelude.Show, (forall x.
UpdateArchiveRuleResponse -> Rep UpdateArchiveRuleResponse x)
-> (forall x.
Rep UpdateArchiveRuleResponse x -> UpdateArchiveRuleResponse)
-> Generic UpdateArchiveRuleResponse
forall x.
Rep UpdateArchiveRuleResponse x -> UpdateArchiveRuleResponse
forall x.
UpdateArchiveRuleResponse -> Rep UpdateArchiveRuleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateArchiveRuleResponse x -> UpdateArchiveRuleResponse
$cfrom :: forall x.
UpdateArchiveRuleResponse -> Rep UpdateArchiveRuleResponse x
Prelude.Generic)
newUpdateArchiveRuleResponse ::
UpdateArchiveRuleResponse
newUpdateArchiveRuleResponse :: UpdateArchiveRuleResponse
newUpdateArchiveRuleResponse =
UpdateArchiveRuleResponse
UpdateArchiveRuleResponse'
instance Prelude.NFData UpdateArchiveRuleResponse