Class: AWSCDK::AppFlow::CfnFlow::SalesforceDestinationPropertiesProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
app_flow/cfn_flow.rb

Overview

The properties that are applied when Salesforce is being used as a destination.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object:, data_transfer_api: nil, error_handling_config: nil, id_field_names: nil, write_operation_type: nil) ⇒ SalesforceDestinationPropertiesProperty

Returns a new instance of SalesforceDestinationPropertiesProperty.

Parameters:

  • object (String)

    The object specified in the Salesforce flow destination.

  • data_transfer_api (String, nil) (defaults to: nil)

    Specifies which Salesforce API is used by Amazon AppFlow when your flow transfers data to Salesforce.

  • error_handling_config (AWSCDK::IResolvable, AWSCDK::AppFlow::CfnFlow::ErrorHandlingConfigProperty, nil) (defaults to: nil)

    The settings that determine how Amazon AppFlow handles an error when placing data in the Salesforce destination.

  • id_field_names (Array<String>, nil) (defaults to: nil)

    The name of the field that Amazon AppFlow uses as an ID when performing a write operation such as update or delete.

  • write_operation_type (String, nil) (defaults to: nil)

    This specifies the type of write operation to be performed in Salesforce.



2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
# File 'app_flow/cfn_flow.rb', line 2343

def initialize(object:, data_transfer_api: nil, error_handling_config: nil, id_field_names: nil, write_operation_type: nil)
  @object = object
  Jsii::Type.check_type(@object, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "object")
  @data_transfer_api = data_transfer_api
  Jsii::Type.check_type(@data_transfer_api, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "dataTransferApi") unless @data_transfer_api.nil?
  @error_handling_config = error_handling_config.is_a?(Hash) ? ::AWSCDK::AppFlow::CfnFlow::ErrorHandlingConfigProperty.new(**error_handling_config.transform_keys(&:to_sym)) : error_handling_config
  Jsii::Type.check_type(@error_handling_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcHBmbG93LkNmbkZsb3cuRXJyb3JIYW5kbGluZ0NvbmZpZ1Byb3BlcnR5In1dfX0=")), "errorHandlingConfig") unless @error_handling_config.nil?
  @id_field_names = id_field_names
  Jsii::Type.check_type(@id_field_names, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "idFieldNames") unless @id_field_names.nil?
  @write_operation_type = write_operation_type
  Jsii::Type.check_type(@write_operation_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "writeOperationType") unless @write_operation_type.nil?
end

Instance Attribute Details

#data_transfer_apiString? (readonly)

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.


2377
2378
2379
# File 'app_flow/cfn_flow.rb', line 2377

def data_transfer_api
  @data_transfer_api
end

#error_handling_configAWSCDK::IResolvable, ... (readonly)

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.



2384
2385
2386
# File 'app_flow/cfn_flow.rb', line 2384

def error_handling_config
  @error_handling_config
end

#id_field_namesArray<String>? (readonly)

The name of the field that Amazon AppFlow uses as an ID when performing a write operation such as update or delete.



2389
2390
2391
# File 'app_flow/cfn_flow.rb', line 2389

def id_field_names
  @id_field_names
end

#objectString (readonly)

The object specified in the Salesforce flow destination.



2360
2361
2362
# File 'app_flow/cfn_flow.rb', line 2360

def object
  @object
end

#write_operation_typeString? (readonly)

This specifies the type of write operation to be performed in Salesforce.

When the value is UPSERT , then id_field_names is required.



2396
2397
2398
# File 'app_flow/cfn_flow.rb', line 2396

def write_operation_type
  @write_operation_type
end

Class Method Details

.jsii_propertiesObject



2398
2399
2400
2401
2402
2403
2404
2405
2406
# File 'app_flow/cfn_flow.rb', line 2398

def self.jsii_properties
  {
    :object => "object",
    :data_transfer_api => "dataTransferApi",
    :error_handling_config => "errorHandlingConfig",
    :id_field_names => "idFieldNames",
    :write_operation_type => "writeOperationType",
  }
end

Instance Method Details

#to_jsiiObject



2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
# File 'app_flow/cfn_flow.rb', line 2408

def to_jsii
  result = {}
  result.merge!({
    "object" => @object,
    "dataTransferApi" => @data_transfer_api,
    "errorHandlingConfig" => @error_handling_config,
    "idFieldNames" => @id_field_names,
    "writeOperationType" => @write_operation_type,
  })
  result.compact
end