diff --git a/docs/location.rst b/docs/location.rst index 29b1f92a..0ab1cd1c 100644 --- a/docs/location.rst +++ b/docs/location.rst @@ -109,3 +109,19 @@ for more information. .. note:: ``polygon_id`` needs to be a string. ``Zoom`` is a number ranging from 1-20. + + +Location Date Ranges +-------------------- + +Get the possible date ranges that can be used with location endpoints. See `the documentation +on location date ranges `__ +for more information. + +.. code-block:: ruby + + require 'urbanairship' + UA = Urbanairship + airship = UA::Client.new(key:'application_key', secret:'master_secret') + l = UA::Location.new(client: airship) + l.date_ranges diff --git a/lib/urbanairship/push/location.rb b/lib/urbanairship/push/location.rb index e9d24417..b6e68084 100644 --- a/lib/urbanairship/push/location.rb +++ b/lib/urbanairship/push/location.rb @@ -89,6 +89,15 @@ def polygon_lookup(polygon_id: required('polygon_id'), zoom: required('zoom')) logger.info("Retrieved location info for polygon #{polygon_id} and zoom level #{zoom}") resp end + + def date_ranges + resp = @client.send_request( + method: 'GET', + url: SEGMENTS_URL + 'dates/' + ) + logger.info('Retrieved location date ranges') + resp + end end end end \ No newline at end of file