{-# 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.CodeCommit.Types.ReactionValueFormats
-- 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.CodeCommit.Types.ReactionValueFormats where

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

-- | Information about the values for reactions to a comment. AWS CodeCommit
-- supports a limited set of reactions.
--
-- /See:/ 'newReactionValueFormats' smart constructor.
data ReactionValueFormats = ReactionValueFormats'
  { -- | The Emoji Version 1.0 graphic of the reaction. These graphics are
    -- interpreted slightly differently on different operating systems.
    ReactionValueFormats -> Maybe Text
emoji :: Prelude.Maybe Prelude.Text,
    -- | The emoji short code for the reaction. Short codes are interpreted
    -- slightly differently on different operating systems.
    ReactionValueFormats -> Maybe Text
shortCode :: Prelude.Maybe Prelude.Text,
    -- | The Unicode codepoint for the reaction.
    ReactionValueFormats -> Maybe Text
unicode :: Prelude.Maybe Prelude.Text
  }
  deriving (ReactionValueFormats -> ReactionValueFormats -> Bool
(ReactionValueFormats -> ReactionValueFormats -> Bool)
-> (ReactionValueFormats -> ReactionValueFormats -> Bool)
-> Eq ReactionValueFormats
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReactionValueFormats -> ReactionValueFormats -> Bool
$c/= :: ReactionValueFormats -> ReactionValueFormats -> Bool
== :: ReactionValueFormats -> ReactionValueFormats -> Bool
$c== :: ReactionValueFormats -> ReactionValueFormats -> Bool
Prelude.Eq, ReadPrec [ReactionValueFormats]
ReadPrec ReactionValueFormats
Int -> ReadS ReactionValueFormats
ReadS [ReactionValueFormats]
(Int -> ReadS ReactionValueFormats)
-> ReadS [ReactionValueFormats]
-> ReadPrec ReactionValueFormats
-> ReadPrec [ReactionValueFormats]
-> Read ReactionValueFormats
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReactionValueFormats]
$creadListPrec :: ReadPrec [ReactionValueFormats]
readPrec :: ReadPrec ReactionValueFormats
$creadPrec :: ReadPrec ReactionValueFormats
readList :: ReadS [ReactionValueFormats]
$creadList :: ReadS [ReactionValueFormats]
readsPrec :: Int -> ReadS ReactionValueFormats
$creadsPrec :: Int -> ReadS ReactionValueFormats
Prelude.Read, Int -> ReactionValueFormats -> ShowS
[ReactionValueFormats] -> ShowS
ReactionValueFormats -> String
(Int -> ReactionValueFormats -> ShowS)
-> (ReactionValueFormats -> String)
-> ([ReactionValueFormats] -> ShowS)
-> Show ReactionValueFormats
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReactionValueFormats] -> ShowS
$cshowList :: [ReactionValueFormats] -> ShowS
show :: ReactionValueFormats -> String
$cshow :: ReactionValueFormats -> String
showsPrec :: Int -> ReactionValueFormats -> ShowS
$cshowsPrec :: Int -> ReactionValueFormats -> ShowS
Prelude.Show, (forall x. ReactionValueFormats -> Rep ReactionValueFormats x)
-> (forall x. Rep ReactionValueFormats x -> ReactionValueFormats)
-> Generic ReactionValueFormats
forall x. Rep ReactionValueFormats x -> ReactionValueFormats
forall x. ReactionValueFormats -> Rep ReactionValueFormats x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ReactionValueFormats x -> ReactionValueFormats
$cfrom :: forall x. ReactionValueFormats -> Rep ReactionValueFormats x
Prelude.Generic)

-- |
-- Create a value of 'ReactionValueFormats' 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:
--
-- 'emoji', 'reactionValueFormats_emoji' - The Emoji Version 1.0 graphic of the reaction. These graphics are
-- interpreted slightly differently on different operating systems.
--
-- 'shortCode', 'reactionValueFormats_shortCode' - The emoji short code for the reaction. Short codes are interpreted
-- slightly differently on different operating systems.
--
-- 'unicode', 'reactionValueFormats_unicode' - The Unicode codepoint for the reaction.
newReactionValueFormats ::
  ReactionValueFormats
newReactionValueFormats :: ReactionValueFormats
newReactionValueFormats =
  ReactionValueFormats' :: Maybe Text -> Maybe Text -> Maybe Text -> ReactionValueFormats
