@google-cloud/geocode 0.1.1
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/README.md +117 -0
- package/build/protos/google/geo/type/viewport.proto +69 -0
- package/build/protos/google/maps/geocode/v4/destination_service.proto +435 -0
- package/build/protos/google/maps/geocode/v4/geocode_service.proto +279 -0
- package/build/protos/protos.d.ts +9343 -0
- package/build/protos/protos.js +25983 -0
- package/build/protos/protos.json +2630 -0
- package/build/src/index.d.ts +14 -0
- package/build/src/index.js +30 -0
- package/build/src/index.js.map +1 -0
- package/build/src/v4/destination_service_client.d.ts +165 -0
- package/build/src/v4/destination_service_client.js +326 -0
- package/build/src/v4/destination_service_client.js.map +1 -0
- package/build/src/v4/destination_service_client_config.json +43 -0
- package/build/src/v4/destination_service_proto_list.json +5 -0
- package/build/src/v4/gapic_metadata.json +77 -0
- package/build/src/v4/geocode_service_client.d.ts +227 -0
- package/build/src/v4/geocode_service_client.js +398 -0
- package/build/src/v4/geocode_service_client.js.map +1 -0
- package/build/src/v4/geocode_service_client_config.json +53 -0
- package/build/src/v4/geocode_service_proto_list.json +5 -0
- package/build/src/v4/index.d.ts +2 -0
- package/build/src/v4/index.js +25 -0
- package/build/src/v4/index.js.map +1 -0
- package/package.json +78 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": "1.0",
|
|
3
|
+
"comment": "This file maps proto services/RPCs to the corresponding library clients/methods",
|
|
4
|
+
"language": "typescript",
|
|
5
|
+
"protoPackage": "google.maps.geocode.v4",
|
|
6
|
+
"libraryPackage": "@google-cloud/geocode",
|
|
7
|
+
"services": {
|
|
8
|
+
"DestinationService": {
|
|
9
|
+
"clients": {
|
|
10
|
+
"grpc": {
|
|
11
|
+
"libraryClient": "DestinationServiceClient",
|
|
12
|
+
"rpcs": {
|
|
13
|
+
"SearchDestinations": {
|
|
14
|
+
"methods": [
|
|
15
|
+
"searchDestinations"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"grpc-fallback": {
|
|
21
|
+
"libraryClient": "DestinationServiceClient",
|
|
22
|
+
"rpcs": {
|
|
23
|
+
"SearchDestinations": {
|
|
24
|
+
"methods": [
|
|
25
|
+
"searchDestinations"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"GeocodeService": {
|
|
33
|
+
"clients": {
|
|
34
|
+
"grpc": {
|
|
35
|
+
"libraryClient": "GeocodeServiceClient",
|
|
36
|
+
"rpcs": {
|
|
37
|
+
"GeocodeAddress": {
|
|
38
|
+
"methods": [
|
|
39
|
+
"geocodeAddress"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
"GeocodeLocation": {
|
|
43
|
+
"methods": [
|
|
44
|
+
"geocodeLocation"
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
"GeocodePlace": {
|
|
48
|
+
"methods": [
|
|
49
|
+
"geocodePlace"
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"grpc-fallback": {
|
|
55
|
+
"libraryClient": "GeocodeServiceClient",
|
|
56
|
+
"rpcs": {
|
|
57
|
+
"GeocodeAddress": {
|
|
58
|
+
"methods": [
|
|
59
|
+
"geocodeAddress"
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
"GeocodeLocation": {
|
|
63
|
+
"methods": [
|
|
64
|
+
"geocodeLocation"
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
"GeocodePlace": {
|
|
68
|
+
"methods": [
|
|
69
|
+
"geocodePlace"
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import type * as gax from 'google-gax';
|
|
2
|
+
import type { Callback, CallOptions, Descriptors, ClientOptions } from 'google-gax';
|
|
3
|
+
import * as protos from '../../protos/protos';
|
|
4
|
+
/**
|
|
5
|
+
* A service for performing geocoding.
|
|
6
|
+
* @class
|
|
7
|
+
* @memberof v4
|
|
8
|
+
*/
|
|
9
|
+
export declare class GeocodeServiceClient {
|
|
10
|
+
private _terminated;
|
|
11
|
+
private _opts;
|
|
12
|
+
private _providedCustomServicePath;
|
|
13
|
+
private _gaxModule;
|
|
14
|
+
private _gaxGrpc;
|
|
15
|
+
private _protos;
|
|
16
|
+
private _defaults;
|
|
17
|
+
private _universeDomain;
|
|
18
|
+
private _servicePath;
|
|
19
|
+
private _log;
|
|
20
|
+
auth: gax.GoogleAuth;
|
|
21
|
+
descriptors: Descriptors;
|
|
22
|
+
warn: (code: string, message: string, warnType?: string) => void;
|
|
23
|
+
innerApiCalls: {
|
|
24
|
+
[name: string]: Function;
|
|
25
|
+
};
|
|
26
|
+
geocodeServiceStub?: Promise<{
|
|
27
|
+
[name: string]: Function;
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* Construct an instance of GeocodeServiceClient.
|
|
31
|
+
*
|
|
32
|
+
* @param {object} [options] - The configuration object.
|
|
33
|
+
* The options accepted by the constructor are described in detail
|
|
34
|
+
* in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
|
|
35
|
+
* The common options are:
|
|
36
|
+
* @param {object} [options.credentials] - Credentials object.
|
|
37
|
+
* @param {string} [options.credentials.client_email]
|
|
38
|
+
* @param {string} [options.credentials.private_key]
|
|
39
|
+
* @param {string} [options.email] - Account email address. Required when
|
|
40
|
+
* using a .pem or .p12 keyFilename.
|
|
41
|
+
* @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
|
|
42
|
+
* .p12 key downloaded from the Google Developers Console. If you provide
|
|
43
|
+
* a path to a JSON file, the projectId option below is not necessary.
|
|
44
|
+
* NOTE: .pem and .p12 require you to specify options.email as well.
|
|
45
|
+
* @param {number} [options.port] - The port on which to connect to
|
|
46
|
+
* the remote host.
|
|
47
|
+
* @param {string} [options.projectId] - The project ID from the Google
|
|
48
|
+
* Developer's Console, e.g. 'grape-spaceship-123'. We will also check
|
|
49
|
+
* the environment variable GCLOUD_PROJECT for your project ID. If your
|
|
50
|
+
* app is running in an environment which supports
|
|
51
|
+
* {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials},
|
|
52
|
+
* your project ID will be detected automatically.
|
|
53
|
+
* @param {string} [options.apiEndpoint] - The domain name of the
|
|
54
|
+
* API remote host.
|
|
55
|
+
* @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
|
|
56
|
+
* Follows the structure of {@link gapicConfig}.
|
|
57
|
+
* @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
|
|
58
|
+
* For more information, please check the
|
|
59
|
+
* {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
|
|
60
|
+
* @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
|
|
61
|
+
* need to avoid loading the default gRPC version and want to use the fallback
|
|
62
|
+
* HTTP implementation. Load only fallback version and pass it to the constructor:
|
|
63
|
+
* ```
|
|
64
|
+
* const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
|
|
65
|
+
* const client = new GeocodeServiceClient({fallback: true}, gax);
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
|
|
69
|
+
/**
|
|
70
|
+
* Initialize the client.
|
|
71
|
+
* Performs asynchronous operations (such as authentication) and prepares the client.
|
|
72
|
+
* This function will be called automatically when any class method is called for the
|
|
73
|
+
* first time, but if you need to initialize it before calling an actual method,
|
|
74
|
+
* feel free to call initialize() directly.
|
|
75
|
+
*
|
|
76
|
+
* You can await on this method if you want to make sure the client is initialized.
|
|
77
|
+
*
|
|
78
|
+
* @returns {Promise} A promise that resolves to an authenticated service stub.
|
|
79
|
+
*/
|
|
80
|
+
initialize(): Promise<{
|
|
81
|
+
[name: string]: Function;
|
|
82
|
+
}>;
|
|
83
|
+
/**
|
|
84
|
+
* The DNS address for this API service.
|
|
85
|
+
* @deprecated Use the apiEndpoint method of the client instance.
|
|
86
|
+
* @returns {string} The DNS address for this service.
|
|
87
|
+
*/
|
|
88
|
+
static get servicePath(): string;
|
|
89
|
+
/**
|
|
90
|
+
* The DNS address for this API service - same as servicePath.
|
|
91
|
+
* @deprecated Use the apiEndpoint method of the client instance.
|
|
92
|
+
* @returns {string} The DNS address for this service.
|
|
93
|
+
*/
|
|
94
|
+
static get apiEndpoint(): string;
|
|
95
|
+
/**
|
|
96
|
+
* The DNS address for this API service.
|
|
97
|
+
* @returns {string} The DNS address for this service.
|
|
98
|
+
*/
|
|
99
|
+
get apiEndpoint(): string;
|
|
100
|
+
get universeDomain(): string;
|
|
101
|
+
/**
|
|
102
|
+
* The port for this API service.
|
|
103
|
+
* @returns {number} The default port for this service.
|
|
104
|
+
*/
|
|
105
|
+
static get port(): number;
|
|
106
|
+
/**
|
|
107
|
+
* The scopes needed to make gRPC calls for every method defined
|
|
108
|
+
* in this service.
|
|
109
|
+
* @returns {string[]} List of default scopes.
|
|
110
|
+
*/
|
|
111
|
+
static get scopes(): string[];
|
|
112
|
+
getProjectId(): Promise<string>;
|
|
113
|
+
getProjectId(callback: Callback<string, undefined, undefined>): void;
|
|
114
|
+
/**
|
|
115
|
+
* This method performs an address geocode, which maps an address to a
|
|
116
|
+
* LatLng. It also provides structured information about the address.
|
|
117
|
+
*
|
|
118
|
+
* @param {Object} request
|
|
119
|
+
* The request object that will be sent.
|
|
120
|
+
* @param {string} request.addressQuery
|
|
121
|
+
* The unstructured address to geocode.
|
|
122
|
+
* @param {google.type.PostalAddress} request.address
|
|
123
|
+
* The structured address to geocode in postal address format.
|
|
124
|
+
* @param {google.maps.geocode.v4.GeocodeAddressRequest.LocationBias} [request.locationBias]
|
|
125
|
+
* Optional. The region to search. This location serves as a bias which means
|
|
126
|
+
* results around the given location are preferred.
|
|
127
|
+
* @param {string} [request.languageCode]
|
|
128
|
+
* Optional. Language in which the results should be returned.
|
|
129
|
+
* @param {string} [request.regionCode]
|
|
130
|
+
* Optional. Region code. The region code, specified as a ccTLD ("top-level
|
|
131
|
+
* domain") two-character value. The parameter affects results based on
|
|
132
|
+
* applicable law. This parameter will also influence, but not fully restrict,
|
|
133
|
+
* results from the service.
|
|
134
|
+
* @param {object} [options]
|
|
135
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
136
|
+
* @returns {Promise} - The promise which resolves to an array.
|
|
137
|
+
* The first element of the array is an object representing {@link protos.google.maps.geocode.v4.GeocodeAddressResponse|GeocodeAddressResponse}.
|
|
138
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
|
139
|
+
* for more details and examples.
|
|
140
|
+
* @example <caption>include:samples/generated/v4/geocode_service.geocode_address.js</caption>
|
|
141
|
+
* region_tag:geocoding-backend_v4_generated_GeocodeService_GeocodeAddress_async
|
|
142
|
+
*/
|
|
143
|
+
geocodeAddress(request?: protos.google.maps.geocode.v4.IGeocodeAddressRequest, options?: CallOptions): Promise<[
|
|
144
|
+
protos.google.maps.geocode.v4.IGeocodeAddressResponse,
|
|
145
|
+
protos.google.maps.geocode.v4.IGeocodeAddressRequest | undefined,
|
|
146
|
+
{} | undefined
|
|
147
|
+
]>;
|
|
148
|
+
geocodeAddress(request: protos.google.maps.geocode.v4.IGeocodeAddressRequest, options: CallOptions, callback: Callback<protos.google.maps.geocode.v4.IGeocodeAddressResponse, protos.google.maps.geocode.v4.IGeocodeAddressRequest | null | undefined, {} | null | undefined>): void;
|
|
149
|
+
geocodeAddress(request: protos.google.maps.geocode.v4.IGeocodeAddressRequest, callback: Callback<protos.google.maps.geocode.v4.IGeocodeAddressResponse, protos.google.maps.geocode.v4.IGeocodeAddressRequest | null | undefined, {} | null | undefined>): void;
|
|
150
|
+
/**
|
|
151
|
+
* This method performs a location geocode, which maps a LatLng to an
|
|
152
|
+
* address. It also provides structured information about the address.
|
|
153
|
+
*
|
|
154
|
+
* @param {Object} request
|
|
155
|
+
* The request object that will be sent.
|
|
156
|
+
* @param {string} request.locationQuery
|
|
157
|
+
* The location in the format of "lat,lng" string. For example,
|
|
158
|
+
* "64.7611872,-18.4705364".
|
|
159
|
+
* @param {google.type.LatLng} request.location
|
|
160
|
+
* The location in the structured format.
|
|
161
|
+
* @param {string} [request.languageCode]
|
|
162
|
+
* Optional. Language in which the results should be returned.
|
|
163
|
+
* @param {string} [request.regionCode]
|
|
164
|
+
* Optional. Region code. The region code, specified as a ccTLD ("top-level
|
|
165
|
+
* domain") two-character value. The parameter affects results based on
|
|
166
|
+
* applicable law.
|
|
167
|
+
* @param {string[]} [request.types]
|
|
168
|
+
* Optional. A set of type tags to restrict the results. Results that do not
|
|
169
|
+
* have any of the specified types are removed.
|
|
170
|
+
*
|
|
171
|
+
* For the complete list of possible values, see Table A and Table B at
|
|
172
|
+
* https://developers.google.com/maps/documentation/places/web-service/place-types.
|
|
173
|
+
* @param {number[]} [request.granularity]
|
|
174
|
+
* Optional. A filter of one or more location granularity enums.
|
|
175
|
+
* @param {object} [options]
|
|
176
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
177
|
+
* @returns {Promise} - The promise which resolves to an array.
|
|
178
|
+
* The first element of the array is an object representing {@link protos.google.maps.geocode.v4.GeocodeLocationResponse|GeocodeLocationResponse}.
|
|
179
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
|
180
|
+
* for more details and examples.
|
|
181
|
+
* @example <caption>include:samples/generated/v4/geocode_service.geocode_location.js</caption>
|
|
182
|
+
* region_tag:geocoding-backend_v4_generated_GeocodeService_GeocodeLocation_async
|
|
183
|
+
*/
|
|
184
|
+
geocodeLocation(request?: protos.google.maps.geocode.v4.IGeocodeLocationRequest, options?: CallOptions): Promise<[
|
|
185
|
+
protos.google.maps.geocode.v4.IGeocodeLocationResponse,
|
|
186
|
+
protos.google.maps.geocode.v4.IGeocodeLocationRequest | undefined,
|
|
187
|
+
{} | undefined
|
|
188
|
+
]>;
|
|
189
|
+
geocodeLocation(request: protos.google.maps.geocode.v4.IGeocodeLocationRequest, options: CallOptions, callback: Callback<protos.google.maps.geocode.v4.IGeocodeLocationResponse, protos.google.maps.geocode.v4.IGeocodeLocationRequest | null | undefined, {} | null | undefined>): void;
|
|
190
|
+
geocodeLocation(request: protos.google.maps.geocode.v4.IGeocodeLocationRequest, callback: Callback<protos.google.maps.geocode.v4.IGeocodeLocationResponse, protos.google.maps.geocode.v4.IGeocodeLocationRequest | null | undefined, {} | null | undefined>): void;
|
|
191
|
+
/**
|
|
192
|
+
* This method performs a geocode lookup using a place ID.
|
|
193
|
+
*
|
|
194
|
+
* @param {Object} request
|
|
195
|
+
* The request object that will be sent.
|
|
196
|
+
* @param {string} request.place
|
|
197
|
+
* Required. Place identifier to geocode in the format of places/{place}.
|
|
198
|
+
* @param {string} [request.languageCode]
|
|
199
|
+
* Optional. Language in which the results should be returned.
|
|
200
|
+
* @param {string} [request.regionCode]
|
|
201
|
+
* Optional. Region code. The region code, specified as a ccTLD ("top-level
|
|
202
|
+
* domain") two-character value. The parameter affects results based on
|
|
203
|
+
* applicable law.
|
|
204
|
+
* @param {object} [options]
|
|
205
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
206
|
+
* @returns {Promise} - The promise which resolves to an array.
|
|
207
|
+
* The first element of the array is an object representing {@link protos.google.maps.geocode.v4.GeocodeResult|GeocodeResult}.
|
|
208
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
|
|
209
|
+
* for more details and examples.
|
|
210
|
+
* @example <caption>include:samples/generated/v4/geocode_service.geocode_place.js</caption>
|
|
211
|
+
* region_tag:geocoding-backend_v4_generated_GeocodeService_GeocodePlace_async
|
|
212
|
+
*/
|
|
213
|
+
geocodePlace(request?: protos.google.maps.geocode.v4.IGeocodePlaceRequest, options?: CallOptions): Promise<[
|
|
214
|
+
protos.google.maps.geocode.v4.IGeocodeResult,
|
|
215
|
+
protos.google.maps.geocode.v4.IGeocodePlaceRequest | undefined,
|
|
216
|
+
{} | undefined
|
|
217
|
+
]>;
|
|
218
|
+
geocodePlace(request: protos.google.maps.geocode.v4.IGeocodePlaceRequest, options: CallOptions, callback: Callback<protos.google.maps.geocode.v4.IGeocodeResult, protos.google.maps.geocode.v4.IGeocodePlaceRequest | null | undefined, {} | null | undefined>): void;
|
|
219
|
+
geocodePlace(request: protos.google.maps.geocode.v4.IGeocodePlaceRequest, callback: Callback<protos.google.maps.geocode.v4.IGeocodeResult, protos.google.maps.geocode.v4.IGeocodePlaceRequest | null | undefined, {} | null | undefined>): void;
|
|
220
|
+
/**
|
|
221
|
+
* Terminate the gRPC channel and close the client.
|
|
222
|
+
*
|
|
223
|
+
* The client will no longer be usable and all future behavior is undefined.
|
|
224
|
+
* @returns {Promise} A promise that resolves when the client is closed.
|
|
225
|
+
*/
|
|
226
|
+
close(): Promise<void>;
|
|
227
|
+
}
|