list method
Lists posts.
Request parameters:
blogId
- null
endDate
- null
fetchBodies
- null
fetchImages
- null
labels
- null
maxResults
- null
orderBy
- null
Possible string values are:
- "ORDER_BY_UNSPECIFIED"
- "PUBLISHED"
- "UPDATED"
pageToken
- null
sortOption
- Sort direction applied to post list.
Possible string values are:
- "SORT_OPTION_UNSPECIFIED" : The unspecified sort option.
- "DESCENDING" : The option to sort posts in descending order in time.
- "ASCENDING" : The option to sort posts in ascending order in time.
startDate
- null
status
- null
view
- null
Possible string values are:
- "VIEW_TYPE_UNSPECIFIED"
- "READER"
- "AUTHOR"
- "ADMIN"
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a PostList.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client
completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<PostList> list(
core.String blogId, {
core.String? endDate,
core.bool? fetchBodies,
core.bool? fetchImages,
core.String? labels,
core.int? maxResults,
core.String? orderBy,
core.String? pageToken,
core.String? sortOption,
core.String? startDate,
core.List<core.String>? status,
core.String? view,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (endDate != null) 'endDate': [endDate],
if (fetchBodies != null) 'fetchBodies': ['${fetchBodies}'],
if (fetchImages != null) 'fetchImages': ['${fetchImages}'],
if (labels != null) 'labels': [labels],
if (maxResults != null) 'maxResults': ['${maxResults}'],
if (orderBy != null) 'orderBy': [orderBy],
if (pageToken != null) 'pageToken': [pageToken],
if (sortOption != null) 'sortOption': [sortOption],
if (startDate != null) 'startDate': [startDate],
if (status != null) 'status': status,
if (view != null) 'view': [view],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v3/blogs/' + commons.escapeVariable('$blogId') + '/posts';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return PostList.fromJson(response_ as core.Map<core.String, core.dynamic>);
}