registerService method

Future<RegisterServiceOutput> registerService({
  1. required PostRegisterServiceSupportedService service,
  2. required ServiceDetails serviceDetails,
  3. String? kmsKeyArn,
  4. String? name,
  5. String? privateConnectionName,
  6. Map<String, String>? tags,
})

This operation registers the specified service

May throw InternalServerException. May throw InvalidParameterException. May throw ResourceNotFoundException. May throw ValidationException.

Parameter serviceDetails : Service-specific authorization configuration parameters

Parameter kmsKeyArn : The ARN of the AWS Key Management Service (AWS KMS) customer managed key that's used to encrypt resources.

Parameter name : The display name for the service registration.

Parameter privateConnectionName : The name of the private connection to use for VPC connectivity.

Parameter tags : Tags to add to the Service at registration time.

Implementation

Future<RegisterServiceOutput> registerService({
  required PostRegisterServiceSupportedService service,
  required ServiceDetails serviceDetails,
  String? kmsKeyArn,
  String? name,
  String? privateConnectionName,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'serviceDetails': serviceDetails,
    if (kmsKeyArn != null) 'kmsKeyArn': kmsKeyArn,
    if (name != null) 'name': name,
    if (privateConnectionName != null)
      'privateConnectionName': privateConnectionName,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v1/register/${Uri.encodeComponent(service.value)}',
    hostPrefix: 'cp.',
    exceptionFnMap: _exceptionFns,
  );
  return RegisterServiceOutput.fromJson(response);
}