{-# 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.FraudDetector.SendEvent
-- 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)
--
-- Stores events in Amazon Fraud Detector without generating fraud
-- predictions for those events. For example, you can use @SendEvent@ to
-- upload a historical dataset, which you can then later use to train a
-- model.
module Amazonka.FraudDetector.SendEvent
  ( -- * Creating a Request
    SendEvent (..),
    newSendEvent,

    -- * Request Lenses
    sendEvent_labelTimestamp,
    sendEvent_assignedLabel,
    sendEvent_eventId,
    sendEvent_eventTypeName,
    sendEvent_eventTimestamp,
    sendEvent_eventVariables,
    sendEvent_entities,

    -- * Destructuring the Response
    SendEventResponse (..),
    newSendEventResponse,

    -- * Response Lenses
    sendEventResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.FraudDetector.Types
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:/ 'newSendEvent' smart constructor.
data SendEvent = SendEvent'
  { -- | The timestamp associated with the label. Required if specifying
    -- @assignedLabel@.
    SendEvent -> Maybe Text
labelTimestamp :: Prelude.Maybe Prelude.Text,
    -- | The label to associate with the event. Required if specifying
    -- @labelTimestamp@.
    SendEvent -> Maybe Text
assignedLabel :: Prelude.Maybe Prelude.Text,
    -- | The event ID to upload.
    SendEvent -> Text
eventId :: Prelude.Text,
    -- | The event type name of the event.
    SendEvent -> Text
eventTypeName :: Prelude.Text,
    -- | The timestamp that defines when the event under evaluation occurred. The
    -- timestamp must be specified using ISO 8601 standard in UTC.
    SendEvent -> Text
eventTimestamp :: Prelude.Text,
    -- | Names of the event type\'s variables you defined in Amazon Fraud
    -- Detector to represent data elements and their corresponding values for
    -- the event you are sending for evaluation.
    SendEvent -> HashMap Text (Sensitive Text)
eventVariables :: Prelude.HashMap Prelude.Text (Core.Sensitive Prelude.Text),
    -- | An array of entities.
    SendEvent -> [Sensitive Entity]
entities :: [Core.Sensitive Entity]
  }
  deriving (SendEvent -> SendEvent -> Bool
(SendEvent -> SendEvent -> Bool)
-> (SendEvent -> SendEvent -> Bool) -> Eq SendEvent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SendEvent -> SendEvent -> Bool
$c/= :: SendEvent -> SendEvent -> Bool
== :: SendEvent -> SendEvent -> Bool
$c== :: SendEvent -> SendEvent -> Bool
Prelude.Eq, Int -> SendEvent -> ShowS
[SendEvent] -> ShowS
SendEvent -> String
(Int -> SendEvent -> ShowS)
-> (SendEvent -> String)
-> ([SendEvent] -> ShowS)
-> Show SendEvent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SendEvent] -> ShowS
$cshowList :: [SendEvent] -> ShowS
show :: SendEvent -> String
$cshow :: SendEvent -> String
showsPrec :: Int -> SendEvent -> ShowS
$cshowsPrec :: Int -> SendEvent -> ShowS
Prelude.Show, (forall x. SendEvent -> Rep SendEvent x)
-> (forall x. Rep SendEvent x -> SendEvent) -> Generic SendEvent
forall x. Rep SendEvent x -> SendEvent
forall x. SendEvent -> Rep SendEvent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SendEvent x -> SendEvent
$cfrom :: forall x. SendEvent -> Rep SendEvent x
Prelude.Generic)

