{-# 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.PutEventType
-- 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 or updates an event type. An event is a business activity that
-- is evaluated for fraud risk. With Amazon Fraud Detector, you generate
-- fraud predictions for events. An event type defines the structure for an
-- event sent to Amazon Fraud Detector. This includes the variables sent as
-- part of the event, the entity performing the event (such as a customer),
-- and the labels that classify the event. Example event types include
-- online payment transactions, account registrations, and authentications.
module Amazonka.FraudDetector.PutEventType
  ( -- * Creating a Request
    PutEventType (..),
    newPutEventType,

    -- * Request Lenses
    putEventType_labels,
    putEventType_eventIngestion,
    putEventType_description,
    putEventType_tags,
    putEventType_name,
    putEventType_eventVariables,
    putEventType_entityTypes,

    -- * Destructuring the Response
    PutEventTypeResponse (..),
    newPutEventTypeResponse,

    -- * Response Lenses
    putEventTypeResponse_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:/ 'newPutEventType' smart constructor.
data PutEventType = PutEventType'
  { -- | The event type labels.
    PutEventType -> Maybe [Text]
labels :: Prelude.Maybe [Prelude.Text],
    -- | Specifies if ingenstion is enabled or disabled.
    PutEventType -> Maybe EventIngestion
eventIngestion :: Prelude.Maybe EventIngestion,
    -- | The description of the event type.
    PutEventType -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | A collection of key and value pairs.
    PutEventType -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The name.
    PutEventType -> Text
name :: Prelude.Text,
    -- | The event type variables.
    PutEventType -> NonEmpty Text
eventVariables :: Prelude.NonEmpty Prelude.Text,
    -- | The entity type for the event type. Example entity types: customer,
    -- merchant, account.
    PutEventType -> NonEmpty Text
entityTypes :: Prelude.NonEmpty Prelude.Text
  }
  deriving (PutEventType -> PutEventType -> Bool
(PutEventType -> PutEventType -> Bool)
-> (PutEventType -> PutEventType -> Bool) -> Eq PutEventType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutEventType -> PutEventType -> Bool
$c/= :: PutEventType -> PutEventType -> Bool
== :: PutEventType -> PutEventType -> Bool
$c== :: PutEventType -> PutEventType -> Bool
Prelude.Eq, ReadPrec [PutEventType]
ReadPrec PutEventType
Int -> ReadS PutEventType
ReadS [PutEventType]
(Int -> ReadS PutEventType)
-> ReadS [PutEventType]
-> ReadPrec PutEventType
-> ReadPrec [PutEventType]
-> Read PutEventType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutEventType]
$creadListPrec :: ReadPrec [PutEventType]
readPrec :: ReadPrec PutEventType
$creadPrec :: ReadPrec PutEventType
readList :: ReadS [PutEventType]
$creadList :: ReadS [PutEventType]
readsPrec :: Int -> ReadS PutEventType
$creadsPrec :: Int -> ReadS PutEventType
Prelude.Read, Int -> PutEventType -> ShowS
[PutEventType] -> ShowS
PutEventType -> String
(Int -> PutEventType -> ShowS)
-> (PutEventType -> String)
-> ([PutEventType] -> ShowS)
-> Show PutEventType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutEventType] -> ShowS
$cshowList :: [PutEventType] -> ShowS
show :: PutEventType -> String
$cshow :: PutEventType -> String
showsPrec :: Int -> PutEventType -> ShowS
$cshowsPrec :: Int -> PutEventType -> ShowS
Prelude.Show, (forall x. PutEventType -> Rep PutEventType x)
-> (forall x. Rep PutEventType x -> PutEventType)
-> Generic PutEventType
forall x. Rep PutEventType x -> PutEventType
forall x. PutEventType -> Rep PutEventType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutEventType x -> PutEventType
$cfrom :: forall x. PutEventType -> Rep PutEventType x
Prelude.Generic)

-- |
-- Create a value of 'PutEventType' 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:
--
-- 'labels', 'putEventType_labels' - The event type labels.
--
-- 'eventIngestion', 'putEventType_eventIngestion' - Specifies if ingenstion is enabled or disabled.
--
-- 'description', 'putEventType_description' - The description of the event type.
--
-- 'tags', 'putEventType_tags' - A collection of key and value pairs.
--
-- 'name', 'putEventType_name' - The name.
--
-- 'eventVariables', 'putEventType_eventVariables' - The event type variables.
--
-- 'entityTypes', 'putEventType_entityTypes' - The entity type for the event type. Example entity types: customer,
-- merchant, account.
newPutEventType ::
  -- | 'name'
  Prelude.Text ->
  -- | 'eventVariables'
  Prelude.NonEmpty Prelude.Text ->
  -- | 'entityTypes'
  Prelude.NonEmpty Prelude.Text ->
  PutEventType
