create method
- GoogleAdsSearchads360V23ServicesCreateDataLinkRequest request,
- String customerId, {
- String? $fields,
Creates a data link.
The requesting Google Ads account name and account ID will be shared with the third party (such as YouTube creators for video links) to whom you are creating the link with. Only customers on the allow-list can create data links. List of thrown errors: [AuthenticationError]() [AuthorizationError]() [DatabaseError]() [DataLinkError]() [FieldError]() [HeaderError]() [InternalError]() [MutateError]() [QuotaError]() [RequestError]()
request - The metadata request object.
Request parameters:
customerId - Required. The ID of the customer for which the data link is
created.
Value must have pattern ^\[^/\]+$.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a GoogleAdsSearchads360V23ServicesCreateDataLinkResponse.
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<GoogleAdsSearchads360V23ServicesCreateDataLinkResponse> create(
GoogleAdsSearchads360V23ServicesCreateDataLinkRequest request,
core.String customerId, {
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_ =
'v23/customers/' +
core.Uri.encodeFull('$customerId') +
'/dataLinks:create';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return GoogleAdsSearchads360V23ServicesCreateDataLinkResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}