createService method
Future<CreateServiceResponse>
createService({
- required String name,
- required PermissionModel permissionModel,
- required List<
String> regions, - List<
AssociatedSystem> ? associatedSystems, - String? clientToken,
- DependencyDiscoveryInput? dependencyDiscovery,
- String? description,
- String? kmsKeyId,
- String? policyArn,
- ServiceReportConfiguration? reportConfiguration,
- Map<
String, String> ? tags,
Creates a service.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ValidationException.
Parameter permissionModel :
The permission model for the service.
Parameter regions :
The Regions where the service operates.
Parameter associatedSystems :
The systems to associate with the service.
Implementation
Future<CreateServiceResponse> createService({
required String name,
required PermissionModel permissionModel,
required List<String> regions,
List<AssociatedSystem>? associatedSystems,
String? clientToken,
DependencyDiscoveryInput? dependencyDiscovery,
String? description,
String? kmsKeyId,
String? policyArn,
ServiceReportConfiguration? reportConfiguration,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'name': name,
'permissionModel': permissionModel,
'regions': regions,
if (associatedSystems != null) 'associatedSystems': associatedSystems,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (dependencyDiscovery != null)
'dependencyDiscovery': dependencyDiscovery.value,
if (description != null) 'description': description,
if (kmsKeyId != null) 'kmsKeyId': kmsKeyId,
if (policyArn != null) 'policyArn': policyArn,
if (reportConfiguration != null)
'reportConfiguration': reportConfiguration,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/v2/create-service',
exceptionFnMap: _exceptionFns,
);
return CreateServiceResponse.fromJson(response);
}