-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.gen.go
More file actions
2099 lines (1727 loc) · 70.4 KB
/
Copy pathapi.gen.go
File metadata and controls
2099 lines (1727 loc) · 70.4 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
// Package api provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.3.0 DO NOT EDIT.
package api
import (
"bytes"
"compress/gzip"
"context"
"encoding/base64"
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"path"
"strings"
"github.com/getkin/kin-openapi/openapi3"
"github.com/gorilla/mux"
"github.com/oapi-codegen/runtime"
)
const (
DeveloperTokenScopes = "DeveloperToken.Scopes"
)
// Defines values for PublicModulePortType.
const (
Source PublicModulePortType = "source"
Target PublicModulePortType = "target"
)
// BuildPushOptions defines model for BuildPushOptions.
type BuildPushOptions struct {
Password string `json:"password"`
Repo string `json:"repo"`
Tag string `json:"tag"`
Username string `json:"username"`
}
// BundledDependency A Helm release the module offers to provision on install. Author-declared values cover the common case; exposedSchema lets the user override a subset via the install form.
type BundledDependency struct {
// ChartName Chart name within the repo.
ChartName string `json:"chartName"`
// ChartRepo Helm repository URL.
ChartRepo string `json:"chartRepo"`
// ChartVersion Pinned chart version. Empty means use latest at install time (not recommended).
ChartVersion *string `json:"chartVersion,omitempty"`
// ConnectionHint Hint shown to the user about how the module reaches the bundle — typically the in-cluster Service URL (e.g. http://tei.tei.svc.cluster.local:80) and which module setting field receives it.
ConnectionHint *string `json:"connectionHint,omitempty"`
// DefaultEnabled Whether the install-form checkbox starts checked.
DefaultEnabled *bool `json:"defaultEnabled,omitempty"`
// Description Shown next to the checkbox in the install UI.
Description *string `json:"description,omitempty"`
// ExposedSchema JSON Schema fragment defining which value keys the install form exposes as user-editable fields. Same renderer the flow editor uses. Empty means the bundle is install-as-is, no user knobs.
ExposedSchema *map[string]interface{} `json:"exposedSchema,omitempty"`
// Name Stable identifier — becomes the bundle's Helm release name and the install-form checkbox label.
Name string `json:"name"`
// Values Author-supplied default values passed to the bundle's chart. Map of any-typed values. Merged on top of chart defaults at install time, then overlaid by user overrides.
Values *map[string]interface{} `json:"values,omitempty"`
// ValuesYAML Optional raw values.yaml content for complex bundles where the structured values map is awkward. Merged before values map (which takes precedence).
ValuesYAML *string `json:"valuesYAML,omitempty"`
}
// HelmBundle Selector into the operator chart's curated subchart set. Name
// must match a registered subchart alias (e.g. "tei", "pgvector").
// When the user ticks the bundle's checkbox in the install UI,
// the bundle's set_flags get appended to the module helm command —
// one release, one upgrade unit, helm-tracked lifecycle.
type HelmBundle struct {
// ConnectionHint Free-form note telling the module how to reach this bundle
// once installed (e.g. "DATABASE_URL=postgres://...").
ConnectionHint *string `json:"connection_hint,omitempty"`
DefaultEnabled *bool `json:"default_enabled,omitempty"`
Description *string `json:"description,omitempty"`
// ExposedSchema JSON Schema fragment driving per-bundle form fields on the install page
ExposedSchema *map[string]interface{} `json:"exposed_schema,omitempty"`
Name string `json:"name"`
// SetFlags Author defaults rendered as --set flags (e.g.
// "--set bundles.tei.image.tag=cpu-1.5"). UI appends these
// for every ticked bundle, alongside "--set bundles.<name>.enabled=true".
SetFlags *[]string `json:"set_flags,omitempty"`
}
// HelmConfigField defines model for HelmConfigField.
type HelmConfigField struct {
DefaultValue *string `json:"default_value,omitempty"`
Description *string `json:"description,omitempty"`
Label *string `json:"label,omitempty"`
Name *string `json:"name,omitempty"`
Options *[]string `json:"options,omitempty"`
Placeholder *string `json:"placeholder,omitempty"`
Required *bool `json:"required,omitempty"`
// Type text or select
Type *string `json:"type,omitempty"`
}
// HelmInstallConfig Helm installation instructions the caller can render verbatim.
// The `command` field is a copy-pasteable template with placeholders
// (e.g. `<NAMESPACE>`) that map to entries in `fields`. Prerequisites
// and warnings are plain strings meant for display.
type HelmInstallConfig struct {
// Bundles Self-contained helm install snippets for each third-party
// release the module declared. UI renders a checkbox per
// entry; checked bundles' commands get appended to the
// module command before paste.
Bundles *[]HelmBundle `json:"bundles,omitempty"`
ChartName *string `json:"chart_name,omitempty"`
ChartRepo *string `json:"chart_repo,omitempty"`
// Command Helm install command template with placeholders
Command *string `json:"command,omitempty"`
Fields *[]HelmConfigField `json:"fields,omitempty"`
Prerequisites *[]string `json:"prerequisites,omitempty"`
RequiresIngress *bool `json:"requires_ingress,omitempty"`
RequiresStorage *bool `json:"requires_storage,omitempty"`
Warnings *[]string `json:"warnings,omitempty"`
}
// ModuleRequirements defines model for ModuleRequirements.
type ModuleRequirements struct {
// Bundles Third-party Helm releases the module can install alongside itself (e.g. embedding-module ships TEI, database-extension ships pgvector). Install UI exposes one toggle per bundle; enabled bundles get their own helm install in the same namespace.
Bundles *[]BundledDependency `json:"bundles,omitempty"`
Rbac *RBACRequirements `json:"rbac,omitempty"`
// Secrets Declares the k8s Secrets a module needs to read. Install UI
// prompts the user to supply the actual Secret names; chart
// Role's resourceNames is pinned to those values. Module code
// resolves placeholders via pkg/secret.Resolve at OnSettings
// time. Empty means the module consumes no Secrets and no
// Role is created.
Secrets *SecretRequirements `json:"secrets,omitempty"`
// Storage Persistent storage needs declared by the module. When enabled, the install flow exposes storage-size / storage-class fields and the helm command includes the PVC switches.
Storage *StorageRequirements `json:"storage,omitempty"`
}
// PublicModuleComponent A component inside a module: its name, the description and info
// the component author wrote, its tags, and the typed ports it
// exposes.
type PublicModuleComponent struct {
Description *string `json:"description,omitempty"`
// Info Author-written operational notes; the LLM should read this before wiring the component
Info *string `json:"info,omitempty"`
// Name Component identifier (e.g. "ticker", "http_server")
Name string `json:"name"`
Ports *[]PublicModulePort `json:"ports,omitempty"`
Tags *[]string `json:"tags,omitempty"`
}
// PublicModuleDetails Full module payload returned by `/v1/modules/{name}`. Equivalent
// to the summary plus the full latest version, every component with
// port schemas, the RBAC permissions the module needs, and the helm
// install configuration that desktop/local installers use.
type PublicModuleDetails struct {
Description string `json:"description"`
FullName *string `json:"full_name,omitempty"`
// HelmInstall Helm installation instructions the caller can render verbatim.
// The `command` field is a copy-pasteable template with placeholders
// (e.g. `<NAMESPACE>`) that map to entries in `fields`. Prerequisites
// and warnings are plain strings meant for display.
HelmInstall *HelmInstallConfig `json:"helm_install,omitempty"`
LatestVersion *PublicModuleVersionDetails `json:"latest_version,omitempty"`
Name string `json:"name"`
Verified *bool `json:"verified,omitempty"`
}
// PublicModulePermission Kubernetes RBAC rule required by the module
type PublicModulePermission struct {
ApiGroups *[]string `json:"api_groups,omitempty"`
Resources *[]string `json:"resources,omitempty"`
Verbs *[]string `json:"verbs,omitempty"`
}
// PublicModulePort defines model for PublicModulePort.
type PublicModulePort struct {
// DefaultData Sample data for the port, usable as example input
DefaultData *map[string]interface{} `json:"default_data,omitempty"`
Description *string `json:"description,omitempty"`
Name string `json:"name"`
// Schema JSON Schema describing the port's data shape
Schema *map[string]interface{} `json:"schema,omitempty"`
// Type source or target
Type PublicModulePortType `json:"type"`
}
// PublicModulePortType source or target
type PublicModulePortType string
// PublicModuleSearchResponse defines model for PublicModuleSearchResponse.
type PublicModuleSearchResponse struct {
Results []PublicModuleSummary `json:"results"`
}
// PublicModuleSummary Lightweight module entry returned by `/v1/modules/search`. Carries
// enough for the caller to choose a module to install; follow up
// with `/v1/modules/{name}` for components and install instructions.
type PublicModuleSummary struct {
Description string `json:"description"`
// FullName Human-readable display name
FullName *string `json:"full_name,omitempty"`
LatestVersion *PublicModuleVersionSummary `json:"latest_version,omitempty"`
// Name Workspace-qualified module name (e.g. "tinysystems/common-module-v0")
Name string `json:"name"`
// Verified Whether the module has been verified by Tiny Systems
Verified *bool `json:"verified,omitempty"`
}
// PublicModuleVersionDetails defines model for PublicModuleVersionDetails.
type PublicModuleVersionDetails struct {
// Bundles Third-party Helm releases the module declares for install-time
// provisioning. Same shape as ModuleRequirements.bundles. Empty
// (or absent) for modules that don't bundle anything.
Bundles *[]BundledDependency `json:"bundles,omitempty"`
Components []PublicModuleComponent `json:"components"`
Permissions *[]PublicModulePermission `json:"permissions,omitempty"`
ReleaseNotes *string `json:"release_notes,omitempty"`
// Repo Container image repository
Repo *string `json:"repo,omitempty"`
RequiresKubernetesAccess *bool `json:"requires_kubernetes_access,omitempty"`
SdkVersion *string `json:"sdk_version,omitempty"`
// Tag Container image tag
Tag *string `json:"tag,omitempty"`
Version string `json:"version"`
}
// PublicModuleVersionSummary defines model for PublicModuleVersionSummary.
type PublicModuleVersionSummary struct {
// RequiresKubernetesAccess Module needs RBAC access to the Kubernetes API
RequiresKubernetesAccess *bool `json:"requires_kubernetes_access,omitempty"`
SdkVersion *string `json:"sdk_version,omitempty"`
Version string `json:"version"`
}
// PublishComponent defines model for PublishComponent.
type PublishComponent struct {
Description string `json:"description"`
Info *string `json:"info,omitempty"`
Name string `json:"name"`
Ports *[]PublishComponentPort `json:"ports,omitempty"`
Tags *[]string `json:"tags,omitempty"`
}
// PublishComponentPort defines model for PublishComponentPort.
type PublishComponentPort struct {
DefaultData *map[string]interface{} `json:"default_data,omitempty"`
Label *string `json:"label,omitempty"`
Name string `json:"name"`
Position *int `json:"position,omitempty"`
Schema *map[string]interface{} `json:"schema,omitempty"`
Source bool `json:"source"`
}
// PublishModuleRequest defines model for PublishModuleRequest.
type PublishModuleRequest struct {
Components []PublishComponent `json:"components"`
Description *string `json:"description,omitempty"`
Info *string `json:"info,omitempty"`
Name string `json:"name"`
Requirements *ModuleRequirements `json:"requirements,omitempty"`
// SdkVersion SDK version used to build this module
SdkVersion *string `json:"sdk_version,omitempty"`
Version string `json:"version"`
}
// PublishModuleResult defines model for PublishModuleResult.
type PublishModuleResult struct {
Module *PublishModuleVersion `json:"module,omitempty"`
Options *BuildPushOptions `json:"options,omitempty"`
}
// PublishModuleVersion defines model for PublishModuleVersion.
type PublishModuleVersion struct {
Id string `json:"id"`
Name string `json:"name"`
Version string `json:"version"`
}
// RBACRequirements defines model for RBACRequirements.
type RBACRequirements struct {
// EnableKubernetesResourceAccess Enable access to pods, services, deployments, ingresses
EnableKubernetesResourceAccess *bool `json:"enableKubernetesResourceAccess,omitempty"`
ExtraRules *[]RBACRule `json:"extraRules,omitempty"`
}
// RBACRule defines model for RBACRule.
type RBACRule struct {
ApiGroups *[]string `json:"apiGroups,omitempty"`
Resources *[]string `json:"resources,omitempty"`
Verbs *[]string `json:"verbs,omitempty"`
}
// SecretRequirements Declares the k8s Secrets a module needs to read. Install UI
// prompts the user to supply the actual Secret names; chart
// Role's resourceNames is pinned to those values. Module code
// resolves placeholders via pkg/secret.Resolve at OnSettings
// time. Empty means the module consumes no Secrets and no
// Role is created.
type SecretRequirements struct {
// Names List of Secret names the module may reference (pre-flight allowlist).
Names *[]string `json:"names,omitempty"`
}
// SolutionDetails Full solution structure returned by `/v1/solutions/{uuid}`.
// Contains every flow with its nodes, edges, and configurations,
// plus any solution-level variables.
type SolutionDetails struct {
Description string `json:"description"`
Flows []SolutionFlow `json:"flows"`
Tags *[]string `json:"tags,omitempty"`
Title string `json:"title"`
Uuid string `json:"uuid"`
Variables *[]map[string]interface{} `json:"variables,omitempty"`
}
// SolutionEdge defines model for SolutionEdge.
type SolutionEdge struct {
Configuration *map[string]interface{} `json:"configuration,omitempty"`
Source string `json:"source"`
SourceHandle string `json:"source_handle"`
Target string `json:"target"`
TargetHandle string `json:"target_handle"`
}
// SolutionFlow defines model for SolutionFlow.
type SolutionFlow struct {
Edges []SolutionEdge `json:"edges"`
Nodes []SolutionNode `json:"nodes"`
Title string `json:"title"`
}
// SolutionNode defines model for SolutionNode.
type SolutionNode struct {
Component string `json:"component"`
Id string `json:"id"`
Module string `json:"module"`
Position *map[string]interface{} `json:"position,omitempty"`
Settings *map[string]interface{} `json:"settings,omitempty"`
}
// SolutionSearchResponse defines model for SolutionSearchResponse.
type SolutionSearchResponse struct {
Results []SolutionSummary `json:"results"`
}
// SolutionSummary Brief overview of a solution returned by `/v1/solutions/search`.
// Carries enough for the caller to render a result row and decide
// whether to fetch the full details.
type SolutionSummary struct {
Description string `json:"description"`
Tags *[]string `json:"tags,omitempty"`
Title string `json:"title"`
// Uuid Stable solution identifier, used with `/v1/solutions/{uuid}`
Uuid string `json:"uuid"`
}
// StorageRequirements Persistent storage needs declared by the module. When enabled, the install flow exposes storage-size / storage-class fields and the helm command includes the PVC switches.
type StorageRequirements struct {
// Enabled True when the module requires a PVC to function (e.g. file-backed embedded stores).
Enabled *bool `json:"enabled,omitempty"`
// Size Default storage size suggestion (e.g. 1Gi, 10Gi). Author hint; UI lets the operator override.
Size *string `json:"size,omitempty"`
// StorageClassName Default storage class suggestion. Empty uses the cluster default.
StorageClassName *string `json:"storageClassName,omitempty"`
}
// UpdateModuleVersionRequest defines model for UpdateModuleVersionRequest.
type UpdateModuleVersionRequest struct {
// Id Module Version ID
Id string `json:"id"`
// Repo Image repo
Repo string `json:"repo"`
// Tag Image tag
Tag string `json:"tag"`
}
// SearchPublicModulesParams defines parameters for SearchPublicModules.
type SearchPublicModulesParams struct {
// Q Keyword query matched against module name and description
Q *string `form:"q,omitempty" json:"q,omitempty"`
// Limit Maximum results to return
Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
}
// ExportSolutionParams defines parameters for ExportSolution.
type ExportSolutionParams struct {
// Token One-time export token
Token string `form:"token" json:"token"`
}
// SearchPublicSolutionsParams defines parameters for SearchPublicSolutions.
type SearchPublicSolutionsParams struct {
// Q Keyword query matched against title, description, and tags
Q *string `form:"q,omitempty" json:"q,omitempty"`
// Tags Tag filter; repeat the parameter for multiple tags
Tags *[]string `form:"tags,omitempty" json:"tags,omitempty"`
// Limit Maximum results to return
Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
}
// PublishModuleJSONRequestBody defines body for PublishModule for application/json ContentType.
type PublishModuleJSONRequestBody = PublishModuleRequest
// UpdateModuleVersionJSONRequestBody defines body for UpdateModuleVersion for application/json ContentType.
type UpdateModuleVersionJSONRequestBody = UpdateModuleVersionRequest
// RequestEditorFn is the function signature for the RequestEditor callback function
type RequestEditorFn func(ctx context.Context, req *http.Request) error
// Doer performs HTTP requests.
//
// The standard http.Client implements this interface.
type HttpRequestDoer interface {
Do(req *http.Request) (*http.Response, error)
}
// Client which conforms to the OpenAPI3 specification for this service.
type Client struct {
// The endpoint of the server conforming to this interface, with scheme,
// https://api.deepmap.com for example. This can contain a path relative
// to the server, such as https://api.deepmap.com/dev-test, and all the
// paths in the swagger spec will be appended to the server.
Server string
// Doer for performing requests, typically a *http.Client with any
// customized settings, such as certificate chains.
Client HttpRequestDoer
// A list of callbacks for modifying requests which are generated before sending over
// the network.
RequestEditors []RequestEditorFn
}
// ClientOption allows setting custom parameters during construction
type ClientOption func(*Client) error
// Creates a new Client, with reasonable defaults
func NewClient(server string, opts ...ClientOption) (*Client, error) {
// create a client with sane default values
client := Client{
Server: server,
}
// mutate client and add all optional params
for _, o := range opts {
if err := o(&client); err != nil {
return nil, err
}
}
// ensure the server URL always has a trailing slash
if !strings.HasSuffix(client.Server, "/") {
client.Server += "/"
}
// create httpClient, if not already present
if client.Client == nil {
client.Client = &http.Client{}
}
return &client, nil
}
// WithHTTPClient allows overriding the default Doer, which is
// automatically created using http.Client. This is useful for tests.
func WithHTTPClient(doer HttpRequestDoer) ClientOption {
return func(c *Client) error {
c.Client = doer
return nil
}
}
// WithRequestEditorFn allows setting up a callback function, which will be
// called right before sending the request. This can be used to mutate the request.
func WithRequestEditorFn(fn RequestEditorFn) ClientOption {
return func(c *Client) error {
c.RequestEditors = append(c.RequestEditors, fn)
return nil
}
}
// The interface specification for the client above.
type ClientInterface interface {
// PublishModuleWithBody request with any body
PublishModuleWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PublishModule(ctx context.Context, body PublishModuleJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// UpdateModuleVersionWithBody request with any body
UpdateModuleVersionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
UpdateModuleVersion(ctx context.Context, body UpdateModuleVersionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// HealthCheck request
HealthCheck(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// SearchPublicModules request
SearchPublicModules(ctx context.Context, params *SearchPublicModulesParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetPublicModule request
GetPublicModule(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error)
// ExportSolution request
ExportSolution(ctx context.Context, params *ExportSolutionParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// SearchPublicSolutions request
SearchPublicSolutions(ctx context.Context, params *SearchPublicSolutionsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetPublicSolution request
GetPublicSolution(ctx context.Context, uuid string, reqEditors ...RequestEditorFn) (*http.Response, error)
}
func (c *Client) PublishModuleWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewPublishModuleRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) PublishModule(ctx context.Context, body PublishModuleJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewPublishModuleRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) UpdateModuleVersionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewUpdateModuleVersionRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) UpdateModuleVersion(ctx context.Context, body UpdateModuleVersionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewUpdateModuleVersionRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) HealthCheck(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewHealthCheckRequest(c.Server)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) SearchPublicModules(ctx context.Context, params *SearchPublicModulesParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewSearchPublicModulesRequest(c.Server, params)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) GetPublicModule(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewGetPublicModuleRequest(c.Server, name)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) ExportSolution(ctx context.Context, params *ExportSolutionParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewExportSolutionRequest(c.Server, params)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) SearchPublicSolutions(ctx context.Context, params *SearchPublicSolutionsParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewSearchPublicSolutionsRequest(c.Server, params)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
func (c *Client) GetPublicSolution(ctx context.Context, uuid string, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewGetPublicSolutionRequest(c.Server, uuid)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// NewPublishModuleRequest calls the generic PublishModule builder with application/json body
func NewPublishModuleRequest(server string, body PublishModuleJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewPublishModuleRequestWithBody(server, "application/json", bodyReader)
}
// NewPublishModuleRequestWithBody generates requests for PublishModule with any type of body
func NewPublishModuleRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/v1/devtools/publish-module")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("POST", queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewUpdateModuleVersionRequest calls the generic UpdateModuleVersion builder with application/json body
func NewUpdateModuleVersionRequest(server string, body UpdateModuleVersionJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewUpdateModuleVersionRequestWithBody(server, "application/json", bodyReader)
}
// NewUpdateModuleVersionRequestWithBody generates requests for UpdateModuleVersion with any type of body
func NewUpdateModuleVersionRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/v1/devtools/update-module-version")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("POST", queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewHealthCheckRequest generates requests for HealthCheck
func NewHealthCheckRequest(server string) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/v1/health")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("GET", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewSearchPublicModulesRequest generates requests for SearchPublicModules
func NewSearchPublicModulesRequest(server string, params *SearchPublicModulesParams) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/v1/modules/search")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
if params != nil {
queryValues := queryURL.Query()
if params.Q != nil {
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "q", runtime.ParamLocationQuery, *params.Q); err != nil {
return nil, err
} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
return nil, err
} else {
for k, v := range parsed {
for _, v2 := range v {
queryValues.Add(k, v2)
}
}
}
}
if params.Limit != nil {
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil {
return nil, err
} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
return nil, err
} else {
for k, v := range parsed {
for _, v2 := range v {
queryValues.Add(k, v2)
}
}
}
}
queryURL.RawQuery = queryValues.Encode()
}
req, err := http.NewRequest("GET", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewGetPublicModuleRequest generates requests for GetPublicModule
func NewGetPublicModuleRequest(server string, name string) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name)
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/v1/modules/%s", pathParam0)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest("GET", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewExportSolutionRequest generates requests for ExportSolution
func NewExportSolutionRequest(server string, params *ExportSolutionParams) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/v1/solutions/export")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
if params != nil {
queryValues := queryURL.Query()
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "token", runtime.ParamLocationQuery, params.Token); err != nil {
return nil, err
} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
return nil, err
} else {
for k, v := range parsed {
for _, v2 := range v {
queryValues.Add(k, v2)
}
}
}
queryURL.RawQuery = queryValues.Encode()
}
req, err := http.NewRequest("GET", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewSearchPublicSolutionsRequest generates requests for SearchPublicSolutions
func NewSearchPublicSolutionsRequest(server string, params *SearchPublicSolutionsParams) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/v1/solutions/search")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
if params != nil {
queryValues := queryURL.Query()
if params.Q != nil {
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "q", runtime.ParamLocationQuery, *params.Q); err != nil {
return nil, err
} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
return nil, err
} else {
for k, v := range parsed {
for _, v2 := range v {
queryValues.Add(k, v2)
}
}
}
}
if params.Tags != nil {
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "tags", runtime.ParamLocationQuery, *params.Tags); err != nil {
return nil, err
} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
return nil, err
} else {
for k, v := range parsed {
for _, v2 := range v {
queryValues.Add(k, v2)
}
}
}
}
if params.Limit != nil {
if queryFrag, err := runtime.StyleParamWithLocation("form", true, "limit", runtime.ParamLocationQuery, *params.Limit); err != nil {
return nil, err
} else if parsed, err := url.ParseQuery(queryFrag); err != nil {
return nil, err
} else {
for k, v := range parsed {
for _, v2 := range v {
queryValues.Add(k, v2)
}
}
}
}
queryURL.RawQuery = queryValues.Encode()
}
req, err := http.NewRequest("GET", queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewGetPublicSolutionRequest generates requests for GetPublicSolution
func NewGetPublicSolutionRequest(server string, uuid string) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithLocation("simple", false, "uuid", runtime.ParamLocationPath, uuid)
if err != nil {