diff --git a/gcloud/logging/_gax.py b/gcloud/logging/_gax.py index fd8c3eff3e2b..bf368900b335 100644 --- a/gcloud/logging/_gax.py +++ b/gcloud/logging/_gax.py @@ -44,7 +44,7 @@ def __init__(self, gax_api): self._gax_api = gax_api def list_entries(self, projects, filter_='', order_by='', - page_size=0, page_token=INITIAL_PAGE): + page_size=0, page_token=None): """Return a page of log entry resources. :type projects: list of strings @@ -73,6 +73,8 @@ def list_entries(self, projects, filter_='', order_by='', if not None, indicates that more entries can be retrieved with another call (pass that value as ``page_token``). """ + if page_token is None: + page_token = INITIAL_PAGE options = CallOptions(page_token=page_token) page_iter = self._gax_api.list_log_entries( projects, filter_, order_by, page_size, options) @@ -135,7 +137,7 @@ class _SinksAPI(object): def __init__(self, gax_api): self._gax_api = gax_api - def list_sinks(self, project, page_size=0, page_token=INITIAL_PAGE): + def list_sinks(self, project, page_size=0, page_token=None): """List sinks for the project associated with this client. :type project: string @@ -155,6 +157,8 @@ def list_sinks(self, project, page_size=0, page_token=INITIAL_PAGE): if not None, indicates that more sinks can be retrieved with another call (pass that value as ``page_token``). """ + if page_token is None: + page_token = INITIAL_PAGE options = CallOptions(page_token=page_token) path = 'projects/%s' % (project,) page_iter = self._gax_api.list_sinks(path, page_size, options) @@ -279,7 +283,7 @@ class _MetricsAPI(object): def __init__(self, gax_api): self._gax_api = gax_api - def list_metrics(self, project, page_size=0, page_token=INITIAL_PAGE): + def list_metrics(self, project, page_size=0, page_token=None): """List metrics for the project associated with this client. :type project: string @@ -299,6 +303,8 @@ def list_metrics(self, project, page_size=0, page_token=INITIAL_PAGE): if not None, indicates that more metrics can be retrieved with another call (pass that value as ``page_token``). """ + if page_token is None: + page_token = INITIAL_PAGE options = CallOptions(page_token=page_token) path = 'projects/%s' % (project,) page_iter = self._gax_api.list_log_metrics(path, page_size, options) diff --git a/gcloud/pubsub/_gax.py b/gcloud/pubsub/_gax.py index 4fde46a3f931..c0a10390ed40 100644 --- a/gcloud/pubsub/_gax.py +++ b/gcloud/pubsub/_gax.py @@ -36,7 +36,7 @@ class _PublisherAPI(object): def __init__(self, gax_api): self._gax_api = gax_api - def list_topics(self, project, page_size=0, page_token=INITIAL_PAGE): + def list_topics(self, project, page_size=0, page_token=None): """List topics for the project associated with this API. See: @@ -60,6 +60,8 @@ def list_topics(self, project, page_size=0, page_token=INITIAL_PAGE): more topics can be retrieved with another call (pass that value as ``page_token``). """ + if page_token is None: + page_token = INITIAL_PAGE options = CallOptions(page_token=page_token) path = 'projects/%s' % (project,) page_iter = self._gax_api.list_topics( @@ -162,7 +164,7 @@ def topic_publish(self, topic_path, messages): return result.message_ids def topic_list_subscriptions(self, topic_path, page_size=0, - page_token=INITIAL_PAGE): + page_token=None): """API call: list subscriptions bound to a topic See: @@ -187,6 +189,8 @@ def topic_list_subscriptions(self, topic_path, page_size=0, :raises: :exc:`gcloud.exceptions.NotFound` if the topic does not exist """ + if page_token is None: + page_token = INITIAL_PAGE options = CallOptions(page_token=page_token) try: page_iter = self._gax_api.list_topic_subscriptions( @@ -209,8 +213,7 @@ class _SubscriberAPI(object): def __init__(self, gax_api): self._gax_api = gax_api - def list_subscriptions(self, project, page_size=0, - page_token=INITIAL_PAGE): + def list_subscriptions(self, project, page_size=0, page_token=None): """List subscriptions for the project associated with this API. See: @@ -234,6 +237,8 @@ def list_subscriptions(self, project, page_size=0, more topics can be retrieved with another call (pass that value as ``page_token``). """ + if page_token is None: + page_token = INITIAL_PAGE options = CallOptions(page_token=page_token) path = 'projects/%s' % (project,) page_iter = self._gax_api.list_subscriptions(