@maxim_mazurok/gapi.client.pubsub-v1beta1a 0.0.20220729
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 +845 -0
- package/package.json +20 -0
- package/readme.md +146 -0
- package/tests.ts +171 -0
- package/tsconfig.json +18 -0
- package/tslint.json +6 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,845 @@
|
|
|
1
|
+
/* Type definitions for non-npm package Cloud Pub/Sub API v1beta1a 0.0 */
|
|
2
|
+
// Project: https://cloud.google.com/pubsub/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
|
+
// 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://pubsub.googleapis.com/$discovery/rest?version=v1beta1a
|
|
13
|
+
// Revision: 20220729
|
|
14
|
+
|
|
15
|
+
/// <reference types="gapi.client" />
|
|
16
|
+
|
|
17
|
+
declare namespace gapi.client {
|
|
18
|
+
/** Load Cloud Pub/Sub API v1beta1a */
|
|
19
|
+
function load(urlOrObject: "https://pubsub.googleapis.com/$discovery/rest?version=v1beta1a"): Promise<void>;
|
|
20
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
21
|
+
function load(name: "pubsub", version: "v1beta1a"): Promise<void>;
|
|
22
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
23
|
+
function load(name: "pubsub", version: "v1beta1a", callback: () => any): void;
|
|
24
|
+
|
|
25
|
+
namespace pubsub {
|
|
26
|
+
interface AcknowledgeRequest {
|
|
27
|
+
/** The acknowledgment ID for the message being acknowledged. This was returned by the Pub/Sub system in the Pull response. */
|
|
28
|
+
ackId?: string[];
|
|
29
|
+
/** The subscription whose message is being acknowledged. */
|
|
30
|
+
subscription?: string;
|
|
31
|
+
}
|
|
32
|
+
// tslint:disable-next-line:no-empty-interface
|
|
33
|
+
interface Empty {
|
|
34
|
+
}
|
|
35
|
+
interface Label {
|
|
36
|
+
/**
|
|
37
|
+
* The key of a label is a syntactically valid URL (as per RFC 1738) with the "scheme" and initial slashes omitted and with the additional restrictions noted below. Each key should be
|
|
38
|
+
* globally unique. The "host" portion is called the "namespace" and is not necessarily resolvable to a network endpoint. Instead, the namespace indicates what system or entity defines
|
|
39
|
+
* the semantics of the label. Namespaces do not restrict the set of objects to which a label may be associated. Keys are defined by the following grammar: key = hostname "/" kpath
|
|
40
|
+
* kpath = ksegment *[ "/" ksegment ] ksegment = alphadigit | *[ alphadigit | "-" | "_" | "." ] where "hostname" and "alphadigit" are defined as in RFC 1738. Example key:
|
|
41
|
+
* spanner.google.com/universe
|
|
42
|
+
*/
|
|
43
|
+
key?: string;
|
|
44
|
+
/** An integer value. */
|
|
45
|
+
numValue?: string;
|
|
46
|
+
/** A string value. */
|
|
47
|
+
strValue?: string;
|
|
48
|
+
}
|
|
49
|
+
interface ListSubscriptionsResponse {
|
|
50
|
+
/** If not empty, indicates that there are more subscriptions that match the request and this value should be passed to the next ListSubscriptionsRequest to continue. */
|
|
51
|
+
nextPageToken?: string;
|
|
52
|
+
/** The subscriptions that match the request. */
|
|
53
|
+
subscription?: Subscription[];
|
|
54
|
+
}
|
|
55
|
+
interface ListTopicsResponse {
|
|
56
|
+
/** If not empty, indicates that there are more topics that match the request, and this value should be passed to the next ListTopicsRequest to continue. */
|
|
57
|
+
nextPageToken?: string;
|
|
58
|
+
/** The resulting topics. */
|
|
59
|
+
topic?: Topic[];
|
|
60
|
+
}
|
|
61
|
+
interface ModifyAckDeadlineRequest {
|
|
62
|
+
/**
|
|
63
|
+
* The new ack deadline with respect to the time this request was sent to the Pub/Sub system. Must be >= 0. For example, if the value is 10, the new ack deadline will expire 10 seconds
|
|
64
|
+
* after the ModifyAckDeadline call was made. Specifying zero may immediately make the message available for another pull request.
|
|
65
|
+
*/
|
|
66
|
+
ackDeadlineSeconds?: number;
|
|
67
|
+
/** The acknowledgment ID. Either this or ack_ids must be populated, not both. */
|
|
68
|
+
ackId?: string;
|
|
69
|
+
/** List of acknowledgment IDs. Either this field or ack_id should be populated, not both. */
|
|
70
|
+
ackIds?: string[];
|
|
71
|
+
/** Next Index: 5 The name of the subscription from which messages are being pulled. */
|
|
72
|
+
subscription?: string;
|
|
73
|
+
}
|
|
74
|
+
interface ModifyPushConfigRequest {
|
|
75
|
+
/** An empty push_config indicates that the Pub/Sub system should pause pushing messages from the given subscription. */
|
|
76
|
+
pushConfig?: PushConfig;
|
|
77
|
+
/** The name of the subscription. */
|
|
78
|
+
subscription?: string;
|
|
79
|
+
}
|
|
80
|
+
interface PublishBatchRequest {
|
|
81
|
+
/** The messages to publish. */
|
|
82
|
+
messages?: PubsubMessage[];
|
|
83
|
+
/** The messages in the request will be published on this topic. */
|
|
84
|
+
topic?: string;
|
|
85
|
+
}
|
|
86
|
+
interface PublishBatchResponse {
|
|
87
|
+
/** The server-assigned ID of each published message, in the same order as the messages in the request. IDs are guaranteed to be unique within the topic. */
|
|
88
|
+
messageIds?: string[];
|
|
89
|
+
}
|
|
90
|
+
interface PublishRequest {
|
|
91
|
+
/** The message to publish. */
|
|
92
|
+
message?: PubsubMessage;
|
|
93
|
+
/** The message in the request will be published on this topic. */
|
|
94
|
+
topic?: string;
|
|
95
|
+
}
|
|
96
|
+
interface PubsubEvent {
|
|
97
|
+
/**
|
|
98
|
+
* Indicates that this subscription has been deleted. (Note that pull subscribers will always receive NOT_FOUND in response in their pull request on the subscription, rather than
|
|
99
|
+
* seeing this boolean.)
|
|
100
|
+
*/
|
|
101
|
+
deleted?: boolean;
|
|
102
|
+
/** A received message. */
|
|
103
|
+
message?: PubsubMessage;
|
|
104
|
+
/** The subscription that received the event. */
|
|
105
|
+
subscription?: string;
|
|
106
|
+
/** Indicates that this subscription has been truncated. */
|
|
107
|
+
truncated?: boolean;
|
|
108
|
+
}
|
|
109
|
+
interface PubsubMessage {
|
|
110
|
+
/** The message payload. */
|
|
111
|
+
data?: string;
|
|
112
|
+
/** Optional list of labels for this message. Keys in this collection must be unique. */
|
|
113
|
+
label?: Label[];
|
|
114
|
+
/**
|
|
115
|
+
* ID of this message assigned by the server at publication time. Guaranteed to be unique within the topic. This value may be read by a subscriber that receives a PubsubMessage via a
|
|
116
|
+
* Pull call or a push delivery. It must not be populated by a publisher in a Publish call.
|
|
117
|
+
*/
|
|
118
|
+
messageId?: string;
|
|
119
|
+
/** The time at which the message was published. The time is milliseconds since the UNIX epoch. */
|
|
120
|
+
publishTime?: string;
|
|
121
|
+
}
|
|
122
|
+
interface PullBatchRequest {
|
|
123
|
+
/** The maximum number of PubsubEvents returned for this request. The Pub/Sub system may return fewer than the number of events specified. */
|
|
124
|
+
maxEvents?: number;
|
|
125
|
+
/**
|
|
126
|
+
* If this is specified as true the system will respond immediately even if it is not able to return a message in the Pull response. Otherwise the system is allowed to wait until at
|
|
127
|
+
* least one message is available rather than returning no messages. The client may cancel the request if it does not wish to wait any longer for the response.
|
|
128
|
+
*/
|
|
129
|
+
returnImmediately?: boolean;
|
|
130
|
+
/** The subscription from which messages should be pulled. */
|
|
131
|
+
subscription?: string;
|
|
132
|
+
}
|
|
133
|
+
interface PullBatchResponse {
|
|
134
|
+
/**
|
|
135
|
+
* Received Pub/Sub messages or status events. The Pub/Sub system will return zero messages if there are no more messages available in the backlog. The Pub/Sub system may return fewer
|
|
136
|
+
* than the max_events requested even if there are more messages available in the backlog.
|
|
137
|
+
*/
|
|
138
|
+
pullResponses?: PullResponse[];
|
|
139
|
+
}
|
|
140
|
+
interface PullRequest {
|
|
141
|
+
/**
|
|
142
|
+
* If this is specified as true the system will respond immediately even if it is not able to return a message in the Pull response. Otherwise the system is allowed to wait until at
|
|
143
|
+
* least one message is available rather than returning FAILED_PRECONDITION. The client may cancel the request if it does not wish to wait any longer for the response.
|
|
144
|
+
*/
|
|
145
|
+
returnImmediately?: boolean;
|
|
146
|
+
/** The subscription from which a message should be pulled. */
|
|
147
|
+
subscription?: string;
|
|
148
|
+
}
|
|
149
|
+
interface PullResponse {
|
|
150
|
+
/** This ID must be used to acknowledge the received event or message. */
|
|
151
|
+
ackId?: string;
|
|
152
|
+
/** A pubsub message or truncation event. */
|
|
153
|
+
pubsubEvent?: PubsubEvent;
|
|
154
|
+
}
|
|
155
|
+
interface PushConfig {
|
|
156
|
+
/** A URL locating the endpoint to which messages should be pushed. For example, a Webhook endpoint might use "https://example.com/push". */
|
|
157
|
+
pushEndpoint?: string;
|
|
158
|
+
}
|
|
159
|
+
interface Subscription {
|
|
160
|
+
/**
|
|
161
|
+
* For either push or pull delivery, the value is the maximum time after a subscriber receives a message before the subscriber should acknowledge or Nack the message. If the Ack
|
|
162
|
+
* deadline for a message passes without an Ack or a Nack, the Pub/Sub system will eventually redeliver the message. If a subscriber acknowledges after the deadline, the Pub/Sub system
|
|
163
|
+
* may accept the Ack, but it is possible that the message has been already delivered again. Multiple Acks to the message are allowed and will succeed. For push delivery, this value is
|
|
164
|
+
* used to set the request timeout for the call to the push endpoint. For pull delivery, this value is used as the initial value for the Ack deadline. It may be overridden for each
|
|
165
|
+
* message using its corresponding ack_id with ModifyAckDeadline. While a message is outstanding (i.e. it has been delivered to a pull subscriber and the subscriber has not yet Acked
|
|
166
|
+
* or Nacked), the Pub/Sub system will not deliver that message to another pull subscriber (on a best-effort basis).
|
|
167
|
+
*/
|
|
168
|
+
ackDeadlineSeconds?: number;
|
|
169
|
+
/** Name of the subscription. */
|
|
170
|
+
name?: string;
|
|
171
|
+
/** If push delivery is used with this subscription, this field is used to configure it. */
|
|
172
|
+
pushConfig?: PushConfig;
|
|
173
|
+
/** The name of the topic from which this subscription is receiving messages. */
|
|
174
|
+
topic?: string;
|
|
175
|
+
}
|
|
176
|
+
interface Topic {
|
|
177
|
+
/** Name of the topic. */
|
|
178
|
+
name?: string;
|
|
179
|
+
}
|
|
180
|
+
interface SubscriptionsResource {
|
|
181
|
+
/**
|
|
182
|
+
* Acknowledges a particular received message: the Pub/Sub system can remove the given message from the subscription. Acknowledging a message whose Ack deadline has expired may
|
|
183
|
+
* succeed, but the message could have been already redelivered. Acknowledging a message more than once will not result in an error. This is only used for messages received via pull.
|
|
184
|
+
*/
|
|
185
|
+
acknowledge(request: {
|
|
186
|
+
/** V1 error format. */
|
|
187
|
+
"$.xgafv"?: string;
|
|
188
|
+
/** OAuth access token. */
|
|
189
|
+
access_token?: string;
|
|
190
|
+
/** Data format for response. */
|
|
191
|
+
alt?: string;
|
|
192
|
+
/** JSONP */
|
|
193
|
+
callback?: string;
|
|
194
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
195
|
+
fields?: string;
|
|
196
|
+
/** 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. */
|
|
197
|
+
key?: string;
|
|
198
|
+
/** OAuth 2.0 token for the current user. */
|
|
199
|
+
oauth_token?: string;
|
|
200
|
+
/** Returns response with indentations and line breaks. */
|
|
201
|
+
prettyPrint?: boolean;
|
|
202
|
+
/** 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. */
|
|
203
|
+
quotaUser?: string;
|
|
204
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
205
|
+
upload_protocol?: string;
|
|
206
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
207
|
+
uploadType?: string;
|
|
208
|
+
/** Request body */
|
|
209
|
+
resource: AcknowledgeRequest;
|
|
210
|
+
}): Request<{}>;
|
|
211
|
+
acknowledge(request: {
|
|
212
|
+
/** V1 error format. */
|
|
213
|
+
"$.xgafv"?: string;
|
|
214
|
+
/** OAuth access token. */
|
|
215
|
+
access_token?: string;
|
|
216
|
+
/** Data format for response. */
|
|
217
|
+
alt?: string;
|
|
218
|
+
/** JSONP */
|
|
219
|
+
callback?: string;
|
|
220
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
221
|
+
fields?: string;
|
|
222
|
+
/** 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. */
|
|
223
|
+
key?: string;
|
|
224
|
+
/** OAuth 2.0 token for the current user. */
|
|
225
|
+
oauth_token?: string;
|
|
226
|
+
/** Returns response with indentations and line breaks. */
|
|
227
|
+
prettyPrint?: boolean;
|
|
228
|
+
/** 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. */
|
|
229
|
+
quotaUser?: string;
|
|
230
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
231
|
+
upload_protocol?: string;
|
|
232
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
233
|
+
uploadType?: string;
|
|
234
|
+
},
|
|
235
|
+
body: AcknowledgeRequest): Request<{}>;
|
|
236
|
+
/**
|
|
237
|
+
* Creates a subscription on a given topic for a given subscriber. If the subscription already exists, returns ALREADY_EXISTS. If the corresponding topic doesn't exist, returns
|
|
238
|
+
* NOT_FOUND. If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic.
|
|
239
|
+
*/
|
|
240
|
+
create(request: {
|
|
241
|
+
/** V1 error format. */
|
|
242
|
+
"$.xgafv"?: string;
|
|
243
|
+
/** OAuth access token. */
|
|
244
|
+
access_token?: string;
|
|
245
|
+
/** Data format for response. */
|
|
246
|
+
alt?: string;
|
|
247
|
+
/** JSONP */
|
|
248
|
+
callback?: string;
|
|
249
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
250
|
+
fields?: string;
|
|
251
|
+
/** 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. */
|
|
252
|
+
key?: string;
|
|
253
|
+
/** OAuth 2.0 token for the current user. */
|
|
254
|
+
oauth_token?: string;
|
|
255
|
+
/** Returns response with indentations and line breaks. */
|
|
256
|
+
prettyPrint?: boolean;
|
|
257
|
+
/** 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. */
|
|
258
|
+
quotaUser?: string;
|
|
259
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
260
|
+
upload_protocol?: string;
|
|
261
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
262
|
+
uploadType?: string;
|
|
263
|
+
/** Request body */
|
|
264
|
+
resource: Subscription;
|
|
265
|
+
}): Request<Subscription>;
|
|
266
|
+
create(request: {
|
|
267
|
+
/** V1 error format. */
|
|
268
|
+
"$.xgafv"?: string;
|
|
269
|
+
/** OAuth access token. */
|
|
270
|
+
access_token?: string;
|
|
271
|
+
/** Data format for response. */
|
|
272
|
+
alt?: string;
|
|
273
|
+
/** JSONP */
|
|
274
|
+
callback?: string;
|
|
275
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
276
|
+
fields?: string;
|
|
277
|
+
/** 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. */
|
|
278
|
+
key?: string;
|
|
279
|
+
/** OAuth 2.0 token for the current user. */
|
|
280
|
+
oauth_token?: string;
|
|
281
|
+
/** Returns response with indentations and line breaks. */
|
|
282
|
+
prettyPrint?: boolean;
|
|
283
|
+
/** 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. */
|
|
284
|
+
quotaUser?: string;
|
|
285
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
286
|
+
upload_protocol?: string;
|
|
287
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
288
|
+
uploadType?: string;
|
|
289
|
+
},
|
|
290
|
+
body: Subscription): Request<Subscription>;
|
|
291
|
+
/** Deletes an existing subscription. All pending messages in the subscription are immediately dropped. Calls to Pull after deletion will return NOT_FOUND. */
|
|
292
|
+
delete(request?: {
|
|
293
|
+
/** V1 error format. */
|
|
294
|
+
"$.xgafv"?: string;
|
|
295
|
+
/** OAuth access token. */
|
|
296
|
+
access_token?: string;
|
|
297
|
+
/** Data format for response. */
|
|
298
|
+
alt?: string;
|
|
299
|
+
/** JSONP */
|
|
300
|
+
callback?: string;
|
|
301
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
302
|
+
fields?: string;
|
|
303
|
+
/** 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. */
|
|
304
|
+
key?: string;
|
|
305
|
+
/** OAuth 2.0 token for the current user. */
|
|
306
|
+
oauth_token?: string;
|
|
307
|
+
/** Returns response with indentations and line breaks. */
|
|
308
|
+
prettyPrint?: boolean;
|
|
309
|
+
/** 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. */
|
|
310
|
+
quotaUser?: string;
|
|
311
|
+
/** The subscription to delete. */
|
|
312
|
+
subscription: string;
|
|
313
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
314
|
+
upload_protocol?: string;
|
|
315
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
316
|
+
uploadType?: string;
|
|
317
|
+
}): Request<{}>;
|
|
318
|
+
/** Gets the configuration details of a subscription. */
|
|
319
|
+
get(request?: {
|
|
320
|
+
/** V1 error format. */
|
|
321
|
+
"$.xgafv"?: string;
|
|
322
|
+
/** OAuth access token. */
|
|
323
|
+
access_token?: string;
|
|
324
|
+
/** Data format for response. */
|
|
325
|
+
alt?: string;
|
|
326
|
+
/** JSONP */
|
|
327
|
+
callback?: string;
|
|
328
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
329
|
+
fields?: string;
|
|
330
|
+
/** 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. */
|
|
331
|
+
key?: string;
|
|
332
|
+
/** OAuth 2.0 token for the current user. */
|
|
333
|
+
oauth_token?: 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
|
+
/** The name of the subscription to get. */
|
|
339
|
+
subscription: string;
|
|
340
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
341
|
+
upload_protocol?: string;
|
|
342
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
343
|
+
uploadType?: string;
|
|
344
|
+
}): Request<Subscription>;
|
|
345
|
+
/** Lists matching subscriptions. */
|
|
346
|
+
list(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
|
+
/** Maximum number of subscriptions to return. */
|
|
360
|
+
maxResults?: number;
|
|
361
|
+
/** OAuth 2.0 token for the current user. */
|
|
362
|
+
oauth_token?: string;
|
|
363
|
+
/** The value obtained in the last ListSubscriptionsResponse for continuation. */
|
|
364
|
+
pageToken?: string;
|
|
365
|
+
/** Returns response with indentations and line breaks. */
|
|
366
|
+
prettyPrint?: boolean;
|
|
367
|
+
/** A valid label query expression. */
|
|
368
|
+
query?: string;
|
|
369
|
+
/** 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. */
|
|
370
|
+
quotaUser?: string;
|
|
371
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
372
|
+
upload_protocol?: string;
|
|
373
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
374
|
+
uploadType?: string;
|
|
375
|
+
}): Request<ListSubscriptionsResponse>;
|
|
376
|
+
/** Modifies the Ack deadline for a message received from a pull request. */
|
|
377
|
+
modifyAckDeadline(request: {
|
|
378
|
+
/** V1 error format. */
|
|
379
|
+
"$.xgafv"?: string;
|
|
380
|
+
/** OAuth access token. */
|
|
381
|
+
access_token?: string;
|
|
382
|
+
/** Data format for response. */
|
|
383
|
+
alt?: string;
|
|
384
|
+
/** JSONP */
|
|
385
|
+
callback?: string;
|
|
386
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
387
|
+
fields?: string;
|
|
388
|
+
/** 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. */
|
|
389
|
+
key?: string;
|
|
390
|
+
/** OAuth 2.0 token for the current user. */
|
|
391
|
+
oauth_token?: string;
|
|
392
|
+
/** Returns response with indentations and line breaks. */
|
|
393
|
+
prettyPrint?: boolean;
|
|
394
|
+
/** 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. */
|
|
395
|
+
quotaUser?: string;
|
|
396
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
397
|
+
upload_protocol?: string;
|
|
398
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
399
|
+
uploadType?: string;
|
|
400
|
+
/** Request body */
|
|
401
|
+
resource: ModifyAckDeadlineRequest;
|
|
402
|
+
}): Request<{}>;
|
|
403
|
+
modifyAckDeadline(request: {
|
|
404
|
+
/** V1 error format. */
|
|
405
|
+
"$.xgafv"?: string;
|
|
406
|
+
/** OAuth access token. */
|
|
407
|
+
access_token?: string;
|
|
408
|
+
/** Data format for response. */
|
|
409
|
+
alt?: string;
|
|
410
|
+
/** JSONP */
|
|
411
|
+
callback?: string;
|
|
412
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
413
|
+
fields?: string;
|
|
414
|
+
/** 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. */
|
|
415
|
+
key?: string;
|
|
416
|
+
/** OAuth 2.0 token for the current user. */
|
|
417
|
+
oauth_token?: string;
|
|
418
|
+
/** Returns response with indentations and line breaks. */
|
|
419
|
+
prettyPrint?: boolean;
|
|
420
|
+
/** 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. */
|
|
421
|
+
quotaUser?: string;
|
|
422
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
423
|
+
upload_protocol?: string;
|
|
424
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
425
|
+
uploadType?: string;
|
|
426
|
+
},
|
|
427
|
+
body: ModifyAckDeadlineRequest): Request<{}>;
|
|
428
|
+
/**
|
|
429
|
+
* Modifies the PushConfig for a specified subscription. This method can be used to suspend the flow of messages to an endpoint by clearing the PushConfig field in the request.
|
|
430
|
+
* Messages will be accumulated for delivery even if no push configuration is defined or while the configuration is modified.
|
|
431
|
+
*/
|
|
432
|
+
modifyPushConfig(request: {
|
|
433
|
+
/** V1 error format. */
|
|
434
|
+
"$.xgafv"?: string;
|
|
435
|
+
/** OAuth access token. */
|
|
436
|
+
access_token?: string;
|
|
437
|
+
/** Data format for response. */
|
|
438
|
+
alt?: string;
|
|
439
|
+
/** JSONP */
|
|
440
|
+
callback?: string;
|
|
441
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
442
|
+
fields?: string;
|
|
443
|
+
/** 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. */
|
|
444
|
+
key?: string;
|
|
445
|
+
/** OAuth 2.0 token for the current user. */
|
|
446
|
+
oauth_token?: string;
|
|
447
|
+
/** Returns response with indentations and line breaks. */
|
|
448
|
+
prettyPrint?: boolean;
|
|
449
|
+
/** 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. */
|
|
450
|
+
quotaUser?: string;
|
|
451
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
452
|
+
upload_protocol?: string;
|
|
453
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
454
|
+
uploadType?: string;
|
|
455
|
+
/** Request body */
|
|
456
|
+
resource: ModifyPushConfigRequest;
|
|
457
|
+
}): Request<{}>;
|
|
458
|
+
modifyPushConfig(request: {
|
|
459
|
+
/** V1 error format. */
|
|
460
|
+
"$.xgafv"?: string;
|
|
461
|
+
/** OAuth access token. */
|
|
462
|
+
access_token?: string;
|
|
463
|
+
/** Data format for response. */
|
|
464
|
+
alt?: string;
|
|
465
|
+
/** JSONP */
|
|
466
|
+
callback?: string;
|
|
467
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
468
|
+
fields?: string;
|
|
469
|
+
/** 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. */
|
|
470
|
+
key?: string;
|
|
471
|
+
/** OAuth 2.0 token for the current user. */
|
|
472
|
+
oauth_token?: string;
|
|
473
|
+
/** Returns response with indentations and line breaks. */
|
|
474
|
+
prettyPrint?: boolean;
|
|
475
|
+
/** 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. */
|
|
476
|
+
quotaUser?: string;
|
|
477
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
478
|
+
upload_protocol?: string;
|
|
479
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
480
|
+
uploadType?: string;
|
|
481
|
+
},
|
|
482
|
+
body: ModifyPushConfigRequest): Request<{}>;
|
|
483
|
+
/**
|
|
484
|
+
* Pulls a single message from the server. If return_immediately is true, and no messages are available in the subscription, this method returns FAILED_PRECONDITION. The system is free
|
|
485
|
+
* to return an UNAVAILABLE error if no messages are available in a reasonable amount of time (to reduce system load).
|
|
486
|
+
*/
|
|
487
|
+
pull(request: {
|
|
488
|
+
/** V1 error format. */
|
|
489
|
+
"$.xgafv"?: string;
|
|
490
|
+
/** OAuth access token. */
|
|
491
|
+
access_token?: string;
|
|
492
|
+
/** Data format for response. */
|
|
493
|
+
alt?: string;
|
|
494
|
+
/** JSONP */
|
|
495
|
+
callback?: string;
|
|
496
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
497
|
+
fields?: string;
|
|
498
|
+
/** 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. */
|
|
499
|
+
key?: string;
|
|
500
|
+
/** OAuth 2.0 token for the current user. */
|
|
501
|
+
oauth_token?: string;
|
|
502
|
+
/** Returns response with indentations and line breaks. */
|
|
503
|
+
prettyPrint?: boolean;
|
|
504
|
+
/** 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. */
|
|
505
|
+
quotaUser?: string;
|
|
506
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
507
|
+
upload_protocol?: string;
|
|
508
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
509
|
+
uploadType?: string;
|
|
510
|
+
/** Request body */
|
|
511
|
+
resource: PullRequest;
|
|
512
|
+
}): Request<PullResponse>;
|
|
513
|
+
pull(request: {
|
|
514
|
+
/** V1 error format. */
|
|
515
|
+
"$.xgafv"?: string;
|
|
516
|
+
/** OAuth access token. */
|
|
517
|
+
access_token?: string;
|
|
518
|
+
/** Data format for response. */
|
|
519
|
+
alt?: string;
|
|
520
|
+
/** JSONP */
|
|
521
|
+
callback?: string;
|
|
522
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
523
|
+
fields?: string;
|
|
524
|
+
/** 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. */
|
|
525
|
+
key?: string;
|
|
526
|
+
/** OAuth 2.0 token for the current user. */
|
|
527
|
+
oauth_token?: string;
|
|
528
|
+
/** Returns response with indentations and line breaks. */
|
|
529
|
+
prettyPrint?: boolean;
|
|
530
|
+
/** 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. */
|
|
531
|
+
quotaUser?: string;
|
|
532
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
533
|
+
upload_protocol?: string;
|
|
534
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
535
|
+
uploadType?: string;
|
|
536
|
+
},
|
|
537
|
+
body: PullRequest): Request<PullResponse>;
|
|
538
|
+
/**
|
|
539
|
+
* Pulls messages from the server. Returns an empty list if there are no messages available in the backlog. The system is free to return UNAVAILABLE if there are too many pull requests
|
|
540
|
+
* outstanding for the given subscription.
|
|
541
|
+
*/
|
|
542
|
+
pullBatch(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
|
+
/** Request body */
|
|
566
|
+
resource: PullBatchRequest;
|
|
567
|
+
}): Request<PullBatchResponse>;
|
|
568
|
+
pullBatch(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
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
588
|
+
upload_protocol?: string;
|
|
589
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
590
|
+
uploadType?: string;
|
|
591
|
+
},
|
|
592
|
+
body: PullBatchRequest): Request<PullBatchResponse>;
|
|
593
|
+
}
|
|
594
|
+
interface TopicsResource {
|
|
595
|
+
/** Creates the given topic with the given name. */
|
|
596
|
+
create(request: {
|
|
597
|
+
/** V1 error format. */
|
|
598
|
+
"$.xgafv"?: string;
|
|
599
|
+
/** OAuth access token. */
|
|
600
|
+
access_token?: string;
|
|
601
|
+
/** Data format for response. */
|
|
602
|
+
alt?: string;
|
|
603
|
+
/** JSONP */
|
|
604
|
+
callback?: string;
|
|
605
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
606
|
+
fields?: string;
|
|
607
|
+
/** 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. */
|
|
608
|
+
key?: string;
|
|
609
|
+
/** OAuth 2.0 token for the current user. */
|
|
610
|
+
oauth_token?: string;
|
|
611
|
+
/** Returns response with indentations and line breaks. */
|
|
612
|
+
prettyPrint?: boolean;
|
|
613
|
+
/** 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. */
|
|
614
|
+
quotaUser?: string;
|
|
615
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
616
|
+
upload_protocol?: string;
|
|
617
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
618
|
+
uploadType?: string;
|
|
619
|
+
/** Request body */
|
|
620
|
+
resource: Topic;
|
|
621
|
+
}): Request<Topic>;
|
|
622
|
+
create(request: {
|
|
623
|
+
/** V1 error format. */
|
|
624
|
+
"$.xgafv"?: string;
|
|
625
|
+
/** OAuth access token. */
|
|
626
|
+
access_token?: string;
|
|
627
|
+
/** Data format for response. */
|
|
628
|
+
alt?: string;
|
|
629
|
+
/** JSONP */
|
|
630
|
+
callback?: string;
|
|
631
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
632
|
+
fields?: string;
|
|
633
|
+
/** 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. */
|
|
634
|
+
key?: string;
|
|
635
|
+
/** OAuth 2.0 token for the current user. */
|
|
636
|
+
oauth_token?: string;
|
|
637
|
+
/** Returns response with indentations and line breaks. */
|
|
638
|
+
prettyPrint?: boolean;
|
|
639
|
+
/** 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. */
|
|
640
|
+
quotaUser?: string;
|
|
641
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
642
|
+
upload_protocol?: string;
|
|
643
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
644
|
+
uploadType?: string;
|
|
645
|
+
},
|
|
646
|
+
body: Topic): Request<Topic>;
|
|
647
|
+
/** Deletes the topic with the given name. Returns NOT_FOUND if the topic does not exist. After a topic is deleted, a new topic may be created with the same name. */
|
|
648
|
+
delete(request?: {
|
|
649
|
+
/** V1 error format. */
|
|
650
|
+
"$.xgafv"?: string;
|
|
651
|
+
/** OAuth access token. */
|
|
652
|
+
access_token?: string;
|
|
653
|
+
/** Data format for response. */
|
|
654
|
+
alt?: string;
|
|
655
|
+
/** JSONP */
|
|
656
|
+
callback?: string;
|
|
657
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
658
|
+
fields?: string;
|
|
659
|
+
/** 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. */
|
|
660
|
+
key?: string;
|
|
661
|
+
/** OAuth 2.0 token for the current user. */
|
|
662
|
+
oauth_token?: string;
|
|
663
|
+
/** Returns response with indentations and line breaks. */
|
|
664
|
+
prettyPrint?: boolean;
|
|
665
|
+
/** 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. */
|
|
666
|
+
quotaUser?: string;
|
|
667
|
+
/** Name of the topic to delete. */
|
|
668
|
+
topic: string;
|
|
669
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
670
|
+
upload_protocol?: string;
|
|
671
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
672
|
+
uploadType?: string;
|
|
673
|
+
}): Request<{}>;
|
|
674
|
+
/**
|
|
675
|
+
* Gets the configuration of a topic. Since the topic only has the name attribute, this method is only useful to check the existence of a topic. If other attributes are added in the
|
|
676
|
+
* future, they will be returned here.
|
|
677
|
+
*/
|
|
678
|
+
get(request?: {
|
|
679
|
+
/** V1 error format. */
|
|
680
|
+
"$.xgafv"?: string;
|
|
681
|
+
/** OAuth access token. */
|
|
682
|
+
access_token?: string;
|
|
683
|
+
/** Data format for response. */
|
|
684
|
+
alt?: string;
|
|
685
|
+
/** JSONP */
|
|
686
|
+
callback?: string;
|
|
687
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
688
|
+
fields?: string;
|
|
689
|
+
/** 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. */
|
|
690
|
+
key?: string;
|
|
691
|
+
/** OAuth 2.0 token for the current user. */
|
|
692
|
+
oauth_token?: string;
|
|
693
|
+
/** Returns response with indentations and line breaks. */
|
|
694
|
+
prettyPrint?: boolean;
|
|
695
|
+
/** 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. */
|
|
696
|
+
quotaUser?: string;
|
|
697
|
+
/** The name of the topic to get. */
|
|
698
|
+
topic: string;
|
|
699
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
700
|
+
upload_protocol?: string;
|
|
701
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
702
|
+
uploadType?: string;
|
|
703
|
+
}): Request<Topic>;
|
|
704
|
+
/** Lists matching topics. */
|
|
705
|
+
list(request?: {
|
|
706
|
+
/** V1 error format. */
|
|
707
|
+
"$.xgafv"?: string;
|
|
708
|
+
/** OAuth access token. */
|
|
709
|
+
access_token?: string;
|
|
710
|
+
/** Data format for response. */
|
|
711
|
+
alt?: string;
|
|
712
|
+
/** JSONP */
|
|
713
|
+
callback?: string;
|
|
714
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
715
|
+
fields?: string;
|
|
716
|
+
/** 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. */
|
|
717
|
+
key?: string;
|
|
718
|
+
/** Maximum number of topics to return. */
|
|
719
|
+
maxResults?: number;
|
|
720
|
+
/** OAuth 2.0 token for the current user. */
|
|
721
|
+
oauth_token?: string;
|
|
722
|
+
/** The value obtained in the last ListTopicsResponse for continuation. */
|
|
723
|
+
pageToken?: string;
|
|
724
|
+
/** Returns response with indentations and line breaks. */
|
|
725
|
+
prettyPrint?: boolean;
|
|
726
|
+
/** A valid label query expression. */
|
|
727
|
+
query?: string;
|
|
728
|
+
/** 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. */
|
|
729
|
+
quotaUser?: string;
|
|
730
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
731
|
+
upload_protocol?: string;
|
|
732
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
733
|
+
uploadType?: string;
|
|
734
|
+
}): Request<ListTopicsResponse>;
|
|
735
|
+
/** Adds a message to the topic. Returns NOT_FOUND if the topic does not exist. */
|
|
736
|
+
publish(request: {
|
|
737
|
+
/** V1 error format. */
|
|
738
|
+
"$.xgafv"?: string;
|
|
739
|
+
/** OAuth access token. */
|
|
740
|
+
access_token?: string;
|
|
741
|
+
/** Data format for response. */
|
|
742
|
+
alt?: string;
|
|
743
|
+
/** JSONP */
|
|
744
|
+
callback?: string;
|
|
745
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
746
|
+
fields?: string;
|
|
747
|
+
/** 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. */
|
|
748
|
+
key?: string;
|
|
749
|
+
/** OAuth 2.0 token for the current user. */
|
|
750
|
+
oauth_token?: string;
|
|
751
|
+
/** Returns response with indentations and line breaks. */
|
|
752
|
+
prettyPrint?: boolean;
|
|
753
|
+
/** 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. */
|
|
754
|
+
quotaUser?: string;
|
|
755
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
756
|
+
upload_protocol?: string;
|
|
757
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
758
|
+
uploadType?: string;
|
|
759
|
+
/** Request body */
|
|
760
|
+
resource: PublishRequest;
|
|
761
|
+
}): Request<{}>;
|
|
762
|
+
publish(request: {
|
|
763
|
+
/** V1 error format. */
|
|
764
|
+
"$.xgafv"?: string;
|
|
765
|
+
/** OAuth access token. */
|
|
766
|
+
access_token?: string;
|
|
767
|
+
/** Data format for response. */
|
|
768
|
+
alt?: string;
|
|
769
|
+
/** JSONP */
|
|
770
|
+
callback?: string;
|
|
771
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
772
|
+
fields?: string;
|
|
773
|
+
/** 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. */
|
|
774
|
+
key?: string;
|
|
775
|
+
/** OAuth 2.0 token for the current user. */
|
|
776
|
+
oauth_token?: string;
|
|
777
|
+
/** Returns response with indentations and line breaks. */
|
|
778
|
+
prettyPrint?: boolean;
|
|
779
|
+
/** 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. */
|
|
780
|
+
quotaUser?: string;
|
|
781
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
782
|
+
upload_protocol?: string;
|
|
783
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
784
|
+
uploadType?: string;
|
|
785
|
+
},
|
|
786
|
+
body: PublishRequest): Request<{}>;
|
|
787
|
+
/** Adds one or more messages to the topic. Returns NOT_FOUND if the topic does not exist. */
|
|
788
|
+
publishBatch(request: {
|
|
789
|
+
/** V1 error format. */
|
|
790
|
+
"$.xgafv"?: string;
|
|
791
|
+
/** OAuth access token. */
|
|
792
|
+
access_token?: string;
|
|
793
|
+
/** Data format for response. */
|
|
794
|
+
alt?: string;
|
|
795
|
+
/** JSONP */
|
|
796
|
+
callback?: string;
|
|
797
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
798
|
+
fields?: string;
|
|
799
|
+
/** 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. */
|
|
800
|
+
key?: string;
|
|
801
|
+
/** OAuth 2.0 token for the current user. */
|
|
802
|
+
oauth_token?: string;
|
|
803
|
+
/** Returns response with indentations and line breaks. */
|
|
804
|
+
prettyPrint?: boolean;
|
|
805
|
+
/** 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. */
|
|
806
|
+
quotaUser?: string;
|
|
807
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
808
|
+
upload_protocol?: string;
|
|
809
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
810
|
+
uploadType?: string;
|
|
811
|
+
/** Request body */
|
|
812
|
+
resource: PublishBatchRequest;
|
|
813
|
+
}): Request<PublishBatchResponse>;
|
|
814
|
+
publishBatch(request: {
|
|
815
|
+
/** V1 error format. */
|
|
816
|
+
"$.xgafv"?: string;
|
|
817
|
+
/** OAuth access token. */
|
|
818
|
+
access_token?: string;
|
|
819
|
+
/** Data format for response. */
|
|
820
|
+
alt?: string;
|
|
821
|
+
/** JSONP */
|
|
822
|
+
callback?: string;
|
|
823
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
824
|
+
fields?: string;
|
|
825
|
+
/** 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. */
|
|
826
|
+
key?: string;
|
|
827
|
+
/** OAuth 2.0 token for the current user. */
|
|
828
|
+
oauth_token?: string;
|
|
829
|
+
/** Returns response with indentations and line breaks. */
|
|
830
|
+
prettyPrint?: boolean;
|
|
831
|
+
/** 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. */
|
|
832
|
+
quotaUser?: string;
|
|
833
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
834
|
+
upload_protocol?: string;
|
|
835
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
836
|
+
uploadType?: string;
|
|
837
|
+
},
|
|
838
|
+
body: PublishBatchRequest): Request<PublishBatchResponse>;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
const subscriptions: SubscriptionsResource;
|
|
842
|
+
|
|
843
|
+
const topics: TopicsResource;
|
|
844
|
+
}
|
|
845
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maxim_mazurok/gapi.client.pubsub-v1beta1a",
|
|
3
|
+
"version": "0.0.20220729",
|
|
4
|
+
"description": "TypeScript typings for Cloud Pub/Sub API v1beta1a",
|
|
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,146 @@
|
|
|
1
|
+
# TypeScript typings for Cloud Pub/Sub API v1beta1a
|
|
2
|
+
|
|
3
|
+
Provides reliable, many-to-many, asynchronous messaging between applications.
|
|
4
|
+
For detailed description please check [documentation](https://cloud.google.com/pubsub/docs).
|
|
5
|
+
|
|
6
|
+
## Installing
|
|
7
|
+
|
|
8
|
+
Install typings for Cloud Pub/Sub API:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npm install @types/gapi.client.pubsub-v1beta1a --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://pubsub.googleapis.com/$discovery/rest?version=v1beta1a', () => {
|
|
29
|
+
// now we can use:
|
|
30
|
+
// gapi.client.pubsub
|
|
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('pubsub', 'v1beta1a', () => {
|
|
37
|
+
// now we can use:
|
|
38
|
+
// gapi.client.pubsub
|
|
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
|
+
// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
|
|
49
|
+
'https://www.googleapis.com/auth/cloud-platform',
|
|
50
|
+
|
|
51
|
+
// View and manage Pub/Sub topics and subscriptions
|
|
52
|
+
'https://www.googleapis.com/auth/pubsub',
|
|
53
|
+
],
|
|
54
|
+
immediate = true;
|
|
55
|
+
// ...
|
|
56
|
+
|
|
57
|
+
gapi.auth.authorize(
|
|
58
|
+
{ client_id: client_id, scope: scope, immediate: immediate },
|
|
59
|
+
authResult => {
|
|
60
|
+
if (authResult && !authResult.error) {
|
|
61
|
+
/* handle successful authorization */
|
|
62
|
+
} else {
|
|
63
|
+
/* handle authorization error */
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
After that you can use Cloud Pub/Sub API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
|
|
72
|
+
/*
|
|
73
|
+
Acknowledges a particular received message: the Pub/Sub system can remove the given message from the subscription. Acknowledging a message whose Ack deadline has expired may succeed, but the message could have been already redelivered. Acknowledging a message more than once will not result in an error. This is only used for messages received via pull.
|
|
74
|
+
*/
|
|
75
|
+
await gapi.client.pubsub.subscriptions.acknowledge({ });
|
|
76
|
+
|
|
77
|
+
/*
|
|
78
|
+
Creates a subscription on a given topic for a given subscriber. If the subscription already exists, returns ALREADY_EXISTS. If the corresponding topic doesn't exist, returns NOT_FOUND. If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic.
|
|
79
|
+
*/
|
|
80
|
+
await gapi.client.pubsub.subscriptions.create({ });
|
|
81
|
+
|
|
82
|
+
/*
|
|
83
|
+
Deletes an existing subscription. All pending messages in the subscription are immediately dropped. Calls to Pull after deletion will return NOT_FOUND.
|
|
84
|
+
*/
|
|
85
|
+
await gapi.client.pubsub.subscriptions.delete({ subscription: "subscription", });
|
|
86
|
+
|
|
87
|
+
/*
|
|
88
|
+
Gets the configuration details of a subscription.
|
|
89
|
+
*/
|
|
90
|
+
await gapi.client.pubsub.subscriptions.get({ subscription: "subscription", });
|
|
91
|
+
|
|
92
|
+
/*
|
|
93
|
+
Lists matching subscriptions.
|
|
94
|
+
*/
|
|
95
|
+
await gapi.client.pubsub.subscriptions.list({ });
|
|
96
|
+
|
|
97
|
+
/*
|
|
98
|
+
Modifies the Ack deadline for a message received from a pull request.
|
|
99
|
+
*/
|
|
100
|
+
await gapi.client.pubsub.subscriptions.modifyAckDeadline({ });
|
|
101
|
+
|
|
102
|
+
/*
|
|
103
|
+
Modifies the PushConfig for a specified subscription. This method can be used to suspend the flow of messages to an endpoint by clearing the PushConfig field in the request. Messages will be accumulated for delivery even if no push configuration is defined or while the configuration is modified.
|
|
104
|
+
*/
|
|
105
|
+
await gapi.client.pubsub.subscriptions.modifyPushConfig({ });
|
|
106
|
+
|
|
107
|
+
/*
|
|
108
|
+
Pulls a single message from the server. If return_immediately is true, and no messages are available in the subscription, this method returns FAILED_PRECONDITION. The system is free to return an UNAVAILABLE error if no messages are available in a reasonable amount of time (to reduce system load).
|
|
109
|
+
*/
|
|
110
|
+
await gapi.client.pubsub.subscriptions.pull({ });
|
|
111
|
+
|
|
112
|
+
/*
|
|
113
|
+
Pulls messages from the server. Returns an empty list if there are no messages available in the backlog. The system is free to return UNAVAILABLE if there are too many pull requests outstanding for the given subscription.
|
|
114
|
+
*/
|
|
115
|
+
await gapi.client.pubsub.subscriptions.pullBatch({ });
|
|
116
|
+
|
|
117
|
+
/*
|
|
118
|
+
Creates the given topic with the given name.
|
|
119
|
+
*/
|
|
120
|
+
await gapi.client.pubsub.topics.create({ });
|
|
121
|
+
|
|
122
|
+
/*
|
|
123
|
+
Deletes the topic with the given name. Returns NOT_FOUND if the topic does not exist. After a topic is deleted, a new topic may be created with the same name.
|
|
124
|
+
*/
|
|
125
|
+
await gapi.client.pubsub.topics.delete({ topic: "topic", });
|
|
126
|
+
|
|
127
|
+
/*
|
|
128
|
+
Gets the configuration of a topic. Since the topic only has the name attribute, this method is only useful to check the existence of a topic. If other attributes are added in the future, they will be returned here.
|
|
129
|
+
*/
|
|
130
|
+
await gapi.client.pubsub.topics.get({ topic: "topic", });
|
|
131
|
+
|
|
132
|
+
/*
|
|
133
|
+
Lists matching topics.
|
|
134
|
+
*/
|
|
135
|
+
await gapi.client.pubsub.topics.list({ });
|
|
136
|
+
|
|
137
|
+
/*
|
|
138
|
+
Adds a message to the topic. Returns NOT_FOUND if the topic does not exist.
|
|
139
|
+
*/
|
|
140
|
+
await gapi.client.pubsub.topics.publish({ });
|
|
141
|
+
|
|
142
|
+
/*
|
|
143
|
+
Adds one or more messages to the topic. Returns NOT_FOUND if the topic does not exist.
|
|
144
|
+
*/
|
|
145
|
+
await gapi.client.pubsub.topics.publishBatch({ });
|
|
146
|
+
```
|
package/tests.ts
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/* This is stub file for gapi.client.pubsub-v1beta1a 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: 20220729
|
|
7
|
+
|
|
8
|
+
gapi.load('client', async () => {
|
|
9
|
+
/** now we can use gapi.client */
|
|
10
|
+
|
|
11
|
+
await gapi.client.load('https://pubsub.googleapis.com/$discovery/rest?version=v1beta1a');
|
|
12
|
+
/** now we can use gapi.client.pubsub */
|
|
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
|
+
/** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account. */
|
|
19
|
+
'https://www.googleapis.com/auth/cloud-platform',
|
|
20
|
+
/** View and manage Pub/Sub topics and subscriptions */
|
|
21
|
+
'https://www.googleapis.com/auth/pubsub',
|
|
22
|
+
];
|
|
23
|
+
const immediate = false;
|
|
24
|
+
gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
|
|
25
|
+
if (authResult && !authResult.error) {
|
|
26
|
+
/** handle successful authorization */
|
|
27
|
+
run();
|
|
28
|
+
} else {
|
|
29
|
+
/** handle authorization error */
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
async function run() {
|
|
34
|
+
/**
|
|
35
|
+
* Acknowledges a particular received message: the Pub/Sub system can remove the given message from the subscription. Acknowledging a message whose Ack deadline has expired may succeed,
|
|
36
|
+
* but the message could have been already redelivered. Acknowledging a message more than once will not result in an error. This is only used for messages received via pull.
|
|
37
|
+
*/
|
|
38
|
+
await gapi.client.pubsub.subscriptions.acknowledge({
|
|
39
|
+
}, {
|
|
40
|
+
ackId: [
|
|
41
|
+
"Test string"
|
|
42
|
+
],
|
|
43
|
+
subscription: "Test string",
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Creates a subscription on a given topic for a given subscriber. If the subscription already exists, returns ALREADY_EXISTS. If the corresponding topic doesn't exist, returns NOT_FOUND.
|
|
47
|
+
* If the name is not provided in the request, the server will assign a random name for this subscription on the same project as the topic.
|
|
48
|
+
*/
|
|
49
|
+
await gapi.client.pubsub.subscriptions.create({
|
|
50
|
+
}, {
|
|
51
|
+
ackDeadlineSeconds: 42,
|
|
52
|
+
name: "Test string",
|
|
53
|
+
pushConfig: {
|
|
54
|
+
pushEndpoint: "Test string",
|
|
55
|
+
},
|
|
56
|
+
topic: "Test string",
|
|
57
|
+
});
|
|
58
|
+
/** Deletes an existing subscription. All pending messages in the subscription are immediately dropped. Calls to Pull after deletion will return NOT_FOUND. */
|
|
59
|
+
await gapi.client.pubsub.subscriptions.delete({
|
|
60
|
+
subscription: "Test string",
|
|
61
|
+
});
|
|
62
|
+
/** Gets the configuration details of a subscription. */
|
|
63
|
+
await gapi.client.pubsub.subscriptions.get({
|
|
64
|
+
subscription: "Test string",
|
|
65
|
+
});
|
|
66
|
+
/** Lists matching subscriptions. */
|
|
67
|
+
await gapi.client.pubsub.subscriptions.list({
|
|
68
|
+
maxResults: 42,
|
|
69
|
+
pageToken: "Test string",
|
|
70
|
+
query: "Test string",
|
|
71
|
+
});
|
|
72
|
+
/** Modifies the Ack deadline for a message received from a pull request. */
|
|
73
|
+
await gapi.client.pubsub.subscriptions.modifyAckDeadline({
|
|
74
|
+
}, {
|
|
75
|
+
ackDeadlineSeconds: 42,
|
|
76
|
+
ackId: "Test string",
|
|
77
|
+
ackIds: [
|
|
78
|
+
"Test string"
|
|
79
|
+
],
|
|
80
|
+
subscription: "Test string",
|
|
81
|
+
});
|
|
82
|
+
/**
|
|
83
|
+
* Modifies the PushConfig for a specified subscription. This method can be used to suspend the flow of messages to an endpoint by clearing the PushConfig field in the request. Messages
|
|
84
|
+
* will be accumulated for delivery even if no push configuration is defined or while the configuration is modified.
|
|
85
|
+
*/
|
|
86
|
+
await gapi.client.pubsub.subscriptions.modifyPushConfig({
|
|
87
|
+
}, {
|
|
88
|
+
pushConfig: {
|
|
89
|
+
pushEndpoint: "Test string",
|
|
90
|
+
},
|
|
91
|
+
subscription: "Test string",
|
|
92
|
+
});
|
|
93
|
+
/**
|
|
94
|
+
* Pulls a single message from the server. If return_immediately is true, and no messages are available in the subscription, this method returns FAILED_PRECONDITION. The system is free to
|
|
95
|
+
* return an UNAVAILABLE error if no messages are available in a reasonable amount of time (to reduce system load).
|
|
96
|
+
*/
|
|
97
|
+
await gapi.client.pubsub.subscriptions.pull({
|
|
98
|
+
}, {
|
|
99
|
+
returnImmediately: true,
|
|
100
|
+
subscription: "Test string",
|
|
101
|
+
});
|
|
102
|
+
/**
|
|
103
|
+
* Pulls messages from the server. Returns an empty list if there are no messages available in the backlog. The system is free to return UNAVAILABLE if there are too many pull requests
|
|
104
|
+
* outstanding for the given subscription.
|
|
105
|
+
*/
|
|
106
|
+
await gapi.client.pubsub.subscriptions.pullBatch({
|
|
107
|
+
}, {
|
|
108
|
+
maxEvents: 42,
|
|
109
|
+
returnImmediately: true,
|
|
110
|
+
subscription: "Test string",
|
|
111
|
+
});
|
|
112
|
+
/** Creates the given topic with the given name. */
|
|
113
|
+
await gapi.client.pubsub.topics.create({
|
|
114
|
+
}, {
|
|
115
|
+
name: "Test string",
|
|
116
|
+
});
|
|
117
|
+
/** Deletes the topic with the given name. Returns NOT_FOUND if the topic does not exist. After a topic is deleted, a new topic may be created with the same name. */
|
|
118
|
+
await gapi.client.pubsub.topics.delete({
|
|
119
|
+
topic: "Test string",
|
|
120
|
+
});
|
|
121
|
+
/**
|
|
122
|
+
* Gets the configuration of a topic. Since the topic only has the name attribute, this method is only useful to check the existence of a topic. If other attributes are added in the
|
|
123
|
+
* future, they will be returned here.
|
|
124
|
+
*/
|
|
125
|
+
await gapi.client.pubsub.topics.get({
|
|
126
|
+
topic: "Test string",
|
|
127
|
+
});
|
|
128
|
+
/** Lists matching topics. */
|
|
129
|
+
await gapi.client.pubsub.topics.list({
|
|
130
|
+
maxResults: 42,
|
|
131
|
+
pageToken: "Test string",
|
|
132
|
+
query: "Test string",
|
|
133
|
+
});
|
|
134
|
+
/** Adds a message to the topic. Returns NOT_FOUND if the topic does not exist. */
|
|
135
|
+
await gapi.client.pubsub.topics.publish({
|
|
136
|
+
}, {
|
|
137
|
+
message: {
|
|
138
|
+
data: "Test string",
|
|
139
|
+
label: [
|
|
140
|
+
{
|
|
141
|
+
key: "Test string",
|
|
142
|
+
numValue: "Test string",
|
|
143
|
+
strValue: "Test string",
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
messageId: "Test string",
|
|
147
|
+
publishTime: "Test string",
|
|
148
|
+
},
|
|
149
|
+
topic: "Test string",
|
|
150
|
+
});
|
|
151
|
+
/** Adds one or more messages to the topic. Returns NOT_FOUND if the topic does not exist. */
|
|
152
|
+
await gapi.client.pubsub.topics.publishBatch({
|
|
153
|
+
}, {
|
|
154
|
+
messages: [
|
|
155
|
+
{
|
|
156
|
+
data: "Test string",
|
|
157
|
+
label: [
|
|
158
|
+
{
|
|
159
|
+
key: "Test string",
|
|
160
|
+
numValue: "Test string",
|
|
161
|
+
strValue: "Test string",
|
|
162
|
+
}
|
|
163
|
+
],
|
|
164
|
+
messageId: "Test string",
|
|
165
|
+
publishTime: "Test string",
|
|
166
|
+
}
|
|
167
|
+
],
|
|
168
|
+
topic: "Test string",
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
});
|
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
|
+
}
|