Class: AWSCDK::EventsTargets::AWSAPIInput

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
events_targets/awsapi_input.rb

Overview

Rule target input for an AwsApi target.

Direct Known Subclasses

AWSAPIProps

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action:, service:, api_version: nil, catch_error_pattern: nil, parameters: nil) ⇒ AWSAPIInput

Returns a new instance of AWSAPIInput.

Parameters:

  • action (String)

    The service action to call.

  • service (String)

    The service to call.

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

    API version to use for the service.

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

    The regex pattern to use to catch API errors.

  • parameters (Object, nil) (defaults to: nil)

    The parameters for the service action.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'events_targets/awsapi_input.rb', line 12

def initialize(action:, service:, api_version: nil, catch_error_pattern: nil, parameters: nil)
  @action = action
  Jsii::Type.check_type(@action, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "action")
  @service = service
  Jsii::Type.check_type(@service, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "service")
  @api_version = api_version
  Jsii::Type.check_type(@api_version, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "apiVersion") unless @api_version.nil?
  @catch_error_pattern = catch_error_pattern
  Jsii::Type.check_type(@catch_error_pattern, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "catchErrorPattern") unless @catch_error_pattern.nil?
  @parameters = parameters
  Jsii::Type.check_type(@parameters, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "parameters") unless @parameters.nil?
end

Instance Attribute Details

#actionString (readonly)

The service action to call.



29
30
31
# File 'events_targets/awsapi_input.rb', line 29

def action
  @action
end

#api_versionString? (readonly)

Deprecated.

the handler code was migrated to AWS SDK for JavaScript v3, which does not support this feature anymore

API version to use for the service.

Returns:

  • (String, nil)


39
40
41
# File 'events_targets/awsapi_input.rb', line 39

def api_version
  @api_version
end

#catch_error_patternString? (readonly)

Note:

Default: - do not catch errors

The regex pattern to use to catch API errors.

The code property of the Error object will be tested against this pattern. If there is a match an error will not be thrown.

Returns:

  • (String, nil)


48
49
50
# File 'events_targets/awsapi_input.rb', line 48

def catch_error_pattern
  @catch_error_pattern
end

#parametersObject? (readonly)

Note:

Default: - no parameters

The parameters for the service action.



54
55
56
# File 'events_targets/awsapi_input.rb', line 54

def parameters
  @parameters
end

#serviceString (readonly)

The service to call.



34
35
36
# File 'events_targets/awsapi_input.rb', line 34

def service
  @service
end

Class Method Details

.jsii_propertiesObject



56
57
58
59
60
61
62
63
64
# File 'events_targets/awsapi_input.rb', line 56

def self.jsii_properties
  {
    :action => "action",
    :service => "service",
    :api_version => "apiVersion",
    :catch_error_pattern => "catchErrorPattern",
    :parameters => "parameters",
  }
end

Instance Method Details

#to_jsiiObject



66
67
68
69
70
71
72
73
74
75
76
# File 'events_targets/awsapi_input.rb', line 66

def to_jsii
  result = {}
  result.merge!({
    "action" => @action,
    "service" => @service,
    "apiVersion" => @api_version,
    "catchErrorPattern" => @catch_error_pattern,
    "parameters" => @parameters,
  })
  result.compact
end