Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Update iterator to take a method and **kwargs #1554

Copy link
Copy link

Description

@tseaver
Issue body actions

gcloud.iterator.Iterator is a base class, relying on a path for the API method. I think it would be clearer if it wrapped around a method of a client (or other domain object), where that method takes page_token, page_size, etc., along with other named arguments in **kw. We could then ditch all the derived classes, and just use the one, common implementation. E.g.:

from gcloud.iterator import Iterator
from gcloud.pubsub import Client

client = Client()
topics = list(Iterator(client.list_topics))
subs = list(Iterator(client.list_subscriptions, topic_name='my-topic'))
Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.api: cloudresourcemanagerIssues related to the Resource Manager API.Issues related to the Resource Manager API.api: coreapi: dnsIssues related to the Cloud DNS API.Issues related to the Cloud DNS API.api: pubsubIssues related to the Pub/Sub API.Issues related to the Pub/Sub API.api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.