-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.gen.go
691 lines (560 loc) · 25.4 KB
/
models.gen.go
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
// Package apis provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT.
package apis
import (
"bytes"
"compress/gzip"
"encoding/base64"
"fmt"
"net/url"
"path"
"strings"
"time"
"github.com/getkin/kin-openapi/openapi3"
openapi_types "github.com/oapi-codegen/runtime/types"
)
const (
ApiKeyScopes = "apiKey.Scopes"
BearerAuthScopes = "bearerAuth.Scopes"
)
// Account defines model for Account.
type Account struct {
ContactEmail *string `json:"contactEmail,omitempty"`
// CreatedAt Creation date and time
CreatedAt *time.Time `json:"createdAt,omitempty"`
// DeletedAt Creation date and time
DeletedAt *time.Time `json:"deletedAt,omitempty"`
Description *string `json:"description,omitempty"`
Id *openapi_types.UUID `json:"id,omitempty"`
Key *KeyPair `json:"key,omitempty"`
Name string `json:"name"`
SigningKeys *[]KeyPair `json:"signingKeys,omitempty"`
// UpdatedAt Creation date and time
UpdatedAt *time.Time `json:"updatedAt,omitempty"`
}
// Cluster defines model for Cluster.
type Cluster struct {
// CreatedAt Creation date and time
CreatedAt *time.Time `json:"createdAt,omitempty"`
// DeletedAt Delete date and time
DeletedAt *time.Time `json:"deletedAt,omitempty"`
Description *string `json:"description,omitempty"`
Id *openapi_types.UUID `json:"id,omitempty"`
Name string `json:"name"`
ServerURL string `json:"serverURL"`
// UpdatedAt Update date and time
UpdatedAt *time.Time `json:"updatedAt,omitempty"`
}
// Clusters defines model for Clusters.
type Clusters = []Cluster
// Credentials defines model for Credentials.
type Credentials = openapi_types.File
// Error defines model for Error.
type Error struct {
// Code Error code
Code int32 `json:"code"`
// Message Error message
Message string `json:"message"`
// Ref Reference to the error
Ref *string `json:"ref,omitempty"`
}
// JWTAccountClaims defines model for JWTAccountClaims.
type JWTAccountClaims struct {
Exports *[]JWTExport `json:"exports,omitempty"`
}
// JWTExport defines model for JWTExport.
type JWTExport struct {
AccountTokenPosition *uint `json:"account_token_position,omitempty"`
Info *JWTInfo `json:"info,omitempty"`
Name *string `json:"name,omitempty"`
ResponseType *string `json:"response_type,omitempty"`
Subject *string `json:"subject,omitempty"`
Type *int `json:"type,omitempty"`
}
// JWTInfo defines model for JWTInfo.
type JWTInfo struct {
Description *string `json:"description,omitempty"`
InfoUrl *string `json:"info_url,omitempty"`
}
// JWTToken A JWT token is a JSON Web Token.
type JWTToken struct {
Token *string `json:"token,omitempty"`
}
// KeyPair defines model for KeyPair.
type KeyPair struct {
PrivateKey *string `json:"privateKey,omitempty"`
PublicKey string `json:"publicKey"`
}
// NKey An NKey is the private key of a NATS account.
type NKey = string
// Operator defines model for Operator.
type Operator struct {
ContactEmail *string `json:"contactEmail,omitempty"`
// CreatedAt Creation date and time
CreatedAt *time.Time `json:"createdAt,omitempty"`
// DeletedAt Creation date and time
DeletedAt *time.Time `json:"deletedAt,omitempty"`
Description *string `json:"description,omitempty"`
Id *openapi_types.UUID `json:"id,omitempty"`
Key *KeyPair `json:"key,omitempty"`
Name string `json:"name"`
SigningKeys *[]KeyPair `json:"signingKeys,omitempty"`
// UpdatedAt Creation date and time
UpdatedAt *time.Time `json:"updatedAt,omitempty"`
}
// Operators defines model for Operators.
type Operators struct {
Results *[]Operator `json:"results,omitempty"`
}
// PaginatedResult defines model for PaginatedResult.
type PaginatedResult struct {
Limit *int `json:"limit,omitempty"`
Offset *int `json:"offset,omitempty"`
Results *[]interface{} `json:"results,omitempty"`
Total *int `json:"total,omitempty"`
}
// SigningKeyGroup defines model for SigningKeyGroup.
type SigningKeyGroup struct {
// CreatedAt Creation date and time
CreatedAt *time.Time `json:"createdAt,omitempty"`
// DeletedAt Creation date and time
DeletedAt *time.Time `json:"deletedAt,omitempty"`
Description *string `json:"description,omitempty"`
Disabled *bool `json:"disabled,omitempty"`
Id *openapi_types.UUID `json:"id,omitempty"`
IsScoped *bool `json:"is_scoped,omitempty"`
Name string `json:"name"`
Scope *SigningKeyGroupScope `json:"scope,omitempty"`
// UpdatedAt Creation date and time
UpdatedAt *time.Time `json:"updatedAt,omitempty"`
}
// SigningKeyGroupScope defines model for SigningKeyGroupScope.
type SigningKeyGroupScope struct {
Data *int `json:"data,omitempty"`
Payload *int `json:"payload,omitempty"`
Publish *SigningKeyGroupScopePublish `json:"publish,omitempty"`
Subscribe *SigningKeyGroupScopeSubscribe `json:"subscribe,omitempty"`
Subscriptions *int `json:"subscriptions,omitempty"`
}
// SigningKeyGroupScopePublish defines model for SigningKeyGroupScopePublish.
type SigningKeyGroupScopePublish struct {
Allow *[]string `json:"allow,omitempty"`
Deny *[]string `json:"deny,omitempty"`
}
// SigningKeyGroupScopeSubscribe defines model for SigningKeyGroupScopeSubscribe.
type SigningKeyGroupScopeSubscribe struct {
Allow *[]string `json:"allow,omitempty"`
Deny *[]string `json:"deny,omitempty"`
}
// System defines model for System.
type System struct {
Clusters Clusters `json:"clusters"`
// CreatedAt Creation date and time
CreatedAt *time.Time `json:"createdAt,omitempty"`
// DeletedAt Creation date and time
DeletedAt *time.Time `json:"deletedAt,omitempty"`
// Description A description of the system.
Description *string `json:"description,omitempty"`
Id *openapi_types.UUID `json:"id,omitempty"`
// Name Name of the system
Name string `json:"name"`
Operator *Operator `json:"operator,omitempty"`
// UpdatedAt Creation date and time
UpdatedAt *time.Time `json:"updatedAt,omitempty"`
}
// Systems defines model for Systems.
type Systems = []System
// Team defines model for Team.
type Team struct {
ContactEmail *string `json:"contactEmail,omitempty"`
// CreatedAt Creation date and time
CreatedAt *time.Time `json:"createdAt,omitempty"`
// DeletedAt Creation date and time
DeletedAt *time.Time `json:"deletedAt,omitempty"`
Description *string `json:"description,omitempty"`
Id *openapi_types.UUID `json:"id,omitempty"`
Name string `json:"name"`
// UpdatedAt Creation date and time
UpdatedAt *time.Time `json:"updatedAt,omitempty"`
}
// Teams defines model for Teams.
type Teams struct {
Results *[]Team `json:"results,omitempty"`
}
// User defines model for User.
type User struct {
// CreatedAt Creation date and time
CreatedAt *time.Time `json:"createdAt,omitempty"`
// DeletedAt Creation date and time
DeletedAt *time.Time `json:"deletedAt,omitempty"`
Email *string `json:"email,omitempty"`
Id *openapi_types.UUID `json:"id,omitempty"`
Jwt *string `json:"jwt,omitempty"`
Key *string `json:"key,omitempty"`
Name string `json:"name"`
// UpdatedAt Creation date and time
UpdatedAt *time.Time `json:"updatedAt,omitempty"`
}
// Users defines model for Users.
type Users struct {
Results *[]User `json:"results,omitempty"`
}
// Version defines model for Version.
type Version struct {
Date string `json:"date"`
Version string `json:"version"`
}
// AccountId defines model for accountId.
type AccountId = openapi_types.UUID
// GroupId defines model for groupId.
type GroupId = openapi_types.UUID
// LimitParam defines model for limitParam.
type LimitParam = int
// OffsetParam defines model for offsetParam.
type OffsetParam = int
// OperatorId defines model for operatorId.
type OperatorId = openapi_types.UUID
// SystemId defines model for systemId.
type SystemId = openapi_types.UUID
// TeamId defines model for teamId.
type TeamId = openapi_types.UUID
// UserId defines model for userId.
type UserId = openapi_types.UUID
// BadRequest defines model for BadRequest.
type BadRequest = Error
// Duplicate defines model for Duplicate.
type Duplicate = Error
// InternalError defines model for InternalError.
type InternalError = Error
// NotFound defines model for NotFound.
type NotFound = Error
// Unauthorized defines model for Unauthorized.
type Unauthorized = Error
// Unimplemented defines model for Unimplemented.
type Unimplemented = Error
// CreateAccount defines model for CreateAccount.
type CreateAccount struct {
Description *string `json:"description,omitempty"`
Name string `json:"name"`
OperatorId openapi_types.UUID `json:"operatorId"`
}
// CreateOperator defines model for CreateOperator.
type CreateOperator struct {
ContactEmail *string `json:"contactEmail,omitempty"`
Description *string `json:"description,omitempty"`
Name string `json:"name"`
}
// CreateOperatorAccountUser defines model for CreateOperatorAccountUser.
type CreateOperatorAccountUser struct {
Email *string `json:"email,omitempty"`
Name string `json:"name"`
}
// CreateSystem defines model for CreateSystem.
type CreateSystem struct {
// Clusters A list of clusters the system is part of.
Clusters []Cluster `json:"clusters"`
// Description A description of the system.
Description *string `json:"description,omitempty"`
// Name Name of the system
Name string `json:"name"`
OperatorId openapi_types.UUID `json:"operatorId"`
}
// CreateTeam defines model for CreateTeam.
type CreateTeam struct {
Description *string `json:"description,omitempty"`
Name string `json:"name"`
}
// CreateUser defines model for CreateUser.
type CreateUser struct {
AccountId openapi_types.UUID `json:"accountId"`
Description *string `json:"description,omitempty"`
Name string `json:"name"`
}
// ListAccounts defines model for ListAccounts.
type ListAccounts struct {
OperatorId *openapi_types.UUID `json:"operatorId,omitempty"`
}
// ListUsers defines model for ListUsers.
type ListUsers struct {
AccountId *openapi_types.UUID `json:"accountId,omitempty"`
}
// UpdateAccount defines model for UpdateAccount.
type UpdateAccount struct {
Claims *JWTAccountClaims `json:"claims,omitempty"`
Description *string `json:"description,omitempty"`
Name string `json:"name"`
}
// UpdateOperatorSystemAccount defines model for UpdateOperatorSystemAccount.
type UpdateOperatorSystemAccount struct {
AccountId openapi_types.UUID `json:"accountId"`
}
// UpdateSystemOperator defines model for UpdateSystemOperator.
type UpdateSystemOperator struct {
OperatorId openapi_types.UUID `json:"operatorId"`
}
// ListAccountsJSONBody defines parameters for ListAccounts.
type ListAccountsJSONBody struct {
OperatorId *openapi_types.UUID `json:"operatorId,omitempty"`
}
// ListAccountsParams defines parameters for ListAccounts.
type ListAccountsParams struct {
// Offset The number of items to skip before starting to collect the result set.
Offset *OffsetParam `form:"offset,omitempty" json:"offset,omitempty"`
// Limit The numbers of items to return.
Limit *LimitParam `form:"limit,omitempty" json:"limit,omitempty"`
}
// CreateAccountJSONBody defines parameters for CreateAccount.
type CreateAccountJSONBody struct {
Description *string `json:"description,omitempty"`
Name string `json:"name"`
OperatorId openapi_types.UUID `json:"operatorId"`
}
// ListAccountSigningKeyGroupsParams defines parameters for ListAccountSigningKeyGroups.
type ListAccountSigningKeyGroupsParams struct {
// Offset The number of items to skip before starting to collect the result set.
Offset *OffsetParam `form:"offset,omitempty" json:"offset,omitempty"`
// Limit The numbers of items to return.
Limit *LimitParam `form:"limit,omitempty" json:"limit,omitempty"`
}
// ListOperatorsParams defines parameters for ListOperators.
type ListOperatorsParams struct {
// Offset The number of items to skip before starting to collect the result set.
Offset *OffsetParam `form:"offset,omitempty" json:"offset,omitempty"`
// Limit The numbers of items to return.
Limit *LimitParam `form:"limit,omitempty" json:"limit,omitempty"`
}
// CreateOperatorJSONBody defines parameters for CreateOperator.
type CreateOperatorJSONBody struct {
ContactEmail *string `json:"contactEmail,omitempty"`
Description *string `json:"description,omitempty"`
Name string `json:"name"`
}
// ListOperatorSigningKeyGroupsParams defines parameters for ListOperatorSigningKeyGroups.
type ListOperatorSigningKeyGroupsParams struct {
// Offset The number of items to skip before starting to collect the result set.
Offset *OffsetParam `form:"offset,omitempty" json:"offset,omitempty"`
// Limit The numbers of items to return.
Limit *LimitParam `form:"limit,omitempty" json:"limit,omitempty"`
}
// UpdateOperatorSystemAccountJSONBody defines parameters for UpdateOperatorSystemAccount.
type UpdateOperatorSystemAccountJSONBody struct {
AccountId openapi_types.UUID `json:"accountId"`
}
// ListSystemsParams defines parameters for ListSystems.
type ListSystemsParams struct {
// Offset The number of items to skip before starting to collect the result set.
Offset *OffsetParam `form:"offset,omitempty" json:"offset,omitempty"`
// Limit The numbers of items to return.
Limit *LimitParam `form:"limit,omitempty" json:"limit,omitempty"`
}
// CreateSystemJSONBody defines parameters for CreateSystem.
type CreateSystemJSONBody struct {
// Clusters A list of clusters the system is part of.
Clusters []Cluster `json:"clusters"`
// Description A description of the system.
Description *string `json:"description,omitempty"`
// Name Name of the system
Name string `json:"name"`
OperatorId openapi_types.UUID `json:"operatorId"`
}
// UpdateSystemOperatorJSONBody defines parameters for UpdateSystemOperator.
type UpdateSystemOperatorJSONBody struct {
OperatorId openapi_types.UUID `json:"operatorId"`
}
// ListTeamsParams defines parameters for ListTeams.
type ListTeamsParams struct {
// Offset The number of items to skip before starting to collect the result set.
Offset *OffsetParam `form:"offset,omitempty" json:"offset,omitempty"`
// Limit The numbers of items to return.
Limit *LimitParam `form:"limit,omitempty" json:"limit,omitempty"`
}
// CreateTeamJSONBody defines parameters for CreateTeam.
type CreateTeamJSONBody struct {
Description *string `json:"description,omitempty"`
Name string `json:"name"`
}
// ListTeamAccountsParams defines parameters for ListTeamAccounts.
type ListTeamAccountsParams struct {
// Offset The number of items to skip before starting to collect the result set.
Offset *OffsetParam `form:"offset,omitempty" json:"offset,omitempty"`
// Limit The numbers of items to return.
Limit *LimitParam `form:"limit,omitempty" json:"limit,omitempty"`
}
// ListTeamSystemsParams defines parameters for ListTeamSystems.
type ListTeamSystemsParams struct {
// Offset The number of items to skip before starting to collect the result set.
Offset *OffsetParam `form:"offset,omitempty" json:"offset,omitempty"`
// Limit The numbers of items to return.
Limit *LimitParam `form:"limit,omitempty" json:"limit,omitempty"`
}
// ListUsersJSONBody defines parameters for ListUsers.
type ListUsersJSONBody struct {
AccountId *openapi_types.UUID `json:"accountId,omitempty"`
}
// ListUsersParams defines parameters for ListUsers.
type ListUsersParams struct {
// Offset The number of items to skip before starting to collect the result set.
Offset *OffsetParam `form:"offset,omitempty" json:"offset,omitempty"`
// Limit The numbers of items to return.
Limit *LimitParam `form:"limit,omitempty" json:"limit,omitempty"`
}
// CreateUserJSONBody defines parameters for CreateUser.
type CreateUserJSONBody struct {
AccountId openapi_types.UUID `json:"accountId"`
Description *string `json:"description,omitempty"`
Name string `json:"name"`
}
// ListAccountsJSONRequestBody defines body for ListAccounts for application/json ContentType.
type ListAccountsJSONRequestBody ListAccountsJSONBody
// CreateAccountJSONRequestBody defines body for CreateAccount for application/json ContentType.
type CreateAccountJSONRequestBody CreateAccountJSONBody
// UpdateAccountJSONRequestBody defines body for UpdateAccount for application/json ContentType.
type UpdateAccountJSONRequestBody = Account
// CreateAccountSigningKeyGroupJSONRequestBody defines body for CreateAccountSigningKeyGroup for application/json ContentType.
type CreateAccountSigningKeyGroupJSONRequestBody = SigningKeyGroup
// CreateOperatorJSONRequestBody defines body for CreateOperator for application/json ContentType.
type CreateOperatorJSONRequestBody CreateOperatorJSONBody
// UpdateOperatorJSONRequestBody defines body for UpdateOperator for application/json ContentType.
type UpdateOperatorJSONRequestBody = Operator
// CreateOperatorSigningKeyGroupJSONRequestBody defines body for CreateOperatorSigningKeyGroup for application/json ContentType.
type CreateOperatorSigningKeyGroupJSONRequestBody = SigningKeyGroup
// UpdateOperatorSystemAccountJSONRequestBody defines body for UpdateOperatorSystemAccount for application/json ContentType.
type UpdateOperatorSystemAccountJSONRequestBody UpdateOperatorSystemAccountJSONBody
// CreateSystemJSONRequestBody defines body for CreateSystem for application/json ContentType.
type CreateSystemJSONRequestBody CreateSystemJSONBody
// UpdateSystemJSONRequestBody defines body for UpdateSystem for application/json ContentType.
type UpdateSystemJSONRequestBody = System
// UpdateSystemOperatorJSONRequestBody defines body for UpdateSystemOperator for application/json ContentType.
type UpdateSystemOperatorJSONRequestBody UpdateSystemOperatorJSONBody
// CreateTeamJSONRequestBody defines body for CreateTeam for application/json ContentType.
type CreateTeamJSONRequestBody CreateTeamJSONBody
// ListUsersJSONRequestBody defines body for ListUsers for application/json ContentType.
type ListUsersJSONRequestBody ListUsersJSONBody
// CreateUserJSONRequestBody defines body for CreateUser for application/json ContentType.
type CreateUserJSONRequestBody CreateUserJSONBody
// UpdateUserJSONRequestBody defines body for UpdateUser for application/json ContentType.
type UpdateUserJSONRequestBody = User
// Base64 encoded, gzipped, json marshaled Swagger object
var swaggerSpec = []string{
"H4sIAAAAAAAC/+xd62/buLL/Vwjt/ejETnsvsPCnm213F+ku2qBJtwenDQpaGtvcyqSWpJL4BP7fD/iS",
"qIcl+Rk79bfE4mM4L/5mOKKegpDNEkaBShEMn4IEczwDCVz/h8OQpVReReqfCETISSIJo8EwuJ0CIhFi",
"YySngGxDJBniIDmBezgPegFRLRMsp0EvoHgGwdAbshdw+CclHKJgKHkKvUCEU5hhNdeY8RmWwTBIU6Ja",
"ynmiOgvJCZ0Ei0UvmHCWJu2E6WYdyHLDbUZUTGZEXisW1tNF09kIuFDEEQkzYQlLOc3I+icFPs/p0iMG",
"PhURjHEay2D4atALZviRzNJZMPw/9Q+h5p+LjDZCJUyAa+LYeCygnboCceI7SdAIxowDEhJzSehE/R6y",
"OIZQahZzEGkskQC5bBFm5vpV+HQP6ulOgGPJeLuwXcsO8vYG3UzkYi4kzNppM+06UJYNuBldEnAHqlSr",
"DjTZwTajKBXQQYaqVQeK7GCbULQwnUHIX1hEQDu8NxywhEvjo9QPIaMSzJ84SWISYkV1/2+hSH/yZku4",
"Uilpxyms8Kk8tVtFzYOisrczNV/+l6JO6xnusi5s9DeEUq160bOr/GCbb7BM1Q2H8tcZJnHtctbkQ2lh",
"3ddiJfdJwCbLgqXr2Ra9N9rIN+F8nAq3SxfN6RLFREhlTq6N73+IQAnm6rE2LOXn1RD/w2EcDIOf+jka",
"6JupRf+NGUYt3y4Ic47nNeItE+L9X3SD51VdznlbHOU9nkGxc13fTcxGz9srWk/G3kYp3gKe7d9JrKxs",
"G1pDAQS2sHZbFu+jxKYF/kmEtDYvNljiquqzjBTFabEnVi8h41MSbWUHC2NM2n3Du8+3dqo3pv1efL5Z",
"o/P5xpduvuIVmV+vro0UG0q3sO9uCSXUEqubi4RRYeb6BUcfDUxaieAmrfmVc8YNAqtCQYvJ0AMWiDKJ",
"7nFMonOlOG9TMyHslRCIVITDUh6CpgmjyNGhqbqiEjjFsRlr55R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benVl+3CVL6KmzJOOd/tarUD+yi5d2xlL3RTHmxdrRMCuIE/biRqNSmS57i6Bvby+KlRX",
"6Y/TBCY4WG1W3dMYS/lLQ/cQs2SmZjetgl6gv8ShL6ob9vsxC3E8ZUIOfx78POjjhPTvL7QxWbpqPqIs",
"AGEOSOf9iJBKb+7dURhhVNeMZffY6UkVzcuG8Y/RFL+wtDVoyF7u5g3nHUk2D5ilcJrHyxNgzcPpRE/L",
"WPYYq2Uk7RerI1F/JBfCNo9kqylcvd5oXkNTlhTpvDz1UyoInSxZYftYnEwm2RrNcBDpT7wDjcytf/qL",
"7zXj264qQv5vAAAA//+SE68sL4AAAA==",
}
// GetSwagger returns the content of the embedded swagger specification file
// or error if failed to decode
func decodeSpec() ([]byte, error) {
zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, ""))
if err != nil {
return nil, fmt.Errorf("error base64 decoding spec: %w", err)
}
zr, err := gzip.NewReader(bytes.NewReader(zipped))
if err != nil {
return nil, fmt.Errorf("error decompressing spec: %w", err)
}
var buf bytes.Buffer
_, err = buf.ReadFrom(zr)
if err != nil {
return nil, fmt.Errorf("error decompressing spec: %w", err)
}
return buf.Bytes(), nil
}
var rawSpec = decodeSpecCached()
// a naive cached of a decoded swagger spec
func decodeSpecCached() func() ([]byte, error) {
data, err := decodeSpec()
return func() ([]byte, error) {
return data, err
}
}
// Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) {
res := make(map[string]func() ([]byte, error))
if len(pathToFile) > 0 {
res[pathToFile] = rawSpec
}
return res
}
// GetSwagger returns the Swagger specification corresponding to the generated code
// in this file. The external references of Swagger specification are resolved.
// The logic of resolving external references is tightly connected to "import-mapping" feature.
// Externally referenced files must be embedded in the corresponding golang packages.
// Urls can be supported but this task was out of the scope.
func GetSwagger() (swagger *openapi3.T, err error) {
resolvePath := PathToRawSpec("")
loader := openapi3.NewLoader()
loader.IsExternalRefsAllowed = true
loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) {
pathToFile := url.String()
pathToFile = path.Clean(pathToFile)
getSpec, ok := resolvePath[pathToFile]
if !ok {
err1 := fmt.Errorf("path not found: %s", pathToFile)
return nil, err1
}
return getSpec()
}
var specData []byte
specData, err = rawSpec()
if err != nil {
return
}
swagger, err = loader.LoadFromData(specData)
if err != nil {
return
}
return
}