{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.EC2.CreateVpcEndpointConnectionNotification
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a connection notification for a specified VPC endpoint or VPC
-- endpoint service. A connection notification notifies you of specific
-- endpoint events. You must create an SNS topic to receive notifications.
-- For more information, see
-- <https://docs.aws.amazon.com/sns/latest/dg/CreateTopic.html Create a Topic>
-- in the /Amazon Simple Notification Service Developer Guide/.
--
-- You can create a connection notification for interface endpoints only.
module Amazonka.EC2.CreateVpcEndpointConnectionNotification
  ( -- * Creating a Request
    CreateVpcEndpointConnectionNotification (..),
    newCreateVpcEndpointConnectionNotification,

    -- * Request Lenses
    createVpcEndpointConnectionNotification_clientToken,
    createVpcEndpointConnectionNotification_dryRun,
    createVpcEndpointConnectionNotification_serviceId,
    createVpcEndpointConnectionNotification_vpcEndpointId,
    createVpcEndpointConnectionNotification_connectionNotificationArn,
    createVpcEndpointConnectionNotification_connectionEvents,

    -- * Destructuring the Response
    CreateVpcEndpointConnectionNotificationResponse (..),
    newCreateVpcEndpointConnectionNotificationResponse,

    -- * Response Lenses
    createVpcEndpointConnectionNotificationResponse_clientToken,
    createVpcEndpointConnectionNotificationResponse_connectionNotification,
    createVpcEndpointConnectionNotificationResponse_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

-- | /See:/ 'newCreateVpcEndpointConnectionNotification' smart constructor.
data CreateVpcEndpointConnectionNotification = CreateVpcEndpointConnectionNotification'
  { -- | Unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request. For more information, see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html How to ensure idempotency>.
    CreateVpcEndpointConnectionNotification -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | Checks whether you have the required permissions for the action, without
    -- actually making the request, and provides an error response. If you have
    -- the required permissions, the error response is @DryRunOperation@.
    -- Otherwise, it is @UnauthorizedOperation@.
    CreateVpcEndpointConnectionNotification -> Maybe Bool
dryRun :: Prelude.Maybe Prelude.Bool,
    -- | The ID of the endpoint service.
    CreateVpcEndpointConnectionNotification -> Maybe Text
serviceId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the endpoint.
    CreateVpcEndpointConnectionNotification -> Maybe Text
vpcEndpointId :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the SNS topic for the notifications.
    CreateVpcEndpointConnectionNotification -> Text
connectionNotificationArn :: Prelude.Text,
    -- | One or more endpoint events for which to receive notifications. Valid
    -- values are @Accept@, @Connect@, @Delete@, and @Reject@.
    CreateVpcEndpointConnectionNotification -> [Text]
connectionEvents :: [Prelude.Text]
  }
  deriving (CreateVpcEndpointConnectionNotification
-> CreateVpcEndpointConnectionNotification -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateVpcEndpointConnectionNotification
-> CreateVpcEndpointConnectionNotification -> Bool
$c/= :: CreateVpcEndpointConnectionNotification
-> CreateVpcEndpointConnectionNotification -> Bool
== :: CreateVpcEndpointConnectionNotification
-> CreateVpcEndpointConnectionNotification -> Bool
$c== :: CreateVpcEndpointConnectionNotification
-> CreateVpcEndpointConnectionNotification -> Bool
Prelude.Eq, ReadPrec [CreateVpcEndpointConnectionNotification]
ReadPrec CreateVpcEndpointConnectionNotification
Int -> ReadS CreateVpcEndpointConnectionNotification
ReadS [CreateVpcEndpointConnectionNotification]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateVpcEndpointConnectionNotification]
$creadListPrec :: ReadPrec [CreateVpcEndpointConnectionNotification]
readPrec :: ReadPrec CreateVpcEndpointConnectionNotification
$creadPrec :: ReadPrec CreateVpcEndpointConnectionNotification
readList :: ReadS [CreateVpcEndpointConnectionNotification]
$creadList :: ReadS [CreateVpcEndpointConnectionNotification]
readsPrec :: Int -> ReadS CreateVpcEndpointConnectionNotification
$creadsPrec :: Int -> ReadS CreateVpcEndpointConnectionNotification
Prelude.Read, Int -> CreateVpcEndpointConnectionNotification -> ShowS
[CreateVpcEndpointConnectionNotification] -> ShowS
CreateVpcEndpointConnectionNotification -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateVpcEndpointConnectionNotification] -> ShowS
$cshowList :: [CreateVpcEndpointConnectionNotification] -> ShowS
show :: CreateVpcEndpointConnectionNotification -> String
$cshow :: CreateVpcEndpointConnectionNotification -> String
showsPrec :: Int -> CreateVpcEndpointConnectionNotification -> ShowS
$cshowsPrec :: Int -> CreateVpcEndpointConnectionNotification -> ShowS
Prelude.Show, forall x.
Rep CreateVpcEndpointConnectionNotification x
-> CreateVpcEndpointConnectionNotification
forall x.
CreateVpcEndpointConnectionNotification
-> Rep CreateVpcEndpointConnectionNotification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateVpcEndpointConnectionNotification x
-> CreateVpcEndpointConnectionNotification
$cfrom :: forall x.
CreateVpcEndpointConnectionNotification
-> Rep CreateVpcEndpointConnectionNotification x
Prelude.Generic)