-- |
-- Create a value of 'SendEvent' 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:
--
-- 'labelTimestamp', 'sendEvent_labelTimestamp' - The timestamp associated with the label. Required if specifying
-- @assignedLabel@.
--
-- 'assignedLabel', 'sendEvent_assignedLabel' - The label to associate with the event. Required if specifying
-- @labelTimestamp@.
--
-- 'eventId', 'sendEvent_eventId' - The event ID to upload.
--
-- 'eventTypeName', 'sendEvent_eventTypeName' - The event type name of the event.
--
-- 'eventTimestamp', 'sendEvent_eventTimestamp' - The timestamp that defines when the event under evaluation occurred. The
-- timestamp must be specified using ISO 8601 standard in UTC.
--
-- 'eventVariables', 'sendEvent_eventVariables' - Names of the event type\'s variables you defined in Amazon Fraud
-- Detector to represent data elements and their corresponding values for
-- the event you are sending for evaluation.
--
-- 'entities', 'sendEvent_entities' - An array of entities.
newSendEvent ::
  -- | 'eventId'
  Prelude.Text ->
  -- | 'eventTypeName'
  Prelude.Text ->
  -- | 'eventTimestamp'
  Prelude.Text ->
  SendEvent
newSendEvent :: Text -> Text -> Text -> SendEvent
newSendEvent
  Text
pEventId_
  Text
pEventTypeName_
  Text
pEventTimestamp_ =
    SendEvent' :: Maybe Text
-> Maybe Text
-> Text
-> Text
-> Text
-> HashMap Text (Sensitive Text)
-> [Sensitive Entity]
-> SendEvent
SendEvent'
      { $sel:labelTimestamp:SendEvent' :: Maybe Text
labelTimestamp = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:assignedLabel:SendEvent' :: Maybe Text
assignedLabel = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:eventId:SendEvent' :: Text
eventId = Text
pEventId_,
        $sel:eventTypeName:SendEvent' :: Text
eventTypeName = Text
pEventTypeName_,
        $sel:eventTimestamp:SendEvent' :: Text
eventTimestamp = Text
pEventTimestamp_,
        $sel:eventVariables:SendEvent' :: HashMap Text (Sensitive Text)
eventVariables = HashMap Text (Sensitive Text)
forall a. Monoid a => a
Prelude.mempty,
        $sel:entities:SendEvent' :: [Sensitive Entity]
entities = [Sensitive Entity]
forall a. Monoid a => a
Prelude.mempty
      }

-- | The timestamp associated with the label. Required if specifying
-- @assignedLabel@.
sendEvent_labelTimestamp :: Lens.Lens' SendEvent (Prelude.Maybe Prelude.Text)
sendEvent_labelTimestamp :: (Maybe Text -> f (Maybe Text)) -> SendEvent -> f SendEvent
sendEvent_labelTimestamp = (SendEvent -> Maybe Text)
-> (SendEvent -> Maybe Text -> SendEvent)
-> Lens SendEvent SendEvent (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendEvent' {Maybe Text
labelTimestamp :: Maybe Text
$sel:labelTimestamp:SendEvent' :: SendEvent -> Maybe Text
labelTimestamp} -> Maybe Text
labelTimestamp) (\s :: SendEvent
s@SendEvent' {} Maybe Text
a -> SendEvent
s {$sel:labelTimestamp:SendEvent' :: Maybe Text
labelTimestamp = Maybe Text
a} :: SendEvent)

-- | The label to associate with the event. Required if specifying
-- @labelTimestamp@.
sendEvent_assignedLabel :: Lens.Lens' SendEvent (Prelude.Maybe Prelude.Text)
sendEvent_assignedLabel :: (Maybe Text -> f (Maybe Text)) -> SendEvent -> f SendEvent
sendEvent_assignedLabel = (SendEvent -> Maybe Text)
-> (SendEvent -> Maybe Text -> SendEvent)
-> Lens SendEvent SendEvent (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendEvent' {Maybe Text
assignedLabel :: Maybe Text
$sel:assignedLabel:SendEvent' :: SendEvent -> Maybe Text
assignedLabel} -> Maybe Text
assignedLabel) (\s :: SendEvent
s@SendEvent' {} Maybe Text
a -> SendEvent
s {$sel:assignedLabel:SendEvent' :: Maybe Text
assignedLabel = Maybe Text
a} :: SendEvent)

