create method
- GoogleCloudAiplatformV1Context request,
- String parent, {
- String? contextId,
- String? $fields,
Creates a Context associated with a MetadataStore.
request
- The metadata request object.
Request parameters:
parent
- Required. The resource name of the MetadataStore where the
Context should be created. Format:
projects/{project}/locations/{location}/metadataStores/{metadatastore}
Value must have pattern
^projects/\[^/\]+/locations/\[^/\]+/metadataStores/\[^/\]+$
.
contextId
- The {context} portion of the resource name with the format:
projects/{project}/locations/{location}/metadataStores/{metadatastore}/contexts/{context}
.
If not provided, the Context'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 Contexts in the parent MetadataStore. (Otherwise the
request will fail with ALREADY_EXISTS, or PERMISSION_DENIED if the caller
can't view the preexisting Context.)
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a GoogleCloudAiplatformV1Context.
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<GoogleCloudAiplatformV1Context> create(
GoogleCloudAiplatformV1Context request,
core.String parent, {
core.String? contextId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
if (contextId != null) 'contextId': [contextId],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/contexts';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return GoogleCloudAiplatformV1Context.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}