addRestrictions method

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

Adds restrictions to a piece of content. Note, this does not change any existing restrictions on the content.

Permissions required: Permission to edit the content.

Implementation

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