ReactionValueFormats'
    { $sel:emoji:ReactionValueFormats' :: Maybe Text
emoji = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:shortCode:ReactionValueFormats' :: Maybe Text
shortCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:unicode:ReactionValueFormats' :: Maybe Text
unicode = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The Emoji Version 1.0 graphic of the reaction. These graphics are
-- interpreted slightly differently on different operating systems.
reactionValueFormats_emoji :: Lens.Lens' ReactionValueFormats (Prelude.Maybe Prelude.Text)
reactionValueFormats_emoji :: (Maybe Text -> f (Maybe Text))
-> ReactionValueFormats -> f ReactionValueFormats
reactionValueFormats_emoji = (ReactionValueFormats -> Maybe Text)
-> (ReactionValueFormats -> Maybe Text -> ReactionValueFormats)
-> Lens
     ReactionValueFormats ReactionValueFormats (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReactionValueFormats' {Maybe Text
emoji :: Maybe Text
$sel:emoji:ReactionValueFormats' :: ReactionValueFormats -> Maybe Text
emoji} -> Maybe Text
emoji) (\s :: ReactionValueFormats
s@ReactionValueFormats' {} Maybe Text
a -> ReactionValueFormats
s {$sel:emoji:ReactionValueFormats' :: Maybe Text
emoji = Maybe Text
a} :: ReactionValueFormats)

-- | The emoji short code for the reaction. Short codes are interpreted
-- slightly differently on different operating systems.
reactionValueFormats_shortCode :: Lens.Lens' ReactionValueFormats (Prelude.Maybe Prelude.Text)
reactionValueFormats_shortCode :: (Maybe Text -> f (Maybe Text))
-> ReactionValueFormats -> f ReactionValueFormats
reactionValueFormats_shortCode = (ReactionValueFormats -> Maybe Text)
-> (ReactionValueFormats -> Maybe Text -> ReactionValueFormats)
-> Lens
     ReactionValueFormats ReactionValueFormats (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReactionValueFormats' {Maybe Text
shortCode :: Maybe Text
$sel:shortCode:ReactionValueFormats' :: ReactionValueFormats -> Maybe Text
shortCode} -> Maybe Text
shortCode) (\s :: ReactionValueFormats
s@ReactionValueFormats' {} Maybe Text
a -> ReactionValueFormats
s {$sel:shortCode:ReactionValueFormats' :: Maybe Text
shortCode = Maybe Text
a} :: ReactionValueFormats)

-- | The Unicode codepoint for the reaction.
reactionValueFormats_unicode :: Lens.Lens' ReactionValueFormats (Prelude.Maybe Prelude.Text)
reactionValueFormats_unicode :: (Maybe Text -> f (Maybe Text))
-> ReactionValueFormats -> f ReactionValueFormats
reactionValueFormats_unicode = (ReactionValueFormats -> Maybe Text)
-> (ReactionValueFormats -> Maybe Text -> ReactionValueFormats)
-> Lens
     ReactionValueFormats ReactionValueFormats (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReactionValueFormats' {Maybe Text
unicode :: Maybe Text
$sel:unicode:ReactionValueFormats' :: ReactionValueFormats -> Maybe Text
unicode} -> Maybe Text
unicode) (\s :: ReactionValueFormats
s@ReactionValueFormats' {} Maybe Text
a -> ReactionValueFormats
s {$sel:unicode:ReactionValueFormats' :: Maybe Text
unicode = Maybe Text
a} :: ReactionValueFormats)

instance Core.FromJSON ReactionValueFormats where
  parseJSON :: Value -> Parser ReactionValueFormats
parseJSON =
    String
-> (Object -> Parser ReactionValueFormats)
-> Value
-> Parser ReactionValueFormats
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ReactionValueFormats"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> ReactionValueFormats
ReactionValueFormats'
            (Maybe Text -> Maybe Text -> Maybe Text -> ReactionValueFormats)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> ReactionValueFormats)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"emoji")
            Parser (Maybe Text -> Maybe Text -> ReactionValueFormats)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> ReactionValueFormats)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"shortCode")
            Parser (Maybe Text -> ReactionValueFormats)
-> Parser (Maybe Text) -> Parser ReactionValueFormats
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"unicode")
      )

instance Prelude.Hashable ReactionValueFormats

instance Prelude.NFData ReactionValueFormats