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

import Amazonka.AppFlow.Types.ErrorHandlingConfig
import Amazonka.AppFlow.Types.SalesforceDataTransferApi
import Amazonka.AppFlow.Types.WriteOperationType
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 Salesforce is being used as a
-- destination.
--
-- /See:/ 'newSalesforceDestinationProperties' smart constructor.
data SalesforceDestinationProperties = SalesforceDestinationProperties'
  { -- | Specifies which Salesforce API is used by Amazon AppFlow when your flow
    -- transfers data to Salesforce.
    --
    -- [AUTOMATIC]
    --     The default. Amazon AppFlow selects which API to use based on the
    --     number of records that your flow transfers to Salesforce. If your
    --     flow transfers fewer than 1,000 records, Amazon AppFlow uses
    --     Salesforce REST API. If your flow transfers 1,000 records or more,
    --     Amazon AppFlow uses Salesforce Bulk API 2.0.
    --
    --     Each of these Salesforce APIs structures data differently. If Amazon
    --     AppFlow selects the API automatically, be aware that, for recurring
    --     flows, the data output might vary from one flow run to the next. For
    --     example, if a flow runs daily, it might use REST API on one day to
    --     transfer 900 records, and it might use Bulk API 2.0 on the next day
    --     to transfer 1,100 records. For each of these flow runs, the
    --     respective Salesforce API formats the data differently. Some of the
    --     differences include how dates are formatted and null values are
    --     represented. Also, Bulk API 2.0 doesn\'t transfer Salesforce
    --     compound fields.
    --
    --     By choosing this option, you optimize flow performance for both
    --     small and large data transfers, but the tradeoff is inconsistent
    --     formatting in the output.
    --
    -- [BULKV2]
    --     Amazon AppFlow uses only Salesforce Bulk API 2.0. This API runs
    --     asynchronous data transfers, and it\'s optimal for large sets of
    --     data. By choosing this option, you ensure that your flow writes
    --     consistent output, but you optimize performance only for large data
    --     transfers.
    --
    --     Note that Bulk API 2.0 does not transfer Salesforce compound fields.
    --
    -- [REST_SYNC]
    --     Amazon AppFlow uses only Salesforce REST API. By choosing this
    --     option, you ensure that your flow writes consistent output, but you
    --     decrease performance for large data transfers that are better suited
    --     for Bulk API 2.0. In some cases, if your flow attempts to transfer a
    --     vary large set of data, it might fail with a timed out error.
    SalesforceDestinationProperties -> Maybe SalesforceDataTransferApi
dataTransferApi :: Prelude.Maybe SalesforceDataTransferApi,
    -- | The settings that determine how Amazon AppFlow handles an error when
    -- placing data in the Salesforce destination. For example, this setting
    -- would determine if the flow should fail after one insertion error, or
    -- continue and attempt to insert every record regardless of the initial
    -- failure. @ErrorHandlingConfig@ is a part of the destination connector
    -- details.
    SalesforceDestinationProperties -> Maybe ErrorHandlingConfig
errorHandlingConfig :: Prelude.Maybe ErrorHandlingConfig,
    -- | The name of the field that Amazon AppFlow uses as an ID when performing
    -- a write operation such as update or delete.
    SalesforceDestinationProperties -> Maybe [Text]
idFieldNames :: Prelude.Maybe [Prelude.Text],
    -- | This specifies the type of write operation to be performed in
    -- Salesforce. When the value is @UPSERT@, then @idFieldNames@ is required.
    SalesforceDestinationProperties -> Maybe WriteOperationType
writeOperationType :: Prelude.Maybe WriteOperationType,
    -- | The object specified in the Salesforce flow destination.
    SalesforceDestinationProperties -> Text
object' :: Prelude.Text
  }
  deriving (SalesforceDestinationProperties
-> SalesforceDestinationProperties -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SalesforceDestinationProperties
-> SalesforceDestinationProperties -> Bool
$c/= :: SalesforceDestinationProperties
-> SalesforceDestinationProperties -> Bool
== :: SalesforceDestinationProperties
-> SalesforceDestinationProperties -> Bool
$c== :: SalesforceDestinationProperties
-> SalesforceDestinationProperties -> Bool
Prelude.Eq, ReadPrec [SalesforceDestinationProperties]
ReadPrec SalesforceDestinationProperties
Int -> ReadS SalesforceDestinationProperties
ReadS [SalesforceDestinationProperties]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SalesforceDestinationProperties]
$creadListPrec :: ReadPrec [SalesforceDestinationProperties]
readPrec :: ReadPrec SalesforceDestinationProperties
$creadPrec :: ReadPrec SalesforceDestinationProperties
readList :: ReadS [SalesforceDestinationProperties]
$creadList :: ReadS [SalesforceDestinationProperties]
readsPrec :: Int -> ReadS SalesforceDestinationProperties
$creadsPrec :: Int -> ReadS SalesforceDestinationProperties
Prelude.Read, Int -> SalesforceDestinationProperties -> ShowS
[SalesforceDestinationProperties] -> ShowS
SalesforceDestinationProperties -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SalesforceDestinationProperties] -> ShowS
$cshowList :: [SalesforceDestinationProperties] -> ShowS
show :: SalesforceDestinationProperties -> String
$cshow :: SalesforceDestinationProperties -> String
showsPrec :: Int -> SalesforceDestinationProperties -> ShowS
$cshowsPrec :: Int -> SalesforceDestinationProperties -> ShowS
Prelude.Show, forall x.
Rep SalesforceDestinationProperties x
-> SalesforceDestinationProperties
forall x.
SalesforceDestinationProperties
-> Rep SalesforceDestinationProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SalesforceDestinationProperties x
-> SalesforceDestinationProperties
$cfrom :: forall x.
SalesforceDestinationProperties
-> Rep SalesforceDestinationProperties x
Prelude.Generic)

