create method

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

Creates an Artifact associated with a MetadataStore.

request - The metadata request object.

Request parameters:

parent - Required. The resource name of the MetadataStore where the Artifact should be created. Format: projects/{project}/locations/{location}/metadataStores/{metadatastore} Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+/metadataStores/\[^/\]+$.

artifactId - The {artifact} portion of the resource name with the format: projects/{project}/locations/{location}/metadataStores/{metadatastore}/artifacts/{artifact} If not provided, the Artifact's ID will be a UUID generated by the service. Must be 4-128 characters in length. Valid characters are /a-z-/. Must be unique across all Artifacts in the parent MetadataStore. (Otherwise the request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the caller can't view the preexisting Artifact.)

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

Completes with a GoogleCloudAiplatformV1Artifact.

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

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

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