Repository navigation
Expand file tree
/
Copy pathpipelinedocument.go
More file actions
619 lines (564 loc) · 24.6 KB
/
Copy pathpipelinedocument.go
File metadata and controls
619 lines (564 loc) · 24.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
package llamacloud
import (
"context"
"encoding/json"
"errors"
"fmt"
"net/http"
"net/url"
"slices"
"github.com/run-llama/llama-parse-go/internal/apijson"
"github.com/run-llama/llama-parse-go/internal/apiquery"
shimjson "github.com/run-llama/llama-parse-go/internal/encoding/json"
"github.com/run-llama/llama-parse-go/internal/requestconfig"
"github.com/run-llama/llama-parse-go/option"
"github.com/run-llama/llama-parse-go/packages/pagination"
"github.com/run-llama/llama-parse-go/packages/param"
"github.com/run-llama/llama-parse-go/packages/respjson"
)
// PipelineDocumentService contains methods and other services that help with
// interacting with the llama-cloud API.
//
// Note, unlike clients, this service does not read variables from the environment
// automatically. You should not instantiate this service directly, and instead use
// the [NewPipelineDocumentService] method instead.
type PipelineDocumentService struct {
options []option.RequestOption
}
// NewPipelineDocumentService generates a new service that applies the given
// options to each request. These options are applied after the parent client's
// options (if there is one), and before any request-specific options.
func NewPipelineDocumentService(opts ...option.RequestOption) (r PipelineDocumentService) {
r = PipelineDocumentService{}
r.options = opts
return
}
// Batch create documents for a pipeline.
//
// Deprecated: deprecated
func (r *PipelineDocumentService) New(ctx context.Context, pipelineID string, params PipelineDocumentNewParams, opts ...option.RequestOption) (res *[]CloudDocument, err error) {
opts = slices.Concat(r.options, opts)
if pipelineID == "" {
err = errors.New("missing required pipeline_id parameter")
return nil, err
}
path := fmt.Sprintf("api/v1/pipelines/%s/documents", pipelineID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &res, opts...)
return res, err
}
// Return a list of documents for a pipeline.
//
// Deprecated: deprecated
func (r *PipelineDocumentService) List(ctx context.Context, pipelineID string, query PipelineDocumentListParams, opts ...option.RequestOption) (res *pagination.PaginatedCloudDocuments[CloudDocument], err error) {
var raw *http.Response
opts = slices.Concat(r.options, opts)
opts = append([]option.RequestOption{option.WithResponseInto(&raw)}, opts...)
if pipelineID == "" {
err = errors.New("missing required pipeline_id parameter")
return nil, err
}
path := fmt.Sprintf("api/v1/pipelines/%s/documents/paginated", pipelineID)
cfg, err := requestconfig.NewRequestConfig(ctx, http.MethodGet, path, query, &res, opts...)
if err != nil {
return nil, err
}
err = cfg.Execute()
if err != nil {
return nil, err
}
res.SetPageConfig(cfg, raw)
return res, nil
}
// Return a list of documents for a pipeline.
//
// Deprecated: deprecated
func (r *PipelineDocumentService) ListAutoPaging(ctx context.Context, pipelineID string, query PipelineDocumentListParams, opts ...option.RequestOption) *pagination.PaginatedCloudDocumentsAutoPager[CloudDocument] {
return pagination.NewPaginatedCloudDocumentsAutoPager(r.List(ctx, pipelineID, query, opts...))
}
// Delete a document from a pipeline; runs async (vectors first, then MongoDB
// record).
//
// Deprecated: deprecated
func (r *PipelineDocumentService) Delete(ctx context.Context, documentID string, params PipelineDocumentDeleteParams, opts ...option.RequestOption) (err error) {
opts = slices.Concat(r.options, opts)
opts = append([]option.RequestOption{option.WithHeader("Accept", "*/*")}, opts...)
if params.PipelineID == "" {
err = errors.New("missing required pipeline_id parameter")
return err
}
if documentID == "" {
err = errors.New("missing required document_id parameter")
return err
}
path := fmt.Sprintf("api/v1/pipelines/%s/documents/%s", params.PipelineID, url.PathEscape(documentID))
err = requestconfig.ExecuteNewRequest(ctx, http.MethodDelete, path, params, nil, opts...)
return err
}
// Return a single document for a pipeline.
//
// Deprecated: deprecated
func (r *PipelineDocumentService) Get(ctx context.Context, documentID string, params PipelineDocumentGetParams, opts ...option.RequestOption) (res *CloudDocument, err error) {
opts = slices.Concat(r.options, opts)
if params.PipelineID == "" {
err = errors.New("missing required pipeline_id parameter")
return nil, err
}
if documentID == "" {
err = errors.New("missing required document_id parameter")
return nil, err
}
path := fmt.Sprintf("api/v1/pipelines/%s/documents/%s", params.PipelineID, url.PathEscape(documentID))
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &res, opts...)
return res, err
}
// Return a list of chunks for a pipeline document.
//
// Deprecated: deprecated
func (r *PipelineDocumentService) GetChunks(ctx context.Context, documentID string, params PipelineDocumentGetChunksParams, opts ...option.RequestOption) (res *[]TextNode, err error) {
opts = slices.Concat(r.options, opts)
if params.PipelineID == "" {
err = errors.New("missing required pipeline_id parameter")
return nil, err
}
if documentID == "" {
err = errors.New("missing required document_id parameter")
return nil, err
}
path := fmt.Sprintf("api/v1/pipelines/%s/documents/%s/chunks", params.PipelineID, url.PathEscape(documentID))
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &res, opts...)
return res, err
}
// Return a single document for a pipeline.
//
// Deprecated: deprecated
func (r *PipelineDocumentService) GetStatus(ctx context.Context, documentID string, params PipelineDocumentGetStatusParams, opts ...option.RequestOption) (res *ManagedIngestionStatusResponse, err error) {
opts = slices.Concat(r.options, opts)
if params.PipelineID == "" {
err = errors.New("missing required pipeline_id parameter")
return nil, err
}
if documentID == "" {
err = errors.New("missing required document_id parameter")
return nil, err
}
path := fmt.Sprintf("api/v1/pipelines/%s/documents/%s/status", params.PipelineID, url.PathEscape(documentID))
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, params, &res, opts...)
return res, err
}
// Count the documents in a pipeline, grouped by ingestion status.
//
// Counts reflect each document's last recorded status rather than a freshly
// computed one, so a document that changed status in the last few moments may
// still be counted under its previous one. Use
// `GET /pipelines/{pipeline_id}/documents/{document_id}/status` when a single
// document's status has to be up to the moment.
//
// Deprecated: deprecated
func (r *PipelineDocumentService) GetStatusCounts(ctx context.Context, pipelineID string, query PipelineDocumentGetStatusCountsParams, opts ...option.RequestOption) (res *PipelineDocumentGetStatusCountsResponse, err error) {
opts = slices.Concat(r.options, opts)
if pipelineID == "" {
err = errors.New("missing required pipeline_id parameter")
return nil, err
}
path := fmt.Sprintf("api/v1/pipelines/%s/documents/status-counts", pipelineID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodGet, path, query, &res, opts...)
return res, err
}
// Sync a specific document for a pipeline.
//
// Deprecated: deprecated
func (r *PipelineDocumentService) Sync(ctx context.Context, documentID string, params PipelineDocumentSyncParams, opts ...option.RequestOption) (res *PipelineDocumentSyncResponse, err error) {
opts = slices.Concat(r.options, opts)
if params.PipelineID == "" {
err = errors.New("missing required pipeline_id parameter")
return nil, err
}
if documentID == "" {
err = errors.New("missing required document_id parameter")
return nil, err
}
path := fmt.Sprintf("api/v1/pipelines/%s/documents/%s/sync", params.PipelineID, url.PathEscape(documentID))
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, params, &res, opts...)
return res, err
}
// Batch create or update a document for a pipeline.
//
// Deprecated: deprecated
func (r *PipelineDocumentService) Upsert(ctx context.Context, pipelineID string, params PipelineDocumentUpsertParams, opts ...option.RequestOption) (res *[]CloudDocument, err error) {
opts = slices.Concat(r.options, opts)
if pipelineID == "" {
err = errors.New("missing required pipeline_id parameter")
return nil, err
}
path := fmt.Sprintf("api/v1/pipelines/%s/documents", pipelineID)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPut, path, params, &res, opts...)
return res, err
}
// Cloud document stored in S3.
type CloudDocument struct {
ID string `json:"id" api:"required"`
Metadata map[string]any `json:"metadata" api:"required"`
Text string `json:"text" api:"required"`
ExcludedEmbedMetadataKeys []string `json:"excluded_embed_metadata_keys"`
ExcludedLlmMetadataKeys []string `json:"excluded_llm_metadata_keys"`
// indices in the CloudDocument.text where a new page begins. e.g. Second page
// starts at index specified by page_positions[1].
PagePositions []int64 `json:"page_positions" api:"nullable"`
StatusMetadata map[string]any `json:"status_metadata" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Metadata respjson.Field
Text respjson.Field
ExcludedEmbedMetadataKeys respjson.Field
ExcludedLlmMetadataKeys respjson.Field
PagePositions respjson.Field
StatusMetadata respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r CloudDocument) RawJSON() string { return r.JSON.raw }
func (r *CloudDocument) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
// Create a new cloud document.
//
// The properties Metadata, Text are required.
type CloudDocumentCreateParam struct {
Metadata map[string]any `json:"metadata,omitzero" api:"required"`
Text string `json:"text" api:"required"`
ID param.Opt[string] `json:"id,omitzero"`
// indices in the CloudDocument.text where a new page begins. e.g. Second page
// starts at index specified by page_positions[1].
PagePositions []int64 `json:"page_positions,omitzero"`
ExcludedEmbedMetadataKeys []string `json:"excluded_embed_metadata_keys,omitzero"`
ExcludedLlmMetadataKeys []string `json:"excluded_llm_metadata_keys,omitzero"`
paramObj
}
func (r CloudDocumentCreateParam) MarshalJSON() (data []byte, err error) {
type shadow CloudDocumentCreateParam
return param.MarshalObject(r, (*shadow)(&r))
}
func (r *CloudDocumentCreateParam) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
// Provided for backward compatibility.
type TextNode struct {
ClassName string `json:"class_name"`
// Embedding of the node.
Embedding []float64 `json:"embedding" api:"nullable"`
// End char index of the node.
EndCharIdx int64 `json:"end_char_idx" api:"nullable"`
// Metadata keys that are excluded from text for the embed model.
ExcludedEmbedMetadataKeys []string `json:"excluded_embed_metadata_keys"`
// Metadata keys that are excluded from text for the LLM.
ExcludedLlmMetadataKeys []string `json:"excluded_llm_metadata_keys"`
// A flat dictionary of metadata fields
ExtraInfo map[string]any `json:"extra_info"`
// Unique ID of the node.
ID string `json:"id_"`
// Separator between metadata fields when converting to string.
MetadataSeperator string `json:"metadata_seperator"`
// Template for how metadata is formatted, with {key} and {value} placeholders.
MetadataTemplate string `json:"metadata_template"`
// MIME type of the node content.
Mimetype string `json:"mimetype"`
// A mapping of relationships to other node information.
Relationships map[string]TextNodeRelationshipUnion `json:"relationships"`
// Start char index of the node.
StartCharIdx int64 `json:"start_char_idx" api:"nullable"`
// Text content of the node.
Text string `json:"text"`
// Template for how text is formatted, with {content} and {metadata_str}
// placeholders.
TextTemplate string `json:"text_template"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ClassName respjson.Field
Embedding respjson.Field
EndCharIdx respjson.Field
ExcludedEmbedMetadataKeys respjson.Field
ExcludedLlmMetadataKeys respjson.Field
ExtraInfo respjson.Field
ID respjson.Field
MetadataSeperator respjson.Field
MetadataTemplate respjson.Field
Mimetype respjson.Field
Relationships respjson.Field
StartCharIdx respjson.Field
Text respjson.Field
TextTemplate respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r TextNode) RawJSON() string { return r.JSON.raw }
func (r *TextNode) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
// TextNodeRelationshipUnion contains all possible properties and values from
// [TextNodeRelationshipRelatedNodeInfo], [[]TextNodeRelationshipArrayItem].
//
// Use the methods beginning with 'As' to cast the union to one of its variants.
//
// If the underlying value is not a json object, one of the following properties
// will be valid: OfTextNodeRelationshipArray]
type TextNodeRelationshipUnion struct {
// This field will be present if the value is a [[]TextNodeRelationshipArrayItem]
// instead of an object.
OfTextNodeRelationshipArray []TextNodeRelationshipArrayItem `json:",inline"`
// This field is from variant [TextNodeRelationshipRelatedNodeInfo].
NodeID string `json:"node_id"`
// This field is from variant [TextNodeRelationshipRelatedNodeInfo].
ClassName string `json:"class_name"`
// This field is from variant [TextNodeRelationshipRelatedNodeInfo].
Hash string `json:"hash"`
// This field is from variant [TextNodeRelationshipRelatedNodeInfo].
Metadata map[string]any `json:"metadata"`
// This field is from variant [TextNodeRelationshipRelatedNodeInfo].
NodeType string `json:"node_type"`
JSON struct {
OfTextNodeRelationshipArray respjson.Field
NodeID respjson.Field
ClassName respjson.Field
Hash respjson.Field
Metadata respjson.Field
NodeType respjson.Field
raw string
} `json:"-"`
}
func (u TextNodeRelationshipUnion) AsRelatedNodeInfo() (v TextNodeRelationshipRelatedNodeInfo) {
apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v)
return
}
func (u TextNodeRelationshipUnion) AsTextNodeRelationshipArray() (v []TextNodeRelationshipArrayItem) {
apijson.UnmarshalRoot(json.RawMessage(u.JSON.raw), &v)
return
}
// Returns the unmodified JSON received from the API
func (u TextNodeRelationshipUnion) RawJSON() string { return u.JSON.raw }
func (r *TextNodeRelationshipUnion) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
type TextNodeRelationshipRelatedNodeInfo struct {
NodeID string `json:"node_id" api:"required"`
ClassName string `json:"class_name"`
Hash string `json:"hash" api:"nullable"`
Metadata map[string]any `json:"metadata"`
NodeType string `json:"node_type" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
NodeID respjson.Field
ClassName respjson.Field
Hash respjson.Field
Metadata respjson.Field
NodeType respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r TextNodeRelationshipRelatedNodeInfo) RawJSON() string { return r.JSON.raw }
func (r *TextNodeRelationshipRelatedNodeInfo) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
type TextNodeRelationshipArrayItem struct {
NodeID string `json:"node_id" api:"required"`
ClassName string `json:"class_name"`
Hash string `json:"hash" api:"nullable"`
Metadata map[string]any `json:"metadata"`
NodeType string `json:"node_type" api:"nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
NodeID respjson.Field
ClassName respjson.Field
Hash respjson.Field
Metadata respjson.Field
NodeType respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r TextNodeRelationshipArrayItem) RawJSON() string { return r.JSON.raw }
func (r *TextNodeRelationshipArrayItem) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
// Counts of the documents in a pipeline, grouped by ingestion status.
type PipelineDocumentGetStatusCountsResponse struct {
// Number of documents per ingestion status; every status is present.
Counts map[string]int64 `json:"counts" api:"required"`
// ID of the pipeline the documents belong to.
PipelineID string `json:"pipeline_id" api:"required" format:"uuid"`
// Total number of documents counted.
TotalCount int64 `json:"total_count" api:"required"`
// Data source the counts were restricted to.
DataSourceID string `json:"data_source_id" api:"nullable" format:"uuid"`
// File the counts were restricted to.
FileID string `json:"file_id" api:"nullable" format:"uuid"`
// Whether only directly uploaded documents were counted.
OnlyDirectUpload bool `json:"only_direct_upload"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Counts respjson.Field
PipelineID respjson.Field
TotalCount respjson.Field
DataSourceID respjson.Field
FileID respjson.Field
OnlyDirectUpload respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}
// Returns the unmodified JSON received from the API
func (r PipelineDocumentGetStatusCountsResponse) RawJSON() string { return r.JSON.raw }
func (r *PipelineDocumentGetStatusCountsResponse) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
type PipelineDocumentSyncResponse = any
type PipelineDocumentNewParams struct {
Body []CloudDocumentCreateParam
ProjectID param.Opt[string] `query:"project_id,omitzero" format:"uuid" json:"-"`
paramObj
}
func (r PipelineDocumentNewParams) MarshalJSON() (data []byte, err error) {
return shimjson.Marshal(r.Body)
}
func (r *PipelineDocumentNewParams) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
// URLQuery serializes [PipelineDocumentNewParams]'s query parameters as
// `url.Values`.
func (r PipelineDocumentNewParams) URLQuery() (v url.Values, err error) {
return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
ArrayFormat: apiquery.ArrayQueryFormatRepeat,
NestedFormat: apiquery.NestedQueryFormatBrackets,
})
}
type PipelineDocumentListParams struct {
FileID param.Opt[string] `query:"file_id,omitzero" format:"uuid" json:"-"`
OnlyAPIDataSourceDocuments param.Opt[bool] `query:"only_api_data_source_documents,omitzero" json:"-"`
OnlyDirectUpload param.Opt[bool] `query:"only_direct_upload,omitzero" json:"-"`
ProjectID param.Opt[string] `query:"project_id,omitzero" format:"uuid" json:"-"`
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
Skip param.Opt[int64] `query:"skip,omitzero" json:"-"`
// Any of "cached", "ttl".
StatusRefreshPolicy PipelineDocumentListParamsStatusRefreshPolicy `query:"status_refresh_policy,omitzero" json:"-"`
paramObj
}
// URLQuery serializes [PipelineDocumentListParams]'s query parameters as
// `url.Values`.
func (r PipelineDocumentListParams) URLQuery() (v url.Values, err error) {
return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
ArrayFormat: apiquery.ArrayQueryFormatRepeat,
NestedFormat: apiquery.NestedQueryFormatBrackets,
})
}
type PipelineDocumentListParamsStatusRefreshPolicy string
const (
PipelineDocumentListParamsStatusRefreshPolicyCached PipelineDocumentListParamsStatusRefreshPolicy = "cached"
PipelineDocumentListParamsStatusRefreshPolicyTtl PipelineDocumentListParamsStatusRefreshPolicy = "ttl"
)
type PipelineDocumentDeleteParams struct {
PipelineID string `path:"pipeline_id" api:"required" format:"uuid" json:"-"`
ProjectID param.Opt[string] `query:"project_id,omitzero" format:"uuid" json:"-"`
paramObj
}
// URLQuery serializes [PipelineDocumentDeleteParams]'s query parameters as
// `url.Values`.
func (r PipelineDocumentDeleteParams) URLQuery() (v url.Values, err error) {
return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
ArrayFormat: apiquery.ArrayQueryFormatRepeat,
NestedFormat: apiquery.NestedQueryFormatBrackets,
})
}
type PipelineDocumentGetParams struct {
PipelineID string `path:"pipeline_id" api:"required" format:"uuid" json:"-"`
ProjectID param.Opt[string] `query:"project_id,omitzero" format:"uuid" json:"-"`
paramObj
}
// URLQuery serializes [PipelineDocumentGetParams]'s query parameters as
// `url.Values`.
func (r PipelineDocumentGetParams) URLQuery() (v url.Values, err error) {
return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
ArrayFormat: apiquery.ArrayQueryFormatRepeat,
NestedFormat: apiquery.NestedQueryFormatBrackets,
})
}
type PipelineDocumentGetChunksParams struct {
PipelineID string `path:"pipeline_id" api:"required" format:"uuid" json:"-"`
ProjectID param.Opt[string] `query:"project_id,omitzero" format:"uuid" json:"-"`
paramObj
}
// URLQuery serializes [PipelineDocumentGetChunksParams]'s query parameters as
// `url.Values`.
func (r PipelineDocumentGetChunksParams) URLQuery() (v url.Values, err error) {
return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
ArrayFormat: apiquery.ArrayQueryFormatRepeat,
NestedFormat: apiquery.NestedQueryFormatBrackets,
})
}
type PipelineDocumentGetStatusParams struct {
PipelineID string `path:"pipeline_id" api:"required" format:"uuid" json:"-"`
ProjectID param.Opt[string] `query:"project_id,omitzero" format:"uuid" json:"-"`
paramObj
}
// URLQuery serializes [PipelineDocumentGetStatusParams]'s query parameters as
// `url.Values`.
func (r PipelineDocumentGetStatusParams) URLQuery() (v url.Values, err error) {
return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
ArrayFormat: apiquery.ArrayQueryFormatRepeat,
NestedFormat: apiquery.NestedQueryFormatBrackets,
})
}
type PipelineDocumentGetStatusCountsParams struct {
DataSourceID param.Opt[string] `query:"data_source_id,omitzero" format:"uuid" json:"-"`
FileID param.Opt[string] `query:"file_id,omitzero" format:"uuid" json:"-"`
ProjectID param.Opt[string] `query:"project_id,omitzero" format:"uuid" json:"-"`
OnlyDirectUpload param.Opt[bool] `query:"only_direct_upload,omitzero" json:"-"`
paramObj
}
// URLQuery serializes [PipelineDocumentGetStatusCountsParams]'s query parameters
// as `url.Values`.
func (r PipelineDocumentGetStatusCountsParams) URLQuery() (v url.Values, err error) {
return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
ArrayFormat: apiquery.ArrayQueryFormatRepeat,
NestedFormat: apiquery.NestedQueryFormatBrackets,
})
}
type PipelineDocumentSyncParams struct {
PipelineID string `path:"pipeline_id" api:"required" format:"uuid" json:"-"`
ProjectID param.Opt[string] `query:"project_id,omitzero" format:"uuid" json:"-"`
paramObj
}
// URLQuery serializes [PipelineDocumentSyncParams]'s query parameters as
// `url.Values`.
func (r PipelineDocumentSyncParams) URLQuery() (v url.Values, err error) {
return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
ArrayFormat: apiquery.ArrayQueryFormatRepeat,
NestedFormat: apiquery.NestedQueryFormatBrackets,
})
}
type PipelineDocumentUpsertParams struct {
Body []CloudDocumentCreateParam
ProjectID param.Opt[string] `query:"project_id,omitzero" format:"uuid" json:"-"`
paramObj
}
func (r PipelineDocumentUpsertParams) MarshalJSON() (data []byte, err error) {
return shimjson.Marshal(r.Body)
}
func (r *PipelineDocumentUpsertParams) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}
// URLQuery serializes [PipelineDocumentUpsertParams]'s query parameters as
// `url.Values`.
func (r PipelineDocumentUpsertParams) URLQuery() (v url.Values, err error) {
return apiquery.MarshalWithSettings(r, apiquery.QuerySettings{
ArrayFormat: apiquery.ArrayQueryFormatRepeat,
NestedFormat: apiquery.NestedQueryFormatBrackets,
})
}