-- |
-- Create a value of 'CreateVpcEndpointConnectionNotification' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'clientToken', 'createVpcEndpointConnectionNotification_clientToken' - Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html How to ensure idempotency>.
--
-- 'dryRun', 'createVpcEndpointConnectionNotification_dryRun' - Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
--
-- 'serviceId', 'createVpcEndpointConnectionNotification_serviceId' - The ID of the endpoint service.
--
-- 'vpcEndpointId', 'createVpcEndpointConnectionNotification_vpcEndpointId' - The ID of the endpoint.
--
-- 'connectionNotificationArn', 'createVpcEndpointConnectionNotification_connectionNotificationArn' - The ARN of the SNS topic for the notifications.
--
-- 'connectionEvents', 'createVpcEndpointConnectionNotification_connectionEvents' - One or more endpoint events for which to receive notifications. Valid
-- values are @Accept@, @Connect@, @Delete@, and @Reject@.
newCreateVpcEndpointConnectionNotification ::
  -- | 'connectionNotificationArn'
  Prelude.Text ->
  CreateVpcEndpointConnectionNotification
newCreateVpcEndpointConnectionNotification :: Text -> CreateVpcEndpointConnectionNotification
newCreateVpcEndpointConnectionNotification
  Text
pConnectionNotificationArn_ =
    CreateVpcEndpointConnectionNotification'
      { $sel:clientToken:CreateVpcEndpointConnectionNotification' :: Maybe Text
clientToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:dryRun:CreateVpcEndpointConnectionNotification' :: Maybe Bool
dryRun = forall a. Maybe a
Prelude.Nothing,
        $sel:serviceId:CreateVpcEndpointConnectionNotification' :: Maybe Text
serviceId = forall a. Maybe a
Prelude.Nothing,
        $sel:vpcEndpointId:CreateVpcEndpointConnectionNotification' :: Maybe Text
vpcEndpointId = forall a. Maybe a
Prelude.Nothing,
        $sel:connectionNotificationArn:CreateVpcEndpointConnectionNotification' :: Text
connectionNotificationArn =
          Text
pConnectionNotificationArn_,
        $sel:connectionEvents:CreateVpcEndpointConnectionNotification' :: [Text]
connectionEvents = forall a. Monoid a => a
Prelude.mempty
      }

-- | Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request. For more information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html How to ensure idempotency>.
createVpcEndpointConnectionNotification_clientToken :: Lens.Lens' CreateVpcEndpointConnectionNotification (Prelude.Maybe Prelude.Text)
createVpcEndpointConnectionNotification_clientToken :: Lens' CreateVpcEndpointConnectionNotification (Maybe Text)
createVpcEndpointConnectionNotification_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcEndpointConnectionNotification' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateVpcEndpointConnectionNotification' :: CreateVpcEndpointConnectionNotification -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateVpcEndpointConnectionNotification
s@CreateVpcEndpointConnectionNotification' {} Maybe Text
a -> CreateVpcEndpointConnectionNotification
s {$sel:clientToken:CreateVpcEndpointConnectionNotification' :: Maybe Text
clientToken = Maybe Text
a} :: CreateVpcEndpointConnectionNotification)

