createDeviceFleet method

Future<void> createDeviceFleet({
  1. required String deviceFleetName,
  2. required EdgeOutputConfig outputConfig,
  3. String? description,
  4. String? roleArn,
  5. List<Tag>? tags,
})

Creates a device fleet.

May throw ResourceInUse. May throw ResourceLimitExceeded.

Parameter deviceFleetName : The name of the fleet that the device belongs to.

Parameter outputConfig : The output configuration for storing sample data collected by the fleet.

Parameter description : A description of the fleet.

Parameter roleArn : The Amazon Resource Name (ARN) that has access to AWS Internet of Things (IoT).

Parameter tags : Creates tags for the specified fleet.

Implementation

Future<void> createDeviceFleet({
  required String deviceFleetName,
  required EdgeOutputConfig outputConfig,
  String? description,
  String? roleArn,
  List<Tag>? tags,
}) async {
  ArgumentError.checkNotNull(deviceFleetName, 'deviceFleetName');
  _s.validateStringLength(
    'deviceFleetName',
    deviceFleetName,
    1,
    63,
    isRequired: true,
  );
  ArgumentError.checkNotNull(outputConfig, 'outputConfig');
  _s.validateStringLength(
    'description',
    description,
    1,
    800,
  );
  _s.validateStringLength(
    'roleArn',
    roleArn,
    20,
    2048,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.CreateDeviceFleet'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DeviceFleetName': deviceFleetName,
      'OutputConfig': outputConfig,
      if (description != null) 'Description': description,
      if (roleArn != null) 'RoleArn': roleArn,
      if (tags != null) 'Tags': tags,
    },
  );
}