get method

Future<SchemaConfig> get(
  1. String name, {
  2. bool? defaultToGlobal,
  3. String? $fields,
})

Get schema config at global level or for a subject.

Request parameters:

name - Required. The resource name to get the config for. It can be either of following: * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/config: Get config at global level. * projects/{project}/locations/{location}/schemaRegistries/{schema_registry}/config/{subject}: Get config for a specific subject. Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+/schemaRegistries/\[^/\]+/config/.*$.

defaultToGlobal - Optional. If true, the config will fall back to the config at the global level if no subject level config is found.

$fields - Selector specifying which fields to include in a partial response.

Completes with a SchemaConfig.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<SchemaConfig> get(
  core.String name, {
  core.bool? defaultToGlobal,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (defaultToGlobal != null) 'defaultToGlobal': ['${defaultToGlobal}'],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v1/' + core.Uri.encodeFull('$name');

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return SchemaConfig.fromJson(
    response_ as core.Map<core.String, core.dynamic>,
  );
}