-- |
-- Create a value of 'SalesforceDestinationProperties' 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:
--
-- 'dataTransferApi', 'salesforceDestinationProperties_dataTransferApi' - Specifies which Salesforce API is used by Amazon AppFlow when your flow
-- transfers data to Salesforce.
--
-- [AUTOMATIC]
--     The default. Amazon AppFlow selects which API to use based on the
--     number of records that your flow transfers to Salesforce. If your
--     flow transfers fewer than 1,000 records, Amazon AppFlow uses
--     Salesforce REST API. If your flow transfers 1,000 records or more,
--     Amazon AppFlow uses Salesforce Bulk API 2.0.
--
--     Each of these Salesforce APIs structures data differently. If Amazon
--     AppFlow selects the API automatically, be aware that, for recurring
--     flows, the data output might vary from one flow run to the next. For
--     example, if a flow runs daily, it might use REST API on one day to
--     transfer 900 records, and it might use Bulk API 2.0 on the next day
--     to transfer 1,100 records. For each of these flow runs, the
--     respective Salesforce API formats the data differently. Some of the
--     differences include how dates are formatted and null values are
--     represented. Also, Bulk API 2.0 doesn\'t transfer Salesforce
--     compound fields.
--
--     By choosing this option, you optimize flow performance for both
--     small and large data transfers, but the tradeoff is inconsistent
--     formatting in the output.
--
-- [BULKV2]
--     Amazon AppFlow uses only Salesforce Bulk API 2.0. This API runs
--     asynchronous data transfers, and it\'s optimal for large sets of
--     data. By choosing this option, you ensure that your flow writes
--     consistent output, but you optimize performance only for large data
--     transfers.
--
--     Note that Bulk API 2.0 does not transfer Salesforce compound fields.
--
-- [REST_SYNC]
--     Amazon AppFlow uses only Salesforce REST API. By choosing this
--     option, you ensure that your flow writes consistent output, but you
--     decrease performance for large data transfers that are better suited
--     for Bulk API 2.0. In some cases, if your flow attempts to transfer a
--     vary large set of data, it might fail with a timed out error.
--
-- 'errorHandlingConfig', 'salesforceDestinationProperties_errorHandlingConfig' - The settings that determine how Amazon AppFlow handles an error when
-- placing data in the Salesforce destination. For example, this setting
-- would determine if the flow should fail after one insertion error, or
-- continue and attempt to insert every record regardless of the initial
-- failure. @ErrorHandlingConfig@ is a part of the destination connector
-- details.
--
-- 'idFieldNames', 'salesforceDestinationProperties_idFieldNames' - The name of the field that Amazon AppFlow uses as an ID when performing
-- a write operation such as update or delete.
--
-- 'writeOperationType', 'salesforceDestinationProperties_writeOperationType' - This specifies the type of write operation to be performed in
-- Salesforce. When the value is @UPSERT@, then @idFieldNames@ is required.
--
-- 'object'', 'salesforceDestinationProperties_object' - The object specified in the Salesforce flow destination.
newSalesforceDestinationProperties ::
  -- | 'object''
  Prelude.Text ->
  SalesforceDestinationProperties
