@maxim_mazurok/gapi.client.cloudlocationfinder-v1alpha 0.0.20250619
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 +245 -0
- package/package.json +20 -0
- package/readme.md +72 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
/* Type definitions for non-npm package Cloud Location Finder API v1alpha 0.0 */
|
|
2
|
+
// Project: https://cloud.google.com/location-finder/docs
|
|
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
|
+
|
|
8
|
+
// IMPORTANT
|
|
9
|
+
// This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
|
|
10
|
+
// In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
|
|
11
|
+
// Generated from: https://cloudlocationfinder.googleapis.com/$discovery/rest?version=v1alpha
|
|
12
|
+
// Revision: 20250619
|
|
13
|
+
|
|
14
|
+
/// <reference types="gapi.client" />
|
|
15
|
+
|
|
16
|
+
declare namespace gapi.client {
|
|
17
|
+
/** Load Cloud Location Finder API v1alpha */
|
|
18
|
+
function load(
|
|
19
|
+
urlOrObject: 'https://cloudlocationfinder.googleapis.com/$discovery/rest?version=v1alpha',
|
|
20
|
+
): Promise<void>;
|
|
21
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
22
|
+
function load(name: 'cloudlocationfinder', version: 'v1alpha'): Promise<void>;
|
|
23
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
24
|
+
function load(
|
|
25
|
+
name: 'cloudlocationfinder',
|
|
26
|
+
version: 'v1alpha',
|
|
27
|
+
callback: () => any,
|
|
28
|
+
): void;
|
|
29
|
+
|
|
30
|
+
namespace cloudlocationfinder {
|
|
31
|
+
interface CloudLocation {
|
|
32
|
+
/** Optional. The carbon free energy percentage of the cloud location. This represents the average percentage of time customers' application will be running on carbon-free energy. See https://cloud.google.com/sustainability/region-carbon for more details. There is a difference between default value 0 and unset value. 0 means the carbon free energy percentage is 0%, while unset value means the carbon footprint data is not available. */
|
|
33
|
+
carbonFreeEnergyPercentage?: number;
|
|
34
|
+
/** Optional. The type of the cloud location. */
|
|
35
|
+
cloudLocationType?: string;
|
|
36
|
+
/** Optional. The provider of the cloud location. Values can be Google Cloud or third-party providers, including AWS, Azure, or Oracle Cloud Infrastructure. */
|
|
37
|
+
cloudProvider?: string;
|
|
38
|
+
/** Output only. The containing cloud location in the strict nesting hierarchy. For example, the containing cloud location of a zone is a region. */
|
|
39
|
+
containingCloudLocation?: string;
|
|
40
|
+
/** Optional. The human-readable name of the cloud location. Example: us-east-2, us-east1. */
|
|
41
|
+
displayName?: string;
|
|
42
|
+
/** Identifier. Name of the cloud location. Unique name of the cloud location including project and location using the form: `projects/{project_id}/locations/{location}/cloudLocations/{cloud_location}` */
|
|
43
|
+
name?: string;
|
|
44
|
+
/** Optional. The two-letter ISO 3166-1 alpha-2 code of the cloud location. Examples: US, JP, KR. */
|
|
45
|
+
territoryCode?: string;
|
|
46
|
+
}
|
|
47
|
+
interface ListCloudLocationsResponse {
|
|
48
|
+
/** Output only. List of cloud locations. */
|
|
49
|
+
cloudLocations?: CloudLocation[];
|
|
50
|
+
/** Output only. The continuation token, used to page through large result sets. Provide this value in a subsequent request as page_token in subsequent requests to retrieve the next page. If this field is not present, there are no subsequent results. */
|
|
51
|
+
nextPageToken?: string;
|
|
52
|
+
}
|
|
53
|
+
interface ListLocationsResponse {
|
|
54
|
+
/** A list of locations that matches the specified filter in the request. */
|
|
55
|
+
locations?: Location[];
|
|
56
|
+
/** The standard List next-page token. */
|
|
57
|
+
nextPageToken?: string;
|
|
58
|
+
}
|
|
59
|
+
interface Location {
|
|
60
|
+
/** The friendly name for this location, typically a nearby city name. For example, "Tokyo". */
|
|
61
|
+
displayName?: string;
|
|
62
|
+
/** Cross-service attributes for the location. For example {"cloud.googleapis.com/region": "us-east1"} */
|
|
63
|
+
labels?: {[P in string]: string};
|
|
64
|
+
/** The canonical id for this location. For example: `"us-east1"`. */
|
|
65
|
+
locationId?: string;
|
|
66
|
+
/** Service-specific metadata. For example the available capacity at the given location. */
|
|
67
|
+
metadata?: {[P in string]: any};
|
|
68
|
+
/** Resource name for the location, which may vary between implementations. For example: `"projects/example-project/locations/us-east1"` */
|
|
69
|
+
name?: string;
|
|
70
|
+
}
|
|
71
|
+
interface SearchCloudLocationsResponse {
|
|
72
|
+
/** Output only. List of cloud locations. */
|
|
73
|
+
cloudLocations?: CloudLocation[];
|
|
74
|
+
/** Output only. The continuation token, used to page through large result sets. Provide this value in a subsequent request as page_token in subsequent requests to retrieve the next page. If this field is not present, there are no subsequent results. */
|
|
75
|
+
nextPageToken?: string;
|
|
76
|
+
}
|
|
77
|
+
interface CloudLocationsResource {
|
|
78
|
+
/** Retrieves a resource containing information about a cloud location. */
|
|
79
|
+
get(request?: {
|
|
80
|
+
/** V1 error format. */
|
|
81
|
+
'$.xgafv'?: string;
|
|
82
|
+
/** OAuth access token. */
|
|
83
|
+
access_token?: string;
|
|
84
|
+
/** Data format for response. */
|
|
85
|
+
alt?: string;
|
|
86
|
+
/** JSONP */
|
|
87
|
+
callback?: string;
|
|
88
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
89
|
+
fields?: string;
|
|
90
|
+
/** 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. */
|
|
91
|
+
key?: string;
|
|
92
|
+
/** Required. Name of the resource. */
|
|
93
|
+
name: string;
|
|
94
|
+
/** OAuth 2.0 token for the current user. */
|
|
95
|
+
oauth_token?: string;
|
|
96
|
+
/** Returns response with indentations and line breaks. */
|
|
97
|
+
prettyPrint?: boolean;
|
|
98
|
+
/** 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. */
|
|
99
|
+
quotaUser?: string;
|
|
100
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
101
|
+
upload_protocol?: string;
|
|
102
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
103
|
+
uploadType?: string;
|
|
104
|
+
}): Request<CloudLocation>;
|
|
105
|
+
/** Lists cloud locations under a given project and location. */
|
|
106
|
+
list(request?: {
|
|
107
|
+
/** V1 error format. */
|
|
108
|
+
'$.xgafv'?: string;
|
|
109
|
+
/** OAuth access token. */
|
|
110
|
+
access_token?: string;
|
|
111
|
+
/** Data format for response. */
|
|
112
|
+
alt?: string;
|
|
113
|
+
/** JSONP */
|
|
114
|
+
callback?: string;
|
|
115
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
116
|
+
fields?: string;
|
|
117
|
+
/** Optional. A filter expression that filters resources listed in the response. The expression is in the form of field=value. For example, 'cloud_location_type=CLOUD_LOCATION_TYPE_REGION'. Multiple filter queries are space-separated. For example, 'cloud_location_type=CLOUD_LOCATION_TYPE_REGION territory_code="US"' By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. */
|
|
118
|
+
filter?: string;
|
|
119
|
+
/** 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. */
|
|
120
|
+
key?: string;
|
|
121
|
+
/** OAuth 2.0 token for the current user. */
|
|
122
|
+
oauth_token?: string;
|
|
123
|
+
/** Optional. The maximum number of cloud locations to return per page. The service might return fewer cloud locations than this value. If unspecified, server will pick an appropriate default. */
|
|
124
|
+
pageSize?: number;
|
|
125
|
+
/** Optional. A token identifying a page of results the server should return. Provide page token returned by a previous 'ListCloudLocations' call to retrieve the next page of results. When paginating, all other parameters provided to 'ListCloudLocations' must match the call that provided the page token. */
|
|
126
|
+
pageToken?: string;
|
|
127
|
+
/** Required. The parent, which owns this collection of cloud locations. Format: projects/{project}/locations/{location} */
|
|
128
|
+
parent: string;
|
|
129
|
+
/** Returns response with indentations and line breaks. */
|
|
130
|
+
prettyPrint?: boolean;
|
|
131
|
+
/** 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. */
|
|
132
|
+
quotaUser?: string;
|
|
133
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
134
|
+
upload_protocol?: string;
|
|
135
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
136
|
+
uploadType?: string;
|
|
137
|
+
}): Request<ListCloudLocationsResponse>;
|
|
138
|
+
/** Searches for cloud locations from a given source location. */
|
|
139
|
+
search(request?: {
|
|
140
|
+
/** V1 error format. */
|
|
141
|
+
'$.xgafv'?: string;
|
|
142
|
+
/** OAuth access token. */
|
|
143
|
+
access_token?: string;
|
|
144
|
+
/** Data format for response. */
|
|
145
|
+
alt?: string;
|
|
146
|
+
/** JSONP */
|
|
147
|
+
callback?: string;
|
|
148
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
149
|
+
fields?: string;
|
|
150
|
+
/** 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. */
|
|
151
|
+
key?: string;
|
|
152
|
+
/** OAuth 2.0 token for the current user. */
|
|
153
|
+
oauth_token?: string;
|
|
154
|
+
/** Optional. The maximum number of cloud locations to return. The service might return fewer cloud locations than this value. If unspecified, server will pick an appropriate default. */
|
|
155
|
+
pageSize?: number;
|
|
156
|
+
/** Optional. A token identifying a page of results the server should return. Provide Page token returned by a previous 'ListCloudLocations' call to retrieve the next page of results. When paginating, all other parameters provided to 'ListCloudLocations' must match the call that provided the page token. */
|
|
157
|
+
pageToken?: string;
|
|
158
|
+
/** Required. The parent, which owns this collection of cloud locations. Format: projects/{project}/locations/{location} */
|
|
159
|
+
parent: string;
|
|
160
|
+
/** Returns response with indentations and line breaks. */
|
|
161
|
+
prettyPrint?: boolean;
|
|
162
|
+
/** Optional. The query string in search query syntax. While filter is used to filter the search results by attributes, query is used to specify the search requirements. */
|
|
163
|
+
query?: string;
|
|
164
|
+
/** 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. */
|
|
165
|
+
quotaUser?: string;
|
|
166
|
+
/** Required. The source cloud location to search from. Example search can be searching nearby cloud locations from the source cloud location by latency. */
|
|
167
|
+
sourceCloudLocation?: string;
|
|
168
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
169
|
+
upload_protocol?: string;
|
|
170
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
171
|
+
uploadType?: string;
|
|
172
|
+
}): Request<SearchCloudLocationsResponse>;
|
|
173
|
+
}
|
|
174
|
+
interface LocationsResource {
|
|
175
|
+
/** Gets information about a location. */
|
|
176
|
+
get(request?: {
|
|
177
|
+
/** V1 error format. */
|
|
178
|
+
'$.xgafv'?: string;
|
|
179
|
+
/** OAuth access token. */
|
|
180
|
+
access_token?: string;
|
|
181
|
+
/** Data format for response. */
|
|
182
|
+
alt?: string;
|
|
183
|
+
/** JSONP */
|
|
184
|
+
callback?: string;
|
|
185
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
186
|
+
fields?: string;
|
|
187
|
+
/** 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. */
|
|
188
|
+
key?: string;
|
|
189
|
+
/** Resource name for the location. */
|
|
190
|
+
name: string;
|
|
191
|
+
/** OAuth 2.0 token for the current user. */
|
|
192
|
+
oauth_token?: string;
|
|
193
|
+
/** Returns response with indentations and line breaks. */
|
|
194
|
+
prettyPrint?: boolean;
|
|
195
|
+
/** 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. */
|
|
196
|
+
quotaUser?: string;
|
|
197
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
198
|
+
upload_protocol?: string;
|
|
199
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
200
|
+
uploadType?: string;
|
|
201
|
+
}): Request<Location>;
|
|
202
|
+
/** Lists information about the supported locations for this service. */
|
|
203
|
+
list(request?: {
|
|
204
|
+
/** V1 error format. */
|
|
205
|
+
'$.xgafv'?: string;
|
|
206
|
+
/** OAuth access token. */
|
|
207
|
+
access_token?: string;
|
|
208
|
+
/** Data format for response. */
|
|
209
|
+
alt?: string;
|
|
210
|
+
/** JSONP */
|
|
211
|
+
callback?: string;
|
|
212
|
+
/** Optional. A list of extra location types that should be used as conditions for controlling the visibility of the locations. */
|
|
213
|
+
extraLocationTypes?: string | string[];
|
|
214
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
215
|
+
fields?: string;
|
|
216
|
+
/** A filter to narrow down results to a preferred subset. The filtering language accepts strings like `"displayName=tokyo"`, and is documented in more detail in [AIP-160](https://google.aip.dev/160). */
|
|
217
|
+
filter?: string;
|
|
218
|
+
/** 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. */
|
|
219
|
+
key?: string;
|
|
220
|
+
/** The resource that owns the locations collection, if applicable. */
|
|
221
|
+
name: string;
|
|
222
|
+
/** OAuth 2.0 token for the current user. */
|
|
223
|
+
oauth_token?: string;
|
|
224
|
+
/** The maximum number of results to return. If not set, the service selects a default. */
|
|
225
|
+
pageSize?: number;
|
|
226
|
+
/** A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page. */
|
|
227
|
+
pageToken?: string;
|
|
228
|
+
/** Returns response with indentations and line breaks. */
|
|
229
|
+
prettyPrint?: boolean;
|
|
230
|
+
/** 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. */
|
|
231
|
+
quotaUser?: string;
|
|
232
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
233
|
+
upload_protocol?: string;
|
|
234
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
235
|
+
uploadType?: string;
|
|
236
|
+
}): Request<ListLocationsResponse>;
|
|
237
|
+
cloudLocations: CloudLocationsResource;
|
|
238
|
+
}
|
|
239
|
+
interface ProjectsResource {
|
|
240
|
+
locations: LocationsResource;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
const projects: ProjectsResource;
|
|
244
|
+
}
|
|
245
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maxim_mazurok/gapi.client.cloudlocationfinder-v1alpha",
|
|
3
|
+
"version": "0.0.20250619",
|
|
4
|
+
"description": "TypeScript typings for Cloud Location Finder API v1alpha",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/Maxim-Mazurok/google-api-typings-generator.git"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"author": {
|
|
11
|
+
"name": "Maxim Mazurok",
|
|
12
|
+
"email": "maxim@mazurok.com",
|
|
13
|
+
"url": "https://maxim.mazurok.com"
|
|
14
|
+
},
|
|
15
|
+
"types": "index.d.ts",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@types/gapi.client": "*",
|
|
18
|
+
"@types/gapi.client.discovery-v1": "*"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# TypeScript typings for Cloud Location Finder API v1alpha
|
|
2
|
+
|
|
3
|
+
For detailed description please check [documentation](https://cloud.google.com/location-finder/docs).
|
|
4
|
+
|
|
5
|
+
## Installing
|
|
6
|
+
|
|
7
|
+
Install typings for Cloud Location Finder API:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
npm install @types/gapi.client.cloudlocationfinder-v1alpha --save-dev
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
You need to initialize Google API client in your code:
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
gapi.load('client', () => {
|
|
19
|
+
// now we can use gapi.client
|
|
20
|
+
// ...
|
|
21
|
+
});
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Then load api client wrapper:
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
gapi.client.load(
|
|
28
|
+
'https://cloudlocationfinder.googleapis.com/$discovery/rest?version=v1alpha',
|
|
29
|
+
() => {
|
|
30
|
+
// now we can use:
|
|
31
|
+
// gapi.client.cloudlocationfinder
|
|
32
|
+
},
|
|
33
|
+
);
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
// Deprecated, use discovery document URL, see https://github.com/google/google-api-javascript-client/blob/master/docs/reference.md#----gapiclientloadname----version----callback--
|
|
38
|
+
gapi.client.load('cloudlocationfinder', 'v1alpha', () => {
|
|
39
|
+
// now we can use:
|
|
40
|
+
// gapi.client.cloudlocationfinder
|
|
41
|
+
});
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Don't forget to authenticate your client before sending any request to resources:
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
// declare client_id registered in Google Developers Console
|
|
48
|
+
var client_id = '',
|
|
49
|
+
scope = [
|
|
50
|
+
// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
|
|
51
|
+
'https://www.googleapis.com/auth/cloud-platform',
|
|
52
|
+
],
|
|
53
|
+
immediate = true;
|
|
54
|
+
// ...
|
|
55
|
+
|
|
56
|
+
gapi.auth.authorize(
|
|
57
|
+
{client_id: client_id, scope: scope, immediate: immediate},
|
|
58
|
+
authResult => {
|
|
59
|
+
if (authResult && !authResult.error) {
|
|
60
|
+
/* handle successful authorization */
|
|
61
|
+
} else {
|
|
62
|
+
/* handle authorization error */
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
);
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
After that you can use Cloud Location Finder API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
|
|
72
|
+
```
|