{-# 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.SourceConnectorProperties
-- 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.SourceConnectorProperties where

import qualified Amazonka.Core as Core
import Amazonka.CustomerProfiles.Types.MarketoSourceProperties
import Amazonka.CustomerProfiles.Types.S3SourceProperties
import Amazonka.CustomerProfiles.Types.SalesforceSourceProperties
import Amazonka.CustomerProfiles.Types.ServiceNowSourceProperties
import Amazonka.CustomerProfiles.Types.ZendeskSourceProperties
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Specifies the information that is required to query a particular Amazon
-- AppFlow connector. Customer Profiles supports Salesforce, Zendesk,
-- Marketo, ServiceNow and Amazon S3.
--
-- /See:/ 'newSourceConnectorProperties' smart constructor.
data SourceConnectorProperties = SourceConnectorProperties'
  { -- | The properties that are applied when ServiceNow is being used as a
    -- source.
    SourceConnectorProperties -> Maybe ServiceNowSourceProperties
serviceNow :: Prelude.Maybe ServiceNowSourceProperties,
    -- | The properties that are applied when Marketo is being used as a source.
    SourceConnectorProperties -> Maybe MarketoSourceProperties
marketo :: Prelude.Maybe MarketoSourceProperties,
    -- | The properties that are applied when Salesforce is being used as a
    -- source.
    SourceConnectorProperties -> Maybe SalesforceSourceProperties
salesforce :: Prelude.Maybe SalesforceSourceProperties,
    -- | The properties that are applied when using Zendesk as a flow source.
    SourceConnectorProperties -> Maybe ZendeskSourceProperties
zendesk :: Prelude.Maybe ZendeskSourceProperties,
    -- | The properties that are applied when Amazon S3 is being used as the flow
    -- source.
    SourceConnectorProperties -> Maybe S3SourceProperties
s3 :: Prelude.Maybe S3SourceProperties
  }
  deriving (SourceConnectorProperties -> SourceConnectorProperties -> Bool
(SourceConnectorProperties -> SourceConnectorProperties -> Bool)
-> (SourceConnectorProperties -> SourceConnectorProperties -> Bool)
-> Eq SourceConnectorProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SourceConnectorProperties -> SourceConnectorProperties -> Bool
$c/= :: SourceConnectorProperties -> SourceConnectorProperties -> Bool
== :: SourceConnectorProperties -> SourceConnectorProperties -> Bool
$c== :: SourceConnectorProperties -> SourceConnectorProperties -> Bool
Prelude.Eq, ReadPrec [SourceConnectorProperties]
ReadPrec SourceConnectorProperties
Int -> ReadS SourceConnectorProperties
ReadS [SourceConnectorProperties]
(Int -> ReadS SourceConnectorProperties)
-> ReadS [SourceConnectorProperties]
-> ReadPrec SourceConnectorProperties
-> ReadPrec [SourceConnectorProperties]
-> Read SourceConnectorProperties
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SourceConnectorProperties]
$creadListPrec :: ReadPrec [SourceConnectorProperties]
readPrec :: ReadPrec SourceConnectorProperties
$creadPrec :: ReadPrec SourceConnectorProperties
readList :: ReadS [SourceConnectorProperties]
$creadList :: ReadS [SourceConnectorProperties]
readsPrec :: Int -> ReadS SourceConnectorProperties
$creadsPrec :: Int -> ReadS SourceConnectorProperties
Prelude.Read, Int -> SourceConnectorProperties -> ShowS
[SourceConnectorProperties] -> ShowS
SourceConnectorProperties -> String
(Int -> SourceConnectorProperties -> ShowS)
-> (SourceConnectorProperties -> String)
-> ([SourceConnectorProperties] -> ShowS)
-> Show SourceConnectorProperties
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SourceConnectorProperties] -> ShowS
$cshowList :: [SourceConnectorProperties] -> ShowS
show :: SourceConnectorProperties -> String
$cshow :: SourceConnectorProperties -> String
showsPrec :: Int -> SourceConnectorProperties -> ShowS
$cshowsPrec :: Int -> SourceConnectorProperties -> ShowS
Prelude.Show, (forall x.
 SourceConnectorProperties -> Rep SourceConnectorProperties x)
-> (forall x.
    Rep SourceConnectorProperties x -> SourceConnectorProperties)
-> Generic SourceConnectorProperties
forall x.
Rep SourceConnectorProperties x -> SourceConnectorProperties
forall x.
SourceConnectorProperties -> Rep SourceConnectorProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SourceConnectorProperties x -> SourceConnectorProperties
$cfrom :: forall x.
SourceConnectorProperties -> Rep SourceConnectorProperties x
Prelude.Generic)

-- |
-- Create a value of 'SourceConnectorProperties' 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:
--
-- 'serviceNow', 'sourceConnectorProperties_serviceNow' - The properties that are applied when ServiceNow is being used as a
-- source.
--
-- 'marketo', 'sourceConnectorProperties_marketo' - The properties that are applied when Marketo is being used as a source.
--
-- 'salesforce', 'sourceConnectorProperties_salesforce' - The properties that are applied when Salesforce is being used as a
-- source.
--
-- 'zendesk', 'sourceConnectorProperties_zendesk' - The properties that are applied when using Zendesk as a flow source.
--
-- 's3', 'sourceConnectorProperties_s3' - The properties that are applied when Amazon S3 is being used as the flow
-- source.
newSourceConnectorProperties ::
  SourceConnectorProperties
newSourceConnectorProperties :: SourceConnectorProperties
newSourceConnectorProperties =
  SourceConnectorProperties' :: Maybe ServiceNowSourceProperties
-> Maybe MarketoSourceProperties
-> Maybe SalesforceSourceProperties
-> Maybe ZendeskSourceProperties
-> Maybe S3SourceProperties
-> SourceConnectorProperties
SourceConnectorProperties'
    { $sel:serviceNow:SourceConnectorProperties' :: Maybe ServiceNowSourceProperties
serviceNow =
        Maybe ServiceNowSourceProperties
forall a. Maybe a
Prelude.Nothing,
      $sel:marketo:SourceConnectorProperties' :: Maybe MarketoSourceProperties
marketo = Maybe MarketoSourceProperties
forall a. Maybe a
Prelude.Nothing,
      $sel:salesforce:SourceConnectorProperties' :: Maybe SalesforceSourceProperties
salesforce = Maybe SalesforceSourceProperties
forall a. Maybe a
Prelude.Nothing,
      $sel:zendesk:SourceConnectorProperties' :: Maybe ZendeskSourceProperties
zendesk = Maybe ZendeskSourceProperties
forall a. Maybe a
Prelude.Nothing,
      $sel:s3:SourceConnectorProperties' :: Maybe S3SourceProperties
s3 = Maybe S3SourceProperties
forall a. Maybe a
Prelude.Nothing
    }

-- | The properties that are applied when ServiceNow is being used as a
-- source.
sourceConnectorProperties_serviceNow :: Lens.Lens' SourceConnectorProperties (Prelude.Maybe ServiceNowSourceProperties)
sourceConnectorProperties_serviceNow :: (Maybe ServiceNowSourceProperties
 -> f (Maybe ServiceNowSourceProperties))
-> SourceConnectorProperties -> f SourceConnectorProperties
sourceConnectorProperties_serviceNow = (SourceConnectorProperties -> Maybe ServiceNowSourceProperties)
-> (SourceConnectorProperties
    -> Maybe ServiceNowSourceProperties -> SourceConnectorProperties)
-> Lens
     SourceConnectorProperties
     SourceConnectorProperties
     (Maybe ServiceNowSourceProperties)
     (Maybe ServiceNowSourceProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceConnectorProperties' {Maybe ServiceNowSourceProperties
serviceNow :: Maybe ServiceNowSourceProperties
$sel:serviceNow:SourceConnectorProperties' :: SourceConnectorProperties -> Maybe ServiceNowSourceProperties
serviceNow} -> Maybe ServiceNowSourceProperties
serviceNow) (\s :: SourceConnectorProperties
s@SourceConnectorProperties' {} Maybe ServiceNowSourceProperties
a -> SourceConnectorProperties
s {$sel:serviceNow:SourceConnectorProperties' :: Maybe ServiceNowSourceProperties
serviceNow = Maybe ServiceNowSourceProperties
a} :: SourceConnectorProperties)