-- | The event ID to upload.
sendEvent_eventId :: Lens.Lens' SendEvent Prelude.Text
sendEvent_eventId :: (Text -> f Text) -> SendEvent -> f SendEvent
sendEvent_eventId = (SendEvent -> Text)
-> (SendEvent -> Text -> SendEvent)
-> Lens SendEvent SendEvent Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendEvent' {Text
eventId :: Text
$sel:eventId:SendEvent' :: SendEvent -> Text
eventId} -> Text
eventId) (\s :: SendEvent
s@SendEvent' {} Text
a -> SendEvent
s {$sel:eventId:SendEvent' :: Text
eventId = Text
a} :: SendEvent)

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

-- | The timestamp that defines when the event under evaluation occurred. The
-- timestamp must be specified using ISO 8601 standard in UTC.
sendEvent_eventTimestamp :: Lens.Lens' SendEvent Prelude.Text
sendEvent_eventTimestamp :: (Text -> f Text) -> SendEvent -> f SendEvent
sendEvent_eventTimestamp = (SendEvent -> Text)
-> (SendEvent -> Text -> SendEvent)
-> Lens SendEvent SendEvent Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendEvent' {Text
eventTimestamp :: Text
$sel:eventTimestamp:SendEvent' :: SendEvent -> Text
eventTimestamp} -> Text
eventTimestamp) (\s :: SendEvent
s@SendEvent' {} Text
a -> SendEvent
s {$sel:eventTimestamp:SendEvent' :: Text
eventTimestamp = Text
a} :: SendEvent)

-- | Names of the event type\'s variables you defined in Amazon Fraud
-- Detector to represent data elements and their corresponding values for
-- the event you are sending for evaluation.
sendEvent_eventVariables :: Lens.Lens' SendEvent (Prelude.HashMap Prelude.Text Prelude.Text)
sendEvent_eventVariables :: (HashMap Text Text -> f (HashMap Text Text))
-> SendEvent -> f SendEvent
sendEvent_eventVariables = (SendEvent -> HashMap Text (Sensitive Text))
-> (SendEvent -> HashMap Text (Sensitive Text) -> SendEvent)
-> Lens
     SendEvent
     SendEvent
     (HashMap Text (Sensitive Text))
     (HashMap Text (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendEvent' {HashMap Text (Sensitive Text)
eventVariables :: HashMap Text (Sensitive Text)
$sel:eventVariables:SendEvent' :: SendEvent -> HashMap Text (Sensitive Text)
eventVariables} -> HashMap Text (Sensitive Text)
eventVariables) (\s :: SendEvent
s@SendEvent' {} HashMap Text (Sensitive Text)
a -> SendEvent
s {$sel:eventVariables:SendEvent' :: HashMap Text (Sensitive Text)
eventVariables = HashMap Text (Sensitive Text)
a} :: SendEvent) ((HashMap Text (Sensitive Text)
  -> f (HashMap Text (Sensitive Text)))
 -> SendEvent -> f SendEvent)
-> ((HashMap Text Text -> f (HashMap Text Text))
    -> HashMap Text (Sensitive Text)
    -> f (HashMap Text (Sensitive Text)))
