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>>{
'endDate': ?endDate == null ? null : [endDate],
'fetchBodies': ?fetchBodies == null ? null : ['${fetchBodies}'],
'fetchImages': ?fetchImages == null ? null : ['${fetchImages}'],
'labels': ?labels == null ? null : [labels],
'maxResults': ?maxResults == null ? null : ['${maxResults}'],
'orderBy': ?orderBy == null ? null : [orderBy],
'pageToken': ?pageToken == null ? null : [pageToken],
'sortOption': ?sortOption == null ? null : [sortOption],
'startDate': ?startDate == null ? null : [startDate],
'status': ?status,
'view': ?view == null ? null : [view],
'fields': ?$fields == null ? null : [$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>);
}