register method
- GoogleCloudChannelV1RegisterSubscriberRequest request,
- String account, {
- String? $fields,
Registers a service account with subscriber privileges on the Cloud Pub/Sub topic for this Channel Services account.
After you create a subscriber, you get the events through SubscriberEvent Possible error codes: * PERMISSION_DENIED: The reseller account making the request and the provided reseller account are different, or the impersonated user is not a super admin. * INVALID_ARGUMENT: Required request parameters are missing or invalid. * INTERNAL: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. * UNKNOWN: Any non-user error related to a technical issue in the backend. Contact Cloud Channel support. Return value: The topic name with the registered service email address.
request
- The metadata request object.
Request parameters:
account
- Required. Resource name of the account.
Value must have pattern ^accounts/\[^/\]+$
.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a GoogleCloudChannelV1RegisterSubscriberResponse.
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<GoogleCloudChannelV1RegisterSubscriberResponse> register(
GoogleCloudChannelV1RegisterSubscriberRequest request,
core.String account, {
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('$account') + ':register';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return GoogleCloudChannelV1RegisterSubscriberResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}