{-# 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.QuickSight.Types.JiraParameters
-- 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.QuickSight.Types.JiraParameters where

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

-- | The parameters for Jira.
--
-- /See:/ 'newJiraParameters' smart constructor.
data JiraParameters = JiraParameters'
  { -- | The base URL of the Jira site.
    JiraParameters -> Text
siteBaseUrl :: Prelude.Text
  }
  deriving (JiraParameters -> JiraParameters -> Bool
(JiraParameters -> JiraParameters -> Bool)
-> (JiraParameters -> JiraParameters -> Bool) -> Eq JiraParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: JiraParameters -> JiraParameters -> Bool
$c/= :: JiraParameters -> JiraParameters -> Bool
== :: JiraParameters -> JiraParameters -> Bool
$c== :: JiraParameters -> JiraParameters -> Bool
Prelude.Eq, ReadPrec [JiraParameters]
ReadPrec JiraParameters
Int -> ReadS JiraParameters
ReadS [JiraParameters]
(Int -> ReadS JiraParameters)
-> ReadS [JiraParameters]
-> ReadPrec JiraParameters
-> ReadPrec [JiraParameters]
-> Read JiraParameters
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [JiraParameters]
$creadListPrec :: ReadPrec [JiraParameters]
readPrec :: ReadPrec JiraParameters
$creadPrec :: ReadPrec JiraParameters
readList :: ReadS [JiraParameters]
$creadList :: ReadS [JiraParameters]
readsPrec :: Int -> ReadS JiraParameters
$creadsPrec :: Int -> ReadS JiraParameters
Prelude.Read, Int -> JiraParameters -> ShowS
[JiraParameters] -> ShowS
JiraParameters -> String
(Int -> JiraParameters -> ShowS)
-> (JiraParameters -> String)
-> ([JiraParameters] -> ShowS)
-> Show JiraParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [JiraParameters] -> ShowS
$cshowList :: [JiraParameters] -> ShowS
show :: JiraParameters -> String
$cshow :: JiraParameters -> String
showsPrec :: Int -> JiraParameters -> ShowS
$cshowsPrec :: Int -> JiraParameters -> ShowS
Prelude.Show, (forall x. JiraParameters -> Rep JiraParameters x)
-> (forall x. Rep JiraParameters x -> JiraParameters)
-> Generic JiraParameters
forall x. Rep JiraParameters x -> JiraParameters
forall x. JiraParameters -> Rep JiraParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep JiraParameters x -> JiraParameters
$cfrom :: forall x. JiraParameters -> Rep JiraParameters x
Prelude.Generic)

-- |
-- Create a value of 'JiraParameters' 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:
--
-- 'siteBaseUrl', 'jiraParameters_siteBaseUrl' - The base URL of the Jira site.
newJiraParameters ::
  -- | 'siteBaseUrl'
  Prelude.Text ->
  JiraParameters
newJiraParameters :: Text -> JiraParameters
newJiraParameters Text
pSiteBaseUrl_ =
  JiraParameters' :: Text -> JiraParameters
JiraParameters' {$sel:siteBaseUrl:JiraParameters' :: Text
siteBaseUrl = Text
pSiteBaseUrl_}

-- | The base URL of the Jira site.
jiraParameters_siteBaseUrl :: Lens.Lens' JiraParameters Prelude.Text
jiraParameters_siteBaseUrl :: (Text -> f Text) -> JiraParameters -> f JiraParameters
jiraParameters_siteBaseUrl = (JiraParameters -> Text)
-> (JiraParameters -> Text -> JiraParameters)
-> Lens JiraParameters JiraParameters Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\JiraParameters' {Text
siteBaseUrl :: Text
$sel:siteBaseUrl:JiraParameters' :: JiraParameters -> Text
siteBaseUrl} -> Text
siteBaseUrl) (\s :: JiraParameters
s@JiraParameters' {} Text
a -> JiraParameters
s {$sel:siteBaseUrl:JiraParameters' :: Text
siteBaseUrl = Text
a} :: JiraParameters)

instance Core.FromJSON JiraParameters where
  parseJSON :: Value -> Parser JiraParameters
parseJSON =
    String
-> (Object -> Parser JiraParameters)
-> Value
-> Parser JiraParameters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"JiraParameters"
      ( \Object
x ->
          Text -> JiraParameters
JiraParameters'
            (Text -> JiraParameters) -> Parser Text -> Parser JiraParameters
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"SiteBaseUrl")
      )

instance Prelude.Hashable JiraParameters

instance Prelude.NFData JiraParameters

instance Core.ToJSON JiraParameters where
  toJSON :: JiraParameters -> Value
toJSON JiraParameters' {Text
siteBaseUrl :: Text
$sel:siteBaseUrl:JiraParameters' :: JiraParameters -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SiteBaseUrl" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
siteBaseUrl)]
      )