createSecurityGroup method
Creates a new security group in a Wickr network. Security groups allow you to organize users and control their permissions, features, and security settings.
May throw BadRequestError.
May throw ForbiddenError.
May throw InternalServerError.
May throw RateLimitError.
May throw ResourceNotFoundError.
May throw UnauthorizedError.
May throw ValidationError.
Parameter name :
The name for the new security group.
Parameter networkId :
The ID of the Wickr network where the security group will be created.
Parameter securityGroupSettings :
The configuration settings for the security group, including permissions,
federation settings, and feature controls.
Parameter clientToken :
A unique identifier for this request to ensure idempotency.
Implementation
Future<CreateSecurityGroupResponse> createSecurityGroup({
required String name,
required String networkId,
required SecurityGroupSettingsRequest securityGroupSettings,
String? clientToken,
}) async {
final headers = <String, String>{
if (clientToken != null) 'X-Client-Token': clientToken.toString(),
};
final $payload = <String, dynamic>{
'name': name,
'securityGroupSettings': securityGroupSettings,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/networks/${Uri.encodeComponent(networkId)}/security-groups',
headers: headers,
exceptionFnMap: _exceptionFns,
);
return CreateSecurityGroupResponse.fromJson(response);
}