create method
Creates a partner link for the given account.
Authorization Headers: This method supports the following optional headers
to define how the API authorizes access for the request: *
login-account: (Optional) The resource name of the account where the
Google Account of the credentials is a user. If not set, defaults to the
account of the request. Format:
accountTypes/{loginAccountType}/accounts/{loginAccountId}
request - The metadata request object.
Request parameters:
parent - Required. The parent, which owns this collection of partner
links. Format: accountTypes/{account_type}/accounts/{account}
Value must have pattern ^accountTypes/\[^/\]+/accounts/\[^/\]+$.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a PartnerLink.
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<PartnerLink> create(
PartnerLink request,
core.String parent, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/partnerLinks';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return PartnerLink.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}