{-# 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.AppIntegrationS.CreateEventIntegration
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates an EventIntegration, given a specified name, description, and a
-- reference to an Amazon EventBridge bus in your account and a partner
-- event source that pushes events to that bus. No objects are created in
-- the your account, only metadata that is persisted on the
-- EventIntegration control plane.
module Amazonka.AppIntegrationS.CreateEventIntegration
  ( -- * Creating a Request
    CreateEventIntegration (..),
    newCreateEventIntegration,

    -- * Request Lenses
    createEventIntegration_clientToken,
    createEventIntegration_description,
    createEventIntegration_tags,
    createEventIntegration_name,
    createEventIntegration_eventFilter,
    createEventIntegration_eventBridgeBus,

    -- * Destructuring the Response
    CreateEventIntegrationResponse (..),
    newCreateEventIntegrationResponse,

    -- * Response Lenses
    createEventIntegrationResponse_eventIntegrationArn,
    createEventIntegrationResponse_httpStatus,
  )
where

import Amazonka.AppIntegrationS.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

-- | /See:/ 'newCreateEventIntegration' smart constructor.
data CreateEventIntegration = CreateEventIntegration'
  { -- | A unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the request.
    CreateEventIntegration -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The description of the event integration.
    CreateEventIntegration -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | One or more tags.
    CreateEventIntegration -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The name of the event integration.
    CreateEventIntegration -> Text
name :: Prelude.Text,
    -- | The event filter.
    CreateEventIntegration -> EventFilter
eventFilter :: EventFilter,
    -- | The EventBridge bus.
    CreateEventIntegration -> Text
eventBridgeBus :: Prelude.Text
  }
  deriving (CreateEventIntegration -> CreateEventIntegration -> Bool
(CreateEventIntegration -> CreateEventIntegration -> Bool)
-> (CreateEventIntegration -> CreateEventIntegration -> Bool)
-> Eq CreateEventIntegration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateEventIntegration -> CreateEventIntegration -> Bool
$c/= :: CreateEventIntegration -> CreateEventIntegration -> Bool
== :: CreateEventIntegration -> CreateEventIntegration -> Bool
$c== :: CreateEventIntegration -> CreateEventIntegration -> Bool
Prelude.Eq, ReadPrec [CreateEventIntegration]
ReadPrec CreateEventIntegration
Int -> ReadS CreateEventIntegration
ReadS [CreateEventIntegration]
(Int -> ReadS CreateEventIntegration)
-> ReadS [CreateEventIntegration]
-> ReadPrec CreateEventIntegration
-> ReadPrec [CreateEventIntegration]
-> Read CreateEventIntegration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateEventIntegration]
$creadListPrec :: ReadPrec [CreateEventIntegration]
readPrec :: ReadPrec CreateEventIntegration
$creadPrec :: ReadPrec CreateEventIntegration
readList :: ReadS [CreateEventIntegration]
$creadList :: ReadS [CreateEventIntegration]
readsPrec :: Int -> ReadS CreateEventIntegration
$creadsPrec :: Int -> ReadS CreateEventIntegration
Prelude.Read, Int -> CreateEventIntegration -> ShowS
[CreateEventIntegration] -> ShowS
CreateEventIntegration -> String
(Int -> CreateEventIntegration -> ShowS)
-> (CreateEventIntegration -> String)
-> ([CreateEventIntegration] -> ShowS)
-> Show CreateEventIntegration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateEventIntegration] -> ShowS
$cshowList :: [CreateEventIntegration] -> ShowS
show :: CreateEventIntegration -> String
$cshow :: CreateEventIntegration -> String
showsPrec :: Int -> CreateEventIntegration -> ShowS
$cshowsPrec :: Int -> CreateEventIntegration -> ShowS
Prelude.Show, (forall x. CreateEventIntegration -> Rep CreateEventIntegration x)
-> (forall x.
    Rep CreateEventIntegration x -> CreateEventIntegration)
-> Generic CreateEventIntegration
forall x. Rep CreateEventIntegration x -> CreateEventIntegration
forall x. CreateEventIntegration -> Rep CreateEventIntegration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateEventIntegration x -> CreateEventIntegration
$cfrom :: forall x. CreateEventIntegration -> Rep CreateEventIntegration x
Prelude.Generic)

