{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CodeCommit.Types.ReactionValueFormats where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
    { $sel:emoji:ReactionValueFormats' :: Maybe Text
emoji = forall a. Maybe a
Prelude.Nothing,
      $sel:shortCode:ReactionValueFormats' :: Maybe Text
shortCode = forall a. Maybe a
Prelude.Nothing,
      $sel:unicode:ReactionValueFormats' :: Maybe Text
unicode = 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 :: Lens' ReactionValueFormats (Maybe Text)
reactionValueFormats_emoji = 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 :: Lens' ReactionValueFormats (Maybe Text)
reactionValueFormats_shortCode = 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 :: Lens' ReactionValueFormats (Maybe Text)
reactionValueFormats_unicode = 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 Data.FromJSON ReactionValueFormats where
  parseJSON :: Value -> Parser ReactionValueFormats
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ReactionValueFormats"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> ReactionValueFormats
ReactionValueFormats'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"emoji")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"shortCode")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"unicode")
      )

instance Prelude.Hashable ReactionValueFormats where
  hashWithSalt :: Int -> ReactionValueFormats -> Int
hashWithSalt Int
_salt ReactionValueFormats' {Maybe Text
unicode :: Maybe Text
shortCode :: Maybe Text
emoji :: Maybe Text
$sel:unicode:ReactionValueFormats' :: ReactionValueFormats -> Maybe Text
$sel:shortCode:ReactionValueFormats' :: ReactionValueFormats -> Maybe Text
$sel:emoji:ReactionValueFormats' :: ReactionValueFormats -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
emoji
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
shortCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
unicode

instance Prelude.NFData ReactionValueFormats where
  rnf :: ReactionValueFormats -> ()
rnf ReactionValueFormats' {Maybe Text
unicode :: Maybe Text
shortCode :: Maybe Text
emoji :: Maybe Text
$sel:unicode:ReactionValueFormats' :: ReactionValueFormats -> Maybe Text
$sel:shortCode:ReactionValueFormats' :: ReactionValueFormats -> Maybe Text
$sel:emoji:ReactionValueFormats' :: ReactionValueFormats -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
emoji
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
shortCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
unicode