{-# 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.SMS.Types.NotificationContext
-- 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.SMS.Types.NotificationContext where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SMS.Types.ValidationStatus

-- | Contains the status of validating an application.
--
-- /See:/ 'newNotificationContext' smart constructor.
data NotificationContext = NotificationContext'
  { -- | The status of the validation.
    NotificationContext -> Maybe ValidationStatus
status :: Prelude.Maybe ValidationStatus,
    -- | The status message.
    NotificationContext -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text,
    -- | The ID of the validation.
    NotificationContext -> Maybe Text
validationId :: Prelude.Maybe Prelude.Text
  }
  deriving (NotificationContext -> NotificationContext -> Bool
(NotificationContext -> NotificationContext -> Bool)
-> (NotificationContext -> NotificationContext -> Bool)
-> Eq NotificationContext
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NotificationContext -> NotificationContext -> Bool
$c/= :: NotificationContext -> NotificationContext -> Bool
== :: NotificationContext -> NotificationContext -> Bool
$c== :: NotificationContext -> NotificationContext -> Bool
Prelude.Eq, ReadPrec [NotificationContext]
ReadPrec NotificationContext
Int -> ReadS NotificationContext
ReadS [NotificationContext]
(Int -> ReadS NotificationContext)
-> ReadS [NotificationContext]
-> ReadPrec NotificationContext
-> ReadPrec [NotificationContext]
-> Read NotificationContext
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NotificationContext]
$creadListPrec :: ReadPrec [NotificationContext]
readPrec :: ReadPrec NotificationContext
$creadPrec :: ReadPrec NotificationContext
readList :: ReadS [NotificationContext]
$creadList :: ReadS [NotificationContext]
readsPrec :: Int -> ReadS NotificationContext
$creadsPrec :: Int -> ReadS NotificationContext
Prelude.Read, Int -> NotificationContext -> ShowS
[NotificationContext] -> ShowS
NotificationContext -> String
(Int -> NotificationContext -> ShowS)
-> (NotificationContext -> String)
-> ([NotificationContext] -> ShowS)
-> Show NotificationContext
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NotificationContext] -> ShowS
$cshowList :: [NotificationContext] -> ShowS
show :: NotificationContext -> String
$cshow :: NotificationContext -> String
showsPrec :: Int -> NotificationContext -> ShowS
$cshowsPrec :: Int -> NotificationContext -> ShowS
Prelude.Show, (forall x. NotificationContext -> Rep NotificationContext x)
-> (forall x. Rep NotificationContext x -> NotificationContext)
-> Generic NotificationContext
forall x. Rep NotificationContext x -> NotificationContext
forall x. NotificationContext -> Rep NotificationContext x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NotificationContext x -> NotificationContext
$cfrom :: forall x. NotificationContext -> Rep NotificationContext x
Prelude.Generic)

-- |
-- Create a value of 'NotificationContext' 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:
--
-- 'status', 'notificationContext_status' - The status of the validation.
--
-- 'statusMessage', 'notificationContext_statusMessage' - The status message.
--
-- 'validationId', 'notificationContext_validationId' - The ID of the validation.
newNotificationContext ::
  NotificationContext
newNotificationContext :: NotificationContext
newNotificationContext =
  NotificationContext' :: Maybe ValidationStatus
-> Maybe Text -> Maybe Text -> NotificationContext
NotificationContext'
    { $sel:status:NotificationContext' :: Maybe ValidationStatus
status = Maybe ValidationStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:statusMessage:NotificationContext' :: Maybe Text
statusMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:validationId:NotificationContext' :: Maybe Text
validationId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the validation.
notificationContext_status :: Lens.Lens' NotificationContext (Prelude.Maybe ValidationStatus)
notificationContext_status :: (Maybe ValidationStatus -> f (Maybe ValidationStatus))
-> NotificationContext -> f NotificationContext
notificationContext_status = (NotificationContext -> Maybe ValidationStatus)
-> (NotificationContext
    -> Maybe ValidationStatus -> NotificationContext)
-> Lens
     NotificationContext
     NotificationContext
     (Maybe ValidationStatus)
     (Maybe ValidationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotificationContext' {Maybe ValidationStatus
status :: Maybe ValidationStatus
$sel:status:NotificationContext' :: NotificationContext -> Maybe ValidationStatus
status} -> Maybe ValidationStatus
status) (\s :: NotificationContext
s@NotificationContext' {} Maybe ValidationStatus
a -> NotificationContext
s {$sel:status:NotificationContext' :: Maybe ValidationStatus
status = Maybe ValidationStatus
a} :: NotificationContext)

-- | The status message.
notificationContext_statusMessage :: Lens.Lens' NotificationContext (Prelude.Maybe Prelude.Text)
notificationContext_statusMessage :: (Maybe Text -> f (Maybe Text))
-> NotificationContext -> f NotificationContext
notificationContext_statusMessage = (NotificationContext -> Maybe Text)
-> (NotificationContext -> Maybe Text -> NotificationContext)
-> Lens
     NotificationContext NotificationContext (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotificationContext' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:NotificationContext' :: NotificationContext -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: NotificationContext
s@NotificationContext' {} Maybe Text
a -> NotificationContext
s {$sel:statusMessage:NotificationContext' :: Maybe Text
statusMessage = Maybe Text
a} :: NotificationContext)

-- | The ID of the validation.
notificationContext_validationId :: Lens.Lens' NotificationContext (Prelude.Maybe Prelude.Text)
notificationContext_validationId :: (Maybe Text -> f (Maybe Text))
-> NotificationContext -> f NotificationContext
notificationContext_validationId = (NotificationContext -> Maybe Text)
-> (NotificationContext -> Maybe Text -> NotificationContext)
-> Lens
     NotificationContext NotificationContext (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotificationContext' {Maybe Text
validationId :: Maybe Text
$sel:validationId:NotificationContext' :: NotificationContext -> Maybe Text
validationId} -> Maybe Text
validationId) (\s :: NotificationContext
s@NotificationContext' {} Maybe Text
a -> NotificationContext
s {$sel:validationId:NotificationContext' :: Maybe Text
validationId = Maybe Text
a} :: NotificationContext)

instance Prelude.Hashable NotificationContext

instance Prelude.NFData NotificationContext

instance Core.ToJSON NotificationContext where
  toJSON :: NotificationContext -> Value
toJSON NotificationContext' {Maybe Text
Maybe ValidationStatus
validationId :: Maybe Text
statusMessage :: Maybe Text
status :: Maybe ValidationStatus
$sel:validationId:NotificationContext' :: NotificationContext -> Maybe Text
$sel:statusMessage:NotificationContext' :: NotificationContext -> Maybe Text
$sel:status:NotificationContext' :: NotificationContext -> Maybe ValidationStatus
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"status" Text -> ValidationStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ValidationStatus -> Pair) -> Maybe ValidationStatus -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ValidationStatus
status,
            (Text
"statusMessage" 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
statusMessage,
            (Text
"validationId" 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
validationId
          ]
      )