{-# 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.DirectConnect.DisassociateMacSecKey
(
DisassociateMacSecKey (..),
newDisassociateMacSecKey,
disassociateMacSecKey_connectionId,
disassociateMacSecKey_secretARN,
DisassociateMacSecKeyResponse (..),
newDisassociateMacSecKeyResponse,
disassociateMacSecKeyResponse_connectionId,
disassociateMacSecKeyResponse_macSecKeys,
disassociateMacSecKeyResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.DirectConnect.Types
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 DisassociateMacSecKey = DisassociateMacSecKey'
{
DisassociateMacSecKey -> Text
connectionId :: Prelude.Text,
DisassociateMacSecKey -> Text
secretARN :: Prelude.Text
}
deriving (DisassociateMacSecKey -> DisassociateMacSecKey -> Bool
(DisassociateMacSecKey -> DisassociateMacSecKey -> Bool)
-> (DisassociateMacSecKey -> DisassociateMacSecKey -> Bool)
-> Eq DisassociateMacSecKey
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateMacSecKey -> DisassociateMacSecKey -> Bool
$c/= :: DisassociateMacSecKey -> DisassociateMacSecKey -> Bool
== :: DisassociateMacSecKey -> DisassociateMacSecKey -> Bool
$c== :: DisassociateMacSecKey -> DisassociateMacSecKey -> Bool
Prelude.Eq, ReadPrec [DisassociateMacSecKey]
ReadPrec DisassociateMacSecKey
Int -> ReadS DisassociateMacSecKey
ReadS [DisassociateMacSecKey]
(Int -> ReadS DisassociateMacSecKey)
-> ReadS [DisassociateMacSecKey]
-> ReadPrec DisassociateMacSecKey
-> ReadPrec [DisassociateMacSecKey]
-> Read DisassociateMacSecKey
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateMacSecKey]
$creadListPrec :: ReadPrec [DisassociateMacSecKey]
readPrec :: ReadPrec DisassociateMacSecKey
$creadPrec :: ReadPrec DisassociateMacSecKey
readList :: ReadS [DisassociateMacSecKey]
$creadList :: ReadS [DisassociateMacSecKey]
readsPrec :: Int -> ReadS DisassociateMacSecKey
$creadsPrec :: Int -> ReadS DisassociateMacSecKey
Prelude.Read, Int -> DisassociateMacSecKey -> ShowS
[DisassociateMacSecKey] -> ShowS
DisassociateMacSecKey -> String
(Int -> DisassociateMacSecKey -> ShowS)
-> (DisassociateMacSecKey -> String)
-> ([DisassociateMacSecKey] -> ShowS)
-> Show DisassociateMacSecKey
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateMacSecKey] -> ShowS
$cshowList :: [DisassociateMacSecKey] -> ShowS
show :: DisassociateMacSecKey -> String
$cshow :: DisassociateMacSecKey -> String
showsPrec :: Int -> DisassociateMacSecKey -> ShowS
$cshowsPrec :: Int -> DisassociateMacSecKey -> ShowS
Prelude.Show, (forall x. DisassociateMacSecKey -> Rep DisassociateMacSecKey x)
-> (forall x. Rep DisassociateMacSecKey x -> DisassociateMacSecKey)
-> Generic DisassociateMacSecKey
forall x. Rep DisassociateMacSecKey x -> DisassociateMacSecKey
forall x. DisassociateMacSecKey -> Rep DisassociateMacSecKey x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DisassociateMacSecKey x -> DisassociateMacSecKey
$cfrom :: forall x. DisassociateMacSecKey -> Rep DisassociateMacSecKey x
Prelude.Generic)
newDisassociateMacSecKey ::
Prelude.Text ->
Prelude.Text ->
DisassociateMacSecKey
newDisassociateMacSecKey :: Text -> Text -> DisassociateMacSecKey
newDisassociateMacSecKey Text
pConnectionId_ Text
pSecretARN_ =
DisassociateMacSecKey' :: Text -> Text -> DisassociateMacSecKey
DisassociateMacSecKey'
{ $sel:connectionId:DisassociateMacSecKey' :: Text
connectionId =
Text
pConnectionId_,
$sel:secretARN:DisassociateMacSecKey' :: Text
secretARN = Text
pSecretARN_
}
disassociateMacSecKey_connectionId :: Lens.Lens' DisassociateMacSecKey Prelude.Text
disassociateMacSecKey_connectionId :: (Text -> f Text)
-> DisassociateMacSecKey -> f DisassociateMacSecKey
disassociateMacSecKey_connectionId = (DisassociateMacSecKey -> Text)
-> (DisassociateMacSecKey -> Text -> DisassociateMacSecKey)
-> Lens DisassociateMacSecKey DisassociateMacSecKey Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateMacSecKey' {Text
connectionId :: Text
$sel:connectionId:DisassociateMacSecKey' :: DisassociateMacSecKey -> Text
connectionId} -> Text
connectionId) (\s :: DisassociateMacSecKey
s@DisassociateMacSecKey' {} Text
a -> DisassociateMacSecKey
s {$sel:connectionId:DisassociateMacSecKey' :: Text
connectionId = Text
a} :: DisassociateMacSecKey)
disassociateMacSecKey_secretARN :: Lens.Lens' DisassociateMacSecKey Prelude.Text
disassociateMacSecKey_secretARN :: (Text -> f Text)
-> DisassociateMacSecKey -> f DisassociateMacSecKey
disassociateMacSecKey_secretARN = (DisassociateMacSecKey -> Text)
-> (DisassociateMacSecKey -> Text -> DisassociateMacSecKey)
-> Lens DisassociateMacSecKey DisassociateMacSecKey Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateMacSecKey' {Text
secretARN :: Text
$sel:secretARN:DisassociateMacSecKey' :: DisassociateMacSecKey -> Text
secretARN} -> Text
secretARN) (\s :: DisassociateMacSecKey
s@DisassociateMacSecKey' {} Text
a -> DisassociateMacSecKey
s {$sel:secretARN:DisassociateMacSecKey' :: Text
secretARN = Text
a} :: DisassociateMacSecKey)
instance Core.AWSRequest DisassociateMacSecKey where
type
AWSResponse DisassociateMacSecKey =
DisassociateMacSecKeyResponse
request :: DisassociateMacSecKey -> Request DisassociateMacSecKey
request = Service -> DisassociateMacSecKey -> Request DisassociateMacSecKey
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DisassociateMacSecKey
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisassociateMacSecKey)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DisassociateMacSecKey))
-> Logger
-> Service
-> Proxy DisassociateMacSecKey
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DisassociateMacSecKey)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Maybe [MacSecKey] -> Int -> DisassociateMacSecKeyResponse
DisassociateMacSecKeyResponse'
(Maybe Text
-> Maybe [MacSecKey] -> Int -> DisassociateMacSecKeyResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe [MacSecKey] -> Int -> DisassociateMacSecKeyResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"connectionId")
Either
String (Maybe [MacSecKey] -> Int -> DisassociateMacSecKeyResponse)
-> Either String (Maybe [MacSecKey])
-> Either String (Int -> DisassociateMacSecKeyResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [MacSecKey]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"macSecKeys" Either String (Maybe (Maybe [MacSecKey]))
-> Maybe [MacSecKey] -> Either String (Maybe [MacSecKey])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [MacSecKey]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> DisassociateMacSecKeyResponse)
-> Either String Int -> Either String DisassociateMacSecKeyResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DisassociateMacSecKey
instance Prelude.NFData DisassociateMacSecKey
instance Core.ToHeaders DisassociateMacSecKey where
toHeaders :: DisassociateMacSecKey -> ResponseHeaders
toHeaders =
ResponseHeaders -> DisassociateMacSecKey -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"OvertureService.DisassociateMacSecKey" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DisassociateMacSecKey where
toJSON :: DisassociateMacSecKey -> Value
toJSON DisassociateMacSecKey' {Text
secretARN :: Text
connectionId :: Text
$sel:secretARN:DisassociateMacSecKey' :: DisassociateMacSecKey -> Text
$sel:connectionId:DisassociateMacSecKey' :: DisassociateMacSecKey -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"connectionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
connectionId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"secretARN" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
secretARN)
]
)
instance Core.ToPath DisassociateMacSecKey where
toPath :: DisassociateMacSecKey -> ByteString
toPath = ByteString -> DisassociateMacSecKey -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DisassociateMacSecKey where
toQuery :: DisassociateMacSecKey -> QueryString
toQuery = QueryString -> DisassociateMacSecKey -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DisassociateMacSecKeyResponse = DisassociateMacSecKeyResponse'
{
DisassociateMacSecKeyResponse -> Maybe Text
connectionId :: Prelude.Maybe Prelude.Text,
DisassociateMacSecKeyResponse -> Maybe [MacSecKey]
macSecKeys :: Prelude.Maybe [MacSecKey],
DisassociateMacSecKeyResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DisassociateMacSecKeyResponse
-> DisassociateMacSecKeyResponse -> Bool
(DisassociateMacSecKeyResponse
-> DisassociateMacSecKeyResponse -> Bool)
-> (DisassociateMacSecKeyResponse
-> DisassociateMacSecKeyResponse -> Bool)
-> Eq DisassociateMacSecKeyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateMacSecKeyResponse
-> DisassociateMacSecKeyResponse -> Bool
$c/= :: DisassociateMacSecKeyResponse
-> DisassociateMacSecKeyResponse -> Bool
== :: DisassociateMacSecKeyResponse
-> DisassociateMacSecKeyResponse -> Bool
$c== :: DisassociateMacSecKeyResponse
-> DisassociateMacSecKeyResponse -> Bool
Prelude.Eq, ReadPrec [DisassociateMacSecKeyResponse]
ReadPrec DisassociateMacSecKeyResponse
Int -> ReadS DisassociateMacSecKeyResponse
ReadS [DisassociateMacSecKeyResponse]
(Int -> ReadS DisassociateMacSecKeyResponse)
-> ReadS [DisassociateMacSecKeyResponse]
-> ReadPrec DisassociateMacSecKeyResponse
-> ReadPrec [DisassociateMacSecKeyResponse]
-> Read DisassociateMacSecKeyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateMacSecKeyResponse]
$creadListPrec :: ReadPrec [DisassociateMacSecKeyResponse]
readPrec :: ReadPrec DisassociateMacSecKeyResponse
$creadPrec :: ReadPrec DisassociateMacSecKeyResponse
readList :: ReadS [DisassociateMacSecKeyResponse]
$creadList :: ReadS [DisassociateMacSecKeyResponse]
readsPrec :: Int -> ReadS DisassociateMacSecKeyResponse
$creadsPrec :: Int -> ReadS DisassociateMacSecKeyResponse
Prelude.Read, Int -> DisassociateMacSecKeyResponse -> ShowS
[DisassociateMacSecKeyResponse] -> ShowS
DisassociateMacSecKeyResponse -> String
(Int -> DisassociateMacSecKeyResponse -> ShowS)
-> (DisassociateMacSecKeyResponse -> String)
-> ([DisassociateMacSecKeyResponse] -> ShowS)
-> Show DisassociateMacSecKeyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateMacSecKeyResponse] -> ShowS
$cshowList :: [DisassociateMacSecKeyResponse] -> ShowS
show :: DisassociateMacSecKeyResponse -> String
$cshow :: DisassociateMacSecKeyResponse -> String
showsPrec :: Int -> DisassociateMacSecKeyResponse -> ShowS
$cshowsPrec :: Int -> DisassociateMacSecKeyResponse -> ShowS
Prelude.Show, (forall x.
DisassociateMacSecKeyResponse
-> Rep DisassociateMacSecKeyResponse x)
-> (forall x.
Rep DisassociateMacSecKeyResponse x
-> DisassociateMacSecKeyResponse)
-> Generic DisassociateMacSecKeyResponse
forall x.
Rep DisassociateMacSecKeyResponse x
-> DisassociateMacSecKeyResponse
forall x.
DisassociateMacSecKeyResponse
-> Rep DisassociateMacSecKeyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateMacSecKeyResponse x
-> DisassociateMacSecKeyResponse
$cfrom :: forall x.
DisassociateMacSecKeyResponse
-> Rep DisassociateMacSecKeyResponse x
Prelude.Generic)
newDisassociateMacSecKeyResponse ::
Prelude.Int ->
DisassociateMacSecKeyResponse
newDisassociateMacSecKeyResponse :: Int -> DisassociateMacSecKeyResponse
newDisassociateMacSecKeyResponse Int
pHttpStatus_ =
DisassociateMacSecKeyResponse' :: Maybe Text
-> Maybe [MacSecKey] -> Int -> DisassociateMacSecKeyResponse
DisassociateMacSecKeyResponse'
{ $sel:connectionId:DisassociateMacSecKeyResponse' :: Maybe Text
connectionId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:macSecKeys:DisassociateMacSecKeyResponse' :: Maybe [MacSecKey]
macSecKeys = Maybe [MacSecKey]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DisassociateMacSecKeyResponse' :: Int
httpStatus = Int
pHttpStatus_
}
disassociateMacSecKeyResponse_connectionId :: Lens.Lens' DisassociateMacSecKeyResponse (Prelude.Maybe Prelude.Text)
disassociateMacSecKeyResponse_connectionId :: (Maybe Text -> f (Maybe Text))
-> DisassociateMacSecKeyResponse -> f DisassociateMacSecKeyResponse
disassociateMacSecKeyResponse_connectionId = (DisassociateMacSecKeyResponse -> Maybe Text)
-> (DisassociateMacSecKeyResponse
-> Maybe Text -> DisassociateMacSecKeyResponse)
-> Lens
DisassociateMacSecKeyResponse
DisassociateMacSecKeyResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateMacSecKeyResponse' {Maybe Text
connectionId :: Maybe Text
$sel:connectionId:DisassociateMacSecKeyResponse' :: DisassociateMacSecKeyResponse -> Maybe Text
connectionId} -> Maybe Text
connectionId) (\s :: DisassociateMacSecKeyResponse
s@DisassociateMacSecKeyResponse' {} Maybe Text
a -> DisassociateMacSecKeyResponse
s {$sel:connectionId:DisassociateMacSecKeyResponse' :: Maybe Text
connectionId = Maybe Text
a} :: DisassociateMacSecKeyResponse)
disassociateMacSecKeyResponse_macSecKeys :: Lens.Lens' DisassociateMacSecKeyResponse (Prelude.Maybe [MacSecKey])
disassociateMacSecKeyResponse_macSecKeys :: (Maybe [MacSecKey] -> f (Maybe [MacSecKey]))
-> DisassociateMacSecKeyResponse -> f DisassociateMacSecKeyResponse
disassociateMacSecKeyResponse_macSecKeys = (DisassociateMacSecKeyResponse -> Maybe [MacSecKey])
-> (DisassociateMacSecKeyResponse
-> Maybe [MacSecKey] -> DisassociateMacSecKeyResponse)
-> Lens
DisassociateMacSecKeyResponse
DisassociateMacSecKeyResponse
(Maybe [MacSecKey])
(Maybe [MacSecKey])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateMacSecKeyResponse' {Maybe [MacSecKey]
macSecKeys :: Maybe [MacSecKey]
$sel:macSecKeys:DisassociateMacSecKeyResponse' :: DisassociateMacSecKeyResponse -> Maybe [MacSecKey]
macSecKeys} -> Maybe [MacSecKey]
macSecKeys) (\s :: DisassociateMacSecKeyResponse
s@DisassociateMacSecKeyResponse' {} Maybe [MacSecKey]
a -> DisassociateMacSecKeyResponse
s {$sel:macSecKeys:DisassociateMacSecKeyResponse' :: Maybe [MacSecKey]
macSecKeys = Maybe [MacSecKey]
a} :: DisassociateMacSecKeyResponse) ((Maybe [MacSecKey] -> f (Maybe [MacSecKey]))
-> DisassociateMacSecKeyResponse
-> f DisassociateMacSecKeyResponse)
-> ((Maybe [MacSecKey] -> f (Maybe [MacSecKey]))
-> Maybe [MacSecKey] -> f (Maybe [MacSecKey]))
-> (Maybe [MacSecKey] -> f (Maybe [MacSecKey]))
-> DisassociateMacSecKeyResponse
-> f DisassociateMacSecKeyResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [MacSecKey] [MacSecKey] [MacSecKey] [MacSecKey]
-> Iso
(Maybe [MacSecKey])
(Maybe [MacSecKey])
(Maybe [MacSecKey])
(Maybe [MacSecKey])
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 AnIso [MacSecKey] [MacSecKey] [MacSecKey] [MacSecKey]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
disassociateMacSecKeyResponse_httpStatus :: Lens.Lens' DisassociateMacSecKeyResponse Prelude.Int
disassociateMacSecKeyResponse_httpStatus :: (Int -> f Int)
-> DisassociateMacSecKeyResponse -> f DisassociateMacSecKeyResponse
disassociateMacSecKeyResponse_httpStatus = (DisassociateMacSecKeyResponse -> Int)
-> (DisassociateMacSecKeyResponse
-> Int -> DisassociateMacSecKeyResponse)
-> Lens
DisassociateMacSecKeyResponse DisassociateMacSecKeyResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateMacSecKeyResponse' {Int
httpStatus :: Int
$sel:httpStatus:DisassociateMacSecKeyResponse' :: DisassociateMacSecKeyResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DisassociateMacSecKeyResponse
s@DisassociateMacSecKeyResponse' {} Int
a -> DisassociateMacSecKeyResponse
s {$sel:httpStatus:DisassociateMacSecKeyResponse' :: Int
httpStatus = Int
a} :: DisassociateMacSecKeyResponse)
instance Prelude.NFData DisassociateMacSecKeyResponse