@maxim_mazurok/gapi.client.storage-v1 0.0.20220806

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/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "@maxim_mazurok/gapi.client.storage-v1",
3
+ "version": "0.0.20220806",
4
+ "description": "TypeScript typings for Cloud Storage JSON 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,310 @@
1
+ # TypeScript typings for Cloud Storage JSON API v1
2
+
3
+ Stores and retrieves potentially large, immutable data objects.
4
+ For detailed description please check [documentation](https://developers.google.com/storage/docs/json_api/).
5
+
6
+ ## Installing
7
+
8
+ Install typings for Cloud Storage JSON API:
9
+
10
+ ```
11
+ npm install @types/gapi.client.storage-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://storage.googleapis.com/$discovery/rest?version=v1', () => {
29
+ // now we can use:
30
+ // gapi.client.storage
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('storage', 'v1', () => {
37
+ // now we can use:
38
+ // gapi.client.storage
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 data across Google Cloud Platform services
49
+ 'https://www.googleapis.com/auth/cloud-platform',
50
+
51
+ // View your data across Google Cloud Platform services
52
+ 'https://www.googleapis.com/auth/cloud-platform.read-only',
53
+
54
+ // Manage your data and permissions in Google Cloud Storage
55
+ 'https://www.googleapis.com/auth/devstorage.full_control',
56
+
57
+ // View your data in Google Cloud Storage
58
+ 'https://www.googleapis.com/auth/devstorage.read_only',
59
+
60
+ // Manage your data in Google Cloud Storage
61
+ 'https://www.googleapis.com/auth/devstorage.read_write',
62
+ ],
63
+ immediate = true;
64
+ // ...
65
+
66
+ gapi.auth.authorize(
67
+ { client_id: client_id, scope: scope, immediate: immediate },
68
+ authResult => {
69
+ if (authResult && !authResult.error) {
70
+ /* handle successful authorization */
71
+ } else {
72
+ /* handle authorization error */
73
+ }
74
+ });
75
+ ```
76
+
77
+ After that you can use Cloud Storage JSON API resources: <!-- TODO: make this work for multiple namespaces -->
78
+
79
+ ```typescript
80
+
81
+ /*
82
+ Permanently deletes the ACL entry for the specified entity on the specified bucket.
83
+ */
84
+ await gapi.client.storage.bucketAccessControls.delete({ bucket: "bucket", entity: "entity", });
85
+
86
+ /*
87
+ Returns the ACL entry for the specified entity on the specified bucket.
88
+ */
89
+ await gapi.client.storage.bucketAccessControls.get({ bucket: "bucket", entity: "entity", });
90
+
91
+ /*
92
+ Creates a new ACL entry on the specified bucket.
93
+ */
94
+ await gapi.client.storage.bucketAccessControls.insert({ bucket: "bucket", });
95
+
96
+ /*
97
+ Retrieves ACL entries on the specified bucket.
98
+ */
99
+ await gapi.client.storage.bucketAccessControls.list({ bucket: "bucket", });
100
+
101
+ /*
102
+ Patches an ACL entry on the specified bucket.
103
+ */
104
+ await gapi.client.storage.bucketAccessControls.patch({ bucket: "bucket", entity: "entity", });
105
+
106
+ /*
107
+ Updates an ACL entry on the specified bucket.
108
+ */
109
+ await gapi.client.storage.bucketAccessControls.update({ bucket: "bucket", entity: "entity", });
110
+
111
+ /*
112
+ Permanently deletes an empty bucket.
113
+ */
114
+ await gapi.client.storage.buckets.delete({ bucket: "bucket", });
115
+
116
+ /*
117
+ Returns metadata for the specified bucket.
118
+ */
119
+ await gapi.client.storage.buckets.get({ bucket: "bucket", });
120
+
121
+ /*
122
+ Returns an IAM policy for the specified bucket.
123
+ */
124
+ await gapi.client.storage.buckets.getIamPolicy({ bucket: "bucket", });
125
+
126
+ /*
127
+ Creates a new bucket.
128
+ */
129
+ await gapi.client.storage.buckets.insert({ project: "project", });
130
+
131
+ /*
132
+ Retrieves a list of buckets for a given project.
133
+ */
134
+ await gapi.client.storage.buckets.list({ project: "project", });
135
+
136
+ /*
137
+ Locks retention policy on a bucket.
138
+ */
139
+ await gapi.client.storage.buckets.lockRetentionPolicy({ bucket: "bucket", ifMetagenerationMatch: "ifMetagenerationMatch", });
140
+
141
+ /*
142
+ Patches a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.
143
+ */
144
+ await gapi.client.storage.buckets.patch({ bucket: "bucket", });
145
+
146
+ /*
147
+ Updates an IAM policy for the specified bucket.
148
+ */
149
+ await gapi.client.storage.buckets.setIamPolicy({ bucket: "bucket", });
150
+
151
+ /*
152
+ Tests a set of permissions on the given bucket to see which, if any, are held by the caller.
153
+ */
154
+ await gapi.client.storage.buckets.testIamPermissions({ bucket: "bucket", permissions: "permissions", });
155
+
156
+ /*
157
+ Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.
158
+ */
159
+ await gapi.client.storage.buckets.update({ bucket: "bucket", });
160
+
161
+ /*
162
+ Stop watching resources through this channel
163
+ */
164
+ await gapi.client.storage.channels.stop({ });
165
+
166
+ /*
167
+ Permanently deletes the default object ACL entry for the specified entity on the specified bucket.
168
+ */
169
+ await gapi.client.storage.defaultObjectAccessControls.delete({ bucket: "bucket", entity: "entity", });
170
+
171
+ /*
172
+ Returns the default object ACL entry for the specified entity on the specified bucket.
173
+ */
174
+ await gapi.client.storage.defaultObjectAccessControls.get({ bucket: "bucket", entity: "entity", });
175
+
176
+ /*
177
+ Creates a new default object ACL entry on the specified bucket.
178
+ */
179
+ await gapi.client.storage.defaultObjectAccessControls.insert({ bucket: "bucket", });
180
+
181
+ /*
182
+ Retrieves default object ACL entries on the specified bucket.
183
+ */
184
+ await gapi.client.storage.defaultObjectAccessControls.list({ bucket: "bucket", });
185
+
186
+ /*
187
+ Patches a default object ACL entry on the specified bucket.
188
+ */
189
+ await gapi.client.storage.defaultObjectAccessControls.patch({ bucket: "bucket", entity: "entity", });
190
+
191
+ /*
192
+ Updates a default object ACL entry on the specified bucket.
193
+ */
194
+ await gapi.client.storage.defaultObjectAccessControls.update({ bucket: "bucket", entity: "entity", });
195
+
196
+ /*
197
+ Permanently deletes a notification subscription.
198
+ */
199
+ await gapi.client.storage.notifications.delete({ bucket: "bucket", notification: "notification", });
200
+
201
+ /*
202
+ View a notification configuration.
203
+ */
204
+ await gapi.client.storage.notifications.get({ bucket: "bucket", notification: "notification", });
205
+
206
+ /*
207
+ Creates a notification subscription for a given bucket.
208
+ */
209
+ await gapi.client.storage.notifications.insert({ bucket: "bucket", });
210
+
211
+ /*
212
+ Retrieves a list of notification subscriptions for a given bucket.
213
+ */
214
+ await gapi.client.storage.notifications.list({ bucket: "bucket", });
215
+
216
+ /*
217
+ Permanently deletes the ACL entry for the specified entity on the specified object.
218
+ */
219
+ await gapi.client.storage.objectAccessControls.delete({ bucket: "bucket", entity: "entity", object: "object", });
220
+
221
+ /*
222
+ Returns the ACL entry for the specified entity on the specified object.
223
+ */
224
+ await gapi.client.storage.objectAccessControls.get({ bucket: "bucket", entity: "entity", object: "object", });
225
+
226
+ /*
227
+ Creates a new ACL entry on the specified object.
228
+ */
229
+ await gapi.client.storage.objectAccessControls.insert({ bucket: "bucket", object: "object", });
230
+
231
+ /*
232
+ Retrieves ACL entries on the specified object.
233
+ */
234
+ await gapi.client.storage.objectAccessControls.list({ bucket: "bucket", object: "object", });
235
+
236
+ /*
237
+ Patches an ACL entry on the specified object.
238
+ */
239
+ await gapi.client.storage.objectAccessControls.patch({ bucket: "bucket", entity: "entity", object: "object", });
240
+
241
+ /*
242
+ Updates an ACL entry on the specified object.
243
+ */
244
+ await gapi.client.storage.objectAccessControls.update({ bucket: "bucket", entity: "entity", object: "object", });
245
+
246
+ /*
247
+ Concatenates a list of existing objects into a new object in the same bucket.
248
+ */
249
+ await gapi.client.storage.objects.compose({ destinationBucket: "destinationBucket", destinationObject: "destinationObject", });
250
+
251
+ /*
252
+ Copies a source object to a destination object. Optionally overrides metadata.
253
+ */
254
+ await gapi.client.storage.objects.copy({ destinationBucket: "destinationBucket", destinationObject: "destinationObject", sourceBucket: "sourceBucket", sourceObject: "sourceObject", });
255
+
256
+ /*
257
+ Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the generation parameter is used.
258
+ */
259
+ await gapi.client.storage.objects.delete({ bucket: "bucket", object: "object", });
260
+
261
+ /*
262
+ Retrieves an object or its metadata.
263
+ */
264
+ await gapi.client.storage.objects.get({ bucket: "bucket", object: "object", });
265
+
266
+ /*
267
+ Returns an IAM policy for the specified object.
268
+ */
269
+ await gapi.client.storage.objects.getIamPolicy({ bucket: "bucket", object: "object", });
270
+
271
+ /*
272
+ Stores a new object and metadata.
273
+ */
274
+ await gapi.client.storage.objects.insert({ bucket: "bucket", });
275
+
276
+ /*
277
+ Retrieves a list of objects matching the criteria.
278
+ */
279
+ await gapi.client.storage.objects.list({ bucket: "bucket", });
280
+
281
+ /*
282
+ Patches an object's metadata.
283
+ */
284
+ await gapi.client.storage.objects.patch({ bucket: "bucket", object: "object", });
285
+
286
+ /*
287
+ Rewrites a source object to a destination object. Optionally overrides metadata.
288
+ */
289
+ await gapi.client.storage.objects.rewrite({ destinationBucket: "destinationBucket", destinationObject: "destinationObject", sourceBucket: "sourceBucket", sourceObject: "sourceObject", });
290
+
291
+ /*
292
+ Updates an IAM policy for the specified object.
293
+ */
294
+ await gapi.client.storage.objects.setIamPolicy({ bucket: "bucket", object: "object", });
295
+
296
+ /*
297
+ Tests a set of permissions on the given object to see which, if any, are held by the caller.
298
+ */
299
+ await gapi.client.storage.objects.testIamPermissions({ bucket: "bucket", object: "object", permissions: "permissions", });
300
+
301
+ /*
302
+ Updates an object's metadata.
303
+ */
304
+ await gapi.client.storage.objects.update({ bucket: "bucket", object: "object", });
305
+
306
+ /*
307
+ Watch for changes on all objects in a bucket.
308
+ */
309
+ await gapi.client.storage.objects.watchAll({ bucket: "bucket", });
310
+ ```