createWorldTemplate method

Future<CreateWorldTemplateResponse> createWorldTemplate({
  1. String? clientRequestToken,
  2. String? name,
  3. Map<String, String>? tags,
  4. String? templateBody,
  5. TemplateLocation? templateLocation,
})

Creates a world template.

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

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

Parameter name : The name of the world template.

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

Parameter templateBody : The world template body.

Parameter templateLocation : The location of the world template.

Implementation

Future<CreateWorldTemplateResponse> createWorldTemplate({
  String? clientRequestToken,
  String? name,
  Map<String, String>? tags,
  String? templateBody,
  TemplateLocation? templateLocation,
}) async {
  _s.validateStringLength(
    'clientRequestToken',
    clientRequestToken,
    1,
    64,
  );
  _s.validateStringLength(
    'name',
    name,
    0,
    255,
  );
  _s.validateStringLength(
    'templateBody',
    templateBody,
    1,
    262144,
  );
  final $payload = <String, dynamic>{
    if (clientRequestToken != null) 'clientRequestToken': clientRequestToken,
    if (name != null) 'name': name,
    if (tags != null) 'tags': tags,
    if (templateBody != null) 'templateBody': templateBody,
    if (templateLocation != null) 'templateLocation': templateLocation,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/createWorldTemplate',
    exceptionFnMap: _exceptionFns,
  );
  return CreateWorldTemplateResponse.fromJson(response);
}