mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
SNS ConfirmSubscription and Unsubscribe
This commit is contained in:
parent
71b7a44132
commit
f3f9650896
5 changed files with 102 additions and 0 deletions
24
lib/fog/aws/parsers/sns/confirm_subscription.rb
Normal file
24
lib/fog/aws/parsers/sns/confirm_subscription.rb
Normal file
|
@ -0,0 +1,24 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module SNS
|
||||
|
||||
class ConfirmSubscription < Fog::Parsers::Base
|
||||
|
||||
def reset
|
||||
@response = {}
|
||||
end
|
||||
|
||||
def end_element(name)
|
||||
case name
|
||||
when 'SubscriptionArn', 'RequestId'
|
||||
@response[name] = @value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
24
lib/fog/aws/parsers/sns/unsubscribe.rb
Normal file
24
lib/fog/aws/parsers/sns/unsubscribe.rb
Normal file
|
@ -0,0 +1,24 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module SNS
|
||||
|
||||
class Unsubscribe < Fog::Parsers::Base
|
||||
|
||||
def reset
|
||||
@response = {}
|
||||
end
|
||||
|
||||
def end_element(name)
|
||||
case name
|
||||
when 'RequestId'
|
||||
@response[name] = @value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
26
lib/fog/aws/requests/sns/confirm_subscription.rb
Normal file
26
lib/fog/aws/requests/sns/confirm_subscription.rb
Normal file
|
@ -0,0 +1,26 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class SNS
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/sns/confirm_subscription'
|
||||
|
||||
def confirm_subscription(options = {})
|
||||
request({
|
||||
'Action' => 'ConfirmSubscription',
|
||||
:parser => Fog::Parsers::AWS::SNS::ConfirmSubscription.new
|
||||
}.merge!(options))
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
class Mock
|
||||
|
||||
def confirm_subscription(options = {})
|
||||
Fog::Mock.not_implemented
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
26
lib/fog/aws/requests/sns/unsubscribe.rb
Normal file
26
lib/fog/aws/requests/sns/unsubscribe.rb
Normal file
|
@ -0,0 +1,26 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class SNS
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/sns/unsubscribe'
|
||||
|
||||
def unsubscribe(options = {})
|
||||
request({
|
||||
'Action' => 'Unsubscribe',
|
||||
:parser => Fog::Parsers::AWS::SNS::Unsubscribe.new
|
||||
}.merge!(options))
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
class Mock
|
||||
|
||||
def unsubscribe(options = {})
|
||||
Fog::Mock.not_implemented
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -7,6 +7,7 @@ module Fog
|
|||
|
||||
request_path 'fog/aws/requests/sns'
|
||||
request :add_permission
|
||||
request :confirm_subscription
|
||||
request :create_topic
|
||||
request :delete_topic
|
||||
request :get_topic_attributes
|
||||
|
@ -17,6 +18,7 @@ module Fog
|
|||
request :remove_permission
|
||||
request :set_topic_attributes
|
||||
request :subscribe
|
||||
request :unsubscribe
|
||||
|
||||
class Mock
|
||||
|
||||
|
|
Loading…
Reference in a new issue