Class: AWSCDK::SNS::DeliveryPolicy

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
sns/delivery_policy.rb

Overview

Options for customising the delivery of SNS messages to HTTP/S endpoints.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(healthy_retry_policy: nil, request_policy: nil, throttle_policy: nil) ⇒ DeliveryPolicy

Returns a new instance of DeliveryPolicy.

Parameters:

  • healthy_retry_policy (AWSCDK::SNS::HealthyRetryPolicy, nil) (defaults to: nil)

    The retry policy of the delivery of SNS messages to HTTP/S endpoints.

  • request_policy (AWSCDK::SNS::RequestPolicy, nil) (defaults to: nil)

    The request of the content sent in AWS SNS HTTP/S requests.

  • throttle_policy (AWSCDK::SNS::ThrottlePolicy, nil) (defaults to: nil)

    The throttling policy of the delivery of SNS messages to HTTP/S endpoints.



10
11
12
13
14
15
16
17
# File 'sns/delivery_policy.rb', line 10

def initialize(healthy_retry_policy: nil, request_policy: nil, throttle_policy: nil)
  @healthy_retry_policy = healthy_retry_policy.is_a?(Hash) ? ::AWSCDK::SNS::HealthyRetryPolicy.new(**healthy_retry_policy.transform_keys(&:to_sym)) : healthy_retry_policy
  Jsii::Type.check_type(@healthy_retry_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc25zLkhlYWx0aHlSZXRyeVBvbGljeSJ9")), "healthyRetryPolicy") unless @healthy_retry_policy.nil?
  @request_policy = request_policy.is_a?(Hash) ? ::AWSCDK::SNS::RequestPolicy.new(**request_policy.transform_keys(&:to_sym)) : request_policy
  Jsii::Type.check_type(@request_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc25zLlJlcXVlc3RQb2xpY3kifQ==")), "requestPolicy") unless @request_policy.nil?
  @throttle_policy = throttle_policy.is_a?(Hash) ? ::AWSCDK::SNS::ThrottlePolicy.new(**throttle_policy.transform_keys(&:to_sym)) : throttle_policy
  Jsii::Type.check_type(@throttle_policy, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc25zLlRocm90dGxlUG9saWN5In0=")), "throttlePolicy") unless @throttle_policy.nil?
end

Instance Attribute Details

#healthy_retry_policyAWSCDK::SNS::HealthyRetryPolicy? (readonly)

Note:

Default: - Amazon SNS attempts up to three retries with a delay between failed attempts set at 20 seconds

The retry policy of the delivery of SNS messages to HTTP/S endpoints.



23
24
25
# File 'sns/delivery_policy.rb', line 23

def healthy_retry_policy
  @healthy_retry_policy
end

#request_policyAWSCDK::SNS::RequestPolicy? (readonly)

Note:

Default: - The content type is set to 'text/plain; charset=UTF-8'

The request of the content sent in AWS SNS HTTP/S requests.

Returns:



28
29
30
# File 'sns/delivery_policy.rb', line 28

def request_policy
  @request_policy
end

#throttle_policyAWSCDK::SNS::ThrottlePolicy? (readonly)

Note:

Default: - No throttling

The throttling policy of the delivery of SNS messages to HTTP/S endpoints.

Returns:



33
34
35
# File 'sns/delivery_policy.rb', line 33

def throttle_policy
  @throttle_policy
end

Class Method Details

.jsii_propertiesObject



35
36
37
38
39
40
41
# File 'sns/delivery_policy.rb', line 35

def self.jsii_properties
  {
    :healthy_retry_policy => "healthyRetryPolicy",
    :request_policy => "requestPolicy",
    :throttle_policy => "throttlePolicy",
  }
end

Instance Method Details

#to_jsiiObject



43
44
45
46
47
48
49
50
51
# File 'sns/delivery_policy.rb', line 43

def to_jsii
  result = {}
  result.merge!({
    "healthyRetryPolicy" => @healthy_retry_policy,
    "requestPolicy" => @request_policy,
    "throttlePolicy" => @throttle_policy,
  })
  result.compact
end