finishOAuthFlow method
Finishes OAuth flow for an account connector.
Request parameters:
accountConnector - Required. The resource name of the AccountConnector
in the format projects / * /locations / * /accountConnectors / * .
Value must have pattern
^projects/\[^/\]+/locations/\[^/\]+/accountConnectors/\[^/\]+$.
googleOauthParams_scopes - Required. The scopes returned by Google OAuth
flow.
googleOauthParams_ticket - Required. The ticket to be used for post
processing the callback from Google OAuth flow.
googleOauthParams_versionInfo - Optional. The version info returned by
Google OAuth flow.
oauthParams_code - Required. The code to be used for getting the token
from SCM provider.
oauthParams_ticket - Required. The ticket to be used for post processing
the callback from SCM provider.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a FinishOAuthResponse.
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<FinishOAuthResponse> finishOAuthFlow(
core.String accountConnector, {
core.List<core.String>? googleOauthParams_scopes,
core.String? googleOauthParams_ticket,
core.String? googleOauthParams_versionInfo,
core.String? oauthParams_code,
core.String? oauthParams_ticket,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'googleOauthParams.scopes': ?googleOauthParams_scopes,
'googleOauthParams.ticket': ?googleOauthParams_ticket == null
? null
: [googleOauthParams_ticket],
'googleOauthParams.versionInfo': ?googleOauthParams_versionInfo == null
? null
: [googleOauthParams_versionInfo],
'oauthParams.code': ?oauthParams_code == null ? null : [oauthParams_code],
'oauthParams.ticket': ?oauthParams_ticket == null
? null
: [oauthParams_ticket],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'v1/' +
core.Uri.encodeFull('$accountConnector') +
'/users:finishOAuthFlow';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return FinishOAuthResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}