mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
SNS ListSubscriptions
This commit is contained in:
parent
4b6cbb6912
commit
967a686bc9
3 changed files with 58 additions and 1 deletions
29
lib/fog/aws/parsers/sns/list_subscriptions.rb
Normal file
29
lib/fog/aws/parsers/sns/list_subscriptions.rb
Normal 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
|
27
lib/fog/aws/requests/sns/list_subscriptions.rb
Normal file
27
lib/fog/aws/requests/sns/list_subscriptions.rb
Normal 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
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue