@maxim_mazurok/gapi.client.doubleclicksearch-v2 0.0.20220802
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +746 -0
- package/package.json +20 -0
- package/readme.md +118 -0
- package/tests.ts +345 -0
- package/tsconfig.json +18 -0
- package/tslint.json +6 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,746 @@
|
|
|
1
|
+
/* Type definitions for non-npm package Search Ads 360 API v2 0.0 */
|
|
2
|
+
// Project: https://developers.google.com/search-ads
|
|
3
|
+
// Definitions by: Maxim Mazurok <https://github.com/Maxim-Mazurok>
|
|
4
|
+
// Nick Amoscato <https://github.com/namoscato>
|
|
5
|
+
// Declan Vong <https://github.com/declanvong>
|
|
6
|
+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
7
|
+
// TypeScript Version: 2.8
|
|
8
|
+
|
|
9
|
+
// IMPORTANT
|
|
10
|
+
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
|
11
|
+
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
|
12
|
+
// Generated from: https://doubleclicksearch.googleapis.com/$discovery/rest?version=v2
|
|
13
|
+
// Revision: 20220802
|
|
14
|
+
|
|
15
|
+
/// <reference types="gapi.client" />
|
|
16
|
+
|
|
17
|
+
declare namespace gapi.client {
|
|
18
|
+
/** Load Search Ads 360 API v2 */
|
|
19
|
+
function load(urlOrObject: "https://doubleclicksearch.googleapis.com/$discovery/rest?version=v2"): Promise<void>;
|
|
20
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
21
|
+
function load(name: "doubleclicksearch", version: "v2"): Promise<void>;
|
|
22
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
23
|
+
function load(name: "doubleclicksearch", version: "v2", callback: () => any): void;
|
|
24
|
+
|
|
25
|
+
namespace doubleclicksearch {
|
|
26
|
+
interface Availability {
|
|
27
|
+
/** DS advertiser ID. */
|
|
28
|
+
advertiserId?: string;
|
|
29
|
+
/** DS agency ID. */
|
|
30
|
+
agencyId?: string;
|
|
31
|
+
/** The time by which all conversions have been uploaded, in epoch millis UTC. */
|
|
32
|
+
availabilityTimestamp?: string;
|
|
33
|
+
/** The numeric segmentation identifier (for example, DoubleClick Search Floodlight activity ID). */
|
|
34
|
+
segmentationId?: string;
|
|
35
|
+
/** The friendly segmentation identifier (for example, DoubleClick Search Floodlight activity name). */
|
|
36
|
+
segmentationName?: string;
|
|
37
|
+
/** The segmentation type that this availability is for (its default value is `FLOODLIGHT`). */
|
|
38
|
+
segmentationType?: string;
|
|
39
|
+
}
|
|
40
|
+
interface Conversion {
|
|
41
|
+
/** DS ad group ID. */
|
|
42
|
+
adGroupId?: string;
|
|
43
|
+
/** DS ad ID. */
|
|
44
|
+
adId?: string;
|
|
45
|
+
/** DS advertiser ID. */
|
|
46
|
+
advertiserId?: string;
|
|
47
|
+
/** DS agency ID. */
|
|
48
|
+
agencyId?: string;
|
|
49
|
+
/** Available to advertisers only after contacting DoubleClick Search customer support. */
|
|
50
|
+
attributionModel?: string;
|
|
51
|
+
/** DS campaign ID. */
|
|
52
|
+
campaignId?: string;
|
|
53
|
+
/** Sales channel for the product. Acceptable values are: - "`local`": a physical store - "`online`": an online store */
|
|
54
|
+
channel?: string;
|
|
55
|
+
/** DS click ID for the conversion. */
|
|
56
|
+
clickId?: string;
|
|
57
|
+
/**
|
|
58
|
+
* For offline conversions, advertisers provide this ID. Advertisers can specify any ID that is meaningful to them. Each conversion in a request must specify a unique ID, and the
|
|
59
|
+
* combination of ID and timestamp must be unique amongst all conversions within the advertiser. For online conversions, DS copies the `dsConversionId` or `floodlightOrderId` into this
|
|
60
|
+
* property depending on the advertiser's Floodlight instructions.
|
|
61
|
+
*/
|
|
62
|
+
conversionId?: string;
|
|
63
|
+
/** The time at which the conversion was last modified, in epoch millis UTC. */
|
|
64
|
+
conversionModifiedTimestamp?: string;
|
|
65
|
+
/** The time at which the conversion took place, in epoch millis UTC. */
|
|
66
|
+
conversionTimestamp?: string;
|
|
67
|
+
/** Available to advertisers only after contacting DoubleClick Search customer support. */
|
|
68
|
+
countMillis?: string;
|
|
69
|
+
/** DS criterion (keyword) ID. */
|
|
70
|
+
criterionId?: string;
|
|
71
|
+
/** The currency code for the conversion's revenue. Should be in ISO 4217 alphabetic (3-char) format. */
|
|
72
|
+
currencyCode?: string;
|
|
73
|
+
/** Custom dimensions for the conversion, which can be used to filter data in a report. */
|
|
74
|
+
customDimension?: CustomDimension[];
|
|
75
|
+
/** Custom metrics for the conversion. */
|
|
76
|
+
customMetric?: CustomMetric[];
|
|
77
|
+
/** The type of device on which the conversion occurred. */
|
|
78
|
+
deviceType?: string;
|
|
79
|
+
/** ID that DoubleClick Search generates for each conversion. */
|
|
80
|
+
dsConversionId?: string;
|
|
81
|
+
/** DS engine account ID. */
|
|
82
|
+
engineAccountId?: string;
|
|
83
|
+
/** The Floodlight order ID provided by the advertiser for the conversion. */
|
|
84
|
+
floodlightOrderId?: string;
|
|
85
|
+
/** ID that DS generates and uses to uniquely identify the inventory account that contains the product. */
|
|
86
|
+
inventoryAccountId?: string;
|
|
87
|
+
/** The country registered for the Merchant Center feed that contains the product. Use an ISO 3166 code to specify a country. */
|
|
88
|
+
productCountry?: string;
|
|
89
|
+
/** DS product group ID. */
|
|
90
|
+
productGroupId?: string;
|
|
91
|
+
/** The product ID (SKU). */
|
|
92
|
+
productId?: string;
|
|
93
|
+
/** The language registered for the Merchant Center feed that contains the product. Use an ISO 639 code to specify a language. */
|
|
94
|
+
productLanguage?: string;
|
|
95
|
+
/** The quantity of this conversion, in millis. */
|
|
96
|
+
quantityMillis?: string;
|
|
97
|
+
/**
|
|
98
|
+
* The revenue amount of this `TRANSACTION` conversion, in micros (value multiplied by 1000000, no decimal). For example, to specify a revenue value of "10" enter "10000000" (10
|
|
99
|
+
* million) in your request.
|
|
100
|
+
*/
|
|
101
|
+
revenueMicros?: string;
|
|
102
|
+
/** The numeric segmentation identifier (for example, DoubleClick Search Floodlight activity ID). */
|
|
103
|
+
segmentationId?: string;
|
|
104
|
+
/** The friendly segmentation identifier (for example, DoubleClick Search Floodlight activity name). */
|
|
105
|
+
segmentationName?: string;
|
|
106
|
+
/** The segmentation type of this conversion (for example, `FLOODLIGHT`). */
|
|
107
|
+
segmentationType?: string;
|
|
108
|
+
/** The state of the conversion, that is, either `ACTIVE` or `REMOVED`. Note: state DELETED is deprecated. */
|
|
109
|
+
state?: string;
|
|
110
|
+
/** The ID of the local store for which the product was advertised. Applicable only when the channel is "`local`". */
|
|
111
|
+
storeId?: string;
|
|
112
|
+
/**
|
|
113
|
+
* The type of the conversion, that is, either `ACTION` or `TRANSACTION`. An `ACTION` conversion is an action by the user that has no monetarily quantifiable value, while a
|
|
114
|
+
* `TRANSACTION` conversion is an action that does have a monetarily quantifiable value. Examples are email list signups (`ACTION`) versus ecommerce purchases (`TRANSACTION`).
|
|
115
|
+
*/
|
|
116
|
+
type?: string;
|
|
117
|
+
}
|
|
118
|
+
interface ConversionList {
|
|
119
|
+
/** The conversions being requested. */
|
|
120
|
+
conversion?: Conversion[];
|
|
121
|
+
/** Identifies this as a ConversionList resource. Value: the fixed string doubleclicksearch#conversionList. */
|
|
122
|
+
kind?: string;
|
|
123
|
+
}
|
|
124
|
+
interface CustomDimension {
|
|
125
|
+
/** Custom dimension name. */
|
|
126
|
+
name?: string;
|
|
127
|
+
/** Custom dimension value. */
|
|
128
|
+
value?: string;
|
|
129
|
+
}
|
|
130
|
+
interface CustomMetric {
|
|
131
|
+
/** Custom metric name. */
|
|
132
|
+
name?: string;
|
|
133
|
+
/** Custom metric numeric value. */
|
|
134
|
+
value?: number;
|
|
135
|
+
}
|
|
136
|
+
// tslint:disable-next-line:no-empty-interface
|
|
137
|
+
interface IdMappingFile {
|
|
138
|
+
}
|
|
139
|
+
interface Report {
|
|
140
|
+
/** Asynchronous report only. Contains a list of generated report files once the report has successfully completed. */
|
|
141
|
+
files?: Array<{
|
|
142
|
+
/** The size of this report file in bytes. */
|
|
143
|
+
byteCount?: string;
|
|
144
|
+
/** Use this url to download the report file. */
|
|
145
|
+
url?: string;
|
|
146
|
+
}>;
|
|
147
|
+
/** Asynchronous report only. Id of the report. */
|
|
148
|
+
id?: string;
|
|
149
|
+
/** Asynchronous report only. True if and only if the report has completed successfully and the report files are ready to be downloaded. */
|
|
150
|
+
isReportReady?: boolean;
|
|
151
|
+
/** Identifies this as a Report resource. Value: the fixed string `doubleclicksearch#report`. */
|
|
152
|
+
kind?: string;
|
|
153
|
+
/** The request that created the report. Optional fields not specified in the original request are filled with default values. */
|
|
154
|
+
request?: ReportRequest;
|
|
155
|
+
/** The number of report rows generated by the report, not including headers. */
|
|
156
|
+
rowCount?: number;
|
|
157
|
+
/** Synchronous report only. Generated report rows. */
|
|
158
|
+
rows?: ReportRow[];
|
|
159
|
+
/**
|
|
160
|
+
* The currency code of all monetary values produced in the report, including values that are set by users (e.g., keyword bid settings) and metrics (e.g., cost and revenue). The
|
|
161
|
+
* currency code of a report is determined by the `statisticsCurrency` field of the report request.
|
|
162
|
+
*/
|
|
163
|
+
statisticsCurrencyCode?: string;
|
|
164
|
+
/** If all statistics of the report are sourced from the same time zone, this would be it. Otherwise the field is unset. */
|
|
165
|
+
statisticsTimeZone?: string;
|
|
166
|
+
}
|
|
167
|
+
interface ReportApiColumnSpec {
|
|
168
|
+
/** Name of a DoubleClick Search column to include in the report. */
|
|
169
|
+
columnName?: string;
|
|
170
|
+
/**
|
|
171
|
+
* Segments a report by a custom dimension. The report must be scoped to an advertiser or lower, and the custom dimension must already be set up in DoubleClick Search. The custom
|
|
172
|
+
* dimension name, which appears in DoubleClick Search, is case sensitive.\ If used in a conversion report, returns the value of the specified custom dimension for the given
|
|
173
|
+
* conversion, if set. This column does not segment the conversion report.
|
|
174
|
+
*/
|
|
175
|
+
customDimensionName?: string;
|
|
176
|
+
/**
|
|
177
|
+
* Name of a custom metric to include in the report. The report must be scoped to an advertiser or lower, and the custom metric must already be set up in DoubleClick Search. The custom
|
|
178
|
+
* metric name, which appears in DoubleClick Search, is case sensitive.
|
|
179
|
+
*/
|
|
180
|
+
customMetricName?: string;
|
|
181
|
+
/** Inclusive day in YYYY-MM-DD format. When provided, this overrides the overall time range of the report for this column only. Must be provided together with `startDate`. */
|
|
182
|
+
endDate?: string;
|
|
183
|
+
/** Synchronous report only. Set to `true` to group by this column. Defaults to `false`. */
|
|
184
|
+
groupByColumn?: boolean;
|
|
185
|
+
/**
|
|
186
|
+
* Text used to identify this column in the report output; defaults to `columnName` or `savedColumnName` when not specified. This can be used to prevent collisions between DoubleClick
|
|
187
|
+
* Search columns and saved columns with the same name.
|
|
188
|
+
*/
|
|
189
|
+
headerText?: string;
|
|
190
|
+
/** The platform that is used to provide data for the custom dimension. Acceptable values are "floodlight". */
|
|
191
|
+
platformSource?: string;
|
|
192
|
+
/**
|
|
193
|
+
* Returns metrics only for a specific type of product activity. Accepted values are: - "`sold`": returns metrics only for products that were sold - "`advertised`": returns metrics
|
|
194
|
+
* only for products that were advertised in a Shopping campaign, and that might or might not have been sold
|
|
195
|
+
*/
|
|
196
|
+
productReportPerspective?: string;
|
|
197
|
+
/** Name of a saved column to include in the report. The report must be scoped at advertiser or lower, and this saved column must already be created in the DoubleClick Search UI. */
|
|
198
|
+
savedColumnName?: string;
|
|
199
|
+
/** Inclusive date in YYYY-MM-DD format. When provided, this overrides the overall time range of the report for this column only. Must be provided together with `endDate`. */
|
|
200
|
+
startDate?: string;
|
|
201
|
+
}
|
|
202
|
+
interface ReportRequest {
|
|
203
|
+
/**
|
|
204
|
+
* The columns to include in the report. This includes both DoubleClick Search columns and saved columns. For DoubleClick Search columns, only the `columnName` parameter is required.
|
|
205
|
+
* For saved columns only the `savedColumnName` parameter is required. Both `columnName` and `savedColumnName` cannot be set in the same stanza.\ The maximum number of columns per
|
|
206
|
+
* request is 300.
|
|
207
|
+
*/
|
|
208
|
+
columns?: ReportApiColumnSpec[];
|
|
209
|
+
/** Format that the report should be returned in. Currently `csv` or `tsv` is supported. */
|
|
210
|
+
downloadFormat?: string;
|
|
211
|
+
/** A list of filters to be applied to the report.\ The maximum number of filters per request is 300. */
|
|
212
|
+
filters?: Array<{
|
|
213
|
+
/** Column to perform the filter on. This can be a DoubleClick Search column or a saved column. */
|
|
214
|
+
column?: ReportApiColumnSpec;
|
|
215
|
+
/** Operator to use in the filter. See the filter reference for a list of available operators. */
|
|
216
|
+
operator?: string;
|
|
217
|
+
/** A list of values to filter the column value against.\ The maximum number of filter values per request is 300. */
|
|
218
|
+
values?: any[];
|
|
219
|
+
}>;
|
|
220
|
+
/** Determines if removed entities should be included in the report. Defaults to `false`. Deprecated, please use `includeRemovedEntities` instead. */
|
|
221
|
+
includeDeletedEntities?: boolean;
|
|
222
|
+
/** Determines if removed entities should be included in the report. Defaults to `false`. */
|
|
223
|
+
includeRemovedEntities?: boolean;
|
|
224
|
+
/**
|
|
225
|
+
* Asynchronous report only. The maximum number of rows per report file. A large report is split into many files based on this field. Acceptable values are `1000000` to `100000000`,
|
|
226
|
+
* inclusive.
|
|
227
|
+
*/
|
|
228
|
+
maxRowsPerFile?: number;
|
|
229
|
+
/** Synchronous report only. A list of columns and directions defining sorting to be performed on the report rows.\ The maximum number of orderings per request is 300. */
|
|
230
|
+
orderBy?: Array<{
|
|
231
|
+
/** Column to perform the sort on. This can be a DoubleClick Search-defined column or a saved column. */
|
|
232
|
+
column?: ReportApiColumnSpec;
|
|
233
|
+
/** The sort direction, which is either `ascending` or `descending`. */
|
|
234
|
+
sortOrder?: string;
|
|
235
|
+
}>;
|
|
236
|
+
/**
|
|
237
|
+
* The reportScope is a set of IDs that are used to determine which subset of entities will be returned in the report. The full lineage of IDs from the lowest scoped level desired up
|
|
238
|
+
* through agency is required.
|
|
239
|
+
*/
|
|
240
|
+
reportScope?: {
|
|
241
|
+
/** DS ad group ID. */
|
|
242
|
+
adGroupId?: string;
|
|
243
|
+
/** DS ad ID. */
|
|
244
|
+
adId?: string;
|
|
245
|
+
/** DS advertiser ID. */
|
|
246
|
+
advertiserId?: string;
|
|
247
|
+
/** DS agency ID. */
|
|
248
|
+
agencyId?: string;
|
|
249
|
+
/** DS campaign ID. */
|
|
250
|
+
campaignId?: string;
|
|
251
|
+
/** DS engine account ID. */
|
|
252
|
+
engineAccountId?: string;
|
|
253
|
+
/** DS keyword ID. */
|
|
254
|
+
keywordId?: string;
|
|
255
|
+
};
|
|
256
|
+
/**
|
|
257
|
+
* Determines the type of rows that are returned in the report. For example, if you specify `reportType: keyword`, each row in the report will contain data about a keyword. See the
|
|
258
|
+
* [Types of Reports](/search-ads/v2/report-types/) reference for the columns that are available for each type.
|
|
259
|
+
*/
|
|
260
|
+
reportType?: string;
|
|
261
|
+
/** Synchronous report only. The maximum number of rows to return; additional rows are dropped. Acceptable values are `0` to `10000`, inclusive. Defaults to `10000`. */
|
|
262
|
+
rowCount?: number;
|
|
263
|
+
/** Synchronous report only. Zero-based index of the first row to return. Acceptable values are `0` to `50000`, inclusive. Defaults to `0`. */
|
|
264
|
+
startRow?: number;
|
|
265
|
+
/**
|
|
266
|
+
* Specifies the currency in which monetary will be returned. Possible values are: `usd`, `agency` (valid if the report is scoped to agency or lower), `advertiser` (valid if the report
|
|
267
|
+
* is scoped to * advertiser or lower), or `account` (valid if the report is scoped to engine account or lower).
|
|
268
|
+
*/
|
|
269
|
+
statisticsCurrency?: string;
|
|
270
|
+
/** If metrics are requested in a report, this argument will be used to restrict the metrics to a specific time range. */
|
|
271
|
+
timeRange?: {
|
|
272
|
+
/** Inclusive UTC timestamp in RFC format, e.g., `2013-07-16T10:16:23.555Z`. See additional references on how changed attribute reports work. */
|
|
273
|
+
changedAttributesSinceTimestamp?: string;
|
|
274
|
+
/** Inclusive UTC timestamp in RFC format, e.g., `2013-07-16T10:16:23.555Z`. See additional references on how changed metrics reports work. */
|
|
275
|
+
changedMetricsSinceTimestamp?: string;
|
|
276
|
+
/** Inclusive date in YYYY-MM-DD format. */
|
|
277
|
+
endDate?: string;
|
|
278
|
+
/** Inclusive date in YYYY-MM-DD format. */
|
|
279
|
+
startDate?: string;
|
|
280
|
+
};
|
|
281
|
+
/** If `true`, the report would only be created if all the requested stat data are sourced from a single timezone. Defaults to `false`. */
|
|
282
|
+
verifySingleTimeZone?: boolean;
|
|
283
|
+
}
|
|
284
|
+
interface ReportRow {
|
|
285
|
+
[key: string]: any;
|
|
286
|
+
}
|
|
287
|
+
interface SavedColumn {
|
|
288
|
+
/** Identifies this as a SavedColumn resource. Value: the fixed string doubleclicksearch#savedColumn. */
|
|
289
|
+
kind?: string;
|
|
290
|
+
/** The name of the saved column. */
|
|
291
|
+
savedColumnName?: string;
|
|
292
|
+
/** The type of data this saved column will produce. */
|
|
293
|
+
type?: string;
|
|
294
|
+
}
|
|
295
|
+
interface SavedColumnList {
|
|
296
|
+
/** The saved columns being requested. */
|
|
297
|
+
items?: SavedColumn[];
|
|
298
|
+
/** Identifies this as a SavedColumnList resource. Value: the fixed string doubleclicksearch#savedColumnList. */
|
|
299
|
+
kind?: string;
|
|
300
|
+
}
|
|
301
|
+
interface UpdateAvailabilityRequest {
|
|
302
|
+
/** The availabilities being requested. */
|
|
303
|
+
availabilities?: Availability[];
|
|
304
|
+
}
|
|
305
|
+
interface UpdateAvailabilityResponse {
|
|
306
|
+
/** The availabilities being returned. */
|
|
307
|
+
availabilities?: Availability[];
|
|
308
|
+
}
|
|
309
|
+
interface ConversionResource {
|
|
310
|
+
/** Retrieves a list of conversions from a DoubleClick Search engine account. */
|
|
311
|
+
get(request?: {
|
|
312
|
+
/** V1 error format. */
|
|
313
|
+
"$.xgafv"?: string;
|
|
314
|
+
/** OAuth access token. */
|
|
315
|
+
access_token?: string;
|
|
316
|
+
/** Numeric ID of the ad group. */
|
|
317
|
+
adGroupId?: string;
|
|
318
|
+
/** Numeric ID of the ad. */
|
|
319
|
+
adId?: string;
|
|
320
|
+
/** Numeric ID of the advertiser. */
|
|
321
|
+
advertiserId: string;
|
|
322
|
+
/** Numeric ID of the agency. */
|
|
323
|
+
agencyId: string;
|
|
324
|
+
/** Data format for response. */
|
|
325
|
+
alt?: string;
|
|
326
|
+
/** JSONP */
|
|
327
|
+
callback?: string;
|
|
328
|
+
/** Numeric ID of the campaign. */
|
|
329
|
+
campaignId?: string;
|
|
330
|
+
/** Numeric ID of the criterion. */
|
|
331
|
+
criterionId?: string;
|
|
332
|
+
/** Last date (inclusive) on which to retrieve conversions. Format is yyyymmdd. */
|
|
333
|
+
endDate: number;
|
|
334
|
+
/** Numeric ID of the engine account. */
|
|
335
|
+
engineAccountId: string;
|
|
336
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
337
|
+
fields?: string;
|
|
338
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
339
|
+
key?: string;
|
|
340
|
+
/** OAuth 2.0 token for the current user. */
|
|
341
|
+
oauth_token?: string;
|
|
342
|
+
/** Returns response with indentations and line breaks. */
|
|
343
|
+
prettyPrint?: boolean;
|
|
344
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
345
|
+
quotaUser?: string;
|
|
346
|
+
/** The number of conversions to return per call. */
|
|
347
|
+
rowCount: number;
|
|
348
|
+
/** First date (inclusive) on which to retrieve conversions. Format is yyyymmdd. */
|
|
349
|
+
startDate: number;
|
|
350
|
+
/** The 0-based starting index for retrieving conversions results. */
|
|
351
|
+
startRow: number;
|
|
352
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
353
|
+
upload_protocol?: string;
|
|
354
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
355
|
+
uploadType?: string;
|
|
356
|
+
}): Request<ConversionList>;
|
|
357
|
+
/** Inserts a batch of new conversions into DoubleClick Search. */
|
|
358
|
+
insert(request: {
|
|
359
|
+
/** V1 error format. */
|
|
360
|
+
"$.xgafv"?: string;
|
|
361
|
+
/** OAuth access token. */
|
|
362
|
+
access_token?: string;
|
|
363
|
+
/** Data format for response. */
|
|
364
|
+
alt?: string;
|
|
365
|
+
/** JSONP */
|
|
366
|
+
callback?: string;
|
|
367
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
368
|
+
fields?: string;
|
|
369
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
370
|
+
key?: string;
|
|
371
|
+
/** OAuth 2.0 token for the current user. */
|
|
372
|
+
oauth_token?: string;
|
|
373
|
+
/** Returns response with indentations and line breaks. */
|
|
374
|
+
prettyPrint?: boolean;
|
|
375
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
376
|
+
quotaUser?: string;
|
|
377
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
378
|
+
upload_protocol?: string;
|
|
379
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
380
|
+
uploadType?: string;
|
|
381
|
+
/** Request body */
|
|
382
|
+
resource: ConversionList;
|
|
383
|
+
}): Request<ConversionList>;
|
|
384
|
+
insert(request: {
|
|
385
|
+
/** V1 error format. */
|
|
386
|
+
"$.xgafv"?: string;
|
|
387
|
+
/** OAuth access token. */
|
|
388
|
+
access_token?: string;
|
|
389
|
+
/** Data format for response. */
|
|
390
|
+
alt?: string;
|
|
391
|
+
/** JSONP */
|
|
392
|
+
callback?: string;
|
|
393
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
394
|
+
fields?: string;
|
|
395
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
396
|
+
key?: string;
|
|
397
|
+
/** OAuth 2.0 token for the current user. */
|
|
398
|
+
oauth_token?: string;
|
|
399
|
+
/** Returns response with indentations and line breaks. */
|
|
400
|
+
prettyPrint?: boolean;
|
|
401
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
402
|
+
quotaUser?: string;
|
|
403
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
404
|
+
upload_protocol?: string;
|
|
405
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
406
|
+
uploadType?: string;
|
|
407
|
+
},
|
|
408
|
+
body: ConversionList): Request<ConversionList>;
|
|
409
|
+
/** Updates a batch of conversions in DoubleClick Search. */
|
|
410
|
+
update(request: {
|
|
411
|
+
/** V1 error format. */
|
|
412
|
+
"$.xgafv"?: string;
|
|
413
|
+
/** OAuth access token. */
|
|
414
|
+
access_token?: string;
|
|
415
|
+
/** Data format for response. */
|
|
416
|
+
alt?: string;
|
|
417
|
+
/** JSONP */
|
|
418
|
+
callback?: string;
|
|
419
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
420
|
+
fields?: string;
|
|
421
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
422
|
+
key?: string;
|
|
423
|
+
/** OAuth 2.0 token for the current user. */
|
|
424
|
+
oauth_token?: string;
|
|
425
|
+
/** Returns response with indentations and line breaks. */
|
|
426
|
+
prettyPrint?: boolean;
|
|
427
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
428
|
+
quotaUser?: string;
|
|
429
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
430
|
+
upload_protocol?: string;
|
|
431
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
432
|
+
uploadType?: string;
|
|
433
|
+
/** Request body */
|
|
434
|
+
resource: ConversionList;
|
|
435
|
+
}): Request<ConversionList>;
|
|
436
|
+
update(request: {
|
|
437
|
+
/** V1 error format. */
|
|
438
|
+
"$.xgafv"?: string;
|
|
439
|
+
/** OAuth access token. */
|
|
440
|
+
access_token?: string;
|
|
441
|
+
/** Data format for response. */
|
|
442
|
+
alt?: string;
|
|
443
|
+
/** JSONP */
|
|
444
|
+
callback?: string;
|
|
445
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
446
|
+
fields?: string;
|
|
447
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
448
|
+
key?: string;
|
|
449
|
+
/** OAuth 2.0 token for the current user. */
|
|
450
|
+
oauth_token?: string;
|
|
451
|
+
/** Returns response with indentations and line breaks. */
|
|
452
|
+
prettyPrint?: boolean;
|
|
453
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
454
|
+
quotaUser?: string;
|
|
455
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
456
|
+
upload_protocol?: string;
|
|
457
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
458
|
+
uploadType?: string;
|
|
459
|
+
},
|
|
460
|
+
body: ConversionList): Request<ConversionList>;
|
|
461
|
+
/** Updates the availabilities of a batch of floodlight activities in DoubleClick Search. */
|
|
462
|
+
updateAvailability(request: {
|
|
463
|
+
/** V1 error format. */
|
|
464
|
+
"$.xgafv"?: string;
|
|
465
|
+
/** OAuth access token. */
|
|
466
|
+
access_token?: string;
|
|
467
|
+
/** Data format for response. */
|
|
468
|
+
alt?: string;
|
|
469
|
+
/** JSONP */
|
|
470
|
+
callback?: string;
|
|
471
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
472
|
+
fields?: string;
|
|
473
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
474
|
+
key?: string;
|
|
475
|
+
/** OAuth 2.0 token for the current user. */
|
|
476
|
+
oauth_token?: string;
|
|
477
|
+
/** Returns response with indentations and line breaks. */
|
|
478
|
+
prettyPrint?: boolean;
|
|
479
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
480
|
+
quotaUser?: string;
|
|
481
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
482
|
+
upload_protocol?: string;
|
|
483
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
484
|
+
uploadType?: string;
|
|
485
|
+
/** Request body */
|
|
486
|
+
resource: UpdateAvailabilityRequest;
|
|
487
|
+
}): Request<UpdateAvailabilityResponse>;
|
|
488
|
+
updateAvailability(request: {
|
|
489
|
+
/** V1 error format. */
|
|
490
|
+
"$.xgafv"?: string;
|
|
491
|
+
/** OAuth access token. */
|
|
492
|
+
access_token?: string;
|
|
493
|
+
/** Data format for response. */
|
|
494
|
+
alt?: string;
|
|
495
|
+
/** JSONP */
|
|
496
|
+
callback?: string;
|
|
497
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
498
|
+
fields?: string;
|
|
499
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
500
|
+
key?: string;
|
|
501
|
+
/** OAuth 2.0 token for the current user. */
|
|
502
|
+
oauth_token?: string;
|
|
503
|
+
/** Returns response with indentations and line breaks. */
|
|
504
|
+
prettyPrint?: boolean;
|
|
505
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
506
|
+
quotaUser?: string;
|
|
507
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
508
|
+
upload_protocol?: string;
|
|
509
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
510
|
+
uploadType?: string;
|
|
511
|
+
},
|
|
512
|
+
body: UpdateAvailabilityRequest): Request<UpdateAvailabilityResponse>;
|
|
513
|
+
}
|
|
514
|
+
interface ReportsResource {
|
|
515
|
+
/** Generates and returns a report immediately. */
|
|
516
|
+
generate(request: {
|
|
517
|
+
/** V1 error format. */
|
|
518
|
+
"$.xgafv"?: string;
|
|
519
|
+
/** OAuth access token. */
|
|
520
|
+
access_token?: string;
|
|
521
|
+
/** Data format for response. */
|
|
522
|
+
alt?: string;
|
|
523
|
+
/** JSONP */
|
|
524
|
+
callback?: string;
|
|
525
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
526
|
+
fields?: string;
|
|
527
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
528
|
+
key?: string;
|
|
529
|
+
/** OAuth 2.0 token for the current user. */
|
|
530
|
+
oauth_token?: string;
|
|
531
|
+
/** Returns response with indentations and line breaks. */
|
|
532
|
+
prettyPrint?: boolean;
|
|
533
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
534
|
+
quotaUser?: string;
|
|
535
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
536
|
+
upload_protocol?: string;
|
|
537
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
538
|
+
uploadType?: string;
|
|
539
|
+
/** Request body */
|
|
540
|
+
resource: ReportRequest;
|
|
541
|
+
}): Request<Report>;
|
|
542
|
+
generate(request: {
|
|
543
|
+
/** V1 error format. */
|
|
544
|
+
"$.xgafv"?: string;
|
|
545
|
+
/** OAuth access token. */
|
|
546
|
+
access_token?: string;
|
|
547
|
+
/** Data format for response. */
|
|
548
|
+
alt?: string;
|
|
549
|
+
/** JSONP */
|
|
550
|
+
callback?: string;
|
|
551
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
552
|
+
fields?: string;
|
|
553
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
554
|
+
key?: string;
|
|
555
|
+
/** OAuth 2.0 token for the current user. */
|
|
556
|
+
oauth_token?: string;
|
|
557
|
+
/** Returns response with indentations and line breaks. */
|
|
558
|
+
prettyPrint?: boolean;
|
|
559
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
560
|
+
quotaUser?: string;
|
|
561
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
562
|
+
upload_protocol?: string;
|
|
563
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
564
|
+
uploadType?: string;
|
|
565
|
+
},
|
|
566
|
+
body: ReportRequest): Request<Report>;
|
|
567
|
+
/** Polls for the status of a report request. */
|
|
568
|
+
get(request?: {
|
|
569
|
+
/** V1 error format. */
|
|
570
|
+
"$.xgafv"?: string;
|
|
571
|
+
/** OAuth access token. */
|
|
572
|
+
access_token?: string;
|
|
573
|
+
/** Data format for response. */
|
|
574
|
+
alt?: string;
|
|
575
|
+
/** JSONP */
|
|
576
|
+
callback?: string;
|
|
577
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
578
|
+
fields?: string;
|
|
579
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
580
|
+
key?: string;
|
|
581
|
+
/** OAuth 2.0 token for the current user. */
|
|
582
|
+
oauth_token?: string;
|
|
583
|
+
/** Returns response with indentations and line breaks. */
|
|
584
|
+
prettyPrint?: boolean;
|
|
585
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
586
|
+
quotaUser?: string;
|
|
587
|
+
/** ID of the report request being polled. */
|
|
588
|
+
reportId: string;
|
|
589
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
590
|
+
upload_protocol?: string;
|
|
591
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
592
|
+
uploadType?: string;
|
|
593
|
+
}): Request<Report>;
|
|
594
|
+
/** Downloads a report file encoded in UTF-8. */
|
|
595
|
+
getFile(request?: {
|
|
596
|
+
/** V1 error format. */
|
|
597
|
+
"$.xgafv"?: string;
|
|
598
|
+
/** OAuth access token. */
|
|
599
|
+
access_token?: string;
|
|
600
|
+
/** Data format for response. */
|
|
601
|
+
alt?: string;
|
|
602
|
+
/** JSONP */
|
|
603
|
+
callback?: string;
|
|
604
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
605
|
+
fields?: string;
|
|
606
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
607
|
+
key?: string;
|
|
608
|
+
/** OAuth 2.0 token for the current user. */
|
|
609
|
+
oauth_token?: string;
|
|
610
|
+
/** Returns response with indentations and line breaks. */
|
|
611
|
+
prettyPrint?: boolean;
|
|
612
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
613
|
+
quotaUser?: string;
|
|
614
|
+
/** The index of the report fragment to download. */
|
|
615
|
+
reportFragment: number;
|
|
616
|
+
/** ID of the report. */
|
|
617
|
+
reportId: string;
|
|
618
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
619
|
+
upload_protocol?: string;
|
|
620
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
621
|
+
uploadType?: string;
|
|
622
|
+
}): Request<void>;
|
|
623
|
+
/**
|
|
624
|
+
* Downloads a csv file(encoded in UTF-8) that contains ID mappings between legacy SA360 and new SA360. The file includes all children entities of the given advertiser(e.g. engine
|
|
625
|
+
* accounts, campaigns, ad groups, etc.) that exist in both legacy SA360 and new SA360.
|
|
626
|
+
*/
|
|
627
|
+
getIdMappingFile(request?: {
|
|
628
|
+
/** V1 error format. */
|
|
629
|
+
"$.xgafv"?: string;
|
|
630
|
+
/** OAuth access token. */
|
|
631
|
+
access_token?: string;
|
|
632
|
+
/** Legacy SA360 advertiser ID. */
|
|
633
|
+
advertiserId: string;
|
|
634
|
+
/** Legacy SA360 agency ID. */
|
|
635
|
+
agencyId: string;
|
|
636
|
+
/** Data format for response. */
|
|
637
|
+
alt?: string;
|
|
638
|
+
/** JSONP */
|
|
639
|
+
callback?: string;
|
|
640
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
641
|
+
fields?: string;
|
|
642
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
643
|
+
key?: string;
|
|
644
|
+
/** OAuth 2.0 token for the current user. */
|
|
645
|
+
oauth_token?: string;
|
|
646
|
+
/** Returns response with indentations and line breaks. */
|
|
647
|
+
prettyPrint?: boolean;
|
|
648
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
649
|
+
quotaUser?: string;
|
|
650
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
651
|
+
upload_protocol?: string;
|
|
652
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
653
|
+
uploadType?: string;
|
|
654
|
+
}): Request<{}>;
|
|
655
|
+
/** Inserts a report request into the reporting system. */
|
|
656
|
+
request(request: {
|
|
657
|
+
/** V1 error format. */
|
|
658
|
+
"$.xgafv"?: string;
|
|
659
|
+
/** OAuth access token. */
|
|
660
|
+
access_token?: string;
|
|
661
|
+
/** Data format for response. */
|
|
662
|
+
alt?: string;
|
|
663
|
+
/** JSONP */
|
|
664
|
+
callback?: string;
|
|
665
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
666
|
+
fields?: string;
|
|
667
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
668
|
+
key?: string;
|
|
669
|
+
/** OAuth 2.0 token for the current user. */
|
|
670
|
+
oauth_token?: string;
|
|
671
|
+
/** Returns response with indentations and line breaks. */
|
|
672
|
+
prettyPrint?: boolean;
|
|
673
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
674
|
+
quotaUser?: string;
|
|
675
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
676
|
+
upload_protocol?: string;
|
|
677
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
678
|
+
uploadType?: string;
|
|
679
|
+
/** Request body */
|
|
680
|
+
resource: ReportRequest;
|
|
681
|
+
}): Request<Report>;
|
|
682
|
+
request(request: {
|
|
683
|
+
/** V1 error format. */
|
|
684
|
+
"$.xgafv"?: string;
|
|
685
|
+
/** OAuth access token. */
|
|
686
|
+
access_token?: string;
|
|
687
|
+
/** Data format for response. */
|
|
688
|
+
alt?: string;
|
|
689
|
+
/** JSONP */
|
|
690
|
+
callback?: string;
|
|
691
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
692
|
+
fields?: string;
|
|
693
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
694
|
+
key?: string;
|
|
695
|
+
/** OAuth 2.0 token for the current user. */
|
|
696
|
+
oauth_token?: string;
|
|
697
|
+
/** Returns response with indentations and line breaks. */
|
|
698
|
+
prettyPrint?: boolean;
|
|
699
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
700
|
+
quotaUser?: string;
|
|
701
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
702
|
+
upload_protocol?: string;
|
|
703
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
704
|
+
uploadType?: string;
|
|
705
|
+
},
|
|
706
|
+
body: ReportRequest): Request<Report>;
|
|
707
|
+
}
|
|
708
|
+
interface SavedColumnsResource {
|
|
709
|
+
/** Retrieve the list of saved columns for a specified advertiser. */
|
|
710
|
+
list(request?: {
|
|
711
|
+
/** V1 error format. */
|
|
712
|
+
"$.xgafv"?: string;
|
|
713
|
+
/** OAuth access token. */
|
|
714
|
+
access_token?: string;
|
|
715
|
+
/** DS ID of the advertiser. */
|
|
716
|
+
advertiserId: string;
|
|
717
|
+
/** DS ID of the agency. */
|
|
718
|
+
agencyId: string;
|
|
719
|
+
/** Data format for response. */
|
|
720
|
+
alt?: string;
|
|
721
|
+
/** JSONP */
|
|
722
|
+
callback?: string;
|
|
723
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
724
|
+
fields?: string;
|
|
725
|
+
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
726
|
+
key?: string;
|
|
727
|
+
/** OAuth 2.0 token for the current user. */
|
|
728
|
+
oauth_token?: string;
|
|
729
|
+
/** Returns response with indentations and line breaks. */
|
|
730
|
+
prettyPrint?: boolean;
|
|
731
|
+
/** Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */
|
|
732
|
+
quotaUser?: string;
|
|
733
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
734
|
+
upload_protocol?: string;
|
|
735
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
736
|
+
uploadType?: string;
|
|
737
|
+
}): Request<SavedColumnList>;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
const conversion: ConversionResource;
|
|
741
|
+
|
|
742
|
+
const reports: ReportsResource;
|
|
743
|
+
|
|
744
|
+
const savedColumns: SavedColumnsResource;
|
|
745
|
+
}
|
|
746
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maxim_mazurok/gapi.client.doubleclicksearch-v2",
|
|
3
|
+
"version": "0.0.20220802",
|
|
4
|
+
"description": "TypeScript typings for Search Ads 360 API v2",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": {
|
|
7
|
+
"email": "maxim@mazurok.com",
|
|
8
|
+
"name": "Maxim Mazurok",
|
|
9
|
+
"url": "https://maxim.mazurok.com"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
|
|
14
|
+
},
|
|
15
|
+
"types": "index.d.ts",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@types/gapi.client": "*",
|
|
18
|
+
"@types/gapi.client.discovery": "*"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# TypeScript typings for Search Ads 360 API v2
|
|
2
|
+
|
|
3
|
+
The Search Ads 360 API allows developers to automate uploading conversions and downloading reports from Search Ads 360.
|
|
4
|
+
For detailed description please check [documentation](https://developers.google.com/search-ads).
|
|
5
|
+
|
|
6
|
+
## Installing
|
|
7
|
+
|
|
8
|
+
Install typings for Search Ads 360 API:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npm install @types/gapi.client.doubleclicksearch-v2 --save-dev
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Usage
|
|
15
|
+
|
|
16
|
+
You need to initialize Google API client in your code:
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
gapi.load('client', () => {
|
|
20
|
+
// now we can use gapi.client
|
|
21
|
+
// ...
|
|
22
|
+
});
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Then load api client wrapper:
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
gapi.client.load('https://doubleclicksearch.googleapis.com/$discovery/rest?version=v2', () => {
|
|
29
|
+
// now we can use:
|
|
30
|
+
// gapi.client.doubleclicksearch
|
|
31
|
+
});
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
|
|
36
|
+
gapi.client.load('doubleclicksearch', 'v2', () => {
|
|
37
|
+
// now we can use:
|
|
38
|
+
// gapi.client.doubleclicksearch
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Don't forget to authenticate your client before sending any request to resources:
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
// declare client_id registered in Google Developers Console
|
|
46
|
+
var client_id = '',
|
|
47
|
+
scope = [
|
|
48
|
+
// View and manage your advertising data in DoubleClick Search
|
|
49
|
+
'https://www.googleapis.com/auth/doubleclicksearch',
|
|
50
|
+
],
|
|
51
|
+
immediate = true;
|
|
52
|
+
// ...
|
|
53
|
+
|
|
54
|
+
gapi.auth.authorize(
|
|
55
|
+
{ client_id: client_id, scope: scope, immediate: immediate },
|
|
56
|
+
authResult => {
|
|
57
|
+
if (authResult && !authResult.error) {
|
|
58
|
+
/* handle successful authorization */
|
|
59
|
+
} else {
|
|
60
|
+
/* handle authorization error */
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
After that you can use Search Ads 360 API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
|
|
69
|
+
/*
|
|
70
|
+
Retrieves a list of conversions from a DoubleClick Search engine account.
|
|
71
|
+
*/
|
|
72
|
+
await gapi.client.doubleclicksearch.conversion.get({ advertiserId: "advertiserId", agencyId: "agencyId", endDate: 1, engineAccountId: "engineAccountId", rowCount: 1, startDate: 1, startRow: 1, });
|
|
73
|
+
|
|
74
|
+
/*
|
|
75
|
+
Inserts a batch of new conversions into DoubleClick Search.
|
|
76
|
+
*/
|
|
77
|
+
await gapi.client.doubleclicksearch.conversion.insert({ });
|
|
78
|
+
|
|
79
|
+
/*
|
|
80
|
+
Updates a batch of conversions in DoubleClick Search.
|
|
81
|
+
*/
|
|
82
|
+
await gapi.client.doubleclicksearch.conversion.update({ });
|
|
83
|
+
|
|
84
|
+
/*
|
|
85
|
+
Updates the availabilities of a batch of floodlight activities in DoubleClick Search.
|
|
86
|
+
*/
|
|
87
|
+
await gapi.client.doubleclicksearch.conversion.updateAvailability({ });
|
|
88
|
+
|
|
89
|
+
/*
|
|
90
|
+
Generates and returns a report immediately.
|
|
91
|
+
*/
|
|
92
|
+
await gapi.client.doubleclicksearch.reports.generate({ });
|
|
93
|
+
|
|
94
|
+
/*
|
|
95
|
+
Polls for the status of a report request.
|
|
96
|
+
*/
|
|
97
|
+
await gapi.client.doubleclicksearch.reports.get({ reportId: "reportId", });
|
|
98
|
+
|
|
99
|
+
/*
|
|
100
|
+
Downloads a report file encoded in UTF-8.
|
|
101
|
+
*/
|
|
102
|
+
await gapi.client.doubleclicksearch.reports.getFile({ reportFragment: 1, reportId: "reportId", });
|
|
103
|
+
|
|
104
|
+
/*
|
|
105
|
+
Downloads a csv file(encoded in UTF-8) that contains ID mappings between legacy SA360 and new SA360. The file includes all children entities of the given advertiser(e.g. engine accounts, campaigns, ad groups, etc.) that exist in both legacy SA360 and new SA360.
|
|
106
|
+
*/
|
|
107
|
+
await gapi.client.doubleclicksearch.reports.getIdMappingFile({ advertiserId: "advertiserId", agencyId: "agencyId", });
|
|
108
|
+
|
|
109
|
+
/*
|
|
110
|
+
Inserts a report request into the reporting system.
|
|
111
|
+
*/
|
|
112
|
+
await gapi.client.doubleclicksearch.reports.request({ });
|
|
113
|
+
|
|
114
|
+
/*
|
|
115
|
+
Retrieve the list of saved columns for a specified advertiser.
|
|
116
|
+
*/
|
|
117
|
+
await gapi.client.doubleclicksearch.savedColumns.list({ advertiserId: "advertiserId", agencyId: "agencyId", });
|
|
118
|
+
```
|
package/tests.ts
ADDED
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
/* This is stub file for gapi.client.doubleclicksearch-v2 definition tests */
|
|
2
|
+
// IMPORTANT
|
|
3
|
+
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
|
4
|
+
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
|
5
|
+
|
|
6
|
+
// Revision: 20220802
|
|
7
|
+
|
|
8
|
+
gapi.load('client', async () => {
|
|
9
|
+
/** now we can use gapi.client */
|
|
10
|
+
|
|
11
|
+
await gapi.client.load('https://doubleclicksearch.googleapis.com/$discovery/rest?version=v2');
|
|
12
|
+
/** now we can use gapi.client.doubleclicksearch */
|
|
13
|
+
|
|
14
|
+
/** don't forget to authenticate your client before sending any request to resources: */
|
|
15
|
+
/** declare client_id registered in Google Developers Console */
|
|
16
|
+
const client_id = '<<PUT YOUR CLIENT ID HERE>>';
|
|
17
|
+
const scope = [
|
|
18
|
+
/** View and manage your advertising data in DoubleClick Search */
|
|
19
|
+
'https://www.googleapis.com/auth/doubleclicksearch',
|
|
20
|
+
];
|
|
21
|
+
const immediate = false;
|
|
22
|
+
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
|
23
|
+
if (authResult && !authResult.error) {
|
|
24
|
+
/** handle successful authorization */
|
|
25
|
+
run();
|
|
26
|
+
} else {
|
|
27
|
+
/** handle authorization error */
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
async function run() {
|
|
32
|
+
/** Retrieves a list of conversions from a DoubleClick Search engine account. */
|
|
33
|
+
await gapi.client.doubleclicksearch.conversion.get({
|
|
34
|
+
adGroupId: "Test string",
|
|
35
|
+
adId: "Test string",
|
|
36
|
+
advertiserId: "Test string",
|
|
37
|
+
agencyId: "Test string",
|
|
38
|
+
campaignId: "Test string",
|
|
39
|
+
criterionId: "Test string",
|
|
40
|
+
endDate: 42,
|
|
41
|
+
engineAccountId: "Test string",
|
|
42
|
+
rowCount: 42,
|
|
43
|
+
startDate: 42,
|
|
44
|
+
startRow: 42,
|
|
45
|
+
});
|
|
46
|
+
/** Inserts a batch of new conversions into DoubleClick Search. */
|
|
47
|
+
await gapi.client.doubleclicksearch.conversion.insert({
|
|
48
|
+
}, {
|
|
49
|
+
conversion: [
|
|
50
|
+
{
|
|
51
|
+
adGroupId: "Test string",
|
|
52
|
+
adId: "Test string",
|
|
53
|
+
advertiserId: "Test string",
|
|
54
|
+
agencyId: "Test string",
|
|
55
|
+
attributionModel: "Test string",
|
|
56
|
+
campaignId: "Test string",
|
|
57
|
+
channel: "Test string",
|
|
58
|
+
clickId: "Test string",
|
|
59
|
+
conversionId: "Test string",
|
|
60
|
+
conversionModifiedTimestamp: "Test string",
|
|
61
|
+
conversionTimestamp: "Test string",
|
|
62
|
+
countMillis: "Test string",
|
|
63
|
+
criterionId: "Test string",
|
|
64
|
+
currencyCode: "Test string",
|
|
65
|
+
customDimension: [
|
|
66
|
+
{
|
|
67
|
+
name: "Test string",
|
|
68
|
+
value: "Test string",
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
customMetric: [
|
|
72
|
+
{
|
|
73
|
+
name: "Test string",
|
|
74
|
+
value: 42,
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
deviceType: "Test string",
|
|
78
|
+
dsConversionId: "Test string",
|
|
79
|
+
engineAccountId: "Test string",
|
|
80
|
+
floodlightOrderId: "Test string",
|
|
81
|
+
inventoryAccountId: "Test string",
|
|
82
|
+
productCountry: "Test string",
|
|
83
|
+
productGroupId: "Test string",
|
|
84
|
+
productId: "Test string",
|
|
85
|
+
productLanguage: "Test string",
|
|
86
|
+
quantityMillis: "Test string",
|
|
87
|
+
revenueMicros: "Test string",
|
|
88
|
+
segmentationId: "Test string",
|
|
89
|
+
segmentationName: "Test string",
|
|
90
|
+
segmentationType: "Test string",
|
|
91
|
+
state: "Test string",
|
|
92
|
+
storeId: "Test string",
|
|
93
|
+
type: "Test string",
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
kind: "Test string",
|
|
97
|
+
});
|
|
98
|
+
/** Updates a batch of conversions in DoubleClick Search. */
|
|
99
|
+
await gapi.client.doubleclicksearch.conversion.update({
|
|
100
|
+
}, {
|
|
101
|
+
conversion: [
|
|
102
|
+
{
|
|
103
|
+
adGroupId: "Test string",
|
|
104
|
+
adId: "Test string",
|
|
105
|
+
advertiserId: "Test string",
|
|
106
|
+
agencyId: "Test string",
|
|
107
|
+
attributionModel: "Test string",
|
|
108
|
+
campaignId: "Test string",
|
|
109
|
+
channel: "Test string",
|
|
110
|
+
clickId: "Test string",
|
|
111
|
+
conversionId: "Test string",
|
|
112
|
+
conversionModifiedTimestamp: "Test string",
|
|
113
|
+
conversionTimestamp: "Test string",
|
|
114
|
+
countMillis: "Test string",
|
|
115
|
+
criterionId: "Test string",
|
|
116
|
+
currencyCode: "Test string",
|
|
117
|
+
customDimension: [
|
|
118
|
+
{
|
|
119
|
+
name: "Test string",
|
|
120
|
+
value: "Test string",
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
customMetric: [
|
|
124
|
+
{
|
|
125
|
+
name: "Test string",
|
|
126
|
+
value: 42,
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
deviceType: "Test string",
|
|
130
|
+
dsConversionId: "Test string",
|
|
131
|
+
engineAccountId: "Test string",
|
|
132
|
+
floodlightOrderId: "Test string",
|
|
133
|
+
inventoryAccountId: "Test string",
|
|
134
|
+
productCountry: "Test string",
|
|
135
|
+
productGroupId: "Test string",
|
|
136
|
+
productId: "Test string",
|
|
137
|
+
productLanguage: "Test string",
|
|
138
|
+
quantityMillis: "Test string",
|
|
139
|
+
revenueMicros: "Test string",
|
|
140
|
+
segmentationId: "Test string",
|
|
141
|
+
segmentationName: "Test string",
|
|
142
|
+
segmentationType: "Test string",
|
|
143
|
+
state: "Test string",
|
|
144
|
+
storeId: "Test string",
|
|
145
|
+
type: "Test string",
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
kind: "Test string",
|
|
149
|
+
});
|
|
150
|
+
/** Updates the availabilities of a batch of floodlight activities in DoubleClick Search. */
|
|
151
|
+
await gapi.client.doubleclicksearch.conversion.updateAvailability({
|
|
152
|
+
}, {
|
|
153
|
+
availabilities: [
|
|
154
|
+
{
|
|
155
|
+
advertiserId: "Test string",
|
|
156
|
+
agencyId: "Test string",
|
|
157
|
+
availabilityTimestamp: "Test string",
|
|
158
|
+
segmentationId: "Test string",
|
|
159
|
+
segmentationName: "Test string",
|
|
160
|
+
segmentationType: "Test string",
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
});
|
|
164
|
+
/** Generates and returns a report immediately. */
|
|
165
|
+
await gapi.client.doubleclicksearch.reports.generate({
|
|
166
|
+
}, {
|
|
167
|
+
columns: [
|
|
168
|
+
{
|
|
169
|
+
columnName: "Test string",
|
|
170
|
+
customDimensionName: "Test string",
|
|
171
|
+
customMetricName: "Test string",
|
|
172
|
+
endDate: "Test string",
|
|
173
|
+
groupByColumn: true,
|
|
174
|
+
headerText: "Test string",
|
|
175
|
+
platformSource: "Test string",
|
|
176
|
+
productReportPerspective: "Test string",
|
|
177
|
+
savedColumnName: "Test string",
|
|
178
|
+
startDate: "Test string",
|
|
179
|
+
}
|
|
180
|
+
],
|
|
181
|
+
downloadFormat: "Test string",
|
|
182
|
+
filters: [
|
|
183
|
+
{
|
|
184
|
+
column: {
|
|
185
|
+
columnName: "Test string",
|
|
186
|
+
customDimensionName: "Test string",
|
|
187
|
+
customMetricName: "Test string",
|
|
188
|
+
endDate: "Test string",
|
|
189
|
+
groupByColumn: true,
|
|
190
|
+
headerText: "Test string",
|
|
191
|
+
platformSource: "Test string",
|
|
192
|
+
productReportPerspective: "Test string",
|
|
193
|
+
savedColumnName: "Test string",
|
|
194
|
+
startDate: "Test string",
|
|
195
|
+
},
|
|
196
|
+
operator: "Test string",
|
|
197
|
+
values: [
|
|
198
|
+
42
|
|
199
|
+
],
|
|
200
|
+
}
|
|
201
|
+
],
|
|
202
|
+
includeDeletedEntities: true,
|
|
203
|
+
includeRemovedEntities: true,
|
|
204
|
+
maxRowsPerFile: 42,
|
|
205
|
+
orderBy: [
|
|
206
|
+
{
|
|
207
|
+
column: {
|
|
208
|
+
columnName: "Test string",
|
|
209
|
+
customDimensionName: "Test string",
|
|
210
|
+
customMetricName: "Test string",
|
|
211
|
+
endDate: "Test string",
|
|
212
|
+
groupByColumn: true,
|
|
213
|
+
headerText: "Test string",
|
|
214
|
+
platformSource: "Test string",
|
|
215
|
+
productReportPerspective: "Test string",
|
|
216
|
+
savedColumnName: "Test string",
|
|
217
|
+
startDate: "Test string",
|
|
218
|
+
},
|
|
219
|
+
sortOrder: "Test string",
|
|
220
|
+
}
|
|
221
|
+
],
|
|
222
|
+
reportScope: {
|
|
223
|
+
adGroupId: "Test string",
|
|
224
|
+
adId: "Test string",
|
|
225
|
+
advertiserId: "Test string",
|
|
226
|
+
agencyId: "Test string",
|
|
227
|
+
campaignId: "Test string",
|
|
228
|
+
engineAccountId: "Test string",
|
|
229
|
+
keywordId: "Test string",
|
|
230
|
+
},
|
|
231
|
+
reportType: "Test string",
|
|
232
|
+
rowCount: 42,
|
|
233
|
+
startRow: 42,
|
|
234
|
+
statisticsCurrency: "Test string",
|
|
235
|
+
timeRange: {
|
|
236
|
+
changedAttributesSinceTimestamp: "Test string",
|
|
237
|
+
changedMetricsSinceTimestamp: "Test string",
|
|
238
|
+
endDate: "Test string",
|
|
239
|
+
startDate: "Test string",
|
|
240
|
+
},
|
|
241
|
+
verifySingleTimeZone: true,
|
|
242
|
+
});
|
|
243
|
+
/** Polls for the status of a report request. */
|
|
244
|
+
await gapi.client.doubleclicksearch.reports.get({
|
|
245
|
+
reportId: "Test string",
|
|
246
|
+
});
|
|
247
|
+
/** Downloads a report file encoded in UTF-8. */
|
|
248
|
+
await gapi.client.doubleclicksearch.reports.getFile({
|
|
249
|
+
reportFragment: 42,
|
|
250
|
+
reportId: "Test string",
|
|
251
|
+
});
|
|
252
|
+
/**
|
|
253
|
+
* Downloads a csv file(encoded in UTF-8) that contains ID mappings between legacy SA360 and new SA360. The file includes all children entities of the given advertiser(e.g. engine
|
|
254
|
+
* accounts, campaigns, ad groups, etc.) that exist in both legacy SA360 and new SA360.
|
|
255
|
+
*/
|
|
256
|
+
await gapi.client.doubleclicksearch.reports.getIdMappingFile({
|
|
257
|
+
advertiserId: "Test string",
|
|
258
|
+
agencyId: "Test string",
|
|
259
|
+
});
|
|
260
|
+
/** Inserts a report request into the reporting system. */
|
|
261
|
+
await gapi.client.doubleclicksearch.reports.request({
|
|
262
|
+
}, {
|
|
263
|
+
columns: [
|
|
264
|
+
{
|
|
265
|
+
columnName: "Test string",
|
|
266
|
+
customDimensionName: "Test string",
|
|
267
|
+
customMetricName: "Test string",
|
|
268
|
+
endDate: "Test string",
|
|
269
|
+
groupByColumn: true,
|
|
270
|
+
headerText: "Test string",
|
|
271
|
+
platformSource: "Test string",
|
|
272
|
+
productReportPerspective: "Test string",
|
|
273
|
+
savedColumnName: "Test string",
|
|
274
|
+
startDate: "Test string",
|
|
275
|
+
}
|
|
276
|
+
],
|
|
277
|
+
downloadFormat: "Test string",
|
|
278
|
+
filters: [
|
|
279
|
+
{
|
|
280
|
+
column: {
|
|
281
|
+
columnName: "Test string",
|
|
282
|
+
customDimensionName: "Test string",
|
|
283
|
+
customMetricName: "Test string",
|
|
284
|
+
endDate: "Test string",
|
|
285
|
+
groupByColumn: true,
|
|
286
|
+
headerText: "Test string",
|
|
287
|
+
platformSource: "Test string",
|
|
288
|
+
productReportPerspective: "Test string",
|
|
289
|
+
savedColumnName: "Test string",
|
|
290
|
+
startDate: "Test string",
|
|
291
|
+
},
|
|
292
|
+
operator: "Test string",
|
|
293
|
+
values: [
|
|
294
|
+
42
|
|
295
|
+
],
|
|
296
|
+
}
|
|
297
|
+
],
|
|
298
|
+
includeDeletedEntities: true,
|
|
299
|
+
includeRemovedEntities: true,
|
|
300
|
+
maxRowsPerFile: 42,
|
|
301
|
+
orderBy: [
|
|
302
|
+
{
|
|
303
|
+
column: {
|
|
304
|
+
columnName: "Test string",
|
|
305
|
+
customDimensionName: "Test string",
|
|
306
|
+
customMetricName: "Test string",
|
|
307
|
+
endDate: "Test string",
|
|
308
|
+
groupByColumn: true,
|
|
309
|
+
headerText: "Test string",
|
|
310
|
+
platformSource: "Test string",
|
|
311
|
+
productReportPerspective: "Test string",
|
|
312
|
+
savedColumnName: "Test string",
|
|
313
|
+
startDate: "Test string",
|
|
314
|
+
},
|
|
315
|
+
sortOrder: "Test string",
|
|
316
|
+
}
|
|
317
|
+
],
|
|
318
|
+
reportScope: {
|
|
319
|
+
adGroupId: "Test string",
|
|
320
|
+
adId: "Test string",
|
|
321
|
+
advertiserId: "Test string",
|
|
322
|
+
agencyId: "Test string",
|
|
323
|
+
campaignId: "Test string",
|
|
324
|
+
engineAccountId: "Test string",
|
|
325
|
+
keywordId: "Test string",
|
|
326
|
+
},
|
|
327
|
+
reportType: "Test string",
|
|
328
|
+
rowCount: 42,
|
|
329
|
+
startRow: 42,
|
|
330
|
+
statisticsCurrency: "Test string",
|
|
331
|
+
timeRange: {
|
|
332
|
+
changedAttributesSinceTimestamp: "Test string",
|
|
333
|
+
changedMetricsSinceTimestamp: "Test string",
|
|
334
|
+
endDate: "Test string",
|
|
335
|
+
startDate: "Test string",
|
|
336
|
+
},
|
|
337
|
+
verifySingleTimeZone: true,
|
|
338
|
+
});
|
|
339
|
+
/** Retrieve the list of saved columns for a specified advertiser. */
|
|
340
|
+
await gapi.client.doubleclicksearch.savedColumns.list({
|
|
341
|
+
advertiserId: "Test string",
|
|
342
|
+
agencyId: "Test string",
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
});
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "commonjs",
|
|
4
|
+
"lib": ["es6", "dom"],
|
|
5
|
+
"noImplicitAny": true,
|
|
6
|
+
"noImplicitThis": true,
|
|
7
|
+
"strictNullChecks": true,
|
|
8
|
+
"baseUrl": "../",
|
|
9
|
+
"typeRoots": [
|
|
10
|
+
"../"
|
|
11
|
+
],
|
|
12
|
+
"types": [],
|
|
13
|
+
"noEmit": true,
|
|
14
|
+
"forceConsistentCasingInFileNames": true,
|
|
15
|
+
"strictFunctionTypes": true
|
|
16
|
+
},
|
|
17
|
+
"files": ["index.d.ts", "tests.ts"]
|
|
18
|
+
}
|