@maxim_mazurok/gapi.client.mybusinessverifications-v1 0.0.20220809
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 +548 -0
- package/package.json +20 -0
- package/readme.md +67 -0
- package/tests.ts +121 -0
- package/tsconfig.json +18 -0
- package/tslint.json +6 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,548 @@
|
|
|
1
|
+
/* Type definitions for non-npm package My Business Verifications API v1 0.0 */
|
|
2
|
+
// Project: https://developers.google.com/my-business/
|
|
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://mybusinessverifications.googleapis.com/$discovery/rest?version=v1
|
|
13
|
+
// Revision: 20220809
|
|
14
|
+
|
|
15
|
+
/// <reference types="gapi.client" />
|
|
16
|
+
|
|
17
|
+
declare namespace gapi.client {
|
|
18
|
+
/** Load My Business Verifications API v1 */
|
|
19
|
+
function load(urlOrObject: "https://mybusinessverifications.googleapis.com/$discovery/rest?version=v1"): Promise<void>;
|
|
20
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
21
|
+
function load(name: "mybusinessverifications", version: "v1"): Promise<void>;
|
|
22
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
23
|
+
function load(name: "mybusinessverifications", version: "v1", callback: () => any): void;
|
|
24
|
+
|
|
25
|
+
namespace mybusinessverifications {
|
|
26
|
+
interface AddressVerificationData {
|
|
27
|
+
/** Address that a postcard can be sent to. */
|
|
28
|
+
address?: PostalAddress;
|
|
29
|
+
/** Merchant's business name. */
|
|
30
|
+
business?: string;
|
|
31
|
+
/** Expected number of days it takes to deliver a postcard to the address's region. */
|
|
32
|
+
expectedDeliveryDaysRegion?: number;
|
|
33
|
+
}
|
|
34
|
+
interface CompleteVerificationRequest {
|
|
35
|
+
/** Required. PIN code received by the merchant to complete the verification. */
|
|
36
|
+
pin?: string;
|
|
37
|
+
}
|
|
38
|
+
interface CompleteVerificationResponse {
|
|
39
|
+
/** The completed verification. */
|
|
40
|
+
verification?: Verification;
|
|
41
|
+
}
|
|
42
|
+
interface ComplyWithGuidelines {
|
|
43
|
+
/** The reason why the location is being recommended to comply with guidelines. */
|
|
44
|
+
recommendationReason?: string;
|
|
45
|
+
}
|
|
46
|
+
interface EmailVerificationData {
|
|
47
|
+
/** Domain name in the email address. e.g. "gmail.com" in foo@gmail.com */
|
|
48
|
+
domain?: string;
|
|
49
|
+
/** Whether client is allowed to provide a different user name. */
|
|
50
|
+
isUserNameEditable?: boolean;
|
|
51
|
+
/** User name in the email address. e.g. "foo" in foo@gmail.com */
|
|
52
|
+
user?: string;
|
|
53
|
+
}
|
|
54
|
+
interface FetchVerificationOptionsRequest {
|
|
55
|
+
/**
|
|
56
|
+
* Optional. Extra context information for the verification of service businesses. Can only be applied to the locations whose business type is CUSTOMER_LOCATION_ONLY. Specifying an
|
|
57
|
+
* accurate address could enable more options. INVALID_ARGUMENT will be thrown if it is set for other business types of locations.
|
|
58
|
+
*/
|
|
59
|
+
context?: ServiceBusinessContext;
|
|
60
|
+
/** Required. The BCP 47 language code representing the language that is to be used for the verification process. Available options vary by language. */
|
|
61
|
+
languageCode?: string;
|
|
62
|
+
}
|
|
63
|
+
interface FetchVerificationOptionsResponse {
|
|
64
|
+
/** The available verification options. */
|
|
65
|
+
options?: VerificationOption[];
|
|
66
|
+
}
|
|
67
|
+
interface GenerateVerificationTokenRequest {
|
|
68
|
+
/** Required. The target location. */
|
|
69
|
+
location?: Location;
|
|
70
|
+
}
|
|
71
|
+
interface GenerateVerificationTokenResponse {
|
|
72
|
+
/** The generated token to verify the location. */
|
|
73
|
+
token?: VerificationToken;
|
|
74
|
+
}
|
|
75
|
+
interface ListVerificationsResponse {
|
|
76
|
+
/**
|
|
77
|
+
* If the number of verifications exceeded the requested page size, this field will be populated with a token to fetch the next page of verification on a subsequent call. If there are
|
|
78
|
+
* no more attributes, this field will not be present in the response.
|
|
79
|
+
*/
|
|
80
|
+
nextPageToken?: string;
|
|
81
|
+
/** List of the verifications. */
|
|
82
|
+
verifications?: Verification[];
|
|
83
|
+
}
|
|
84
|
+
interface Location {
|
|
85
|
+
/**
|
|
86
|
+
* Required. A precise, accurate address to describe your business location. PO boxes or mailboxes located at remote locations are not acceptable. At this time, you can specify a
|
|
87
|
+
* maximum of five `address_lines` values in the address.
|
|
88
|
+
*/
|
|
89
|
+
address?: PostalAddress;
|
|
90
|
+
/**
|
|
91
|
+
* Required. Location name should reflect your business's real-world name, as used consistently on your storefront, website, and stationery, and as known to customers. Any additional
|
|
92
|
+
* information, when relevant, can be included in other fields of the resource (for example, `Address`, `Categories`). Don't add unnecessary information to your name (for example,
|
|
93
|
+
* prefer "Google" over "Google Inc. - Mountain View Corporate Headquarters"). Don't include marketing taglines, store codes, special characters, hours or closed/open status, phone
|
|
94
|
+
* numbers, website URLs, service/product information, location/address or directions, or containment information (for example, "Chase ATM in Duane Reade").
|
|
95
|
+
*/
|
|
96
|
+
name?: string;
|
|
97
|
+
/** Required. Id of the category that best describes the core business this location engages in. e.g. gcid:bakery. */
|
|
98
|
+
primaryCategoryId?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Optional. A phone number that connects to your individual business location as directly as possible. Use a local phone number instead of a central, call center helpline number
|
|
101
|
+
* whenever possible.
|
|
102
|
+
*/
|
|
103
|
+
primaryPhone?: string;
|
|
104
|
+
/**
|
|
105
|
+
* Optional. A URL for this business. If possible, use a URL that represents this individual business location instead of a generic website/URL that represents all locations, or the
|
|
106
|
+
* brand.
|
|
107
|
+
*/
|
|
108
|
+
websiteUri?: string;
|
|
109
|
+
}
|
|
110
|
+
interface PostalAddress {
|
|
111
|
+
/**
|
|
112
|
+
* Unstructured address lines describing the lower levels of an address. Because values in address_lines do not have type information and may sometimes contain multiple values in a
|
|
113
|
+
* single field (e.g. "Austin, TX"), it is important that the line order is clear. The order of address lines should be "envelope order" for the country/region of the address. In
|
|
114
|
+
* places where this can vary (e.g. Japan), address_language is used to make it explicit (e.g. "ja" for large-to-small ordering and "ja-Latn" or "en" for small-to-large). This way, the
|
|
115
|
+
* most specific line of an address can be selected based on the language. The minimum permitted structural representation of an address consists of a region_code with all remaining
|
|
116
|
+
* information placed in the address_lines. It would be possible to format such an address very approximately without geocoding, but no semantic reasoning could be made about any of
|
|
117
|
+
* the address components until it was at least partially resolved. Creating an address only containing a region_code and address_lines, and then geocoding is the recommended way to
|
|
118
|
+
* handle completely unstructured addresses (as opposed to guessing which parts of the address should be localities or administrative areas).
|
|
119
|
+
*/
|
|
120
|
+
addressLines?: string[];
|
|
121
|
+
/**
|
|
122
|
+
* Optional. Highest administrative subdivision which is used for postal addresses of a country or region. For example, this can be a state, a province, an oblast, or a prefecture.
|
|
123
|
+
* Specifically, for Spain this is the province and not the autonomous community (e.g. "Barcelona" and not "Catalonia"). Many countries don't use an administrative area in postal
|
|
124
|
+
* addresses. E.g. in Switzerland this should be left unpopulated.
|
|
125
|
+
*/
|
|
126
|
+
administrativeArea?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Optional. BCP-47 language code of the contents of this address (if known). This is often the UI language of the input form or is expected to match one of the languages used in the
|
|
129
|
+
* address' country/region, or their transliterated equivalents. This can affect formatting in certain countries, but is not critical to the correctness of the data and will never
|
|
130
|
+
* affect any validation or other non-formatting related operations. If this value is not known, it should be omitted (rather than specifying a possibly incorrect default). Examples:
|
|
131
|
+
* "zh-Hant", "ja", "ja-Latn", "en".
|
|
132
|
+
*/
|
|
133
|
+
languageCode?: string;
|
|
134
|
+
/**
|
|
135
|
+
* Optional. Generally refers to the city/town portion of the address. Examples: US city, IT comune, UK post town. In regions of the world where localities are not well defined or do
|
|
136
|
+
* not fit into this structure well, leave locality empty and use address_lines.
|
|
137
|
+
*/
|
|
138
|
+
locality?: string;
|
|
139
|
+
/** Optional. The name of the organization at the address. */
|
|
140
|
+
organization?: string;
|
|
141
|
+
/**
|
|
142
|
+
* Optional. Postal code of the address. Not all countries use or require postal codes to be present, but where they are used, they may trigger additional validation with other parts
|
|
143
|
+
* of the address (e.g. state/zip validation in the U.S.A.).
|
|
144
|
+
*/
|
|
145
|
+
postalCode?: string;
|
|
146
|
+
/** Optional. The recipient at the address. This field may, under certain circumstances, contain multiline information. For example, it might contain "care of" information. */
|
|
147
|
+
recipients?: string[];
|
|
148
|
+
/**
|
|
149
|
+
* Required. CLDR region code of the country/region of the address. This is never inferred and it is up to the user to ensure the value is correct. See https://cldr.unicode.org/ and
|
|
150
|
+
* https://www.unicode.org/cldr/charts/30/supplemental/territory_information.html for details. Example: "CH" for Switzerland.
|
|
151
|
+
*/
|
|
152
|
+
regionCode?: string;
|
|
153
|
+
/** The schema revision of the `PostalAddress`. This must be set to 0, which is the latest revision. All new revisions **must** be backward compatible with old revisions. */
|
|
154
|
+
revision?: number;
|
|
155
|
+
/**
|
|
156
|
+
* Optional. Additional, country-specific, sorting code. This is not used in most regions. Where it is used, the value is either a string like "CEDEX", optionally followed by a number
|
|
157
|
+
* (e.g. "CEDEX 7"), or just a number alone, representing the "sector code" (Jamaica), "delivery area indicator" (Malawi) or "post office indicator" (e.g. Côte d'Ivoire).
|
|
158
|
+
*/
|
|
159
|
+
sortingCode?: string;
|
|
160
|
+
/** Optional. Sublocality of the address. For example, this can be neighborhoods, boroughs, districts. */
|
|
161
|
+
sublocality?: string;
|
|
162
|
+
}
|
|
163
|
+
// tslint:disable-next-line:no-empty-interface
|
|
164
|
+
interface ResolveOwnershipConflict {
|
|
165
|
+
}
|
|
166
|
+
interface ServiceBusinessContext {
|
|
167
|
+
/** The verification address of the location. It is used to either enable more verification options or send a postcard. */
|
|
168
|
+
address?: PostalAddress;
|
|
169
|
+
}
|
|
170
|
+
interface Verification {
|
|
171
|
+
/** The timestamp when the verification is requested. */
|
|
172
|
+
createTime?: string;
|
|
173
|
+
/** The method of the verification. */
|
|
174
|
+
method?: string;
|
|
175
|
+
/** Resource name of the verification. */
|
|
176
|
+
name?: string;
|
|
177
|
+
/** The state of the verification. */
|
|
178
|
+
state?: string;
|
|
179
|
+
}
|
|
180
|
+
interface VerificationOption {
|
|
181
|
+
/** Set only if the method is MAIL. */
|
|
182
|
+
addressData?: AddressVerificationData;
|
|
183
|
+
/** Set only if the method is EMAIL. */
|
|
184
|
+
emailData?: EmailVerificationData;
|
|
185
|
+
/** Set only if the method is PHONE_CALL or SMS. Phone number that the PIN will be sent to. */
|
|
186
|
+
phoneNumber?: string;
|
|
187
|
+
/** Method to verify the location. */
|
|
188
|
+
verificationMethod?: string;
|
|
189
|
+
}
|
|
190
|
+
interface VerificationToken {
|
|
191
|
+
/** The token string. */
|
|
192
|
+
tokenString?: string;
|
|
193
|
+
}
|
|
194
|
+
interface Verify {
|
|
195
|
+
/** Indicates whether a verification process has already started, and can be completed by the location. */
|
|
196
|
+
hasPendingVerification?: boolean;
|
|
197
|
+
}
|
|
198
|
+
interface VerifyLocationRequest {
|
|
199
|
+
/**
|
|
200
|
+
* Optional. Extra context information for the verification of service businesses. It is only required for the locations whose business type is CUSTOMER_LOCATION_ONLY. For ADDRESS
|
|
201
|
+
* verification, the address will be used to send out postcard. For other methods, it should be the same as the one that is passed to GetVerificationOptions. INVALID_ARGUMENT will be
|
|
202
|
+
* thrown if it is set for other types of business locations.
|
|
203
|
+
*/
|
|
204
|
+
context?: ServiceBusinessContext;
|
|
205
|
+
/**
|
|
206
|
+
* Optional. The input for EMAIL method. Email address where the PIN should be sent to. An email address is accepted only if it is one of the addresses provided by
|
|
207
|
+
* FetchVerificationOptions. If the EmailVerificationData has is_user_name_editable set to true, the client may specify a different user name (local-part) but must match the domain
|
|
208
|
+
* name.
|
|
209
|
+
*/
|
|
210
|
+
emailAddress?: string;
|
|
211
|
+
/** Optional. The BCP 47 language code representing the language that is to be used for the verification process. */
|
|
212
|
+
languageCode?: string;
|
|
213
|
+
/** Optional. The input for ADDRESS method. Contact name the mail should be sent to. */
|
|
214
|
+
mailerContact?: string;
|
|
215
|
+
/** Required. Verification method. */
|
|
216
|
+
method?: string;
|
|
217
|
+
/** Optional. The input for PHONE_CALL/SMS method The phone number that should be called or be sent SMS to. It must be one of the phone numbers in the eligible options. */
|
|
218
|
+
phoneNumber?: string;
|
|
219
|
+
/**
|
|
220
|
+
* Optional. The input for VETTED_PARTNER method available to select [partners.](https://support.google.com/business/answer/7674102) The input is not needed for a vetted account. Token
|
|
221
|
+
* that is associated to the location. Token that is associated to the location.
|
|
222
|
+
*/
|
|
223
|
+
token?: VerificationToken;
|
|
224
|
+
}
|
|
225
|
+
interface VerifyLocationResponse {
|
|
226
|
+
/** The created verification request. */
|
|
227
|
+
verification?: Verification;
|
|
228
|
+
}
|
|
229
|
+
interface VoiceOfMerchantState {
|
|
230
|
+
/**
|
|
231
|
+
* The location fails to comply with our [guidelines](https://support.google.com/business/answer/3038177) and requires additional steps for reinstatement. To fix this issue, consult
|
|
232
|
+
* the [Help Center Article](https://support.google.com/business/answer/4569145).
|
|
233
|
+
*/
|
|
234
|
+
complyWithGuidelines?: ComplyWithGuidelines;
|
|
235
|
+
/**
|
|
236
|
+
* Indicates whether the location has the authority (ownership) over the business on Google. If true, another location cannot take over and become the dominant listing on Maps.
|
|
237
|
+
* However, edits will not become live unless Voice of Merchant is gained (i.e. has_voice_of_merchant is true).
|
|
238
|
+
*/
|
|
239
|
+
hasBusinessAuthority?: boolean;
|
|
240
|
+
/** Indicates whether the location is in good standing and has control over the business on Google. Any edits made to the location will propagate to Maps after passing the review phase. */
|
|
241
|
+
hasVoiceOfMerchant?: boolean;
|
|
242
|
+
/**
|
|
243
|
+
* This location duplicates another location that is in good standing. If you have access to the location in good standing, use that location's id to perform operations. Otherwise,
|
|
244
|
+
* request access from the current owner.
|
|
245
|
+
*/
|
|
246
|
+
resolveOwnershipConflict?: any;
|
|
247
|
+
/** Start or continue the verification process. */
|
|
248
|
+
verify?: Verify;
|
|
249
|
+
/** Wait to gain Voice of Merchant. The location is under review for quality purposes. */
|
|
250
|
+
waitForVoiceOfMerchant?: any;
|
|
251
|
+
}
|
|
252
|
+
// tslint:disable-next-line:no-empty-interface
|
|
253
|
+
interface WaitForVoiceOfMerchant {
|
|
254
|
+
}
|
|
255
|
+
interface VerificationsResource {
|
|
256
|
+
/** Completes a `PENDING` verification. It is only necessary for non `AUTO` verification methods. `AUTO` verification request is instantly `VERIFIED` upon creation. */
|
|
257
|
+
complete(request: {
|
|
258
|
+
/** V1 error format. */
|
|
259
|
+
"$.xgafv"?: string;
|
|
260
|
+
/** OAuth access token. */
|
|
261
|
+
access_token?: string;
|
|
262
|
+
/** Data format for response. */
|
|
263
|
+
alt?: string;
|
|
264
|
+
/** JSONP */
|
|
265
|
+
callback?: string;
|
|
266
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
267
|
+
fields?: string;
|
|
268
|
+
/** 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. */
|
|
269
|
+
key?: string;
|
|
270
|
+
/** Required. Resource name of the verification to complete. */
|
|
271
|
+
name: string;
|
|
272
|
+
/** OAuth 2.0 token for the current user. */
|
|
273
|
+
oauth_token?: string;
|
|
274
|
+
/** Returns response with indentations and line breaks. */
|
|
275
|
+
prettyPrint?: boolean;
|
|
276
|
+
/** 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. */
|
|
277
|
+
quotaUser?: string;
|
|
278
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
279
|
+
upload_protocol?: string;
|
|
280
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
281
|
+
uploadType?: string;
|
|
282
|
+
/** Request body */
|
|
283
|
+
resource: CompleteVerificationRequest;
|
|
284
|
+
}): Request<CompleteVerificationResponse>;
|
|
285
|
+
complete(request: {
|
|
286
|
+
/** V1 error format. */
|
|
287
|
+
"$.xgafv"?: string;
|
|
288
|
+
/** OAuth access token. */
|
|
289
|
+
access_token?: string;
|
|
290
|
+
/** Data format for response. */
|
|
291
|
+
alt?: string;
|
|
292
|
+
/** JSONP */
|
|
293
|
+
callback?: string;
|
|
294
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
295
|
+
fields?: string;
|
|
296
|
+
/** 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. */
|
|
297
|
+
key?: string;
|
|
298
|
+
/** Required. Resource name of the verification to complete. */
|
|
299
|
+
name: string;
|
|
300
|
+
/** OAuth 2.0 token for the current user. */
|
|
301
|
+
oauth_token?: string;
|
|
302
|
+
/** Returns response with indentations and line breaks. */
|
|
303
|
+
prettyPrint?: boolean;
|
|
304
|
+
/** 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. */
|
|
305
|
+
quotaUser?: string;
|
|
306
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
307
|
+
upload_protocol?: string;
|
|
308
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
309
|
+
uploadType?: string;
|
|
310
|
+
},
|
|
311
|
+
body: CompleteVerificationRequest): Request<CompleteVerificationResponse>;
|
|
312
|
+
/** List verifications of a location, ordered by create time. */
|
|
313
|
+
list(request?: {
|
|
314
|
+
/** V1 error format. */
|
|
315
|
+
"$.xgafv"?: string;
|
|
316
|
+
/** OAuth access token. */
|
|
317
|
+
access_token?: string;
|
|
318
|
+
/** Data format for response. */
|
|
319
|
+
alt?: string;
|
|
320
|
+
/** JSONP */
|
|
321
|
+
callback?: string;
|
|
322
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
323
|
+
fields?: string;
|
|
324
|
+
/** 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. */
|
|
325
|
+
key?: string;
|
|
326
|
+
/** OAuth 2.0 token for the current user. */
|
|
327
|
+
oauth_token?: string;
|
|
328
|
+
/** How many verification to include per page. Minimum is 1, and the default and maximum page size is 100. */
|
|
329
|
+
pageSize?: number;
|
|
330
|
+
/** If specified, returns the next page of verifications. */
|
|
331
|
+
pageToken?: string;
|
|
332
|
+
/** Required. Resource name of the location that verification requests belong to. */
|
|
333
|
+
parent: string;
|
|
334
|
+
/** Returns response with indentations and line breaks. */
|
|
335
|
+
prettyPrint?: boolean;
|
|
336
|
+
/** 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. */
|
|
337
|
+
quotaUser?: string;
|
|
338
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
339
|
+
upload_protocol?: string;
|
|
340
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
341
|
+
uploadType?: string;
|
|
342
|
+
}): Request<ListVerificationsResponse>;
|
|
343
|
+
}
|
|
344
|
+
interface LocationsResource {
|
|
345
|
+
/** Reports all eligible verification options for a location in a specific language. */
|
|
346
|
+
fetchVerificationOptions(request: {
|
|
347
|
+
/** V1 error format. */
|
|
348
|
+
"$.xgafv"?: string;
|
|
349
|
+
/** OAuth access token. */
|
|
350
|
+
access_token?: string;
|
|
351
|
+
/** Data format for response. */
|
|
352
|
+
alt?: string;
|
|
353
|
+
/** JSONP */
|
|
354
|
+
callback?: string;
|
|
355
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
356
|
+
fields?: string;
|
|
357
|
+
/** 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. */
|
|
358
|
+
key?: string;
|
|
359
|
+
/** Required. The location to verify. */
|
|
360
|
+
location: string;
|
|
361
|
+
/** OAuth 2.0 token for the current user. */
|
|
362
|
+
oauth_token?: string;
|
|
363
|
+
/** Returns response with indentations and line breaks. */
|
|
364
|
+
prettyPrint?: boolean;
|
|
365
|
+
/** 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. */
|
|
366
|
+
quotaUser?: string;
|
|
367
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
368
|
+
upload_protocol?: string;
|
|
369
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
370
|
+
uploadType?: string;
|
|
371
|
+
/** Request body */
|
|
372
|
+
resource: FetchVerificationOptionsRequest;
|
|
373
|
+
}): Request<FetchVerificationOptionsResponse>;
|
|
374
|
+
fetchVerificationOptions(request: {
|
|
375
|
+
/** V1 error format. */
|
|
376
|
+
"$.xgafv"?: string;
|
|
377
|
+
/** OAuth access token. */
|
|
378
|
+
access_token?: string;
|
|
379
|
+
/** Data format for response. */
|
|
380
|
+
alt?: string;
|
|
381
|
+
/** JSONP */
|
|
382
|
+
callback?: string;
|
|
383
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
384
|
+
fields?: string;
|
|
385
|
+
/** 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. */
|
|
386
|
+
key?: string;
|
|
387
|
+
/** Required. The location to verify. */
|
|
388
|
+
location: string;
|
|
389
|
+
/** OAuth 2.0 token for the current user. */
|
|
390
|
+
oauth_token?: string;
|
|
391
|
+
/** Returns response with indentations and line breaks. */
|
|
392
|
+
prettyPrint?: boolean;
|
|
393
|
+
/** 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. */
|
|
394
|
+
quotaUser?: string;
|
|
395
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
396
|
+
upload_protocol?: string;
|
|
397
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
398
|
+
uploadType?: string;
|
|
399
|
+
},
|
|
400
|
+
body: FetchVerificationOptionsRequest): Request<FetchVerificationOptionsResponse>;
|
|
401
|
+
/** Gets the VoiceOfMerchant state. */
|
|
402
|
+
getVoiceOfMerchantState(request?: {
|
|
403
|
+
/** V1 error format. */
|
|
404
|
+
"$.xgafv"?: string;
|
|
405
|
+
/** OAuth access token. */
|
|
406
|
+
access_token?: string;
|
|
407
|
+
/** Data format for response. */
|
|
408
|
+
alt?: string;
|
|
409
|
+
/** JSONP */
|
|
410
|
+
callback?: string;
|
|
411
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
412
|
+
fields?: string;
|
|
413
|
+
/** 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. */
|
|
414
|
+
key?: string;
|
|
415
|
+
/** Required. Resource name of the location. */
|
|
416
|
+
name: string;
|
|
417
|
+
/** OAuth 2.0 token for the current user. */
|
|
418
|
+
oauth_token?: string;
|
|
419
|
+
/** Returns response with indentations and line breaks. */
|
|
420
|
+
prettyPrint?: boolean;
|
|
421
|
+
/** 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. */
|
|
422
|
+
quotaUser?: string;
|
|
423
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
424
|
+
upload_protocol?: string;
|
|
425
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
426
|
+
uploadType?: string;
|
|
427
|
+
}): Request<VoiceOfMerchantState>;
|
|
428
|
+
/** Starts the verification process for a location. */
|
|
429
|
+
verify(request: {
|
|
430
|
+
/** V1 error format. */
|
|
431
|
+
"$.xgafv"?: string;
|
|
432
|
+
/** OAuth access token. */
|
|
433
|
+
access_token?: string;
|
|
434
|
+
/** Data format for response. */
|
|
435
|
+
alt?: string;
|
|
436
|
+
/** JSONP */
|
|
437
|
+
callback?: string;
|
|
438
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
439
|
+
fields?: string;
|
|
440
|
+
/** 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. */
|
|
441
|
+
key?: string;
|
|
442
|
+
/** Required. Resource name of the location to verify. */
|
|
443
|
+
name: string;
|
|
444
|
+
/** OAuth 2.0 token for the current user. */
|
|
445
|
+
oauth_token?: string;
|
|
446
|
+
/** Returns response with indentations and line breaks. */
|
|
447
|
+
prettyPrint?: boolean;
|
|
448
|
+
/** 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. */
|
|
449
|
+
quotaUser?: string;
|
|
450
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
451
|
+
upload_protocol?: string;
|
|
452
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
453
|
+
uploadType?: string;
|
|
454
|
+
/** Request body */
|
|
455
|
+
resource: VerifyLocationRequest;
|
|
456
|
+
}): Request<VerifyLocationResponse>;
|
|
457
|
+
verify(request: {
|
|
458
|
+
/** V1 error format. */
|
|
459
|
+
"$.xgafv"?: string;
|
|
460
|
+
/** OAuth access token. */
|
|
461
|
+
access_token?: string;
|
|
462
|
+
/** Data format for response. */
|
|
463
|
+
alt?: string;
|
|
464
|
+
/** JSONP */
|
|
465
|
+
callback?: string;
|
|
466
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
467
|
+
fields?: string;
|
|
468
|
+
/** 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. */
|
|
469
|
+
key?: string;
|
|
470
|
+
/** Required. Resource name of the location to verify. */
|
|
471
|
+
name: string;
|
|
472
|
+
/** OAuth 2.0 token for the current user. */
|
|
473
|
+
oauth_token?: string;
|
|
474
|
+
/** Returns response with indentations and line breaks. */
|
|
475
|
+
prettyPrint?: boolean;
|
|
476
|
+
/** 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. */
|
|
477
|
+
quotaUser?: string;
|
|
478
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
479
|
+
upload_protocol?: string;
|
|
480
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
481
|
+
uploadType?: string;
|
|
482
|
+
},
|
|
483
|
+
body: VerifyLocationRequest): Request<VerifyLocationResponse>;
|
|
484
|
+
verifications: VerificationsResource;
|
|
485
|
+
}
|
|
486
|
+
interface VerificationTokensResource {
|
|
487
|
+
/**
|
|
488
|
+
* Generates a token for the provided location data as a vetted [partner](https://support.google.com/business/answer/7674102). Throws PERMISSION_DENIED if the caller is not a vetted
|
|
489
|
+
* partner account. Throws FAILED_PRECONDITION if the caller's VettedStatus is INVALID.
|
|
490
|
+
*/
|
|
491
|
+
generate(request: {
|
|
492
|
+
/** V1 error format. */
|
|
493
|
+
"$.xgafv"?: string;
|
|
494
|
+
/** OAuth access token. */
|
|
495
|
+
access_token?: string;
|
|
496
|
+
/** Data format for response. */
|
|
497
|
+
alt?: string;
|
|
498
|
+
/** JSONP */
|
|
499
|
+
callback?: string;
|
|
500
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
501
|
+
fields?: string;
|
|
502
|
+
/** 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. */
|
|
503
|
+
key?: string;
|
|
504
|
+
/** OAuth 2.0 token for the current user. */
|
|
505
|
+
oauth_token?: string;
|
|
506
|
+
/** Returns response with indentations and line breaks. */
|
|
507
|
+
prettyPrint?: boolean;
|
|
508
|
+
/** 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. */
|
|
509
|
+
quotaUser?: string;
|
|
510
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
511
|
+
upload_protocol?: string;
|
|
512
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
513
|
+
uploadType?: string;
|
|
514
|
+
/** Request body */
|
|
515
|
+
resource: GenerateVerificationTokenRequest;
|
|
516
|
+
}): Request<GenerateVerificationTokenResponse>;
|
|
517
|
+
generate(request: {
|
|
518
|
+
/** V1 error format. */
|
|
519
|
+
"$.xgafv"?: string;
|
|
520
|
+
/** OAuth access token. */
|
|
521
|
+
access_token?: string;
|
|
522
|
+
/** Data format for response. */
|
|
523
|
+
alt?: string;
|
|
524
|
+
/** JSONP */
|
|
525
|
+
callback?: string;
|
|
526
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
527
|
+
fields?: string;
|
|
528
|
+
/** 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. */
|
|
529
|
+
key?: string;
|
|
530
|
+
/** OAuth 2.0 token for the current user. */
|
|
531
|
+
oauth_token?: string;
|
|
532
|
+
/** Returns response with indentations and line breaks. */
|
|
533
|
+
prettyPrint?: boolean;
|
|
534
|
+
/** 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. */
|
|
535
|
+
quotaUser?: string;
|
|
536
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
537
|
+
upload_protocol?: string;
|
|
538
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
539
|
+
uploadType?: string;
|
|
540
|
+
},
|
|
541
|
+
body: GenerateVerificationTokenRequest): Request<GenerateVerificationTokenResponse>;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
const locations: LocationsResource;
|
|
545
|
+
|
|
546
|
+
const verificationTokens: VerificationTokensResource;
|
|
547
|
+
}
|
|
548
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maxim_mazurok/gapi.client.mybusinessverifications-v1",
|
|
3
|
+
"version": "0.0.20220809",
|
|
4
|
+
"description": "TypeScript typings for My Business Verifications API v1",
|
|
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,67 @@
|
|
|
1
|
+
# TypeScript typings for My Business Verifications API v1
|
|
2
|
+
|
|
3
|
+
The My Business Verifications API provides an interface for taking verifications related actions for locations.
|
|
4
|
+
For detailed description please check [documentation](https://developers.google.com/my-business/).
|
|
5
|
+
|
|
6
|
+
## Installing
|
|
7
|
+
|
|
8
|
+
Install typings for My Business Verifications API:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npm install @types/gapi.client.mybusinessverifications-v1 --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://mybusinessverifications.googleapis.com/$discovery/rest?version=v1', () => {
|
|
29
|
+
// now we can use:
|
|
30
|
+
// gapi.client.mybusinessverifications
|
|
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('mybusinessverifications', 'v1', () => {
|
|
37
|
+
// now we can use:
|
|
38
|
+
// gapi.client.mybusinessverifications
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
After that you can use My Business Verifications API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
|
|
48
|
+
/*
|
|
49
|
+
Reports all eligible verification options for a location in a specific language.
|
|
50
|
+
*/
|
|
51
|
+
await gapi.client.mybusinessverifications.locations.fetchVerificationOptions({ location: "location", });
|
|
52
|
+
|
|
53
|
+
/*
|
|
54
|
+
Gets the VoiceOfMerchant state.
|
|
55
|
+
*/
|
|
56
|
+
await gapi.client.mybusinessverifications.locations.getVoiceOfMerchantState({ name: "name", });
|
|
57
|
+
|
|
58
|
+
/*
|
|
59
|
+
Starts the verification process for a location.
|
|
60
|
+
*/
|
|
61
|
+
await gapi.client.mybusinessverifications.locations.verify({ name: "name", });
|
|
62
|
+
|
|
63
|
+
/*
|
|
64
|
+
Generates a token for the provided location data as a vetted [partner](https://support.google.com/business/answer/7674102). Throws PERMISSION_DENIED if the caller is not a vetted partner account. Throws FAILED_PRECONDITION if the caller's VettedStatus is INVALID.
|
|
65
|
+
*/
|
|
66
|
+
await gapi.client.mybusinessverifications.verificationTokens.generate({ });
|
|
67
|
+
```
|
package/tests.ts
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/* This is stub file for gapi.client.mybusinessverifications-v1 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: 20220809
|
|
7
|
+
|
|
8
|
+
gapi.load('client', async () => {
|
|
9
|
+
/** now we can use gapi.client */
|
|
10
|
+
|
|
11
|
+
await gapi.client.load('https://mybusinessverifications.googleapis.com/$discovery/rest?version=v1');
|
|
12
|
+
/** now we can use gapi.client.mybusinessverifications */
|
|
13
|
+
|
|
14
|
+
run();
|
|
15
|
+
|
|
16
|
+
async function run() {
|
|
17
|
+
/** Reports all eligible verification options for a location in a specific language. */
|
|
18
|
+
await gapi.client.mybusinessverifications.locations.fetchVerificationOptions({
|
|
19
|
+
location: "Test string",
|
|
20
|
+
}, {
|
|
21
|
+
context: {
|
|
22
|
+
address: {
|
|
23
|
+
addressLines: [
|
|
24
|
+
"Test string"
|
|
25
|
+
],
|
|
26
|
+
administrativeArea: "Test string",
|
|
27
|
+
languageCode: "Test string",
|
|
28
|
+
locality: "Test string",
|
|
29
|
+
organization: "Test string",
|
|
30
|
+
postalCode: "Test string",
|
|
31
|
+
recipients: [
|
|
32
|
+
"Test string"
|
|
33
|
+
],
|
|
34
|
+
regionCode: "Test string",
|
|
35
|
+
revision: 42,
|
|
36
|
+
sortingCode: "Test string",
|
|
37
|
+
sublocality: "Test string",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
languageCode: "Test string",
|
|
41
|
+
});
|
|
42
|
+
/** Gets the VoiceOfMerchant state. */
|
|
43
|
+
await gapi.client.mybusinessverifications.locations.getVoiceOfMerchantState({
|
|
44
|
+
name: "Test string",
|
|
45
|
+
});
|
|
46
|
+
/** Starts the verification process for a location. */
|
|
47
|
+
await gapi.client.mybusinessverifications.locations.verify({
|
|
48
|
+
name: "Test string",
|
|
49
|
+
}, {
|
|
50
|
+
context: {
|
|
51
|
+
address: {
|
|
52
|
+
addressLines: [
|
|
53
|
+
"Test string"
|
|
54
|
+
],
|
|
55
|
+
administrativeArea: "Test string",
|
|
56
|
+
languageCode: "Test string",
|
|
57
|
+
locality: "Test string",
|
|
58
|
+
organization: "Test string",
|
|
59
|
+
postalCode: "Test string",
|
|
60
|
+
recipients: [
|
|
61
|
+
"Test string"
|
|
62
|
+
],
|
|
63
|
+
regionCode: "Test string",
|
|
64
|
+
revision: 42,
|
|
65
|
+
sortingCode: "Test string",
|
|
66
|
+
sublocality: "Test string",
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
emailAddress: "Test string",
|
|
70
|
+
languageCode: "Test string",
|
|
71
|
+
mailerContact: "Test string",
|
|
72
|
+
method: "Test string",
|
|
73
|
+
phoneNumber: "Test string",
|
|
74
|
+
token: {
|
|
75
|
+
tokenString: "Test string",
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
/** Completes a `PENDING` verification. It is only necessary for non `AUTO` verification methods. `AUTO` verification request is instantly `VERIFIED` upon creation. */
|
|
79
|
+
await gapi.client.mybusinessverifications.locations.verifications.complete({
|
|
80
|
+
name: "Test string",
|
|
81
|
+
}, {
|
|
82
|
+
pin: "Test string",
|
|
83
|
+
});
|
|
84
|
+
/** List verifications of a location, ordered by create time. */
|
|
85
|
+
await gapi.client.mybusinessverifications.locations.verifications.list({
|
|
86
|
+
pageSize: 42,
|
|
87
|
+
pageToken: "Test string",
|
|
88
|
+
parent: "Test string",
|
|
89
|
+
});
|
|
90
|
+
/**
|
|
91
|
+
* Generates a token for the provided location data as a vetted [partner](https://support.google.com/business/answer/7674102). Throws PERMISSION_DENIED if the caller is not a vetted
|
|
92
|
+
* partner account. Throws FAILED_PRECONDITION if the caller's VettedStatus is INVALID.
|
|
93
|
+
*/
|
|
94
|
+
await gapi.client.mybusinessverifications.verificationTokens.generate({
|
|
95
|
+
}, {
|
|
96
|
+
location: {
|
|
97
|
+
address: {
|
|
98
|
+
addressLines: [
|
|
99
|
+
"Test string"
|
|
100
|
+
],
|
|
101
|
+
administrativeArea: "Test string",
|
|
102
|
+
languageCode: "Test string",
|
|
103
|
+
locality: "Test string",
|
|
104
|
+
organization: "Test string",
|
|
105
|
+
postalCode: "Test string",
|
|
106
|
+
recipients: [
|
|
107
|
+
"Test string"
|
|
108
|
+
],
|
|
109
|
+
regionCode: "Test string",
|
|
110
|
+
revision: 42,
|
|
111
|
+
sortingCode: "Test string",
|
|
112
|
+
sublocality: "Test string",
|
|
113
|
+
},
|
|
114
|
+
name: "Test string",
|
|
115
|
+
primaryCategoryId: "Test string",
|
|
116
|
+
primaryPhone: "Test string",
|
|
117
|
+
websiteUri: "Test string",
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
});
|
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
|
+
}
|