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

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

-- | The details about the developer that published the skill.
--
-- /See:/ 'newDeveloperInfo' smart constructor.
data DeveloperInfo = DeveloperInfo'
  { -- | The email of the developer.
    DeveloperInfo -> Maybe Text
email :: Prelude.Maybe Prelude.Text,
    -- | The website of the developer.
    DeveloperInfo -> Maybe Text
url :: Prelude.Maybe Prelude.Text,
    -- | The URL of the privacy policy.
    DeveloperInfo -> Maybe Text
privacyPolicy :: Prelude.Maybe Prelude.Text,
    -- | The name of the developer.
    DeveloperInfo -> Maybe Text
developerName :: Prelude.Maybe Prelude.Text
  }
  deriving (DeveloperInfo -> DeveloperInfo -> Bool
(DeveloperInfo -> DeveloperInfo -> Bool)
-> (DeveloperInfo -> DeveloperInfo -> Bool) -> Eq DeveloperInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeveloperInfo -> DeveloperInfo -> Bool
$c/= :: DeveloperInfo -> DeveloperInfo -> Bool
== :: DeveloperInfo -> DeveloperInfo -> Bool
$c== :: DeveloperInfo -> DeveloperInfo -> Bool
Prelude.Eq, ReadPrec [DeveloperInfo]
ReadPrec DeveloperInfo
Int -> ReadS DeveloperInfo
ReadS [DeveloperInfo]
(Int -> ReadS DeveloperInfo)
-> ReadS [DeveloperInfo]
-> ReadPrec DeveloperInfo
-> ReadPrec [DeveloperInfo]
-> Read DeveloperInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeveloperInfo]
$creadListPrec :: ReadPrec [DeveloperInfo]
readPrec :: ReadPrec DeveloperInfo
$creadPrec :: ReadPrec DeveloperInfo
readList :: ReadS [DeveloperInfo]
$creadList :: ReadS [DeveloperInfo]
readsPrec :: Int -> ReadS DeveloperInfo
$creadsPrec :: Int -> ReadS DeveloperInfo
Prelude.Read, Int -> DeveloperInfo -> ShowS
[DeveloperInfo] -> ShowS
DeveloperInfo -> String
(Int -> DeveloperInfo -> ShowS)
-> (DeveloperInfo -> String)
-> ([DeveloperInfo] -> ShowS)
-> Show DeveloperInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeveloperInfo] -> ShowS
$cshowList :: [DeveloperInfo] -> ShowS
show :: DeveloperInfo -> String
$cshow :: DeveloperInfo -> String
showsPrec :: Int -> DeveloperInfo -> ShowS
$cshowsPrec :: Int -> DeveloperInfo -> ShowS
Prelude.Show, (forall x. DeveloperInfo -> Rep DeveloperInfo x)
-> (forall x. Rep DeveloperInfo x -> DeveloperInfo)
-> Generic DeveloperInfo
forall x. Rep DeveloperInfo x -> DeveloperInfo
forall x. DeveloperInfo -> Rep DeveloperInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeveloperInfo x -> DeveloperInfo
$cfrom :: forall x. DeveloperInfo -> Rep DeveloperInfo x
Prelude.Generic)

-- |
-- Create a value of 'DeveloperInfo' 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:
--
-- 'email', 'developerInfo_email' - The email of the developer.
--
-- 'url', 'developerInfo_url' - The website of the developer.
--
-- 'privacyPolicy', 'developerInfo_privacyPolicy' - The URL of the privacy policy.
--
-- 'developerName', 'developerInfo_developerName' - The name of the developer.
newDeveloperInfo ::
  DeveloperInfo
newDeveloperInfo :: DeveloperInfo
newDeveloperInfo =
  DeveloperInfo' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> DeveloperInfo
DeveloperInfo'
    { $sel:email:DeveloperInfo' :: Maybe Text
email = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:url:DeveloperInfo' :: Maybe Text
url = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:privacyPolicy:DeveloperInfo' :: Maybe Text
privacyPolicy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:developerName:DeveloperInfo' :: Maybe Text
developerName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The email of the developer.
developerInfo_email :: Lens.Lens' DeveloperInfo (Prelude.Maybe Prelude.Text)
developerInfo_email :: (Maybe Text -> f (Maybe Text)) -> DeveloperInfo -> f DeveloperInfo
developerInfo_email = (DeveloperInfo -> Maybe Text)
-> (DeveloperInfo -> Maybe Text -> DeveloperInfo)
-> Lens DeveloperInfo DeveloperInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeveloperInfo' {Maybe Text
email :: Maybe Text
$sel:email:DeveloperInfo' :: DeveloperInfo -> Maybe Text
email} -> Maybe Text
email) (\s :: DeveloperInfo
s@DeveloperInfo' {} Maybe Text
a -> DeveloperInfo
s {$sel:email:DeveloperInfo' :: Maybe Text
email = Maybe Text
a} :: DeveloperInfo)

