{-# 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.MarketoSourceProperties
-- 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.MarketoSourceProperties 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 Marketo is being used as a source.
--
-- /See:/ 'newMarketoSourceProperties' smart constructor.
data MarketoSourceProperties = MarketoSourceProperties'
  { -- | The object specified in the Marketo flow source.
    MarketoSourceProperties -> Text
object' :: Prelude.Text
  }
  deriving (MarketoSourceProperties -> MarketoSourceProperties -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MarketoSourceProperties -> MarketoSourceProperties -> Bool
$c/= :: MarketoSourceProperties -> MarketoSourceProperties -> Bool
== :: MarketoSourceProperties -> MarketoSourceProperties -> Bool
$c== :: MarketoSourceProperties -> MarketoSourceProperties -> Bool
Prelude.Eq, ReadPrec [MarketoSourceProperties]
ReadPrec MarketoSourceProperties
Int -> ReadS MarketoSourceProperties
ReadS [MarketoSourceProperties]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MarketoSourceProperties]
$creadListPrec :: ReadPrec [MarketoSourceProperties]
readPrec :: ReadPrec MarketoSourceProperties
$creadPrec :: ReadPrec MarketoSourceProperties
readList :: ReadS [MarketoSourceProperties]
$creadList :: ReadS [MarketoSourceProperties]
readsPrec :: Int -> ReadS MarketoSourceProperties
$creadsPrec :: Int -> ReadS MarketoSourceProperties
Prelude.Read, Int -> MarketoSourceProperties -> ShowS
[MarketoSourceProperties] -> ShowS
MarketoSourceProperties -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MarketoSourceProperties] -> ShowS
$cshowList :: [MarketoSourceProperties] -> ShowS
show :: MarketoSourceProperties -> String
$cshow :: MarketoSourceProperties -> String
showsPrec :: Int -> MarketoSourceProperties -> ShowS
$cshowsPrec :: Int -> MarketoSourceProperties -> ShowS
Prelude.Show, forall x. Rep MarketoSourceProperties x -> MarketoSourceProperties
forall x. MarketoSourceProperties -> Rep MarketoSourceProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MarketoSourceProperties x -> MarketoSourceProperties
$cfrom :: forall x. MarketoSourceProperties -> Rep MarketoSourceProperties x
Prelude.Generic)

-- |
-- Create a value of 'MarketoSourceProperties' 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'', 'marketoSourceProperties_object' - The object specified in the Marketo flow source.
newMarketoSourceProperties ::
  -- | 'object''
  Prelude.Text ->
  MarketoSourceProperties
newMarketoSourceProperties :: Text -> MarketoSourceProperties
newMarketoSourceProperties Text
pObject_ =
  MarketoSourceProperties' {$sel:object':MarketoSourceProperties' :: Text
object' = Text
pObject_}

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

instance Data.FromJSON MarketoSourceProperties where
  parseJSON :: Value -> Parser MarketoSourceProperties
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MarketoSourceProperties"
      ( \Object
x ->
          Text -> MarketoSourceProperties
MarketoSourceProperties'
            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 MarketoSourceProperties where
  hashWithSalt :: Int -> MarketoSourceProperties -> Int
hashWithSalt Int
_salt MarketoSourceProperties' {Text
object' :: Text
$sel:object':MarketoSourceProperties' :: MarketoSourceProperties -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
object'

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

instance Data.ToJSON MarketoSourceProperties where
  toJSON :: MarketoSourceProperties -> Value
toJSON MarketoSourceProperties' {Text
object' :: Text
$sel:object':MarketoSourceProperties' :: MarketoSourceProperties -> 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')]
      )