mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
SNS ListSubscriptionsByTopic
This commit is contained in:
parent
967a686bc9
commit
2870fdea56
3 changed files with 57 additions and 0 deletions
29
lib/fog/aws/parsers/sns/list_subscriptions_by_topic.rb
Normal file
29
lib/fog/aws/parsers/sns/list_subscriptions_by_topic.rb
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
module Fog
|
||||||
|
module Parsers
|
||||||
|
module AWS
|
||||||
|
module SNS
|
||||||
|
|
||||||
|
class ListSubscriptionsByTopic < 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_by_topic.rb
Normal file
27
lib/fog/aws/requests/sns/list_subscriptions_by_topic.rb
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
module Fog
|
||||||
|
module AWS
|
||||||
|
class SNS
|
||||||
|
class Real
|
||||||
|
|
||||||
|
require 'fog/aws/parsers/sns/list_subscriptions_by_topic'
|
||||||
|
|
||||||
|
def list_subscriptions_by_topic(options = {})
|
||||||
|
request({
|
||||||
|
'Action' => 'ListSubscriptionsByTopic',
|
||||||
|
:parser => Fog::Parsers::AWS::SNS::ListSubscriptionsByTopic.new
|
||||||
|
}.merge!(options))
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
class Mock
|
||||||
|
|
||||||
|
def list_subscriptions_by_topic
|
||||||
|
Fog::Mock.not_implemented
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -8,6 +8,7 @@ module Fog
|
||||||
request_path 'fog/aws/requests/sns'
|
request_path 'fog/aws/requests/sns'
|
||||||
request :get_topic_attributes
|
request :get_topic_attributes
|
||||||
request :list_subscriptions
|
request :list_subscriptions
|
||||||
|
request :list_subscriptions_by_topic
|
||||||
request :list_topics
|
request :list_topics
|
||||||
|
|
||||||
class Mock
|
class Mock
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue