create method

Future<GoogleCloudDatacatalogV1Entry> create(
  1. GoogleCloudDatacatalogV1Entry request,
  2. String parent, {
  3. String? entryId,
  4. String? $fields,
})

Creates an entry.

You can create entries only with 'FILESET', 'CLUSTER', 'DATA_STREAM', or custom types. Data Catalog automatically creates entries with other types during metadata ingestion from integrated systems. You must enable the Data Catalog API in the project identified by the parent parameter. For more information, see Data Catalog resource project. An entry group can have a maximum of 100,000 entries.

request - The metadata request object.

Request parameters:

parent - Required. The name of the entry group this entry belongs to. Note: The entry itself and its child resources might not be stored in the location specified in its name. Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+/entryGroups/\[^/\]+$.

entryId - Required. The ID of the entry to create. The ID must contain only letters (a-z, A-Z), numbers (0-9), and underscores (_). The maximum size is 64 bytes when encoded in UTF-8.

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

Completes with a GoogleCloudDatacatalogV1Entry.

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<GoogleCloudDatacatalogV1Entry> create(
  GoogleCloudDatacatalogV1Entry request,
  core.String parent, {
  core.String? entryId,
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    if (entryId != null) 'entryId': [entryId],
    if ($fields != null) 'fields': [$fields],
  };

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

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