{-# 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.CustomerProfiles.Types.ZendeskSourceProperties
-- 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.CustomerProfiles.Types.ZendeskSourceProperties where

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

-- | The properties that are applied when using Zendesk as a flow source.
--
-- /See:/ 'newZendeskSourceProperties' smart constructor.
data ZendeskSourceProperties = ZendeskSourceProperties'
  { -- | The object specified in the Zendesk flow source.
    ZendeskSourceProperties -> Text
object' :: Prelude.Text
  }
  deriving (ZendeskSourceProperties -> ZendeskSourceProperties -> Bool
(ZendeskSourceProperties -> ZendeskSourceProperties -> Bool)
-> (ZendeskSourceProperties -> ZendeskSourceProperties -> Bool)
-> Eq ZendeskSourceProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ZendeskSourceProperties -> ZendeskSourceProperties -> Bool
$c/= :: ZendeskSourceProperties -> ZendeskSourceProperties -> Bool
== :: ZendeskSourceProperties -> ZendeskSourceProperties -> Bool
$c== :: ZendeskSourceProperties -> ZendeskSourceProperties -> Bool
Prelude.Eq, ReadPrec [ZendeskSourceProperties]
ReadPrec ZendeskSourceProperties
Int -> ReadS ZendeskSourceProperties
ReadS [ZendeskSourceProperties]
(Int -> ReadS ZendeskSourceProperties)
-> ReadS [ZendeskSourceProperties]
-> ReadPrec ZendeskSourceProperties
-> ReadPrec [ZendeskSourceProperties]
-> Read ZendeskSourceProperties
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ZendeskSourceProperties]
$creadListPrec :: ReadPrec [ZendeskSourceProperties]
readPrec :: ReadPrec ZendeskSourceProperties
$creadPrec :: ReadPrec ZendeskSourceProperties
readList :: ReadS [ZendeskSourceProperties]
$creadList :: ReadS [ZendeskSourceProperties]
readsPrec :: Int -> ReadS ZendeskSourceProperties
$creadsPrec :: Int -> ReadS ZendeskSourceProperties
Prelude.Read, Int -> ZendeskSourceProperties -> ShowS
[ZendeskSourceProperties] -> ShowS
ZendeskSourceProperties -> String
(Int -> ZendeskSourceProperties -> ShowS)
-> (ZendeskSourceProperties -> String)
-> ([ZendeskSourceProperties] -> ShowS)
-> Show ZendeskSourceProperties
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ZendeskSourceProperties] -> ShowS
$cshowList :: [ZendeskSourceProperties] -> ShowS
show :: ZendeskSourceProperties -> String
$cshow :: ZendeskSourceProperties -> String
showsPrec :: Int -> ZendeskSourceProperties -> ShowS
$cshowsPrec :: Int -> ZendeskSourceProperties -> ShowS
Prelude.Show, (forall x.
 ZendeskSourceProperties -> Rep ZendeskSourceProperties x)
-> (forall x.
    Rep ZendeskSourceProperties x -> ZendeskSourceProperties)
-> Generic ZendeskSourceProperties
forall x. Rep ZendeskSourceProperties x -> ZendeskSourceProperties
forall x. ZendeskSourceProperties -> Rep ZendeskSourceProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ZendeskSourceProperties x -> ZendeskSourceProperties
$cfrom :: forall x. ZendeskSourceProperties -> Rep ZendeskSourceProperties x
Prelude.Generic)

-- |
-- Create a value of 'ZendeskSourceProperties' 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:
--
-- 'object'', 'zendeskSourceProperties_object' - The object specified in the Zendesk flow source.
newZendeskSourceProperties ::
  -- | 'object''
  Prelude.Text ->
  ZendeskSourceProperties
newZendeskSourceProperties :: Text -> ZendeskSourceProperties
newZendeskSourceProperties Text
pObject_ =
  ZendeskSourceProperties' :: Text -> ZendeskSourceProperties
ZendeskSourceProperties' {$sel:object':ZendeskSourceProperties' :: Text
object' = Text
pObject_}

-- | The object specified in the Zendesk flow source.
zendeskSourceProperties_object :: Lens.Lens' ZendeskSourceProperties Prelude.Text
zendeskSourceProperties_object :: (Text -> f Text)
-> ZendeskSourceProperties -> f ZendeskSourceProperties
zendeskSourceProperties_object = (ZendeskSourceProperties -> Text)
-> (ZendeskSourceProperties -> Text -> ZendeskSourceProperties)
-> Lens ZendeskSourceProperties ZendeskSourceProperties Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ZendeskSourceProperties' {Text
object' :: Text
$sel:object':ZendeskSourceProperties' :: ZendeskSourceProperties -> Text
object'} -> Text
object') (\s :: ZendeskSourceProperties
s@ZendeskSourceProperties' {} Text
a -> ZendeskSourceProperties
s {$sel:object':ZendeskSourceProperties' :: Text
object' = Text
a} :: ZendeskSourceProperties)

instance Prelude.Hashable ZendeskSourceProperties

instance Prelude.NFData ZendeskSourceProperties

instance Core.ToJSON ZendeskSourceProperties where
  toJSON :: ZendeskSourceProperties -> Value
toJSON ZendeskSourceProperties' {Text
object' :: Text
$sel:object':ZendeskSourceProperties' :: ZendeskSourceProperties -> 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
"Object" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
object')]
      )