Class: AWSCDK::AppSync::CfnFunctionConfiguration::SyncConfigProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
app_sync/cfn_function_configuration.rb

Overview

Describes a Sync configuration for a resolver.

Specifies which Conflict Detection strategy and Resolution strategy to use when the resolver is invoked.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(conflict_detection:, conflict_handler: nil, lambda_conflict_handler_config: nil) ⇒ SyncConfigProperty

Returns a new instance of SyncConfigProperty.

Parameters:



787
788
789
790
791
792
793
794
# File 'app_sync/cfn_function_configuration.rb', line 787

def initialize(conflict_detection:, conflict_handler: nil, lambda_conflict_handler_config: nil)
  @conflict_detection = conflict_detection
  Jsii::Type.check_type(@conflict_detection, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "conflictDetection")
  @conflict_handler = conflict_handler
  Jsii::Type.check_type(@conflict_handler, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "conflictHandler") unless @conflict_handler.nil?
  @lambda_conflict_handler_config = lambda_conflict_handler_config.is_a?(Hash) ? ::AWSCDK::AppSync::CfnFunctionConfiguration::LambdaConflictHandlerConfigProperty.new(**lambda_conflict_handler_config.transform_keys(&:to_sym)) : lambda_conflict_handler_config
  Jsii::Type.check_type(@lambda_conflict_handler_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcHBzeW5jLkNmbkZ1bmN0aW9uQ29uZmlndXJhdGlvbi5MYW1iZGFDb25mbGljdEhhbmRsZXJDb25maWdQcm9wZXJ0eSJ9XX19")), "lambdaConflictHandlerConfig") unless @lambda_conflict_handler_config.nil?
end

Instance Attribute Details

#conflict_detectionString (readonly)

The Conflict Detection strategy to use.

  • VERSION : Detect conflicts based on object versions for this resolver.
  • NONE : Do not detect conflicts when invoking this resolver.


803
804
805
# File 'app_sync/cfn_function_configuration.rb', line 803

def conflict_detection
  @conflict_detection
end

#conflict_handlerString? (readonly)

The Conflict Resolution strategy to perform in the event of a conflict.

  • OPTIMISTIC_CONCURRENCY : Resolve conflicts by rejecting mutations when versions don't match the latest version at the server.
  • AUTOMERGE : Resolve conflicts with the Automerge conflict resolution strategy.
  • LAMBDA : Resolve conflicts with an AWS Lambda function supplied in the LambdaConflictHandlerConfig .


812
813
814
# File 'app_sync/cfn_function_configuration.rb', line 812

def conflict_handler
  @conflict_handler
end

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

The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.



817
818
819
# File 'app_sync/cfn_function_configuration.rb', line 817

def lambda_conflict_handler_config
  @lambda_conflict_handler_config
end

Class Method Details

.jsii_propertiesObject



819
820
821
822
823
824
825
# File 'app_sync/cfn_function_configuration.rb', line 819

def self.jsii_properties
  {
    :conflict_detection => "conflictDetection",
    :conflict_handler => "conflictHandler",
    :lambda_conflict_handler_config => "lambdaConflictHandlerConfig",
  }
end

Instance Method Details

#to_jsiiObject



827
828
829
830
831
832
833
834
835
# File 'app_sync/cfn_function_configuration.rb', line 827

def to_jsii
  result = {}
  result.merge!({
    "conflictDetection" => @conflict_detection,
    "conflictHandler" => @conflict_handler,
    "lambdaConflictHandlerConfig" => @lambda_conflict_handler_config,
  })
  result.compact
end