create method
- AuthorizedView request,
- String parent, {
- String? authorizedViewId,
- String? $fields,
Creates a new AuthorizedView in a table.
request
- The metadata request object.
Request parameters:
parent
- Required. This is the name of the table the AuthorizedView
belongs to. Values are of the form
projects/{project}/instances/{instance}/tables/{table}
.
Value must have pattern
^projects/\[^/\]+/instances/\[^/\]+/tables/\[^/\]+$
.
authorizedViewId
- Required. The id of the AuthorizedView to create.
This AuthorizedView must not already exist. The authorized_view_id
appended to parent
forms the full AuthorizedView name of the form
projects/{project}/instances/{instance}/tables/{table}/authorizedView/{authorized_view}
.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a Operation.
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<Operation> create(
AuthorizedView request,
core.String parent, {
core.String? authorizedViewId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
if (authorizedViewId != null) 'authorizedViewId': [authorizedViewId],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v2/' + core.Uri.encodeFull('$parent') + '/authorizedViews';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}