newPutEventType :: Text -> NonEmpty Text -> NonEmpty Text -> PutEventType
newPutEventType Text
pName_ NonEmpty Text
pEventVariables_ NonEmpty Text
pEntityTypes_ =
  PutEventType' :: Maybe [Text]
-> Maybe EventIngestion
-> Maybe Text
-> Maybe [Tag]
-> Text
-> NonEmpty Text
-> NonEmpty Text
-> PutEventType
PutEventType'
    { $sel:labels:PutEventType' :: Maybe [Text]
labels = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:eventIngestion:PutEventType' :: Maybe EventIngestion
eventIngestion = Maybe EventIngestion
forall a. Maybe a
Prelude.Nothing,
      $sel:description:PutEventType' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:PutEventType' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:name:PutEventType' :: Text
name = Text
pName_,
      $sel:eventVariables:PutEventType' :: NonEmpty Text
eventVariables =
        Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
 -> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pEventVariables_,
      $sel:entityTypes:PutEventType' :: NonEmpty Text
entityTypes = Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
 -> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pEntityTypes_
    }

-- | The event type labels.
putEventType_labels :: Lens.Lens' PutEventType (Prelude.Maybe [Prelude.Text])
putEventType_labels :: (Maybe [Text] -> f (Maybe [Text]))
-> PutEventType -> f PutEventType
putEventType_labels = (PutEventType -> Maybe [Text])
-> (PutEventType -> Maybe [Text] -> PutEventType)
-> Lens PutEventType PutEventType (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutEventType' {Maybe [Text]
labels :: Maybe [Text]
$sel:labels:PutEventType' :: PutEventType -> Maybe [Text]
labels} -> Maybe [Text]
labels) (\s :: PutEventType
s@PutEventType' {} Maybe [Text]
a -> PutEventType
s {$sel:labels:PutEventType' :: Maybe [Text]
labels = Maybe [Text]
a} :: PutEventType) ((Maybe [Text] -> f (Maybe [Text]))
 -> PutEventType -> f PutEventType)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> PutEventType
-> f PutEventType
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Specifies if ingenstion is enabled or disabled.
putEventType_eventIngestion :: Lens.Lens' PutEventType (Prelude.Maybe EventIngestion)
putEventType_eventIngestion :: (Maybe EventIngestion -> f (Maybe EventIngestion))
-> PutEventType -> f PutEventType
putEventType_eventIngestion = (PutEventType -> Maybe EventIngestion)
-> (PutEventType -> Maybe EventIngestion -> PutEventType)
-> Lens
     PutEventType
     PutEventType
     (Maybe EventIngestion)
     (Maybe EventIngestion)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutEventType' {Maybe EventIngestion
eventIngestion :: Maybe EventIngestion
$sel:eventIngestion:PutEventType' :: PutEventType -> Maybe EventIngestion
eventIngestion} -> Maybe EventIngestion
eventIngestion) (\s :: PutEventType
s@PutEventType' {} Maybe EventIngestion
a -> PutEventType
s {$sel:eventIngestion:PutEventType' :: Maybe EventIngestion
eventIngestion = Maybe EventIngestion
a} :: PutEventType)

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

-- | A collection of key and value pairs.
putEventType_tags :: Lens.Lens' PutEventType (Prelude.Maybe [Tag])
putEventType_tags :: (Maybe [Tag] -> f (Maybe [Tag])) -> PutEventType -> f PutEventType
putEventType_tags = (PutEventType -> Maybe [Tag])
-> (PutEventType -> Maybe [Tag] -> PutEventType)
-> Lens PutEventType PutEventType (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutEventType' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:PutEventType' :: PutEventType -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: PutEventType
s@PutEventType' {} Maybe [Tag]
a -> PutEventType
s {$sel:tags:PutEventType' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: PutEventType) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> PutEventType -> f PutEventType)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> PutEventType
-> f PutEventType
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name.
putEventType_name :: Lens.Lens' PutEventType Prelude.Text
putEventType_name :: (Text -> f Text) -> PutEventType -> f PutEventType
putEventType_name = (PutEventType -> Text)
-> (PutEventType -> Text -> PutEventType)
-> Lens PutEventType PutEventType Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutEventType' {Text
name :: Text
$sel:name:PutEventType' :: PutEventType -> Text
name} -> Text
name) (\s :: PutEventType
s@PutEventType' {} Text
a -> PutEventType
s {$sel:name:PutEventType' :: Text
name = Text
a} :: PutEventType)