-- | Checks whether you have the required permissions for the action, without
-- actually making the request, and provides an error response. If you have
-- the required permissions, the error response is @DryRunOperation@.
-- Otherwise, it is @UnauthorizedOperation@.
createVpcEndpointConnectionNotification_dryRun :: Lens.Lens' CreateVpcEndpointConnectionNotification (Prelude.Maybe Prelude.Bool)
createVpcEndpointConnectionNotification_dryRun :: Lens' CreateVpcEndpointConnectionNotification (Maybe Bool)
createVpcEndpointConnectionNotification_dryRun = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcEndpointConnectionNotification' {Maybe Bool
dryRun :: Maybe Bool
$sel:dryRun:CreateVpcEndpointConnectionNotification' :: CreateVpcEndpointConnectionNotification -> Maybe Bool
dryRun} -> Maybe Bool
dryRun) (\s :: CreateVpcEndpointConnectionNotification
s@CreateVpcEndpointConnectionNotification' {} Maybe Bool
a -> CreateVpcEndpointConnectionNotification
s {$sel:dryRun:CreateVpcEndpointConnectionNotification' :: Maybe Bool
dryRun = Maybe Bool
a} :: CreateVpcEndpointConnectionNotification)

-- | The ID of the endpoint service.
createVpcEndpointConnectionNotification_serviceId :: Lens.Lens' CreateVpcEndpointConnectionNotification (Prelude.Maybe Prelude.Text)
createVpcEndpointConnectionNotification_serviceId :: Lens' CreateVpcEndpointConnectionNotification (Maybe Text)
createVpcEndpointConnectionNotification_serviceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcEndpointConnectionNotification' {Maybe Text
serviceId :: Maybe Text
$sel:serviceId:CreateVpcEndpointConnectionNotification' :: CreateVpcEndpointConnectionNotification -> Maybe Text
serviceId} -> Maybe Text
serviceId) (\s :: CreateVpcEndpointConnectionNotification
s@CreateVpcEndpointConnectionNotification' {} Maybe Text
a -> CreateVpcEndpointConnectionNotification
s {$sel:serviceId:CreateVpcEndpointConnectionNotification' :: Maybe Text
serviceId = Maybe Text
a} :: CreateVpcEndpointConnectionNotification)

-- | The ID of the endpoint.
createVpcEndpointConnectionNotification_vpcEndpointId :: Lens.Lens' CreateVpcEndpointConnectionNotification (Prelude.Maybe Prelude.Text)
createVpcEndpointConnectionNotification_vpcEndpointId :: Lens' CreateVpcEndpointConnectionNotification (Maybe Text)
createVpcEndpointConnectionNotification_vpcEndpointId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcEndpointConnectionNotification' {Maybe Text
vpcEndpointId :: Maybe Text
$sel:vpcEndpointId:CreateVpcEndpointConnectionNotification' :: CreateVpcEndpointConnectionNotification -> Maybe Text
vpcEndpointId} -> Maybe Text
vpcEndpointId) (\s :: CreateVpcEndpointConnectionNotification
s@CreateVpcEndpointConnectionNotification' {} Maybe Text
a -> CreateVpcEndpointConnectionNotification
s {$sel:vpcEndpointId:CreateVpcEndpointConnectionNotification' :: Maybe Text
vpcEndpointId = Maybe Text
a} :: CreateVpcEndpointConnectionNotification)

-- | The ARN of the SNS topic for the notifications.
createVpcEndpointConnectionNotification_connectionNotificationArn :: Lens.Lens' CreateVpcEndpointConnectionNotification Prelude.Text
createVpcEndpointConnectionNotification_connectionNotificationArn :: Lens' CreateVpcEndpointConnectionNotification Text
createVpcEndpointConnectionNotification_connectionNotificationArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcEndpointConnectionNotification' {Text
connectionNotificationArn :: Text
$sel:connectionNotificationArn:CreateVpcEndpointConnectionNotification' :: CreateVpcEndpointConnectionNotification -> Text
connectionNotificationArn} -> Text
connectionNotificationArn) (\s :: CreateVpcEndpointConnectionNotification
s@CreateVpcEndpointConnectionNotification' {} Text
a -> CreateVpcEndpointConnectionNotification
s {$sel:connectionNotificationArn:CreateVpcEndpointConnectionNotification' :: Text
connectionNotificationArn = Text
a} :: CreateVpcEndpointConnectionNotification)

-- | One or more endpoint events for which to receive notifications. Valid
-- values are @Accept@, @Connect@, @Delete@, and @Reject@.
createVpcEndpointConnectionNotification_connectionEvents :: Lens.Lens' CreateVpcEndpointConnectionNotification [Prelude.Text]
createVpcEndpointConnectionNotification_connectionEvents :: Lens' CreateVpcEndpointConnectionNotification [Text]
createVpcEndpointConnectionNotification_connectionEvents = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcEndpointConnectionNotification' {[Text]
connectionEvents :: [Text]
$sel:connectionEvents:CreateVpcEndpointConnectionNotification' :: CreateVpcEndpointConnectionNotification -> [Text]
connectionEvents} -> [Text]
connectionEvents) (\s :: CreateVpcEndpointConnectionNotification
s@CreateVpcEndpointConnectionNotification' {} [Text]
a -> CreateVpcEndpointConnectionNotification
s {$sel:connectionEvents:CreateVpcEndpointConnectionNotification' :: [Text]
connectionEvents = [Text]
a} :: CreateVpcEndpointConnectionNotification) 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
    CreateVpcEndpointConnectionNotification
  where
  type
    AWSResponse
      CreateVpcEndpointConnectionNotification =
      CreateVpcEndpointConnectionNotificationResponse
  request :: (Service -> Service)
-> CreateVpcEndpointConnectionNotification
-> Request CreateVpcEndpointConnectionNotification
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 CreateVpcEndpointConnectionNotification
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse CreateVpcEndpointConnectionNotification)))
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 Text
-> Maybe ConnectionNotification
-> Int
-> CreateVpcEndpointConnectionNotificationResponse
CreateVpcEndpointConnectionNotificationResponse'
            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
"clientToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"connectionNotification")
            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
    CreateVpcEndpointConnectionNotification
  where
  hashWithSalt :: Int -> CreateVpcEndpointConnectionNotification -> Int
hashWithSalt
    Int
_salt
    CreateVpcEndpointConnectionNotification' {[Text]
Maybe Bool
Maybe Text
Text
connectionEvents :: [Text]
connectionNotificationArn :: Text
vpcEndpointId :: Maybe Text
serviceId :: Maybe Text
dryRun :: Maybe Bool
clientToken :: Maybe Text
$sel:connectionEvents:CreateVpcEndpointConnectionNotification' :: CreateVpcEndpointConnectionNotification -> [Text]
$sel:connectionNotificationArn:CreateVpcEndpointConnectionNotification' :: CreateVpcEndpointConnectionNotification -> Text
$sel:vpcEndpointId:CreateVpcEndpointConnectionNotification' :: CreateVpcEndpointConnectionNotification -> Maybe Text
$sel:serviceId:CreateVpcEndpointConnectionNotification' :: CreateVpcEndpointConnectionNotification -> Maybe Text
$sel:dryRun:CreateVpcEndpointConnectionNotification' :: CreateVpcEndpointConnectionNotification -> Maybe Bool
$sel:clientToken:CreateVpcEndpointConnectionNotification' :: CreateVpcEndpointConnectionNotification -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientToken
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
dryRun
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
serviceId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vpcEndpointId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
connectionNotificationArn
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
connectionEvents

