Repository navigation
Expand file tree
/
Copy pathparams.go
More file actions
1066 lines (1027 loc) · 47 KB
/
Copy pathparams.go
File metadata and controls
1066 lines (1027 loc) · 47 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
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated from the ChartQuery OpenAPI document. DO NOT EDIT.
package chartquery
// BarcodeParams holds the parameters of Barcode (GET / POST /v1/barcode).
// Required fields are plain values; optional fields are pointers (use chartquery.String, chartquery.Float, chartquery.Bool) or nil slices and maps.
type BarcodeParams struct {
// The data to encode in the barcode. Examples by type:
Data string `json:"data" api:"data,required"`
// Barcode format. Default: code128. Allowed values: code128, code39, code39ext, code93, code93ext, ean13, ean8, ean5, ean2, upca, upce, itf, itf14, codabar, msi, pharmacode, code11, gs1-128, gs1-databar, gs1-databar-limited…. Default: "code128".
Type *string `json:"type" api:"type"`
// Bar height in pixels. Default: 80. Typical values: 50 (compact), 80 (standard), 100–120 (tall labels). Example: ?height=100
Height *float64 `json:"height" api:"height"`
// Bar color as a CSS color string. Default: #000. Examples: ?color=%231e293b (dark slate), ?color=%230f172a (near black), ?color=%237c3aed (purple), ?color=%23dc2626 (red). Use %23 to URL-encode the # character.
Color *string `json:"color" api:"color"`
// Show human-readable text below the bars. Example: ?show_text=true. Combine with font_size and text_align for print labels.
ShowText *bool `json:"show_text" api:"show_text"`
// Position of the human-readable text label. Default: bottom. Example: ?text_position=top Allowed values: bottom, top. Default: "bottom".
TextPosition *string `json:"text_position" api:"text_position"`
// Horizontal alignment of the text label. Default: center. Example: ?text_align=left Allowed values: center, left, right. Default: "center".
TextAlign *string `json:"text_align" api:"text_align"`
// Font size of the text label in pixels. Default: 14. Example: ?font_size=12
FontSize *float64 `json:"font_size" api:"font_size"`
// Font family of the text label. Default: monospace. Examples: ?font_family=monospace, ?font_family=sans-serif, ?font_family=Arial
FontFamily *string `json:"font_family" api:"font_family"`
// Width multiplier per module (bar). Default: 2. Increase for wider, more scannable barcodes. Example: ?bar_width=3
BarWidth *float64 `json:"bar_width" api:"bar_width"`
// Extra horizontal spacing between bars in pixels. Default: 0. Example: ?bar_gap=1
BarGap *float64 `json:"bar_gap" api:"bar_gap"`
// Background fill color. Default: #fff. Use transparent for no background. Example: ?background=%23f8fafc
Background *string `json:"background" api:"background"`
// Uniform margin around the barcode in pixels. Default: 10. Overridden per side by margin_top/bottom/left/right. Example: ?margin=6
Margin *float64 `json:"margin" api:"margin"`
// Top margin in pixels (overrides margin). Example: ?margin_top=4
MarginTop *float64 `json:"margin_top" api:"margin_top"`
// Bottom margin in pixels (overrides margin). Example: ?margin_bottom=4
MarginBottom *float64 `json:"margin_bottom" api:"margin_bottom"`
// Left margin in pixels (overrides margin). Example: ?margin_left=8
MarginLeft *float64 `json:"margin_left" api:"margin_left"`
// Right margin in pixels (overrides margin). Example: ?margin_right=8
MarginRight *float64 `json:"margin_right" api:"margin_right"`
// Rotate the barcode by 0, 90, 180 or 270 degrees. Default: 0. Use 90 or 270 for vertical label orientation. Example: ?rotation=90
Rotation *float64 `json:"rotation" api:"rotation"`
// Add horizontal bearer bars above and below the barcode. Required for ITF-14. Default: false. Example: ?bearer_bars=true
BearerBars *bool `json:"bearer_bars" api:"bearer_bars"`
// Measurement unit for dimensions. Default: px. Use mm, in or cm for print-ready output. Example: ?unit=mm Allowed values: px, mm, in, cm. Default: "px".
Unit *string `json:"unit" api:"unit"`
// Accessible label added as aria-label on the SVG element. Improves screen reader support. Example: ?aria_label=EAN-13+barcode+for+product+4006381333931
AriaLabel *string `json:"aria_label" api:"aria_label"`
// SVG <title> element for tooltip and accessibility. Example: ?title=Product+Barcode
Title *string `json:"title" api:"title"`
// SVG <desc> element for extended accessibility description. Example: ?desc=EAN-13+encoding+GTIN+for+Nivea+cream+75ml
Desc *string `json:"desc" api:"desc"`
// Output format. Default: svg. Use png to get a raster image. SVG is lossless and scalable; PNG is pixel-based and suitable for email, PDF or messaging. Example: ?format=png Allowed values: svg, png. Default: "svg".
Format *string `json:"format" api:"format"`
// Set share=true to persist the config and receive JSON instead of an image: { id, render_url, view_url, embed_url, expires_in }. Free plan: 3-day expiry with watermark. Paid plan: 6-month expiry, no branding. Default: false.
Share *bool `json:"share" api:"share"`
// Comma-separated list of fields to keep in the response, with dot notation for nested fields (e.g. name,location.city). Does not change the credit cost.
Fields *string `json:"fields" api:"fields"`
// Process the request asynchronously: the response is a job_id to poll on /v1/jobs/{id} (see waitForJob). Default: false.
IsAsync *bool `json:"is_async" api:"is_async"`
// Return HTTP 200 even when an error occurs; the error is then in the response body. Default: false.
SoftFail *bool `json:"soft_fail" api:"soft_fail"`
}
func (p *BarcodeParams) params() []param {
if p == nil {
return nil
}
values := make([]param, 0, 28)
if p.Data != "" {
values = append(values, param{"data", p.Data})
}
if p.Type != nil {
values = append(values, param{"type", *p.Type})
}
if p.Height != nil {
values = append(values, param{"height", *p.Height})
}
if p.Color != nil {
values = append(values, param{"color", *p.Color})
}
if p.ShowText != nil {
values = append(values, param{"show_text", *p.ShowText})
}
if p.TextPosition != nil {
values = append(values, param{"text_position", *p.TextPosition})
}
if p.TextAlign != nil {
values = append(values, param{"text_align", *p.TextAlign})
}
if p.FontSize != nil {
values = append(values, param{"font_size", *p.FontSize})
}
if p.FontFamily != nil {
values = append(values, param{"font_family", *p.FontFamily})
}
if p.BarWidth != nil {
values = append(values, param{"bar_width", *p.BarWidth})
}
if p.BarGap != nil {
values = append(values, param{"bar_gap", *p.BarGap})
}
if p.Background != nil {
values = append(values, param{"background", *p.Background})
}
if p.Margin != nil {
values = append(values, param{"margin", *p.Margin})
}
if p.MarginTop != nil {
values = append(values, param{"margin_top", *p.MarginTop})
}
if p.MarginBottom != nil {
values = append(values, param{"margin_bottom", *p.MarginBottom})
}
if p.MarginLeft != nil {
values = append(values, param{"margin_left", *p.MarginLeft})
}
if p.MarginRight != nil {
values = append(values, param{"margin_right", *p.MarginRight})
}
if p.Rotation != nil {
values = append(values, param{"rotation", *p.Rotation})
}
if p.BearerBars != nil {
values = append(values, param{"bearer_bars", *p.BearerBars})
}
if p.Unit != nil {
values = append(values, param{"unit", *p.Unit})
}
if p.AriaLabel != nil {
values = append(values, param{"aria_label", *p.AriaLabel})
}
if p.Title != nil {
values = append(values, param{"title", *p.Title})
}
if p.Desc != nil {
values = append(values, param{"desc", *p.Desc})
}
if p.Format != nil {
values = append(values, param{"format", *p.Format})
}
if p.Share != nil {
values = append(values, param{"share", *p.Share})
}
if p.Fields != nil {
values = append(values, param{"fields", *p.Fields})
}
if p.IsAsync != nil {
values = append(values, param{"is_async", *p.IsAsync})
}
if p.SoftFail != nil {
values = append(values, param{"soft_fail", *p.SoftFail})
}
return values
}
// ChartParams holds the parameters of Chart (GET / POST /v1/chart).
// Required fields are plain values; optional fields are pointers (use chartquery.String, chartquery.Float, chartquery.Bool) or nil slices and maps.
type ChartParams struct {
// Full chart config as URL-encoded JSON. Pass ?version= or ?v= separately to pin the chart version.
Query string `json:"query" api:"query,required"`
// Chart.js version to use. Alias: ?v=. Only v4.x is supported. Defaults to the installed version (4.5.1). Example: "4", "4.5", "4.5.1". The installed version is always returned in the X-ChartJS-Version response header. Default: "4.5.1".
Version *string `json:"version" api:"version"`
// If true, persist the result and return share URLs instead of an image. Leave false to get the image.
Share *bool `json:"share" api:"share"`
// Comma-separated list of fields to keep in the response, with dot notation for nested fields (e.g. name,location.city). Does not change the credit cost.
Fields *string `json:"fields" api:"fields"`
// Process the request asynchronously: the response is a job_id to poll on /v1/jobs/{id} (see waitForJob). Default: false.
IsAsync *bool `json:"is_async" api:"is_async"`
// Return HTTP 200 even when an error occurs; the error is then in the response body. Default: false.
SoftFail *bool `json:"soft_fail" api:"soft_fail"`
}
func (p *ChartParams) params() []param {
if p == nil {
return nil
}
values := make([]param, 0, 6)
if p.Query != "" {
values = append(values, param{"query", p.Query})
}
if p.Version != nil {
values = append(values, param{"version", *p.Version})
}
if p.Share != nil {
values = append(values, param{"share", *p.Share})
}
if p.Fields != nil {
values = append(values, param{"fields", *p.Fields})
}
if p.IsAsync != nil {
values = append(values, param{"is_async", *p.IsAsync})
}
if p.SoftFail != nil {
values = append(values, param{"soft_fail", *p.SoftFail})
}
return values
}
// ChartAIParams holds the parameters of ChartAI (GET / POST /v1/chart/ai).
// Required fields are plain values; optional fields are pointers (use chartquery.String, chartquery.Float, chartquery.Bool) or nil slices and maps.
type ChartAIParams struct {
// Describe your chart in plain English (max 1000 chars). Be specific: mention chart type, data topic, colors, style.
Prompt string `json:"prompt" api:"prompt,required"`
// Raw data for the chart. URL-encoded string, CSV, or JSON. AI will parse and structure it.
RawData *string `json:"raw_data" api:"raw_data"`
// Override the chart title generated by AI.
Title *string `json:"title" api:"title"`
// Override the chart subtitle.
Subtitle *string `json:"subtitle" api:"subtitle"`
// Legend position or visibility. Use "false" to hide. Allowed values: top, bottom, left, right, chartArea, false. Default: "top".
Legend *string `json:"legend" api:"legend"`
// Output format. Default: "png". Allowed values: png, svg. Default: "png".
Format *string `json:"format" api:"format"`
// Image width in pixels (50–4000). Default: 1200.
Width *float64 `json:"width" api:"width"`
// Image height in pixels (50–4000). Default: 600.
Height *float64 `json:"height" api:"height"`
// Background color as a hex value. Default: #ffffff.
Background *string `json:"background" api:"background"`
// Device pixel ratio for the rendered image. Default: 1.
DevicePixelRatio *float64 `json:"device_pixel_ratio" api:"device_pixel_ratio"`
// Set share=true to persist the config and receive JSON instead of an image: { id, render_url, view_url, embed_url, expires_in }. Free plan: 3-day expiry with watermark. Paid plan: 6-month expiry, no branding. Default: false.
Share *bool `json:"share" api:"share"`
// Comma-separated list of fields to keep in the response, with dot notation for nested fields (e.g. name,location.city). Does not change the credit cost.
Fields *string `json:"fields" api:"fields"`
// Process the request asynchronously: the response is a job_id to poll on /v1/jobs/{id} (see waitForJob). Default: false.
IsAsync *bool `json:"is_async" api:"is_async"`
// Return HTTP 200 even when an error occurs; the error is then in the response body. Default: false.
SoftFail *bool `json:"soft_fail" api:"soft_fail"`
}
func (p *ChartAIParams) params() []param {
if p == nil {
return nil
}
values := make([]param, 0, 14)
if p.Prompt != "" {
values = append(values, param{"prompt", p.Prompt})
}
if p.RawData != nil {
values = append(values, param{"raw_data", *p.RawData})
}
if p.Title != nil {
values = append(values, param{"title", *p.Title})
}
if p.Subtitle != nil {
values = append(values, param{"subtitle", *p.Subtitle})
}
if p.Legend != nil {
values = append(values, param{"legend", *p.Legend})
}
if p.Format != nil {
values = append(values, param{"format", *p.Format})
}
if p.Width != nil {
values = append(values, param{"width", *p.Width})
}
if p.Height != nil {
values = append(values, param{"height", *p.Height})
}
if p.Background != nil {
values = append(values, param{"background", *p.Background})
}
if p.DevicePixelRatio != nil {
values = append(values, param{"device_pixel_ratio", *p.DevicePixelRatio})
}
if p.Share != nil {
values = append(values, param{"share", *p.Share})
}
if p.Fields != nil {
values = append(values, param{"fields", *p.Fields})
}
if p.IsAsync != nil {
values = append(values, param{"is_async", *p.IsAsync})
}
if p.SoftFail != nil {
values = append(values, param{"soft_fail", *p.SoftFail})
}
return values
}
// ChartRenderParams holds the parameters of ChartRender (GET /v1/chart/render/{id}).
// Required fields are plain values; optional fields are pointers (use chartquery.String, chartquery.Float, chartquery.Bool) or nil slices and maps.
type ChartRenderParams struct {
// The chart ID returned in the X-Chart-Render-URL header when saving a chart. Format: cq-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
ID string `json:"id" api:"id,required"`
// Override the chart title.
Title *string `json:"title" api:"title"`
// Override X-axis labels. Comma-separated.
Labels *string `json:"labels" api:"labels"`
// Override first dataset values. Comma-separated numbers. Use data2, data3… for additional datasets.
Data1 *string `json:"data1" api:"data1"`
// Override output width in pixels (50–4000).
Width *string `json:"width" api:"width"`
// Override output height in pixels (50–4000).
Height *string `json:"height" api:"height"`
// Override output format. Allowed values: png, svg. Default: "png".
Format *string `json:"format" api:"format"`
// Comma-separated list of fields to keep in the response, with dot notation for nested fields (e.g. name,location.city). Does not change the credit cost.
Fields *string `json:"fields" api:"fields"`
// Process the request asynchronously: the response is a job_id to poll on /v1/jobs/{id} (see waitForJob). Default: false.
IsAsync *bool `json:"is_async" api:"is_async"`
// Return HTTP 200 even when an error occurs; the error is then in the response body. Default: false.
SoftFail *bool `json:"soft_fail" api:"soft_fail"`
}
func (p *ChartRenderParams) params() []param {
if p == nil {
return nil
}
values := make([]param, 0, 10)
if p.ID != "" {
values = append(values, param{"id", p.ID})
}
if p.Title != nil {
values = append(values, param{"title", *p.Title})
}
if p.Labels != nil {
values = append(values, param{"labels", *p.Labels})
}
if p.Data1 != nil {
values = append(values, param{"data1", *p.Data1})
}
if p.Width != nil {
values = append(values, param{"width", *p.Width})
}
if p.Height != nil {
values = append(values, param{"height", *p.Height})
}
if p.Format != nil {
values = append(values, param{"format", *p.Format})
}
if p.Fields != nil {
values = append(values, param{"fields", *p.Fields})
}
if p.IsAsync != nil {
values = append(values, param{"is_async", *p.IsAsync})
}
if p.SoftFail != nil {
values = append(values, param{"soft_fail", *p.SoftFail})
}
return values
}
// ChartViewParams holds the parameters of ChartView (GET /v1/chart/view/{id}).
// Required fields are plain values; optional fields are pointers (use chartquery.String, chartquery.Float, chartquery.Bool) or nil slices and maps.
type ChartViewParams struct {
// The chart ID returned in the X-Chart-View-URL header when saving a chart. Format: cq-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
ID string `json:"id" api:"id,required"`
// Set share=true to persist the config and receive JSON instead of an image: { id, render_url, view_url, embed_url, expires_in }. Free plan: 3-day expiry with watermark. Paid plan: 6-month expiry, no branding. Default: false.
Share *bool `json:"share" api:"share"`
// Comma-separated list of fields to keep in the response, with dot notation for nested fields (e.g. name,location.city). Does not change the credit cost.
Fields *string `json:"fields" api:"fields"`
// Process the request asynchronously: the response is a job_id to poll on /v1/jobs/{id} (see waitForJob). Default: false.
IsAsync *bool `json:"is_async" api:"is_async"`
// Return HTTP 200 even when an error occurs; the error is then in the response body. Default: false.
SoftFail *bool `json:"soft_fail" api:"soft_fail"`
}
func (p *ChartViewParams) params() []param {
if p == nil {
return nil
}
values := make([]param, 0, 5)
if p.ID != "" {
values = append(values, param{"id", p.ID})
}
if p.Share != nil {
values = append(values, param{"share", *p.Share})
}
if p.Fields != nil {
values = append(values, param{"fields", *p.Fields})
}
if p.IsAsync != nil {
values = append(values, param{"is_async", *p.IsAsync})
}
if p.SoftFail != nil {
values = append(values, param{"soft_fail", *p.SoftFail})
}
return values
}
// DiagramParams holds the parameters of Diagram (GET / POST /v1/diagram).
// Required fields are plain values; optional fields are pointers (use chartquery.String, chartquery.Float, chartquery.Bool) or nil slices and maps.
type DiagramParams struct {
// Diagram language. Allowed values: mermaid, graphviz, plantuml, d2, svgbob, nomnoml, blockdiag, seqdiag, actdiag, nwdiag, bpmn, erd, excalidraw, ditaa, vega, vegalite, wavedrom, wireviz, c4plantuml, structurizr…. Default: "mermaid".
Type string `json:"type" api:"type,required"`
// Diagram source code (URL-encoded).
Query string `json:"query" api:"query,required"`
// Use png so ChatGPT can display the image. svg is for download or infinite scale. Allowed values: svg, png, jpeg, pdf. Default: "svg".
Format *string `json:"format" api:"format"`
// If true, persist the result and return share URLs instead of an image. Leave false to get the image.
Share *bool `json:"share" api:"share"`
// Comma-separated list of fields to keep in the response, with dot notation for nested fields (e.g. name,location.city). Does not change the credit cost.
Fields *string `json:"fields" api:"fields"`
// Process the request asynchronously: the response is a job_id to poll on /v1/jobs/{id} (see waitForJob). Default: false.
IsAsync *bool `json:"is_async" api:"is_async"`
// Return HTTP 200 even when an error occurs; the error is then in the response body. Default: false.
SoftFail *bool `json:"soft_fail" api:"soft_fail"`
}
func (p *DiagramParams) params() []param {
if p == nil {
return nil
}
values := make([]param, 0, 7)
if p.Type != "" {
values = append(values, param{"type", p.Type})
}
if p.Query != "" {
values = append(values, param{"query", p.Query})
}
if p.Format != nil {
values = append(values, param{"format", *p.Format})
}
if p.Share != nil {
values = append(values, param{"share", *p.Share})
}
if p.Fields != nil {
values = append(values, param{"fields", *p.Fields})
}
if p.IsAsync != nil {
values = append(values, param{"is_async", *p.IsAsync})
}
if p.SoftFail != nil {
values = append(values, param{"soft_fail", *p.SoftFail})
}
return values
}
// DiagramAIParams holds the parameters of DiagramAI (GET / POST /v1/diagram/ai).
// Required fields are plain values; optional fields are pointers (use chartquery.String, chartquery.Float, chartquery.Bool) or nil slices and maps.
type DiagramAIParams struct {
// Describe your diagram in plain English (max 1000 chars). Be specific: mention the diagram type, key entities, and relationships.
Prompt string `json:"prompt" api:"prompt,required"`
// Preferred diagram language. AI chooses if omitted. Examples: "mermaid", "d2", "plantuml", "graphviz". Allowed values: mermaid, d2, plantuml, graphviz. Default: "mermaid".
DiagramType *string `json:"diagram_type" api:"diagram_type"`
// Output format. Default: "svg". Allowed values: svg, png, jpeg, pdf. Default: "svg".
OutputFormat *string `json:"output_format" api:"output_format"`
// Set share=true to persist the config and receive JSON instead of an image: { id, render_url, view_url, embed_url, expires_in }. Free plan: 3-day expiry. Paid plan: 6-month expiry. Default: false.
Share *bool `json:"share" api:"share"`
// Comma-separated list of fields to keep in the response, with dot notation for nested fields (e.g. name,location.city). Does not change the credit cost.
Fields *string `json:"fields" api:"fields"`
// Process the request asynchronously: the response is a job_id to poll on /v1/jobs/{id} (see waitForJob). Default: false.
IsAsync *bool `json:"is_async" api:"is_async"`
// Return HTTP 200 even when an error occurs; the error is then in the response body. Default: false.
SoftFail *bool `json:"soft_fail" api:"soft_fail"`
}
func (p *DiagramAIParams) params() []param {
if p == nil {
return nil
}
values := make([]param, 0, 7)
if p.Prompt != "" {
values = append(values, param{"prompt", p.Prompt})
}
if p.DiagramType != nil {
values = append(values, param{"diagram_type", *p.DiagramType})
}
if p.OutputFormat != nil {
values = append(values, param{"output_format", *p.OutputFormat})
}
if p.Share != nil {
values = append(values, param{"share", *p.Share})
}
if p.Fields != nil {
values = append(values, param{"fields", *p.Fields})
}
if p.IsAsync != nil {
values = append(values, param{"is_async", *p.IsAsync})
}
if p.SoftFail != nil {
values = append(values, param{"soft_fail", *p.SoftFail})
}
return values
}
// DiagramRenderParams holds the parameters of DiagramRender (GET /v1/diagram/render/{id}).
// Required fields are plain values; optional fields are pointers (use chartquery.String, chartquery.Float, chartquery.Bool) or nil slices and maps.
type DiagramRenderParams struct {
// The diagram ID returned in the X-Diagram-Render-URL header when saving a diagram. Format: cq-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
ID string `json:"id" api:"id,required"`
// Override output format. Allowed values: svg, png, jpeg, pdf. Default: "svg".
Format *string `json:"format" api:"format"`
// Override the diagram source code (URL-encoded).
Query *string `json:"query" api:"query"`
// Set share=true to persist the config and receive JSON instead of an image: { id, render_url, view_url, embed_url, expires_in }. Free plan: 3-day expiry with watermark. Paid plan: 6-month expiry, no branding. Default: false.
Share *bool `json:"share" api:"share"`
// Comma-separated list of fields to keep in the response, with dot notation for nested fields (e.g. name,location.city). Does not change the credit cost.
Fields *string `json:"fields" api:"fields"`
// Process the request asynchronously: the response is a job_id to poll on /v1/jobs/{id} (see waitForJob). Default: false.
IsAsync *bool `json:"is_async" api:"is_async"`
// Return HTTP 200 even when an error occurs; the error is then in the response body. Default: false.
SoftFail *bool `json:"soft_fail" api:"soft_fail"`
}
func (p *DiagramRenderParams) params() []param {
if p == nil {
return nil
}
values := make([]param, 0, 7)
if p.ID != "" {
values = append(values, param{"id", p.ID})
}
if p.Format != nil {
values = append(values, param{"format", *p.Format})
}
if p.Query != nil {
values = append(values, param{"query", *p.Query})
}
if p.Share != nil {
values = append(values, param{"share", *p.Share})
}
if p.Fields != nil {
values = append(values, param{"fields", *p.Fields})
}
if p.IsAsync != nil {
values = append(values, param{"is_async", *p.IsAsync})
}
if p.SoftFail != nil {
values = append(values, param{"soft_fail", *p.SoftFail})
}
return values
}
// DiagramViewParams holds the parameters of DiagramView (GET /v1/diagram/view/{id}).
// Required fields are plain values; optional fields are pointers (use chartquery.String, chartquery.Float, chartquery.Bool) or nil slices and maps.
type DiagramViewParams struct {
// The diagram ID returned in the X-Diagram-View-URL header when saving a diagram. Format: cq-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
ID string `json:"id" api:"id,required"`
// Set share=true to persist the config and receive JSON instead of an image: { id, render_url, view_url, embed_url, expires_in }. Free plan: 3-day expiry with watermark. Paid plan: 6-month expiry, no branding. Default: false.
Share *bool `json:"share" api:"share"`
// Comma-separated list of fields to keep in the response, with dot notation for nested fields (e.g. name,location.city). Does not change the credit cost.
Fields *string `json:"fields" api:"fields"`
// Process the request asynchronously: the response is a job_id to poll on /v1/jobs/{id} (see waitForJob). Default: false.
IsAsync *bool `json:"is_async" api:"is_async"`
// Return HTTP 200 even when an error occurs; the error is then in the response body. Default: false.
SoftFail *bool `json:"soft_fail" api:"soft_fail"`
}
func (p *DiagramViewParams) params() []param {
if p == nil {
return nil
}
values := make([]param, 0, 5)
if p.ID != "" {
values = append(values, param{"id", p.ID})
}
if p.Share != nil {
values = append(values, param{"share", *p.Share})
}
if p.Fields != nil {
values = append(values, param{"fields", *p.Fields})
}
if p.IsAsync != nil {
values = append(values, param{"is_async", *p.IsAsync})
}
if p.SoftFail != nil {
values = append(values, param{"soft_fail", *p.SoftFail})
}
return values
}
// JobsParams holds the parameters of Jobs (GET /v1/jobs/{id}).
// Required fields are plain values; optional fields are pointers (use chartquery.String, chartquery.Float, chartquery.Bool) or nil slices and maps.
type JobsParams struct {
// The job_id returned by an endpoint called with is_async=true.
ID string `json:"id" api:"id,required"`
}
func (p *JobsParams) params() []param {
if p == nil {
return nil
}
values := make([]param, 0, 1)
if p.ID != "" {
values = append(values, param{"id", p.ID})
}
return values
}
// LabelParams holds the parameters of Label (GET / POST /v1/label).
// Required fields are plain values; optional fields are pointers (use chartquery.String, chartquery.Float, chartquery.Bool) or nil slices and maps.
type LabelParams struct {
// Use png so ChatGPT can display the image. svg is for download or infinite scale. Allowed values: svg, png. Default: "svg".
Format *string `json:"format" api:"format"`
// If true, persist the result and return share URLs instead of an image. Leave false to get the image. Default: false.
Share *bool `json:"share" api:"share"`
// Full label config as URL-encoded JSON. Must include width and elements. Text items use content and size (1-10), not text or fontSize.
Query string `json:"query" api:"query,required"`
// Comma-separated list of fields to keep in the response, with dot notation for nested fields (e.g. name,location.city). Does not change the credit cost.
Fields *string `json:"fields" api:"fields"`
// Process the request asynchronously: the response is a job_id to poll on /v1/jobs/{id} (see waitForJob). Default: false.
IsAsync *bool `json:"is_async" api:"is_async"`
// Return HTTP 200 even when an error occurs; the error is then in the response body. Default: false.
SoftFail *bool `json:"soft_fail" api:"soft_fail"`
}
func (p *LabelParams) params() []param {
if p == nil {
return nil
}
values := make([]param, 0, 6)
if p.Format != nil {
values = append(values, param{"format", *p.Format})
}
if p.Share != nil {
values = append(values, param{"share", *p.Share})
}
if p.Query != "" {
values = append(values, param{"query", p.Query})
}
if p.Fields != nil {
values = append(values, param{"fields", *p.Fields})
}
if p.IsAsync != nil {
values = append(values, param{"is_async", *p.IsAsync})
}
if p.SoftFail != nil {
values = append(values, param{"soft_fail", *p.SoftFail})
}
return values
}
// LabelCompileParams holds the parameters of LabelCompile (POST /v1/label/compile).
// Required fields are plain values; optional fields are pointers (use chartquery.String, chartquery.Float, chartquery.Bool) or nil slices and maps.
type LabelCompileParams struct {
// Label width. Required. Default unit is mm. Example: 40. Do not send query instead of width.
Width float64 `json:"width" api:"width,required"`
// Label height in the same unit. Example: 30. Omit for receipt / continuous mode.
Height *float64 `json:"height" api:"height"`
// Measurement unit for width and height. Default mm. Use mm unless you are working in printer dots. Allowed values: mm, inch, dot. Default: "mm".
Unit *string `json:"unit" api:"unit"`
// Printer DPI. Default 203.
DPI *float64 `json:"dpi" api:"dpi"`
// Gap between labels in mm. Ignored for receipts.
Gap *float64 `json:"gap" api:"gap"`
// Print speed, 1-18.
Speed *float64 `json:"speed" api:"speed"`
// Print darkness, 0-15.
Density *float64 `json:"density" api:"density"`
// Print direction. 0 = normal, 1 = reversed. Default: 1.
Direction *float64 `json:"direction" api:"direction"`
// Number of copies. Minimum 1.
Copies *float64 `json:"copies" api:"copies"`
// Printer profile id (tsc-te210, zebra-zd420, …).
Printer *string `json:"printer" api:"printer"`
// Required array. Text items need type=text, content, and size (1-10 magnification). Do not use text, fontSize, or type=barcode. Positions x/y are in dots. Example item: {"type":"text","content":"Order: 1042","x":10,"y":10,"size":2}.
Elements []map[string]any `json:"elements" api:"elements,required"`
// Required printer language. Example: zpl or tsc. Do not omit. Allowed values: tsc, zpl, epl, cpcl, dpl, sbpl, escpos, starprnt, ipl. Default: "tsc".
Language string `json:"language" api:"language,required"`
// Comma-separated list of fields to keep in the response, with dot notation for nested fields (e.g. name,location.city). Does not change the credit cost.
Fields *string `json:"fields" api:"fields"`
// Process the request asynchronously: the response is a job_id to poll on /v1/jobs/{id} (see waitForJob). Default: false.
IsAsync *bool `json:"is_async" api:"is_async"`
// Return HTTP 200 even when an error occurs; the error is then in the response body. Default: false.
SoftFail *bool `json:"soft_fail" api:"soft_fail"`
}
func (p *LabelCompileParams) params() []param {
if p == nil {
return nil
}
values := make([]param, 0, 15)
values = append(values, param{"width", p.Width})
if p.Height != nil {
values = append(values, param{"height", *p.Height})
}
if p.Unit != nil {
values = append(values, param{"unit", *p.Unit})
}
if p.DPI != nil {
values = append(values, param{"dpi", *p.DPI})
}
if p.Gap != nil {
values = append(values, param{"gap", *p.Gap})
}
if p.Speed != nil {
values = append(values, param{"speed", *p.Speed})
}
if p.Density != nil {
values = append(values, param{"density", *p.Density})
}
if p.Direction != nil {
values = append(values, param{"direction", *p.Direction})
}
if p.Copies != nil {
values = append(values, param{"copies", *p.Copies})
}
if p.Printer != nil {
values = append(values, param{"printer", *p.Printer})
}
if p.Elements != nil {
values = append(values, param{"elements", p.Elements})
}
if p.Language != "" {
values = append(values, param{"language", p.Language})
}
if p.Fields != nil {
values = append(values, param{"fields", *p.Fields})
}
if p.IsAsync != nil {
values = append(values, param{"is_async", *p.IsAsync})
}
if p.SoftFail != nil {
values = append(values, param{"soft_fail", *p.SoftFail})
}
return values
}
// LabelConvertParams holds the parameters of LabelConvert (POST /v1/label/convert).
// Required fields are plain values; optional fields are pointers (use chartquery.String, chartquery.Float, chartquery.Bool) or nil slices and maps.
type LabelConvertParams struct {
// Raw printer commands to convert. Also send from and to.
Source string `json:"source" api:"source,required"`
// Source language. Allowed values: tsc, zpl, epl, cpcl, dpl, sbpl, ipl. Default: "tsc".
From string `json:"from" api:"from,required"`
// Target language. Allowed values: tsc, zpl, epl, cpcl, dpl, sbpl, escpos, starprnt, ipl. Default: "tsc".
To string `json:"to" api:"to,required"`
// Override DPI on the converted output.
DPI *float64 `json:"dpi" api:"dpi"`
// Override print speed, 1-18.
Speed *float64 `json:"speed" api:"speed"`
// Override print darkness, 0-15.
Density *float64 `json:"density" api:"density"`
// Override copies. Minimum 1.
Copies *float64 `json:"copies" api:"copies"`
// Comma-separated list of fields to keep in the response, with dot notation for nested fields (e.g. name,location.city). Does not change the credit cost.
Fields *string `json:"fields" api:"fields"`
// Process the request asynchronously: the response is a job_id to poll on /v1/jobs/{id} (see waitForJob). Default: false.
IsAsync *bool `json:"is_async" api:"is_async"`
// Return HTTP 200 even when an error occurs; the error is then in the response body. Default: false.
SoftFail *bool `json:"soft_fail" api:"soft_fail"`
}
func (p *LabelConvertParams) params() []param {
if p == nil {
return nil
}
values := make([]param, 0, 10)
if p.Source != "" {
values = append(values, param{"source", p.Source})
}
if p.From != "" {
values = append(values, param{"from", p.From})
}
if p.To != "" {
values = append(values, param{"to", p.To})
}
if p.DPI != nil {
values = append(values, param{"dpi", *p.DPI})
}
if p.Speed != nil {
values = append(values, param{"speed", *p.Speed})
}
if p.Density != nil {
values = append(values, param{"density", *p.Density})
}
if p.Copies != nil {
values = append(values, param{"copies", *p.Copies})
}
if p.Fields != nil {
values = append(values, param{"fields", *p.Fields})
}
if p.IsAsync != nil {
values = append(values, param{"is_async", *p.IsAsync})
}
if p.SoftFail != nil {
values = append(values, param{"soft_fail", *p.SoftFail})
}
return values
}
// LabelParseParams holds the parameters of LabelParse (POST /v1/label/parse).
// Required fields are plain values; optional fields are pointers (use chartquery.String, chartquery.Float, chartquery.Bool) or nil slices and maps.
type LabelParseParams struct {
// Raw printer commands to parse. Also send language.
Source string `json:"source" api:"source,required"`
// Language of the source commands. Example: tsc or zpl. Allowed values: tsc, zpl, epl, cpcl, dpl, sbpl, ipl. Default: "tsc".
Language string `json:"language" api:"language,required"`
// Comma-separated list of fields to keep in the response, with dot notation for nested fields (e.g. name,location.city). Does not change the credit cost.
Fields *string `json:"fields" api:"fields"`
// Process the request asynchronously: the response is a job_id to poll on /v1/jobs/{id} (see waitForJob). Default: false.
IsAsync *bool `json:"is_async" api:"is_async"`
// Return HTTP 200 even when an error occurs; the error is then in the response body. Default: false.
SoftFail *bool `json:"soft_fail" api:"soft_fail"`
}
func (p *LabelParseParams) params() []param {
if p == nil {
return nil
}
values := make([]param, 0, 5)
if p.Source != "" {
values = append(values, param{"source", p.Source})
}
if p.Language != "" {
values = append(values, param{"language", p.Language})
}
if p.Fields != nil {
values = append(values, param{"fields", *p.Fields})
}
if p.IsAsync != nil {
values = append(values, param{"is_async", *p.IsAsync})
}
if p.SoftFail != nil {
values = append(values, param{"soft_fail", *p.SoftFail})
}
return values
}
// LabelRenderParams holds the parameters of LabelRender (GET /v1/label/render/{id}).
// Required fields are plain values; optional fields are pointers (use chartquery.String, chartquery.Float, chartquery.Bool) or nil slices and maps.
type LabelRenderParams struct {
ID string `json:"id" api:"id,required"`
// Override output format. Allowed values: svg, png. Default: "svg".
Format *string `json:"format" api:"format"`
// Comma-separated list of fields to keep in the response, with dot notation for nested fields (e.g. name,location.city). Does not change the credit cost.
Fields *string `json:"fields" api:"fields"`
// Process the request asynchronously: the response is a job_id to poll on /v1/jobs/{id} (see waitForJob). Default: false.
IsAsync *bool `json:"is_async" api:"is_async"`
// Return HTTP 200 even when an error occurs; the error is then in the response body. Default: false.
SoftFail *bool `json:"soft_fail" api:"soft_fail"`
}
func (p *LabelRenderParams) params() []param {
if p == nil {
return nil
}
values := make([]param, 0, 5)
if p.ID != "" {
values = append(values, param{"id", p.ID})
}
if p.Format != nil {
values = append(values, param{"format", *p.Format})
}
if p.Fields != nil {
values = append(values, param{"fields", *p.Fields})
}
if p.IsAsync != nil {
values = append(values, param{"is_async", *p.IsAsync})
}
if p.SoftFail != nil {
values = append(values, param{"soft_fail", *p.SoftFail})
}
return values
}
// LabelValidateParams holds the parameters of LabelValidate (POST /v1/label/validate).
// Required fields are plain values; optional fields are pointers (use chartquery.String, chartquery.Float, chartquery.Bool) or nil slices and maps.
type LabelValidateParams struct {
// Raw printer commands to validate. Also send language.
Source string `json:"source" api:"source,required"`
// Language of the source commands. Example: tsc or zpl. Allowed values: tsc, zpl, epl, cpcl, dpl, sbpl, ipl. Default: "tsc".
Language string `json:"language" api:"language,required"`
// Comma-separated list of fields to keep in the response, with dot notation for nested fields (e.g. name,location.city). Does not change the credit cost.
Fields *string `json:"fields" api:"fields"`
// Process the request asynchronously: the response is a job_id to poll on /v1/jobs/{id} (see waitForJob). Default: false.
IsAsync *bool `json:"is_async" api:"is_async"`
// Return HTTP 200 even when an error occurs; the error is then in the response body. Default: false.
SoftFail *bool `json:"soft_fail" api:"soft_fail"`
}
func (p *LabelValidateParams) params() []param {
if p == nil {
return nil
}
values := make([]param, 0, 5)
if p.Source != "" {
values = append(values, param{"source", p.Source})
}
if p.Language != "" {
values = append(values, param{"language", p.Language})
}
if p.Fields != nil {
values = append(values, param{"fields", *p.Fields})
}
if p.IsAsync != nil {
values = append(values, param{"is_async", *p.IsAsync})
}
if p.SoftFail != nil {
values = append(values, param{"soft_fail", *p.SoftFail})
}
return values
}
// LabelViewParams holds the parameters of LabelView (GET /v1/label/view/{id}).
// Required fields are plain values; optional fields are pointers (use chartquery.String, chartquery.Float, chartquery.Bool) or nil slices and maps.
type LabelViewParams struct {
ID string `json:"id" api:"id,required"`
// Comma-separated list of fields to keep in the response, with dot notation for nested fields (e.g. name,location.city). Does not change the credit cost.
Fields *string `json:"fields" api:"fields"`
// Process the request asynchronously: the response is a job_id to poll on /v1/jobs/{id} (see waitForJob). Default: false.
IsAsync *bool `json:"is_async" api:"is_async"`
// Return HTTP 200 even when an error occurs; the error is then in the response body. Default: false.
SoftFail *bool `json:"soft_fail" api:"soft_fail"`
}
func (p *LabelViewParams) params() []param {
if p == nil {
return nil
}
values := make([]param, 0, 4)
if p.ID != "" {
values = append(values, param{"id", p.ID})
}
if p.Fields != nil {
values = append(values, param{"fields", *p.Fields})
}
if p.IsAsync != nil {
values = append(values, param{"is_async", *p.IsAsync})
}
if p.SoftFail != nil {
values = append(values, param{"soft_fail", *p.SoftFail})
}
return values
}
// QrcodeParams holds the parameters of Qrcode (GET / POST /v1/qrcode).
// Required fields are plain values; optional fields are pointers (use chartquery.String, chartquery.Float, chartquery.Bool) or nil slices and maps.
type QrcodeParams struct {
// Data to encode in the QR code. Examples:
Data string `json:"data" api:"data,required"`
// Output size in pixels (width = height). Default: 200. Examples: ?size=200 (thumbnail), ?size=300 (standard), ?size=400 (large), ?size=600 (poster). For print, use the unit param with mm/cm instead.
Size *float64 `json:"size" api:"size"`
// Error correction level. Default: M. Higher levels allow more damage/obscuring before the code becomes unreadable. Allowed values: L, M, Q, H. Default: "M".
EcLevel *string `json:"ec_level" api:"ec_level"`
// Module (dot) shape. Default: square. Controls the visual style of each QR code module. Allowed values: square, rounded, dots, diamond, classy, classy-rounded, extra-rounded, vertical-line, horizontal-line, small-square, tiny-square. Default: "square".
DotType *string `json:"dot_type" api:"dot_type"`
// Module color as CSS hex. Default: #000. Examples: ?color=%236366f1 (indigo), ?color=%23dc2626 (red), ?color=%23059669 (green), ?color=%230891b2 (teal). Use %23 to URL-encode #. For gradient objects, use POST instead.
Color *string `json:"color" api:"color"`
// Overall QR code shape. Default: square. Use circle to clip the entire QR into a circle: great for profile/avatar-style codes. Example: ?shape=circle&dot_type=dots Allowed values: square, circle. Default: "square".
Shape *string `json:"shape" api:"shape"`
// Module size ratio between 0.1 and 1. Default: 1 (full). Values below 1 add spacing between modules for a lighter look. Example: ?dot_size=0.85
DotSize *float64 `json:"dot_size" api:"dot_size"`
// Background color. Default: #fff. Set to transparent for no background. Example: ?background=%230f172a for dark background. Use %23 to encode #.
Background *string `json:"background" api:"background"`
// Quiet zone width in modules around the QR code. Default: 4. Minimum recommended by the QR standard: 4. Example: ?margin=2 (compact) or ?margin=6 (extra padding).
Margin *float64 `json:"margin" api:"margin"`
// QR version from 1 to 40 (determines grid size and data capacity). Leave unset for auto-selection based on data length and ec_level. Example: ?version=5
Version *float64 `json:"version" api:"version"`
// Encoding mode. Default: auto (best mode selected for the data). Use numeric for digits-only, alphanumeric for uppercase + digits, byte for arbitrary text/UTF-8. Example: ?mode=numeric Allowed values: auto, numeric, alphanumeric, byte. Default: "auto".
Mode *string `json:"mode" api:"mode"`
// Mask pattern from 0 to 7. Default: auto (best mask selected to minimize visual patterns). Only set manually if you need a deterministic output. Example: ?mask=3
Mask *float64 `json:"mask" api:"mask"`
// Measurement unit for the size param. Default: px. Use mm, in or cm with the size param for print-ready output. Example: ?size=50&unit=mm Allowed values: px, mm, in, cm. Default: "px".
Unit *string `json:"unit" api:"unit"`
// Prepend an XML declaration (<?xml version="1.0" encoding="UTF-8"?>) to the SVG output. Useful when the SVG will be used as a standalone XML file. Default: false. Example: ?xml_declaration=true
XMLDeclaration *bool `json:"xml_declaration" api:"xml_declaration"`
// Accessible label added as aria-label on the SVG element. Example: ?aria_label=QR+code+linking+to+chartquery.com
AriaLabel *string `json:"aria_label" api:"aria_label"`
// SVG <title> element shown as a browser tooltip and used by screen readers. Example: ?title=ChartQuery+Website
Title *string `json:"title" api:"title"`
// SVG <desc> element for extended accessibility description. Example: ?desc=Scan+to+visit+https://chartquery.com
Desc *string `json:"desc" api:"desc"`
// Output format. Default: svg. Use png to get a raster image. SVG is lossless and scalable; PNG is pixel-based and suitable for email, PDF or messaging. Example: ?format=png Allowed values: svg, png. Default: "svg".
Format *string `json:"format" api:"format"`
// Set share=true to persist the config and receive JSON instead of an image: { id, render_url, view_url, embed_url, expires_in }. Free plan: 3-day expiry with watermark. Paid plan: 6-month expiry, no branding. Default: false.
Share *bool `json:"share" api:"share"`
// Comma-separated list of fields to keep in the response, with dot notation for nested fields (e.g. name,location.city). Does not change the credit cost.
Fields *string `json:"fields" api:"fields"`
// Process the request asynchronously: the response is a job_id to poll on /v1/jobs/{id} (see waitForJob). Default: false.
IsAsync *bool `json:"is_async" api:"is_async"`
// Return HTTP 200 even when an error occurs; the error is then in the response body. Default: false.
SoftFail *bool `json:"soft_fail" api:"soft_fail"`
}
func (p *QrcodeParams) params() []param {
if p == nil {
return nil
}
values := make([]param, 0, 22)
if p.Data != "" {
values = append(values, param{"data", p.Data})
}
if p.Size != nil {
values = append(values, param{"size", *p.Size})
}
if p.EcLevel != nil {
values = append(values, param{"ec_level", *p.EcLevel})
}
if p.DotType != nil {
values = append(values, param{"dot_type", *p.DotType})
}
if p.Color != nil {
values = append(values, param{"color", *p.Color})
}
if p.Shape != nil {
values = append(values, param{"shape", *p.Shape})
}
if p.DotSize != nil {
values = append(values, param{"dot_size", *p.DotSize})
}
if p.Background != nil {
values = append(values, param{"background", *p.Background})
}
if p.Margin != nil {