-- | The properties that are applied when Marketo is being used as a source.
sourceConnectorProperties_marketo :: Lens.Lens' SourceConnectorProperties (Prelude.Maybe MarketoSourceProperties)
sourceConnectorProperties_marketo :: (Maybe MarketoSourceProperties
 -> f (Maybe MarketoSourceProperties))
-> SourceConnectorProperties -> f SourceConnectorProperties
sourceConnectorProperties_marketo = (SourceConnectorProperties -> Maybe MarketoSourceProperties)
-> (SourceConnectorProperties
    -> Maybe MarketoSourceProperties -> SourceConnectorProperties)
-> Lens
     SourceConnectorProperties
     SourceConnectorProperties
     (Maybe MarketoSourceProperties)
     (Maybe MarketoSourceProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceConnectorProperties' {Maybe MarketoSourceProperties
marketo :: Maybe MarketoSourceProperties
$sel:marketo:SourceConnectorProperties' :: SourceConnectorProperties -> Maybe MarketoSourceProperties
marketo} -> Maybe MarketoSourceProperties
marketo) (\s :: SourceConnectorProperties
s@SourceConnectorProperties' {} Maybe MarketoSourceProperties
a -> SourceConnectorProperties
s {$sel:marketo:SourceConnectorProperties' :: Maybe MarketoSourceProperties
marketo = Maybe MarketoSourceProperties
a} :: SourceConnectorProperties)

-- | The properties that are applied when Salesforce is being used as a
-- source.
sourceConnectorProperties_salesforce :: Lens.Lens' SourceConnectorProperties (Prelude.Maybe SalesforceSourceProperties)
sourceConnectorProperties_salesforce :: (Maybe SalesforceSourceProperties
 -> f (Maybe SalesforceSourceProperties))
-> SourceConnectorProperties -> f SourceConnectorProperties
sourceConnectorProperties_salesforce = (SourceConnectorProperties -> Maybe SalesforceSourceProperties)
-> (SourceConnectorProperties
    -> Maybe SalesforceSourceProperties -> SourceConnectorProperties)
-> Lens
     SourceConnectorProperties
     SourceConnectorProperties
     (Maybe SalesforceSourceProperties)
     (Maybe SalesforceSourceProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceConnectorProperties' {Maybe SalesforceSourceProperties
salesforce :: Maybe SalesforceSourceProperties
$sel:salesforce:SourceConnectorProperties' :: SourceConnectorProperties -> Maybe SalesforceSourceProperties
salesforce} -> Maybe SalesforceSourceProperties
salesforce) (\s :: SourceConnectorProperties
s@SourceConnectorProperties' {} Maybe SalesforceSourceProperties
a -> SourceConnectorProperties
s {$sel:salesforce:SourceConnectorProperties' :: Maybe SalesforceSourceProperties
salesforce = Maybe SalesforceSourceProperties
a} :: SourceConnectorProperties)

-- | The properties that are applied when using Zendesk as a flow source.
sourceConnectorProperties_zendesk :: Lens.Lens' SourceConnectorProperties (Prelude.Maybe ZendeskSourceProperties)
sourceConnectorProperties_zendesk :: (Maybe ZendeskSourceProperties
 -> f (Maybe ZendeskSourceProperties))
-> SourceConnectorProperties -> f SourceConnectorProperties
sourceConnectorProperties_zendesk = (SourceConnectorProperties -> Maybe ZendeskSourceProperties)
-> (SourceConnectorProperties
    -> Maybe ZendeskSourceProperties -> SourceConnectorProperties)
