{-# 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.IoT.UpdateAccountAuditConfiguration
(
UpdateAccountAuditConfiguration (..),
newUpdateAccountAuditConfiguration,
updateAccountAuditConfiguration_auditCheckConfigurations,
updateAccountAuditConfiguration_auditNotificationTargetConfigurations,
updateAccountAuditConfiguration_roleArn,
UpdateAccountAuditConfigurationResponse (..),
newUpdateAccountAuditConfigurationResponse,
updateAccountAuditConfigurationResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoT.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdateAccountAuditConfiguration = UpdateAccountAuditConfiguration'
{
UpdateAccountAuditConfiguration
-> Maybe (HashMap Text AuditCheckConfiguration)
auditCheckConfigurations :: Prelude.Maybe (Prelude.HashMap Prelude.Text AuditCheckConfiguration),
UpdateAccountAuditConfiguration
-> Maybe (HashMap AuditNotificationType AuditNotificationTarget)
auditNotificationTargetConfigurations :: Prelude.Maybe (Prelude.HashMap AuditNotificationType AuditNotificationTarget),
UpdateAccountAuditConfiguration -> Maybe Text
roleArn :: Prelude.Maybe Prelude.Text
}
deriving (UpdateAccountAuditConfiguration
-> UpdateAccountAuditConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAccountAuditConfiguration
-> UpdateAccountAuditConfiguration -> Bool
$c/= :: UpdateAccountAuditConfiguration
-> UpdateAccountAuditConfiguration -> Bool
== :: UpdateAccountAuditConfiguration
-> UpdateAccountAuditConfiguration -> Bool
$c== :: UpdateAccountAuditConfiguration
-> UpdateAccountAuditConfiguration -> Bool
Prelude.Eq, ReadPrec [UpdateAccountAuditConfiguration]
ReadPrec UpdateAccountAuditConfiguration
Int -> ReadS UpdateAccountAuditConfiguration
ReadS [UpdateAccountAuditConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAccountAuditConfiguration]
$creadListPrec :: ReadPrec [UpdateAccountAuditConfiguration]
readPrec :: ReadPrec UpdateAccountAuditConfiguration
$creadPrec :: ReadPrec UpdateAccountAuditConfiguration
readList :: ReadS [UpdateAccountAuditConfiguration]
$creadList :: ReadS [UpdateAccountAuditConfiguration]
readsPrec :: Int -> ReadS UpdateAccountAuditConfiguration
$creadsPrec :: Int -> ReadS UpdateAccountAuditConfiguration
Prelude.Read, Int -> UpdateAccountAuditConfiguration -> ShowS
[UpdateAccountAuditConfiguration] -> ShowS
UpdateAccountAuditConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAccountAuditConfiguration] -> ShowS
$cshowList :: [UpdateAccountAuditConfiguration] -> ShowS
show :: UpdateAccountAuditConfiguration -> String
$cshow :: UpdateAccountAuditConfiguration -> String
showsPrec :: Int -> UpdateAccountAuditConfiguration -> ShowS
$cshowsPrec :: Int -> UpdateAccountAuditConfiguration -> ShowS
Prelude.Show, forall x.
Rep UpdateAccountAuditConfiguration x
-> UpdateAccountAuditConfiguration
forall x.
UpdateAccountAuditConfiguration
-> Rep UpdateAccountAuditConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateAccountAuditConfiguration x
-> UpdateAccountAuditConfiguration
$cfrom :: forall x.
UpdateAccountAuditConfiguration
-> Rep UpdateAccountAuditConfiguration x
Prelude.Generic)
newUpdateAccountAuditConfiguration ::
UpdateAccountAuditConfiguration
newUpdateAccountAuditConfiguration :: UpdateAccountAuditConfiguration
newUpdateAccountAuditConfiguration =
UpdateAccountAuditConfiguration'
{ $sel:auditCheckConfigurations:UpdateAccountAuditConfiguration' :: Maybe (HashMap Text AuditCheckConfiguration)
auditCheckConfigurations =
forall a. Maybe a
Prelude.Nothing,
$sel:auditNotificationTargetConfigurations:UpdateAccountAuditConfiguration' :: Maybe (HashMap AuditNotificationType AuditNotificationTarget)
auditNotificationTargetConfigurations =
forall a. Maybe a
Prelude.Nothing,
$sel:roleArn:UpdateAccountAuditConfiguration' :: Maybe Text
roleArn = forall a. Maybe a
Prelude.Nothing
}
updateAccountAuditConfiguration_auditCheckConfigurations :: Lens.Lens' UpdateAccountAuditConfiguration (Prelude.Maybe (Prelude.HashMap Prelude.Text AuditCheckConfiguration))
updateAccountAuditConfiguration_auditCheckConfigurations :: Lens'
UpdateAccountAuditConfiguration
(Maybe (HashMap Text AuditCheckConfiguration))
updateAccountAuditConfiguration_auditCheckConfigurations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAccountAuditConfiguration' {Maybe (HashMap Text AuditCheckConfiguration)
auditCheckConfigurations :: Maybe (HashMap Text AuditCheckConfiguration)
$sel:auditCheckConfigurations:UpdateAccountAuditConfiguration' :: UpdateAccountAuditConfiguration
-> Maybe (HashMap Text AuditCheckConfiguration)
auditCheckConfigurations} -> Maybe (HashMap Text AuditCheckConfiguration)
auditCheckConfigurations) (\s :: UpdateAccountAuditConfiguration
s@UpdateAccountAuditConfiguration' {} Maybe (HashMap Text AuditCheckConfiguration)
a -> UpdateAccountAuditConfiguration
s {$sel:auditCheckConfigurations:UpdateAccountAuditConfiguration' :: Maybe (HashMap Text AuditCheckConfiguration)
auditCheckConfigurations = Maybe (HashMap Text AuditCheckConfiguration)
a} :: UpdateAccountAuditConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
updateAccountAuditConfiguration_auditNotificationTargetConfigurations :: Lens.Lens' UpdateAccountAuditConfiguration (Prelude.Maybe (Prelude.HashMap AuditNotificationType AuditNotificationTarget))
updateAccountAuditConfiguration_auditNotificationTargetConfigurations :: Lens'
UpdateAccountAuditConfiguration
(Maybe (HashMap AuditNotificationType AuditNotificationTarget))
updateAccountAuditConfiguration_auditNotificationTargetConfigurations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAccountAuditConfiguration' {Maybe (HashMap AuditNotificationType AuditNotificationTarget)
auditNotificationTargetConfigurations :: Maybe (HashMap AuditNotificationType AuditNotificationTarget)
$sel:auditNotificationTargetConfigurations:UpdateAccountAuditConfiguration' :: UpdateAccountAuditConfiguration
-> Maybe (HashMap AuditNotificationType AuditNotificationTarget)
auditNotificationTargetConfigurations} -> Maybe (HashMap AuditNotificationType AuditNotificationTarget)
auditNotificationTargetConfigurations) (\s :: UpdateAccountAuditConfiguration
s@UpdateAccountAuditConfiguration' {} Maybe (HashMap AuditNotificationType AuditNotificationTarget)
a -> UpdateAccountAuditConfiguration
s {$sel:auditNotificationTargetConfigurations:UpdateAccountAuditConfiguration' :: Maybe (HashMap AuditNotificationType AuditNotificationTarget)
auditNotificationTargetConfigurations = Maybe (HashMap AuditNotificationType AuditNotificationTarget)
a} :: UpdateAccountAuditConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
updateAccountAuditConfiguration_roleArn :: Lens.Lens' UpdateAccountAuditConfiguration (Prelude.Maybe Prelude.Text)
updateAccountAuditConfiguration_roleArn :: Lens' UpdateAccountAuditConfiguration (Maybe Text)
updateAccountAuditConfiguration_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAccountAuditConfiguration' {Maybe Text
roleArn :: Maybe Text
$sel:roleArn:UpdateAccountAuditConfiguration' :: UpdateAccountAuditConfiguration -> Maybe Text
roleArn} -> Maybe Text
roleArn) (\s :: UpdateAccountAuditConfiguration
s@UpdateAccountAuditConfiguration' {} Maybe Text
a -> UpdateAccountAuditConfiguration
s {$sel:roleArn:UpdateAccountAuditConfiguration' :: Maybe Text
roleArn = Maybe Text
a} :: UpdateAccountAuditConfiguration)
instance
Core.AWSRequest
UpdateAccountAuditConfiguration
where
type
AWSResponse UpdateAccountAuditConfiguration =
UpdateAccountAuditConfigurationResponse
request :: (Service -> Service)
-> UpdateAccountAuditConfiguration
-> Request UpdateAccountAuditConfiguration
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateAccountAuditConfiguration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse UpdateAccountAuditConfiguration)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> UpdateAccountAuditConfigurationResponse
UpdateAccountAuditConfigurationResponse'
forall (f :: * -> *) a b. Functor 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
UpdateAccountAuditConfiguration
where
hashWithSalt :: Int -> UpdateAccountAuditConfiguration -> Int
hashWithSalt
Int
_salt
UpdateAccountAuditConfiguration' {Maybe Text
Maybe (HashMap Text AuditCheckConfiguration)
Maybe (HashMap AuditNotificationType AuditNotificationTarget)
roleArn :: Maybe Text
auditNotificationTargetConfigurations :: Maybe (HashMap AuditNotificationType AuditNotificationTarget)
auditCheckConfigurations :: Maybe (HashMap Text AuditCheckConfiguration)
$sel:roleArn:UpdateAccountAuditConfiguration' :: UpdateAccountAuditConfiguration -> Maybe Text
$sel:auditNotificationTargetConfigurations:UpdateAccountAuditConfiguration' :: UpdateAccountAuditConfiguration
-> Maybe (HashMap AuditNotificationType AuditNotificationTarget)
$sel:auditCheckConfigurations:UpdateAccountAuditConfiguration' :: UpdateAccountAuditConfiguration
-> Maybe (HashMap Text AuditCheckConfiguration)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text AuditCheckConfiguration)
auditCheckConfigurations
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap AuditNotificationType AuditNotificationTarget)
auditNotificationTargetConfigurations
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
roleArn
instance
Prelude.NFData
UpdateAccountAuditConfiguration
where
rnf :: UpdateAccountAuditConfiguration -> ()
rnf UpdateAccountAuditConfiguration' {Maybe Text
Maybe (HashMap Text AuditCheckConfiguration)
Maybe (HashMap AuditNotificationType AuditNotificationTarget)
roleArn :: Maybe Text
auditNotificationTargetConfigurations :: Maybe (HashMap AuditNotificationType AuditNotificationTarget)
auditCheckConfigurations :: Maybe (HashMap Text AuditCheckConfiguration)
$sel:roleArn:UpdateAccountAuditConfiguration' :: UpdateAccountAuditConfiguration -> Maybe Text
$sel:auditNotificationTargetConfigurations:UpdateAccountAuditConfiguration' :: UpdateAccountAuditConfiguration
-> Maybe (HashMap AuditNotificationType AuditNotificationTarget)
$sel:auditCheckConfigurations:UpdateAccountAuditConfiguration' :: UpdateAccountAuditConfiguration
-> Maybe (HashMap Text AuditCheckConfiguration)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text AuditCheckConfiguration)
auditCheckConfigurations
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap AuditNotificationType AuditNotificationTarget)
auditNotificationTargetConfigurations
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
roleArn
instance
Data.ToHeaders
UpdateAccountAuditConfiguration
where
toHeaders :: UpdateAccountAuditConfiguration -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToJSON UpdateAccountAuditConfiguration where
toJSON :: UpdateAccountAuditConfiguration -> Value
toJSON UpdateAccountAuditConfiguration' {Maybe Text
Maybe (HashMap Text AuditCheckConfiguration)
Maybe (HashMap AuditNotificationType AuditNotificationTarget)
roleArn :: Maybe Text
auditNotificationTargetConfigurations :: Maybe (HashMap AuditNotificationType AuditNotificationTarget)
auditCheckConfigurations :: Maybe (HashMap Text AuditCheckConfiguration)
$sel:roleArn:UpdateAccountAuditConfiguration' :: UpdateAccountAuditConfiguration -> Maybe Text
$sel:auditNotificationTargetConfigurations:UpdateAccountAuditConfiguration' :: UpdateAccountAuditConfiguration
-> Maybe (HashMap AuditNotificationType AuditNotificationTarget)
$sel:auditCheckConfigurations:UpdateAccountAuditConfiguration' :: UpdateAccountAuditConfiguration
-> Maybe (HashMap Text AuditCheckConfiguration)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"auditCheckConfigurations" 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 (HashMap Text AuditCheckConfiguration)
auditCheckConfigurations,
(Key
"auditNotificationTargetConfigurations" 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 (HashMap AuditNotificationType AuditNotificationTarget)
auditNotificationTargetConfigurations,
(Key
"roleArn" 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
roleArn
]
)
instance Data.ToPath UpdateAccountAuditConfiguration where
toPath :: UpdateAccountAuditConfiguration -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/audit/configuration"
instance Data.ToQuery UpdateAccountAuditConfiguration where
toQuery :: UpdateAccountAuditConfiguration -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateAccountAuditConfigurationResponse = UpdateAccountAuditConfigurationResponse'
{
UpdateAccountAuditConfigurationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateAccountAuditConfigurationResponse
-> UpdateAccountAuditConfigurationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAccountAuditConfigurationResponse
-> UpdateAccountAuditConfigurationResponse -> Bool
$c/= :: UpdateAccountAuditConfigurationResponse
-> UpdateAccountAuditConfigurationResponse -> Bool
== :: UpdateAccountAuditConfigurationResponse
-> UpdateAccountAuditConfigurationResponse -> Bool
$c== :: UpdateAccountAuditConfigurationResponse
-> UpdateAccountAuditConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [UpdateAccountAuditConfigurationResponse]
ReadPrec UpdateAccountAuditConfigurationResponse
Int -> ReadS UpdateAccountAuditConfigurationResponse
ReadS [UpdateAccountAuditConfigurationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAccountAuditConfigurationResponse]
$creadListPrec :: ReadPrec [UpdateAccountAuditConfigurationResponse]
readPrec :: ReadPrec UpdateAccountAuditConfigurationResponse
$creadPrec :: ReadPrec UpdateAccountAuditConfigurationResponse
readList :: ReadS [UpdateAccountAuditConfigurationResponse]
$creadList :: ReadS [UpdateAccountAuditConfigurationResponse]
readsPrec :: Int -> ReadS UpdateAccountAuditConfigurationResponse
$creadsPrec :: Int -> ReadS UpdateAccountAuditConfigurationResponse
Prelude.Read, Int -> UpdateAccountAuditConfigurationResponse -> ShowS
[UpdateAccountAuditConfigurationResponse] -> ShowS
UpdateAccountAuditConfigurationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAccountAuditConfigurationResponse] -> ShowS
$cshowList :: [UpdateAccountAuditConfigurationResponse] -> ShowS
show :: UpdateAccountAuditConfigurationResponse -> String
$cshow :: UpdateAccountAuditConfigurationResponse -> String
showsPrec :: Int -> UpdateAccountAuditConfigurationResponse -> ShowS
$cshowsPrec :: Int -> UpdateAccountAuditConfigurationResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateAccountAuditConfigurationResponse x
-> UpdateAccountAuditConfigurationResponse
forall x.
UpdateAccountAuditConfigurationResponse
-> Rep UpdateAccountAuditConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateAccountAuditConfigurationResponse x
-> UpdateAccountAuditConfigurationResponse
$cfrom :: forall x.
UpdateAccountAuditConfigurationResponse
-> Rep UpdateAccountAuditConfigurationResponse x
Prelude.Generic)
newUpdateAccountAuditConfigurationResponse ::
Prelude.Int ->
UpdateAccountAuditConfigurationResponse
newUpdateAccountAuditConfigurationResponse :: Int -> UpdateAccountAuditConfigurationResponse
newUpdateAccountAuditConfigurationResponse
Int
pHttpStatus_ =
UpdateAccountAuditConfigurationResponse'
{ $sel:httpStatus:UpdateAccountAuditConfigurationResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateAccountAuditConfigurationResponse_httpStatus :: Lens.Lens' UpdateAccountAuditConfigurationResponse Prelude.Int
updateAccountAuditConfigurationResponse_httpStatus :: Lens' UpdateAccountAuditConfigurationResponse Int
updateAccountAuditConfigurationResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAccountAuditConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateAccountAuditConfigurationResponse' :: UpdateAccountAuditConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateAccountAuditConfigurationResponse
s@UpdateAccountAuditConfigurationResponse' {} Int
a -> UpdateAccountAuditConfigurationResponse
s {$sel:httpStatus:UpdateAccountAuditConfigurationResponse' :: Int
httpStatus = Int
a} :: UpdateAccountAuditConfigurationResponse)
instance
Prelude.NFData
UpdateAccountAuditConfigurationResponse
where
rnf :: UpdateAccountAuditConfigurationResponse -> ()
rnf UpdateAccountAuditConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateAccountAuditConfigurationResponse' :: UpdateAccountAuditConfigurationResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus