@maxim_mazurok/gapi.client.drivelabels-v2 0.0.20220920
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 +465 -0
- package/package.json +20 -0
- package/readme.md +57 -0
- package/tests.ts +38 -0
- package/tsconfig.json +18 -0
- package/tslint.json +6 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
/* Type definitions for non-npm package Drive Labels API v2 0.0 */
|
|
2
|
+
// Project: https://developers.google.com/drive/labels
|
|
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://drivelabels.googleapis.com/$discovery/rest?version=v2
|
|
12
|
+
// Revision: 20220920
|
|
13
|
+
|
|
14
|
+
/// <reference types="gapi.client" />
|
|
15
|
+
|
|
16
|
+
declare namespace gapi.client {
|
|
17
|
+
/** Load Drive Labels API v2 */
|
|
18
|
+
function load(urlOrObject: "https://drivelabels.googleapis.com/$discovery/rest?version=v2"): Promise<void>;
|
|
19
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
20
|
+
function load(name: "drivelabels", version: "v2"): Promise<void>;
|
|
21
|
+
/** @deprecated Please load APIs with discovery documents. */
|
|
22
|
+
function load(name: "drivelabels", version: "v2", callback: () => any): void;
|
|
23
|
+
|
|
24
|
+
namespace drivelabels {
|
|
25
|
+
interface GoogleAppsDriveLabelsV2BadgeColors {
|
|
26
|
+
/** Output only. Badge background that pairs with the foreground. */
|
|
27
|
+
backgroundColor?: GoogleTypeColor;
|
|
28
|
+
/** Output only. Badge foreground that pairs with the background. */
|
|
29
|
+
foregroundColor?: GoogleTypeColor;
|
|
30
|
+
/** Output only. Color that can be used for text without a background. */
|
|
31
|
+
soloColor?: GoogleTypeColor;
|
|
32
|
+
}
|
|
33
|
+
interface GoogleAppsDriveLabelsV2BadgeConfig {
|
|
34
|
+
/**
|
|
35
|
+
* The color of the badge. When not specified, no badge is rendered. The background, foreground, and solo (light and dark mode) colors set here are changed in the Drive UI into the
|
|
36
|
+
* closest recommended supported color.
|
|
37
|
+
*/
|
|
38
|
+
color?: GoogleTypeColor;
|
|
39
|
+
/** Override the default global priority of this badge. When set to 0, the default priority heuristic is used. */
|
|
40
|
+
priorityOverride?: string;
|
|
41
|
+
}
|
|
42
|
+
interface GoogleAppsDriveLabelsV2Field {
|
|
43
|
+
/** Output only. The capabilities this user has on this field and its value when the label is applied on Drive items. */
|
|
44
|
+
appliedCapabilities?: GoogleAppsDriveLabelsV2FieldAppliedCapabilities;
|
|
45
|
+
/** Output only. The time this field was created. */
|
|
46
|
+
createTime?: string;
|
|
47
|
+
/** Output only. The user who created this field. */
|
|
48
|
+
creator?: GoogleAppsDriveLabelsV2UserInfo;
|
|
49
|
+
/** Date field options. */
|
|
50
|
+
dateOptions?: GoogleAppsDriveLabelsV2FieldDateOptions;
|
|
51
|
+
/** Output only. The user who disabled this field. This value has no meaning when the field is not disabled. */
|
|
52
|
+
disabler?: GoogleAppsDriveLabelsV2UserInfo;
|
|
53
|
+
/** Output only. The time this field was disabled. This value has no meaning when the field is not disabled. */
|
|
54
|
+
disableTime?: string;
|
|
55
|
+
/** Output only. UI display hints for rendering a field. */
|
|
56
|
+
displayHints?: GoogleAppsDriveLabelsV2FieldDisplayHints;
|
|
57
|
+
/** Output only. The key of a field, unique within a label or library. This value is autogenerated. Matches the regex: `([a-zA-Z0-9])+` */
|
|
58
|
+
id?: string;
|
|
59
|
+
/** Integer field options. */
|
|
60
|
+
integerOptions?: GoogleAppsDriveLabelsV2FieldIntegerOptions;
|
|
61
|
+
/** Output only. The lifecycle of this field. */
|
|
62
|
+
lifecycle?: GoogleAppsDriveLabelsV2Lifecycle;
|
|
63
|
+
/** Output only. The LockStatus of this field. */
|
|
64
|
+
lockStatus?: GoogleAppsDriveLabelsV2LockStatus;
|
|
65
|
+
/** The basic properties of the field. */
|
|
66
|
+
properties?: GoogleAppsDriveLabelsV2FieldProperties;
|
|
67
|
+
/** Output only. The user who published this field. This value has no meaning when the field is not published. */
|
|
68
|
+
publisher?: GoogleAppsDriveLabelsV2UserInfo;
|
|
69
|
+
/** Output only. The key to use when constructing Drive search queries to find files based on values defined for this field on files. For example, "`{query_key}` > 2001-01-01". */
|
|
70
|
+
queryKey?: string;
|
|
71
|
+
/** Output only. The capabilities this user has when editing this field. */
|
|
72
|
+
schemaCapabilities?: GoogleAppsDriveLabelsV2FieldSchemaCapabilities;
|
|
73
|
+
/** Selection field options. */
|
|
74
|
+
selectionOptions?: GoogleAppsDriveLabelsV2FieldSelectionOptions;
|
|
75
|
+
/** Text field options. */
|
|
76
|
+
textOptions?: GoogleAppsDriveLabelsV2FieldTextOptions;
|
|
77
|
+
/** Output only. The user who modified this field. */
|
|
78
|
+
updater?: GoogleAppsDriveLabelsV2UserInfo;
|
|
79
|
+
/** Output only. The time this field was updated. */
|
|
80
|
+
updateTime?: string;
|
|
81
|
+
/** User field options. */
|
|
82
|
+
userOptions?: GoogleAppsDriveLabelsV2FieldUserOptions;
|
|
83
|
+
}
|
|
84
|
+
interface GoogleAppsDriveLabelsV2FieldAppliedCapabilities {
|
|
85
|
+
/** Whether the user can read related applied metadata on items. */
|
|
86
|
+
canRead?: boolean;
|
|
87
|
+
/** Whether the user can search for Drive items referencing this field. */
|
|
88
|
+
canSearch?: boolean;
|
|
89
|
+
/** Whether the user can set this field on Drive items. */
|
|
90
|
+
canWrite?: boolean;
|
|
91
|
+
}
|
|
92
|
+
interface GoogleAppsDriveLabelsV2FieldDateOptions {
|
|
93
|
+
/** Output only. ICU date format. */
|
|
94
|
+
dateFormat?: string;
|
|
95
|
+
/** Localized date formatting option. Field values are rendered in this format according to their locale. */
|
|
96
|
+
dateFormatType?: string;
|
|
97
|
+
/** Output only. Maximum valid value (year, month, day). */
|
|
98
|
+
maxValue?: GoogleTypeDate;
|
|
99
|
+
/** Output only. Minimum valid value (year, month, day). */
|
|
100
|
+
minValue?: GoogleTypeDate;
|
|
101
|
+
}
|
|
102
|
+
interface GoogleAppsDriveLabelsV2FieldDisplayHints {
|
|
103
|
+
/** Whether the field should be shown in the UI as disabled. */
|
|
104
|
+
disabled?: boolean;
|
|
105
|
+
/** This field should be hidden in the search menu when searching for Drive items. */
|
|
106
|
+
hiddenInSearch?: boolean;
|
|
107
|
+
/** Whether the field should be shown as required in the UI. */
|
|
108
|
+
required?: boolean;
|
|
109
|
+
/** This field should be shown in the apply menu when applying values to a Drive item. */
|
|
110
|
+
shownInApply?: boolean;
|
|
111
|
+
}
|
|
112
|
+
interface GoogleAppsDriveLabelsV2FieldIntegerOptions {
|
|
113
|
+
/** Output only. The maximum valid value for the integer field. */
|
|
114
|
+
maxValue?: string;
|
|
115
|
+
/** Output only. The minimum valid value for the integer field. */
|
|
116
|
+
minValue?: string;
|
|
117
|
+
}
|
|
118
|
+
interface GoogleAppsDriveLabelsV2FieldListOptions {
|
|
119
|
+
/** Maximum number of entries permitted. */
|
|
120
|
+
maxEntries?: number;
|
|
121
|
+
}
|
|
122
|
+
interface GoogleAppsDriveLabelsV2FieldProperties {
|
|
123
|
+
/** Required. The display text to show in the UI identifying this field. */
|
|
124
|
+
displayName?: string;
|
|
125
|
+
/** Input only. Insert or move this field before the indicated field. If empty, the field is placed at the end of the list. */
|
|
126
|
+
insertBeforeField?: string;
|
|
127
|
+
/** Whether the field should be marked as required. */
|
|
128
|
+
required?: boolean;
|
|
129
|
+
}
|
|
130
|
+
interface GoogleAppsDriveLabelsV2FieldSchemaCapabilities {
|
|
131
|
+
/** Whether the user can delete this field. The user must have permission and the field must be deprecated. */
|
|
132
|
+
canDelete?: boolean;
|
|
133
|
+
/** Whether the user can disable this field. The user must have permission and this field must not already be disabled. */
|
|
134
|
+
canDisable?: boolean;
|
|
135
|
+
/** Whether the user can enable this field. The user must have permission and this field must be disabled. */
|
|
136
|
+
canEnable?: boolean;
|
|
137
|
+
/** Whether the user can change this field. */
|
|
138
|
+
canUpdate?: boolean;
|
|
139
|
+
}
|
|
140
|
+
interface GoogleAppsDriveLabelsV2FieldSelectionOptions {
|
|
141
|
+
/** The options available for this selection field. The list order is consistent, and modified with `insert_before_choice`. */
|
|
142
|
+
choices?: GoogleAppsDriveLabelsV2FieldSelectionOptionsChoice[];
|
|
143
|
+
/** When specified, indicates this field supports a list of values. Once the field is published, this cannot be changed. */
|
|
144
|
+
listOptions?: GoogleAppsDriveLabelsV2FieldListOptions;
|
|
145
|
+
}
|
|
146
|
+
interface GoogleAppsDriveLabelsV2FieldSelectionOptionsChoice {
|
|
147
|
+
/** Output only. The capabilities related to this choice on applied metadata. */
|
|
148
|
+
appliedCapabilities?: GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceAppliedCapabilities;
|
|
149
|
+
/** Output only. The time this choice was created. */
|
|
150
|
+
createTime?: string;
|
|
151
|
+
/** Output only. The user who created this choice. */
|
|
152
|
+
creator?: GoogleAppsDriveLabelsV2UserInfo;
|
|
153
|
+
/** Output only. The user who disabled this choice. This value has no meaning when the option is not disabled. */
|
|
154
|
+
disabler?: GoogleAppsDriveLabelsV2UserInfo;
|
|
155
|
+
/** Output only. The time this choice was disabled. This value has no meaning when the choice is not disabled. */
|
|
156
|
+
disableTime?: string;
|
|
157
|
+
/** Output only. UI display hints for rendering a choice. */
|
|
158
|
+
displayHints?: GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceDisplayHints;
|
|
159
|
+
/** The unique value of the choice. This ID is autogenerated. Matches the regex: `([a-zA-Z0-9_])+`. */
|
|
160
|
+
id?: string;
|
|
161
|
+
/** Output only. Lifecycle of the choice. */
|
|
162
|
+
lifecycle?: GoogleAppsDriveLabelsV2Lifecycle;
|
|
163
|
+
/** Output only. The LockStatus of this choice. */
|
|
164
|
+
lockStatus?: GoogleAppsDriveLabelsV2LockStatus;
|
|
165
|
+
/** Basic properties of the choice. */
|
|
166
|
+
properties?: GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceProperties;
|
|
167
|
+
/** Output only. The user who published this choice. This value has no meaning when the choice is not published. */
|
|
168
|
+
publisher?: GoogleAppsDriveLabelsV2UserInfo;
|
|
169
|
+
/** Output only. The time this choice was published. This value has no meaning when the choice is not published. */
|
|
170
|
+
publishTime?: string;
|
|
171
|
+
/** Output only. The capabilities related to this option when editing the option. */
|
|
172
|
+
schemaCapabilities?: GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceSchemaCapabilities;
|
|
173
|
+
/** Output only. The user who updated this choice last. */
|
|
174
|
+
updater?: GoogleAppsDriveLabelsV2UserInfo;
|
|
175
|
+
/** Output only. The time this choice was updated last. */
|
|
176
|
+
updateTime?: string;
|
|
177
|
+
}
|
|
178
|
+
interface GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceAppliedCapabilities {
|
|
179
|
+
/** Whether the user can read related applied metadata on items. */
|
|
180
|
+
canRead?: boolean;
|
|
181
|
+
/** Whether the user can use this choice in search queries. */
|
|
182
|
+
canSearch?: boolean;
|
|
183
|
+
/** Whether the user can select this choice on an item. */
|
|
184
|
+
canSelect?: boolean;
|
|
185
|
+
}
|
|
186
|
+
interface GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceDisplayHints {
|
|
187
|
+
/** The colors to use for the badge. Changed to Google Material colors based on the chosen `properties.badge_config.color`. */
|
|
188
|
+
badgeColors?: GoogleAppsDriveLabelsV2BadgeColors;
|
|
189
|
+
/**
|
|
190
|
+
* The priority of this badge. Used to compare and sort between multiple badges. A lower number means the badge should be shown first. When a badging configuration is not present, this
|
|
191
|
+
* will be 0. Otherwise, this will be set to `BadgeConfig.priority_override` or the default heuristic which prefers creation date of the label, and field and option priority.
|
|
192
|
+
*/
|
|
193
|
+
badgePriority?: string;
|
|
194
|
+
/** The dark-mode color to use for the badge. Changed to Google Material colors based on the chosen `properties.badge_config.color`. */
|
|
195
|
+
darkBadgeColors?: GoogleAppsDriveLabelsV2BadgeColors;
|
|
196
|
+
/** Whether the option should be shown in the UI as disabled. */
|
|
197
|
+
disabled?: boolean;
|
|
198
|
+
/** This option should be hidden in the search menu when searching for Drive items. */
|
|
199
|
+
hiddenInSearch?: boolean;
|
|
200
|
+
/** This option should be shown in the apply menu when applying values to a Drive item. */
|
|
201
|
+
shownInApply?: boolean;
|
|
202
|
+
}
|
|
203
|
+
interface GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceProperties {
|
|
204
|
+
/** The badge configuration for this choice. When set, the label that owns this choice is considered a "badged label". */
|
|
205
|
+
badgeConfig?: GoogleAppsDriveLabelsV2BadgeConfig;
|
|
206
|
+
/** The description of this label. */
|
|
207
|
+
description?: string;
|
|
208
|
+
/** Required. The display text to show in the UI identifying this field. */
|
|
209
|
+
displayName?: string;
|
|
210
|
+
/** Input only. Insert or move this choice before the indicated choice. If empty, the choice is placed at the end of the list. */
|
|
211
|
+
insertBeforeChoice?: string;
|
|
212
|
+
}
|
|
213
|
+
interface GoogleAppsDriveLabelsV2FieldSelectionOptionsChoiceSchemaCapabilities {
|
|
214
|
+
/** Whether the user can delete this choice. */
|
|
215
|
+
canDelete?: boolean;
|
|
216
|
+
/** Whether the user can disable this choice. */
|
|
217
|
+
canDisable?: boolean;
|
|
218
|
+
/** Whether the user can enable this choice. */
|
|
219
|
+
canEnable?: boolean;
|
|
220
|
+
/** Whether the user can update this choice. */
|
|
221
|
+
canUpdate?: boolean;
|
|
222
|
+
}
|
|
223
|
+
interface GoogleAppsDriveLabelsV2FieldTextOptions {
|
|
224
|
+
/** Output only. The maximum valid length of values for the text field. */
|
|
225
|
+
maxLength?: number;
|
|
226
|
+
/** Output only. The minimum valid length of values for the text field. */
|
|
227
|
+
minLength?: number;
|
|
228
|
+
}
|
|
229
|
+
interface GoogleAppsDriveLabelsV2FieldUserOptions {
|
|
230
|
+
/** When specified, indicates that this field supports a list of values. Once the field is published, this cannot be changed. */
|
|
231
|
+
listOptions?: GoogleAppsDriveLabelsV2FieldListOptions;
|
|
232
|
+
}
|
|
233
|
+
interface GoogleAppsDriveLabelsV2Label {
|
|
234
|
+
/** Output only. The capabilities related to this label on applied metadata. */
|
|
235
|
+
appliedCapabilities?: GoogleAppsDriveLabelsV2LabelAppliedCapabilities;
|
|
236
|
+
/** Output only. Behavior of this label when it's applied to Drive items. */
|
|
237
|
+
appliedLabelPolicy?: GoogleAppsDriveLabelsV2LabelAppliedLabelPolicy;
|
|
238
|
+
/** Output only. The time this label was created. */
|
|
239
|
+
createTime?: string;
|
|
240
|
+
/** Output only. The user who created this label. */
|
|
241
|
+
creator?: GoogleAppsDriveLabelsV2UserInfo;
|
|
242
|
+
/** Output only. The user who disabled this label. This value has no meaning when the label is not disabled. */
|
|
243
|
+
disabler?: GoogleAppsDriveLabelsV2UserInfo;
|
|
244
|
+
/** Output only. The time this label was disabled. This value has no meaning when the label is not disabled. */
|
|
245
|
+
disableTime?: string;
|
|
246
|
+
/** Output only. UI display hints for rendering the label. */
|
|
247
|
+
displayHints?: GoogleAppsDriveLabelsV2LabelDisplayHints;
|
|
248
|
+
/** List of fields in descending priority order. */
|
|
249
|
+
fields?: GoogleAppsDriveLabelsV2Field[];
|
|
250
|
+
/**
|
|
251
|
+
* Output only. Globally unique identifier of this label. ID makes up part of the label `name`, but unlike `name`, ID is consistent between revisions. Matches the regex:
|
|
252
|
+
* `([a-zA-Z0-9])+`
|
|
253
|
+
*/
|
|
254
|
+
id?: string;
|
|
255
|
+
/** Required. The type of label. */
|
|
256
|
+
labelType?: string;
|
|
257
|
+
/** Custom URL to present to users to allow them to learn more about this label and how it should be used. */
|
|
258
|
+
learnMoreUri?: string;
|
|
259
|
+
/** Output only. The lifecycle state of the label including whether it's published, deprecated, and has draft changes. */
|
|
260
|
+
lifecycle?: GoogleAppsDriveLabelsV2Lifecycle;
|
|
261
|
+
/** Output only. The LockStatus of this label. */
|
|
262
|
+
lockStatus?: GoogleAppsDriveLabelsV2LockStatus;
|
|
263
|
+
/** Output only. Resource name of the label. Will be in the form of either: `labels/{id}` or `labels/{id}@{revision_id}` depending on the request. See `id` and `revision_id` below. */
|
|
264
|
+
name?: string;
|
|
265
|
+
/** Required. The basic properties of the label. */
|
|
266
|
+
properties?: GoogleAppsDriveLabelsV2LabelProperties;
|
|
267
|
+
/** Output only. The user who published this label. This value has no meaning when the label is not published. */
|
|
268
|
+
publisher?: GoogleAppsDriveLabelsV2UserInfo;
|
|
269
|
+
/** Output only. The time this label was published. This value has no meaning when the label is not published. */
|
|
270
|
+
publishTime?: string;
|
|
271
|
+
/** Output only. The time this label revision was created. */
|
|
272
|
+
revisionCreateTime?: string;
|
|
273
|
+
/** Output only. The user who created this label revision. */
|
|
274
|
+
revisionCreator?: GoogleAppsDriveLabelsV2UserInfo;
|
|
275
|
+
/**
|
|
276
|
+
* Output only. Revision ID of the label. Revision ID might be part of the label `name` depending on the request issued. A new revision is created whenever revisioned properties of a
|
|
277
|
+
* label are changed. Matches the regex: `([a-zA-Z0-9])+`
|
|
278
|
+
*/
|
|
279
|
+
revisionId?: string;
|
|
280
|
+
/** Output only. The capabilities the user has on this label. */
|
|
281
|
+
schemaCapabilities?: GoogleAppsDriveLabelsV2LabelSchemaCapabilities;
|
|
282
|
+
}
|
|
283
|
+
interface GoogleAppsDriveLabelsV2LabelAppliedCapabilities {
|
|
284
|
+
/** Whether the user can apply this label to items. */
|
|
285
|
+
canApply?: boolean;
|
|
286
|
+
/** Whether the user can read applied metadata related to this label. */
|
|
287
|
+
canRead?: boolean;
|
|
288
|
+
/** Whether the user can remove this label from items. */
|
|
289
|
+
canRemove?: boolean;
|
|
290
|
+
}
|
|
291
|
+
interface GoogleAppsDriveLabelsV2LabelAppliedLabelPolicy {
|
|
292
|
+
/** Indicates how the applied label and field values should be copied when a Drive item is copied. */
|
|
293
|
+
copyMode?: string;
|
|
294
|
+
}
|
|
295
|
+
interface GoogleAppsDriveLabelsV2LabelDisplayHints {
|
|
296
|
+
/** Whether the label should be shown in the UI as disabled. */
|
|
297
|
+
disabled?: boolean;
|
|
298
|
+
/** This label should be hidden in the search menu when searching for Drive items. */
|
|
299
|
+
hiddenInSearch?: boolean;
|
|
300
|
+
/** Order to display label in a list. */
|
|
301
|
+
priority?: string;
|
|
302
|
+
/** This label should be shown in the apply menu when applying values to a Drive item. */
|
|
303
|
+
shownInApply?: boolean;
|
|
304
|
+
}
|
|
305
|
+
interface GoogleAppsDriveLabelsV2LabelProperties {
|
|
306
|
+
/** The description of the label. */
|
|
307
|
+
description?: string;
|
|
308
|
+
/** Required. Title of the label. */
|
|
309
|
+
title?: string;
|
|
310
|
+
}
|
|
311
|
+
interface GoogleAppsDriveLabelsV2LabelSchemaCapabilities {
|
|
312
|
+
/** Whether the user can delete this label. The user must have permission and the label must be disabled. */
|
|
313
|
+
canDelete?: boolean;
|
|
314
|
+
/** Whether the user can disable this label. The user must have permission and this label must not already be disabled. */
|
|
315
|
+
canDisable?: boolean;
|
|
316
|
+
/** Whether the user can enable this label. The user must have permission and this label must be disabled. */
|
|
317
|
+
canEnable?: boolean;
|
|
318
|
+
/** Whether the user can change this label. */
|
|
319
|
+
canUpdate?: boolean;
|
|
320
|
+
}
|
|
321
|
+
interface GoogleAppsDriveLabelsV2Lifecycle {
|
|
322
|
+
/** The policy that governs how to show a disabled label, field, or selection choice. */
|
|
323
|
+
disabledPolicy?: GoogleAppsDriveLabelsV2LifecycleDisabledPolicy;
|
|
324
|
+
/** Output only. Whether the object associated with this lifecycle has unpublished changes. */
|
|
325
|
+
hasUnpublishedChanges?: boolean;
|
|
326
|
+
/** Output only. The state of the object associated with this lifecycle. */
|
|
327
|
+
state?: string;
|
|
328
|
+
}
|
|
329
|
+
interface GoogleAppsDriveLabelsV2LifecycleDisabledPolicy {
|
|
330
|
+
/**
|
|
331
|
+
* Whether to hide this disabled object in the search menu for Drive items. * When `false`, the object is generally shown in the UI as disabled but it appears in the search results
|
|
332
|
+
* when searching for Drive items. * When `true`, the object is generally hidden in the UI when searching for Drive items.
|
|
333
|
+
*/
|
|
334
|
+
hideInSearch?: boolean;
|
|
335
|
+
/**
|
|
336
|
+
* Whether to show this disabled object in the apply menu on Drive items. * When `true`, the object is generally shown in the UI as disabled and is unselectable. * When `false`, the
|
|
337
|
+
* object is generally hidden in the UI.
|
|
338
|
+
*/
|
|
339
|
+
showInApply?: boolean;
|
|
340
|
+
}
|
|
341
|
+
interface GoogleAppsDriveLabelsV2ListLabelsResponse {
|
|
342
|
+
/** Labels. */
|
|
343
|
+
labels?: GoogleAppsDriveLabelsV2Label[];
|
|
344
|
+
/** The token of the next page in the response. */
|
|
345
|
+
nextPageToken?: string;
|
|
346
|
+
}
|
|
347
|
+
interface GoogleAppsDriveLabelsV2LockStatus {
|
|
348
|
+
/**
|
|
349
|
+
* Output only. Indicates whether this label component is the (direct) target of a LabelLock. A label component can be implicitly locked even if it's not the direct target of a
|
|
350
|
+
* LabelLock, in which case this field is set to false.
|
|
351
|
+
*/
|
|
352
|
+
locked?: boolean;
|
|
353
|
+
}
|
|
354
|
+
interface GoogleAppsDriveLabelsV2UserInfo {
|
|
355
|
+
/** The identifier for this user that can be used with the People API to get more information. For example, people/12345678. */
|
|
356
|
+
person?: string;
|
|
357
|
+
}
|
|
358
|
+
interface GoogleTypeColor {
|
|
359
|
+
/**
|
|
360
|
+
* The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) *
|
|
361
|
+
* (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message
|
|
362
|
+
* rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color
|
|
363
|
+
* (as if the alpha value had been explicitly given a value of 1.0).
|
|
364
|
+
*/
|
|
365
|
+
alpha?: number;
|
|
366
|
+
/** The amount of blue in the color as a value in the interval [0, 1]. */
|
|
367
|
+
blue?: number;
|
|
368
|
+
/** The amount of green in the color as a value in the interval [0, 1]. */
|
|
369
|
+
green?: number;
|
|
370
|
+
/** The amount of red in the color as a value in the interval [0, 1]. */
|
|
371
|
+
red?: number;
|
|
372
|
+
}
|
|
373
|
+
interface GoogleTypeDate {
|
|
374
|
+
/** Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant. */
|
|
375
|
+
day?: number;
|
|
376
|
+
/** Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day. */
|
|
377
|
+
month?: number;
|
|
378
|
+
/** Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year. */
|
|
379
|
+
year?: number;
|
|
380
|
+
}
|
|
381
|
+
interface LabelsResource {
|
|
382
|
+
/**
|
|
383
|
+
* Get a label by its resource name. Resource name may be any of: * `labels/{id}` - See `labels/{id}@latest` * `labels/{id}@latest` - Gets the latest revision of the label. *
|
|
384
|
+
* `labels/{id}@published` - Gets the current published revision of the label. * `labels/{id}@{revision_id}` - Gets the label at the specified revision ID.
|
|
385
|
+
*/
|
|
386
|
+
get(request?: {
|
|
387
|
+
/** V1 error format. */
|
|
388
|
+
"$.xgafv"?: string;
|
|
389
|
+
/** OAuth access token. */
|
|
390
|
+
access_token?: string;
|
|
391
|
+
/** Data format for response. */
|
|
392
|
+
alt?: string;
|
|
393
|
+
/** JSONP */
|
|
394
|
+
callback?: string;
|
|
395
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
396
|
+
fields?: string;
|
|
397
|
+
/** 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. */
|
|
398
|
+
key?: string;
|
|
399
|
+
/** The BCP-47 language code to use for evaluating localized field labels. When not specified, values in the default configured language are used. */
|
|
400
|
+
languageCode?: string;
|
|
401
|
+
/** Required. Label resource name. May be any of: * `labels/{id}` (equivalent to labels/{id}@latest) * `labels/{id}@latest` * `labels/{id}@published` * `labels/{id}@{revision_id}` */
|
|
402
|
+
name: string;
|
|
403
|
+
/** OAuth 2.0 token for the current user. */
|
|
404
|
+
oauth_token?: string;
|
|
405
|
+
/** Returns response with indentations and line breaks. */
|
|
406
|
+
prettyPrint?: boolean;
|
|
407
|
+
/** 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. */
|
|
408
|
+
quotaUser?: string;
|
|
409
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
410
|
+
upload_protocol?: string;
|
|
411
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
412
|
+
uploadType?: string;
|
|
413
|
+
/** Set to `true` in order to use the user's admin credentials. The server verifies that the user is an admin for the label before allowing access. */
|
|
414
|
+
useAdminAccess?: boolean;
|
|
415
|
+
/** When specified, only certain fields belonging to the indicated view are returned. */
|
|
416
|
+
view?: string;
|
|
417
|
+
}): Request<GoogleAppsDriveLabelsV2Label>;
|
|
418
|
+
/** List labels. */
|
|
419
|
+
list(request?: {
|
|
420
|
+
/** V1 error format. */
|
|
421
|
+
"$.xgafv"?: string;
|
|
422
|
+
/** OAuth access token. */
|
|
423
|
+
access_token?: string;
|
|
424
|
+
/** Data format for response. */
|
|
425
|
+
alt?: string;
|
|
426
|
+
/** JSONP */
|
|
427
|
+
callback?: string;
|
|
428
|
+
/** Selector specifying which fields to include in a partial response. */
|
|
429
|
+
fields?: string;
|
|
430
|
+
/** 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. */
|
|
431
|
+
key?: string;
|
|
432
|
+
/** The BCP-47 language code to use for evaluating localized field labels. When not specified, values in the default configured language are used. */
|
|
433
|
+
languageCode?: string;
|
|
434
|
+
/** Specifies the level of access the user must have on the returned Labels. The minimum role a user must have on a label. Defaults to `READER`. */
|
|
435
|
+
minimumRole?: string;
|
|
436
|
+
/** OAuth 2.0 token for the current user. */
|
|
437
|
+
oauth_token?: string;
|
|
438
|
+
/** Maximum number of labels to return per page. Default: 50. Max: 200. */
|
|
439
|
+
pageSize?: number;
|
|
440
|
+
/** The token of the page to return. */
|
|
441
|
+
pageToken?: string;
|
|
442
|
+
/** Returns response with indentations and line breaks. */
|
|
443
|
+
prettyPrint?: boolean;
|
|
444
|
+
/**
|
|
445
|
+
* Whether to include only published labels in the results. * When `true`, only the current published label revisions are returned. Disabled labels are included. Returned label
|
|
446
|
+
* resource names reference the published revision (`labels/{id}/{revision_id}`). * When `false`, the current label revisions are returned, which might not be published. Returned
|
|
447
|
+
* label resource names don't reference a specific revision (`labels/{id}`).
|
|
448
|
+
*/
|
|
449
|
+
publishedOnly?: boolean;
|
|
450
|
+
/** 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. */
|
|
451
|
+
quotaUser?: string;
|
|
452
|
+
/** Upload protocol for media (e.g. "raw", "multipart"). */
|
|
453
|
+
upload_protocol?: string;
|
|
454
|
+
/** Legacy upload protocol for media (e.g. "media", "multipart"). */
|
|
455
|
+
uploadType?: string;
|
|
456
|
+
/** Set to `true` in order to use the user's admin credentials. This will return all Labels within the customer. */
|
|
457
|
+
useAdminAccess?: boolean;
|
|
458
|
+
/** When specified, only certain fields belonging to the indicated view are returned. */
|
|
459
|
+
view?: string;
|
|
460
|
+
}): Request<GoogleAppsDriveLabelsV2ListLabelsResponse>;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
const labels: LabelsResource;
|
|
464
|
+
}
|
|
465
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maxim_mazurok/gapi.client.drivelabels-v2",
|
|
3
|
+
"version": "0.0.20220920",
|
|
4
|
+
"description": "TypeScript typings for Drive Labels API v2",
|
|
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,57 @@
|
|
|
1
|
+
# TypeScript typings for Drive Labels API v2
|
|
2
|
+
|
|
3
|
+
An API for managing Drive Labels
|
|
4
|
+
For detailed description please check [documentation](https://developers.google.com/drive/labels).
|
|
5
|
+
|
|
6
|
+
## Installing
|
|
7
|
+
|
|
8
|
+
Install typings for Drive Labels API:
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
npm install @types/gapi.client.drivelabels-v2 --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://drivelabels.googleapis.com/$discovery/rest?version=v2', () => {
|
|
29
|
+
// now we can use:
|
|
30
|
+
// gapi.client.drivelabels
|
|
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('drivelabels', 'v2', () => {
|
|
37
|
+
// now we can use:
|
|
38
|
+
// gapi.client.drivelabels
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
After that you can use Drive Labels API resources: <!-- TODO: make this work for multiple namespaces -->
|
|
45
|
+
|
|
46
|
+
```typescript
|
|
47
|
+
|
|
48
|
+
/*
|
|
49
|
+
Get a label by its resource name. Resource name may be any of: * `labels/{id}` - See `labels/{id}@latest` * `labels/{id}@latest` - Gets the latest revision of the label. * `labels/{id}@published` - Gets the current published revision of the label. * `labels/{id}@{revision_id}` - Gets the label at the specified revision ID.
|
|
50
|
+
*/
|
|
51
|
+
await gapi.client.drivelabels.labels.get({ name: "name", });
|
|
52
|
+
|
|
53
|
+
/*
|
|
54
|
+
List labels.
|
|
55
|
+
*/
|
|
56
|
+
await gapi.client.drivelabels.labels.list({ });
|
|
57
|
+
```
|
package/tests.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/* This is stub file for gapi.client.drivelabels-v2 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: 20220920
|
|
7
|
+
|
|
8
|
+
gapi.load('client', async () => {
|
|
9
|
+
/** now we can use gapi.client */
|
|
10
|
+
|
|
11
|
+
await gapi.client.load('https://drivelabels.googleapis.com/$discovery/rest?version=v2');
|
|
12
|
+
/** now we can use gapi.client.drivelabels */
|
|
13
|
+
|
|
14
|
+
run();
|
|
15
|
+
|
|
16
|
+
async function run() {
|
|
17
|
+
/**
|
|
18
|
+
* Get a label by its resource name. Resource name may be any of: * `labels/{id}` - See `labels/{id}@latest` * `labels/{id}@latest` - Gets the latest revision of the label. *
|
|
19
|
+
* `labels/{id}@published` - Gets the current published revision of the label. * `labels/{id}@{revision_id}` - Gets the label at the specified revision ID.
|
|
20
|
+
*/
|
|
21
|
+
await gapi.client.drivelabels.labels.get({
|
|
22
|
+
languageCode: "Test string",
|
|
23
|
+
name: "Test string",
|
|
24
|
+
useAdminAccess: true,
|
|
25
|
+
view: "Test string",
|
|
26
|
+
});
|
|
27
|
+
/** List labels. */
|
|
28
|
+
await gapi.client.drivelabels.labels.list({
|
|
29
|
+
languageCode: "Test string",
|
|
30
|
+
minimumRole: "Test string",
|
|
31
|
+
pageSize: 42,
|
|
32
|
+
pageToken: "Test string",
|
|
33
|
+
publishedOnly: true,
|
|
34
|
+
useAdminAccess: true,
|
|
35
|
+
view: "Test string",
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
});
|
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
|
+
}
|