{-# 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.CertificateManager.PutAccountConfiguration
(
PutAccountConfiguration (..),
newPutAccountConfiguration,
putAccountConfiguration_expiryEvents,
putAccountConfiguration_idempotencyToken,
PutAccountConfigurationResponse (..),
newPutAccountConfigurationResponse,
)
where
import Amazonka.CertificateManager.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 PutAccountConfiguration = PutAccountConfiguration'
{
PutAccountConfiguration -> Maybe ExpiryEventsConfiguration
expiryEvents :: Prelude.Maybe ExpiryEventsConfiguration,
PutAccountConfiguration -> Text
idempotencyToken :: Prelude.Text
}
deriving (PutAccountConfiguration -> PutAccountConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutAccountConfiguration -> PutAccountConfiguration -> Bool
$c/= :: PutAccountConfiguration -> PutAccountConfiguration -> Bool
== :: PutAccountConfiguration -> PutAccountConfiguration -> Bool
$c== :: PutAccountConfiguration -> PutAccountConfiguration -> Bool
Prelude.Eq, ReadPrec [PutAccountConfiguration]
ReadPrec PutAccountConfiguration
Int -> ReadS PutAccountConfiguration
ReadS [PutAccountConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutAccountConfiguration]
$creadListPrec :: ReadPrec [PutAccountConfiguration]
readPrec :: ReadPrec PutAccountConfiguration
$creadPrec :: ReadPrec PutAccountConfiguration
readList :: ReadS [PutAccountConfiguration]
$creadList :: ReadS [PutAccountConfiguration]
readsPrec :: Int -> ReadS PutAccountConfiguration
$creadsPrec :: Int -> ReadS PutAccountConfiguration
Prelude.Read, Int -> PutAccountConfiguration -> ShowS
[PutAccountConfiguration] -> ShowS
PutAccountConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutAccountConfiguration] -> ShowS
$cshowList :: [PutAccountConfiguration] -> ShowS
show :: PutAccountConfiguration -> String
$cshow :: PutAccountConfiguration -> String
showsPrec :: Int -> PutAccountConfiguration -> ShowS
$cshowsPrec :: Int -> PutAccountConfiguration -> ShowS
Prelude.Show, forall x. Rep PutAccountConfiguration x -> PutAccountConfiguration
forall x. PutAccountConfiguration -> Rep PutAccountConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutAccountConfiguration x -> PutAccountConfiguration
$cfrom :: forall x. PutAccountConfiguration -> Rep PutAccountConfiguration x
Prelude.Generic)
newPutAccountConfiguration ::
Prelude.Text ->
PutAccountConfiguration
newPutAccountConfiguration :: Text -> PutAccountConfiguration
newPutAccountConfiguration Text
pIdempotencyToken_ =
PutAccountConfiguration'
{ $sel:expiryEvents:PutAccountConfiguration' :: Maybe ExpiryEventsConfiguration
expiryEvents =
forall a. Maybe a
Prelude.Nothing,
$sel:idempotencyToken:PutAccountConfiguration' :: Text
idempotencyToken = Text
pIdempotencyToken_
}
putAccountConfiguration_expiryEvents :: Lens.Lens' PutAccountConfiguration (Prelude.Maybe ExpiryEventsConfiguration)
putAccountConfiguration_expiryEvents :: Lens' PutAccountConfiguration (Maybe ExpiryEventsConfiguration)
putAccountConfiguration_expiryEvents = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAccountConfiguration' {Maybe ExpiryEventsConfiguration
expiryEvents :: Maybe ExpiryEventsConfiguration
$sel:expiryEvents:PutAccountConfiguration' :: PutAccountConfiguration -> Maybe ExpiryEventsConfiguration
expiryEvents} -> Maybe ExpiryEventsConfiguration
expiryEvents) (\s :: PutAccountConfiguration
s@PutAccountConfiguration' {} Maybe ExpiryEventsConfiguration
a -> PutAccountConfiguration
s {$sel:expiryEvents:PutAccountConfiguration' :: Maybe ExpiryEventsConfiguration
expiryEvents = Maybe ExpiryEventsConfiguration
a} :: PutAccountConfiguration)
putAccountConfiguration_idempotencyToken :: Lens.Lens' PutAccountConfiguration Prelude.Text
putAccountConfiguration_idempotencyToken :: Lens' PutAccountConfiguration Text
putAccountConfiguration_idempotencyToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAccountConfiguration' {Text
idempotencyToken :: Text
$sel:idempotencyToken:PutAccountConfiguration' :: PutAccountConfiguration -> Text
idempotencyToken} -> Text
idempotencyToken) (\s :: PutAccountConfiguration
s@PutAccountConfiguration' {} Text
a -> PutAccountConfiguration
s {$sel:idempotencyToken:PutAccountConfiguration' :: Text
idempotencyToken = Text
a} :: PutAccountConfiguration)
instance Core.AWSRequest PutAccountConfiguration where
type
AWSResponse PutAccountConfiguration =
PutAccountConfigurationResponse
request :: (Service -> Service)
-> PutAccountConfiguration -> Request PutAccountConfiguration
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 PutAccountConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutAccountConfiguration)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
PutAccountConfigurationResponse
PutAccountConfigurationResponse'
instance Prelude.Hashable PutAccountConfiguration where
hashWithSalt :: Int -> PutAccountConfiguration -> Int
hashWithSalt Int
_salt PutAccountConfiguration' {Maybe ExpiryEventsConfiguration
Text
idempotencyToken :: Text
expiryEvents :: Maybe ExpiryEventsConfiguration
$sel:idempotencyToken:PutAccountConfiguration' :: PutAccountConfiguration -> Text
$sel:expiryEvents:PutAccountConfiguration' :: PutAccountConfiguration -> Maybe ExpiryEventsConfiguration
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ExpiryEventsConfiguration
expiryEvents
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
idempotencyToken
instance Prelude.NFData PutAccountConfiguration where
rnf :: PutAccountConfiguration -> ()
rnf PutAccountConfiguration' {Maybe ExpiryEventsConfiguration
Text
idempotencyToken :: Text
expiryEvents :: Maybe ExpiryEventsConfiguration
$sel:idempotencyToken:PutAccountConfiguration' :: PutAccountConfiguration -> Text
$sel:expiryEvents:PutAccountConfiguration' :: PutAccountConfiguration -> Maybe ExpiryEventsConfiguration
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ExpiryEventsConfiguration
expiryEvents
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
idempotencyToken
instance Data.ToHeaders PutAccountConfiguration where
toHeaders :: PutAccountConfiguration -> [Header]
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"CertificateManager.PutAccountConfiguration" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON PutAccountConfiguration where
toJSON :: PutAccountConfiguration -> Value
toJSON PutAccountConfiguration' {Maybe ExpiryEventsConfiguration
Text
idempotencyToken :: Text
expiryEvents :: Maybe ExpiryEventsConfiguration
$sel:idempotencyToken:PutAccountConfiguration' :: PutAccountConfiguration -> Text
$sel:expiryEvents:PutAccountConfiguration' :: PutAccountConfiguration -> Maybe ExpiryEventsConfiguration
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ExpiryEvents" 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 ExpiryEventsConfiguration
expiryEvents,
forall a. a -> Maybe a
Prelude.Just
(Key
"IdempotencyToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
idempotencyToken)
]
)
instance Data.ToPath PutAccountConfiguration where
toPath :: PutAccountConfiguration -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery PutAccountConfiguration where
toQuery :: PutAccountConfiguration -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data PutAccountConfigurationResponse = PutAccountConfigurationResponse'
{
}
deriving (PutAccountConfigurationResponse
-> PutAccountConfigurationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutAccountConfigurationResponse
-> PutAccountConfigurationResponse -> Bool
$c/= :: PutAccountConfigurationResponse
-> PutAccountConfigurationResponse -> Bool
== :: PutAccountConfigurationResponse
-> PutAccountConfigurationResponse -> Bool
$c== :: PutAccountConfigurationResponse
-> PutAccountConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [PutAccountConfigurationResponse]
ReadPrec PutAccountConfigurationResponse
Int -> ReadS PutAccountConfigurationResponse
ReadS [PutAccountConfigurationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutAccountConfigurationResponse]
$creadListPrec :: ReadPrec [PutAccountConfigurationResponse]
readPrec :: ReadPrec PutAccountConfigurationResponse
$creadPrec :: ReadPrec PutAccountConfigurationResponse
readList :: ReadS [PutAccountConfigurationResponse]
$creadList :: ReadS [PutAccountConfigurationResponse]
readsPrec :: Int -> ReadS PutAccountConfigurationResponse
$creadsPrec :: Int -> ReadS PutAccountConfigurationResponse
Prelude.Read, Int -> PutAccountConfigurationResponse -> ShowS
[PutAccountConfigurationResponse] -> ShowS
PutAccountConfigurationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutAccountConfigurationResponse] -> ShowS
$cshowList :: [PutAccountConfigurationResponse] -> ShowS
show :: PutAccountConfigurationResponse -> String
$cshow :: PutAccountConfigurationResponse -> String
showsPrec :: Int -> PutAccountConfigurationResponse -> ShowS
$cshowsPrec :: Int -> PutAccountConfigurationResponse -> ShowS
Prelude.Show, forall x.
Rep PutAccountConfigurationResponse x
-> PutAccountConfigurationResponse
forall x.
PutAccountConfigurationResponse
-> Rep PutAccountConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutAccountConfigurationResponse x
-> PutAccountConfigurationResponse
$cfrom :: forall x.
PutAccountConfigurationResponse
-> Rep PutAccountConfigurationResponse x
Prelude.Generic)
newPutAccountConfigurationResponse ::
PutAccountConfigurationResponse
newPutAccountConfigurationResponse :: PutAccountConfigurationResponse
newPutAccountConfigurationResponse =
PutAccountConfigurationResponse
PutAccountConfigurationResponse'
instance
Prelude.NFData
PutAccountConfigurationResponse
where
rnf :: PutAccountConfigurationResponse -> ()
rnf PutAccountConfigurationResponse
_ = ()