{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

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

-- |
-- Module      : Amazonka.CognitoIdentityProvider.Types.AnalyticsMetadataType
-- 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)
module Amazonka.CognitoIdentityProvider.Types.AnalyticsMetadataType where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | An Amazon Pinpoint analytics endpoint.
--
-- An endpoint uniquely identifies a mobile device, email address, or phone
-- number that can receive messages from Amazon Pinpoint analytics.
--
-- Cognito User Pools only supports sending events to Amazon Pinpoint
-- projects in the US East (N. Virginia) us-east-1 Region, regardless of
-- the region in which the user pool resides.
--
-- /See:/ 'newAnalyticsMetadataType' smart constructor.
data AnalyticsMetadataType = AnalyticsMetadataType'
  { -- | The endpoint ID.
    AnalyticsMetadataType -> Maybe Text
analyticsEndpointId :: Prelude.Maybe Prelude.Text
  }
  deriving (AnalyticsMetadataType -> AnalyticsMetadataType -> Bool
(AnalyticsMetadataType -> AnalyticsMetadataType -> Bool)
-> (AnalyticsMetadataType -> AnalyticsMetadataType -> Bool)
-> Eq AnalyticsMetadataType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AnalyticsMetadataType -> AnalyticsMetadataType -> Bool
$c/= :: AnalyticsMetadataType -> AnalyticsMetadataType -> Bool
== :: AnalyticsMetadataType -> AnalyticsMetadataType -> Bool
$c== :: AnalyticsMetadataType -> AnalyticsMetadataType -> Bool
Prelude.Eq, ReadPrec [AnalyticsMetadataType]
ReadPrec AnalyticsMetadataType
Int -> ReadS AnalyticsMetadataType
ReadS [AnalyticsMetadataType]
(Int -> ReadS AnalyticsMetadataType)
-> ReadS [AnalyticsMetadataType]
-> ReadPrec AnalyticsMetadataType
-> ReadPrec [AnalyticsMetadataType]
-> Read AnalyticsMetadataType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AnalyticsMetadataType]
$creadListPrec :: ReadPrec [AnalyticsMetadataType]
readPrec :: ReadPrec AnalyticsMetadataType
$creadPrec :: ReadPrec AnalyticsMetadataType
readList :: ReadS [AnalyticsMetadataType]
$creadList :: ReadS [AnalyticsMetadataType]
readsPrec :: Int -> ReadS AnalyticsMetadataType
$creadsPrec :: Int -> ReadS AnalyticsMetadataType
Prelude.Read, Int -> AnalyticsMetadataType -> ShowS
[AnalyticsMetadataType] -> ShowS
AnalyticsMetadataType -> String
(Int -> AnalyticsMetadataType -> ShowS)
-> (AnalyticsMetadataType -> String)
-> ([AnalyticsMetadataType] -> ShowS)
-> Show AnalyticsMetadataType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AnalyticsMetadataType] -> ShowS
$cshowList :: [AnalyticsMetadataType] -> ShowS
show :: AnalyticsMetadataType -> String
$cshow :: AnalyticsMetadataType -> String
showsPrec :: Int -> AnalyticsMetadataType -> ShowS
$cshowsPrec :: Int -> AnalyticsMetadataType -> ShowS
Prelude.Show, (forall x. AnalyticsMetadataType -> Rep AnalyticsMetadataType x)
-> (forall x. Rep AnalyticsMetadataType x -> AnalyticsMetadataType)
-> Generic AnalyticsMetadataType
forall x. Rep AnalyticsMetadataType x -> AnalyticsMetadataType
forall x. AnalyticsMetadataType -> Rep AnalyticsMetadataType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AnalyticsMetadataType x -> AnalyticsMetadataType
$cfrom :: forall x. AnalyticsMetadataType -> Rep AnalyticsMetadataType x
Prelude.Generic)

-- |
-- Create a value of 'AnalyticsMetadataType' 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:
--
-- 'analyticsEndpointId', 'analyticsMetadataType_analyticsEndpointId' - The endpoint ID.
newAnalyticsMetadataType ::
  AnalyticsMetadataType
newAnalyticsMetadataType :: AnalyticsMetadataType
newAnalyticsMetadataType =
  AnalyticsMetadataType' :: Maybe Text -> AnalyticsMetadataType
AnalyticsMetadataType'
    { $sel:analyticsEndpointId:AnalyticsMetadataType' :: Maybe Text
analyticsEndpointId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The endpoint ID.
analyticsMetadataType_analyticsEndpointId :: Lens.Lens' AnalyticsMetadataType (Prelude.Maybe Prelude.Text)
analyticsMetadataType_analyticsEndpointId :: (Maybe Text -> f (Maybe Text))
-> AnalyticsMetadataType -> f AnalyticsMetadataType
analyticsMetadataType_analyticsEndpointId = (AnalyticsMetadataType -> Maybe Text)
-> (AnalyticsMetadataType -> Maybe Text -> AnalyticsMetadataType)
-> Lens
     AnalyticsMetadataType
     AnalyticsMetadataType
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalyticsMetadataType' {Maybe Text
analyticsEndpointId :: Maybe Text
$sel:analyticsEndpointId:AnalyticsMetadataType' :: AnalyticsMetadataType -> Maybe Text
analyticsEndpointId} -> Maybe Text
analyticsEndpointId) (\s :: AnalyticsMetadataType
s@AnalyticsMetadataType' {} Maybe Text
a -> AnalyticsMetadataType
s {$sel:analyticsEndpointId:AnalyticsMetadataType' :: Maybe Text
analyticsEndpointId = Maybe Text
a} :: AnalyticsMetadataType)

instance Prelude.Hashable AnalyticsMetadataType

instance Prelude.NFData AnalyticsMetadataType

instance Core.ToJSON AnalyticsMetadataType where
  toJSON :: AnalyticsMetadataType -> Value
toJSON AnalyticsMetadataType' {Maybe Text
analyticsEndpointId :: Maybe Text
$sel:analyticsEndpointId:AnalyticsMetadataType' :: AnalyticsMetadataType -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"AnalyticsEndpointId" 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
analyticsEndpointId
          ]
      )