def ListAliases(self, kind=messages.SourceProjectsReposAliasesListRequest. KindValueValuesEnum.MOVABLE): """Request a list of aliases. Args: kind: (messages.SourceProjectsReposAliasesListRequest.KindValueValuesEnum) The type of alias to list (fixed, movable, etc). Returns: [messages.Alias] The aliases of the given kind. """ request = messages.SourceProjectsReposAliasesListRequest( projectId=self._project_id, repoName=self._repo_name, kind=kind) return list_pager.YieldFromList(self._client.projects_repos_aliases, request, field='aliases')
def ListRevisions( self, starts=None, ends=None, path=None, walk_direction=messages.SourceProjectsReposRevisionsListRequest. WalkDirectionValueValuesEnum.FORWARD): """Request a list of revisions. Args: starts: ([string]) Revision IDs (hexadecimal strings) that specify where the listing begins. If empty, the repo heads (revisions with no children) are used. ends: ([string]) Revision IDs (hexadecimal strings) that specify where the listing ends. If this field is present, the listing will contain only revisions that are topologically between starts and ends, inclusive. path: (string) List only those revisions that modify path. walk_direction: (messages.SourceProjectsReposRevisionsListRequest. WalkDirectionValueValuesEnum) The direction to walk the graph. Returns: [messages.Revision] The revisions matching the search criteria, in the order specified by walkDirection. """ if not starts: starts = [] if not ends: ends = [] request = messages.SourceProjectsReposRevisionsListRequest( projectId=self._project_id, repoName=self._repo_name, starts=starts, ends=ends, path=path, walkDirection=walk_direction) return list_pager.YieldFromList(self._client.projects_repos_revisions, request, field='revisions')
def _JobSummariesForProject(self, project_id, filter_predicate): """Get the list of job summaries that match the predicate. Args: project_id: The project ID to retrieve filter_predicate: The filter predicate to apply Returns: An iterator over all the matching jobs. """ apitools_client = self.context[commands.DATAFLOW_APITOOLS_CLIENT_KEY] req_class = (self.context[commands.DATAFLOW_MESSAGES_MODULE_KEY]. DataflowProjectsJobsListRequest) request = req_class(projectId=project_id, view=job_utils.JOB_VIEW_SUMMARY.JobsListRequest( self.context)) return list_pager.YieldFromList( apitools_client.projects_jobs, request, batch_size=None, # Use server default. field='jobs', predicate=filter_predicate)
def _GetMessages(self, apitools_client, request): return list_pager.YieldFromList( apitools_client.projects_jobs_messages, request, batch_size=None, # Use server default. field='jobMessages')