newSalesforceDestinationProperties :: Text -> SalesforceDestinationProperties
newSalesforceDestinationProperties Text
pObject_ =
  SalesforceDestinationProperties'
    { $sel:dataTransferApi:SalesforceDestinationProperties' :: Maybe SalesforceDataTransferApi
dataTransferApi =
        forall a. Maybe a
Prelude.Nothing,
      $sel:errorHandlingConfig:SalesforceDestinationProperties' :: Maybe ErrorHandlingConfig
errorHandlingConfig = forall a. Maybe a
Prelude.Nothing,
      $sel:idFieldNames:SalesforceDestinationProperties' :: Maybe [Text]
idFieldNames = forall a. Maybe a
Prelude.Nothing,
      $sel:writeOperationType:SalesforceDestinationProperties' :: Maybe WriteOperationType
writeOperationType = forall a. Maybe a
Prelude.Nothing,
      $sel:object':SalesforceDestinationProperties' :: Text
object' = Text
pObject_
    }

-- | Specifies which Salesforce API is used by Amazon AppFlow when your flow
-- transfers data to Salesforce.
--
-- [AUTOMATIC]
--     The default. Amazon AppFlow selects which API to use based on the
--     number of records that your flow transfers to Salesforce. If your
--     flow transfers fewer than 1,000 records, Amazon AppFlow uses
--     Salesforce REST API. If your flow transfers 1,000 records or more,
--     Amazon AppFlow uses Salesforce Bulk API 2.0.
--
--     Each of these Salesforce APIs structures data differently. If Amazon
--     AppFlow selects the API automatically, be aware that, for recurring
--     flows, the data output might vary from one flow run to the next. For
--     example, if a flow runs daily, it might use REST API on one day to
--     transfer 900 records, and it might use Bulk API 2.0 on the next day
--     to transfer 1,100 records. For each of these flow runs, the
--     respective Salesforce API formats the data differently. Some of the
--     differences include how dates are formatted and null values are
--     represented. Also, Bulk API 2.0 doesn\'t transfer Salesforce
--     compound fields.
--
--     By choosing this option, you optimize flow performance for both
--     small and large data transfers, but the tradeoff is inconsistent
--     formatting in the output.
--
-- [BULKV2]
--     Amazon AppFlow uses only Salesforce Bulk API 2.0. This API runs
--     asynchronous data transfers, and it\'s optimal for large sets of
--     data. By choosing this option, you ensure that your flow writes
--     consistent output, but you optimize performance only for large data
--     transfers.
--
--     Note that Bulk API 2.0 does not transfer Salesforce compound fields.
--
-- [REST_SYNC]
--     Amazon AppFlow uses only Salesforce REST API. By choosing this
--     option, you ensure that your flow writes consistent output, but you
--     decrease performance for large data transfers that are better suited
--     for Bulk API 2.0. In some cases, if your flow attempts to transfer a
--     vary large set of data, it might fail with a timed out error.
salesforceDestinationProperties_dataTransferApi :: Lens.Lens' SalesforceDestinationProperties (Prelude.Maybe SalesforceDataTransferApi)
salesforceDestinationProperties_dataTransferApi :: Lens'
  SalesforceDestinationProperties (Maybe SalesforceDataTransferApi)
salesforceDestinationProperties_dataTransferApi = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SalesforceDestinationProperties' {Maybe SalesforceDataTransferApi
dataTransferApi :: Maybe SalesforceDataTransferApi
$sel:dataTransferApi:SalesforceDestinationProperties' :: SalesforceDestinationProperties -> Maybe SalesforceDataTransferApi
dataTransferApi} -> Maybe SalesforceDataTransferApi
dataTransferApi) (\s :: SalesforceDestinationProperties
s@SalesforceDestinationProperties' {} Maybe SalesforceDataTransferApi
a -> SalesforceDestinationProperties
s {$sel:dataTransferApi:SalesforceDestinationProperties' :: Maybe SalesforceDataTransferApi
dataTransferApi = Maybe SalesforceDataTransferApi
a} :: SalesforceDestinationProperties)

