updateApi method

Future<UpdateApiResponse> updateApi({
  1. required String apiId,
  2. required EventConfig eventConfig,
  3. required String name,
  4. String? ownerContact,
})

Updates an Api.

May throw AccessDeniedException. May throw BadRequestException. May throw ConcurrentModificationException. May throw InternalFailureException. May throw NotFoundException. May throw UnauthorizedException.

Parameter apiId : The Api ID.

Parameter eventConfig : The new event configuration. This includes the default authorization configuration for connecting, publishing, and subscribing to an Event API.

Parameter name : The name of the Api.

Parameter ownerContact : The owner contact information for the Api.

Implementation

Future<UpdateApiResponse> updateApi({
  required String apiId,
  required EventConfig eventConfig,
  required String name,
  String? ownerContact,
}) async {
  final $payload = <String, dynamic>{
    'eventConfig': eventConfig,
    'name': name,
    if (ownerContact != null) 'ownerContact': ownerContact,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v2/apis/${Uri.encodeComponent(apiId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateApiResponse.fromJson(response);
}