{-# 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.DeleteBGPPeer
(
DeleteBGPPeer (..),
newDeleteBGPPeer,
deleteBGPPeer_customerAddress,
deleteBGPPeer_asn,
deleteBGPPeer_bgpPeerId,
deleteBGPPeer_virtualInterfaceId,
DeleteBGPPeerResponse (..),
newDeleteBGPPeerResponse,
deleteBGPPeerResponse_virtualInterface,
deleteBGPPeerResponse_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 DeleteBGPPeer = DeleteBGPPeer'
{
DeleteBGPPeer -> Maybe Text
customerAddress :: Prelude.Maybe Prelude.Text,
DeleteBGPPeer -> Maybe Int
asn :: Prelude.Maybe Prelude.Int,
DeleteBGPPeer -> Maybe Text
bgpPeerId :: Prelude.Maybe Prelude.Text,
DeleteBGPPeer -> Maybe Text
virtualInterfaceId :: Prelude.Maybe Prelude.Text
}
deriving (DeleteBGPPeer -> DeleteBGPPeer -> Bool
(DeleteBGPPeer -> DeleteBGPPeer -> Bool)
-> (DeleteBGPPeer -> DeleteBGPPeer -> Bool) -> Eq DeleteBGPPeer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteBGPPeer -> DeleteBGPPeer -> Bool
$c/= :: DeleteBGPPeer -> DeleteBGPPeer -> Bool
== :: DeleteBGPPeer -> DeleteBGPPeer -> Bool
$c== :: DeleteBGPPeer -> DeleteBGPPeer -> Bool
Prelude.Eq, ReadPrec [DeleteBGPPeer]
ReadPrec DeleteBGPPeer
Int -> ReadS DeleteBGPPeer
ReadS [DeleteBGPPeer]
(Int -> ReadS DeleteBGPPeer)
-> ReadS [DeleteBGPPeer]
-> ReadPrec DeleteBGPPeer
-> ReadPrec [DeleteBGPPeer]
-> Read DeleteBGPPeer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteBGPPeer]
$creadListPrec :: ReadPrec [DeleteBGPPeer]
readPrec :: ReadPrec DeleteBGPPeer
$creadPrec :: ReadPrec DeleteBGPPeer
readList :: ReadS [DeleteBGPPeer]
$creadList :: ReadS [DeleteBGPPeer]
readsPrec :: Int -> ReadS DeleteBGPPeer
$creadsPrec :: Int -> ReadS DeleteBGPPeer
Prelude.Read, Int -> DeleteBGPPeer -> ShowS
[DeleteBGPPeer] -> ShowS
DeleteBGPPeer -> String
(Int -> DeleteBGPPeer -> ShowS)
-> (DeleteBGPPeer -> String)
-> ([DeleteBGPPeer] -> ShowS)
-> Show DeleteBGPPeer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteBGPPeer] -> ShowS
$cshowList :: [DeleteBGPPeer] -> ShowS
show :: DeleteBGPPeer -> String
$cshow :: DeleteBGPPeer -> String
showsPrec :: Int -> DeleteBGPPeer -> ShowS
$cshowsPrec :: Int -> DeleteBGPPeer -> ShowS
Prelude.Show, (forall x. DeleteBGPPeer -> Rep DeleteBGPPeer x)
-> (forall x. Rep DeleteBGPPeer x -> DeleteBGPPeer)
-> Generic DeleteBGPPeer
forall x. Rep DeleteBGPPeer x -> DeleteBGPPeer
forall x. DeleteBGPPeer -> Rep DeleteBGPPeer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteBGPPeer x -> DeleteBGPPeer
$cfrom :: forall x. DeleteBGPPeer -> Rep DeleteBGPPeer x
Prelude.Generic)
newDeleteBGPPeer ::
DeleteBGPPeer
newDeleteBGPPeer :: DeleteBGPPeer
newDeleteBGPPeer =
DeleteBGPPeer' :: Maybe Text
-> Maybe Int -> Maybe Text -> Maybe Text -> DeleteBGPPeer
DeleteBGPPeer'
{ $sel:customerAddress:DeleteBGPPeer' :: Maybe Text
customerAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:asn:DeleteBGPPeer' :: Maybe Int
asn = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:bgpPeerId:DeleteBGPPeer' :: Maybe Text
bgpPeerId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:virtualInterfaceId:DeleteBGPPeer' :: Maybe Text
virtualInterfaceId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
deleteBGPPeer_customerAddress :: Lens.Lens' DeleteBGPPeer (Prelude.Maybe Prelude.Text)
deleteBGPPeer_customerAddress :: (Maybe Text -> f (Maybe Text)) -> DeleteBGPPeer -> f DeleteBGPPeer
deleteBGPPeer_customerAddress = (DeleteBGPPeer -> Maybe Text)
-> (DeleteBGPPeer -> Maybe Text -> DeleteBGPPeer)
-> Lens DeleteBGPPeer DeleteBGPPeer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBGPPeer' {Maybe Text
customerAddress :: Maybe Text
$sel:customerAddress:DeleteBGPPeer' :: DeleteBGPPeer -> Maybe Text
customerAddress} -> Maybe Text
customerAddress) (\s :: DeleteBGPPeer
s@DeleteBGPPeer' {} Maybe Text
a -> DeleteBGPPeer
s {$sel:customerAddress:DeleteBGPPeer' :: Maybe Text
customerAddress = Maybe Text
a} :: DeleteBGPPeer)
deleteBGPPeer_asn :: Lens.Lens' DeleteBGPPeer (Prelude.Maybe Prelude.Int)
deleteBGPPeer_asn :: (Maybe Int -> f (Maybe Int)) -> DeleteBGPPeer -> f DeleteBGPPeer
deleteBGPPeer_asn = (DeleteBGPPeer -> Maybe Int)
-> (DeleteBGPPeer -> Maybe Int -> DeleteBGPPeer)
-> Lens DeleteBGPPeer DeleteBGPPeer (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBGPPeer' {Maybe Int
asn :: Maybe Int
$sel:asn:DeleteBGPPeer' :: DeleteBGPPeer -> Maybe Int
asn} -> Maybe Int
asn) (\s :: DeleteBGPPeer
s@DeleteBGPPeer' {} Maybe Int
a -> DeleteBGPPeer
s {$sel:asn:DeleteBGPPeer' :: Maybe Int
asn = Maybe Int
a} :: DeleteBGPPeer)
deleteBGPPeer_bgpPeerId :: Lens.Lens' DeleteBGPPeer (Prelude.Maybe Prelude.Text)
deleteBGPPeer_bgpPeerId :: (Maybe Text -> f (Maybe Text)) -> DeleteBGPPeer -> f DeleteBGPPeer
deleteBGPPeer_bgpPeerId = (DeleteBGPPeer -> Maybe Text)
-> (DeleteBGPPeer -> Maybe Text -> DeleteBGPPeer)
-> Lens DeleteBGPPeer DeleteBGPPeer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBGPPeer' {Maybe Text
bgpPeerId :: Maybe Text
$sel:bgpPeerId:DeleteBGPPeer' :: DeleteBGPPeer -> Maybe Text
bgpPeerId} -> Maybe Text
bgpPeerId) (\s :: DeleteBGPPeer
s@DeleteBGPPeer' {} Maybe Text
a -> DeleteBGPPeer
s {$sel:bgpPeerId:DeleteBGPPeer' :: Maybe Text
bgpPeerId = Maybe Text
a} :: DeleteBGPPeer)
deleteBGPPeer_virtualInterfaceId :: Lens.Lens' DeleteBGPPeer (Prelude.Maybe Prelude.Text)
deleteBGPPeer_virtualInterfaceId :: (Maybe Text -> f (Maybe Text)) -> DeleteBGPPeer -> f DeleteBGPPeer
deleteBGPPeer_virtualInterfaceId = (DeleteBGPPeer -> Maybe Text)
-> (DeleteBGPPeer -> Maybe Text -> DeleteBGPPeer)
-> Lens DeleteBGPPeer DeleteBGPPeer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBGPPeer' {Maybe Text
virtualInterfaceId :: Maybe Text
$sel:virtualInterfaceId:DeleteBGPPeer' :: DeleteBGPPeer -> Maybe Text
virtualInterfaceId} -> Maybe Text
virtualInterfaceId) (\s :: DeleteBGPPeer
s@DeleteBGPPeer' {} Maybe Text
a -> DeleteBGPPeer
s {$sel:virtualInterfaceId:DeleteBGPPeer' :: Maybe Text
virtualInterfaceId = Maybe Text
a} :: DeleteBGPPeer)
instance Core.AWSRequest DeleteBGPPeer where
type
AWSResponse DeleteBGPPeer =
DeleteBGPPeerResponse
request :: DeleteBGPPeer -> Request DeleteBGPPeer
request = Service -> DeleteBGPPeer -> Request DeleteBGPPeer
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteBGPPeer
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteBGPPeer)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteBGPPeer))
-> Logger
-> Service
-> Proxy DeleteBGPPeer
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteBGPPeer)))
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 VirtualInterface -> Int -> DeleteBGPPeerResponse
DeleteBGPPeerResponse'
(Maybe VirtualInterface -> Int -> DeleteBGPPeerResponse)
-> Either String (Maybe VirtualInterface)
-> Either String (Int -> DeleteBGPPeerResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe VirtualInterface)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"virtualInterface")
Either String (Int -> DeleteBGPPeerResponse)
-> Either String Int -> Either String DeleteBGPPeerResponse
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 DeleteBGPPeer
instance Prelude.NFData DeleteBGPPeer
instance Core.ToHeaders DeleteBGPPeer where
toHeaders :: DeleteBGPPeer -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteBGPPeer -> 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.DeleteBGPPeer" ::
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 DeleteBGPPeer where
toJSON :: DeleteBGPPeer -> Value
toJSON DeleteBGPPeer' {Maybe Int
Maybe Text
virtualInterfaceId :: Maybe Text
bgpPeerId :: Maybe Text
asn :: Maybe Int
customerAddress :: Maybe Text
$sel:virtualInterfaceId:DeleteBGPPeer' :: DeleteBGPPeer -> Maybe Text
$sel:bgpPeerId:DeleteBGPPeer' :: DeleteBGPPeer -> Maybe Text
$sel:asn:DeleteBGPPeer' :: DeleteBGPPeer -> Maybe Int
$sel:customerAddress:DeleteBGPPeer' :: DeleteBGPPeer -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"customerAddress" 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
customerAddress,
(Text
"asn" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
asn,
(Text
"bgpPeerId" 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
bgpPeerId,
(Text
"virtualInterfaceId" 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
virtualInterfaceId
]
)
instance Core.ToPath DeleteBGPPeer where
toPath :: DeleteBGPPeer -> ByteString
toPath = ByteString -> DeleteBGPPeer -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteBGPPeer where
toQuery :: DeleteBGPPeer -> QueryString
toQuery = QueryString -> DeleteBGPPeer -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteBGPPeerResponse = DeleteBGPPeerResponse'
{
DeleteBGPPeerResponse -> Maybe VirtualInterface
virtualInterface :: Prelude.Maybe VirtualInterface,
DeleteBGPPeerResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteBGPPeerResponse -> DeleteBGPPeerResponse -> Bool
(DeleteBGPPeerResponse -> DeleteBGPPeerResponse -> Bool)
-> (DeleteBGPPeerResponse -> DeleteBGPPeerResponse -> Bool)
-> Eq DeleteBGPPeerResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteBGPPeerResponse -> DeleteBGPPeerResponse -> Bool
$c/= :: DeleteBGPPeerResponse -> DeleteBGPPeerResponse -> Bool
== :: DeleteBGPPeerResponse -> DeleteBGPPeerResponse -> Bool
$c== :: DeleteBGPPeerResponse -> DeleteBGPPeerResponse -> Bool
Prelude.Eq, ReadPrec [DeleteBGPPeerResponse]
ReadPrec DeleteBGPPeerResponse
Int -> ReadS DeleteBGPPeerResponse
ReadS [DeleteBGPPeerResponse]
(Int -> ReadS DeleteBGPPeerResponse)
-> ReadS [DeleteBGPPeerResponse]
-> ReadPrec DeleteBGPPeerResponse
-> ReadPrec [DeleteBGPPeerResponse]
-> Read DeleteBGPPeerResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteBGPPeerResponse]
$creadListPrec :: ReadPrec [DeleteBGPPeerResponse]
readPrec :: ReadPrec DeleteBGPPeerResponse
$creadPrec :: ReadPrec DeleteBGPPeerResponse
readList :: ReadS [DeleteBGPPeerResponse]
$creadList :: ReadS [DeleteBGPPeerResponse]
readsPrec :: Int -> ReadS DeleteBGPPeerResponse
$creadsPrec :: Int -> ReadS DeleteBGPPeerResponse
Prelude.Read, Int -> DeleteBGPPeerResponse -> ShowS
[DeleteBGPPeerResponse] -> ShowS
DeleteBGPPeerResponse -> String
(Int -> DeleteBGPPeerResponse -> ShowS)
-> (DeleteBGPPeerResponse -> String)
-> ([DeleteBGPPeerResponse] -> ShowS)
-> Show DeleteBGPPeerResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteBGPPeerResponse] -> ShowS
$cshowList :: [DeleteBGPPeerResponse] -> ShowS
show :: DeleteBGPPeerResponse -> String
$cshow :: DeleteBGPPeerResponse -> String
showsPrec :: Int -> DeleteBGPPeerResponse -> ShowS
$cshowsPrec :: Int -> DeleteBGPPeerResponse -> ShowS
Prelude.Show, (forall x. DeleteBGPPeerResponse -> Rep DeleteBGPPeerResponse x)
-> (forall x. Rep DeleteBGPPeerResponse x -> DeleteBGPPeerResponse)
-> Generic DeleteBGPPeerResponse
forall x. Rep DeleteBGPPeerResponse x -> DeleteBGPPeerResponse
forall x. DeleteBGPPeerResponse -> Rep DeleteBGPPeerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteBGPPeerResponse x -> DeleteBGPPeerResponse
$cfrom :: forall x. DeleteBGPPeerResponse -> Rep DeleteBGPPeerResponse x
Prelude.Generic)
newDeleteBGPPeerResponse ::
Prelude.Int ->
DeleteBGPPeerResponse
newDeleteBGPPeerResponse :: Int -> DeleteBGPPeerResponse
newDeleteBGPPeerResponse Int
pHttpStatus_ =
DeleteBGPPeerResponse' :: Maybe VirtualInterface -> Int -> DeleteBGPPeerResponse
DeleteBGPPeerResponse'
{ $sel:virtualInterface:DeleteBGPPeerResponse' :: Maybe VirtualInterface
virtualInterface =
Maybe VirtualInterface
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteBGPPeerResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteBGPPeerResponse_virtualInterface :: Lens.Lens' DeleteBGPPeerResponse (Prelude.Maybe VirtualInterface)
deleteBGPPeerResponse_virtualInterface :: (Maybe VirtualInterface -> f (Maybe VirtualInterface))
-> DeleteBGPPeerResponse -> f DeleteBGPPeerResponse
deleteBGPPeerResponse_virtualInterface = (DeleteBGPPeerResponse -> Maybe VirtualInterface)
-> (DeleteBGPPeerResponse
-> Maybe VirtualInterface -> DeleteBGPPeerResponse)
-> Lens
DeleteBGPPeerResponse
DeleteBGPPeerResponse
(Maybe VirtualInterface)
(Maybe VirtualInterface)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBGPPeerResponse' {Maybe VirtualInterface
virtualInterface :: Maybe VirtualInterface
$sel:virtualInterface:DeleteBGPPeerResponse' :: DeleteBGPPeerResponse -> Maybe VirtualInterface
virtualInterface} -> Maybe VirtualInterface
virtualInterface) (\s :: DeleteBGPPeerResponse
s@DeleteBGPPeerResponse' {} Maybe VirtualInterface
a -> DeleteBGPPeerResponse
s {$sel:virtualInterface:DeleteBGPPeerResponse' :: Maybe VirtualInterface
virtualInterface = Maybe VirtualInterface
a} :: DeleteBGPPeerResponse)
deleteBGPPeerResponse_httpStatus :: Lens.Lens' DeleteBGPPeerResponse Prelude.Int
deleteBGPPeerResponse_httpStatus :: (Int -> f Int) -> DeleteBGPPeerResponse -> f DeleteBGPPeerResponse
deleteBGPPeerResponse_httpStatus = (DeleteBGPPeerResponse -> Int)
-> (DeleteBGPPeerResponse -> Int -> DeleteBGPPeerResponse)
-> Lens DeleteBGPPeerResponse DeleteBGPPeerResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBGPPeerResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteBGPPeerResponse' :: DeleteBGPPeerResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteBGPPeerResponse
s@DeleteBGPPeerResponse' {} Int
a -> DeleteBGPPeerResponse
s {$sel:httpStatus:DeleteBGPPeerResponse' :: Int
httpStatus = Int
a} :: DeleteBGPPeerResponse)
instance Prelude.NFData DeleteBGPPeerResponse