updateRestrictions method

Future<ContentRestrictionArray> updateRestrictions({
  1. required String id,
  2. List<String>? expand,
  3. required ContentRestrictionAddOrUpdateArray body,
})

Updates restrictions for a piece of content. This removes the existing restrictions and replaces them with the restrictions in the request.

Permissions required: Permission to edit the content.

Implementation

Future<ContentRestrictionArray> updateRestrictions(
    {required String id,
    List<String>? expand,
    required ContentRestrictionAddOrUpdateArray body}) async {
  return ContentRestrictionArray.fromJson(await _client.send(
    'put',
    'wiki/rest/api/content/{id}/restriction',
    pathParameters: {
      'id': id,
    },
    queryParameters: {
      if (expand != null) 'expand': expand.map((e) => e).join(','),
    },
    body: body.toJson(),
  ));
}