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

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

-- | The connector-specific profile properties required when using Marketo.
--
-- /See:/ 'newMarketoConnectorProfileProperties' smart constructor.
data MarketoConnectorProfileProperties = MarketoConnectorProfileProperties'
  { -- | The location of the Marketo resource.
    MarketoConnectorProfileProperties -> Text
instanceUrl :: Prelude.Text
  }
  deriving (MarketoConnectorProfileProperties
-> MarketoConnectorProfileProperties -> Bool
(MarketoConnectorProfileProperties
 -> MarketoConnectorProfileProperties -> Bool)
-> (MarketoConnectorProfileProperties
    -> MarketoConnectorProfileProperties -> Bool)
-> Eq MarketoConnectorProfileProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MarketoConnectorProfileProperties
-> MarketoConnectorProfileProperties -> Bool
$c/= :: MarketoConnectorProfileProperties
-> MarketoConnectorProfileProperties -> Bool
== :: MarketoConnectorProfileProperties
-> MarketoConnectorProfileProperties -> Bool
$c== :: MarketoConnectorProfileProperties
-> MarketoConnectorProfileProperties -> Bool
Prelude.Eq, ReadPrec [MarketoConnectorProfileProperties]
ReadPrec MarketoConnectorProfileProperties
Int -> ReadS MarketoConnectorProfileProperties
ReadS [MarketoConnectorProfileProperties]
(Int -> ReadS MarketoConnectorProfileProperties)
-> ReadS [MarketoConnectorProfileProperties]
-> ReadPrec MarketoConnectorProfileProperties
-> ReadPrec [MarketoConnectorProfileProperties]
-> Read MarketoConnectorProfileProperties
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MarketoConnectorProfileProperties]
$creadListPrec :: ReadPrec [MarketoConnectorProfileProperties]
readPrec :: ReadPrec MarketoConnectorProfileProperties
$creadPrec :: ReadPrec MarketoConnectorProfileProperties
readList :: ReadS [MarketoConnectorProfileProperties]
$creadList :: ReadS [MarketoConnectorProfileProperties]
readsPrec :: Int -> ReadS MarketoConnectorProfileProperties
$creadsPrec :: Int -> ReadS MarketoConnectorProfileProperties
Prelude.Read, Int -> MarketoConnectorProfileProperties -> ShowS
[MarketoConnectorProfileProperties] -> ShowS
MarketoConnectorProfileProperties -> String
(Int -> MarketoConnectorProfileProperties -> ShowS)
-> (MarketoConnectorProfileProperties -> String)
-> ([MarketoConnectorProfileProperties] -> ShowS)
-> Show MarketoConnectorProfileProperties
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MarketoConnectorProfileProperties] -> ShowS
$cshowList :: [MarketoConnectorProfileProperties] -> ShowS
show :: MarketoConnectorProfileProperties -> String
$cshow :: MarketoConnectorProfileProperties -> String
showsPrec :: Int -> MarketoConnectorProfileProperties -> ShowS
$cshowsPrec :: Int -> MarketoConnectorProfileProperties -> ShowS
Prelude.Show, (forall x.
 MarketoConnectorProfileProperties
 -> Rep MarketoConnectorProfileProperties x)
-> (forall x.
    Rep MarketoConnectorProfileProperties x
    -> MarketoConnectorProfileProperties)
-> Generic MarketoConnectorProfileProperties
forall x.
Rep MarketoConnectorProfileProperties x
-> MarketoConnectorProfileProperties
forall x.
MarketoConnectorProfileProperties
-> Rep MarketoConnectorProfileProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MarketoConnectorProfileProperties x
-> MarketoConnectorProfileProperties
$cfrom :: forall x.
MarketoConnectorProfileProperties
-> Rep MarketoConnectorProfileProperties x
Prelude.Generic)

-- |
-- Create a value of 'MarketoConnectorProfileProperties' 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:
--
-- 'instanceUrl', 'marketoConnectorProfileProperties_instanceUrl' - The location of the Marketo resource.
newMarketoConnectorProfileProperties ::
  -- | 'instanceUrl'
  Prelude.Text ->
  MarketoConnectorProfileProperties
newMarketoConnectorProfileProperties :: Text -> MarketoConnectorProfileProperties
newMarketoConnectorProfileProperties Text
pInstanceUrl_ =
  MarketoConnectorProfileProperties' :: Text -> MarketoConnectorProfileProperties
MarketoConnectorProfileProperties'
    { $sel:instanceUrl:MarketoConnectorProfileProperties' :: Text
instanceUrl =
        Text
pInstanceUrl_
    }

-- | The location of the Marketo resource.
marketoConnectorProfileProperties_instanceUrl :: Lens.Lens' MarketoConnectorProfileProperties Prelude.Text
marketoConnectorProfileProperties_instanceUrl :: (Text -> f Text)
-> MarketoConnectorProfileProperties
-> f MarketoConnectorProfileProperties
marketoConnectorProfileProperties_instanceUrl = (MarketoConnectorProfileProperties -> Text)
-> (MarketoConnectorProfileProperties
    -> Text -> MarketoConnectorProfileProperties)
-> Lens
     MarketoConnectorProfileProperties
     MarketoConnectorProfileProperties
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MarketoConnectorProfileProperties' {Text
instanceUrl :: Text
$sel:instanceUrl:MarketoConnectorProfileProperties' :: MarketoConnectorProfileProperties -> Text
instanceUrl} -> Text
instanceUrl) (\s :: MarketoConnectorProfileProperties
s@MarketoConnectorProfileProperties' {} Text
a -> MarketoConnectorProfileProperties
s {$sel:instanceUrl:MarketoConnectorProfileProperties' :: Text
instanceUrl = Text
a} :: MarketoConnectorProfileProperties)

instance
  Core.FromJSON
    MarketoConnectorProfileProperties
  where
  parseJSON :: Value -> Parser MarketoConnectorProfileProperties
parseJSON =
    String
-> (Object -> Parser MarketoConnectorProfileProperties)
-> Value
-> Parser MarketoConnectorProfileProperties
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"MarketoConnectorProfileProperties"
      ( \Object
x ->
          Text -> MarketoConnectorProfileProperties
MarketoConnectorProfileProperties'
            (Text -> MarketoConnectorProfileProperties)
-> Parser Text -> Parser MarketoConnectorProfileProperties
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
"instanceUrl")
      )

instance
  Prelude.Hashable
    MarketoConnectorProfileProperties

instance
  Prelude.NFData
    MarketoConnectorProfileProperties

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