create method
Creates a new Outbound Endpoint.
request - The metadata request object.
Request parameters:
parent - Required. The parent project and location where this
OutboundEndpoint will be created. Format:
projects/{project}/locations/{location}
Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+$.
clientOperationId - For mutating operation requests only. An optional
identifier specified by the client. Must be unique for operation resources
in the Operations collection.
outboundEndpointId - Required. The ID to use for the OutboundEndpoint,
which will become the final component of the OutboundEndpoint's resource
name.
requestId - Optional. An optional request ID to identify requests.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a GoogleLongrunningOperation.
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<GoogleLongrunningOperation> create(
OutboundEndpoint request,
core.String parent, {
core.String? clientOperationId,
core.String? outboundEndpointId,
core.String? requestId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'clientOperationId': ?clientOperationId == null
? null
: [clientOperationId],
'outboundEndpointId': ?outboundEndpointId == null
? null
: [outboundEndpointId],
'requestId': ?requestId == null ? null : [requestId],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'dns/v1/' + core.Uri.encodeFull('$parent') + '/outboundEndpoints';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return GoogleLongrunningOperation.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}