updateSecurityGroup method

Future<UpdateSecurityGroupResponse> updateSecurityGroup({
  1. required String groupId,
  2. required String networkId,
  3. String? name,
  4. SecurityGroupSettings? securityGroupSettings,
})

Updates the properties of an existing security group in a Wickr network, such as its name or settings.

May throw BadRequestError. May throw ForbiddenError. May throw InternalServerError. May throw RateLimitError. May throw ResourceNotFoundError. May throw UnauthorizedError. May throw ValidationError.

Parameter groupId : The unique identifier of the security group to update.

Parameter networkId : The ID of the Wickr network containing the security group to update.

Parameter name : The new name for the security group.

Parameter securityGroupSettings : The updated configuration settings for the security group.

Federation mode - 0 (Local federation), 1 (Restricted federation), 2 (Global federation)

Implementation

Future<UpdateSecurityGroupResponse> updateSecurityGroup({
  required String groupId,
  required String networkId,
  String? name,
  SecurityGroupSettings? securityGroupSettings,
}) async {
  final $payload = <String, dynamic>{
    if (name != null) 'name': name,
    if (securityGroupSettings != null)
      'securityGroupSettings': securityGroupSettings,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri:
        '/networks/${Uri.encodeComponent(networkId)}/security-groups/${Uri.encodeComponent(groupId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateSecurityGroupResponse.fromJson(response);
}