Class: MWS::Subscriptions::Client
- Inherits:
-
Peddler::Client
- Object
- Peddler::Client
- MWS::Subscriptions::Client
- Defined in:
- lib/mws/subscriptions/client.rb
Overview
The Amazon MWS Subscriptions API section enables you to subscribe to receive notifications that are relevant to your business with Amazon. With 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.
Instance Attribute Summary
Attributes inherited from Peddler::Client
#auth_token, #body, #merchant_id, #path, #primary_marketplace_id, #version
Instance Method Summary collapse
-
#create_subscription(notification_type, sqs_queue_url, marketplace_id = primary_marketplace_id) ⇒ Peddler::XMLParser
Creates a new subscription.
-
#delete_subscription(notification_type, sqs_queue_url, marketplace_id = primary_marketplace_id) ⇒ Peddler::XMLParser
Deletes a subscription.
-
#deregister_destination(sqs_queue_url, marketplace_id = primary_marketplace_id) ⇒ Peddler::XMLParser
Removes an existing destination from the list of registered destinations.
-
#get_service_status ⇒ Peddler::XMLParser
Gets the service status of the API.
-
#get_subscription(notification_type, sqs_queue_url, marketplace_id = primary_marketplace_id) ⇒ Peddler::XMLParser
Gets a subscription.
-
#list_registered_destinations(marketplace_id = primary_marketplace_id) ⇒ Peddler::XMLParser
Lists all registered destinations.
-
#list_subscriptions(marketplace_id = primary_marketplace_id) ⇒ Peddler::XMLParser
Lists current subscriptions.
-
#register_destination(sqs_queue_url, marketplace_id = primary_marketplace_id) ⇒ Peddler::XMLParser
Registers a new destination to receive notifications.
-
#send_test_notification_to_destination(sqs_queue_url, marketplace_id = primary_marketplace_id) ⇒ Peddler::XMLParser
Sends a test notification to an existing destination.
-
#update_subscription(notification_type, sqs_queue_url, enabled, marketplace_id = primary_marketplace_id) ⇒ Peddler::XMLParser
Updates a subscription.
Methods inherited from Peddler::Client
#aws_endpoint, #defaults, #error_handler, #headers, #initialize, #marketplace, #marketplace_id, #marketplace_id=, on_error, #on_error, #operation, path, #run, version
Constructor Details
This class inherits a constructor from Peddler::Client
Instance Method Details
#create_subscription(notification_type, sqs_queue_url, marketplace_id = primary_marketplace_id) ⇒ Peddler::XMLParser
Creates a new subscription
82 83 84 85 86 87 88 89 |
# File 'lib/mws/subscriptions/client.rb', line 82 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 end |
#delete_subscription(notification_type, sqs_queue_url, marketplace_id = primary_marketplace_id) ⇒ Peddler::XMLParser
Deletes a subscription
117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/mws/subscriptions/client.rb', line 117 def delete_subscription(notification_type, sqs_queue_url, marketplace_id = primary_marketplace_id) operation('DeleteSubscription') .add( 'MarketplaceId' => marketplace_id, 'NotificationType' => notification_type ) .add(build_destination(sqs_queue_url)) run end |
#deregister_destination(sqs_queue_url, marketplace_id = primary_marketplace_id) ⇒ Peddler::XMLParser
Removes an existing destination from the list of registered destinations
38 39 40 41 42 43 44 45 |
# File 'lib/mws/subscriptions/client.rb', line 38 def deregister_destination(sqs_queue_url, marketplace_id = primary_marketplace_id) operation('DeregisterDestination') .add('MarketplaceId' => marketplace_id) .add(build_destination(sqs_queue_url)) run end |
#get_service_status ⇒ Peddler::XMLParser
Gets the service status of the API
162 163 164 165 |
# File 'lib/mws/subscriptions/client.rb', line 162 def get_service_status operation('GetServiceStatus') run end |
#get_subscription(notification_type, sqs_queue_url, marketplace_id = primary_marketplace_id) ⇒ Peddler::XMLParser
Gets a subscription
98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/mws/subscriptions/client.rb', line 98 def get_subscription(notification_type, sqs_queue_url, marketplace_id = primary_marketplace_id) operation('GetSubscription') .add( 'MarketplaceId' => marketplace_id, 'NotificationType' => notification_type ) .add(build_destination(sqs_queue_url)) run end |
#list_registered_destinations(marketplace_id = primary_marketplace_id) ⇒ Peddler::XMLParser
Lists all registered destinations
52 53 54 55 56 57 |
# File 'lib/mws/subscriptions/client.rb', line 52 def list_registered_destinations(marketplace_id = primary_marketplace_id) operation('ListRegisteredDestinations') .add('MarketplaceId' => marketplace_id) run end |
#list_subscriptions(marketplace_id = primary_marketplace_id) ⇒ Peddler::XMLParser
Lists current subscriptions
134 135 136 137 138 139 |
# File 'lib/mws/subscriptions/client.rb', line 134 def list_subscriptions(marketplace_id = primary_marketplace_id) operation('ListSubscriptions') .add('MarketplaceId' => marketplace_id) run end |
#register_destination(sqs_queue_url, marketplace_id = primary_marketplace_id) ⇒ Peddler::XMLParser
Registers a new destination to receive notifications
23 24 25 26 27 28 29 30 |
# File 'lib/mws/subscriptions/client.rb', line 23 def register_destination(sqs_queue_url, marketplace_id = primary_marketplace_id) operation('RegisterDestination') .add('MarketplaceId' => marketplace_id) .add(build_destination(sqs_queue_url)) run end |
#send_test_notification_to_destination(sqs_queue_url, marketplace_id = primary_marketplace_id) ⇒ Peddler::XMLParser
Sends a test notification to an existing destination
65 66 67 68 69 70 71 72 73 |
# File 'lib/mws/subscriptions/client.rb', line 65 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 end |
#update_subscription(notification_type, sqs_queue_url, enabled, marketplace_id = primary_marketplace_id) ⇒ Peddler::XMLParser
Updates a subscription
149 150 151 152 153 154 155 156 |
# File 'lib/mws/subscriptions/client.rb', line 149 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 end |