-- |
-- Create a value of 'CreateEventIntegration' 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', 'createEventIntegration_clientToken' - A unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the request.
--
-- 'description', 'createEventIntegration_description' - The description of the event integration.
--
-- 'tags', 'createEventIntegration_tags' - One or more tags.
--
-- 'name', 'createEventIntegration_name' - The name of the event integration.
--
-- 'eventFilter', 'createEventIntegration_eventFilter' - The event filter.
--
-- 'eventBridgeBus', 'createEventIntegration_eventBridgeBus' - The EventBridge bus.
newCreateEventIntegration ::
  -- | 'name'
  Prelude.Text ->
  -- | 'eventFilter'
  EventFilter ->
  -- | 'eventBridgeBus'
  Prelude.Text ->
  CreateEventIntegration
newCreateEventIntegration :: Text -> EventFilter -> Text -> CreateEventIntegration
newCreateEventIntegration
  Text
pName_
  EventFilter
pEventFilter_
  Text
pEventBridgeBus_ =
    CreateEventIntegration' :: Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> EventFilter
-> Text
-> CreateEventIntegration
CreateEventIntegration'
      { $sel:clientToken:CreateEventIntegration' :: Maybe Text
clientToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:description:CreateEventIntegration' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateEventIntegration' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:name:CreateEventIntegration' :: Text
name = Text
pName_,
        $sel:eventFilter:CreateEventIntegration' :: EventFilter
eventFilter = EventFilter
pEventFilter_,
        $sel:eventBridgeBus:CreateEventIntegration' :: Text
eventBridgeBus = Text
pEventBridgeBus_
      }

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

-- | The description of the event integration.
createEventIntegration_description :: Lens.Lens' CreateEventIntegration (Prelude.Maybe Prelude.Text)
createEventIntegration_description :: (Maybe Text -> f (Maybe Text))
-> CreateEventIntegration -> f CreateEventIntegration
createEventIntegration_description = (CreateEventIntegration -> Maybe Text)
-> (CreateEventIntegration -> Maybe Text -> CreateEventIntegration)
-> Lens
     CreateEventIntegration
     CreateEventIntegration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEventIntegration' {Maybe Text
description :: Maybe Text
$sel:description:CreateEventIntegration' :: CreateEventIntegration -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateEventIntegration
s@CreateEventIntegration' {} Maybe Text
a -> CreateEventIntegration
s {$sel:description:CreateEventIntegration' :: Maybe Text
description = Maybe Text
a} :: CreateEventIntegration)

-- | One or more tags.
createEventIntegration_tags :: Lens.Lens' CreateEventIntegration (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createEventIntegration_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateEventIntegration -> f CreateEventIntegration
createEventIntegration_tags = (CreateEventIntegration -> Maybe (HashMap Text Text))
-> (CreateEventIntegration
    -> Maybe (HashMap Text Text) -> CreateEventIntegration)
-> Lens
     CreateEventIntegration
     CreateEventIntegration
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEventIntegration' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateEventIntegration' :: CreateEventIntegration -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateEventIntegration
s@CreateEventIntegration' {} Maybe (HashMap Text Text)
a -> CreateEventIntegration
s {$sel:tags:CreateEventIntegration' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateEventIntegration) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> CreateEventIntegration -> f CreateEventIntegration)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateEventIntegration
-> f CreateEventIntegration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the event integration.
createEventIntegration_name :: Lens.Lens' CreateEventIntegration Prelude.Text
createEventIntegration_name :: (Text -> f Text)
-> CreateEventIntegration -> f CreateEventIntegration
createEventIntegration_name = (CreateEventIntegration -> Text)
-> (CreateEventIntegration -> Text -> CreateEventIntegration)
-> Lens CreateEventIntegration CreateEventIntegration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEventIntegration' {Text
name :: Text
$sel:name:CreateEventIntegration' :: CreateEventIntegration -> Text
name} -> Text
name) (\s :: CreateEventIntegration
s@CreateEventIntegration' {} Text
a -> CreateEventIntegration
s {$sel:name:CreateEventIntegration' :: Text
name = Text
a} :: CreateEventIntegration)

-- | The event filter.
createEventIntegration_eventFilter :: Lens.Lens' CreateEventIntegration EventFilter
createEventIntegration_eventFilter :: (EventFilter -> f EventFilter)
-> CreateEventIntegration -> f CreateEventIntegration
createEventIntegration_eventFilter = (CreateEventIntegration -> EventFilter)
-> (CreateEventIntegration
    -> EventFilter -> CreateEventIntegration)
-> Lens
     CreateEventIntegration
     CreateEventIntegration
     EventFilter
     EventFilter
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEventIntegration' {EventFilter
eventFilter :: EventFilter
$sel:eventFilter:CreateEventIntegration' :: CreateEventIntegration -> EventFilter
eventFilter} -> EventFilter
eventFilter) (\s :: CreateEventIntegration
s@CreateEventIntegration' {} EventFilter
a -> CreateEventIntegration
s {$sel:eventFilter:CreateEventIntegration' :: EventFilter
eventFilter = EventFilter
a} :: CreateEventIntegration)

-- | The EventBridge bus.
createEventIntegration_eventBridgeBus :: Lens.Lens' CreateEventIntegration Prelude.Text
createEventIntegration_eventBridgeBus :: (Text -> f Text)
-> CreateEventIntegration -> f CreateEventIntegration
createEventIntegration_eventBridgeBus = (CreateEventIntegration -> Text)
-> (CreateEventIntegration -> Text -> CreateEventIntegration)
-> Lens CreateEventIntegration CreateEventIntegration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEventIntegration' {Text
eventBridgeBus :: Text
$sel:eventBridgeBus:CreateEventIntegration' :: CreateEventIntegration -> Text
eventBridgeBus} -> Text
eventBridgeBus) (\s :: CreateEventIntegration
s@CreateEventIntegration' {} Text
a -> CreateEventIntegration
s {$sel:eventBridgeBus:CreateEventIntegration' :: Text
eventBridgeBus = Text
a} :: CreateEventIntegration)

instance Core.AWSRequest CreateEventIntegration where
  type
    AWSResponse CreateEventIntegration =
      CreateEventIntegrationResponse
  request :: CreateEventIntegration -> Request CreateEventIntegration
request = Service -> CreateEventIntegration -> Request CreateEventIntegration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateEventIntegration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateEventIntegration)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateEventIntegration))
-> Logger
-> Service
-> Proxy CreateEventIntegration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateEventIntegration)))
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 Text -> Int -> CreateEventIntegrationResponse
CreateEventIntegrationResponse'
            (Maybe Text -> Int -> CreateEventIntegrationResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateEventIntegrationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"EventIntegrationArn")
            Either String (Int -> CreateEventIntegrationResponse)
-> Either String Int
-> Either String CreateEventIntegrationResponse
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 CreateEventIntegration

instance Prelude.NFData CreateEventIntegration

instance Core.ToHeaders CreateEventIntegration where
  toHeaders :: CreateEventIntegration -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateEventIntegration -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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 CreateEventIntegration where
  toJSON :: CreateEventIntegration -> Value
toJSON CreateEventIntegration' {Maybe Text
Maybe (HashMap Text Text)
Text
EventFilter
eventBridgeBus :: Text
eventFilter :: EventFilter
name :: Text
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
clientToken :: Maybe Text
$sel:eventBridgeBus:CreateEventIntegration' :: CreateEventIntegration -> Text
$sel:eventFilter:CreateEventIntegration' :: CreateEventIntegration -> EventFilter
$sel:name:CreateEventIntegration' :: CreateEventIntegration -> Text
$sel:tags:CreateEventIntegration' :: CreateEventIntegration -> Maybe (HashMap Text Text)
$sel:description:CreateEventIntegration' :: CreateEventIntegration -> Maybe Text
$sel:clientToken:CreateEventIntegration' :: CreateEventIntegration -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ClientToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientToken,
            (Text
"Description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Text
"Tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"EventFilter" Text -> EventFilter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= EventFilter
eventFilter),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"EventBridgeBus" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
eventBridgeBus)
          ]
      )

instance Core.ToPath CreateEventIntegration where
  toPath :: CreateEventIntegration -> ByteString
toPath = ByteString -> CreateEventIntegration -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/eventIntegrations"

instance Core.ToQuery CreateEventIntegration where
  toQuery :: CreateEventIntegration -> QueryString