-> Lens
     SourceConnectorProperties
     SourceConnectorProperties
     (Maybe ZendeskSourceProperties)
     (Maybe ZendeskSourceProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceConnectorProperties' {Maybe ZendeskSourceProperties
zendesk :: Maybe ZendeskSourceProperties
$sel:zendesk:SourceConnectorProperties' :: SourceConnectorProperties -> Maybe ZendeskSourceProperties
zendesk} -> Maybe ZendeskSourceProperties
zendesk) (\s :: SourceConnectorProperties
s@SourceConnectorProperties' {} Maybe ZendeskSourceProperties
a -> SourceConnectorProperties
s {$sel:zendesk:SourceConnectorProperties' :: Maybe ZendeskSourceProperties
zendesk = Maybe ZendeskSourceProperties
a} :: SourceConnectorProperties)

-- | The properties that are applied when Amazon S3 is being used as the flow
-- source.
sourceConnectorProperties_s3 :: Lens.Lens' SourceConnectorProperties (Prelude.Maybe S3SourceProperties)
sourceConnectorProperties_s3 :: (Maybe S3SourceProperties -> f (Maybe S3SourceProperties))
-> SourceConnectorProperties -> f SourceConnectorProperties
sourceConnectorProperties_s3 = (SourceConnectorProperties -> Maybe S3SourceProperties)
-> (SourceConnectorProperties
    -> Maybe S3SourceProperties -> SourceConnectorProperties)
-> Lens
     SourceConnectorProperties
     SourceConnectorProperties
     (Maybe S3SourceProperties)
     (Maybe S3SourceProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceConnectorProperties' {Maybe S3SourceProperties
s3 :: Maybe S3SourceProperties
$sel:s3:SourceConnectorProperties' :: SourceConnectorProperties -> Maybe S3SourceProperties
s3} -> Maybe S3SourceProperties
s3) (\s :: SourceConnectorProperties
s@SourceConnectorProperties' {} Maybe S3SourceProperties
a -> SourceConnectorProperties
s {$sel:s3:SourceConnectorProperties' :: Maybe S3SourceProperties
s3 = Maybe S3SourceProperties
a} :: SourceConnectorProperties)

instance Prelude.Hashable SourceConnectorProperties

instance Prelude.NFData SourceConnectorProperties

instance Core.ToJSON SourceConnectorProperties where
  toJSON :: SourceConnectorProperties -> Value
toJSON SourceConnectorProperties' {Maybe MarketoSourceProperties
Maybe S3SourceProperties
Maybe SalesforceSourceProperties
Maybe ServiceNowSourceProperties
Maybe ZendeskSourceProperties
s3 :: Maybe S3SourceProperties
zendesk :: Maybe ZendeskSourceProperties
salesforce :: Maybe SalesforceSourceProperties
marketo :: Maybe MarketoSourceProperties
serviceNow :: Maybe ServiceNowSourceProperties
$sel:s3:SourceConnectorProperties' :: SourceConnectorProperties -> Maybe S3SourceProperties
$sel:zendesk:SourceConnectorProperties' :: SourceConnectorProperties -> Maybe ZendeskSourceProperties
$sel:salesforce:SourceConnectorProperties' :: SourceConnectorProperties -> Maybe SalesforceSourceProperties
$sel:marketo:SourceConnectorProperties' :: SourceConnectorProperties -> Maybe MarketoSourceProperties
$sel:serviceNow:SourceConnectorProperties' :: SourceConnectorProperties -> Maybe ServiceNowSourceProperties
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ServiceNow" Text -> ServiceNowSourceProperties -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ServiceNowSourceProperties -> Pair)
-> Maybe ServiceNowSourceProperties -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ServiceNowSourceProperties
serviceNow,
            (Text
"Marketo" Text -> MarketoSourceProperties -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (MarketoSourceProperties -> Pair)
-> Maybe MarketoSourceProperties -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MarketoSourceProperties
marketo,
            (Text
"Salesforce" Text -> SalesforceSourceProperties -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SalesforceSourceProperties -> Pair)
-> Maybe SalesforceSourceProperties -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SalesforceSourceProperties
salesforce,
            (Text
"Zendesk" Text -> ZendeskSourceProperties -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ZendeskSourceProperties -> Pair)
-> Maybe ZendeskSourceProperties -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ZendeskSourceProperties
zendesk,
            (Text
"S3" Text -> S3SourceProperties -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (S3SourceProperties -> Pair)
-> Maybe S3SourceProperties -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe S3SourceProperties
s3
          ]
      )