createOutpost method

Future<CreateOutpostOutput> createOutpost({
  1. required String name,
  2. required String siteId,
  3. String? availabilityZone,
  4. String? availabilityZoneId,
  5. String? description,
  6. Map<String, String>? tags,
})

Creates an Outpost.

May throw ValidationException. May throw NotFoundException. May throw AccessDeniedException. May throw InternalServerException. May throw ServiceQuotaExceededException.

Parameter tags : The tags to apply to the Outpost.

Implementation

Future<CreateOutpostOutput> createOutpost({
  required String name,
  required String siteId,
  String? availabilityZone,
  String? availabilityZoneId,
  String? description,
  Map<String, String>? tags,
}) async {
  ArgumentError.checkNotNull(name, 'name');
  _s.validateStringLength(
    'name',
    name,
    1,
    255,
    isRequired: true,
  );
  ArgumentError.checkNotNull(siteId, 'siteId');
  _s.validateStringLength(
    'siteId',
    siteId,
    1,
    255,
    isRequired: true,
  );
  _s.validateStringLength(
    'availabilityZone',
    availabilityZone,
    1,
    1000,
  );
  _s.validateStringLength(
    'availabilityZoneId',
    availabilityZoneId,
    1,
    255,
  );
  _s.validateStringLength(
    'description',
    description,
    1,
    1000,
  );
  final $payload = <String, dynamic>{
    'Name': name,
    'SiteId': siteId,
    if (availabilityZone != null) 'AvailabilityZone': availabilityZone,
    if (availabilityZoneId != null) 'AvailabilityZoneId': availabilityZoneId,
    if (description != null) 'Description': description,
    if (tags != null) 'Tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/outposts',
    exceptionFnMap: _exceptionFns,
  );
  return CreateOutpostOutput.fromJson(response);
}