-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.gen.go
694 lines (563 loc) · 25.6 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
692
693
694
// 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"`
Team *Team `json:"team,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"`
TeamId *openapi_types.UUID `json:"teamId,omitempty"`
}
// 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"`
TeamId *openapi_types.UUID `json:"teamId,omitempty"`
}
// 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/VwTt/ejETnsvsPCnm213F+ku2qBJtwenDQpaGtvcyqSWpJL4BP7fD/iS",
"KImW5Gfs1N8Si4/hvPib4Yh6CiM6SykBIng4fApTxNAMBDD1H4oimhFxFct/YuARw6nAlITD8HYKAY4D",
"Og7EFALTMBA0YCAYhns4D3shli1TJKZhLyRoBuHQGbIXMvgnwwzicChYBr2QR1OYITnXmLIZEuEwzDIs",
"W4p5KjtzwTCZhItFL5wwmqXthKlmHciyw21GVIJnWFxLFvrpItlsBIxL4rCAGTeEZYzkZP2TAZsXdKkR",
"Q5eKGMYoS0Q4fDXohTP0iGfZLBz+n/wHE/3PRU4bJgImwBRxdDzm0E5diTj+HafBCMaUQcAFYgKTifw9",
"okkCkVAsZsCzRAQcxLJF6Jn9q3DpHvjpToEhQVm7sG3LDvJ2Bt1M5HzOBczaadPtOlCWD7gZXQJQB6pk",
"qw40mcE2oyjj0EGGslUHisxgm1C00J2Bi19ojEE5vDcMkIBL7aPkDxElAvSfKE0THCFJdf9vLkl/cmZL",
"mVQpYcYprfCpOrVdhedBWdlbluBKuZ3/Bae+lNVfEXOXd6GjvyESkkGLnmHIB9N8A47IbigSv84QTrwr",
"X5NllYV1X4sR8icOmywLlq5nW/TeKH+wCeeTjNsNvWx5l0GCuZCWZ9u4rgrzIEVMPlY2KLcEOcT/MBiH",
"w/CnfgEc+npq3n+jh1GaqReEGENzj3irhDj/lz3muU/tLW/Lo7xHMyh39vVdycJ80uqVrSdnb6MUbwHN",
"9u9PVla2Da2hhBdbndd2FuUCyqYF/om5MDbPN1jiquqzjBTJab4nVi8h41Mab2WzixKE233Du8+3Zqo3",
"uv1efL5eo/X52pduvuIVme9X10aKNaVb2Hc3cXdOXy+xqjlPKeF6rl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p/Q6HJ3NzPLezH8mgkQJxx",
"wcx9g92Y5tJ5hKcbjkQMwsy4uSO2KrzW2jIptvXqyvbhKl9ETZkjHef2Na9A/sovXdsZS+0Ux5sXa0TA",
"tiBP2YkcjYjAcN1eAnt5fVWqrlIfpwl1cLDarKqnNpbql4buIaHpTM6uW4W9UH2JQ11UN+z3ExqhZEq5",
"GP48+HnQRynu318oYzJ0eb7NzCFADAKV98NcSL25t0dhmBJVM5bfY6cmlTQvG8Y9RpP8QsLUoAXmcjdn",
"OOdIsnnAPIXTPF6RAGseTiV6WsYyx1gtIym/WB+JuCPZELZ5JFNNYev1RnMPTXlSpPPy5E8Zx2SyZIXt",
"YzE8meRr1MNBrL4cDyTWt/6pD8l7xjddZYT83wAAAP//wUVVm4aAAAA=",
}
// 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
}