-> (HashMap Text Text -> f (HashMap Text Text))
-> SendEvent
-> f SendEvent
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (HashMap Text Text -> f (HashMap Text Text))
-> HashMap Text (Sensitive Text)
-> f (HashMap Text (Sensitive Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An array of entities.
sendEvent_entities :: Lens.Lens' SendEvent [Entity]
sendEvent_entities :: ([Entity] -> f [Entity]) -> SendEvent -> f SendEvent
sendEvent_entities = (SendEvent -> [Sensitive Entity])
-> (SendEvent -> [Sensitive Entity] -> SendEvent)
-> Lens SendEvent SendEvent [Sensitive Entity] [Sensitive Entity]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SendEvent' {[Sensitive Entity]
entities :: [Sensitive Entity]
$sel:entities:SendEvent' :: SendEvent -> [Sensitive Entity]
entities} -> [Sensitive Entity]
entities) (\s :: SendEvent
s@SendEvent' {} [Sensitive Entity]
a -> SendEvent
s {$sel:entities:SendEvent' :: [Sensitive Entity]
entities = [Sensitive Entity]
a} :: SendEvent) (([Sensitive Entity] -> f [Sensitive Entity])
 -> SendEvent -> f SendEvent)
-> (([Entity] -> f [Entity])
    -> [Sensitive Entity] -> f [Sensitive Entity])
-> ([Entity] -> f [Entity])
-> SendEvent
-> f SendEvent
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Entity] -> f [Entity])
-> [Sensitive Entity] -> f [Sensitive Entity]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest SendEvent where
  type AWSResponse SendEvent = SendEventResponse
  request :: SendEvent -> Request SendEvent
request = Service -> SendEvent -> Request SendEvent
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy SendEvent
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SendEvent)))
response =
    (Int
 -> ResponseHeaders -> () -> Either String (AWSResponse SendEvent))
-> Logger
-> Service
-> Proxy SendEvent
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse SendEvent)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> SendEventResponse
SendEventResponse'
            (Int -> SendEventResponse)
-> Either String Int -> Either String SendEventResponse
forall (f :: * -> *) a b. Functor 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 SendEvent

instance Prelude.NFData SendEvent

instance Core.ToHeaders SendEvent where
  toHeaders :: SendEvent -> ResponseHeaders
toHeaders =
    ResponseHeaders -> SendEvent -> 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
"AWSHawksNestServiceFacade.SendEvent" ::
                          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 SendEvent where
  toJSON :: SendEvent -> Value
toJSON SendEvent' {[Sensitive Entity]
Maybe Text
Text
HashMap Text (Sensitive Text)
entities :: [Sensitive Entity]
eventVariables :: HashMap Text (Sensitive Text)
eventTimestamp :: Text
eventTypeName :: Text
eventId :: Text
assignedLabel :: Maybe Text
labelTimestamp :: Maybe Text
$sel:entities:SendEvent' :: SendEvent -> [Sensitive Entity]
$sel:eventVariables:SendEvent' :: SendEvent -> HashMap Text (Sensitive Text)
$sel:eventTimestamp:SendEvent' :: SendEvent -> Text
$sel:eventTypeName:SendEvent' :: SendEvent -> Text
$sel:eventId:SendEvent' :: SendEvent -> Text
$sel:assignedLabel:SendEvent' :: SendEvent -> Maybe Text
$sel:labelTimestamp:SendEvent' :: SendEvent -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"labelTimestamp" 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
labelTimestamp,
            (Text
"assignedLabel" 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
assignedLabel,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"eventId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
eventId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"eventTypeName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
eventTypeName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"eventTimestamp" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
eventTimestamp),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"eventVariables" Text -> HashMap Text (Sensitive Text) -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= HashMap Text (Sensitive Text)
eventVariables),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"entities" Text -> [Sensitive Entity] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Sensitive Entity]
entities)
          ]
      )

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

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

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

-- |
-- Create a value of 'SendEventResponse' 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:
--
-- 'httpStatus', 'sendEventResponse_httpStatus' - The response's http status code.
newSendEventResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  SendEventResponse
newSendEventResponse :: Int -> SendEventResponse
newSendEventResponse Int
pHttpStatus_ =
  SendEventResponse' :: Int -> SendEventResponse
SendEventResponse' {$sel:httpStatus:SendEventResponse' :: Int
httpStatus = Int
pHttpStatus_}

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

instance Prelude.NFData SendEventResponse