createRobot method

Future<CreateRobotResponse> createRobot({
  1. required Architecture architecture,
  2. required String greengrassGroupId,
  3. required String name,
  4. Map<String, String>? tags,
})

Creates a robot.

May throw InvalidParameterException. May throw InternalServerException. May throw ThrottlingException. May throw LimitExceededException. May throw ResourceAlreadyExistsException.

Parameter architecture : The target architecture of the robot.

Parameter greengrassGroupId : The Greengrass group id.

Parameter name : The name for the robot.

Parameter tags : A map that contains tag keys and tag values that are attached to the robot.

Implementation

Future<CreateRobotResponse> createRobot({
  required Architecture architecture,
  required String greengrassGroupId,
  required String name,
  Map<String, String>? tags,
}) async {
  ArgumentError.checkNotNull(architecture, 'architecture');
  ArgumentError.checkNotNull(greengrassGroupId, 'greengrassGroupId');
  _s.validateStringLength(
    'greengrassGroupId',
    greengrassGroupId,
    1,
    1224,
    isRequired: true,
  );
  ArgumentError.checkNotNull(name, 'name');
  _s.validateStringLength(
    'name',
    name,
    1,
    255,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    'architecture': architecture.toValue(),
    'greengrassGroupId': greengrassGroupId,
    'name': name,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/createRobot',
    exceptionFnMap: _exceptionFns,
  );
  return CreateRobotResponse.fromJson(response);
}