create method

Future<Feed> create(
  1. CreateFeedRequest request,
  2. String parent, {
  3. String? $fields,
})

Creates a feed in a parent project/folder/organization to listen to its asset updates.

request - The metadata request object.

Request parameters:

parent - Required. The name of the project/folder/organization where this feed should be created in. It can only be an organization number (such as "organizations/123"), a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as "projects/12345"). Value must have pattern ^\[^/\]+/\[^/\]+$.

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

Completes with a Feed.

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

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

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