Module: AWS::SNS::HasDeliveryPolicy

Included in:
Subscription, Topic
Defined in:
lib/aws/sns/has_delivery_policy.rb

Overview

A module shared between Topic and Subscription. Provides methods for getting and setting the delivery policy and for getting the effective delivery policy.

Instance Method Summary collapse

Instance Method Details

#delivery_policynil, Hash

Returns the delivery policy.

Returns:

  • (nil, Hash)

    Returns the delivery policy.



23
24
25
# File 'lib/aws/sns/has_delivery_policy.rb', line 23

def delivery_policy
  parse_delivery_policy(delivery_policy_json)
end

#delivery_policy=(policy) ⇒ Object

Parameters:

  • policy (nil, Hash, String<JSON>)

    A delivery policy. You can pass a JSON string, A policy hash or nil.



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/aws/sns/has_delivery_policy.rb', line 34

def delivery_policy= policy

  policy_json = case policy
  when nil then ''
  when String then policy
  else policy.to_json
  end

  update_delivery_policy(policy_json)

end

#delivery_policy_jsonnil, String

Returns the delivery policy JSON string.

Returns:

  • (nil, String)

    Returns the delivery policy JSON string.

Raises:

  • (NotImplementedError)


47
48
49
# File 'lib/aws/sns/has_delivery_policy.rb', line 47

def delivery_policy_json
  raise NotImplementedError
end

#effective_delivery_policyHash

Returns the effective delivery policy.

Returns:

  • (Hash)

    Returns the effective delivery policy.



28
29
30
# File 'lib/aws/sns/has_delivery_policy.rb', line 28

def effective_delivery_policy
  parse_delivery_policy(effective_delivery_policy_json)
end

#effective_delivery_policy_jsonString

Returns the effective delivery policy JSON string.

Returns:

  • (String)

    Returns the effective delivery policy JSON string.

Raises:

  • (NotImplementedError)


52
53
54
# File 'lib/aws/sns/has_delivery_policy.rb', line 52

def effective_delivery_policy_json
  raise NotImplementedError
end