@@ -22,12 +22,12 @@ const (
22
22
)
23
23
24
24
var TransferHandlerQuestions = map [string ]reflect.Type {
25
- Q_UPDATE_VERSION : generics .TypeOf [ComponentVersionQuestion ](),
26
- Q_ENFORCE_TRANSPORT : generics .TypeOf [ComponentVersionQuestion ](),
27
- Q_OVERWRITE_VERSION : generics .TypeOf [ComponentVersionQuestion ](),
28
- Q_TRANSFER_VERSION : generics .TypeOf [ComponentReferenceQuestion ](),
29
- Q_TRANSFER_RESOURCE : generics .TypeOf [ArtifactQuestion ](),
30
- Q_TRANSFER_SOURCE : generics .TypeOf [ArtifactQuestion ](),
25
+ Q_UPDATE_VERSION : generics .TypeOf [ComponentVersionQuestionArguments ](),
26
+ Q_ENFORCE_TRANSPORT : generics .TypeOf [ComponentVersionQuestionArguments ](),
27
+ Q_OVERWRITE_VERSION : generics .TypeOf [ComponentVersionQuestionArguments ](),
28
+ Q_TRANSFER_VERSION : generics .TypeOf [ComponentReferenceQuestionArguments ](),
29
+ Q_TRANSFER_RESOURCE : generics .TypeOf [ArtifactQuestionArguments ](),
30
+ Q_TRANSFER_SOURCE : generics .TypeOf [ArtifactQuestionArguments ](),
31
31
}
32
32
33
33
type UniformAccessSpecInfo = tech.UniformAccessSpecInfo
@@ -83,27 +83,35 @@ type DecisionRequestResult struct {
83
83
Resolution * Resolution `json:"resolution,omitempty"`
84
84
}
85
85
86
- // Question is the interface for the question attributes
86
+ // QuestionArguments is the interface for the question attributes
87
87
// differing for the various questions types.
88
88
// There are three basic attribute sets:
89
- // - ComponentVersionQuestion
90
- // - ComponentReferenceQuestion
91
- // - ArtifactQuestion
89
+ // - ComponentVersionQuestionArguments
90
+ // - ComponentReferenceQuestionArguments
91
+ // - ArtifactQuestionArguments
92
92
//
93
93
// For type assignments see TransferHandlerQuestions.
94
- type Question interface {}
94
+ type QuestionArguments interface {
95
+ QuestionArgumentsType () string
96
+ }
95
97
96
- // ComponentVersionQuestion describes the question arguments
98
+ // ComponentVersionQuestionArguments describes the question arguments
97
99
// given for a component version related question.
98
- type ComponentVersionQuestion struct {
100
+ type ComponentVersionQuestionArguments struct {
99
101
Source SourceComponentVersion `json:"source"`
100
102
Target TargetRepositorySpec `json:"target"`
101
103
Options TransferOptions `json:"options"`
102
104
}
103
105
104
- // ComponentReferenceQuestion describes the question arguments
106
+ var _ QuestionArguments = (* ComponentVersionQuestionArguments )(nil )
107
+
108
+ func (a * ComponentVersionQuestionArguments ) QuestionArgumentsType () string {
109
+ return "ComponentVersionQuestionArguments"
110
+ }
111
+
112
+ // ComponentReferenceQuestionArguments describes the question arguments
105
113
// given for a component version reference related question.
106
- type ComponentReferenceQuestion struct {
114
+ type ComponentReferenceQuestionArguments struct {
107
115
Source SourceComponentVersion `json:"source"`
108
116
Target TargetRepositorySpec `json:"target"`
109
117
@@ -113,16 +121,28 @@ type ComponentReferenceQuestion struct {
113
121
Options TransferOptions `json:"options"`
114
122
}
115
123
124
+ var _ QuestionArguments = (* ComponentReferenceQuestionArguments )(nil )
125
+
126
+ func (a * ComponentReferenceQuestionArguments ) QuestionArgumentsType () string {
127
+ return "ComponentReferenceQuestionArguments"
128
+ }
129
+
116
130
type Artifact struct {
117
131
Meta v2.ElementMeta `json:"metadata"`
118
132
Access ocm.GenericAccessSpec `json:"access"`
119
133
AccessInfo UniformAccessSpecInfo `json:"accessInfo"`
120
134
}
121
135
122
- // ArtifactQuestion describes the question arguments
136
+ // ArtifactQuestionArguments describes the question arguments
123
137
// given for an artifact related question.
124
- type ArtifactQuestion struct {
138
+ type ArtifactQuestionArguments struct {
125
139
Source SourceComponentVersion `json:"source"`
126
140
Artifact Artifact `json:"artifact"`
127
141
Options TransferOptions `json:"options"`
128
142
}
143
+
144
+ var _ QuestionArguments = (* ArtifactQuestionArguments )(nil )
145
+
146
+ func (a * ArtifactQuestionArguments ) QuestionArgumentsType () string {
147
+ return "ArtifactQuestionArguments"
148
+ }
0 commit comments