getDiscoveredSchema method

Future<GetDiscoveredSchemaResponse> getDiscoveredSchema({
  1. required List<String> events,
  2. required Type type,
})

Get the discovered schema that was generated based on sampled events.

May throw ServiceUnavailableException. May throw BadRequestException. May throw UnauthorizedException. May throw InternalServerErrorException. May throw ForbiddenException.

Parameter events : An array of strings where each string is a JSON event. These are the events that were used to generate the schema. The array includes a single type of event and has a maximum size of 10 events.

Parameter type : The type of event.

Implementation

Future<GetDiscoveredSchemaResponse> getDiscoveredSchema({
  required List<String> events,
  required Type type,
}) async {
  ArgumentError.checkNotNull(events, 'events');
  ArgumentError.checkNotNull(type, 'type');
  final $payload = <String, dynamic>{
    'Events': events,
    'Type': type.toValue(),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/v1/discover',
    exceptionFnMap: _exceptionFns,
  );
  return GetDiscoveredSchemaResponse.fromJson(response);
}