-- | The settings that determine how Amazon AppFlow handles an error when
-- placing data in the Salesforce destination. For example, this setting
-- would determine if the flow should fail after one insertion error, or
-- continue and attempt to insert every record regardless of the initial
-- failure. @ErrorHandlingConfig@ is a part of the destination connector
-- details.
salesforceDestinationProperties_errorHandlingConfig :: Lens.Lens' SalesforceDestinationProperties (Prelude.Maybe ErrorHandlingConfig)
salesforceDestinationProperties_errorHandlingConfig :: Lens' SalesforceDestinationProperties (Maybe ErrorHandlingConfig)
salesforceDestinationProperties_errorHandlingConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SalesforceDestinationProperties' {Maybe ErrorHandlingConfig
errorHandlingConfig :: Maybe ErrorHandlingConfig
$sel:errorHandlingConfig:SalesforceDestinationProperties' :: SalesforceDestinationProperties -> Maybe ErrorHandlingConfig
errorHandlingConfig} -> Maybe ErrorHandlingConfig
errorHandlingConfig) (\s :: SalesforceDestinationProperties
s@SalesforceDestinationProperties' {} Maybe ErrorHandlingConfig
a -> SalesforceDestinationProperties
s {$sel:errorHandlingConfig:SalesforceDestinationProperties' :: Maybe ErrorHandlingConfig
errorHandlingConfig = Maybe ErrorHandlingConfig
a} :: SalesforceDestinationProperties)

-- | The name of the field that Amazon AppFlow uses as an ID when performing
-- a write operation such as update or delete.
salesforceDestinationProperties_idFieldNames :: Lens.Lens' SalesforceDestinationProperties (Prelude.Maybe [Prelude.Text])
salesforceDestinationProperties_idFieldNames :: Lens' SalesforceDestinationProperties (Maybe [Text])
salesforceDestinationProperties_idFieldNames = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SalesforceDestinationProperties' {Maybe [Text]
idFieldNames :: Maybe [Text]
$sel:idFieldNames:SalesforceDestinationProperties' :: SalesforceDestinationProperties -> Maybe [Text]
idFieldNames} -> Maybe [Text]
idFieldNames) (\s :: SalesforceDestinationProperties
s@SalesforceDestinationProperties' {} Maybe [Text]
a -> SalesforceDestinationProperties
s {$sel:idFieldNames:SalesforceDestinationProperties' :: Maybe [Text]
idFieldNames = Maybe [Text]
a} :: SalesforceDestinationProperties) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | This specifies the type of write operation to be performed in
-- Salesforce. When the value is @UPSERT@, then @idFieldNames@ is required.
salesforceDestinationProperties_writeOperationType :: Lens.Lens' SalesforceDestinationProperties (Prelude.Maybe WriteOperationType)
salesforceDestinationProperties_writeOperationType :: Lens' SalesforceDestinationProperties (Maybe WriteOperationType)
salesforceDestinationProperties_writeOperationType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SalesforceDestinationProperties' {Maybe WriteOperationType
writeOperationType :: Maybe WriteOperationType
$sel:writeOperationType:SalesforceDestinationProperties' :: SalesforceDestinationProperties -> Maybe WriteOperationType
writeOperationType} -> Maybe WriteOperationType
writeOperationType) (\s :: SalesforceDestinationProperties
s@SalesforceDestinationProperties' {} Maybe WriteOperationType
a -> SalesforceDestinationProperties
s {$sel:writeOperationType:SalesforceDestinationProperties' :: Maybe WriteOperationType
writeOperationType = Maybe WriteOperationType
a} :: SalesforceDestinationProperties)

-- | The object specified in the Salesforce flow destination.
salesforceDestinationProperties_object :: Lens.Lens' SalesforceDestinationProperties Prelude.Text
salesforceDestinationProperties_object :: Lens' SalesforceDestinationProperties Text
salesforceDestinationProperties_object = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SalesforceDestinationProperties' {Text
object' :: Text
$sel:object':SalesforceDestinationProperties' :: SalesforceDestinationProperties -> Text
object'} -> Text
object') (\s :: SalesforceDestinationProperties
s@SalesforceDestinationProperties' {} Text
a -> SalesforceDestinationProperties
s {$sel:object':SalesforceDestinationProperties' :: Text
object' = Text
a} :: SalesforceDestinationProperties)

instance
  Data.FromJSON
    SalesforceDestinationProperties
  where
  parseJSON :: Value -> Parser SalesforceDestinationProperties
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SalesforceDestinationProperties"
      ( \Object
x ->
          Maybe SalesforceDataTransferApi
-> Maybe ErrorHandlingConfig
-> Maybe [Text]
-> Maybe WriteOperationType
-> Text
-> SalesforceDestinationProperties
SalesforceDestinationProperties'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"dataTransferApi")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"errorHandlingConfig")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"idFieldNames" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"writeOperationType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"object")
      )