instance
  Prelude.NFData
    CreateVpcEndpointConnectionNotification
  where
  rnf :: CreateVpcEndpointConnectionNotification -> ()
rnf CreateVpcEndpointConnectionNotification' {[Text]
Maybe Bool
Maybe Text
Text
connectionEvents :: [Text]
connectionNotificationArn :: Text
vpcEndpointId :: Maybe Text
serviceId :: Maybe Text
dryRun :: Maybe Bool
clientToken :: Maybe Text
$sel:connectionEvents:CreateVpcEndpointConnectionNotification' :: CreateVpcEndpointConnectionNotification -> [Text]
$sel:connectionNotificationArn:CreateVpcEndpointConnectionNotification' :: CreateVpcEndpointConnectionNotification -> Text
$sel:vpcEndpointId:CreateVpcEndpointConnectionNotification' :: CreateVpcEndpointConnectionNotification -> Maybe Text
$sel:serviceId:CreateVpcEndpointConnectionNotification' :: CreateVpcEndpointConnectionNotification -> Maybe Text
$sel:dryRun:CreateVpcEndpointConnectionNotification' :: CreateVpcEndpointConnectionNotification -> Maybe Bool
$sel:clientToken:CreateVpcEndpointConnectionNotification' :: CreateVpcEndpointConnectionNotification -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Maybe Text
serviceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vpcEndpointId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
connectionNotificationArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
connectionEvents

instance
  Data.ToHeaders
    CreateVpcEndpointConnectionNotification
  where
  toHeaders :: CreateVpcEndpointConnectionNotification -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance
  Data.ToPath
    CreateVpcEndpointConnectionNotification
  where
  toPath :: CreateVpcEndpointConnectionNotification -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance
  Data.ToQuery
    CreateVpcEndpointConnectionNotification
  where
  toQuery :: CreateVpcEndpointConnectionNotification -> QueryString
toQuery CreateVpcEndpointConnectionNotification' {[Text]
Maybe Bool
Maybe Text
Text
connectionEvents :: [Text]
connectionNotificationArn :: Text
vpcEndpointId :: Maybe Text
serviceId :: Maybe Text
dryRun :: Maybe Bool
clientToken :: Maybe Text
$sel:connectionEvents:CreateVpcEndpointConnectionNotification' :: CreateVpcEndpointConnectionNotification -> [Text]
$sel:connectionNotificationArn:CreateVpcEndpointConnectionNotification' :: CreateVpcEndpointConnectionNotification -> Text
$sel:vpcEndpointId:CreateVpcEndpointConnectionNotification' :: CreateVpcEndpointConnectionNotification -> Maybe Text
$sel:serviceId:CreateVpcEndpointConnectionNotification' :: CreateVpcEndpointConnectionNotification -> Maybe Text
$sel:dryRun:CreateVpcEndpointConnectionNotification' :: CreateVpcEndpointConnectionNotification -> Maybe Bool
$sel:clientToken:CreateVpcEndpointConnectionNotification' :: CreateVpcEndpointConnectionNotification -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"CreateVpcEndpointConnectionNotification" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2016-11-15" :: Prelude.ByteString),
        ByteString
"ClientToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
clientToken,
        ByteString
"DryRun" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
dryRun,
        ByteString
"ServiceId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
serviceId,
        ByteString
"VpcEndpointId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
vpcEndpointId,
        ByteString
"ConnectionNotificationArn"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
connectionNotificationArn,
        forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"ConnectionEvents" [Text]
connectionEvents
      ]

