lib/mws/subscriptions/client.rb in peddler-1.6.7 vs lib/mws/subscriptions/client.rb in peddler-2.0.0

- old
+ new

@@ -9,156 +9,145 @@ # the operations in the Subscriptions API section, you can register to # receive important information from Amazon without having to poll the # Amazon MWS service. Instead, the information is sent directly to you when # an event occurs to which you are subscribed. class Client < ::Peddler::Client - version '2013-07-01' - path "/Subscriptions/#{version}" + self.version = '2013-07-01' + self.path = "/Subscriptions/#{version}" # Registers a new destination to receive notifications # - # @see http://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_RegisterDestination.html + # @see https://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) operation('RegisterDestination') .add('MarketplaceId' => marketplace_id) .add(build_destination(sqs_queue_url)) run end # Removes an existing destination from the list of registered destinations # - # @see http://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_DeregisterDestination.html + # @see https://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) operation('DeregisterDestination') .add('MarketplaceId' => marketplace_id) .add(build_destination(sqs_queue_url)) run end # Lists all registered destinations # - # @see http://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_ListRegisteredDestinations.html + # @see https://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_ListRegisteredDestinations.html # @param [String] marketplace_id # @return [Peddler::XMLParser] - def list_registered_destinations(marketplace_id = primary_marketplace_id) + def list_registered_destinations(marketplace_id) operation('ListRegisteredDestinations') .add('MarketplaceId' => marketplace_id) run end # Sends a test notification to an existing destination # - # @see http://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_SendTestNotificationToDestination.html + # @see https://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) operation('SendTestNotificationToDestination') .add('MarketplaceId' => marketplace_id) .add(build_destination(sqs_queue_url)) run end # Creates a new subscription # - # @see http://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_CreateSubscription.html + # @see https://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) operation('CreateSubscription') .add('MarketplaceId' => marketplace_id) .add(build_subscription(notification_type, sqs_queue_url)) run end # Gets a subscription # - # @see http://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_GetSubscription.html + # @see https://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) operation('GetSubscription') - .add( - 'MarketplaceId' => marketplace_id, - 'NotificationType' => notification_type - ) + .add('MarketplaceId' => marketplace_id, + 'NotificationType' => notification_type) .add(build_destination(sqs_queue_url)) run end # Deletes a subscription # - # @see http://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_DeleteSubscription.html + # @see https://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) operation('DeleteSubscription') - .add( - 'MarketplaceId' => marketplace_id, - 'NotificationType' => notification_type - ) + .add('MarketplaceId' => marketplace_id, + 'NotificationType' => notification_type) .add(build_destination(sqs_queue_url)) run end # Lists current subscriptions # - # @see http://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_ListSubscriptions.html + # @see https://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_ListSubscriptions.html # @param [String] marketplace_id # @return [Peddler::XMLParser] - def list_subscriptions(marketplace_id = primary_marketplace_id) + def list_subscriptions(marketplace_id) operation('ListSubscriptions') .add('MarketplaceId' => marketplace_id) run end # Updates a subscription # - # @see http://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_UpdateSubscription.html + # @see https://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_UpdateSubscription.html # @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) + marketplace_id) operation('UpdateSubscription') .add('MarketplaceId' => marketplace_id) .add(build_subscription(notification_type, sqs_queue_url, enabled)) run end # Gets the service status of the API # - # @see http://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_GetServiceStatus.html + # @see https://docs.developer.amazonservices.com/en_US/subscriptions/Subscriptions_GetServiceStatus.html # @return [Peddler::XMLParser] def get_service_status operation('GetServiceStatus') run end