updateApiMapping method

Future<UpdateApiMappingResponse> updateApiMapping({
  1. required String apiId,
  2. required String apiMappingId,
  3. required String domainName,
  4. String? apiMappingKey,
  5. String? stage,
})

The API mapping.

May throw NotFoundException. May throw TooManyRequestsException. May throw BadRequestException. May throw ConflictException.

Parameter apiId : The API identifier.

Parameter apiMappingId : The API mapping identifier.

Parameter domainName : The domain name.

Parameter apiMappingKey : The API mapping key.

Parameter stage : The API stage.

Implementation

Future<UpdateApiMappingResponse> updateApiMapping({
  required String apiId,
  required String apiMappingId,
  required String domainName,
  String? apiMappingKey,
  String? stage,
}) async {
  ArgumentError.checkNotNull(apiId, 'apiId');
  ArgumentError.checkNotNull(apiMappingId, 'apiMappingId');
  ArgumentError.checkNotNull(domainName, 'domainName');
  final $payload = <String, dynamic>{
    'apiId': apiId,
    if (apiMappingKey != null) 'apiMappingKey': apiMappingKey,
    if (stage != null) 'stage': stage,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri:
        '/v2/domainnames/${Uri.encodeComponent(domainName)}/apimappings/${Uri.encodeComponent(apiMappingId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateApiMappingResponse.fromJson(response);
}