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

-- | 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
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]
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
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. 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' {$sel:object':ZendeskSourceProperties' :: Text
object' = Text
pObject_}

-- | The object specified in the Zendesk flow source.
zendeskSourceProperties_object :: Lens.Lens' ZendeskSourceProperties Prelude.Text
zendeskSourceProperties_object :: Lens' ZendeskSourceProperties Text
zendeskSourceProperties_object = 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 Data.FromJSON ZendeskSourceProperties where
  parseJSON :: Value -> Parser ZendeskSourceProperties
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ZendeskSourceProperties"
      ( \Object
x ->
          Text -> ZendeskSourceProperties
ZendeskSourceProperties'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"object")
      )

instance Prelude.Hashable ZendeskSourceProperties where
  hashWithSalt :: Int -> ZendeskSourceProperties -> Int
hashWithSalt Int
_salt ZendeskSourceProperties' {Text
object' :: Text
$sel:object':ZendeskSourceProperties' :: ZendeskSourceProperties -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
object'

instance Prelude.NFData ZendeskSourceProperties where
  rnf :: ZendeskSourceProperties -> ()
rnf ZendeskSourceProperties' {Text
object' :: Text
$sel:object':ZendeskSourceProperties' :: ZendeskSourceProperties -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
object'

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