1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

SNS ListSubscriptions

This commit is contained in:
phiggins 2011-02-02 00:40:13 -08:00 committed by geemus
parent 4b6cbb6912
commit 967a686bc9
3 changed files with 58 additions and 1 deletions

View file

@ -0,0 +1,29 @@
module Fog
module Parsers
module AWS
module SNS
class ListSubscriptions < Fog::Parsers::Base
def reset
@response = { 'Subscriptions' => [] }
@subscription = {}
end
def end_element(name)
case name
when "TopicArn", "Protocol", "SubscriptionArn", "Owner", "Endpoint"
@subscription[name] = @value
when "member"
@response['Subscriptions'] << @subscription
@subscription = {}
when 'RequestId', 'NextToken'
@response[name] = @value
end
end
end
end
end
end
end

View file

@ -0,0 +1,27 @@
module Fog
module AWS
class SNS
class Real
require 'fog/aws/parsers/sns/list_subscriptions'
def list_subscriptions(options = {})
request({
'Action' => 'ListSubscriptions',
:parser => Fog::Parsers::AWS::SNS::ListSubscriptions.new
}.merge!(options))
end
end
class Mock
def list_subscriptions
Fog::Mock.not_implemented
end
end
end
end
end

View file

@ -6,8 +6,9 @@ module Fog
recognizes :host, :path, :port, :scheme, :persistent
request_path 'fog/aws/requests/sns'
request :list_topics
request :get_topic_attributes
request :list_subscriptions
request :list_topics
class Mock