createNetwork method

Future<CreateNetworkResponse> createNetwork({
  1. required AccessLevel accessLevel,
  2. required String networkName,
  3. bool? enablePremiumFreeTrial,
  4. String? encryptionKeyArn,
})

Creates a new Wickr network with specified access level and configuration. This operation provisions a new communication network for your organization.

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

Parameter accessLevel : The access level for the network. Valid values are STANDARD or PREMIUM, which determine the features and capabilities available to network members.

Parameter networkName : The name for the new network. Must be between 1 and 20 characters.

Parameter enablePremiumFreeTrial : Specifies whether to enable a premium free trial for the network. It is optional and has a default value as false. When set to true, the network starts with premium features for a limited trial period.

Parameter encryptionKeyArn : The ARN of the Amazon Web Services KMS customer managed key to use for encrypting sensitive data in the network.

Implementation

Future<CreateNetworkResponse> createNetwork({
  required AccessLevel accessLevel,
  required String networkName,
  bool? enablePremiumFreeTrial,
  String? encryptionKeyArn,
}) async {
  final $payload = <String, dynamic>{
    'accessLevel': accessLevel.value,
    'networkName': networkName,
    if (enablePremiumFreeTrial != null)
      'enablePremiumFreeTrial': enablePremiumFreeTrial,
    if (encryptionKeyArn != null) 'encryptionKeyArn': encryptionKeyArn,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/networks',
    exceptionFnMap: _exceptionFns,
  );
  return CreateNetworkResponse.fromJson(response);
}