lib/ably/rest/push/device_registrations.rb in ably-1.2.2 vs lib/ably/rest/push/device_registrations.rb in ably-1.2.3
- old
+ new
@@ -15,10 +15,12 @@
@client = admin.client
end
# Get registered device by device ID
#
+ # @spec RSH1b1
+ #
# @param [String, Ably::Models::DeviceDetails] device_id the device to retrieve
#
# @return [Ably::Models::DeviceDetails] Returns {Ably::Models::DeviceDetails} if a match is found else a {Ably::Exceptions::ResourceMissing} is raised
#
def get(device_id)
@@ -28,10 +30,12 @@
DeviceDetails(client.get("/push/deviceRegistrations/#{device_id}").body)
end
# List registered devices filtered by optional params
#
+ # @spec RSH1b2
+ #
# @param [Hash] params the filter options for the list registered device request
# @option params [String] :client_id filter by devices registered to a client identifier. Cannot be used with +device_id+ param
# @option params [String] :device_id filter by unique device ID. Cannot be used with +client_id+ param
# @option params [Integer] :limit maximum number of devices to retrieve up to 1,000, defaults to 100
#
@@ -52,12 +56,15 @@
response = client.get('/push/deviceRegistrations', IdiomaticRubyWrapper(params).as_json)
Ably::Models::PaginatedResult.new(response, '', client, paginated_options)
end
- # Save and register device
+ # Registers or updates a {Ably::Models::DeviceDetails} object with Ably.
+ # Returns the new, or updated {Ably::Models::DeviceDetails} object.
#
+ # @spec RSH1b3
+ #
# @param [Ably::Models::DeviceDetails, Hash] device the device details to save
#
# @return [void]
#
def save(device)
@@ -67,10 +74,12 @@
client.put("/push/deviceRegistrations/#{device_details.id}", device_details.as_json)
end
# Remove device
#
+ # @spec RSH1b4
+ #
# @param [String, Ably::Models::DeviceDetails] device_id the device to remove
#
# @return [void]
#
def remove(device_id)
@@ -78,10 +87,12 @@
raise ArgumentError, "device_id must be a string or DeviceDetails object" unless device_id.kind_of?(String)
client.delete("/push/deviceRegistrations/#{device_id}", {})
end
- # Remove device matching where params
+ # Removes all devices registered to receive push notifications from Ably matching the filter params provided.
+ #
+ # @spec RSH1b5
#
# @param [Hash] params the filter params for the remove request
# @option params [String] :client_id remove devices registered to a client identifier. Cannot be used with +device_id+ param
# @option params [String] :device_id remove device with this unique device ID. Cannot be used with +client_id+ param
#