listByUser method

Future<BlogList> listByUser(
  1. String userId, {
  2. bool? fetchUserInfo,
  3. List<String>? role,
  4. List<String>? status,
  5. String? view,
  6. String? $fields,
})

Lists blogs by user.

Request parameters:

userId - null

fetchUserInfo - null

role - null

status - Default value of status is LIVE.

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 BlogList.

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<BlogList> listByUser(
  core.String userId, {
  core.bool? fetchUserInfo,
  core.List<core.String>? role,
  core.List<core.String>? status,
  core.String? view,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (fetchUserInfo != null) 'fetchUserInfo': ['${fetchUserInfo}'],
    if (role != null) 'role': role,
    if (status != null) 'status': status,
    if (view != null) 'view': [view],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v3/users/' + commons.escapeVariable('$userId') + '/blogs';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return BlogList.fromJson(response_ as core.Map<core.String, core.dynamic>);
}