instance
  Prelude.Hashable
    SalesforceDestinationProperties
  where
  hashWithSalt :: Int -> SalesforceDestinationProperties -> Int
hashWithSalt
    Int
_salt
    SalesforceDestinationProperties' {Maybe [Text]
Maybe ErrorHandlingConfig
Maybe SalesforceDataTransferApi
Maybe WriteOperationType
Text
object' :: Text
writeOperationType :: Maybe WriteOperationType
idFieldNames :: Maybe [Text]
errorHandlingConfig :: Maybe ErrorHandlingConfig
dataTransferApi :: Maybe SalesforceDataTransferApi
$sel:object':SalesforceDestinationProperties' :: SalesforceDestinationProperties -> Text
$sel:writeOperationType:SalesforceDestinationProperties' :: SalesforceDestinationProperties -> Maybe WriteOperationType
$sel:idFieldNames:SalesforceDestinationProperties' :: SalesforceDestinationProperties -> Maybe [Text]
$sel:errorHandlingConfig:SalesforceDestinationProperties' :: SalesforceDestinationProperties -> Maybe ErrorHandlingConfig
$sel:dataTransferApi:SalesforceDestinationProperties' :: SalesforceDestinationProperties -> Maybe SalesforceDataTransferApi
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SalesforceDataTransferApi
dataTransferApi
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ErrorHandlingConfig
errorHandlingConfig
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
idFieldNames
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe WriteOperationType
writeOperationType
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
object'

instance
  Prelude.NFData
    SalesforceDestinationProperties
  where
  rnf :: SalesforceDestinationProperties -> ()
rnf SalesforceDestinationProperties' {Maybe [Text]
Maybe ErrorHandlingConfig
Maybe SalesforceDataTransferApi
Maybe WriteOperationType
Text
object' :: Text
writeOperationType :: Maybe WriteOperationType
idFieldNames :: Maybe [Text]
errorHandlingConfig :: Maybe ErrorHandlingConfig
dataTransferApi :: Maybe SalesforceDataTransferApi
$sel:object':SalesforceDestinationProperties' :: SalesforceDestinationProperties -> Text
$sel:writeOperationType:SalesforceDestinationProperties' :: SalesforceDestinationProperties -> Maybe WriteOperationType
$sel:idFieldNames:SalesforceDestinationProperties' :: SalesforceDestinationProperties -> Maybe [Text]
$sel:errorHandlingConfig:SalesforceDestinationProperties' :: SalesforceDestinationProperties -> Maybe ErrorHandlingConfig
$sel:dataTransferApi:SalesforceDestinationProperties' :: SalesforceDestinationProperties -> Maybe SalesforceDataTransferApi
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe SalesforceDataTransferApi
dataTransferApi
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ErrorHandlingConfig
errorHandlingConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
idFieldNames
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe WriteOperationType
writeOperationType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
object'

instance Data.ToJSON SalesforceDestinationProperties where
  toJSON :: SalesforceDestinationProperties -> Value
toJSON SalesforceDestinationProperties' {Maybe [Text]
Maybe ErrorHandlingConfig
Maybe SalesforceDataTransferApi
Maybe WriteOperationType
Text
object' :: Text
writeOperationType :: Maybe WriteOperationType
idFieldNames :: Maybe [Text]
errorHandlingConfig :: Maybe ErrorHandlingConfig
dataTransferApi :: Maybe SalesforceDataTransferApi
$sel:object':SalesforceDestinationProperties' :: SalesforceDestinationProperties -> Text
$sel:writeOperationType:SalesforceDestinationProperties' :: SalesforceDestinationProperties -> Maybe WriteOperationType
$sel:idFieldNames:SalesforceDestinationProperties' :: SalesforceDestinationProperties -> Maybe [Text]
$sel:errorHandlingConfig:SalesforceDestinationProperties' :: SalesforceDestinationProperties -> Maybe ErrorHandlingConfig
$sel:dataTransferApi:SalesforceDestinationProperties' :: SalesforceDestinationProperties -> Maybe SalesforceDataTransferApi
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"dataTransferApi" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SalesforceDataTransferApi
dataTransferApi,
            (Key
"errorHandlingConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ErrorHandlingConfig
errorHandlingConfig,
            (Key
"idFieldNames" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
idFieldNames,
            (Key
"writeOperationType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe WriteOperationType
writeOperationType,
            forall a. a -> Maybe a
Prelude.Just (Key
"object" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
object')
          ]
      )