diff --git a/lib/fog/aws/parsers/sns/confirm_subscription.rb b/lib/fog/aws/parsers/sns/confirm_subscription.rb new file mode 100644 index 000000000..e719d22d2 --- /dev/null +++ b/lib/fog/aws/parsers/sns/confirm_subscription.rb @@ -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 diff --git a/lib/fog/aws/parsers/sns/unsubscribe.rb b/lib/fog/aws/parsers/sns/unsubscribe.rb new file mode 100644 index 000000000..dcab5e46f --- /dev/null +++ b/lib/fog/aws/parsers/sns/unsubscribe.rb @@ -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 diff --git a/lib/fog/aws/requests/sns/confirm_subscription.rb b/lib/fog/aws/requests/sns/confirm_subscription.rb new file mode 100644 index 000000000..d9142406f --- /dev/null +++ b/lib/fog/aws/requests/sns/confirm_subscription.rb @@ -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 diff --git a/lib/fog/aws/requests/sns/unsubscribe.rb b/lib/fog/aws/requests/sns/unsubscribe.rb new file mode 100644 index 000000000..18a11fb97 --- /dev/null +++ b/lib/fog/aws/requests/sns/unsubscribe.rb @@ -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 diff --git a/lib/fog/aws/sns.rb b/lib/fog/aws/sns.rb index 429bd533b..58ea011e1 100644 --- a/lib/fog/aws/sns.rb +++ b/lib/fog/aws/sns.rb @@ -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