-- | /See:/ 'newCreateVpcEndpointConnectionNotificationResponse' smart constructor.
data CreateVpcEndpointConnectionNotificationResponse = CreateVpcEndpointConnectionNotificationResponse'
  { -- | Unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request.
    CreateVpcEndpointConnectionNotificationResponse -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | Information about the notification.
    CreateVpcEndpointConnectionNotificationResponse
-> Maybe ConnectionNotification
connectionNotification :: Prelude.Maybe ConnectionNotification,
    -- | The response's http status code.
    CreateVpcEndpointConnectionNotificationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateVpcEndpointConnectionNotificationResponse
-> CreateVpcEndpointConnectionNotificationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateVpcEndpointConnectionNotificationResponse
-> CreateVpcEndpointConnectionNotificationResponse -> Bool
$c/= :: CreateVpcEndpointConnectionNotificationResponse
-> CreateVpcEndpointConnectionNotificationResponse -> Bool
== :: CreateVpcEndpointConnectionNotificationResponse
-> CreateVpcEndpointConnectionNotificationResponse -> Bool
$c== :: CreateVpcEndpointConnectionNotificationResponse
-> CreateVpcEndpointConnectionNotificationResponse -> Bool
Prelude.Eq, ReadPrec [CreateVpcEndpointConnectionNotificationResponse]
ReadPrec CreateVpcEndpointConnectionNotificationResponse
Int -> ReadS CreateVpcEndpointConnectionNotificationResponse
ReadS [CreateVpcEndpointConnectionNotificationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateVpcEndpointConnectionNotificationResponse]
$creadListPrec :: ReadPrec [CreateVpcEndpointConnectionNotificationResponse]
readPrec :: ReadPrec CreateVpcEndpointConnectionNotificationResponse
$creadPrec :: ReadPrec CreateVpcEndpointConnectionNotificationResponse
readList :: ReadS [CreateVpcEndpointConnectionNotificationResponse]
$creadList :: ReadS [CreateVpcEndpointConnectionNotificationResponse]
readsPrec :: Int -> ReadS CreateVpcEndpointConnectionNotificationResponse
$creadsPrec :: Int -> ReadS CreateVpcEndpointConnectionNotificationResponse
Prelude.Read, Int -> CreateVpcEndpointConnectionNotificationResponse -> ShowS
[CreateVpcEndpointConnectionNotificationResponse] -> ShowS
CreateVpcEndpointConnectionNotificationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateVpcEndpointConnectionNotificationResponse] -> ShowS
$cshowList :: [CreateVpcEndpointConnectionNotificationResponse] -> ShowS
show :: CreateVpcEndpointConnectionNotificationResponse -> String
$cshow :: CreateVpcEndpointConnectionNotificationResponse -> String
showsPrec :: Int -> CreateVpcEndpointConnectionNotificationResponse -> ShowS
$cshowsPrec :: Int -> CreateVpcEndpointConnectionNotificationResponse -> ShowS
Prelude.Show, forall x.
Rep CreateVpcEndpointConnectionNotificationResponse x
-> CreateVpcEndpointConnectionNotificationResponse
forall x.
CreateVpcEndpointConnectionNotificationResponse
-> Rep CreateVpcEndpointConnectionNotificationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateVpcEndpointConnectionNotificationResponse x
-> CreateVpcEndpointConnectionNotificationResponse
$cfrom :: forall x.
CreateVpcEndpointConnectionNotificationResponse
-> Rep CreateVpcEndpointConnectionNotificationResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateVpcEndpointConnectionNotificationResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'clientToken', 'createVpcEndpointConnectionNotificationResponse_clientToken' - Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request.
--
-- 'connectionNotification', 'createVpcEndpointConnectionNotificationResponse_connectionNotification' - Information about the notification.
--
-- 'httpStatus', 'createVpcEndpointConnectionNotificationResponse_httpStatus' - The response's http status code.
newCreateVpcEndpointConnectionNotificationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateVpcEndpointConnectionNotificationResponse
newCreateVpcEndpointConnectionNotificationResponse :: Int -> CreateVpcEndpointConnectionNotificationResponse
newCreateVpcEndpointConnectionNotificationResponse
  Int
pHttpStatus_ =
    CreateVpcEndpointConnectionNotificationResponse'
      { $sel:clientToken:CreateVpcEndpointConnectionNotificationResponse' :: Maybe Text
clientToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:connectionNotification:CreateVpcEndpointConnectionNotificationResponse' :: Maybe ConnectionNotification
connectionNotification =
          forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:CreateVpcEndpointConnectionNotificationResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | Unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request.
createVpcEndpointConnectionNotificationResponse_clientToken :: Lens.Lens' CreateVpcEndpointConnectionNotificationResponse (Prelude.Maybe Prelude.Text)
createVpcEndpointConnectionNotificationResponse_clientToken :: Lens' CreateVpcEndpointConnectionNotificationResponse (Maybe Text)
createVpcEndpointConnectionNotificationResponse_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcEndpointConnectionNotificationResponse' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:CreateVpcEndpointConnectionNotificationResponse' :: CreateVpcEndpointConnectionNotificationResponse -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: CreateVpcEndpointConnectionNotificationResponse
s@CreateVpcEndpointConnectionNotificationResponse' {} Maybe Text
a -> CreateVpcEndpointConnectionNotificationResponse
s {$sel:clientToken:CreateVpcEndpointConnectionNotificationResponse' :: Maybe Text
clientToken = Maybe Text
a} :: CreateVpcEndpointConnectionNotificationResponse)

-- | Information about the notification.
createVpcEndpointConnectionNotificationResponse_connectionNotification :: Lens.Lens' CreateVpcEndpointConnectionNotificationResponse (Prelude.Maybe ConnectionNotification)
createVpcEndpointConnectionNotificationResponse_connectionNotification :: Lens'
  CreateVpcEndpointConnectionNotificationResponse
  (Maybe ConnectionNotification)
createVpcEndpointConnectionNotificationResponse_connectionNotification = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcEndpointConnectionNotificationResponse' {Maybe ConnectionNotification
connectionNotification :: Maybe ConnectionNotification
$sel:connectionNotification:CreateVpcEndpointConnectionNotificationResponse' :: CreateVpcEndpointConnectionNotificationResponse
-> Maybe ConnectionNotification
connectionNotification} -> Maybe ConnectionNotification
connectionNotification) (\s :: CreateVpcEndpointConnectionNotificationResponse
s@CreateVpcEndpointConnectionNotificationResponse' {} Maybe ConnectionNotification
a -> CreateVpcEndpointConnectionNotificationResponse
s {$sel:connectionNotification:CreateVpcEndpointConnectionNotificationResponse' :: Maybe ConnectionNotification
connectionNotification = Maybe ConnectionNotification
a} :: CreateVpcEndpointConnectionNotificationResponse)

-- | The response's http status code.
createVpcEndpointConnectionNotificationResponse_httpStatus :: Lens.Lens' CreateVpcEndpointConnectionNotificationResponse Prelude.Int
createVpcEndpointConnectionNotificationResponse_httpStatus :: Lens' CreateVpcEndpointConnectionNotificationResponse Int
createVpcEndpointConnectionNotificationResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateVpcEndpointConnectionNotificationResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateVpcEndpointConnectionNotificationResponse' :: CreateVpcEndpointConnectionNotificationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateVpcEndpointConnectionNotificationResponse
s@CreateVpcEndpointConnectionNotificationResponse' {} Int
a -> CreateVpcEndpointConnectionNotificationResponse
s {$sel:httpStatus:CreateVpcEndpointConnectionNotificationResponse' :: Int
httpStatus = Int
a} :: CreateVpcEndpointConnectionNotificationResponse)

instance
  Prelude.NFData
    CreateVpcEndpointConnectionNotificationResponse
  where
  rnf :: CreateVpcEndpointConnectionNotificationResponse -> ()
rnf
    CreateVpcEndpointConnectionNotificationResponse' {Int
Maybe Text
Maybe ConnectionNotification
httpStatus :: Int
connectionNotification :: Maybe ConnectionNotification
clientToken :: Maybe Text
$sel:httpStatus:CreateVpcEndpointConnectionNotificationResponse' :: CreateVpcEndpointConnectionNotificationResponse -> Int
$sel:connectionNotification:CreateVpcEndpointConnectionNotificationResponse' :: CreateVpcEndpointConnectionNotificationResponse
-> Maybe ConnectionNotification
$sel:clientToken:CreateVpcEndpointConnectionNotificationResponse' :: CreateVpcEndpointConnectionNotificationResponse -> Maybe Text
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ConnectionNotification
connectionNotification
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus