{-# 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.GlobalAccelerator.DeprovisionByoipCidr
(
DeprovisionByoipCidr (..),
newDeprovisionByoipCidr,
deprovisionByoipCidr_cidr,
DeprovisionByoipCidrResponse (..),
newDeprovisionByoipCidrResponse,
deprovisionByoipCidrResponse_byoipCidr,
deprovisionByoipCidrResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.GlobalAccelerator.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 DeprovisionByoipCidr = DeprovisionByoipCidr'
{
DeprovisionByoipCidr -> Text
cidr :: Prelude.Text
}
deriving (DeprovisionByoipCidr -> DeprovisionByoipCidr -> Bool
(DeprovisionByoipCidr -> DeprovisionByoipCidr -> Bool)
-> (DeprovisionByoipCidr -> DeprovisionByoipCidr -> Bool)
-> Eq DeprovisionByoipCidr
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeprovisionByoipCidr -> DeprovisionByoipCidr -> Bool
$c/= :: DeprovisionByoipCidr -> DeprovisionByoipCidr -> Bool
== :: DeprovisionByoipCidr -> DeprovisionByoipCidr -> Bool
$c== :: DeprovisionByoipCidr -> DeprovisionByoipCidr -> Bool
Prelude.Eq, ReadPrec [DeprovisionByoipCidr]
ReadPrec DeprovisionByoipCidr
Int -> ReadS DeprovisionByoipCidr
ReadS [DeprovisionByoipCidr]
(Int -> ReadS DeprovisionByoipCidr)
-> ReadS [DeprovisionByoipCidr]
-> ReadPrec DeprovisionByoipCidr
-> ReadPrec [DeprovisionByoipCidr]
-> Read DeprovisionByoipCidr
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeprovisionByoipCidr]
$creadListPrec :: ReadPrec [DeprovisionByoipCidr]
readPrec :: ReadPrec DeprovisionByoipCidr
$creadPrec :: ReadPrec DeprovisionByoipCidr
readList :: ReadS [DeprovisionByoipCidr]
$creadList :: ReadS [DeprovisionByoipCidr]
readsPrec :: Int -> ReadS DeprovisionByoipCidr
$creadsPrec :: Int -> ReadS DeprovisionByoipCidr
Prelude.Read, Int -> DeprovisionByoipCidr -> ShowS
[DeprovisionByoipCidr] -> ShowS
DeprovisionByoipCidr -> String
(Int -> DeprovisionByoipCidr -> ShowS)
-> (DeprovisionByoipCidr -> String)
-> ([DeprovisionByoipCidr] -> ShowS)
-> Show DeprovisionByoipCidr
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeprovisionByoipCidr] -> ShowS
$cshowList :: [DeprovisionByoipCidr] -> ShowS
show :: DeprovisionByoipCidr -> String
$cshow :: DeprovisionByoipCidr -> String
showsPrec :: Int -> DeprovisionByoipCidr -> ShowS
$cshowsPrec :: Int -> DeprovisionByoipCidr -> ShowS
Prelude.Show, (forall x. DeprovisionByoipCidr -> Rep DeprovisionByoipCidr x)
-> (forall x. Rep DeprovisionByoipCidr x -> DeprovisionByoipCidr)
-> Generic DeprovisionByoipCidr
forall x. Rep DeprovisionByoipCidr x -> DeprovisionByoipCidr
forall x. DeprovisionByoipCidr -> Rep DeprovisionByoipCidr x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeprovisionByoipCidr x -> DeprovisionByoipCidr
$cfrom :: forall x. DeprovisionByoipCidr -> Rep DeprovisionByoipCidr x
Prelude.Generic)
newDeprovisionByoipCidr ::
Prelude.Text ->
DeprovisionByoipCidr
newDeprovisionByoipCidr :: Text -> DeprovisionByoipCidr
newDeprovisionByoipCidr Text
pCidr_ =
DeprovisionByoipCidr' :: Text -> DeprovisionByoipCidr
DeprovisionByoipCidr' {$sel:cidr:DeprovisionByoipCidr' :: Text
cidr = Text
pCidr_}
deprovisionByoipCidr_cidr :: Lens.Lens' DeprovisionByoipCidr Prelude.Text
deprovisionByoipCidr_cidr :: (Text -> f Text) -> DeprovisionByoipCidr -> f DeprovisionByoipCidr
deprovisionByoipCidr_cidr = (DeprovisionByoipCidr -> Text)
-> (DeprovisionByoipCidr -> Text -> DeprovisionByoipCidr)
-> Lens DeprovisionByoipCidr DeprovisionByoipCidr Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeprovisionByoipCidr' {Text
cidr :: Text
$sel:cidr:DeprovisionByoipCidr' :: DeprovisionByoipCidr -> Text
cidr} -> Text
cidr) (\s :: DeprovisionByoipCidr
s@DeprovisionByoipCidr' {} Text
a -> DeprovisionByoipCidr
s {$sel:cidr:DeprovisionByoipCidr' :: Text
cidr = Text
a} :: DeprovisionByoipCidr)
instance Core.AWSRequest DeprovisionByoipCidr where
type
AWSResponse DeprovisionByoipCidr =
DeprovisionByoipCidrResponse
request :: DeprovisionByoipCidr -> Request DeprovisionByoipCidr
request = Service -> DeprovisionByoipCidr -> Request DeprovisionByoipCidr
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeprovisionByoipCidr
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeprovisionByoipCidr)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeprovisionByoipCidr))
-> Logger
-> Service
-> Proxy DeprovisionByoipCidr
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeprovisionByoipCidr)))
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 ByoipCidr -> Int -> DeprovisionByoipCidrResponse
DeprovisionByoipCidrResponse'
(Maybe ByoipCidr -> Int -> DeprovisionByoipCidrResponse)
-> Either String (Maybe ByoipCidr)
-> Either String (Int -> DeprovisionByoipCidrResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ByoipCidr)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ByoipCidr")
Either String (Int -> DeprovisionByoipCidrResponse)
-> Either String Int -> Either String DeprovisionByoipCidrResponse
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 DeprovisionByoipCidr
instance Prelude.NFData DeprovisionByoipCidr
instance Core.ToHeaders DeprovisionByoipCidr where
toHeaders :: DeprovisionByoipCidr -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeprovisionByoipCidr -> 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
"GlobalAccelerator_V20180706.DeprovisionByoipCidr" ::
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 DeprovisionByoipCidr where
toJSON :: DeprovisionByoipCidr -> Value
toJSON DeprovisionByoipCidr' {Text
cidr :: Text
$sel:cidr:DeprovisionByoipCidr' :: DeprovisionByoipCidr -> 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
"Cidr" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
cidr)]
)
instance Core.ToPath DeprovisionByoipCidr where
toPath :: DeprovisionByoipCidr -> ByteString
toPath = ByteString -> DeprovisionByoipCidr -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeprovisionByoipCidr where
toQuery :: DeprovisionByoipCidr -> QueryString
toQuery = QueryString -> DeprovisionByoipCidr -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeprovisionByoipCidrResponse = DeprovisionByoipCidrResponse'
{
DeprovisionByoipCidrResponse -> Maybe ByoipCidr
byoipCidr :: Prelude.Maybe ByoipCidr,
DeprovisionByoipCidrResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeprovisionByoipCidrResponse
-> DeprovisionByoipCidrResponse -> Bool
(DeprovisionByoipCidrResponse
-> DeprovisionByoipCidrResponse -> Bool)
-> (DeprovisionByoipCidrResponse
-> DeprovisionByoipCidrResponse -> Bool)
-> Eq DeprovisionByoipCidrResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeprovisionByoipCidrResponse
-> DeprovisionByoipCidrResponse -> Bool
$c/= :: DeprovisionByoipCidrResponse
-> DeprovisionByoipCidrResponse -> Bool
== :: DeprovisionByoipCidrResponse
-> DeprovisionByoipCidrResponse -> Bool
$c== :: DeprovisionByoipCidrResponse
-> DeprovisionByoipCidrResponse -> Bool
Prelude.Eq, ReadPrec [DeprovisionByoipCidrResponse]
ReadPrec DeprovisionByoipCidrResponse
Int -> ReadS DeprovisionByoipCidrResponse
ReadS [DeprovisionByoipCidrResponse]
(Int -> ReadS DeprovisionByoipCidrResponse)
-> ReadS [DeprovisionByoipCidrResponse]
-> ReadPrec DeprovisionByoipCidrResponse
-> ReadPrec [DeprovisionByoipCidrResponse]
-> Read DeprovisionByoipCidrResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeprovisionByoipCidrResponse]
$creadListPrec :: ReadPrec [DeprovisionByoipCidrResponse]
readPrec :: ReadPrec DeprovisionByoipCidrResponse
$creadPrec :: ReadPrec DeprovisionByoipCidrResponse
readList :: ReadS [DeprovisionByoipCidrResponse]
$creadList :: ReadS [DeprovisionByoipCidrResponse]
readsPrec :: Int -> ReadS DeprovisionByoipCidrResponse
$creadsPrec :: Int -> ReadS DeprovisionByoipCidrResponse
Prelude.Read, Int -> DeprovisionByoipCidrResponse -> ShowS
[DeprovisionByoipCidrResponse] -> ShowS
DeprovisionByoipCidrResponse -> String
(Int -> DeprovisionByoipCidrResponse -> ShowS)
-> (DeprovisionByoipCidrResponse -> String)
-> ([DeprovisionByoipCidrResponse] -> ShowS)
-> Show DeprovisionByoipCidrResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeprovisionByoipCidrResponse] -> ShowS
$cshowList :: [DeprovisionByoipCidrResponse] -> ShowS
show :: DeprovisionByoipCidrResponse -> String
$cshow :: DeprovisionByoipCidrResponse -> String
showsPrec :: Int -> DeprovisionByoipCidrResponse -> ShowS
$cshowsPrec :: Int -> DeprovisionByoipCidrResponse -> ShowS
Prelude.Show, (forall x.
DeprovisionByoipCidrResponse -> Rep DeprovisionByoipCidrResponse x)
-> (forall x.
Rep DeprovisionByoipCidrResponse x -> DeprovisionByoipCidrResponse)
-> Generic DeprovisionByoipCidrResponse
forall x.
Rep DeprovisionByoipCidrResponse x -> DeprovisionByoipCidrResponse
forall x.
DeprovisionByoipCidrResponse -> Rep DeprovisionByoipCidrResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeprovisionByoipCidrResponse x -> DeprovisionByoipCidrResponse
$cfrom :: forall x.
DeprovisionByoipCidrResponse -> Rep DeprovisionByoipCidrResponse x
Prelude.Generic)
newDeprovisionByoipCidrResponse ::
Prelude.Int ->
DeprovisionByoipCidrResponse
newDeprovisionByoipCidrResponse :: Int -> DeprovisionByoipCidrResponse
newDeprovisionByoipCidrResponse Int
pHttpStatus_ =
DeprovisionByoipCidrResponse' :: Maybe ByoipCidr -> Int -> DeprovisionByoipCidrResponse
DeprovisionByoipCidrResponse'
{ $sel:byoipCidr:DeprovisionByoipCidrResponse' :: Maybe ByoipCidr
byoipCidr =
Maybe ByoipCidr
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeprovisionByoipCidrResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deprovisionByoipCidrResponse_byoipCidr :: Lens.Lens' DeprovisionByoipCidrResponse (Prelude.Maybe ByoipCidr)
deprovisionByoipCidrResponse_byoipCidr :: (Maybe ByoipCidr -> f (Maybe ByoipCidr))
-> DeprovisionByoipCidrResponse -> f DeprovisionByoipCidrResponse
deprovisionByoipCidrResponse_byoipCidr = (DeprovisionByoipCidrResponse -> Maybe ByoipCidr)
-> (DeprovisionByoipCidrResponse
-> Maybe ByoipCidr -> DeprovisionByoipCidrResponse)
-> Lens
DeprovisionByoipCidrResponse
DeprovisionByoipCidrResponse
(Maybe ByoipCidr)
(Maybe ByoipCidr)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeprovisionByoipCidrResponse' {Maybe ByoipCidr
byoipCidr :: Maybe ByoipCidr
$sel:byoipCidr:DeprovisionByoipCidrResponse' :: DeprovisionByoipCidrResponse -> Maybe ByoipCidr
byoipCidr} -> Maybe ByoipCidr
byoipCidr) (\s :: DeprovisionByoipCidrResponse
s@DeprovisionByoipCidrResponse' {} Maybe ByoipCidr
a -> DeprovisionByoipCidrResponse
s {$sel:byoipCidr:DeprovisionByoipCidrResponse' :: Maybe ByoipCidr
byoipCidr = Maybe ByoipCidr
a} :: DeprovisionByoipCidrResponse)
deprovisionByoipCidrResponse_httpStatus :: Lens.Lens' DeprovisionByoipCidrResponse Prelude.Int
deprovisionByoipCidrResponse_httpStatus :: (Int -> f Int)
-> DeprovisionByoipCidrResponse -> f DeprovisionByoipCidrResponse
deprovisionByoipCidrResponse_httpStatus = (DeprovisionByoipCidrResponse -> Int)
-> (DeprovisionByoipCidrResponse
-> Int -> DeprovisionByoipCidrResponse)
-> Lens
DeprovisionByoipCidrResponse DeprovisionByoipCidrResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeprovisionByoipCidrResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeprovisionByoipCidrResponse' :: DeprovisionByoipCidrResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeprovisionByoipCidrResponse
s@DeprovisionByoipCidrResponse' {} Int
a -> DeprovisionByoipCidrResponse
s {$sel:httpStatus:DeprovisionByoipCidrResponse' :: Int
httpStatus = Int
a} :: DeprovisionByoipCidrResponse)
instance Prelude.NFData DeprovisionByoipCidrResponse