Class: AWSCDK::AppSync::CfnResolver::SyncConfigProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
app_sync/cfn_resolver.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:

  • conflict_detection (String)

    The Conflict Detection strategy to use.

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

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

  • lambda_conflict_handler_config (AWSCDK::IResolvable, AWSCDK::AppSync::CfnResolver::LambdaConflictHandlerConfigProperty, nil) (defaults to: nil)

    The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.



909
910
911
912
913
914
915
916
# File 'app_sync/cfn_resolver.rb', line 909

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::CfnResolver::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("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcHBzeW5jLkNmblJlc29sdmVyLkxhbWJkYUNvbmZsaWN0SGFuZGxlckNvbmZpZ1Byb3BlcnR5In1dfX0=")), "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.


925
926
927
# File 'app_sync/cfn_resolver.rb', line 925

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 .


934
935
936
# File 'app_sync/cfn_resolver.rb', line 934

def conflict_handler
  @conflict_handler
end

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

The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler.



939
940
941
# File 'app_sync/cfn_resolver.rb', line 939

def lambda_conflict_handler_config
  @lambda_conflict_handler_config
end

Class Method Details

.jsii_propertiesObject



941
942
943
944
945
946
947
# File 'app_sync/cfn_resolver.rb', line 941

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

Instance Method Details

#to_jsiiObject



949
950
951
952
953
954
955
956
957
# File 'app_sync/cfn_resolver.rb', line 949

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