-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
client.gen.go
6688 lines (5424 loc) · 198 KB
/
client.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
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 client 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 client
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strings"
"github.com/oapi-codegen/runtime"
openapi_types "github.com/oapi-codegen/runtime/types"
)
const (
Jwt_bearerScopes = "jwt_bearer.Scopes"
)
// Defines values for AbstractExchangeType.
const (
AbstractExchangeTypeReqRespPair AbstractExchangeType = "reqRespPair"
AbstractExchangeTypeUnidirEvent AbstractExchangeType = "unidirEvent"
)
// Defines values for BindingType.
const (
AMQP BindingType = "AMQP"
GOOGLEPUBSUB BindingType = "GOOGLEPUBSUB"
KAFKA BindingType = "KAFKA"
MQTT BindingType = "MQTT"
NATS BindingType = "NATS"
WS BindingType = "WS"
)
// Defines values for OAuth2GrantType.
const (
CLIENTCREDENTIALS OAuth2GrantType = "CLIENT_CREDENTIALS"
PASSWORD OAuth2GrantType = "PASSWORD"
REFRESHTOKEN OAuth2GrantType = "REFRESH_TOKEN"
)
// Defines values for ParameterConstraintIn.
const (
ParameterConstraintInHeader ParameterConstraintIn = "header"
ParameterConstraintInPath ParameterConstraintIn = "path"
ParameterConstraintInQuery ParameterConstraintIn = "query"
)
// Defines values for RequestResponsePairType.
const (
RequestResponsePairTypeReqRespPair RequestResponsePairType = "reqRespPair"
RequestResponsePairTypeUnidirEvent RequestResponsePairType = "unidirEvent"
)
// Defines values for ResourceType.
const (
ResourceTypeASYNCAPISCHEMA ResourceType = "ASYNC_API_SCHEMA"
ResourceTypeASYNCAPISPEC ResourceType = "ASYNC_API_SPEC"
ResourceTypeAVROSCHEMA ResourceType = "AVRO_SCHEMA"
ResourceTypeGRAPHQLSCHEMA ResourceType = "GRAPHQL_SCHEMA"
ResourceTypeJSONSCHEMA ResourceType = "JSON_SCHEMA"
ResourceTypeOPENAPISCHEMA ResourceType = "OPEN_API_SCHEMA"
ResourceTypeOPENAPISPEC ResourceType = "OPEN_API_SPEC"
ResourceTypePOSTMANCOLLECTION ResourceType = "POSTMAN_COLLECTION"
ResourceTypePROTOBUFDESCRIPTION ResourceType = "PROTOBUF_DESCRIPTION"
ResourceTypePROTOBUFSCHEMA ResourceType = "PROTOBUF_SCHEMA"
ResourceTypeWSDL ResourceType = "WSDL"
ResourceTypeXSD ResourceType = "XSD"
)
// Defines values for ServiceType.
const (
EVENT ServiceType = "EVENT"
GENERICEVENT ServiceType = "GENERIC_EVENT"
GENERICREST ServiceType = "GENERIC_REST"
GRAPHQL ServiceType = "GRAPHQL"
GRPC ServiceType = "GRPC"
REST ServiceType = "REST"
SOAPHTTP ServiceType = "SOAP_HTTP"
)
// Defines values for TestRunnerType.
const (
TestRunnerTypeASYNCAPISCHEMA TestRunnerType = "ASYNC_API_SCHEMA"
TestRunnerTypeGRAPHQLSCHEMA TestRunnerType = "GRAPHQL_SCHEMA"
TestRunnerTypeGRPCPROTOBUF TestRunnerType = "GRPC_PROTOBUF"
TestRunnerTypeHTTP TestRunnerType = "HTTP"
TestRunnerTypeOPENAPISCHEMA TestRunnerType = "OPEN_API_SCHEMA"
TestRunnerTypePOSTMAN TestRunnerType = "POSTMAN"
TestRunnerTypeSOAPHTTP TestRunnerType = "SOAP_HTTP"
TestRunnerTypeSOAPUI TestRunnerType = "SOAP_UI"
)
// Defines values for Trend.
const (
DOWN Trend = "DOWN"
LOWDOWN Trend = "LOW_DOWN"
LOWUP Trend = "LOW_UP"
STABLE Trend = "STABLE"
UP Trend = "UP"
)
// Defines values for UnidirectionalEventType.
const (
ReqRespPair UnidirectionalEventType = "reqRespPair"
UnidirEvent UnidirectionalEventType = "unidirEvent"
)
// AbstractExchange Abstract bean representing a Service or API Exchange.
type AbstractExchange struct {
// Type Discriminant type for identifying kind of exchange
Type AbstractExchangeType `json:"type"`
}
// AbstractExchangeType Discriminant type for identifying kind of exchange
type AbstractExchangeType string
// ArtifactDownload Artifact Download specification to be imported by Microcks.
type ArtifactDownload struct {
// MainArtifact Whether this remote artifact should be imported as main/primary or secondary artifact. Default is true.
MainArtifact *bool `json:"mainArtifact,omitempty"`
// SecretName The name of a secret that can be used to authenticated when downloading remote artifact.
SecretName *string `json:"secretName,omitempty"`
// Url The URL of remote artifact to download and import
Url string `json:"url"`
}
// ArtifactUpload Artifact to be imported by Microcks.
// This structure represents a mime-multipart file upload (as specified here: https://swagger.io/docs/specification/describing-request-body/file-upload/)
type ArtifactUpload struct {
// File The artifact to upload
File openapi_types.File `json:"file"`
}
// Binding Protocol binding details for asynchronous operations
type Binding struct {
// DestinationName Name of destination for asynchronous messages of this operation
DestinationName string `json:"destinationName"`
// DestinationType Type of destination for asynchronous messages of this operation
DestinationType *string `json:"destinationType,omitempty"`
// KeyType Type of key for Kafka messages
KeyType *string `json:"keyType,omitempty"`
// Method HTTP method for WebSocket binding
Method *string `json:"method,omitempty"`
// Persistent Persistent attribute for MQTT binding
Persistent *bool `json:"persistent,omitempty"`
// QoS Quality of Service attribute for MQTT binding
QoS *string `json:"qoS,omitempty"`
// Type Protocol binding identifier
Type BindingType `json:"type"`
}
// BindingType Protocol binding identifier
type BindingType string
// Counter A simple Counter type.
type Counter struct {
// Counter Number of items in a resource collection
Counter *int32 `json:"counter,omitempty"`
}
// CounterMap A generic map of counter
type CounterMap map[string]float32
// DailyInvocationStatistic The daily statistic of a service mock invocations
type DailyInvocationStatistic struct {
// DailyCount The number of service mock invocations on this day
DailyCount float32 `json:"dailyCount"`
// Day The day (formatted as yyyyMMdd string) represented by this statistic
Day string `json:"day"`
// HourlyCount The number of service mock invocations per hour of the day (keys range from 0 to 23)
HourlyCount *map[string]interface{} `json:"hourlyCount,omitempty"`
// Id Unique identifier of this statistic object
Id string `json:"id"`
// MinuteCount The number of service mock invocations per minute of the day (keys range from 0 to 1439)
MinuteCount *map[string]interface{} `json:"minuteCount,omitempty"`
// ServiceName The name of the service this statistic is related to
ServiceName string `json:"serviceName"`
// ServiceVersion The version of the service this statistic is related to
ServiceVersion string `json:"serviceVersion"`
}
// EventMessage defines model for EventMessage.
type EventMessage struct {
// Content Body content for this message
Content *string `json:"content,omitempty"`
// Headers Headers for this message
Headers *[]Header `json:"headers,omitempty"`
// Id Unique identifier of this message
Id string `json:"id"`
// MediaType Content type of message
MediaType string `json:"mediaType"`
// Name Unique distinct name of this message
Name *string `json:"name,omitempty"`
// OperationId Identifier of Operation this message is associated to
OperationId *string `json:"operationId,omitempty"`
// TestCaseId Unique identifier of TestCase this message is attached (in case of a test)
TestCaseId *string `json:"testCaseId,omitempty"`
}
// Exchange Abstract representation of a Service or API exchange type (request/response, event based, ...)
type Exchange struct {
union json.RawMessage
}
// Header Transport headers for both Requests and Responses
type Header struct {
// Name Unique distinct name of this Header
Name string `json:"name"`
// Values Values for this Header
Values []string `json:"values"`
}
// HeaderDTO Data Transfert Object for headers of both Requests and Responses
type HeaderDTO struct {
// Name Unique distinct name of this Header
Name string `json:"name"`
// Values Values for this header (comma separated strings)
Values string `json:"values"`
}
// ImportJob An ImportJob allow defining a repository artifact to poll for discovering Services and APIs mocks and tests
type ImportJob struct {
// Active Whether this ImportJob is active (ie. scheduled for execution)
Active *bool `json:"active,omitempty"`
// CreatedDate Creation timestamp for this ImportJob
CreatedDate *int64 `json:"createdDate,omitempty"`
// Etag Etag of repository URL during previous import. Is used for not re-importing if no recent changes
Etag *string `json:"etag,omitempty"`
// Frequency Reserved for future usage
Frequency *string `json:"frequency,omitempty"`
// Id Unique identifier of ImportJob
Id *string `json:"id,omitempty"`
// LastImportDate Timestamp of the last import
LastImportDate *int64 `json:"lastImportDate,omitempty"`
// LastImportError Error message of last import (if any)
LastImportError *string `json:"lastImportError,omitempty"`
// MainArtifact Flag telling if considered as primary or secondary artifact. Default to `true`
MainArtifact *bool `json:"mainArtifact,omitempty"`
// Metadata Commodity object for holding metadata on any entity. This object is inspired by Kubernetes metadata.
Metadata *Metadata `json:"metadata,omitempty"`
// Name Unique distinct name of this ImportJob
Name string `json:"name"`
// RepositoryDisableSSLValidation Whether to disable SSL certificate verification when checking repository
RepositoryDisableSSLValidation *bool `json:"repositoryDisableSSLValidation,omitempty"`
// RepositoryUrl URL of mocks and tests repository artifact
RepositoryUrl string `json:"repositoryUrl"`
// SecretRef Lightweight reference for an existing Secret
SecretRef *SecretRef `json:"secretRef,omitempty"`
// ServiceRefs References of Services discovered when checking repository
ServiceRefs *[]ServiceRef `json:"serviceRefs,omitempty"`
}
// KeycloakConfig Representation of Keycloak / SSO configuration used by Microcks server
type KeycloakConfig struct {
// AuthServerUrl SSO Server authentication url
AuthServerUrl string `json:"auth-server-url"`
// Enabled Whether Keycloak authentification and usage is enabled
Enabled bool `json:"enabled"`
// PublicClient Name of public-client that can be used for requesting OAuth token
PublicClient bool `json:"public-client"`
// Realm Authentication realm name
Realm string `json:"realm"`
// Resource Name of Keycloak resource/application used on client side
Resource string `json:"resource"`
// SslRequired SSL certificates requirements
SslRequired interface{} `json:"ssl-required"`
}
// LabelsMap A map which keys are already used labels keys and values are already used values for this key
type LabelsMap map[string]StringArray
// MessageArray Array of Message for Service operations
type MessageArray = []Exchange
// Metadata Commodity object for holding metadata on any entity. This object is inspired by Kubernetes metadata.
type Metadata struct {
// Annotations Annotations of attached object
Annotations *map[string]string `json:"annotations,omitempty"`
// CreatedOn Creation date of attached object
CreatedOn *float32 `json:"createdOn,omitempty"`
// Labels Labels put on attached object
Labels *map[string]string `json:"labels,omitempty"`
// LastUpdate Last update of attached object
LastUpdate *float32 `json:"lastUpdate,omitempty"`
}
// OAuth2AuthorizedClient OAuth2 authorized client that performed a test
type OAuth2AuthorizedClient struct {
// GrantType Enumeration for the different supported grants/flows of OAuth2
GrantType OAuth2GrantType `json:"grantType"`
// PrincipalName Name of authorized principal (clientId or username in the case of Password grant type)
PrincipalName string `json:"principalName"`
// Scopes Included scopes (separated using space)
Scopes *string `json:"scopes,omitempty"`
// TokenUri Identity Provider URI used for token retrieval
TokenUri string `json:"tokenUri"`
}
// OAuth2ClientContent Represents a volatile OAuth2 client context usually associated with a Test request
type OAuth2ClientContent struct {
// ClientId Id for connecting to OAuth2 identity provider
ClientId string `json:"clientId"`
// ClientSecret Secret for connecting to OAuth2 identity provider
ClientSecret string `json:"clientSecret"`
// Password User password in case you're suing the Resource Owner password flow
Password *string `json:"password,omitempty"`
// RefreshToken Refresh token in case you're using the Refresh Token rotation flow
RefreshToken *string `json:"refreshToken,omitempty"`
// TokenUri URI for retrieving an access token from OAuth2 identity provider
TokenUri string `json:"tokenUri"`
// Username Username in case you're using the Resource Owner Password flow
Username *string `json:"username,omitempty"`
}
// OAuth2GrantType Enumeration for the different supported grants/flows of OAuth2
type OAuth2GrantType string
// Operation An Operation of a Service or API
type Operation struct {
// Bindings Map of protocol binding details for this operation
Bindings *map[string]Binding `json:"bindings,omitempty"`
// DefaultDelay Default response time delay for mocks
DefaultDelay *float32 `json:"defaultDelay,omitempty"`
// Dispatcher Dispatcher strategy used for mocks
Dispatcher *string `json:"dispatcher,omitempty"`
// DispatcherRules DispatcherRules used for mocks
DispatcherRules *string `json:"dispatcherRules,omitempty"`
// InputName Name of input parameters in case of Xml based Service
InputName *string `json:"inputName,omitempty"`
// Method Represents transport method
Method string `json:"method"`
// Name Unique name of this Operation within Service scope
Name string `json:"name"`
// OutputName Name of output parameters in case of Xml based Service
OutputName *string `json:"outputName,omitempty"`
// ParameterContraints Contraints that may apply to mock invocatino on this operation
ParameterContraints *[]ParameterConstraint `json:"parameterContraints,omitempty"`
// ResourcePaths Paths the mocks endpoints are mapped on
ResourcePaths *[]string `json:"resourcePaths,omitempty"`
}
// OperationHeaders Specification of additional headers for a Service/API operations. Keys are operation name or "globals" (if header applies to all), values are Header objects DTO.
type OperationHeaders map[string][]HeaderDTO
// OperationOverrideDTO Data Transfer object for grouping the mutable properties of an Operation
type OperationOverrideDTO struct {
// DefaultDelay Default delay in milliseconds to apply to mock responses on this operation
DefaultDelay *int `json:"defaultDelay,omitempty"`
// Dispatcher Type of dispatcher to apply for this operation
Dispatcher *string `json:"dispatcher,omitempty"`
// DispatcherRules Rules of dispatcher for this operation
DispatcherRules *string `json:"dispatcherRules,omitempty"`
// ParameterConstraints Constraints that may apply to incoming parameters on this operation
ParameterConstraints *[]ParameterConstraint `json:"parameterConstraints,omitempty"`
}
// ParameterConstraint Companion object for Operation that may be used to express constraints on request parameters
type ParameterConstraint struct {
// In Parameter location
In *ParameterConstraintIn `json:"in,omitempty"`
// MustMatchRegexp Whether it's a regular expression matching constraint
MustMatchRegexp *string `json:"mustMatchRegexp,omitempty"`
// Name Parameter name
Name string `json:"name"`
// Recopy Whether it's a recopy constraint
Recopy *bool `json:"recopy,omitempty"`
// Required Whether it's a required constraint
Required *bool `json:"required,omitempty"`
}
// ParameterConstraintIn Parameter location
type ParameterConstraintIn string
// Request A mock invocation or test request
type Request struct {
// Content Body content for this request
Content *string `json:"content,omitempty"`
// Headers Headers for this Request
Headers *[]Header `json:"headers,omitempty"`
// Id Unique identifier of Request
Id *string `json:"id,omitempty"`
// Name Unique distinct name of this Request
Name string `json:"name"`
// OperationId Identifier of Operation this Request is associated to
OperationId string `json:"operationId"`
// TestCaseId Unique identifier of TestCase this Request is attached (in case of a test)
TestCaseId *string `json:"testCaseId,omitempty"`
}
// RequestResponsePair defines model for RequestResponsePair.
type RequestResponsePair struct {
// Request A mock invocation or test request
Request Request `json:"request"`
// Response A mock invocation or test response
Response Response `json:"response"`
// Type Discriminant type for identifying kind of exchange
Type RequestResponsePairType `json:"type"`
}
// RequestResponsePairType Discriminant type for identifying kind of exchange
type RequestResponsePairType string
// Resource Resource represents a Service or API artifacts such as specification, contract
type Resource struct {
// Content String content of this resource
Content string `json:"content"`
// Id Uniquer identifier of this Service or API Resource
Id string `json:"id"`
// Name Unique name/business identifier for this Service or API resource
Name string `json:"name"`
// Path Relative path of this resource regarding main resource
Path *string `json:"path,omitempty"`
// ServiceId Unique identifier of the Servoce or API this resource is attached to
ServiceId string `json:"serviceId"`
// SourceArtifact Short name of the artifact this resource was extracted from
SourceArtifact *string `json:"sourceArtifact,omitempty"`
// Type Types of managed resources for Services or APIs
Type ResourceType `json:"type"`
}
// ResourceType Types of managed resources for Services or APIs
type ResourceType string
// Response A mock invocation or test response
type Response struct {
// Content Body content of this Response
Content *string `json:"content,omitempty"`
// Headers Headers for this Response
Headers *[]Header `json:"headers,omitempty"`
// Id Unique identifier of Response
Id *string `json:"id,omitempty"`
// Name Unique distinct name of this Response
Name string `json:"name"`
// OperationId Identifier of Operation this Response is associated to
OperationId string `json:"operationId"`
// TestCaseId Unique identifier of TestCase this Response is attached (in case of a test)
TestCaseId *string `json:"testCaseId,omitempty"`
}
// Secret A Secret allows grouping informations on how to access a restricted resource such as a repsoitory URL. Secrets are typically used by ImpoortJobs.
type Secret struct {
CaCertPem *string `json:"caCertPem,omitempty"`
// Description Description of this Secret
Description string `json:"description"`
// Id Unique identifier of Secret
Id *string `json:"id,omitempty"`
// Name Unique distinct name of Secret
Name string `json:"name"`
Password *string `json:"password,omitempty"`
Token *string `json:"token,omitempty"`
TokenHeader *string `json:"tokenHeader,omitempty"`
Username *string `json:"username,omitempty"`
}
// SecretRef Lightweight reference for an existing Secret
type SecretRef struct {
// Name Distinct name of the referenced Secret
Name string `json:"name"`
// SecretId Unique identifier or referenced Secret
SecretId string `json:"secretId"`
}
// Service Represents a Service or API definition as registred into Microcks repository
type Service struct {
// Id Unique identifier for this Service or API
Id *string `json:"id,omitempty"`
// Metadata Commodity object for holding metadata on any entity. This object is inspired by Kubernetes metadata.
Metadata *Metadata `json:"metadata,omitempty"`
// Name Distinct name for this Service or API (maybe shared among many versions)
Name string `json:"name"`
// Operations Set of Operations for Service or API
Operations *[]Operation `json:"operations,omitempty"`
// SourceArtifact Short name of the main/primary artifact this service was created from
SourceArtifact string `json:"sourceArtifact"`
// Type Service or API Type
Type ServiceType `json:"type"`
// Version Distinct version for a named Service or API
Version string `json:"version"`
// XmlNS Associated Xml Namespace in case of Xml based Service
XmlNS *string `json:"xmlNS,omitempty"`
}
// ServiceType Service or API Type
type ServiceType string
// ServiceRef Lightweight reference of an existing Service
type ServiceRef struct {
// Name The Service name
Name string `json:"name"`
// ServiceId Unique reference of a Service
ServiceId string `json:"serviceId"`
// Version The Service version
Version string `json:"version"`
}
// ServiceView Aggregate bean for grouping a Service an its messages pairs
type ServiceView struct {
// MessagesMap Map of messages for this Service. Keys are operation name, values are array of messages for this operation
MessagesMap map[string]MessageArray `json:"messagesMap"`
// Service Represents a Service or API definition as registred into Microcks repository
Service Service `json:"service"`
}
// SnapshotUpload Upload of a repository snapshot file
type SnapshotUpload struct {
// File The repository snapshot file
File openapi_types.File `json:"file"`
}
// StringArray A simple array of String
type StringArray = []string
// TestCaseResult Companion objects for TestResult. Each TestCaseResult correspond to a particuliar service operation / action reference by the operationName field. TestCaseResults owns a collection of TestStepResults (one for every request associated to service operation / action).
type TestCaseResult struct {
// ElapsedTime Elapsed time in milliseconds since the test case beginning
ElapsedTime float32 `json:"elapsedTime"`
// OperationName Name of operation this test case is bound to
OperationName string `json:"operationName"`
// Success Flag telling if test case is a success
Success bool `json:"success"`
// TestStepResults Test steps associated to this test case
TestStepResults *[]TestStepResult `json:"testStepResults,omitempty"`
}
// TestCaseReturnDTO defines model for TestCaseReturnDTO.
type TestCaseReturnDTO struct {
// OperationName Name of related operation for this TestCase
OperationName string `json:"operationName"`
}
// TestConformanceMetric Represents the test conformance metrics (current score, history and evolution trend) of a Service
type TestConformanceMetric struct {
// AggregationLabelValue Value of the label used for metrics aggregation (if any)
AggregationLabelValue *string `json:"aggregationLabelValue,omitempty"`
// CurrentScore Current test conformance score for the related Service
CurrentScore float64 `json:"currentScore"`
// Id Unique identifier of coverage metric
Id string `json:"id"`
// LastUpdateDay The day of latest score update (in yyyyMMdd format)
LastUpdateDay *string `json:"lastUpdateDay,omitempty"`
// LatestScores History of latest scores (key is date with format yyyyMMdd, value is score as double)
LatestScores *map[string]float32 `json:"latestScores,omitempty"`
// LatestTrend Evolution trend qualifier
LatestTrend *Trend `json:"latestTrend,omitempty"`
// MaxPossibleScore Maximum conformance score that can be reached (depends on samples expresiveness)
MaxPossibleScore float64 `json:"maxPossibleScore"`
// ServiceId Unique identifier of the Service this metric is related to
ServiceId string `json:"serviceId"`
}
// TestRequest Test request is a minimalist wrapper for requesting the launch of a new test
type TestRequest struct {
// FilteredOperations A restriction on service operations to test
FilteredOperations *[]string `json:"filteredOperations,omitempty"`
// OAuth2Context Represents a volatile OAuth2 client context usually associated with a Test request
OAuth2Context *OAuth2ClientContent `json:"oAuth2Context,omitempty"`
// OperationsHeaders Specification of additional headers for a Service/API operations. Keys are operation name or "globals" (if header applies to all), values are Header objects DTO.
OperationsHeaders *OperationHeaders `json:"operationsHeaders,omitempty"`
// RunnerType Type of test strategy (different strategies are implemented by different runners)
RunnerType TestRunnerType `json:"runnerType"`
// SecretName The name of Secret to use for connecting the test endpoint
SecretName *string `json:"secretName,omitempty"`
// ServiceId Unique identifier of service to test
ServiceId string `json:"serviceId"`
// TestEndpoint Endpoint to test for this service
TestEndpoint string `json:"testEndpoint"`
// Timeout The maximum time (in milliseconds) to wait for this test ends
Timeout int `json:"timeout"`
}
// TestResult Represents the result of a Service or API test run by Microcks. Tests are related to a service and made of multiple test cases corresponding to each operations / actions composing service. Tests are run against a specific endpoint named testedEndpoint. It holds global markers telling if test still ran, is a success, how many times is has taken and so on ...
type TestResult struct {
// AuthorizedClient OAuth2 authorized client that performed a test
AuthorizedClient *OAuth2AuthorizedClient `json:"authorizedClient,omitempty"`
// ElapsedTime Elapsed time in milliseconds since test beginning
ElapsedTime *float32 `json:"elapsedTime,omitempty"`
// Id Unique identifier of TestResult
Id string `json:"id"`
// InProgress Flag telling is test is still in progress
InProgress bool `json:"inProgress"`
// OperationHeaders Specification of additional headers for a Service/API operations. Keys are operation name or "globals" (if header applies to all), values are Header objects DTO.
OperationHeaders *OperationHeaders `json:"operationHeaders,omitempty"`
// RunnerType Type of test strategy (different strategies are implemented by different runners)
RunnerType TestRunnerType `json:"runnerType"`
// SecretRef Lightweight reference for an existing Secret
SecretRef *SecretRef `json:"secretRef,omitempty"`
// ServiceId Unique identifier of service tested
ServiceId string `json:"serviceId"`
// Success Flag telling if test is a success
Success bool `json:"success"`
// TestCaseResults TestCase results associated to this test
TestCaseResults *[]TestCaseResult `json:"testCaseResults,omitempty"`
// TestDate Timestamp of creation date of this service
TestDate int64 `json:"testDate"`
// TestNumber Incremental number for tracking number of tests of a service
TestNumber float32 `json:"testNumber"`
// TestedEndpoint Endpoint used during test
TestedEndpoint string `json:"testedEndpoint"`
// Timeout The maximum time (in milliseconds) to wait for this test ends
Timeout *int `json:"timeout,omitempty"`
// Version Revision number of this test
Version float32 `json:"version"`
}
// TestResultSummary Represents the summary result of a Service or API test run by Microcks.
type TestResultSummary struct {
// Id Unique identifier of TestResult
Id string `json:"id"`
// ServiceId Unique identifier of service tested
ServiceId string `json:"serviceId"`
// Success Flag telling if test is a success
Success bool `json:"success"`
// TestDate Timestamp of creation date of this service
TestDate int64 `json:"testDate"`
}
// TestRunnerType Type of test strategy (different strategies are implemented by different runners)
type TestRunnerType string
// TestStepResult TestStepResult is an entity embedded within TestCaseResult. They are created for each request associated with an operation / action of a microservice.
type TestStepResult struct {
// ElapsedTime Elapsed time in milliseconds since the test step beginning
ElapsedTime *float32 `json:"elapsedTime,omitempty"`
// EventMessageName Name of event this test step is bound to
EventMessageName *string `json:"eventMessageName,omitempty"`
// Message Error message that may be associated to this test step
Message *string `json:"message,omitempty"`
// RequestName Name of request this test step is bound to
RequestName *string `json:"requestName,omitempty"`
// Success Flag telling if test case is a success
Success bool `json:"success"`
}
// Trend Evolution trend qualifier
type Trend string
// UnidirectionalEvent defines model for UnidirectionalEvent.
type UnidirectionalEvent struct {
EventMessage EventMessage `json:"eventMessage"`
// Type Discriminant type for identifying kind of exchange
Type UnidirectionalEventType `json:"type"`
}
// UnidirectionalEventType Discriminant type for identifying kind of exchange
type UnidirectionalEventType string
// WeightedMetricValue Value of a metric with an associated weight
type WeightedMetricValue struct {
// Name Metric name or serie name
Name string `json:"name"`
// Value The value of this metric
Value int `json:"value"`
// Weight Weight of this metric value (typically a percentage)
Weight int `json:"weight"`
}
// ServiceResponse defines model for ServiceResponse.
type ServiceResponse struct {
union json.RawMessage
}
// UploadArtifactParams defines parameters for UploadArtifact.
type UploadArtifactParams struct {
// MainArtifact Flag telling if this should be considered as primary or secondary artifact. Default to 'true'
MainArtifact bool `form:"mainArtifact" json:"mainArtifact"`
}
// ExportSnapshotParams defines parameters for ExportSnapshot.
type ExportSnapshotParams struct {
// ServiceIds List of service identifiers to export
ServiceIds []string `form:"serviceIds" json:"serviceIds"`
}
// GetImportJobsParams defines parameters for GetImportJobs.
type GetImportJobsParams struct {
// Page Page of ImportJobs to retrieve (starts at and defaults to 0)
Page *int `form:"page,omitempty" json:"page,omitempty"`
// Size Size of a page. Maximum number of ImportJobs to include in a response (defaults to 20)
Size *int `form:"size,omitempty" json:"size,omitempty"`
// Name Name like criterion for query
Name *string `form:"name,omitempty" json:"name,omitempty"`
}
// GetAggregatedInvocationsStatsParams defines parameters for GetAggregatedInvocationsStats.
type GetAggregatedInvocationsStatsParams struct {
// Day The day to get statistics for (formatted with yyyyMMdd pattern). Default to today if not provided.
Day *string `form:"day,omitempty" json:"day,omitempty"`
}
// GetLatestAggregatedInvocationsStatsParams defines parameters for GetLatestAggregatedInvocationsStats.
type GetLatestAggregatedInvocationsStatsParams struct {
// Limit Number of days to get back in time. Default is 20.
Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
}
// GetTopIvnocationsStatsByDayParams defines parameters for GetTopIvnocationsStatsByDay.
type GetTopIvnocationsStatsByDayParams struct {
// Day The day to get statistics for (formatted with yyyyMMdd pattern). Default to today if not provided.
Day *string `form:"day,omitempty" json:"day,omitempty"`
// Limit The number of top invoked mocks to return
Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
}
// GetInvocationStatsByServiceParams defines parameters for GetInvocationStatsByService.
type GetInvocationStatsByServiceParams struct {
// Day The day to get statistics for (formatted with yyyyMMdd pattern). Default to today if not provided.
Day *string `form:"day,omitempty" json:"day,omitempty"`
}
// GetLatestTestResultsParams defines parameters for GetLatestTestResults.
type GetLatestTestResultsParams struct {
// Limit Number of days to consider for test results to return. Default is 7 (one week)
Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
}
// GetSecretsParams defines parameters for GetSecrets.
type GetSecretsParams struct {
// Page Page of Secrets to retrieve (starts at and defaults to 0)
Page *int `form:"page,omitempty" json:"page,omitempty"`
// Size Size of a page. Maximum number of Secrets to include in a response (defaults to 20)
Size *int `form:"size,omitempty" json:"size,omitempty"`
}
// SearchSecretsParams defines parameters for SearchSecrets.
type SearchSecretsParams struct {
// Name Search using this name-like criterion
Name string `form:"name" json:"name"`
}
// GetServicesParams defines parameters for GetServices.
type GetServicesParams struct {
// Page Page of Services to retrieve (starts at and defaults to 0)
Page *int `form:"page,omitempty" json:"page,omitempty"`
// Size Size of a page. Maximum number of Services to include in a response (defaults to 20)
Size *int `form:"size,omitempty" json:"size,omitempty"`
}
// SearchServicesParams defines parameters for SearchServices.
type SearchServicesParams struct {
// QueryMap Map of criterion. Key can be simply 'name' with value as the searched string. You can also search by label using keys like 'labels.x' where 'x' is the label and value the label value
QueryMap map[string]string `form:"queryMap" json:"queryMap"`
}
// GetServiceParams defines parameters for GetService.
type GetServiceParams struct {
// Messages Whether to include details on services messages into result. Default is false
Messages *bool `form:"messages,omitempty" json:"messages,omitempty"`
}
// OverrideServiceOperationParams defines parameters for OverrideServiceOperation.
type OverrideServiceOperationParams struct {
// OperationName Name of operation to update
OperationName string `form:"operationName" json:"operationName"`
}
// DownloadArtifactFormdataRequestBody defines body for DownloadArtifact for application/x-www-form-urlencoded ContentType.
type DownloadArtifactFormdataRequestBody = ArtifactDownload
// UploadArtifactMultipartRequestBody defines body for UploadArtifact for multipart/form-data ContentType.
type UploadArtifactMultipartRequestBody = ArtifactUpload
// ImportSnapshotMultipartRequestBody defines body for ImportSnapshot for multipart/form-data ContentType.
type ImportSnapshotMultipartRequestBody = SnapshotUpload
// CreateImportJobJSONRequestBody defines body for CreateImportJob for application/json ContentType.
type CreateImportJobJSONRequestBody = ImportJob
// UpdateImportJobJSONRequestBody defines body for UpdateImportJob for application/json ContentType.
type UpdateImportJobJSONRequestBody = ImportJob
// CreateSecretJSONRequestBody defines body for CreateSecret for application/json ContentType.
type CreateSecretJSONRequestBody = Secret
// UpdateSecretJSONRequestBody defines body for UpdateSecret for application/json ContentType.
type UpdateSecretJSONRequestBody = Secret
// UpdateServiceMetadataJSONRequestBody defines body for UpdateServiceMetadata for application/json ContentType.
type UpdateServiceMetadataJSONRequestBody = Metadata
// OverrideServiceOperationJSONRequestBody defines body for OverrideServiceOperation for application/json ContentType.
type OverrideServiceOperationJSONRequestBody = OperationOverrideDTO
// CreateTestJSONRequestBody defines body for CreateTest for application/json ContentType.
type CreateTestJSONRequestBody = TestRequest
// ReportTestCaseResultJSONRequestBody defines body for ReportTestCaseResult for application/json ContentType.
type ReportTestCaseResultJSONRequestBody = TestCaseReturnDTO
// AsRequestResponsePair returns the union data inside the Exchange as a RequestResponsePair
func (t Exchange) AsRequestResponsePair() (RequestResponsePair, error) {
var body RequestResponsePair
err := json.Unmarshal(t.union, &body)
return body, err
}
// FromRequestResponsePair overwrites any union data inside the Exchange as the provided RequestResponsePair
func (t *Exchange) FromRequestResponsePair(v RequestResponsePair) error {
v.Type = "reqRespPair"
b, err := json.Marshal(v)
t.union = b
return err
}
// MergeRequestResponsePair performs a merge with any union data inside the Exchange, using the provided RequestResponsePair
func (t *Exchange) MergeRequestResponsePair(v RequestResponsePair) error {
v.Type = "reqRespPair"
b, err := json.Marshal(v)
if err != nil {
return err
}
merged, err := runtime.JSONMerge(t.union, b)
t.union = merged
return err
}
// AsUnidirectionalEvent returns the union data inside the Exchange as a UnidirectionalEvent
func (t Exchange) AsUnidirectionalEvent() (UnidirectionalEvent, error) {
var body UnidirectionalEvent
err := json.Unmarshal(t.union, &body)
return body, err
}
// FromUnidirectionalEvent overwrites any union data inside the Exchange as the provided UnidirectionalEvent
func (t *Exchange) FromUnidirectionalEvent(v UnidirectionalEvent) error {
v.Type = "unidirEvent"
b, err := json.Marshal(v)
t.union = b
return err
}
// MergeUnidirectionalEvent performs a merge with any union data inside the Exchange, using the provided UnidirectionalEvent
func (t *Exchange) MergeUnidirectionalEvent(v UnidirectionalEvent) error {
v.Type = "unidirEvent"
b, err := json.Marshal(v)
if err != nil {
return err
}
merged, err := runtime.JSONMerge(t.union, b)
t.union = merged
return err
}
func (t Exchange) Discriminator() (string, error) {
var discriminator struct {
Discriminator string `json:"type"`
}