{-# 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.Lightsail.UnpeerVpc
(
UnpeerVpc (..),
newUnpeerVpc,
UnpeerVpcResponse (..),
newUnpeerVpcResponse,
unpeerVpcResponse_operation,
unpeerVpcResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UnpeerVpc = UnpeerVpc'
{
}
deriving (UnpeerVpc -> UnpeerVpc -> Bool
(UnpeerVpc -> UnpeerVpc -> Bool)
-> (UnpeerVpc -> UnpeerVpc -> Bool) -> Eq UnpeerVpc
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UnpeerVpc -> UnpeerVpc -> Bool
$c/= :: UnpeerVpc -> UnpeerVpc -> Bool
== :: UnpeerVpc -> UnpeerVpc -> Bool
$c== :: UnpeerVpc -> UnpeerVpc -> Bool
Prelude.Eq, ReadPrec [UnpeerVpc]
ReadPrec UnpeerVpc
Int -> ReadS UnpeerVpc
ReadS [UnpeerVpc]
(Int -> ReadS UnpeerVpc)
-> ReadS [UnpeerVpc]
-> ReadPrec UnpeerVpc
-> ReadPrec [UnpeerVpc]
-> Read UnpeerVpc
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UnpeerVpc]
$creadListPrec :: ReadPrec [UnpeerVpc]
readPrec :: ReadPrec UnpeerVpc
$creadPrec :: ReadPrec UnpeerVpc
readList :: ReadS [UnpeerVpc]
$creadList :: ReadS [UnpeerVpc]
readsPrec :: Int -> ReadS UnpeerVpc
$creadsPrec :: Int -> ReadS UnpeerVpc
Prelude.Read, Int -> UnpeerVpc -> ShowS
[UnpeerVpc] -> ShowS
UnpeerVpc -> String
(Int -> UnpeerVpc -> ShowS)
-> (UnpeerVpc -> String)
-> ([UnpeerVpc] -> ShowS)
-> Show UnpeerVpc
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UnpeerVpc] -> ShowS
$cshowList :: [UnpeerVpc] -> ShowS
show :: UnpeerVpc -> String
$cshow :: UnpeerVpc -> String
showsPrec :: Int -> UnpeerVpc -> ShowS
$cshowsPrec :: Int -> UnpeerVpc -> ShowS
Prelude.Show, (forall x. UnpeerVpc -> Rep UnpeerVpc x)
-> (forall x. Rep UnpeerVpc x -> UnpeerVpc) -> Generic UnpeerVpc
forall x. Rep UnpeerVpc x -> UnpeerVpc
forall x. UnpeerVpc -> Rep UnpeerVpc x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UnpeerVpc x -> UnpeerVpc
$cfrom :: forall x. UnpeerVpc -> Rep UnpeerVpc x
Prelude.Generic)
newUnpeerVpc ::
UnpeerVpc
newUnpeerVpc :: UnpeerVpc
newUnpeerVpc = UnpeerVpc
UnpeerVpc'
instance Core.AWSRequest UnpeerVpc where
type AWSResponse UnpeerVpc = UnpeerVpcResponse
request :: UnpeerVpc -> Request UnpeerVpc
request = Service -> UnpeerVpc -> Request UnpeerVpc
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UnpeerVpc
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UnpeerVpc)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UnpeerVpc))
-> Logger
-> Service
-> Proxy UnpeerVpc
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UnpeerVpc)))
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 Operation -> Int -> UnpeerVpcResponse
UnpeerVpcResponse'
(Maybe Operation -> Int -> UnpeerVpcResponse)
-> Either String (Maybe Operation)
-> Either String (Int -> UnpeerVpcResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Key -> Either String (Maybe Operation)
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Core..?> Key
"operation")
Either String (Int -> UnpeerVpcResponse)
-> Either String Int -> Either String UnpeerVpcResponse
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 UnpeerVpc
instance Prelude.NFData UnpeerVpc
instance Core.ToHeaders UnpeerVpc where
toHeaders :: UnpeerVpc -> ResponseHeaders
toHeaders =
ResponseHeaders -> UnpeerVpc -> 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
"Lightsail_20161128.UnpeerVpc" ::
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 UnpeerVpc where
toJSON :: UnpeerVpc -> Value
toJSON = Value -> UnpeerVpc -> Value
forall a b. a -> b -> a
Prelude.const (Object -> Value
Core.Object Object
forall a. Monoid a => a
Prelude.mempty)
instance Core.ToPath UnpeerVpc where
toPath :: UnpeerVpc -> ByteString
toPath = ByteString -> UnpeerVpc -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UnpeerVpc where
toQuery :: UnpeerVpc -> QueryString
toQuery = QueryString -> UnpeerVpc -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UnpeerVpcResponse = UnpeerVpcResponse'
{
UnpeerVpcResponse -> Maybe Operation
operation :: Prelude.Maybe Operation,
UnpeerVpcResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UnpeerVpcResponse -> UnpeerVpcResponse -> Bool
(UnpeerVpcResponse -> UnpeerVpcResponse -> Bool)
-> (UnpeerVpcResponse -> UnpeerVpcResponse -> Bool)
-> Eq UnpeerVpcResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UnpeerVpcResponse -> UnpeerVpcResponse -> Bool
$c/= :: UnpeerVpcResponse -> UnpeerVpcResponse -> Bool
== :: UnpeerVpcResponse -> UnpeerVpcResponse -> Bool
$c== :: UnpeerVpcResponse -> UnpeerVpcResponse -> Bool
Prelude.Eq, ReadPrec [UnpeerVpcResponse]
ReadPrec UnpeerVpcResponse
Int -> ReadS UnpeerVpcResponse
ReadS [UnpeerVpcResponse]
(Int -> ReadS UnpeerVpcResponse)
-> ReadS [UnpeerVpcResponse]
-> ReadPrec UnpeerVpcResponse
-> ReadPrec [UnpeerVpcResponse]
-> Read UnpeerVpcResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UnpeerVpcResponse]
$creadListPrec :: ReadPrec [UnpeerVpcResponse]
readPrec :: ReadPrec UnpeerVpcResponse
$creadPrec :: ReadPrec UnpeerVpcResponse
readList :: ReadS [UnpeerVpcResponse]
$creadList :: ReadS [UnpeerVpcResponse]
readsPrec :: Int -> ReadS UnpeerVpcResponse
$creadsPrec :: Int -> ReadS UnpeerVpcResponse
Prelude.Read, Int -> UnpeerVpcResponse -> ShowS
[UnpeerVpcResponse] -> ShowS
UnpeerVpcResponse -> String
(Int -> UnpeerVpcResponse -> ShowS)
-> (UnpeerVpcResponse -> String)
-> ([UnpeerVpcResponse] -> ShowS)
-> Show UnpeerVpcResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UnpeerVpcResponse] -> ShowS
$cshowList :: [UnpeerVpcResponse] -> ShowS
show :: UnpeerVpcResponse -> String
$cshow :: UnpeerVpcResponse -> String
showsPrec :: Int -> UnpeerVpcResponse -> ShowS
$cshowsPrec :: Int -> UnpeerVpcResponse -> ShowS
Prelude.Show, (forall x. UnpeerVpcResponse -> Rep UnpeerVpcResponse x)
-> (forall x. Rep UnpeerVpcResponse x -> UnpeerVpcResponse)
-> Generic UnpeerVpcResponse
forall x. Rep UnpeerVpcResponse x -> UnpeerVpcResponse
forall x. UnpeerVpcResponse -> Rep UnpeerVpcResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UnpeerVpcResponse x -> UnpeerVpcResponse
$cfrom :: forall x. UnpeerVpcResponse -> Rep UnpeerVpcResponse x
Prelude.Generic)
newUnpeerVpcResponse ::
Prelude.Int ->
UnpeerVpcResponse
newUnpeerVpcResponse :: Int -> UnpeerVpcResponse
newUnpeerVpcResponse Int
pHttpStatus_ =
UnpeerVpcResponse' :: Maybe Operation -> Int -> UnpeerVpcResponse
UnpeerVpcResponse'
{ $sel:operation:UnpeerVpcResponse' :: Maybe Operation
operation = Maybe Operation
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:UnpeerVpcResponse' :: Int
httpStatus = Int
pHttpStatus_
}
unpeerVpcResponse_operation :: Lens.Lens' UnpeerVpcResponse (Prelude.Maybe Operation)
unpeerVpcResponse_operation :: (Maybe Operation -> f (Maybe Operation))
-> UnpeerVpcResponse -> f UnpeerVpcResponse
unpeerVpcResponse_operation = (UnpeerVpcResponse -> Maybe Operation)
-> (UnpeerVpcResponse -> Maybe Operation -> UnpeerVpcResponse)
-> Lens
UnpeerVpcResponse
UnpeerVpcResponse
(Maybe Operation)
(Maybe Operation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnpeerVpcResponse' {Maybe Operation
operation :: Maybe Operation
$sel:operation:UnpeerVpcResponse' :: UnpeerVpcResponse -> Maybe Operation
operation} -> Maybe Operation
operation) (\s :: UnpeerVpcResponse
s@UnpeerVpcResponse' {} Maybe Operation
a -> UnpeerVpcResponse
s {$sel:operation:UnpeerVpcResponse' :: Maybe Operation
operation = Maybe Operation
a} :: UnpeerVpcResponse)
unpeerVpcResponse_httpStatus :: Lens.Lens' UnpeerVpcResponse Prelude.Int
unpeerVpcResponse_httpStatus :: (Int -> f Int) -> UnpeerVpcResponse -> f UnpeerVpcResponse
unpeerVpcResponse_httpStatus = (UnpeerVpcResponse -> Int)
-> (UnpeerVpcResponse -> Int -> UnpeerVpcResponse)
-> Lens UnpeerVpcResponse UnpeerVpcResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnpeerVpcResponse' {Int
httpStatus :: Int
$sel:httpStatus:UnpeerVpcResponse' :: UnpeerVpcResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UnpeerVpcResponse
s@UnpeerVpcResponse' {} Int
a -> UnpeerVpcResponse
s {$sel:httpStatus:UnpeerVpcResponse' :: Int
httpStatus = Int
a} :: UnpeerVpcResponse)
instance Prelude.NFData UnpeerVpcResponse