getCodeBindingSource method

Future<GetCodeBindingSourceResponse> getCodeBindingSource({
  1. required String language,
  2. required String registryName,
  3. required String schemaName,
  4. String? schemaVersion,
})

Get the code binding source URI.

May throw BadRequestException. May throw UnauthorizedException. May throw InternalServerErrorException. May throw ForbiddenException. May throw NotFoundException. May throw TooManyRequestsException.

Parameter language : The language of the code binding.

Parameter registryName : The name of the registry.

Parameter schemaName : The name of the schema.

Parameter schemaVersion : Specifying this limits the results to only this schema version.

Implementation

Future<GetCodeBindingSourceResponse> getCodeBindingSource({
  required String language,
  required String registryName,
  required String schemaName,
  String? schemaVersion,
}) async {
  ArgumentError.checkNotNull(language, 'language');
  ArgumentError.checkNotNull(registryName, 'registryName');
  ArgumentError.checkNotNull(schemaName, 'schemaName');
  final $query = <String, List<String>>{
    if (schemaVersion != null) 'schemaVersion': [schemaVersion],
  };
  final response = await _protocol.sendRaw(
    payload: null,
    method: 'GET',
    requestUri:
        '/v1/registries/name/${Uri.encodeComponent(registryName)}/schemas/name/${Uri.encodeComponent(schemaName)}/language/${Uri.encodeComponent(language)}/source',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return GetCodeBindingSourceResponse(
    body: await response.stream.toBytes(),
  );
}