register method
Registers a new domain name and creates a corresponding Registration
resource.
Call RetrieveRegisterParameters
first to check availability of the
domain name and determine parameters like price that are needed to build a
call to this method. A successful call creates a Registration
resource
in state REGISTRATION_PENDING
, which resolves to ACTIVE
within 1-2
minutes, indicating that the domain was successfully registered. If the
resource ends up in state REGISTRATION_FAILED
, it indicates that the
domain was not registered successfully, and you can safely delete the
resource and retry registration.
request
- The metadata request object.
Request parameters:
parent
- Required. The parent resource of the Registration
. Must be in
the format projects / * /locations / *
.
Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+$
.
$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> register(
RegisterDomainRequest 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 =
'v1beta1/' + core.Uri.encodeFull('$parent') + '/registrations:register';
final _response = await _requester.request(
_url,
'POST',
body: _body,
queryParams: _queryParams,
);
return Operation.fromJson(_response as core.Map<core.String, core.dynamic>);
}