-- | The event type variables.
putEventType_eventVariables :: Lens.Lens' PutEventType (Prelude.NonEmpty Prelude.Text)
putEventType_eventVariables :: (NonEmpty Text -> f (NonEmpty Text))
-> PutEventType -> f PutEventType
putEventType_eventVariables = (PutEventType -> NonEmpty Text)
-> (PutEventType -> NonEmpty Text -> PutEventType)
-> Lens PutEventType PutEventType (NonEmpty Text) (NonEmpty Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutEventType' {NonEmpty Text
eventVariables :: NonEmpty Text
$sel:eventVariables:PutEventType' :: PutEventType -> NonEmpty Text
eventVariables} -> NonEmpty Text
eventVariables) (\s :: PutEventType
s@PutEventType' {} NonEmpty Text
a -> PutEventType
s {$sel:eventVariables:PutEventType' :: NonEmpty Text
eventVariables = NonEmpty Text
a} :: PutEventType) ((NonEmpty Text -> f (NonEmpty Text))
 -> PutEventType -> f PutEventType)
-> ((NonEmpty Text -> f (NonEmpty Text))
    -> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> PutEventType
-> f PutEventType
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The entity type for the event type. Example entity types: customer,
-- merchant, account.
putEventType_entityTypes :: Lens.Lens' PutEventType (Prelude.NonEmpty Prelude.Text)
putEventType_entityTypes :: (NonEmpty Text -> f (NonEmpty Text))
-> PutEventType -> f PutEventType
putEventType_entityTypes = (PutEventType -> NonEmpty Text)
-> (PutEventType -> NonEmpty Text -> PutEventType)
-> Lens PutEventType PutEventType (NonEmpty Text) (NonEmpty Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutEventType' {NonEmpty Text
entityTypes :: NonEmpty Text
$sel:entityTypes:PutEventType' :: PutEventType -> NonEmpty Text
entityTypes} -> NonEmpty Text
entityTypes) (\s :: PutEventType
s@PutEventType' {} NonEmpty Text
a -> PutEventType
s {$sel:entityTypes:PutEventType' :: NonEmpty Text
entityTypes = NonEmpty Text
a} :: PutEventType) ((NonEmpty Text -> f (NonEmpty Text))
 -> PutEventType -> f PutEventType)
-> ((NonEmpty Text -> f (NonEmpty Text))
    -> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> PutEventType
-> f PutEventType
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest PutEventType where
  type AWSResponse PutEventType = PutEventTypeResponse
  request :: PutEventType -> Request PutEventType
request = Service -> PutEventType -> Request PutEventType
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy PutEventType
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutEventType)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse PutEventType))
-> Logger
-> Service
-> Proxy PutEventType
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutEventType)))
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 -> PutEventTypeResponse
PutEventTypeResponse'
            (Int -> PutEventTypeResponse)
-> Either String Int -> Either String PutEventTypeResponse
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 PutEventType

instance Prelude.NFData PutEventType

instance Core.ToHeaders PutEventType where
  toHeaders :: PutEventType -> ResponseHeaders
toHeaders =
    ResponseHeaders -> PutEventType -> 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.PutEventType" ::
                          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 PutEventType where
  toJSON :: PutEventType -> Value
toJSON PutEventType' {Maybe [Text]
Maybe [Tag]
Maybe Text
Maybe EventIngestion
NonEmpty Text
Text
entityTypes :: NonEmpty Text
eventVariables :: NonEmpty Text
name :: Text
tags :: Maybe [Tag]
description :: Maybe Text
eventIngestion :: Maybe EventIngestion
labels :: Maybe [Text]
$sel:entityTypes:PutEventType' :: PutEventType -> NonEmpty Text
$sel:eventVariables:PutEventType' :: PutEventType -> NonEmpty Text
$sel:name:PutEventType' :: PutEventType -> Text
$sel:tags:PutEventType' :: PutEventType -> Maybe [Tag]
$sel:description:PutEventType' :: PutEventType -> Maybe Text
$sel:eventIngestion:PutEventType' :: PutEventType -> Maybe EventIngestion
$sel:labels:PutEventType' :: PutEventType -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"labels" 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]
labels,
            (Text
"eventIngestion" Text -> EventIngestion -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (EventIngestion -> Pair) -> Maybe EventIngestion -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EventIngestion
eventIngestion,
            (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 -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
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
"eventVariables" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Text
eventVariables),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"entityTypes" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Text
entityTypes)
          ]
      )

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

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

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

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

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

instance Prelude.NFData PutEventTypeResponse