createPrivateConnection method

Future<CreatePrivateConnectionOutput> createPrivateConnection({
  1. required PrivateConnectionMode mode,
  2. required String name,
  3. Map<String, String>? tags,
})

Creates a Private Connection to a target resource.

May throw AccessDeniedException. May throw InternalServerException. May throw ThrottlingException. May throw ValidationException.

Parameter mode : Private Connection mode configuration.

Parameter name : Unique name for this Private Connection within the account.

Parameter tags : Tags to add to the Private Connection at creation time.

Implementation

Future<CreatePrivateConnectionOutput> createPrivateConnection({
  required PrivateConnectionMode mode,
  required String name,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'mode': mode,
    'name': name,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v1/private-connections',
    hostPrefix: 'cp.',
    exceptionFnMap: _exceptionFns,
  );
  return CreatePrivateConnectionOutput.fromJson(response);
}