mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
SNS Publish
This commit is contained in:
parent
e92ca191d7
commit
e92d4edb6d
3 changed files with 51 additions and 0 deletions
24
lib/fog/aws/parsers/sns/publish.rb
Normal file
24
lib/fog/aws/parsers/sns/publish.rb
Normal file
|
@ -0,0 +1,24 @@
|
|||
module Fog
|
||||
module Parsers
|
||||
module AWS
|
||||
module SNS
|
||||
|
||||
class Publish < Fog::Parsers::Base
|
||||
|
||||
def reset
|
||||
@response = {}
|
||||
end
|
||||
|
||||
def end_element(name)
|
||||
case name
|
||||
when 'MessageId', 'RequestId'
|
||||
@response[name] = @value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
26
lib/fog/aws/requests/sns/publish.rb
Normal file
26
lib/fog/aws/requests/sns/publish.rb
Normal file
|
@ -0,0 +1,26 @@
|
|||
module Fog
|
||||
module AWS
|
||||
class SNS
|
||||
class Real
|
||||
|
||||
require 'fog/aws/parsers/sns/publish'
|
||||
|
||||
def publish(options = {})
|
||||
request({
|
||||
'Action' => 'Publish',
|
||||
:parser => Fog::Parsers::AWS::SNS::Publish.new
|
||||
}.merge!(options))
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
class Mock
|
||||
|
||||
def publish(options = {})
|
||||
Fog::Mock.not_implemented
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -12,6 +12,7 @@ module Fog
|
|||
request :list_subscriptions
|
||||
request :list_subscriptions_by_topic
|
||||
request :list_topics
|
||||
request :publish
|
||||
|
||||
class Mock
|
||||
|
||||
|
|
Loading…
Reference in a new issue