{-# 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.AlexaBusiness.Types.SkillSummary
-- 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.AlexaBusiness.Types.SkillSummary where

import Amazonka.AlexaBusiness.Types.EnablementType
import Amazonka.AlexaBusiness.Types.SkillType
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

-- | The summary of skills.
--
-- /See:/ 'newSkillSummary' smart constructor.
data SkillSummary = SkillSummary'
  { -- | Whether the skill is enabled under the user\'s account, or if it
    -- requires linking to be used.
    SkillSummary -> Maybe EnablementType
enablementType :: Prelude.Maybe EnablementType,
    -- | The ARN of the skill summary.
    SkillSummary -> Maybe Text
skillId :: Prelude.Maybe Prelude.Text,
    -- | The name of the skill.
    SkillSummary -> Maybe Text
skillName :: Prelude.Maybe Prelude.Text,
    -- | Whether the skill is publicly available or is a private skill.
    SkillSummary -> Maybe SkillType
skillType :: Prelude.Maybe SkillType,
    -- | Linking support for a skill.
    SkillSummary -> Maybe Bool
supportsLinking :: Prelude.Maybe Prelude.Bool
  }
  deriving (SkillSummary -> SkillSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SkillSummary -> SkillSummary -> Bool
$c/= :: SkillSummary -> SkillSummary -> Bool
== :: SkillSummary -> SkillSummary -> Bool
$c== :: SkillSummary -> SkillSummary -> Bool
Prelude.Eq, ReadPrec [SkillSummary]
ReadPrec SkillSummary
Int -> ReadS SkillSummary
ReadS [SkillSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SkillSummary]
$creadListPrec :: ReadPrec [SkillSummary]
readPrec :: ReadPrec SkillSummary
$creadPrec :: ReadPrec SkillSummary
readList :: ReadS [SkillSummary]
$creadList :: ReadS [SkillSummary]
readsPrec :: Int -> ReadS SkillSummary
$creadsPrec :: Int -> ReadS SkillSummary
Prelude.Read, Int -> SkillSummary -> ShowS
[SkillSummary] -> ShowS
SkillSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SkillSummary] -> ShowS
$cshowList :: [SkillSummary] -> ShowS
show :: SkillSummary -> String
$cshow :: SkillSummary -> String
showsPrec :: Int -> SkillSummary -> ShowS
$cshowsPrec :: Int -> SkillSummary -> ShowS
Prelude.Show, forall x. Rep SkillSummary x -> SkillSummary
forall x. SkillSummary -> Rep SkillSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SkillSummary x -> SkillSummary
$cfrom :: forall x. SkillSummary -> Rep SkillSummary x
Prelude.Generic)

-- |
-- Create a value of 'SkillSummary' 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:
--
-- 'enablementType', 'skillSummary_enablementType' - Whether the skill is enabled under the user\'s account, or if it
-- requires linking to be used.
--
-- 'skillId', 'skillSummary_skillId' - The ARN of the skill summary.
--
-- 'skillName', 'skillSummary_skillName' - The name of the skill.
--
-- 'skillType', 'skillSummary_skillType' - Whether the skill is publicly available or is a private skill.
--
-- 'supportsLinking', 'skillSummary_supportsLinking' - Linking support for a skill.
newSkillSummary ::
  SkillSummary
newSkillSummary :: SkillSummary
newSkillSummary =
  SkillSummary'
    { $sel:enablementType:SkillSummary' :: Maybe EnablementType
enablementType = forall a. Maybe a
Prelude.Nothing,
      $sel:skillId:SkillSummary' :: Maybe Text
skillId = forall a. Maybe a
Prelude.Nothing,
      $sel:skillName:SkillSummary' :: Maybe Text
skillName = forall a. Maybe a
Prelude.Nothing,
      $sel:skillType:SkillSummary' :: Maybe SkillType
skillType = forall a. Maybe a
Prelude.Nothing,
      $sel:supportsLinking:SkillSummary' :: Maybe Bool
supportsLinking = forall a. Maybe a
Prelude.Nothing
    }

-- | Whether the skill is enabled under the user\'s account, or if it
-- requires linking to be used.
skillSummary_enablementType :: Lens.Lens' SkillSummary (Prelude.Maybe EnablementType)
skillSummary_enablementType :: Lens' SkillSummary (Maybe EnablementType)
skillSummary_enablementType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SkillSummary' {Maybe EnablementType
enablementType :: Maybe EnablementType
$sel:enablementType:SkillSummary' :: SkillSummary -> Maybe EnablementType
enablementType} -> Maybe EnablementType
enablementType) (\s :: SkillSummary
s@SkillSummary' {} Maybe EnablementType
a -> SkillSummary
s {$sel:enablementType:SkillSummary' :: Maybe EnablementType
enablementType = Maybe EnablementType
a} :: SkillSummary)

-- | The ARN of the skill summary.
skillSummary_skillId :: Lens.Lens' SkillSummary (Prelude.Maybe Prelude.Text)
skillSummary_skillId :: Lens' SkillSummary (Maybe Text)
skillSummary_skillId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SkillSummary' {Maybe Text
skillId :: Maybe Text
$sel:skillId:SkillSummary' :: SkillSummary -> Maybe Text
skillId} -> Maybe Text
skillId) (\s :: SkillSummary
s@SkillSummary' {} Maybe Text
a -> SkillSummary
s {$sel:skillId:SkillSummary' :: Maybe Text
skillId = Maybe Text
a} :: SkillSummary)

-- | The name of the skill.
skillSummary_skillName :: Lens.Lens' SkillSummary (Prelude.Maybe Prelude.Text)
skillSummary_skillName :: Lens' SkillSummary (Maybe Text)
skillSummary_skillName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SkillSummary' {Maybe Text
skillName :: Maybe Text
$sel:skillName:SkillSummary' :: SkillSummary -> Maybe Text
skillName} -> Maybe Text
skillName) (\s :: SkillSummary
s@SkillSummary' {} Maybe Text
a -> SkillSummary
s {$sel:skillName:SkillSummary' :: Maybe Text
skillName = Maybe Text
a} :: SkillSummary)

-- | Whether the skill is publicly available or is a private skill.
skillSummary_skillType :: Lens.Lens' SkillSummary (Prelude.Maybe SkillType)
skillSummary_skillType :: Lens' SkillSummary (Maybe SkillType)
skillSummary_skillType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SkillSummary' {Maybe SkillType
skillType :: Maybe SkillType
$sel:skillType:SkillSummary' :: SkillSummary -> Maybe SkillType
skillType} -> Maybe SkillType
skillType) (\s :: SkillSummary
s@SkillSummary' {} Maybe SkillType
a -> SkillSummary
s {$sel:skillType:SkillSummary' :: Maybe SkillType
skillType = Maybe SkillType
a} :: SkillSummary)

-- | Linking support for a skill.
skillSummary_supportsLinking :: Lens.Lens' SkillSummary (Prelude.Maybe Prelude.Bool)
skillSummary_supportsLinking :: Lens' SkillSummary (Maybe Bool)
skillSummary_supportsLinking = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SkillSummary' {Maybe Bool
supportsLinking :: Maybe Bool
$sel:supportsLinking:SkillSummary' :: SkillSummary -> Maybe Bool
supportsLinking} -> Maybe Bool
supportsLinking) (\s :: SkillSummary
s@SkillSummary' {} Maybe Bool
a -> SkillSummary
s {$sel:supportsLinking:SkillSummary' :: Maybe Bool
supportsLinking = Maybe Bool
a} :: SkillSummary)

instance Data.FromJSON SkillSummary where
  parseJSON :: Value -> Parser SkillSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SkillSummary"
      ( \Object
x ->
          Maybe EnablementType
-> Maybe Text
-> Maybe Text
-> Maybe SkillType
-> Maybe Bool
-> SkillSummary
SkillSummary'
            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
"EnablementType")
            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
"SkillId")
            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
"SkillName")
            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
"SkillType")
            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
"SupportsLinking")
      )

instance Prelude.Hashable SkillSummary where
  hashWithSalt :: Int -> SkillSummary -> Int
hashWithSalt Int
_salt SkillSummary' {Maybe Bool
Maybe Text
Maybe EnablementType
Maybe SkillType
supportsLinking :: Maybe Bool
skillType :: Maybe SkillType
skillName :: Maybe Text
skillId :: Maybe Text
enablementType :: Maybe EnablementType
$sel:supportsLinking:SkillSummary' :: SkillSummary -> Maybe Bool
$sel:skillType:SkillSummary' :: SkillSummary -> Maybe SkillType
$sel:skillName:SkillSummary' :: SkillSummary -> Maybe Text
$sel:skillId:SkillSummary' :: SkillSummary -> Maybe Text
$sel:enablementType:SkillSummary' :: SkillSummary -> Maybe EnablementType
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EnablementType
enablementType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
skillId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
skillName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SkillType
skillType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
supportsLinking

instance Prelude.NFData SkillSummary where
  rnf :: SkillSummary -> ()
rnf SkillSummary' {Maybe Bool
Maybe Text
Maybe EnablementType
Maybe SkillType
supportsLinking :: Maybe Bool
skillType :: Maybe SkillType
skillName :: Maybe Text
skillId :: Maybe Text
enablementType :: Maybe EnablementType
$sel:supportsLinking:SkillSummary' :: SkillSummary -> Maybe Bool
$sel:skillType:SkillSummary' :: SkillSummary -> Maybe SkillType
$sel:skillName:SkillSummary' :: SkillSummary -> Maybe Text
$sel:skillId:SkillSummary' :: SkillSummary -> Maybe Text
$sel:enablementType:SkillSummary' :: SkillSummary -> Maybe EnablementType
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe EnablementType
enablementType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
skillId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
skillName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SkillType
skillType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
supportsLinking