startThingRegistrationTask method
Creates a bulk thing provisioning task.
May throw InvalidRequestException. May throw ThrottlingException. May throw UnauthorizedException. May throw InternalFailureException.
Parameter inputFileBucket
:
The S3 bucket that contains the input file.
Parameter inputFileKey
:
The name of input file within the S3 bucket. This file contains a newline
delimited JSON file. Each line contains the parameter values to provision
one device (thing).
Parameter roleArn
:
The IAM role ARN that grants permission the input file.
Parameter templateBody
:
The provisioning template.
Implementation
Future<StartThingRegistrationTaskResponse> startThingRegistrationTask({
required String inputFileBucket,
required String inputFileKey,
required String roleArn,
required String templateBody,
}) async {
ArgumentError.checkNotNull(inputFileBucket, 'inputFileBucket');
_s.validateStringLength(
'inputFileBucket',
inputFileBucket,
3,
256,
isRequired: true,
);
ArgumentError.checkNotNull(inputFileKey, 'inputFileKey');
_s.validateStringLength(
'inputFileKey',
inputFileKey,
1,
1024,
isRequired: true,
);
ArgumentError.checkNotNull(roleArn, 'roleArn');
_s.validateStringLength(
'roleArn',
roleArn,
20,
2048,
isRequired: true,
);
ArgumentError.checkNotNull(templateBody, 'templateBody');
final $payload = <String, dynamic>{
'inputFileBucket': inputFileBucket,
'inputFileKey': inputFileKey,
'roleArn': roleArn,
'templateBody': templateBody,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/thing-registration-tasks',
exceptionFnMap: _exceptionFns,
);
return StartThingRegistrationTaskResponse.fromJson(response);
}