toQuery = QueryString -> CreateEventIntegration -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateEventIntegrationResponse' smart constructor.
data CreateEventIntegrationResponse = CreateEventIntegrationResponse'
  { -- | The Amazon Resource Name (ARN) of the event integration.
    CreateEventIntegrationResponse -> Maybe Text
eventIntegrationArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateEventIntegrationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateEventIntegrationResponse
-> CreateEventIntegrationResponse -> Bool
(CreateEventIntegrationResponse
 -> CreateEventIntegrationResponse -> Bool)
-> (CreateEventIntegrationResponse
    -> CreateEventIntegrationResponse -> Bool)
-> Eq CreateEventIntegrationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateEventIntegrationResponse
-> CreateEventIntegrationResponse -> Bool
$c/= :: CreateEventIntegrationResponse
-> CreateEventIntegrationResponse -> Bool
== :: CreateEventIntegrationResponse
-> CreateEventIntegrationResponse -> Bool
$c== :: CreateEventIntegrationResponse
-> CreateEventIntegrationResponse -> Bool
Prelude.Eq, ReadPrec [CreateEventIntegrationResponse]
ReadPrec CreateEventIntegrationResponse
Int -> ReadS CreateEventIntegrationResponse
ReadS [CreateEventIntegrationResponse]
(Int -> ReadS CreateEventIntegrationResponse)
-> ReadS [CreateEventIntegrationResponse]
-> ReadPrec CreateEventIntegrationResponse
-> ReadPrec [CreateEventIntegrationResponse]
-> Read CreateEventIntegrationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateEventIntegrationResponse]
$creadListPrec :: ReadPrec [CreateEventIntegrationResponse]
readPrec :: ReadPrec CreateEventIntegrationResponse
$creadPrec :: ReadPrec CreateEventIntegrationResponse
readList :: ReadS [CreateEventIntegrationResponse]
$creadList :: ReadS [CreateEventIntegrationResponse]
readsPrec :: Int -> ReadS CreateEventIntegrationResponse
$creadsPrec :: Int -> ReadS CreateEventIntegrationResponse
Prelude.Read, Int -> CreateEventIntegrationResponse -> ShowS
[CreateEventIntegrationResponse] -> ShowS
CreateEventIntegrationResponse -> String
(Int -> CreateEventIntegrationResponse -> ShowS)
-> (CreateEventIntegrationResponse -> String)
-> ([CreateEventIntegrationResponse] -> ShowS)
-> Show CreateEventIntegrationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateEventIntegrationResponse] -> ShowS
$cshowList :: [CreateEventIntegrationResponse] -> ShowS
show :: CreateEventIntegrationResponse -> String
$cshow :: CreateEventIntegrationResponse -> String
showsPrec :: Int -> CreateEventIntegrationResponse -> ShowS
$cshowsPrec :: Int -> CreateEventIntegrationResponse -> ShowS
Prelude.Show, (forall x.
 CreateEventIntegrationResponse
 -> Rep CreateEventIntegrationResponse x)
-> (forall x.
    Rep CreateEventIntegrationResponse x
    -> CreateEventIntegrationResponse)
-> Generic CreateEventIntegrationResponse
forall x.
Rep CreateEventIntegrationResponse x
-> CreateEventIntegrationResponse
forall x.
CreateEventIntegrationResponse
-> Rep CreateEventIntegrationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateEventIntegrationResponse x
-> CreateEventIntegrationResponse
$cfrom :: forall x.
CreateEventIntegrationResponse
-> Rep CreateEventIntegrationResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateEventIntegrationResponse' 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:
--
-- 'eventIntegrationArn', 'createEventIntegrationResponse_eventIntegrationArn' - The Amazon Resource Name (ARN) of the event integration.
--
-- 'httpStatus', 'createEventIntegrationResponse_httpStatus' - The response's http status code.
newCreateEventIntegrationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateEventIntegrationResponse
newCreateEventIntegrationResponse :: Int -> CreateEventIntegrationResponse
newCreateEventIntegrationResponse Int
pHttpStatus_ =
  CreateEventIntegrationResponse' :: Maybe Text -> Int -> CreateEventIntegrationResponse
CreateEventIntegrationResponse'
    { $sel:eventIntegrationArn:CreateEventIntegrationResponse' :: Maybe Text
eventIntegrationArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateEventIntegrationResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) of the event integration.
createEventIntegrationResponse_eventIntegrationArn :: Lens.Lens' CreateEventIntegrationResponse (Prelude.Maybe Prelude.Text)
createEventIntegrationResponse_eventIntegrationArn :: (Maybe Text -> f (Maybe Text))
-> CreateEventIntegrationResponse
-> f CreateEventIntegrationResponse
createEventIntegrationResponse_eventIntegrationArn = (CreateEventIntegrationResponse -> Maybe Text)
-> (CreateEventIntegrationResponse
    -> Maybe Text -> CreateEventIntegrationResponse)
-> Lens
     CreateEventIntegrationResponse
     CreateEventIntegrationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateEventIntegrationResponse' {Maybe Text
eventIntegrationArn :: Maybe Text
$sel:eventIntegrationArn:CreateEventIntegrationResponse' :: CreateEventIntegrationResponse -> Maybe Text
eventIntegrationArn} -> Maybe Text
eventIntegrationArn) (\s :: CreateEventIntegrationResponse
s@CreateEventIntegrationResponse' {} Maybe Text
a -> CreateEventIntegrationResponse
s {$sel:eventIntegrationArn:CreateEventIntegrationResponse' :: Maybe Text
eventIntegrationArn = Maybe Text
a} :: CreateEventIntegrationResponse)

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

instance
  Prelude.NFData
    CreateEventIntegrationResponse