lib/mws/subscriptions/client.rb in peddler-1.6.3 vs lib/mws/subscriptions/client.rb in peddler-1.6.4
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
require 'peddler/client'
module MWS
module Subscriptions
# The Amazon MWS Subscriptions API section enables you to subscribe to
@@ -16,11 +18,12 @@
#
# @see http://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_RegisterDestination.html
# @param [String] sqs_queue_url
# @param [String] marketplace_id
# @return [Peddler::XMLParser]
- def register_destination(sqs_queue_url, marketplace_id = primary_marketplace_id)
+ def register_destination(sqs_queue_url,
+ marketplace_id = primary_marketplace_id)
operation('RegisterDestination')
.add('MarketplaceId' => marketplace_id)
.add(build_destination(sqs_queue_url))
run
@@ -30,11 +33,12 @@
#
# @see http://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_DeregisterDestination.html
# @param [String] sqs_queue_url
# @param [String] marketplace_id
# @return [Peddler::XMLParser]
- def deregister_destination(sqs_queue_url, marketplace_id = primary_marketplace_id)
+ def deregister_destination(sqs_queue_url,
+ marketplace_id = primary_marketplace_id)
operation('DeregisterDestination')
.add('MarketplaceId' => marketplace_id)
.add(build_destination(sqs_queue_url))
run
@@ -56,11 +60,13 @@
#
# @see http://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_SendTestNotificationToDestination.html
# @param [String] sqs_queue_url
# @param [String] marketplace_id
# @return [Peddler::XMLParser]
- def send_test_notification_to_destination(sqs_queue_url, marketplace_id = primary_marketplace_id)
+ def send_test_notification_to_destination(sqs_queue_url,
+ marketplace_id =
+ primary_marketplace_id)
operation('SendTestNotificationToDestination')
.add('MarketplaceId' => marketplace_id)
.add(build_destination(sqs_queue_url))
run
@@ -71,11 +77,12 @@
# @see http://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_CreateSubscription.html
# @param [String] notification_type
# @param [String] sqs_queue_url
# @param [String] marketplace_id
# @return [Peddler::XMLParser]
- def create_subscription(notification_type, sqs_queue_url, marketplace_id = primary_marketplace_id)
+ def create_subscription(notification_type, sqs_queue_url,
+ marketplace_id = primary_marketplace_id)
operation('CreateSubscription')
.add('MarketplaceId' => marketplace_id)
.add(build_subscription(notification_type, sqs_queue_url))
run
@@ -86,11 +93,12 @@
# @see http://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_GetSubscription.html
# @param [String] notification_type
# @param [String] sqs_queue_url
# @param [String] marketplace_id
# @return [Peddler::XMLParser]
- def get_subscription(notification_type, sqs_queue_url, marketplace_id = primary_marketplace_id)
+ def get_subscription(notification_type, sqs_queue_url,
+ marketplace_id = primary_marketplace_id)
operation('GetSubscription')
.add(
'MarketplaceId' => marketplace_id,
'NotificationType' => notification_type
)
@@ -104,11 +112,12 @@
# @see http://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_DeleteSubscription.html
# @param [String] notification_type
# @param [String] sqs_queue_url
# @param [String] marketplace_id
# @return [Peddler::XMLParser]
- def delete_subscription(notification_type, sqs_queue_url, marketplace_id = primary_marketplace_id)
+ def delete_subscription(notification_type, sqs_queue_url,
+ marketplace_id = primary_marketplace_id)
operation('DeleteSubscription')
.add(
'MarketplaceId' => marketplace_id,
'NotificationType' => notification_type
)
@@ -135,11 +144,12 @@
# @param [String] notification_type
# @param [String] sqs_queue_url
# @param [Boolean] enabled
# @param [String] marketplace_id
# @return [Peddler::XMLParser]
- def update_subscription(notification_type, sqs_queue_url, enabled, marketplace_id = primary_marketplace_id)
+ def update_subscription(notification_type, sqs_queue_url, enabled,
+ marketplace_id = primary_marketplace_id)
operation('UpdateSubscription')
.add('MarketplaceId' => marketplace_id)
.add(build_subscription(notification_type, sqs_queue_url, enabled))
run
@@ -167,11 +177,13 @@
def build_subscription(notification_type, sqs_queue_url, enabled = true)
{
'Subscription.IsEnabled' => enabled,
'Subscription.NotificationType' => notification_type,
'Subscription.Destination.DeliveryChannel' => 'SQS',
- 'Subscription.Destination.AttributeList.member.1.Key' => 'sqsQueueUrl',
- 'Subscription.Destination.AttributeList.member.1.Value' => sqs_queue_url
+ 'Subscription.Destination.AttributeList.member.1.Key' =>
+ 'sqsQueueUrl',
+ 'Subscription.Destination.AttributeList.member.1.Value' =>
+ sqs_queue_url
}
end
end
end
end