createFleet method
Creates a fleet that represents a group of vehicles. For more information, see Fleets in the Amazon Web Services IoT FleetWise Developer Guide.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw LimitExceededException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter fleetId :
The unique ID of the fleet to create.
Parameter signalCatalogArn :
The Amazon Resource Name (ARN) of a signal catalog.
Parameter description :
A brief description of the fleet to create.
Parameter tags :
Metadata that can be used to manage the fleet.
Implementation
Future<CreateFleetResponse> createFleet({
required String fleetId,
required String signalCatalogArn,
String? description,
List<Tag>? tags,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'IoTAutobahnControlPlane.CreateFleet'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'fleetId': fleetId,
'signalCatalogArn': signalCatalogArn,
if (description != null) 'description': description,
if (tags != null) 'tags': tags,
},
);
return CreateFleetResponse.fromJson(jsonResponse.body);
}