create method
Creates a Boundary under a parent Folder or Organization.
Creating a Boundary triggers the creation of a Management Project if one is not supplied.
request - The metadata request object.
Request parameters:
parent - Required. The parent resource under which the Boundary will be
created. Format: organizations/{organization_id} or
folders/{folder_id}
Value must have pattern ^organizations/\[^/\]+$.
boundaryId - Required. The user-assigned ID for the Boundary, which will
become the final component of the Boundary's resource name. Must be unique
within the parent resource. It must be 6 to 30 lowercase ASCII letters,
digits, or hyphens. It must start with a letter. Trailing hyphens are
prohibited. Example: my-boundary-123
$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(
Boundary request,
core.String parent, {
core.String? boundaryId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'boundaryId': ?boundaryId == null ? null : [boundaryId],
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v3/' + core.Uri.encodeFull('$parent') + '/boundaries';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}