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