getSchemaVersionsDiff method

Future<GetSchemaVersionsDiffResponse> getSchemaVersionsDiff({
  1. required SchemaVersionNumber firstSchemaVersionNumber,
  2. required SchemaDiffType schemaDiffType,
  3. required SchemaId schemaId,
  4. required SchemaVersionNumber secondSchemaVersionNumber,
})

Fetches the schema version difference in the specified difference type between two stored schema versions in the Schema Registry.

This API allows you to compare two schema versions between two schema definitions under the same schema.

May throw InvalidInputException. May throw EntityNotFoundException. May throw AccessDeniedException. May throw InternalServiceException.

Parameter firstSchemaVersionNumber : The first of the two schema versions to be compared.

Parameter schemaDiffType : Refers to SYNTAX_DIFF, which is the currently supported diff type.

Parameter schemaId : This is a wrapper structure to contain schema identity fields. The structure contains:

  • SchemaId$SchemaArn: The Amazon Resource Name (ARN) of the schema. One of SchemaArn or SchemaName has to be provided.
  • SchemaId$SchemaName: The name of the schema. One of SchemaArn or SchemaName has to be provided.

Parameter secondSchemaVersionNumber : The second of the two schema versions to be compared.

Implementation

Future<GetSchemaVersionsDiffResponse> getSchemaVersionsDiff({
  required SchemaVersionNumber firstSchemaVersionNumber,
  required SchemaDiffType schemaDiffType,
  required SchemaId schemaId,
  required SchemaVersionNumber secondSchemaVersionNumber,
}) async {
  ArgumentError.checkNotNull(
      firstSchemaVersionNumber, 'firstSchemaVersionNumber');
  ArgumentError.checkNotNull(schemaDiffType, 'schemaDiffType');
  ArgumentError.checkNotNull(schemaId, 'schemaId');
  ArgumentError.checkNotNull(
      secondSchemaVersionNumber, 'secondSchemaVersionNumber');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSGlue.GetSchemaVersionsDiff'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'FirstSchemaVersionNumber': firstSchemaVersionNumber,
      'SchemaDiffType': schemaDiffType.toValue(),
      'SchemaId': schemaId,
      'SecondSchemaVersionNumber': secondSchemaVersionNumber,
    },
  );

  return GetSchemaVersionsDiffResponse.fromJson(jsonResponse.body);
}