{-# 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.APIGateway.UpdateVpcLink
(
UpdateVpcLink (..),
newUpdateVpcLink,
updateVpcLink_patchOperations,
updateVpcLink_vpcLinkId,
VpcLink (..),
newVpcLink,
vpcLink_status,
vpcLink_targetArns,
vpcLink_name,
vpcLink_statusMessage,
vpcLink_id,
vpcLink_description,
vpcLink_tags,
)
where
import Amazonka.APIGateway.Types
import qualified Amazonka.Core as Core
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 UpdateVpcLink = UpdateVpcLink'
{
UpdateVpcLink -> Maybe [PatchOperation]
patchOperations :: Prelude.Maybe [PatchOperation],
UpdateVpcLink -> Text
vpcLinkId :: Prelude.Text
}
deriving (UpdateVpcLink -> UpdateVpcLink -> Bool
(UpdateVpcLink -> UpdateVpcLink -> Bool)
-> (UpdateVpcLink -> UpdateVpcLink -> Bool) -> Eq UpdateVpcLink
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateVpcLink -> UpdateVpcLink -> Bool
$c/= :: UpdateVpcLink -> UpdateVpcLink -> Bool
== :: UpdateVpcLink -> UpdateVpcLink -> Bool
$c== :: UpdateVpcLink -> UpdateVpcLink -> Bool
Prelude.Eq, ReadPrec [UpdateVpcLink]
ReadPrec UpdateVpcLink
Int -> ReadS UpdateVpcLink
ReadS [UpdateVpcLink]
(Int -> ReadS UpdateVpcLink)
-> ReadS [UpdateVpcLink]
-> ReadPrec UpdateVpcLink
-> ReadPrec [UpdateVpcLink]
-> Read UpdateVpcLink
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateVpcLink]
$creadListPrec :: ReadPrec [UpdateVpcLink]
readPrec :: ReadPrec UpdateVpcLink
$creadPrec :: ReadPrec UpdateVpcLink
readList :: ReadS [UpdateVpcLink]
$creadList :: ReadS [UpdateVpcLink]
readsPrec :: Int -> ReadS UpdateVpcLink
$creadsPrec :: Int -> ReadS UpdateVpcLink
Prelude.Read, Int -> UpdateVpcLink -> ShowS
[UpdateVpcLink] -> ShowS
UpdateVpcLink -> String
(Int -> UpdateVpcLink -> ShowS)
-> (UpdateVpcLink -> String)
-> ([UpdateVpcLink] -> ShowS)
-> Show UpdateVpcLink
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateVpcLink] -> ShowS
$cshowList :: [UpdateVpcLink] -> ShowS
show :: UpdateVpcLink -> String
$cshow :: UpdateVpcLink -> String
showsPrec :: Int -> UpdateVpcLink -> ShowS
$cshowsPrec :: Int -> UpdateVpcLink -> ShowS
Prelude.Show, (forall x. UpdateVpcLink -> Rep UpdateVpcLink x)
-> (forall x. Rep UpdateVpcLink x -> UpdateVpcLink)
-> Generic UpdateVpcLink
forall x. Rep UpdateVpcLink x -> UpdateVpcLink
forall x. UpdateVpcLink -> Rep UpdateVpcLink x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateVpcLink x -> UpdateVpcLink
$cfrom :: forall x. UpdateVpcLink -> Rep UpdateVpcLink x
Prelude.Generic)
newUpdateVpcLink ::
Prelude.Text ->
UpdateVpcLink
newUpdateVpcLink :: Text -> UpdateVpcLink
newUpdateVpcLink Text
pVpcLinkId_ =
UpdateVpcLink' :: Maybe [PatchOperation] -> Text -> UpdateVpcLink
UpdateVpcLink'
{ $sel:patchOperations:UpdateVpcLink' :: Maybe [PatchOperation]
patchOperations = Maybe [PatchOperation]
forall a. Maybe a
Prelude.Nothing,
$sel:vpcLinkId:UpdateVpcLink' :: Text
vpcLinkId = Text
pVpcLinkId_
}
updateVpcLink_patchOperations :: Lens.Lens' UpdateVpcLink (Prelude.Maybe [PatchOperation])
updateVpcLink_patchOperations :: (Maybe [PatchOperation] -> f (Maybe [PatchOperation]))
-> UpdateVpcLink -> f UpdateVpcLink
updateVpcLink_patchOperations = (UpdateVpcLink -> Maybe [PatchOperation])
-> (UpdateVpcLink -> Maybe [PatchOperation] -> UpdateVpcLink)
-> Lens
UpdateVpcLink
UpdateVpcLink
(Maybe [PatchOperation])
(Maybe [PatchOperation])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateVpcLink' {Maybe [PatchOperation]
patchOperations :: Maybe [PatchOperation]
$sel:patchOperations:UpdateVpcLink' :: UpdateVpcLink -> Maybe [PatchOperation]
patchOperations} -> Maybe [PatchOperation]
patchOperations) (\s :: UpdateVpcLink
s@UpdateVpcLink' {} Maybe [PatchOperation]
a -> UpdateVpcLink
s {$sel:patchOperations:UpdateVpcLink' :: Maybe [PatchOperation]
patchOperations = Maybe [PatchOperation]
a} :: UpdateVpcLink) ((Maybe [PatchOperation] -> f (Maybe [PatchOperation]))
-> UpdateVpcLink -> f UpdateVpcLink)
-> ((Maybe [PatchOperation] -> f (Maybe [PatchOperation]))
-> Maybe [PatchOperation] -> f (Maybe [PatchOperation]))
-> (Maybe [PatchOperation] -> f (Maybe [PatchOperation]))
-> UpdateVpcLink
-> f UpdateVpcLink
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[PatchOperation] [PatchOperation] [PatchOperation] [PatchOperation]
-> Iso
(Maybe [PatchOperation])
(Maybe [PatchOperation])
(Maybe [PatchOperation])
(Maybe [PatchOperation])
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
[PatchOperation] [PatchOperation] [PatchOperation] [PatchOperation]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
updateVpcLink_vpcLinkId :: Lens.Lens' UpdateVpcLink Prelude.Text
updateVpcLink_vpcLinkId :: (Text -> f Text) -> UpdateVpcLink -> f UpdateVpcLink
updateVpcLink_vpcLinkId = (UpdateVpcLink -> Text)
-> (UpdateVpcLink -> Text -> UpdateVpcLink)
-> Lens UpdateVpcLink UpdateVpcLink Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateVpcLink' {Text
vpcLinkId :: Text
$sel:vpcLinkId:UpdateVpcLink' :: UpdateVpcLink -> Text
vpcLinkId} -> Text
vpcLinkId) (\s :: UpdateVpcLink
s@UpdateVpcLink' {} Text
a -> UpdateVpcLink
s {$sel:vpcLinkId:UpdateVpcLink' :: Text
vpcLinkId = Text
a} :: UpdateVpcLink)
instance Core.AWSRequest UpdateVpcLink where
type AWSResponse UpdateVpcLink = VpcLink
request :: UpdateVpcLink -> Request UpdateVpcLink
request = Service -> UpdateVpcLink -> Request UpdateVpcLink
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateVpcLink
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateVpcLink)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse UpdateVpcLink))
-> Logger
-> Service
-> Proxy UpdateVpcLink
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateVpcLink)))
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 -> Object -> Either String VpcLink
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
instance Prelude.Hashable UpdateVpcLink
instance Prelude.NFData UpdateVpcLink
instance Core.ToHeaders UpdateVpcLink where
toHeaders :: UpdateVpcLink -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateVpcLink -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Accept"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"application/json" :: Prelude.ByteString)
]
)
instance Core.ToJSON UpdateVpcLink where
toJSON :: UpdateVpcLink -> Value
toJSON UpdateVpcLink' {Maybe [PatchOperation]
Text
vpcLinkId :: Text
patchOperations :: Maybe [PatchOperation]
$sel:vpcLinkId:UpdateVpcLink' :: UpdateVpcLink -> Text
$sel:patchOperations:UpdateVpcLink' :: UpdateVpcLink -> Maybe [PatchOperation]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"patchOperations" Text -> [PatchOperation] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([PatchOperation] -> Pair) -> Maybe [PatchOperation] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [PatchOperation]
patchOperations
]
)
instance Core.ToPath UpdateVpcLink where
toPath :: UpdateVpcLink -> ByteString
toPath UpdateVpcLink' {Maybe [PatchOperation]
Text
vpcLinkId :: Text
patchOperations :: Maybe [PatchOperation]
$sel:vpcLinkId:UpdateVpcLink' :: UpdateVpcLink -> Text
$sel:patchOperations:UpdateVpcLink' :: UpdateVpcLink -> Maybe [PatchOperation]
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/vpclinks/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
vpcLinkId]
instance Core.ToQuery UpdateVpcLink where
toQuery :: UpdateVpcLink -> QueryString
toQuery = QueryString -> UpdateVpcLink -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty