notebooklm 4.7.0

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.
@@ -0,0 +1,2068 @@
1
+ # frozen_string_literal: true
2
+
3
+ # @generated by scripts/build-ruby-client.mjs from deployment/docs/openapi.yaml
4
+ # — do not edit by hand. Run `npm run ruby:sync`.
5
+ #
6
+ # A hand-written client stops at the routes someone remembered. This one is
7
+ # the specification, so a new operation reaches a Ruby caller on the release
8
+ # that ships it.
9
+
10
+ module NotebookLM
11
+ # The root route is not wrapped in the success envelope: it is the server's own banner, and it lists every other route.
12
+ class ServerInfo < Model
13
+ # @return [String]
14
+ field :name, 'name'
15
+ # @return [String]
16
+ field :version, 'version'
17
+ # @return [String]
18
+ field :docs, 'docs'
19
+ # @return [Object]
20
+ field :endpoints, 'endpoints'
21
+ end
22
+
23
+ # The `GetHealthData` shape.
24
+ class GetHealthData < Model
25
+ # @return [String]
26
+ field :status, 'status'
27
+ # @return [Boolean]
28
+ field :authenticated, 'authenticated'
29
+ # @return [String]
30
+ field :notebook_url, 'notebook_url'
31
+ # @return [Integer]
32
+ field :active_sessions, 'active_sessions'
33
+ # @return [Integer]
34
+ field :max_sessions, 'max_sessions'
35
+ # @return [Integer]
36
+ field :session_timeout, 'session_timeout'
37
+ # @return [Integer]
38
+ field :total_messages, 'total_messages'
39
+ # @return [Boolean]
40
+ field :headless, 'headless'
41
+ # @return [Boolean]
42
+ field :auto_login_enabled, 'auto_login_enabled'
43
+ # @return [Boolean]
44
+ field :stealth_enabled, 'stealth_enabled'
45
+ # @return [String]
46
+ field :troubleshooting_tip, 'troubleshooting_tip'
47
+ end
48
+
49
+ # A UTCP manual, whose shape belongs to the client's own model rather than to this server. Every url is rebased onto the address the request arrived at.
50
+ class UtcpManual < Model
51
+ # @return [String]
52
+ field :utcp_version, 'utcp_version'
53
+ # @return [String]
54
+ field :manual_version, 'manual_version'
55
+ # @return [Array<UtcpManualToolsItem>]
56
+ field :tools, 'tools', type: 'UtcpManualToolsItem', array: true
57
+ end
58
+
59
+ # The `UtcpManualToolsItem` shape.
60
+ class UtcpManualToolsItem < Model
61
+ # @return [String]
62
+ field :name, 'name'
63
+ # @return [String]
64
+ field :description, 'description'
65
+ # @return [Object]
66
+ field :inputs, 'inputs'
67
+ # @return [Object]
68
+ field :outputs, 'outputs'
69
+ # @return [UtcpManualToolsItemToolCallTemplate]
70
+ field :tool_call_template, 'tool_call_template', type: 'UtcpManualToolsItemToolCallTemplate'
71
+ end
72
+
73
+ # The `UtcpManualToolsItemToolCallTemplate` shape.
74
+ class UtcpManualToolsItemToolCallTemplate < Model
75
+ # @return [String]
76
+ field :call_template_type, 'call_template_type'
77
+ # @return [String]
78
+ field :http_method, 'http_method'
79
+ # @return [String]
80
+ field :url, 'url'
81
+ # @return [String]
82
+ field :content_type, 'content_type'
83
+ # @return [String]
84
+ field :body_field, 'body_field'
85
+ # @return [UtcpManualToolsItemToolCallTemplateAuth]
86
+ field :auth, 'auth', type: 'UtcpManualToolsItemToolCallTemplateAuth'
87
+ end
88
+
89
+ # The `UtcpManualToolsItemToolCallTemplateAuth` shape.
90
+ class UtcpManualToolsItemToolCallTemplateAuth < Model
91
+ # @return [String]
92
+ field :auth_type, 'auth_type'
93
+ # @return [String]
94
+ field :api_key, 'api_key'
95
+ # @return [String]
96
+ field :var_name, 'var_name'
97
+ # @return [String]
98
+ field :location, 'location'
99
+ end
100
+
101
+ # The `SetupAuthData` shape.
102
+ class SetupAuthData < Model
103
+ # @return [String]
104
+ field :status, 'status'
105
+ # @return [String]
106
+ field :message, 'message'
107
+ end
108
+
109
+ # The `DeAuthData` shape.
110
+ class DeAuthData < Model
111
+ # @return [String]
112
+ field :status, 'status'
113
+ # @return [String]
114
+ field :message, 'message'
115
+ # @return [Boolean]
116
+ field :authenticated, 'authenticated'
117
+ end
118
+
119
+ # The `ReAuthData` shape.
120
+ class ReAuthData < Model
121
+ # @return [String]
122
+ field :status, 'status'
123
+ # @return [String]
124
+ field :message, 'message'
125
+ # @return [Boolean]
126
+ field :authenticated, 'authenticated'
127
+ # @return [Float]
128
+ field :duration_seconds, 'duration_seconds'
129
+ end
130
+
131
+ # The `AskQuestionData` shape.
132
+ class AskQuestionData < Model
133
+ # @return [String]
134
+ field :status, 'status'
135
+ # @return [String]
136
+ field :question, 'question'
137
+ # @return [String]
138
+ field :answer, 'answer'
139
+ # @return [String]
140
+ field :session_id, 'session_id'
141
+ # @return [String]
142
+ field :notebook_url, 'notebook_url'
143
+ # @return [AskQuestionDataSessionInfo]
144
+ field :session_info, 'session_info', type: 'AskQuestionDataSessionInfo'
145
+ # Present when the question asked for a source format other than `none`. The reference's second example, which its first does not show.
146
+ # @return [AskQuestionDataSources]
147
+ field :sources, 'sources', type: 'AskQuestionDataSources'
148
+ end
149
+
150
+ # The `AskQuestionDataSessionInfo` shape.
151
+ class AskQuestionDataSessionInfo < Model
152
+ # @return [Integer]
153
+ field :age_seconds, 'age_seconds'
154
+ # @return [Integer]
155
+ field :message_count, 'message_count'
156
+ # @return [Integer]
157
+ field :last_activity, 'last_activity'
158
+ end
159
+
160
+ # Present when the question asked for a source format other than `none`. The reference's second example, which its first does not show.
161
+ class AskQuestionDataSources < Model
162
+ # @return [String]
163
+ field :format, 'format'
164
+ # @return [Boolean]
165
+ field :extraction_success, 'extraction_success'
166
+ # @return [Array<AskQuestionDataSourcesCitationsItem>]
167
+ field :citations, 'citations', type: 'AskQuestionDataSourcesCitationsItem', array: true
168
+ end
169
+
170
+ # The `AskQuestionDataSourcesCitationsItem` shape.
171
+ class AskQuestionDataSourcesCitationsItem < Model
172
+ # @return [String]
173
+ field :marker, 'marker'
174
+ # @return [Integer]
175
+ field :number, 'number'
176
+ # The quoted passage. Empty when the citation resolved to a source with no excerpt — reported empty rather than filled with the filename.
177
+ # @return [String]
178
+ field :source_text, 'sourceText'
179
+ # @return [String, nil]
180
+ field :source_name, 'sourceName'
181
+ end
182
+
183
+ # The `ListNotebooksData` shape.
184
+ class ListNotebooksData < Model
185
+ # @return [Array<ListNotebooksDataNotebooksItem>]
186
+ field :notebooks, 'notebooks', type: 'ListNotebooksDataNotebooksItem', array: true
187
+ # @return [Integer]
188
+ field :count, 'count'
189
+ end
190
+
191
+ # The `ListNotebooksDataNotebooksItem` shape.
192
+ class ListNotebooksDataNotebooksItem < Model
193
+ # @return [String]
194
+ field :id, 'id'
195
+ # @return [String]
196
+ field :name, 'name'
197
+ # @return [String]
198
+ field :description, 'description'
199
+ # @return [String]
200
+ field :url, 'url'
201
+ # @return [Array<String>]
202
+ field :topics, 'topics', array: true
203
+ # @return [Array<String>]
204
+ field :use_cases, 'use_cases', array: true
205
+ # @return [Boolean]
206
+ field :active, 'active'
207
+ end
208
+
209
+ # The `AddNotebookData` shape.
210
+ class AddNotebookData < Model
211
+ # @return [AddNotebookDataNotebook]
212
+ field :notebook, 'notebook', type: 'AddNotebookDataNotebook'
213
+ end
214
+
215
+ # The `AddNotebookDataNotebook` shape.
216
+ class AddNotebookDataNotebook < Model
217
+ # @return [String]
218
+ field :id, 'id'
219
+ # @return [String]
220
+ field :name, 'name'
221
+ # @return [String]
222
+ field :description, 'description'
223
+ # @return [String]
224
+ field :url, 'url'
225
+ # @return [Array<String>]
226
+ field :topics, 'topics', array: true
227
+ # @return [Array<String>]
228
+ field :content_types, 'content_types', array: true
229
+ # @return [Array<String>]
230
+ field :use_cases, 'use_cases', array: true
231
+ # @return [String]
232
+ field :added_at, 'added_at'
233
+ # @return [String]
234
+ field :last_used, 'last_used'
235
+ # @return [Integer]
236
+ field :use_count, 'use_count'
237
+ # @return [Array<String>]
238
+ field :tags, 'tags', array: true
239
+ # @return [Boolean]
240
+ field :active, 'active'
241
+ end
242
+
243
+ # The `ListNotebooksFromNblmData` shape.
244
+ class ListNotebooksFromNblmData < Model
245
+ # @return [Array<ListNotebooksFromNblmDataNotebooksItem>]
246
+ field :notebooks, 'notebooks', type: 'ListNotebooksFromNblmDataNotebooksItem', array: true
247
+ # @return [Integer]
248
+ field :total, 'total'
249
+ # @return [String]
250
+ field :message, 'message'
251
+ end
252
+
253
+ # The `ListNotebooksFromNblmDataNotebooksItem` shape.
254
+ class ListNotebooksFromNblmDataNotebooksItem < Model
255
+ # @return [String]
256
+ field :id, 'id'
257
+ # @return [String]
258
+ field :name, 'name'
259
+ # @return [String]
260
+ field :url, 'url'
261
+ end
262
+
263
+ # The `ImportScrapedNotebooksData` shape.
264
+ class ImportScrapedNotebooksData < Model
265
+ # @return [Array<ImportScrapedNotebooksDataImportedItem>]
266
+ field :imported, 'imported', type: 'ImportScrapedNotebooksDataImportedItem', array: true
267
+ # @return [Array<ImportScrapedNotebooksDataErrorsItem>]
268
+ field :errors, 'errors', type: 'ImportScrapedNotebooksDataErrorsItem', array: true
269
+ # @return [Integer]
270
+ field :total_scraped, 'total_scraped'
271
+ # @return [Integer]
272
+ field :total_imported, 'total_imported'
273
+ # @return [Integer]
274
+ field :total_errors, 'total_errors'
275
+ end
276
+
277
+ # The `ImportScrapedNotebooksDataImportedItem` shape.
278
+ class ImportScrapedNotebooksDataImportedItem < Model
279
+ # @return [String]
280
+ field :id, 'id'
281
+ # @return [String]
282
+ field :name, 'name'
283
+ # @return [String]
284
+ field :status, 'status'
285
+ end
286
+
287
+ # The `ImportScrapedNotebooksDataErrorsItem` shape.
288
+ class ImportScrapedNotebooksDataErrorsItem < Model
289
+ # @return [String]
290
+ field :id, 'id'
291
+ # @return [String]
292
+ field :name, 'name'
293
+ # @return [String]
294
+ field :error, 'error'
295
+ end
296
+
297
+ # The `AutoDiscoverNotebookData` shape.
298
+ class AutoDiscoverNotebookData < Model
299
+ # @return [AutoDiscoverNotebookDataNotebook]
300
+ field :notebook, 'notebook', type: 'AutoDiscoverNotebookDataNotebook'
301
+ end
302
+
303
+ # The `AutoDiscoverNotebookDataNotebook` shape.
304
+ class AutoDiscoverNotebookDataNotebook < Model
305
+ # @return [String]
306
+ field :id, 'id'
307
+ # @return [String]
308
+ field :url, 'url'
309
+ # @return [String]
310
+ field :name, 'name'
311
+ # @return [String]
312
+ field :description, 'description'
313
+ # @return [Array<String>]
314
+ field :topics, 'topics', array: true
315
+ # @return [Array<String>]
316
+ field :content_types, 'content_types', array: true
317
+ # @return [Array<String>]
318
+ field :use_cases, 'use_cases', array: true
319
+ # @return [String]
320
+ field :added_at, 'added_at'
321
+ # @return [String]
322
+ field :last_used, 'last_used'
323
+ # @return [Integer]
324
+ field :use_count, 'use_count'
325
+ # @return [Boolean]
326
+ field :auto_generated, 'auto_generated'
327
+ end
328
+
329
+ # The `SearchNotebooksData` shape.
330
+ class SearchNotebooksData < Model
331
+ # @return [Array<SearchNotebooksDataNotebooksItem>]
332
+ field :notebooks, 'notebooks', type: 'SearchNotebooksDataNotebooksItem', array: true
333
+ end
334
+
335
+ # The `SearchNotebooksDataNotebooksItem` shape.
336
+ class SearchNotebooksDataNotebooksItem < Model
337
+ # @return [String]
338
+ field :id, 'id'
339
+ # @return [String]
340
+ field :url, 'url'
341
+ # @return [String]
342
+ field :name, 'name'
343
+ # @return [String]
344
+ field :description, 'description'
345
+ # @return [Array<String>]
346
+ field :topics, 'topics', array: true
347
+ # @return [Array<String>]
348
+ field :content_types, 'content_types', array: true
349
+ # @return [Array<String>]
350
+ field :use_cases, 'use_cases', array: true
351
+ # @return [String]
352
+ field :added_at, 'added_at'
353
+ # @return [String]
354
+ field :last_used, 'last_used'
355
+ # @return [Integer]
356
+ field :use_count, 'use_count'
357
+ end
358
+
359
+ # The `GetLibraryStatsData` shape.
360
+ class GetLibraryStatsData < Model
361
+ # @return [Integer]
362
+ field :total_notebooks, 'total_notebooks'
363
+ # @return [String, nil]
364
+ field :active_notebook_id, 'active_notebook_id'
365
+ # @return [Integer]
366
+ field :total_queries, 'total_queries'
367
+ # @return [GetLibraryStatsDataMostUsedNotebook]
368
+ field :most_used_notebook, 'most_used_notebook', type: 'GetLibraryStatsDataMostUsedNotebook'
369
+ # @return [Array<GetLibraryStatsDataRecentlyAddedItem>]
370
+ field :recently_added, 'recently_added', type: 'GetLibraryStatsDataRecentlyAddedItem', array: true
371
+ end
372
+
373
+ # The `GetLibraryStatsDataMostUsedNotebook` shape.
374
+ class GetLibraryStatsDataMostUsedNotebook < Model
375
+ # @return [String]
376
+ field :id, 'id'
377
+ # @return [String]
378
+ field :name, 'name'
379
+ # @return [Integer]
380
+ field :use_count, 'use_count'
381
+ end
382
+
383
+ # The `GetLibraryStatsDataRecentlyAddedItem` shape.
384
+ class GetLibraryStatsDataRecentlyAddedItem < Model
385
+ # @return [String]
386
+ field :id, 'id'
387
+ # @return [String]
388
+ field :name, 'name'
389
+ # @return [String]
390
+ field :added_at, 'added_at'
391
+ end
392
+
393
+ # The `DeleteNotebooksFromNblmData` shape.
394
+ class DeleteNotebooksFromNblmData < Model
395
+ # @return [Array<String>]
396
+ field :deleted, 'deleted', array: true
397
+ # @return [Array<String>]
398
+ field :failed, 'failed', array: true
399
+ # @return [String]
400
+ field :message, 'message'
401
+ end
402
+
403
+ # The `GetNotebookData` shape.
404
+ class GetNotebookData < Model
405
+ # @return [GetNotebookDataNotebook]
406
+ field :notebook, 'notebook', type: 'GetNotebookDataNotebook'
407
+ end
408
+
409
+ # The `GetNotebookDataNotebook` shape.
410
+ class GetNotebookDataNotebook < Model
411
+ # @return [String]
412
+ field :id, 'id'
413
+ # @return [String]
414
+ field :name, 'name'
415
+ # @return [String]
416
+ field :description, 'description'
417
+ # @return [String]
418
+ field :url, 'url'
419
+ # @return [Array<String>]
420
+ field :topics, 'topics', array: true
421
+ # @return [Boolean]
422
+ field :active, 'active'
423
+ end
424
+
425
+ # The `UpdateNotebookData` shape.
426
+ class UpdateNotebookData < Model
427
+ # @return [UpdateNotebookDataNotebook]
428
+ field :notebook, 'notebook', type: 'UpdateNotebookDataNotebook'
429
+ end
430
+
431
+ # The `UpdateNotebookDataNotebook` shape.
432
+ class UpdateNotebookDataNotebook < Model
433
+ # @return [String]
434
+ field :id, 'id'
435
+ # @return [String]
436
+ field :name, 'name'
437
+ # @return [String]
438
+ field :description, 'description'
439
+ # @return [Array<String>]
440
+ field :topics, 'topics', array: true
441
+ # @return [String]
442
+ field :last_modified, 'last_modified'
443
+ end
444
+
445
+ # The `RemoveNotebookData` shape.
446
+ class RemoveNotebookData < Model
447
+ # @return [String]
448
+ field :message, 'message'
449
+ # @return [String]
450
+ field :id, 'id'
451
+ end
452
+
453
+ # The `SelectNotebookData` shape.
454
+ class SelectNotebookData < Model
455
+ # @return [String]
456
+ field :message, 'message'
457
+ # @return [SelectNotebookDataNotebook]
458
+ field :notebook, 'notebook', type: 'SelectNotebookDataNotebook'
459
+ end
460
+
461
+ # The `SelectNotebookDataNotebook` shape.
462
+ class SelectNotebookDataNotebook < Model
463
+ # @return [String]
464
+ field :id, 'id'
465
+ # @return [String]
466
+ field :name, 'name'
467
+ # @return [String]
468
+ field :description, 'description'
469
+ # @return [String]
470
+ field :url, 'url'
471
+ # @return [Array<String>]
472
+ field :topics, 'topics', array: true
473
+ # @return [Boolean]
474
+ field :active, 'active'
475
+ # @return [String]
476
+ field :last_used, 'last_used'
477
+ end
478
+
479
+ # The `CreateNotebookData` shape.
480
+ class CreateNotebookData < Model
481
+ # @return [String]
482
+ field :notebook_url, 'notebook_url'
483
+ # @return [String]
484
+ field :name, 'name'
485
+ end
486
+
487
+ # The `ListSessionsData` shape.
488
+ class ListSessionsData < Model
489
+ # @return [Array<ListSessionsDataSessionsItem>]
490
+ field :sessions, 'sessions', type: 'ListSessionsDataSessionsItem', array: true
491
+ # @return [Integer]
492
+ field :count, 'count'
493
+ # @return [Integer]
494
+ field :max_sessions, 'max_sessions'
495
+ end
496
+
497
+ # The `ListSessionsDataSessionsItem` shape.
498
+ class ListSessionsDataSessionsItem < Model
499
+ # @return [String]
500
+ field :id, 'id'
501
+ # @return [String]
502
+ field :notebook_url, 'notebook_url'
503
+ # @return [Integer]
504
+ field :message_count, 'message_count'
505
+ # @return [Integer]
506
+ field :age_seconds, 'age_seconds'
507
+ # @return [Integer]
508
+ field :inactive_seconds, 'inactive_seconds'
509
+ # @return [Integer]
510
+ field :last_activity, 'last_activity'
511
+ end
512
+
513
+ # The `CloseSessionData` shape.
514
+ class CloseSessionData < Model
515
+ # @return [String]
516
+ field :message, 'message'
517
+ # @return [String]
518
+ field :session_id, 'session_id'
519
+ end
520
+
521
+ # The `ResetSessionData` shape.
522
+ class ResetSessionData < Model
523
+ # @return [String]
524
+ field :message, 'message'
525
+ # @return [String]
526
+ field :session_id, 'session_id'
527
+ # @return [Integer]
528
+ field :previous_message_count, 'previous_message_count'
529
+ end
530
+
531
+ # The `AddSourceData` shape.
532
+ class AddSourceData < Model
533
+ # @return [Boolean]
534
+ field :success, 'success'
535
+ # @return [String]
536
+ field :source_id, 'sourceId'
537
+ # @return [String]
538
+ field :source_name, 'sourceName'
539
+ # @return [String]
540
+ field :status, 'status'
541
+ end
542
+
543
+ # The `DeleteSourceData` shape.
544
+ class DeleteSourceData < Model
545
+ # @return [Boolean]
546
+ field :success, 'success'
547
+ # @return [String]
548
+ field :source_id, 'sourceId'
549
+ # @return [String]
550
+ field :source_name, 'sourceName'
551
+ end
552
+
553
+ # The `DeleteSourceByIdData` shape.
554
+ class DeleteSourceByIdData < Model
555
+ # @return [Boolean]
556
+ field :success, 'success'
557
+ # @return [String]
558
+ field :source_id, 'sourceId'
559
+ # @return [String]
560
+ field :source_name, 'sourceName'
561
+ end
562
+
563
+ # The `DeleteContentData` shape.
564
+ class DeleteContentData < Model
565
+ # @return [String]
566
+ field :notebook_id, 'notebookId'
567
+ # @return [String]
568
+ field :content_id, 'contentId'
569
+ # @return [Boolean]
570
+ field :deleted, 'deleted'
571
+ end
572
+
573
+ # The `ListSourcesData` shape.
574
+ class ListSourcesData < Model
575
+ # @return [String]
576
+ field :notebook_id, 'notebookId'
577
+ # @return [Integer]
578
+ field :count, 'count'
579
+ # @return [Array<ListSourcesDataSourcesItem>]
580
+ field :sources, 'sources', type: 'ListSourcesDataSourcesItem', array: true
581
+ end
582
+
583
+ # The `ListSourcesDataSourcesItem` shape.
584
+ class ListSourcesDataSourcesItem < Model
585
+ # @return [String]
586
+ field :id, 'id'
587
+ # @return [String]
588
+ field :title, 'title'
589
+ end
590
+
591
+ # The `ReadSourceData` shape.
592
+ class ReadSourceData < Model
593
+ # @return [String]
594
+ field :id, 'id'
595
+ # @return [String]
596
+ field :title, 'title'
597
+ # @return [String]
598
+ field :notebook_id, 'notebookId'
599
+ # @return [String]
600
+ field :format, 'format'
601
+ # @return [String]
602
+ field :content, 'content'
603
+ # @return [Integer]
604
+ field :total_chars, 'totalChars'
605
+ # @return [Integer]
606
+ field :page_chars, 'pageChars'
607
+ # @return [Integer]
608
+ field :offset, 'offset'
609
+ # @return [Boolean]
610
+ field :has_more, 'hasMore'
611
+ # @return [Integer, nil]
612
+ field :next_cursor, 'nextCursor'
613
+ # @return [String, nil]
614
+ field :continue, 'continue'
615
+ end
616
+
617
+ # The `RenameSourceData` shape.
618
+ class RenameSourceData < Model
619
+ # @return [String]
620
+ field :notebook_id, 'notebookId'
621
+ # @return [String]
622
+ field :source_id, 'sourceId'
623
+ # @return [String]
624
+ field :title, 'title'
625
+ end
626
+
627
+ # The `GetSourceGuideData` shape.
628
+ class GetSourceGuideData < Model
629
+ # @return [String]
630
+ field :notebook_id, 'notebookId'
631
+ # @return [String]
632
+ field :id, 'id'
633
+ # @return [String]
634
+ field :summary, 'summary'
635
+ # @return [Array<String>]
636
+ field :key_topics, 'keyTopics', array: true
637
+ end
638
+
639
+ # The `SearchPassagesData` shape.
640
+ class SearchPassagesData < Model
641
+ # @return [String]
642
+ field :notebook_id, 'notebookId'
643
+ # @return [String]
644
+ field :query, 'query'
645
+ # @return [Integer]
646
+ field :count, 'count'
647
+ # @return [Array<SearchPassagesDataPassagesItem>]
648
+ field :passages, 'passages', type: 'SearchPassagesDataPassagesItem', array: true
649
+ end
650
+
651
+ # The `SearchPassagesDataPassagesItem` shape.
652
+ class SearchPassagesDataPassagesItem < Model
653
+ # @return [String]
654
+ field :source_id, 'sourceId'
655
+ # @return [String]
656
+ field :text, 'text'
657
+ # @return [Integer]
658
+ field :rank, 'rank'
659
+ # @return [Integer, nil]
660
+ field :start, 'start'
661
+ # @return [Integer, nil]
662
+ field :end_value, 'end'
663
+ end
664
+
665
+ # The `GetNotebookSummaryData` shape.
666
+ class GetNotebookSummaryData < Model
667
+ # @return [String]
668
+ field :notebook_id, 'notebookId'
669
+ # @return [String]
670
+ field :summary, 'summary'
671
+ # @return [Array<GetNotebookSummaryDataSuggestedTopicsItem>]
672
+ field :suggested_topics, 'suggestedTopics', type: 'GetNotebookSummaryDataSuggestedTopicsItem', array: true
673
+ end
674
+
675
+ # The `GetNotebookSummaryDataSuggestedTopicsItem` shape.
676
+ class GetNotebookSummaryDataSuggestedTopicsItem < Model
677
+ # @return [String]
678
+ field :question, 'question'
679
+ # @return [String]
680
+ field :prompt, 'prompt'
681
+ end
682
+
683
+ # The `CheckSourceFreshnessData` shape.
684
+ class CheckSourceFreshnessData < Model
685
+ # @return [String]
686
+ field :notebook_id, 'notebookId'
687
+ # @return [Integer]
688
+ field :checked, 'checked'
689
+ # @return [Integer]
690
+ field :stale, 'stale'
691
+ # @return [Array<CheckSourceFreshnessDataSourcesItem>]
692
+ field :sources, 'sources', type: 'CheckSourceFreshnessDataSourcesItem', array: true
693
+ end
694
+
695
+ # The `CheckSourceFreshnessDataSourcesItem` shape.
696
+ class CheckSourceFreshnessDataSourcesItem < Model
697
+ # @return [String]
698
+ field :id, 'id'
699
+ # @return [String, nil]
700
+ field :stale, 'stale'
701
+ end
702
+
703
+ # The `GetChatHistoryData` shape.
704
+ class GetChatHistoryData < Model
705
+ # @return [String]
706
+ field :notebook_id, 'notebookId'
707
+ # @return [String]
708
+ field :conversation_id, 'conversationId'
709
+ # @return [Integer]
710
+ field :count, 'count'
711
+ # @return [Array<GetChatHistoryDataTurnsItem>]
712
+ field :turns, 'turns', type: 'GetChatHistoryDataTurnsItem', array: true
713
+ end
714
+
715
+ # The `GetChatHistoryDataTurnsItem` shape.
716
+ class GetChatHistoryDataTurnsItem < Model
717
+ # @return [String]
718
+ field :role, 'role'
719
+ # @return [String]
720
+ field :text, 'text'
721
+ end
722
+
723
+ # The `DeleteChatHistoryData` shape.
724
+ class DeleteChatHistoryData < Model
725
+ # @return [String]
726
+ field :notebook_id, 'notebookId'
727
+ # @return [String]
728
+ field :conversation_id, 'conversationId'
729
+ # @return [Boolean]
730
+ field :deleted, 'deleted'
731
+ end
732
+
733
+ # The `GetShareStatusData` shape.
734
+ class GetShareStatusData < Model
735
+ # @return [Boolean]
736
+ field :is_public, 'isPublic'
737
+ # @return [String]
738
+ field :public_link, 'publicLink'
739
+ # @return [Array<GetShareStatusDataCollaboratorsItem>]
740
+ field :collaborators, 'collaborators', type: 'GetShareStatusDataCollaboratorsItem', array: true
741
+ end
742
+
743
+ # The `GetShareStatusDataCollaboratorsItem` shape.
744
+ class GetShareStatusDataCollaboratorsItem < Model
745
+ # @return [String]
746
+ field :email, 'email'
747
+ # @return [String]
748
+ field :name, 'name'
749
+ end
750
+
751
+ # The `ShareNotebookData` shape.
752
+ class ShareNotebookData < Model
753
+ # @return [Boolean]
754
+ field :is_public, 'isPublic'
755
+ # @return [String]
756
+ field :public_link, 'publicLink'
757
+ # @return [Array<ShareNotebookDataCollaboratorsItem>]
758
+ field :collaborators, 'collaborators', type: 'ShareNotebookDataCollaboratorsItem', array: true
759
+ end
760
+
761
+ # The `ShareNotebookDataCollaboratorsItem` shape.
762
+ class ShareNotebookDataCollaboratorsItem < Model
763
+ # @return [String]
764
+ field :email, 'email'
765
+ # @return [String]
766
+ field :name, 'name'
767
+ end
768
+
769
+ # The `RetryContentData` shape.
770
+ class RetryContentData < Model
771
+ # @return [String]
772
+ field :notebook_id, 'notebookId'
773
+ # @return [String]
774
+ field :content_id, 'contentId'
775
+ # @return [String]
776
+ field :status, 'status'
777
+ # @return [Boolean]
778
+ field :retried, 'retried'
779
+ end
780
+
781
+ # The `ExportArtifactData` shape.
782
+ class ExportArtifactData < Model
783
+ # @return [String]
784
+ field :notebook_id, 'notebookId'
785
+ # @return [String]
786
+ field :artifact_id, 'artifactId'
787
+ # @return [String]
788
+ field :target, 'target'
789
+ # @return [String]
790
+ field :document_url, 'documentUrl'
791
+ end
792
+
793
+ # The `ReviseSlideData` shape.
794
+ class ReviseSlideData < Model
795
+ # @return [String]
796
+ field :notebook_id, 'notebookId'
797
+ # @return [String]
798
+ field :artifact_id, 'artifactId'
799
+ # @return [String]
800
+ field :status, 'status'
801
+ end
802
+
803
+ # The `ListLabelsData` shape.
804
+ class ListLabelsData < Model
805
+ # @return [Array<ListLabelsDataLabelsItem>]
806
+ field :labels, 'labels', type: 'ListLabelsDataLabelsItem', array: true
807
+ end
808
+
809
+ # The `ListLabelsDataLabelsItem` shape.
810
+ class ListLabelsDataLabelsItem < Model
811
+ # @return [String]
812
+ field :id, 'id'
813
+ # @return [String]
814
+ field :name, 'name'
815
+ # @return [String]
816
+ field :emoji, 'emoji'
817
+ # @return [Integer]
818
+ field :source_count, 'sourceCount'
819
+ end
820
+
821
+ # The `ManageLabelsData` shape.
822
+ class ManageLabelsData < Model
823
+ # @return [Array<ManageLabelsDataLabelsItem>]
824
+ field :labels, 'labels', type: 'ManageLabelsDataLabelsItem', array: true
825
+ end
826
+
827
+ # The `ManageLabelsDataLabelsItem` shape.
828
+ class ManageLabelsDataLabelsItem < Model
829
+ # @return [String]
830
+ field :id, 'id'
831
+ # @return [String]
832
+ field :name, 'name'
833
+ # @return [String]
834
+ field :emoji, 'emoji'
835
+ # @return [Integer]
836
+ field :source_count, 'sourceCount'
837
+ end
838
+
839
+ # The `GenerateStudyAidData` shape.
840
+ class GenerateStudyAidData < Model
841
+ # @return [String]
842
+ field :status, 'status'
843
+ # @return [String]
844
+ field :title, 'title'
845
+ # @return [String]
846
+ field :artifact_id, 'artifactId'
847
+ end
848
+
849
+ # The `GenerateMindMapData` shape.
850
+ class GenerateMindMapData < Model
851
+ # @return [String]
852
+ field :mind_map_id, 'mindMapId'
853
+ # @return [String]
854
+ field :title, 'title'
855
+ # @return [String]
856
+ field :json, 'json'
857
+ end
858
+
859
+ # The `ResearchSourcesData` shape.
860
+ class ResearchSourcesData < Model
861
+ # @return [String]
862
+ field :task_id, 'taskId'
863
+ # @return [Integer]
864
+ field :imported, 'imported'
865
+ # @return [Array<ResearchSourcesDataSourcesItem>]
866
+ field :sources, 'sources', type: 'ResearchSourcesDataSourcesItem', array: true
867
+ end
868
+
869
+ # The `ResearchSourcesDataSourcesItem` shape.
870
+ class ResearchSourcesDataSourcesItem < Model
871
+ # @return [String]
872
+ field :url, 'url'
873
+ # @return [String]
874
+ field :title, 'title'
875
+ # @return [String]
876
+ field :description, 'description'
877
+ end
878
+
879
+ # The `GenerateContentData` shape.
880
+ class GenerateContentData < Model
881
+ # @return [Boolean]
882
+ field :success, 'success'
883
+ # @return [String]
884
+ field :type, 'type'
885
+ # @return [String]
886
+ field :status, 'status'
887
+ # @return [String]
888
+ field :message, 'message'
889
+ end
890
+
891
+ # The `DownloadContentData` shape.
892
+ class DownloadContentData < Model
893
+ # @return [Boolean]
894
+ field :success, 'success'
895
+ # @return [String]
896
+ field :file_path, 'filePath'
897
+ # @return [String]
898
+ field :mime_type, 'mimeType'
899
+ # Present when the artifact was exported to Sheets.
900
+ # @return [String, nil]
901
+ field :google_sheets_url, 'googleSheetsUrl'
902
+ # Present when the artifact was exported to Slides.
903
+ # @return [String, nil]
904
+ field :google_slides_url, 'googleSlidesUrl'
905
+ end
906
+
907
+ # The `ListContentData` shape.
908
+ class ListContentData < Model
909
+ # @return [Array<ListContentDataSourcesItem>]
910
+ field :sources, 'sources', type: 'ListContentDataSourcesItem', array: true
911
+ # @return [Array<ListContentDataGeneratedContentItem>]
912
+ field :generated_content, 'generatedContent', type: 'ListContentDataGeneratedContentItem', array: true
913
+ # @return [Integer]
914
+ field :source_count, 'sourceCount'
915
+ # @return [Boolean]
916
+ field :has_audio_overview, 'hasAudioOverview'
917
+ end
918
+
919
+ # The `ListContentDataSourcesItem` shape.
920
+ class ListContentDataSourcesItem < Model
921
+ # @return [String]
922
+ field :id, 'id'
923
+ # @return [String]
924
+ field :name, 'name'
925
+ # @return [String]
926
+ field :type, 'type'
927
+ # @return [String]
928
+ field :status, 'status'
929
+ # @return [Integer]
930
+ field :passage_count, 'passageCount'
931
+ # @return [String]
932
+ field :added_at, 'addedAt'
933
+ end
934
+
935
+ # The `ListContentDataGeneratedContentItem` shape.
936
+ class ListContentDataGeneratedContentItem < Model
937
+ # @return [String]
938
+ field :id, 'id'
939
+ # @return [String]
940
+ field :type, 'type'
941
+ # @return [String]
942
+ field :name, 'name'
943
+ # @return [String]
944
+ field :status, 'status'
945
+ # @return [String]
946
+ field :created_at, 'createdAt'
947
+ # @return [Integer]
948
+ field :duration, 'duration'
949
+ # @return [String]
950
+ field :url, 'url'
951
+ # @return [String]
952
+ field :content, 'content'
953
+ end
954
+
955
+ # The `CreateNoteData` shape.
956
+ class CreateNoteData < Model
957
+ # @return [Boolean]
958
+ field :success, 'success'
959
+ # @return [String]
960
+ field :note_title, 'noteTitle'
961
+ # @return [String]
962
+ field :status, 'status'
963
+ end
964
+
965
+ # The `SaveChatToNoteData` shape.
966
+ class SaveChatToNoteData < Model
967
+ # @return [Boolean]
968
+ field :success, 'success'
969
+ # @return [String]
970
+ field :note_title, 'noteTitle'
971
+ # @return [String]
972
+ field :status, 'status'
973
+ end
974
+
975
+ # The `ConvertNoteToSourceData` shape.
976
+ class ConvertNoteToSourceData < Model
977
+ # @return [Boolean]
978
+ field :success, 'success'
979
+ # @return [String]
980
+ field :note_title, 'noteTitle'
981
+ # @return [String]
982
+ field :status, 'status'
983
+ end
984
+
985
+ # The `BatchToVaultData` shape.
986
+ class BatchToVaultData < Model
987
+ # @return [String]
988
+ field :vault_dir, 'vault_dir'
989
+ # @return [Integer]
990
+ field :total, 'total'
991
+ # @return [Integer]
992
+ field :succeeded, 'succeeded'
993
+ # @return [Integer]
994
+ field :failed, 'failed'
995
+ # @return [String]
996
+ field :session_id, 'session_id'
997
+ # @return [BatchToVaultDataNotebook]
998
+ field :notebook, 'notebook', type: 'BatchToVaultDataNotebook'
999
+ # @return [Array<BatchToVaultDataFilesItem>]
1000
+ field :files, 'files', type: 'BatchToVaultDataFilesItem', array: true
1001
+ end
1002
+
1003
+ # The `BatchToVaultDataNotebook` shape.
1004
+ class BatchToVaultDataNotebook < Model
1005
+ # @return [String]
1006
+ field :id, 'id'
1007
+ # @return [String]
1008
+ field :url, 'url'
1009
+ end
1010
+
1011
+ # The `BatchToVaultDataFilesItem` shape.
1012
+ class BatchToVaultDataFilesItem < Model
1013
+ # @return [String]
1014
+ field :question, 'question'
1015
+ # @return [String]
1016
+ field :md_path, 'md_path'
1017
+ # @return [String]
1018
+ field :json_path, 'json_path'
1019
+ # @return [Boolean]
1020
+ field :success, 'success'
1021
+ # @return [Integer]
1022
+ field :citations_count, 'citations_count'
1023
+ end
1024
+
1025
+ # The `ListNotesData` shape.
1026
+ class ListNotesData < Model
1027
+ # @return [Boolean]
1028
+ field :success, 'success'
1029
+ # @return [Array<ListNotesDataNotesItem>]
1030
+ field :notes, 'notes', type: 'ListNotesDataNotesItem', array: true
1031
+ end
1032
+
1033
+ # The `ListNotesDataNotesItem` shape.
1034
+ class ListNotesDataNotesItem < Model
1035
+ # @return [String]
1036
+ field :id, 'id'
1037
+ # @return [String]
1038
+ field :title, 'title'
1039
+ # @return [String]
1040
+ field :details, 'details'
1041
+ end
1042
+
1043
+ # The `GetNoteData` shape.
1044
+ class GetNoteData < Model
1045
+ # @return [Boolean]
1046
+ field :success, 'success'
1047
+ # @return [String]
1048
+ field :title, 'title'
1049
+ # @return [String]
1050
+ field :content, 'content'
1051
+ end
1052
+
1053
+ # The `CleanupDataData` shape.
1054
+ class CleanupDataData < Model
1055
+ # @return [String]
1056
+ field :message, 'message'
1057
+ # @return [Integer]
1058
+ field :files_deleted, 'files_deleted'
1059
+ # @return [Float]
1060
+ field :space_freed_mb, 'space_freed_mb'
1061
+ # @return [Boolean]
1062
+ field :library_preserved, 'library_preserved'
1063
+ end
1064
+
1065
+ # Every operation of the server's REST API.
1066
+ #
1067
+ # Included into {Client}, so these are called on a client rather than used
1068
+ # directly. They are listed here so that the documentation of the plumbing
1069
+ # and the documentation of the API stay separate things.
1070
+ module Operations
1071
+ # Every operation id, in specification order. The server exposes
1072
+ # 56 of them.
1073
+ OPERATION_IDS = %w[
1074
+ get_server_info
1075
+ get_health
1076
+ get_utcp_manual
1077
+ setup_auth
1078
+ de_auth
1079
+ re_auth
1080
+ ask_question
1081
+ list_notebooks
1082
+ add_notebook
1083
+ list_notebooks_from_nblm
1084
+ import_scraped_notebooks
1085
+ auto_discover_notebook
1086
+ search_notebooks
1087
+ get_library_stats
1088
+ delete_notebooks_from_nblm
1089
+ get_notebook
1090
+ update_notebook
1091
+ remove_notebook
1092
+ select_notebook
1093
+ create_notebook
1094
+ list_sessions
1095
+ close_session
1096
+ reset_session
1097
+ add_source
1098
+ delete_source
1099
+ delete_source_by_id
1100
+ delete_content
1101
+ list_sources
1102
+ read_source
1103
+ rename_source
1104
+ get_source_guide
1105
+ search_passages
1106
+ get_notebook_summary
1107
+ check_source_freshness
1108
+ get_chat_history
1109
+ delete_chat_history
1110
+ get_share_status
1111
+ share_notebook
1112
+ retry_content
1113
+ export_artifact
1114
+ revise_slide
1115
+ list_labels
1116
+ manage_labels
1117
+ generate_study_aid
1118
+ generate_mind_map
1119
+ research_sources
1120
+ generate_content
1121
+ download_content
1122
+ list_content
1123
+ create_note
1124
+ save_chat_to_note
1125
+ convert_note_to_source
1126
+ batch_to_vault
1127
+ list_notes
1128
+ get_note
1129
+ cleanup_data
1130
+ ].freeze
1131
+
1132
+ # Server identity, version, and a pointer to the docs
1133
+ #
1134
+ # `GET /`
1135
+ #
1136
+ # @return [ServerInfo]
1137
+ # @raise [NotebookLM::Refused] when the server declines the request
1138
+ def get_server_info
1139
+ payload = call('get_server_info', :get, '/', enveloped: false)
1140
+ ServerInfo.new(payload)
1141
+ end
1142
+
1143
+ # Server health check
1144
+ #
1145
+ # `GET /health`
1146
+ #
1147
+ # @return [GetHealthData]
1148
+ # @raise [NotebookLM::Refused] when the server declines the request
1149
+ def get_health
1150
+ payload = call('get_health', :get, '/health')
1151
+ GetHealthData.new(payload)
1152
+ end
1153
+
1154
+ # UTCP tool manual for this server
1155
+ #
1156
+ # The manual a Universal Tool Calling Protocol client reads before
1157
+ # calling anything. UTCP has no protocol server: the client reads this
1158
+ # once and then calls the routes below natively, so the manual is a
1159
+ # description of this same API rather than a second way into it.
1160
+ #
1161
+ # Generated from this specification, with the call addresses rebased on
1162
+ # the address the request arrived at. The same document is published
1163
+ # statically at `/utcp.json` on the documentation site. Behind the token
1164
+ # guard like every route but `/health`.
1165
+ #
1166
+ # `GET /utcp`
1167
+ #
1168
+ # @return [UtcpManual]
1169
+ # @raise [NotebookLM::Refused] when the server declines the request
1170
+ def get_utcp_manual
1171
+ payload = call('get_utcp_manual', :get, '/utcp', enveloped: false)
1172
+ UtcpManual.new(payload)
1173
+ end
1174
+
1175
+ # First-time Google authentication (opens visible browser)
1176
+ #
1177
+ # `POST /setup-auth`
1178
+ #
1179
+ # @param show_browser [Boolean, nil]
1180
+ # @param account [String, nil]
1181
+ # @return [SetupAuthData]
1182
+ # @raise [NotebookLM::Refused] when the server declines the request
1183
+ def setup_auth(show_browser: nil, account: nil)
1184
+ body = {}
1185
+ body['show_browser'] = show_browser unless show_browser.nil?
1186
+ body['account'] = account unless account.nil?
1187
+ payload = call('setup_auth', :post, '/setup-auth', body: body)
1188
+ SetupAuthData.new(payload)
1189
+ end
1190
+
1191
+ # Logout, clear all credentials
1192
+ #
1193
+ # `POST /de-auth`
1194
+ #
1195
+ # @return [DeAuthData]
1196
+ # @raise [NotebookLM::Refused] when the server declines the request
1197
+ def de_auth
1198
+ payload = call('de_auth', :post, '/de-auth')
1199
+ DeAuthData.new(payload)
1200
+ end
1201
+
1202
+ # Re-authenticate or switch account
1203
+ #
1204
+ # `POST /re-auth`
1205
+ #
1206
+ # @param account [String, nil]
1207
+ # @return [ReAuthData]
1208
+ # @raise [NotebookLM::Refused] when the server declines the request
1209
+ def re_auth(account: nil)
1210
+ body = {}
1211
+ body['account'] = account unless account.nil?
1212
+ payload = call('re_auth', :post, '/re-auth', body: body)
1213
+ ReAuthData.new(payload)
1214
+ end
1215
+
1216
+ # Ask a question with citation-backed response
1217
+ #
1218
+ # `POST /ask`
1219
+ #
1220
+ # @param question [String]
1221
+ # @param notebook_id [String, nil]
1222
+ # @param notebook_url [String, nil]
1223
+ # @param session_id [String, nil]
1224
+ # @param source_format [String, nil]
1225
+ # @param show_browser [Boolean, nil]
1226
+ # @return [AskQuestionData]
1227
+ # @raise [NotebookLM::Refused] when the server declines the request
1228
+ def ask_question(question:, notebook_id: nil, notebook_url: nil, session_id: nil, source_format: nil, show_browser: nil)
1229
+ body = {}
1230
+ body['question'] = question
1231
+ body['notebook_id'] = notebook_id unless notebook_id.nil?
1232
+ body['notebook_url'] = notebook_url unless notebook_url.nil?
1233
+ body['session_id'] = session_id unless session_id.nil?
1234
+ body['source_format'] = source_format unless source_format.nil?
1235
+ body['show_browser'] = show_browser unless show_browser.nil?
1236
+ payload = call('ask_question', :post, '/ask', body: body)
1237
+ AskQuestionData.new(payload)
1238
+ end
1239
+
1240
+ # List all notebooks in the local library
1241
+ #
1242
+ # `GET /notebooks`
1243
+ #
1244
+ # @return [ListNotebooksData]
1245
+ # @raise [NotebookLM::Refused] when the server declines the request
1246
+ def list_notebooks
1247
+ payload = call('list_notebooks', :get, '/notebooks')
1248
+ ListNotebooksData.new(payload)
1249
+ end
1250
+
1251
+ # Manually add a notebook to the library
1252
+ #
1253
+ # `POST /notebooks`
1254
+ #
1255
+ # @param id [String]
1256
+ # @param name [String]
1257
+ # @param url [String]
1258
+ # @param description [String, nil]
1259
+ # @param topics [Array<String>, nil]
1260
+ # @return [AddNotebookData]
1261
+ # @raise [NotebookLM::Refused] when the server declines the request
1262
+ def add_notebook(id:, name:, url:, description: nil, topics: nil)
1263
+ body = {}
1264
+ body['id'] = id
1265
+ body['name'] = name
1266
+ body['url'] = url
1267
+ body['description'] = description unless description.nil?
1268
+ body['topics'] = topics unless topics.nil?
1269
+ payload = call('add_notebook', :post, '/notebooks', body: body)
1270
+ AddNotebookData.new(payload)
1271
+ end
1272
+
1273
+ # Scrape all notebooks from NotebookLM UI
1274
+ #
1275
+ # `GET /notebooks/scrape`
1276
+ #
1277
+ # @return [ListNotebooksFromNblmData]
1278
+ # @raise [NotebookLM::Refused] when the server declines the request
1279
+ def list_notebooks_from_nblm
1280
+ payload = call('list_notebooks_from_nblm', :get, '/notebooks/scrape')
1281
+ ListNotebooksFromNblmData.new(payload)
1282
+ end
1283
+
1284
+ # Bulk import scraped notebooks into local library
1285
+ #
1286
+ # `POST /notebooks/import-from-scrape`
1287
+ #
1288
+ # @return [ImportScrapedNotebooksData]
1289
+ # @raise [NotebookLM::Refused] when the server declines the request
1290
+ def import_scraped_notebooks
1291
+ payload = call('import_scraped_notebooks', :post, '/notebooks/import-from-scrape')
1292
+ ImportScrapedNotebooksData.new(payload)
1293
+ end
1294
+
1295
+ # Generate notebook metadata autonomously via NotebookLM queries
1296
+ #
1297
+ # `POST /notebooks/auto-discover`
1298
+ #
1299
+ # @param notebook_id [String, nil]
1300
+ # @param notebook_url [String, nil]
1301
+ # @return [AutoDiscoverNotebookData]
1302
+ # @raise [NotebookLM::Refused] when the server declines the request
1303
+ def auto_discover_notebook(notebook_id: nil, notebook_url: nil)
1304
+ body = {}
1305
+ body['notebook_id'] = notebook_id unless notebook_id.nil?
1306
+ body['notebook_url'] = notebook_url unless notebook_url.nil?
1307
+ payload = call('auto_discover_notebook', :post, '/notebooks/auto-discover', body: body)
1308
+ AutoDiscoverNotebookData.new(payload)
1309
+ end
1310
+
1311
+ # Search the local library by keyword
1312
+ #
1313
+ # `GET /notebooks/search`
1314
+ #
1315
+ # @param q [String, nil]
1316
+ # @return [SearchNotebooksData]
1317
+ # @raise [NotebookLM::Refused] when the server declines the request
1318
+ def search_notebooks(q: nil)
1319
+ query = {}
1320
+ query['q'] = q unless q.nil?
1321
+ payload = call('search_notebooks', :get, '/notebooks/search', query: query)
1322
+ SearchNotebooksData.new(payload)
1323
+ end
1324
+
1325
+ # Library statistics
1326
+ #
1327
+ # `GET /notebooks/stats`
1328
+ #
1329
+ # @return [GetLibraryStatsData]
1330
+ # @raise [NotebookLM::Refused] when the server declines the request
1331
+ def get_library_stats
1332
+ payload = call('get_library_stats', :get, '/notebooks/stats')
1333
+ GetLibraryStatsData.new(payload)
1334
+ end
1335
+
1336
+ # Delete multiple notebooks at once
1337
+ #
1338
+ # `DELETE /notebooks/bulk-delete`
1339
+ #
1340
+ # @param ids [Array<String>, nil]
1341
+ # @return [DeleteNotebooksFromNblmData]
1342
+ # @raise [NotebookLM::Refused] when the server declines the request
1343
+ def delete_notebooks_from_nblm(ids: nil)
1344
+ body = {}
1345
+ body['ids'] = ids unless ids.nil?
1346
+ payload = call('delete_notebooks_from_nblm', :delete, '/notebooks/bulk-delete', body: body)
1347
+ DeleteNotebooksFromNblmData.new(payload)
1348
+ end
1349
+
1350
+ # Get notebook details
1351
+ #
1352
+ # `GET /notebooks/{id}`
1353
+ #
1354
+ # @param id [String]
1355
+ # @return [GetNotebookData]
1356
+ # @raise [NotebookLM::Refused] when the server declines the request
1357
+ def get_notebook(id:)
1358
+ payload = call('get_notebook', :get, "/notebooks/#{id}")
1359
+ GetNotebookData.new(payload)
1360
+ end
1361
+
1362
+ # Update notebook metadata
1363
+ #
1364
+ # `PUT /notebooks/{id}`
1365
+ #
1366
+ # @param id [String]
1367
+ # @return [UpdateNotebookData]
1368
+ # @raise [NotebookLM::Refused] when the server declines the request
1369
+ def update_notebook(id:)
1370
+ payload = call('update_notebook', :put, "/notebooks/#{id}")
1371
+ UpdateNotebookData.new(payload)
1372
+ end
1373
+
1374
+ # Delete a notebook from the library
1375
+ #
1376
+ # `DELETE /notebooks/{id}`
1377
+ #
1378
+ # @param id [String]
1379
+ # @return [RemoveNotebookData]
1380
+ # @raise [NotebookLM::Refused] when the server declines the request
1381
+ def remove_notebook(id:)
1382
+ payload = call('remove_notebook', :delete, "/notebooks/#{id}")
1383
+ RemoveNotebookData.new(payload)
1384
+ end
1385
+
1386
+ # Set notebook as the default active notebook
1387
+ #
1388
+ # `PUT /notebooks/{id}/activate`
1389
+ #
1390
+ # @param id [String]
1391
+ # @return [SelectNotebookData]
1392
+ # @raise [NotebookLM::Refused] when the server declines the request
1393
+ def select_notebook(id:)
1394
+ payload = call('select_notebook', :put, "/notebooks/#{id}/activate")
1395
+ SelectNotebookData.new(payload)
1396
+ end
1397
+
1398
+ # Create a new notebook in NotebookLM
1399
+ #
1400
+ # `POST /notebooks/create`
1401
+ #
1402
+ # @param name [String, nil]
1403
+ # @param description [String, nil]
1404
+ # @return [CreateNotebookData]
1405
+ # @raise [NotebookLM::Refused] when the server declines the request
1406
+ def create_notebook(name: nil, description: nil)
1407
+ body = {}
1408
+ body['name'] = name unless name.nil?
1409
+ body['description'] = description unless description.nil?
1410
+ payload = call('create_notebook', :post, '/notebooks/create', body: body)
1411
+ CreateNotebookData.new(payload)
1412
+ end
1413
+
1414
+ # List active sessions
1415
+ #
1416
+ # `GET /sessions`
1417
+ #
1418
+ # @return [ListSessionsData]
1419
+ # @raise [NotebookLM::Refused] when the server declines the request
1420
+ def list_sessions
1421
+ payload = call('list_sessions', :get, '/sessions')
1422
+ ListSessionsData.new(payload)
1423
+ end
1424
+
1425
+ # Close a session
1426
+ #
1427
+ # `DELETE /sessions/{id}`
1428
+ #
1429
+ # @param id [String]
1430
+ # @return [CloseSessionData]
1431
+ # @raise [NotebookLM::Refused] when the server declines the request
1432
+ def close_session(id:)
1433
+ payload = call('close_session', :delete, "/sessions/#{id}")
1434
+ CloseSessionData.new(payload)
1435
+ end
1436
+
1437
+ # Reset a session's history
1438
+ #
1439
+ # `POST /sessions/{id}/reset`
1440
+ #
1441
+ # @param id [String]
1442
+ # @return [ResetSessionData]
1443
+ # @raise [NotebookLM::Refused] when the server declines the request
1444
+ def reset_session(id:)
1445
+ payload = call('reset_session', :post, "/sessions/#{id}/reset")
1446
+ ResetSessionData.new(payload)
1447
+ end
1448
+
1449
+ # Add a source (file, url, text, youtube, drive) to the active notebook
1450
+ #
1451
+ # `POST /content/sources`
1452
+ #
1453
+ # @param source_type [String]
1454
+ # @param file_path [String, nil]
1455
+ # @param url [String, nil]
1456
+ # @param text [String, nil]
1457
+ # @param title [String, nil]
1458
+ # @param notebook_url [String, nil]
1459
+ # @param session_id [String, nil]
1460
+ # @return [AddSourceData]
1461
+ # @raise [NotebookLM::Refused] when the server declines the request
1462
+ def add_source(source_type:, file_path: nil, url: nil, text: nil, title: nil, notebook_url: nil, session_id: nil)
1463
+ body = {}
1464
+ body['source_type'] = source_type
1465
+ body['file_path'] = file_path unless file_path.nil?
1466
+ body['url'] = url unless url.nil?
1467
+ body['text'] = text unless text.nil?
1468
+ body['title'] = title unless title.nil?
1469
+ body['notebook_url'] = notebook_url unless notebook_url.nil?
1470
+ body['session_id'] = session_id unless session_id.nil?
1471
+ payload = call('add_source', :post, '/content/sources', body: body)
1472
+ AddSourceData.new(payload)
1473
+ end
1474
+
1475
+ # Delete source by name (query parameter)
1476
+ #
1477
+ # `DELETE /content/sources`
1478
+ #
1479
+ # @param name [String, nil]
1480
+ # @return [DeleteSourceData]
1481
+ # @raise [NotebookLM::Refused] when the server declines the request
1482
+ def delete_source(name: nil)
1483
+ query = {}
1484
+ query['name'] = name unless name.nil?
1485
+ payload = call('delete_source', :delete, '/content/sources', query: query)
1486
+ DeleteSourceData.new(payload)
1487
+ end
1488
+
1489
+ # Delete source by id
1490
+ #
1491
+ # `DELETE /content/sources/{id}`
1492
+ #
1493
+ # @param id [String]
1494
+ # @return [DeleteSourceByIdData]
1495
+ # @raise [NotebookLM::Refused] when the server declines the request
1496
+ def delete_source_by_id(id:)
1497
+ payload = call('delete_source_by_id', :delete, "/content/sources/#{id}")
1498
+ DeleteSourceByIdData.new(payload)
1499
+ end
1500
+
1501
+ # Delete a generated Studio artifact
1502
+ #
1503
+ # RPC-backed (no browser). Irreversible. Note-backed mind maps are not
1504
+ # covered — they live in the notes system, not the Studio library.
1505
+ #
1506
+ # `DELETE /content/{contentId}`
1507
+ #
1508
+ # @param content_id [String]
1509
+ # @param notebook_url [String, nil]
1510
+ # @param notebook_id [String, nil]
1511
+ # @return [DeleteContentData]
1512
+ # @raise [NotebookLM::Refused] when the server declines the request
1513
+ def delete_content(content_id:, notebook_url: nil, notebook_id: nil)
1514
+ query = {}
1515
+ query['notebook_url'] = notebook_url unless notebook_url.nil?
1516
+ query['notebook_id'] = notebook_id unless notebook_id.nil?
1517
+ payload = call('delete_content', :delete, "/content/#{content_id}", query: query)
1518
+ DeleteContentData.new(payload)
1519
+ end
1520
+
1521
+ # List a notebook's sources with their ids and titles
1522
+ #
1523
+ # RPC-backed (no browser). Returns `{ notebookId, count, sources: [{ id, title }] }`.
1524
+ # This is where the source ids for `/notebooks/{id}/sources/{sourceId}` come from.
1525
+ #
1526
+ # `GET /notebooks/{id}/sources`
1527
+ #
1528
+ # @param id [String]
1529
+ # @return [ListSourcesData]
1530
+ # @raise [NotebookLM::Refused] when the server declines the request
1531
+ def list_sources(id:)
1532
+ payload = call('list_sources', :get, "/notebooks/#{id}/sources")
1533
+ ListSourcesData.new(payload)
1534
+ end
1535
+
1536
+ # Read a source's indexed text, one page at a time
1537
+ #
1538
+ # RPC-backed (no browser). Returns the exact content NotebookLM reasons
1539
+ # over. Sources are long — the first PDF measured ran to 157,716
1540
+ # characters — so the response is paginated by default and carries
1541
+ # `totalChars`, `pageChars`, `offset`, `hasMore`, `nextCursor` and a
1542
+ # plain-language `continue` instruction. Pages are cut at the nearest
1543
+ # line break (tag close, in HTML), and concatenating every page
1544
+ # reproduces the document exactly. Pass `paginate=false` for the whole
1545
+ # document in one response. The `html` rendition preserves structure but
1546
+ # inlines images as base64 and is bigger.
1547
+ #
1548
+ # `GET /notebooks/{id}/sources/{sourceId}`
1549
+ #
1550
+ # @param id [String]
1551
+ # @param source_id [String]
1552
+ # @param format [String, nil]
1553
+ # @param paginate [Boolean, nil] Set to `false` to return the whole document in one response.
1554
+ # @param max_chars [Integer, nil] Page size in characters. Ignored when `paginate=false`.
1555
+ # @param cursor [Integer, nil] Resume point — the `nextCursor` returned by the previous page.
1556
+ # @return [ReadSourceData]
1557
+ # @raise [NotebookLM::Refused] when the server declines the request
1558
+ def read_source(id:, source_id:, format: nil, paginate: nil, max_chars: nil, cursor: nil)
1559
+ query = {}
1560
+ query['format'] = format unless format.nil?
1561
+ query['paginate'] = paginate unless paginate.nil?
1562
+ query['max_chars'] = max_chars unless max_chars.nil?
1563
+ query['cursor'] = cursor unless cursor.nil?
1564
+ payload = call('read_source', :get, "/notebooks/#{id}/sources/#{source_id}", query: query)
1565
+ ReadSourceData.new(payload)
1566
+ end
1567
+
1568
+ # Rename one source in place
1569
+ #
1570
+ # RPC-backed (no browser). An empty `title` is a 400.
1571
+ #
1572
+ # `PATCH /notebooks/{id}/sources/{sourceId}`
1573
+ #
1574
+ # @param id [String]
1575
+ # @param source_id [String]
1576
+ # @param title [String]
1577
+ # @return [RenameSourceData]
1578
+ # @raise [NotebookLM::Refused] when the server declines the request
1579
+ def rename_source(id:, source_id:, title:)
1580
+ body = {}
1581
+ body['title'] = title
1582
+ payload = call('rename_source', :patch, "/notebooks/#{id}/sources/#{source_id}", body: body)
1583
+ RenameSourceData.new(payload)
1584
+ end
1585
+
1586
+ # NotebookLM's own summary and key topics for one source
1587
+ #
1588
+ # RPC-backed (no browser). A source NotebookLM has not summarised yet
1589
+ # returns an empty `summary` and no topics.
1590
+ #
1591
+ # `GET /notebooks/{id}/sources/{sourceId}/guide`
1592
+ #
1593
+ # @param id [String]
1594
+ # @param source_id [String]
1595
+ # @return [GetSourceGuideData]
1596
+ # @raise [NotebookLM::Refused] when the server declines the request
1597
+ def get_source_guide(id:, source_id:)
1598
+ payload = call('get_source_guide', :get, "/notebooks/#{id}/sources/#{source_id}/guide")
1599
+ GetSourceGuideData.new(payload)
1600
+ end
1601
+
1602
+ # Ranked passages from the notebook's index, without generating an answer
1603
+ #
1604
+ # RPC-backed (no browser). Retrieval rather than question answering:
1605
+ # nothing is generated and no generation quota is spent. Rank is global
1606
+ # across sources and lower is better. `start` / `end` are character
1607
+ # offsets into the source's full text, and are `null` when the server
1608
+ # did not give them.
1609
+ #
1610
+ # `POST /notebooks/{id}/search`
1611
+ #
1612
+ # @param id [String]
1613
+ # @param query [String]
1614
+ # @param source_ids [Array<String>, nil] Restrict to these source UUIDs. Omit to search them all.
1615
+ # @param source_names [Array<String>, nil] Restrict by source title; an ambiguous title is an error.
1616
+ # @param limit [Integer, nil] Keep at most this many passages, best rank first.
1617
+ # @return [SearchPassagesData]
1618
+ # @raise [NotebookLM::Refused] when the server declines the request
1619
+ def search_passages(id:, query:, source_ids: nil, source_names: nil, limit: nil)
1620
+ body = {}
1621
+ body['query'] = query
1622
+ body['source_ids'] = source_ids unless source_ids.nil?
1623
+ body['source_names'] = source_names unless source_names.nil?
1624
+ body['limit'] = limit unless limit.nil?
1625
+ payload = call('search_passages', :post, "/notebooks/#{id}/search", body: body)
1626
+ SearchPassagesData.new(payload)
1627
+ end
1628
+
1629
+ # A notebook's own summary of its sources, and the questions it suggests
1630
+ #
1631
+ # RPC-backed (no browser). Cheaper than asking a question to find out
1632
+ # what a notebook holds.
1633
+ #
1634
+ # `GET /notebooks/{id}/summary`
1635
+ #
1636
+ # @param id [String]
1637
+ # @return [GetNotebookSummaryData]
1638
+ # @raise [NotebookLM::Refused] when the server declines the request
1639
+ def get_notebook_summary(id:)
1640
+ payload = call('get_notebook_summary', :get, "/notebooks/#{id}/summary")
1641
+ GetNotebookSummaryData.new(payload)
1642
+ end
1643
+
1644
+ # Have the notebook's URL / Drive sources drifted?
1645
+ #
1646
+ # RPC-backed (no browser). Checks every source unless `source_id`
1647
+ # narrows it. `stale: null` means the server did not answer for that
1648
+ # source — not that it is current.
1649
+ #
1650
+ # `GET /notebooks/{id}/freshness`
1651
+ #
1652
+ # @param id [String]
1653
+ # @param source_id [String, nil]
1654
+ # @return [CheckSourceFreshnessData]
1655
+ # @raise [NotebookLM::Refused] when the server declines the request
1656
+ def check_source_freshness(id:, source_id: nil)
1657
+ query = {}
1658
+ query['source_id'] = source_id unless source_id.nil?
1659
+ payload = call('check_source_freshness', :get, "/notebooks/#{id}/freshness", query: query)
1660
+ CheckSourceFreshnessData.new(payload)
1661
+ end
1662
+
1663
+ # Read back the recorded questions and answers, newest first
1664
+ #
1665
+ # RPC-backed (no browser). NotebookLM exposes only the most recent
1666
+ # conversation per notebook; older ones cannot be listed.
1667
+ #
1668
+ # `GET /notebooks/{id}/chat`
1669
+ #
1670
+ # @param id [String]
1671
+ # @param conversation_id [String, nil]
1672
+ # @param limit [Integer, nil]
1673
+ # @return [GetChatHistoryData]
1674
+ # @raise [NotebookLM::Refused] when the server declines the request
1675
+ def get_chat_history(id:, conversation_id: nil, limit: nil)
1676
+ query = {}
1677
+ query['conversation_id'] = conversation_id unless conversation_id.nil?
1678
+ query['limit'] = limit unless limit.nil?
1679
+ payload = call('get_chat_history', :get, "/notebooks/#{id}/chat", query: query)
1680
+ GetChatHistoryData.new(payload)
1681
+ end
1682
+
1683
+ # Clear the chat history
1684
+ #
1685
+ # The web UI's "Delete history". NotebookLM has no per-turn delete, so
1686
+ # the whole conversation goes. Nothing to delete is reported as
1687
+ # `deleted: false`, not as a failure.
1688
+ #
1689
+ # `DELETE /notebooks/{id}/chat`
1690
+ #
1691
+ # @param id [String]
1692
+ # @param conversation_id [String, nil]
1693
+ # @return [DeleteChatHistoryData]
1694
+ # @raise [NotebookLM::Refused] when the server declines the request
1695
+ def delete_chat_history(id:, conversation_id: nil)
1696
+ query = {}
1697
+ query['conversation_id'] = conversation_id unless conversation_id.nil?
1698
+ payload = call('delete_chat_history', :delete, "/notebooks/#{id}/chat", query: query)
1699
+ DeleteChatHistoryData.new(payload)
1700
+ end
1701
+
1702
+ # Read a notebook's sharing status
1703
+ #
1704
+ # `GET /notebooks/{id}/share`
1705
+ #
1706
+ # @param id [String]
1707
+ # @return [GetShareStatusData]
1708
+ # @raise [NotebookLM::Refused] when the server declines the request
1709
+ def get_share_status(id:)
1710
+ payload = call('get_share_status', :get, "/notebooks/#{id}/share")
1711
+ GetShareStatusData.new(payload)
1712
+ end
1713
+
1714
+ # Toggle the public link
1715
+ #
1716
+ # `PUT /notebooks/{id}/share`
1717
+ #
1718
+ # @param id [String]
1719
+ # @param public [Boolean]
1720
+ # @return [ShareNotebookData]
1721
+ # @raise [NotebookLM::Refused] when the server declines the request
1722
+ def share_notebook(id:, public:)
1723
+ body = {}
1724
+ body['public'] = public
1725
+ payload = call('share_notebook', :put, "/notebooks/#{id}/share", body: body)
1726
+ ShareNotebookData.new(payload)
1727
+ end
1728
+
1729
+ # Retry a failed generation, keeping the same artifact id
1730
+ #
1731
+ # RPC-backed. The artifact is not deleted and not replaced: the same id
1732
+ # goes back to `generating`, so a reference the caller already holds
1733
+ # stays valid. Deleting and regenerating instead mints a new id.
1734
+ #
1735
+ # A refusal (rate limit, quota, or an artifact the backend will not
1736
+ # retry) comes back as an error. An accepted retry can still fail again
1737
+ # on Google's side — poll `GET /content` for the outcome.
1738
+ #
1739
+ # `POST /content/{artifactId}/retry`
1740
+ #
1741
+ # @param artifact_id [String]
1742
+ # @param notebook_id [String, nil]
1743
+ # @param notebook_url [String, nil]
1744
+ # @return [RetryContentData]
1745
+ # @raise [NotebookLM::Refused] when the server declines the request
1746
+ def retry_content(artifact_id:, notebook_id: nil, notebook_url: nil)
1747
+ body = {}
1748
+ body['notebook_id'] = notebook_id unless notebook_id.nil?
1749
+ body['notebook_url'] = notebook_url unless notebook_url.nil?
1750
+ payload = call('retry_content', :post, "/content/#{artifact_id}/retry", body: body)
1751
+ RetryContentData.new(payload)
1752
+ end
1753
+
1754
+ # Export a finished artifact to Google Docs or Sheets
1755
+ #
1756
+ # RPC-backed. `documentUrl` is `null` when the reply carried no Drive
1757
+ # link — the export may still have succeeded; check Drive.
1758
+ #
1759
+ # `POST /content/{artifactId}/export`
1760
+ #
1761
+ # @param artifact_id [String]
1762
+ # @param notebook_id [String, nil]
1763
+ # @param notebook_url [String, nil]
1764
+ # @param target [String, nil]
1765
+ # @param title [String, nil]
1766
+ # @return [ExportArtifactData]
1767
+ # @raise [NotebookLM::Refused] when the server declines the request
1768
+ def export_artifact(artifact_id:, notebook_id: nil, notebook_url: nil, target: nil, title: nil)
1769
+ body = {}
1770
+ body['notebook_id'] = notebook_id unless notebook_id.nil?
1771
+ body['notebook_url'] = notebook_url unless notebook_url.nil?
1772
+ body['target'] = target unless target.nil?
1773
+ body['title'] = title unless title.nil?
1774
+ payload = call('export_artifact', :post, "/content/#{artifact_id}/export", body: body)
1775
+ ExportArtifactData.new(payload)
1776
+ end
1777
+
1778
+ # Revise one slide of an existing deck from a prompt
1779
+ #
1780
+ # RPC-backed. `slide_index` is zero-based. Returns as soon as the
1781
+ # revision is accepted; poll `GET /content` for the finished deck.
1782
+ #
1783
+ # `POST /content/{artifactId}/revise-slide`
1784
+ #
1785
+ # @param artifact_id [String]
1786
+ # @param notebook_id [String, nil]
1787
+ # @param notebook_url [String, nil]
1788
+ # @param slide_index [Integer]
1789
+ # @param prompt [String]
1790
+ # @return [ReviseSlideData]
1791
+ # @raise [NotebookLM::Refused] when the server declines the request
1792
+ def revise_slide(artifact_id:, slide_index:, prompt:, notebook_id: nil, notebook_url: nil)
1793
+ body = {}
1794
+ body['notebook_id'] = notebook_id unless notebook_id.nil?
1795
+ body['notebook_url'] = notebook_url unless notebook_url.nil?
1796
+ body['slide_index'] = slide_index
1797
+ body['prompt'] = prompt
1798
+ payload = call('revise_slide', :post, "/content/#{artifact_id}/revise-slide", body: body)
1799
+ ReviseSlideData.new(payload)
1800
+ end
1801
+
1802
+ # List a notebook's source labels
1803
+ #
1804
+ # `GET /notebooks/{id}/labels`
1805
+ #
1806
+ # @param id [String]
1807
+ # @return [ListLabelsData]
1808
+ # @raise [NotebookLM::Refused] when the server declines the request
1809
+ def list_labels(id:)
1810
+ payload = call('list_labels', :get, "/notebooks/#{id}/labels")
1811
+ ListLabelsData.new(payload)
1812
+ end
1813
+
1814
+ # Create or delete source labels
1815
+ #
1816
+ # `POST /notebooks/{id}/labels`
1817
+ #
1818
+ # @param id [String]
1819
+ # @param action [String, nil]
1820
+ # @param name [String, nil]
1821
+ # @param emoji [String, nil]
1822
+ # @param label_ids [Array<String>, nil]
1823
+ # @return [ManageLabelsData]
1824
+ # @raise [NotebookLM::Refused] when the server declines the request
1825
+ def manage_labels(id:, action: nil, name: nil, emoji: nil, label_ids: nil)
1826
+ body = {}
1827
+ body['action'] = action unless action.nil?
1828
+ body['name'] = name unless name.nil?
1829
+ body['emoji'] = emoji unless emoji.nil?
1830
+ body['label_ids'] = label_ids unless label_ids.nil?
1831
+ payload = call('manage_labels', :post, "/notebooks/#{id}/labels", body: body)
1832
+ ManageLabelsData.new(payload)
1833
+ end
1834
+
1835
+ # Generate a study aid (flashcards or quiz)
1836
+ #
1837
+ # `POST /content/study-aid`
1838
+ #
1839
+ # @param notebook_id [String, nil]
1840
+ # @param notebook_url [String, nil]
1841
+ # @param kind [String]
1842
+ # @param focus [String, nil]
1843
+ # @return [GenerateStudyAidData]
1844
+ # @raise [NotebookLM::Refused] when the server declines the request
1845
+ def generate_study_aid(kind:, notebook_id: nil, notebook_url: nil, focus: nil)
1846
+ body = {}
1847
+ body['notebook_id'] = notebook_id unless notebook_id.nil?
1848
+ body['notebook_url'] = notebook_url unless notebook_url.nil?
1849
+ body['kind'] = kind
1850
+ body['focus'] = focus unless focus.nil?
1851
+ payload = call('generate_study_aid', :post, '/content/study-aid', body: body)
1852
+ GenerateStudyAidData.new(payload)
1853
+ end
1854
+
1855
+ # Generate and save a mind map
1856
+ #
1857
+ # `POST /content/mind-map`
1858
+ #
1859
+ # @param notebook_id [String, nil]
1860
+ # @param notebook_url [String, nil]
1861
+ # @param title [String, nil]
1862
+ # @return [GenerateMindMapData]
1863
+ # @raise [NotebookLM::Refused] when the server declines the request
1864
+ def generate_mind_map(notebook_id: nil, notebook_url: nil, title: nil)
1865
+ body = {}
1866
+ body['notebook_id'] = notebook_id unless notebook_id.nil?
1867
+ body['notebook_url'] = notebook_url unless notebook_url.nil?
1868
+ body['title'] = title unless title.nil?
1869
+ payload = call('generate_mind_map', :post, '/content/mind-map', body: body)
1870
+ GenerateMindMapData.new(payload)
1871
+ end
1872
+
1873
+ # Discover web sources for a notebook (Fast Research), optionally importing them
1874
+ #
1875
+ # `POST /content/research`
1876
+ #
1877
+ # @param notebook_id [String, nil]
1878
+ # @param notebook_url [String, nil]
1879
+ # @param query [String]
1880
+ # @param import [Boolean, nil]
1881
+ # @return [ResearchSourcesData]
1882
+ # @raise [NotebookLM::Refused] when the server declines the request
1883
+ def research_sources(query:, notebook_id: nil, notebook_url: nil, import: nil)
1884
+ body = {}
1885
+ body['notebook_id'] = notebook_id unless notebook_id.nil?
1886
+ body['notebook_url'] = notebook_url unless notebook_url.nil?
1887
+ body['query'] = query
1888
+ body['import'] = import unless import.nil?
1889
+ payload = call('research_sources', :post, '/content/research', body: body)
1890
+ ResearchSourcesData.new(payload)
1891
+ end
1892
+
1893
+ # Generate Studio content (audio, video, infographic, report, presentation, data table)
1894
+ #
1895
+ # `POST /content/generate`
1896
+ #
1897
+ # @param content_type [String]
1898
+ # @param language [String, nil]
1899
+ # @param custom_instructions [String, nil]
1900
+ # @param video_style [String, nil]
1901
+ # @param video_format [String, nil]
1902
+ # @param infographic_format [String, nil]
1903
+ # @param report_format [String, nil]
1904
+ # @param presentation_style [String, nil]
1905
+ # @param presentation_length [String, nil]
1906
+ # @return [GenerateContentData]
1907
+ # @raise [NotebookLM::Refused] when the server declines the request
1908
+ def generate_content(content_type:, language: nil, custom_instructions: nil, video_style: nil, video_format: nil, infographic_format: nil, report_format: nil, presentation_style: nil, presentation_length: nil)
1909
+ body = {}
1910
+ body['content_type'] = content_type
1911
+ body['language'] = language unless language.nil?
1912
+ body['custom_instructions'] = custom_instructions unless custom_instructions.nil?
1913
+ body['video_style'] = video_style unless video_style.nil?
1914
+ body['video_format'] = video_format unless video_format.nil?
1915
+ body['infographic_format'] = infographic_format unless infographic_format.nil?
1916
+ body['report_format'] = report_format unless report_format.nil?
1917
+ body['presentation_style'] = presentation_style unless presentation_style.nil?
1918
+ body['presentation_length'] = presentation_length unless presentation_length.nil?
1919
+ payload = call('generate_content', :post, '/content/generate', body: body)
1920
+ GenerateContentData.new(payload)
1921
+ end
1922
+
1923
+ # Download a generated artifact (WAV, MP4, PNG)
1924
+ #
1925
+ # `GET /content/download`
1926
+ #
1927
+ # @param content_id [String, nil]
1928
+ # @return [DownloadContentData]
1929
+ # @raise [NotebookLM::Refused] when the server declines the request
1930
+ def download_content(content_id: nil)
1931
+ query = {}
1932
+ query['content_id'] = content_id unless content_id.nil?
1933
+ payload = call('download_content', :get, '/content/download', query: query)
1934
+ DownloadContentData.new(payload)
1935
+ end
1936
+
1937
+ # List sources and generated content for the active notebook
1938
+ #
1939
+ # `GET /content`
1940
+ #
1941
+ # @return [ListContentData]
1942
+ # @raise [NotebookLM::Refused] when the server declines the request
1943
+ def list_content
1944
+ payload = call('list_content', :get, '/content')
1945
+ ListContentData.new(payload)
1946
+ end
1947
+
1948
+ # Create a note in the active notebook
1949
+ #
1950
+ # `POST /content/notes`
1951
+ #
1952
+ # @return [CreateNoteData]
1953
+ # @raise [NotebookLM::Refused] when the server declines the request
1954
+ def create_note
1955
+ payload = call('create_note', :post, '/content/notes')
1956
+ CreateNoteData.new(payload)
1957
+ end
1958
+
1959
+ # Save the current chat discussion as a note
1960
+ #
1961
+ # `POST /content/chat-to-note`
1962
+ #
1963
+ # @return [SaveChatToNoteData]
1964
+ # @raise [NotebookLM::Refused] when the server declines the request
1965
+ def save_chat_to_note
1966
+ payload = call('save_chat_to_note', :post, '/content/chat-to-note')
1967
+ SaveChatToNoteData.new(payload)
1968
+ end
1969
+
1970
+ # Convert a note into a NotebookLM source
1971
+ #
1972
+ # `POST /content/notes/{noteTitle}/to-source`
1973
+ #
1974
+ # @param note_title [String]
1975
+ # @return [ConvertNoteToSourceData]
1976
+ # @raise [NotebookLM::Refused] when the server declines the request
1977
+ def convert_note_to_source(note_title:)
1978
+ payload = call('convert_note_to_source', :post, "/content/notes/#{note_title}/to-source")
1979
+ ConvertNoteToSourceData.new(payload)
1980
+ end
1981
+
1982
+ # Run a batch of questions and write each answer to a vault directory
1983
+ #
1984
+ # Long-running: one NotebookLM answer per question, written as a markdown
1985
+ # file conforming to the `nblm-answer-v1` schema. Size the client timeout
1986
+ # accordingly (and the reverse-proxy read timeout, if any).
1987
+ #
1988
+ # `POST /batch-to-vault`
1989
+ #
1990
+ # @param questions [Array<String>]
1991
+ # @param notebook_id [String, nil]
1992
+ # @param notebook_url [String, nil]
1993
+ # @param vault_dir [String, nil]
1994
+ # @param slug_prefix [String, nil]
1995
+ # @param source_format [String, nil]
1996
+ # @param sleep_between_ms [Integer, nil]
1997
+ # @param session_id [String, nil]
1998
+ # @return [BatchToVaultData]
1999
+ # @raise [NotebookLM::Refused] when the server declines the request
2000
+ def batch_to_vault(questions:, notebook_id: nil, notebook_url: nil, vault_dir: nil, slug_prefix: nil, source_format: nil, sleep_between_ms: nil, session_id: nil)
2001
+ body = {}
2002
+ body['questions'] = questions
2003
+ body['notebook_id'] = notebook_id unless notebook_id.nil?
2004
+ body['notebook_url'] = notebook_url unless notebook_url.nil?
2005
+ body['vault_dir'] = vault_dir unless vault_dir.nil?
2006
+ body['slug_prefix'] = slug_prefix unless slug_prefix.nil?
2007
+ body['source_format'] = source_format unless source_format.nil?
2008
+ body['sleep_between_ms'] = sleep_between_ms unless sleep_between_ms.nil?
2009
+ body['session_id'] = session_id unless session_id.nil?
2010
+ payload = call('batch_to_vault', :post, '/batch-to-vault', body: body)
2011
+ BatchToVaultData.new(payload)
2012
+ end
2013
+
2014
+ # List the notebook's notes
2015
+ #
2016
+ # `POST /content/notes/list`
2017
+ #
2018
+ # @param notebook_url [String, nil]
2019
+ # @param session_id [String, nil]
2020
+ # @return [ListNotesData]
2021
+ # @raise [NotebookLM::Refused] when the server declines the request
2022
+ def list_notes(notebook_url: nil, session_id: nil)
2023
+ body = {}
2024
+ body['notebook_url'] = notebook_url unless notebook_url.nil?
2025
+ body['session_id'] = session_id unless session_id.nil?
2026
+ payload = call('list_notes', :post, '/content/notes/list', body: body)
2027
+ ListNotesData.new(payload)
2028
+ end
2029
+
2030
+ # Read one note's content, by title or id
2031
+ #
2032
+ # `POST /content/notes/get`
2033
+ #
2034
+ # @param note_title [String, nil]
2035
+ # @param note_id [String, nil]
2036
+ # @param notebook_url [String, nil]
2037
+ # @param session_id [String, nil]
2038
+ # @return [GetNoteData]
2039
+ # @raise [NotebookLM::Refused] when the server declines the request
2040
+ def get_note(note_title: nil, note_id: nil, notebook_url: nil, session_id: nil)
2041
+ body = {}
2042
+ body['note_title'] = note_title unless note_title.nil?
2043
+ body['note_id'] = note_id unless note_id.nil?
2044
+ body['notebook_url'] = notebook_url unless notebook_url.nil?
2045
+ body['session_id'] = session_id unless session_id.nil?
2046
+ payload = call('get_note', :post, '/content/notes/get', body: body)
2047
+ GetNoteData.new(payload)
2048
+ end
2049
+
2050
+ # Wipe all local data (requires confirmation)
2051
+ #
2052
+ # `POST /cleanup-data`
2053
+ #
2054
+ # @param confirm [Boolean, nil]
2055
+ # @return [CleanupDataData]
2056
+ # @raise [NotebookLM::Refused] when the server declines the request
2057
+ def cleanup_data(confirm: nil)
2058
+ body = {}
2059
+ body['confirm'] = confirm unless confirm.nil?
2060
+ payload = call('cleanup_data', :post, '/cleanup-data', body: body)
2061
+ CleanupDataData.new(payload)
2062
+ end
2063
+ end
2064
+
2065
+ class Client
2066
+ include Operations
2067
+ end
2068
+ end