lib/urbanairship/devices/devicelist.rb in urbanairship-5.9.0 vs lib/urbanairship/devices/devicelist.rb in urbanairship-6.0.0
- old
+ new
@@ -15,11 +15,11 @@
end
def lookup(uuid: required('uuid'))
response = @client.send_request(
method: 'GET',
- url: CHANNEL_URL + uuid
+ url: channel_url(uuid)
)
logger.info("Retrieved channel information for #{uuid}")
response['body']['channel']
end
@@ -34,21 +34,21 @@
def set_attributes
response = @client.send_request(
method: 'POST',
body: JSON.dump(payload),
- url: CHANNEL_URL + 'attributes',
+ url: channel_url('attributes'),
content_type: 'application/json'
)
response
end
end
class ChannelList < Urbanairship::Common::PageIterator
def initialize(client: required('client'))
super(client: client)
- @next_page = CHANNEL_URL
+ @next_page = channel_url
@data_attribute = 'channels'
end
end
class DeviceToken
@@ -62,11 +62,11 @@
def lookup(token: required('token'))
fail ArgumentError, 'token needs to be a string' unless token.is_a? String
resp = @client.send_request(
method: 'GET',
- url: DEVICE_TOKEN_URL + token
+ url: device_token_url(token)
)
logger.info("Looking up info on device token #{token}")
resp
end
end
@@ -75,11 +75,11 @@
include Urbanairship::Common
include Urbanairship::Loggable
def initialize(client: required('client'))
super(client: client)
- @next_page = DEVICE_TOKEN_URL
+ @next_page = device_token_url
@data_attribute = 'device_tokens'
end
end
class APID
@@ -93,21 +93,21 @@
def lookup(apid: required('apid'))
fail ArgumentError, 'apid needs to be a string' unless apid.is_a? String
resp = @client.send_request(
method: 'GET',
- url: APID_URL + apid
+ url: apid_url(apid)
)
logger.info("Retrieved info on apid #{apid}")
resp
end
end
class APIDList < Urbanairship::Common::PageIterator
def initialize(client: required('client'))
super(client: client)
- @next_page = APID_URL
+ @next_page = apid_url
@data_attribute = 'apids'
end
end
end
-end
\ No newline at end of file
+end