Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

@tseaver

Description

@tseaver

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'))

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions