listTopics method
Lists matching topics. If set, the project
can be either just the
project id or it can be the fully quantified format: projects/{project}
.
If not set, the project from the service account will be used.
Implementation
Future<ListTopicsResponse> listTopics({
int? pageSize,
String? pageToken,
String? project,
int retries = 5,
}) async {
assert(_initialized);
final projectId = project ?? _projectId;
_logger.fine('[listTopics]: start -- [$projectId]');
try {
return await _execute(
executor: () async {
final result = await _pubsubApi.projects.topics.list(
projectId.startsWith('projects/')
? projectId
: 'projects/$projectId',
pageSize: pageSize,
pageToken: pageToken,
);
return result;
},
retries: retries,
);
} finally {
_logger.fine('[listTopics]: complete -- [$projectId]');
}
}