-- | The website of the developer.
developerInfo_url :: Lens.Lens' DeveloperInfo (Prelude.Maybe Prelude.Text)
developerInfo_url :: (Maybe Text -> f (Maybe Text)) -> DeveloperInfo -> f DeveloperInfo
developerInfo_url = (DeveloperInfo -> Maybe Text)
-> (DeveloperInfo -> Maybe Text -> DeveloperInfo)
-> Lens DeveloperInfo DeveloperInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeveloperInfo' {Maybe Text
url :: Maybe Text
$sel:url:DeveloperInfo' :: DeveloperInfo -> Maybe Text
url} -> Maybe Text
url) (\s :: DeveloperInfo
s@DeveloperInfo' {} Maybe Text
a -> DeveloperInfo
s {$sel:url:DeveloperInfo' :: Maybe Text
url = Maybe Text
a} :: DeveloperInfo)

-- | The URL of the privacy policy.
developerInfo_privacyPolicy :: Lens.Lens' DeveloperInfo (Prelude.Maybe Prelude.Text)
developerInfo_privacyPolicy :: (Maybe Text -> f (Maybe Text)) -> DeveloperInfo -> f DeveloperInfo
developerInfo_privacyPolicy = (DeveloperInfo -> Maybe Text)
-> (DeveloperInfo -> Maybe Text -> DeveloperInfo)
-> Lens DeveloperInfo DeveloperInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeveloperInfo' {Maybe Text
privacyPolicy :: Maybe Text
$sel:privacyPolicy:DeveloperInfo' :: DeveloperInfo -> Maybe Text
privacyPolicy} -> Maybe Text
privacyPolicy) (\s :: DeveloperInfo
s@DeveloperInfo' {} Maybe Text
a -> DeveloperInfo
s {$sel:privacyPolicy:DeveloperInfo' :: Maybe Text
privacyPolicy = Maybe Text
a} :: DeveloperInfo)

-- | The name of the developer.
developerInfo_developerName :: Lens.Lens' DeveloperInfo (Prelude.Maybe Prelude.Text)
developerInfo_developerName :: (Maybe Text -> f (Maybe Text)) -> DeveloperInfo -> f DeveloperInfo
developerInfo_developerName = (DeveloperInfo -> Maybe Text)
-> (DeveloperInfo -> Maybe Text -> DeveloperInfo)
-> Lens DeveloperInfo DeveloperInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeveloperInfo' {Maybe Text
developerName :: Maybe Text
$sel:developerName:DeveloperInfo' :: DeveloperInfo -> Maybe Text
developerName} -> Maybe Text
developerName) (\s :: DeveloperInfo
s@DeveloperInfo' {} Maybe Text
a -> DeveloperInfo
s {$sel:developerName:DeveloperInfo' :: Maybe Text
developerName = Maybe Text
a} :: DeveloperInfo)

instance Core.FromJSON DeveloperInfo where
  parseJSON :: Value -> Parser DeveloperInfo
parseJSON =
    String
-> (Object -> Parser DeveloperInfo)
-> Value
-> Parser DeveloperInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DeveloperInfo"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> DeveloperInfo
DeveloperInfo'
            (Maybe Text
 -> Maybe Text -> Maybe Text -> Maybe Text -> DeveloperInfo)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> DeveloperInfo)
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
"Email")
            Parser (Maybe Text -> Maybe Text -> Maybe Text -> DeveloperInfo)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> DeveloperInfo)
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
"Url")
            Parser (Maybe Text -> Maybe Text -> DeveloperInfo)
-> Parser (Maybe Text) -> Parser (Maybe Text -> DeveloperInfo)
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
"PrivacyPolicy")
            Parser (Maybe Text -> DeveloperInfo)
-> Parser (Maybe Text) -> Parser DeveloperInfo
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
"DeveloperName")
      )

instance Prelude.Hashable DeveloperInfo

instance Prelude.NFData DeveloperInfo