createWorldExportJob method

Future<CreateWorldExportJobResponse> createWorldExportJob({
  1. required String iamRole,
  2. required OutputLocation outputLocation,
  3. required List<String> worlds,
  4. String? clientRequestToken,
  5. Map<String, String>? tags,
})

Creates a world export job.

May throw ResourceNotFoundException. May throw InvalidParameterException. May throw InternalServerException. May throw ThrottlingException. May throw IdempotentParameterMismatchException. May throw ServiceUnavailableException.

Parameter iamRole : The IAM role that the world export process uses to access the Amazon S3 bucket and put the export.

Parameter worlds : A list of Amazon Resource Names (arns) that correspond to worlds to export.

Parameter clientRequestToken : Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

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

Implementation

Future<CreateWorldExportJobResponse> createWorldExportJob({
  required String iamRole,
  required OutputLocation outputLocation,
  required List<String> worlds,
  String? clientRequestToken,
  Map<String, String>? tags,
}) async {
  ArgumentError.checkNotNull(iamRole, 'iamRole');
  _s.validateStringLength(
    'iamRole',
    iamRole,
    1,
    255,
    isRequired: true,
  );
  ArgumentError.checkNotNull(outputLocation, 'outputLocation');
  ArgumentError.checkNotNull(worlds, 'worlds');
  _s.validateStringLength(
    'clientRequestToken',
    clientRequestToken,
    1,
    64,
  );
  final $payload = <String, dynamic>{
    'iamRole': iamRole,
    'outputLocation': outputLocation,
    'worlds': worlds,
    'clientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(),
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/createWorldExportJob',
    exceptionFnMap: _exceptionFns,
  );
  return CreateWorldExportJobResponse.fromJson(response);
}