{-# 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.EC2.RejectVpcEndpointConnections
(
RejectVpcEndpointConnections (..),
newRejectVpcEndpointConnections,
rejectVpcEndpointConnections_dryRun,
rejectVpcEndpointConnections_serviceId,
rejectVpcEndpointConnections_vpcEndpointIds,
RejectVpcEndpointConnectionsResponse (..),
newRejectVpcEndpointConnectionsResponse,
rejectVpcEndpointConnectionsResponse_unsuccessful,
rejectVpcEndpointConnectionsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data RejectVpcEndpointConnections = RejectVpcEndpointConnections'
{
RejectVpcEndpointConnections -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
RejectVpcEndpointConnections -> Text
serviceId :: Prelude.Text,
RejectVpcEndpointConnections -> [Text]
vpcEndpointIds :: [Prelude.Text]
}
deriving (RejectVpcEndpointConnections
-> RejectVpcEndpointConnections -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RejectVpcEndpointConnections
-> RejectVpcEndpointConnections -> Bool
$c/= :: RejectVpcEndpointConnections
-> RejectVpcEndpointConnections -> Bool
== :: RejectVpcEndpointConnections
-> RejectVpcEndpointConnections -> Bool
$c== :: RejectVpcEndpointConnections
-> RejectVpcEndpointConnections -> Bool
Prelude.Eq, ReadPrec [RejectVpcEndpointConnections]
ReadPrec RejectVpcEndpointConnections
Int -> ReadS RejectVpcEndpointConnections
ReadS [RejectVpcEndpointConnections]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RejectVpcEndpointConnections]
$creadListPrec :: ReadPrec [RejectVpcEndpointConnections]
readPrec :: ReadPrec RejectVpcEndpointConnections
$creadPrec :: ReadPrec RejectVpcEndpointConnections
readList :: ReadS [RejectVpcEndpointConnections]
$creadList :: ReadS [RejectVpcEndpointConnections]
readsPrec :: Int -> ReadS RejectVpcEndpointConnections
$creadsPrec :: Int -> ReadS RejectVpcEndpointConnections
Prelude.Read, Int -> RejectVpcEndpointConnections -> ShowS
[RejectVpcEndpointConnections] -> ShowS
RejectVpcEndpointConnections -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RejectVpcEndpointConnections] -> ShowS
$cshowList :: [RejectVpcEndpointConnections] -> ShowS
show :: RejectVpcEndpointConnections -> String
$cshow :: RejectVpcEndpointConnections -> String
showsPrec :: Int -> RejectVpcEndpointConnections -> ShowS
$cshowsPrec :: Int -> RejectVpcEndpointConnections -> ShowS
Prelude.Show, forall x.
Rep RejectVpcEndpointConnections x -> RejectVpcEndpointConnections
forall x.
RejectVpcEndpointConnections -> Rep RejectVpcEndpointConnections x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RejectVpcEndpointConnections x -> RejectVpcEndpointConnections
$cfrom :: forall x.
RejectVpcEndpointConnections -> Rep RejectVpcEndpointConnections x
Prelude.Generic)
newRejectVpcEndpointConnections ::
Prelude.Text ->
RejectVpcEndpointConnections
newRejectVpcEndpointConnections :: Text -> RejectVpcEndpointConnections
newRejectVpcEndpointConnections Text
pServiceId_ =
RejectVpcEndpointConnections'
{ $sel:dryRun:RejectVpcEndpointConnections' :: Maybe Bool
dryRun =
forall a. Maybe a
Prelude.Nothing,
$sel:serviceId:RejectVpcEndpointConnections' :: Text
serviceId = Text
pServiceId_,
$sel:vpcEndpointIds:RejectVpcEndpointConnections' :: [Text]
vpcEndpointIds = forall a. Monoid a => a
Prelude.mempty
}
rejectVpcEndpointConnections_dryRun :: Lens.Lens' RejectVpcEndpointConnections (Prelude.Maybe Prelude.Bool)
rejectVpcEndpointConnections_dryRun :: Lens' RejectVpcEndpointConnections (Maybe Bool)
rejectVpcEndpointConnections_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RejectVpcEndpointConnections' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:RejectVpcEndpointConnections' :: RejectVpcEndpointConnections -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: RejectVpcEndpointConnections
s@RejectVpcEndpointConnections' {} Maybe Bool
a -> RejectVpcEndpointConnections
s {$sel:dryRun:RejectVpcEndpointConnections' :: Maybe Bool
dryRun = Maybe Bool
a} :: RejectVpcEndpointConnections)
rejectVpcEndpointConnections_serviceId :: Lens.Lens' RejectVpcEndpointConnections Prelude.Text
rejectVpcEndpointConnections_serviceId :: Lens' RejectVpcEndpointConnections Text
rejectVpcEndpointConnections_serviceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RejectVpcEndpointConnections' {Text
serviceId :: Text
$sel:serviceId:RejectVpcEndpointConnections' :: RejectVpcEndpointConnections -> Text
serviceId} -> Text
serviceId) (\s :: RejectVpcEndpointConnections
s@RejectVpcEndpointConnections' {} Text
a -> RejectVpcEndpointConnections
s {$sel:serviceId:RejectVpcEndpointConnections' :: Text
serviceId = Text
a} :: RejectVpcEndpointConnections)
rejectVpcEndpointConnections_vpcEndpointIds :: Lens.Lens' RejectVpcEndpointConnections [Prelude.Text]
rejectVpcEndpointConnections_vpcEndpointIds :: Lens' RejectVpcEndpointConnections [Text]
rejectVpcEndpointConnections_vpcEndpointIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RejectVpcEndpointConnections' {[Text]
vpcEndpointIds :: [Text]
$sel:vpcEndpointIds:RejectVpcEndpointConnections' :: RejectVpcEndpointConnections -> [Text]
vpcEndpointIds} -> [Text]
vpcEndpointIds) (\s :: RejectVpcEndpointConnections
s@RejectVpcEndpointConnections' {} [Text]
a -> RejectVpcEndpointConnections
s {$sel:vpcEndpointIds:RejectVpcEndpointConnections' :: [Text]
vpcEndpointIds = [Text]
a} :: RejectVpcEndpointConnections) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest RejectVpcEndpointConnections where
type
AWSResponse RejectVpcEndpointConnections =
RejectVpcEndpointConnectionsResponse
request :: (Service -> Service)
-> RejectVpcEndpointConnections
-> Request RejectVpcEndpointConnections
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy RejectVpcEndpointConnections
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RejectVpcEndpointConnections)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe [UnsuccessfulItem]
-> Int -> RejectVpcEndpointConnectionsResponse
RejectVpcEndpointConnectionsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"unsuccessful"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance
Prelude.Hashable
RejectVpcEndpointConnections
where
hashWithSalt :: Int -> RejectVpcEndpointConnections -> Int
hashWithSalt Int
_salt RejectVpcEndpointConnections' {[Text]
Maybe Bool
Text
vpcEndpointIds :: [Text]
serviceId :: Text
dryRun :: Maybe Bool
$sel:vpcEndpointIds:RejectVpcEndpointConnections' :: RejectVpcEndpointConnections -> [Text]
$sel:serviceId:RejectVpcEndpointConnections' :: RejectVpcEndpointConnections -> Text
$sel:dryRun:RejectVpcEndpointConnections' :: RejectVpcEndpointConnections -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
serviceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
vpcEndpointIds
instance Prelude.NFData RejectVpcEndpointConnections where
rnf :: RejectVpcEndpointConnections -> ()
rnf RejectVpcEndpointConnections' {[Text]
Maybe Bool
Text
vpcEndpointIds :: [Text]
serviceId :: Text
dryRun :: Maybe Bool
$sel:vpcEndpointIds:RejectVpcEndpointConnections' :: RejectVpcEndpointConnections -> [Text]
$sel:serviceId:RejectVpcEndpointConnections' :: RejectVpcEndpointConnections -> Text
$sel:dryRun:RejectVpcEndpointConnections' :: RejectVpcEndpointConnections -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
dryRun
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
serviceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
vpcEndpointIds
instance Data.ToHeaders RejectVpcEndpointConnections where
toHeaders :: RejectVpcEndpointConnections -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath RejectVpcEndpointConnections where
toPath :: RejectVpcEndpointConnections -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery RejectVpcEndpointConnections where
toQuery :: RejectVpcEndpointConnections -> QueryString
toQuery RejectVpcEndpointConnections' {[Text]
Maybe Bool
Text
vpcEndpointIds :: [Text]
serviceId :: Text
dryRun :: Maybe Bool
$sel:vpcEndpointIds:RejectVpcEndpointConnections' :: RejectVpcEndpointConnections -> [Text]
$sel:serviceId:RejectVpcEndpointConnections' :: RejectVpcEndpointConnections -> Text
$sel:dryRun:RejectVpcEndpointConnections' :: RejectVpcEndpointConnections -> Maybe Bool
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"RejectVpcEndpointConnections" ::
Prelude.ByteString
),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
ByteString
"ServiceId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
serviceId,
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"VpcEndpointId" [Text]
vpcEndpointIds
]
data RejectVpcEndpointConnectionsResponse = RejectVpcEndpointConnectionsResponse'
{
RejectVpcEndpointConnectionsResponse -> Maybe [UnsuccessfulItem]
unsuccessful :: Prelude.Maybe [UnsuccessfulItem],
RejectVpcEndpointConnectionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (RejectVpcEndpointConnectionsResponse
-> RejectVpcEndpointConnectionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RejectVpcEndpointConnectionsResponse
-> RejectVpcEndpointConnectionsResponse -> Bool
$c/= :: RejectVpcEndpointConnectionsResponse
-> RejectVpcEndpointConnectionsResponse -> Bool
== :: RejectVpcEndpointConnectionsResponse
-> RejectVpcEndpointConnectionsResponse -> Bool
$c== :: RejectVpcEndpointConnectionsResponse
-> RejectVpcEndpointConnectionsResponse -> Bool
Prelude.Eq, ReadPrec [RejectVpcEndpointConnectionsResponse]
ReadPrec RejectVpcEndpointConnectionsResponse
Int -> ReadS RejectVpcEndpointConnectionsResponse
ReadS [RejectVpcEndpointConnectionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RejectVpcEndpointConnectionsResponse]
$creadListPrec :: ReadPrec [RejectVpcEndpointConnectionsResponse]
readPrec :: ReadPrec RejectVpcEndpointConnectionsResponse
$creadPrec :: ReadPrec RejectVpcEndpointConnectionsResponse
readList :: ReadS [RejectVpcEndpointConnectionsResponse]
$creadList :: ReadS [RejectVpcEndpointConnectionsResponse]
readsPrec :: Int -> ReadS RejectVpcEndpointConnectionsResponse
$creadsPrec :: Int -> ReadS RejectVpcEndpointConnectionsResponse
Prelude.Read, Int -> RejectVpcEndpointConnectionsResponse -> ShowS
[RejectVpcEndpointConnectionsResponse] -> ShowS
RejectVpcEndpointConnectionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RejectVpcEndpointConnectionsResponse] -> ShowS
$cshowList :: [RejectVpcEndpointConnectionsResponse] -> ShowS
show :: RejectVpcEndpointConnectionsResponse -> String
$cshow :: RejectVpcEndpointConnectionsResponse -> String
showsPrec :: Int -> RejectVpcEndpointConnectionsResponse -> ShowS
$cshowsPrec :: Int -> RejectVpcEndpointConnectionsResponse -> ShowS
Prelude.Show, forall x.
Rep RejectVpcEndpointConnectionsResponse x
-> RejectVpcEndpointConnectionsResponse
forall x.
RejectVpcEndpointConnectionsResponse
-> Rep RejectVpcEndpointConnectionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RejectVpcEndpointConnectionsResponse x
-> RejectVpcEndpointConnectionsResponse
$cfrom :: forall x.
RejectVpcEndpointConnectionsResponse
-> Rep RejectVpcEndpointConnectionsResponse x
Prelude.Generic)
newRejectVpcEndpointConnectionsResponse ::
Prelude.Int ->
RejectVpcEndpointConnectionsResponse
newRejectVpcEndpointConnectionsResponse :: Int -> RejectVpcEndpointConnectionsResponse
newRejectVpcEndpointConnectionsResponse Int
pHttpStatus_ =
RejectVpcEndpointConnectionsResponse'
{ $sel:unsuccessful:RejectVpcEndpointConnectionsResponse' :: Maybe [UnsuccessfulItem]
unsuccessful =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:RejectVpcEndpointConnectionsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
rejectVpcEndpointConnectionsResponse_unsuccessful :: Lens.Lens' RejectVpcEndpointConnectionsResponse (Prelude.Maybe [UnsuccessfulItem])
rejectVpcEndpointConnectionsResponse_unsuccessful :: Lens'
RejectVpcEndpointConnectionsResponse (Maybe [UnsuccessfulItem])
rejectVpcEndpointConnectionsResponse_unsuccessful = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RejectVpcEndpointConnectionsResponse' {Maybe [UnsuccessfulItem]
unsuccessful :: Maybe [UnsuccessfulItem]
$sel:unsuccessful:RejectVpcEndpointConnectionsResponse' :: RejectVpcEndpointConnectionsResponse -> Maybe [UnsuccessfulItem]
unsuccessful} -> Maybe [UnsuccessfulItem]
unsuccessful) (\s :: RejectVpcEndpointConnectionsResponse
s@RejectVpcEndpointConnectionsResponse' {} Maybe [UnsuccessfulItem]
a -> RejectVpcEndpointConnectionsResponse
s {$sel:unsuccessful:RejectVpcEndpointConnectionsResponse' :: Maybe [UnsuccessfulItem]
unsuccessful = Maybe [UnsuccessfulItem]
a} :: RejectVpcEndpointConnectionsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
rejectVpcEndpointConnectionsResponse_httpStatus :: Lens.Lens' RejectVpcEndpointConnectionsResponse Prelude.Int
rejectVpcEndpointConnectionsResponse_httpStatus :: Lens' RejectVpcEndpointConnectionsResponse Int
rejectVpcEndpointConnectionsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RejectVpcEndpointConnectionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:RejectVpcEndpointConnectionsResponse' :: RejectVpcEndpointConnectionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RejectVpcEndpointConnectionsResponse
s@RejectVpcEndpointConnectionsResponse' {} Int
a -> RejectVpcEndpointConnectionsResponse
s {$sel:httpStatus:RejectVpcEndpointConnectionsResponse' :: Int
httpStatus = Int
a} :: RejectVpcEndpointConnectionsResponse)
instance
Prelude.NFData
RejectVpcEndpointConnectionsResponse
where
rnf :: RejectVpcEndpointConnectionsResponse -> ()
rnf RejectVpcEndpointConnectionsResponse' {Int
Maybe [UnsuccessfulItem]
httpStatus :: Int
unsuccessful :: Maybe [UnsuccessfulItem]
$sel:httpStatus:RejectVpcEndpointConnectionsResponse' :: RejectVpcEndpointConnectionsResponse -> Int
$sel:unsuccessful:RejectVpcEndpointConnectionsResponse' :: RejectVpcEndpointConnectionsResponse -> Maybe [UnsuccessfulItem]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [UnsuccessfulItem]
unsuccessful
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus