def List(client=None, messages=None, limit=None): if not client: client = util.GetClient() messages = messages or util.GetMessages() return list_pager.YieldFromList( client.projects, messages.CloudresourcemanagerProjectsListRequest(), limit=limit, field='projects', predicate=util.IsActive, batch_size_attribute='pageSize')
def List(client=None, messages=None, http=None, limit=None): if not client: if not http: raise ValueError( 'At least one of {client, http} must be provided.') client = util.GetClient(http) messages = messages or util.GetMessages() return list_pager.YieldFromList( client.projects, messages.CloudresourcemanagerProjectsListRequest(), limit=limit, field='projects', predicate=util.IsActive, batch_size_attribute='pageSize')
def List(client=None, messages=None, limit=None): """Make API calls to List active projects. Args: client: Projects client to use or None to use the default messages: Projects messages class to use or None to use the default limit: The number of projects to limit the resutls to. This limit is passed to the server and the server does the limiting. Returns: Generator that yields projects """ client = client or util.GetClient() messages = messages or util.GetMessages() return list_pager.YieldFromList( client.projects, messages.CloudresourcemanagerProjectsListRequest(), limit=limit, field='projects', predicate=util.IsActive, batch_size_attribute='pageSize')
def Filter(self, context, _): context['projects_resources'] = resources context['projects_client'] = util.GetClient() context['projects_messages'] = util.GetMessages()