@@ -30,17 +30,29 @@ import kotlin.collections.toTypedArray
30
30
* [Action on GitHub](https://github.com/john-smith/action-with-all-types-of-inputs)
31
31
*
32
32
* @param fooBar Short description
33
+ * @param fooBar_Untyped Short description
33
34
* @param bazGoo First boolean input!
35
+ * @param bazGoo_Untyped First boolean input!
34
36
* @param binKin Boolean and nullable
37
+ * @param binKin_Untyped Boolean and nullable
35
38
* @param intPint Integer
39
+ * @param intPint_Untyped Integer
36
40
* @param floPint Float
41
+ * @param floPint_Untyped Float
37
42
* @param finBin Enumeration
43
+ * @param finBin_Untyped Enumeration
38
44
* @param gooZen Integer with special value
45
+ * @param gooZen_Untyped Integer with special value
39
46
* @param bahEnum Enum with custom naming
47
+ * @param bahEnum_Untyped Enum with custom naming
40
48
* @param listStrings List of strings
49
+ * @param listStrings_Untyped List of strings
41
50
* @param listInts List of integers
51
+ * @param listInts_Untyped List of integers
42
52
* @param listEnums List of enums
53
+ * @param listEnums_Untyped List of enums
43
54
* @param listIntSpecial List of integer with special values
55
+ * @param listIntSpecial_Untyped List of integer with special values
44
56
* @param _customInputs Type-unsafe map where you can put any inputs that are not yet supported by
45
57
* the binding
46
58
* @param _customVersion Allows overriding action's version, for example to use a specific minor
@@ -50,51 +62,99 @@ public data class ActionWithAllTypesOfInputs private constructor(
50
62
/* *
51
63
* Short description
52
64
*/
53
- public val fooBar : String ,
65
+ public val fooBar : String? = null ,
66
+ /* *
67
+ * Short description
68
+ */
69
+ public val fooBar_Untyped : String? = null ,
54
70
/* *
55
71
* First boolean input!
56
72
*/
57
- public val bazGoo : Boolean ,
73
+ public val bazGoo : Boolean? = null ,
74
+ /* *
75
+ * First boolean input!
76
+ */
77
+ public val bazGoo_Untyped : String? = null ,
58
78
/* *
59
79
* Boolean and nullable
60
80
*/
61
81
public val binKin : Boolean? = null ,
82
+ /* *
83
+ * Boolean and nullable
84
+ */
85
+ public val binKin_Untyped : String? = null ,
86
+ /* *
87
+ * Integer
88
+ */
89
+ public val intPint : Int? = null ,
62
90
/* *
63
91
* Integer
64
92
*/
65
- public val intPint : Int ,
93
+ public val intPint_Untyped : String? = null ,
66
94
/* *
67
95
* Float
68
96
*/
69
- public val floPint : Float ,
97
+ public val floPint : Float? = null ,
98
+ /* *
99
+ * Float
100
+ */
101
+ public val floPint_Untyped : String? = null ,
102
+ /* *
103
+ * Enumeration
104
+ */
105
+ public val finBin : ActionWithAllTypesOfInputs .Bin ? = null ,
70
106
/* *
71
107
* Enumeration
72
108
*/
73
- public val finBin : ActionWithAllTypesOfInputs .Bin ,
109
+ public val finBin_Untyped : String? = null ,
110
+ /* *
111
+ * Integer with special value
112
+ */
113
+ public val gooZen : ActionWithAllTypesOfInputs .Zen ? = null ,
74
114
/* *
75
115
* Integer with special value
76
116
*/
77
- public val gooZen : ActionWithAllTypesOfInputs .Zen ,
117
+ public val gooZen_Untyped : String? = null ,
118
+ /* *
119
+ * Enum with custom naming
120
+ */
121
+ public val bahEnum : ActionWithAllTypesOfInputs .BahEnum ? = null ,
78
122
/* *
79
123
* Enum with custom naming
80
124
*/
81
- public val bahEnum : ActionWithAllTypesOfInputs . BahEnum ,
125
+ public val bahEnum_Untyped : String? = null ,
82
126
/* *
83
127
* List of strings
84
128
*/
85
129
public val listStrings : List <String >? = null ,
130
+ /* *
131
+ * List of strings
132
+ */
133
+ public val listStrings_Untyped : String? = null ,
86
134
/* *
87
135
* List of integers
88
136
*/
89
137
public val listInts : List <Int >? = null ,
138
+ /* *
139
+ * List of integers
140
+ */
141
+ public val listInts_Untyped : String? = null ,
90
142
/* *
91
143
* List of enums
92
144
*/
93
145
public val listEnums : List <ActionWithAllTypesOfInputs .MyEnum >? = null ,
146
+ /* *
147
+ * List of enums
148
+ */
149
+ public val listEnums_Untyped : String? = null ,
94
150
/* *
95
151
* List of integer with special values
96
152
*/
97
153
public val listIntSpecial : List <ActionWithAllTypesOfInputs .MyInt >? = null ,
154
+ /* *
155
+ * List of integer with special values
156
+ */
157
+ public val listIntSpecial_Untyped : String? = null ,
98
158
/* *
99
159
* Type-unsafe map where you can put any inputs that are not yet supported by the binding
100
160
*/
@@ -106,43 +166,143 @@ public data class ActionWithAllTypesOfInputs private constructor(
106
166
public val _customVersion : String? = null ,
107
167
) : RegularAction<ActionWithAllTypesOfInputs.Outputs>(" john-smith" ,
108
168
" action-with-all-types-of-inputs" , _customVersion ? : " v3" ) {
169
+ init {
170
+ require(! ((fooBar != null ) && (fooBar_Untyped != null ))) {
171
+ " Only fooBar or fooBar_Untyped must be set, but not both"
172
+ }
173
+ require((fooBar != null ) || (fooBar_Untyped != null )) {
174
+ " fooBar or fooBar_Untyped must be set, one of them is required"
175
+ }
176
+
177
+ require(! ((bazGoo != null ) && (bazGoo_Untyped != null ))) {
178
+ " Only bazGoo or bazGoo_Untyped must be set, but not both"
179
+ }
180
+ require((bazGoo != null ) || (bazGoo_Untyped != null )) {
181
+ " bazGoo or bazGoo_Untyped must be set, one of them is required"
182
+ }
183
+
184
+ require(! ((binKin != null ) && (binKin_Untyped != null ))) {
185
+ " Only binKin or binKin_Untyped must be set, but not both"
186
+ }
187
+
188
+ require(! ((intPint != null ) && (intPint_Untyped != null ))) {
189
+ " Only intPint or intPint_Untyped must be set, but not both"
190
+ }
191
+ require((intPint != null ) || (intPint_Untyped != null )) {
192
+ " intPint or intPint_Untyped must be set, one of them is required"
193
+ }
194
+
195
+ require(! ((floPint != null ) && (floPint_Untyped != null ))) {
196
+ " Only floPint or floPint_Untyped must be set, but not both"
197
+ }
198
+ require((floPint != null ) || (floPint_Untyped != null )) {
199
+ " floPint or floPint_Untyped must be set, one of them is required"
200
+ }
201
+
202
+ require(! ((finBin != null ) && (finBin_Untyped != null ))) {
203
+ " Only finBin or finBin_Untyped must be set, but not both"
204
+ }
205
+ require((finBin != null ) || (finBin_Untyped != null )) {
206
+ " finBin or finBin_Untyped must be set, one of them is required"
207
+ }
208
+
209
+ require(! ((gooZen != null ) && (gooZen_Untyped != null ))) {
210
+ " Only gooZen or gooZen_Untyped must be set, but not both"
211
+ }
212
+ require((gooZen != null ) || (gooZen_Untyped != null )) {
213
+ " gooZen or gooZen_Untyped must be set, one of them is required"
214
+ }
215
+
216
+ require(! ((bahEnum != null ) && (bahEnum_Untyped != null ))) {
217
+ " Only bahEnum or bahEnum_Untyped must be set, but not both"
218
+ }
219
+ require((bahEnum != null ) || (bahEnum_Untyped != null )) {
220
+ " bahEnum or bahEnum_Untyped must be set, one of them is required"
221
+ }
222
+
223
+ require(! ((listStrings != null ) && (listStrings_Untyped != null ))) {
224
+ " Only listStrings or listStrings_Untyped must be set, but not both"
225
+ }
226
+
227
+ require(! ((listInts != null ) && (listInts_Untyped != null ))) {
228
+ " Only listInts or listInts_Untyped must be set, but not both"
229
+ }
230
+
231
+ require(! ((listEnums != null ) && (listEnums_Untyped != null ))) {
232
+ " Only listEnums or listEnums_Untyped must be set, but not both"
233
+ }
234
+
235
+ require(! ((listIntSpecial != null ) && (listIntSpecial_Untyped != null ))) {
236
+ " Only listIntSpecial or listIntSpecial_Untyped must be set, but not both"
237
+ }
238
+ }
239
+
109
240
public constructor (
110
241
vararg pleaseUseNamedArguments: Unit ,
111
- fooBar: String ,
112
- bazGoo: Boolean ,
242
+ fooBar: String? = null ,
243
+ fooBar_Untyped: String? = null ,
244
+ bazGoo: Boolean? = null ,
245
+ bazGoo_Untyped: String? = null ,
113
246
binKin: Boolean? = null ,
114
- intPint: Int ,
115
- floPint: Float ,
116
- finBin: ActionWithAllTypesOfInputs .Bin ,
117
- gooZen: ActionWithAllTypesOfInputs .Zen ,
118
- bahEnum: ActionWithAllTypesOfInputs .BahEnum ,
247
+ binKin_Untyped: String? = null ,
248
+ intPint: Int? = null ,
249
+ intPint_Untyped: String? = null ,
250
+ floPint: Float? = null ,
251
+ floPint_Untyped: String? = null ,
252
+ finBin: ActionWithAllTypesOfInputs .Bin ? = null ,
253
+ finBin_Untyped: String? = null ,
254
+ gooZen: ActionWithAllTypesOfInputs .Zen ? = null ,
255
+ gooZen_Untyped: String? = null ,
256
+ bahEnum: ActionWithAllTypesOfInputs .BahEnum ? = null ,
257
+ bahEnum_Untyped: String? = null ,
119
258
listStrings: List <String >? = null ,
259
+ listStrings_Untyped: String? = null ,
120
260
listInts: List <Int >? = null ,
261
+ listInts_Untyped: String? = null ,
121
262
listEnums: List <ActionWithAllTypesOfInputs .MyEnum >? = null ,
263
+ listEnums_Untyped: String? = null ,
122
264
listIntSpecial: List <ActionWithAllTypesOfInputs .MyInt >? = null ,
265
+ listIntSpecial_Untyped: String? = null ,
123
266
_customInputs : Map <String , String > = mapOf (),
124
267
_customVersion : String? = null ,
125
- ) : this (fooBar= fooBar, bazGoo= bazGoo, binKin= binKin, intPint= intPint, floPint= floPint,
126
- finBin= finBin, gooZen= gooZen, bahEnum= bahEnum, listStrings= listStrings,
127
- listInts= listInts, listEnums= listEnums, listIntSpecial= listIntSpecial,
128
- _customInputs = _customInputs , _customVersion = _customVersion )
268
+ ) : this (fooBar = fooBar, fooBar_Untyped = fooBar_Untyped, bazGoo = bazGoo, bazGoo_Untyped =
269
+ bazGoo_Untyped, binKin = binKin, binKin_Untyped = binKin_Untyped, intPint = intPint,
270
+ intPint_Untyped = intPint_Untyped, floPint = floPint, floPint_Untyped = floPint_Untyped,
271
+ finBin = finBin, finBin_Untyped = finBin_Untyped, gooZen = gooZen, gooZen_Untyped =
272
+ gooZen_Untyped, bahEnum = bahEnum, bahEnum_Untyped = bahEnum_Untyped, listStrings =
273
+ listStrings, listStrings_Untyped = listStrings_Untyped, listInts = listInts,
274
+ listInts_Untyped = listInts_Untyped, listEnums = listEnums, listEnums_Untyped =
275
+ listEnums_Untyped, listIntSpecial = listIntSpecial, listIntSpecial_Untyped =
276
+ listIntSpecial_Untyped, _customInputs = _customInputs , _customVersion = _customVersion )
129
277
130
278
@Suppress(" SpreadOperator" )
131
279
override fun toYamlArguments (): LinkedHashMap <String , String > = linkedMapOf(
132
280
* listOfNotNull(
133
- " foo-bar" .to(fooBar),
134
- " baz-goo" .to(bazGoo.toString()),
281
+ fooBar?.let { " foo-bar" .to(it) },
282
+ fooBar_Untyped?.let { " foo-bar" .to(it) },
283
+ bazGoo?.let { " baz-goo" .to(it.toString()) },
284
+ bazGoo_Untyped?.let { " baz-goo" .to(it) },
135
285
binKin?.let { " bin-kin" .to(it.toString()) },
136
- " int-pint" .to(intPint.toString()),
137
- " flo-pint" .to(floPint.toString()),
138
- " fin-bin" .to(finBin.stringValue),
139
- " goo-zen" .to(gooZen.integerValue.toString()),
140
- " bah-enum" .to(bahEnum.stringValue),
286
+ binKin_Untyped?.let { " bin-kin" .to(it) },
287
+ intPint?.let { " int-pint" .to(it.toString()) },
288
+ intPint_Untyped?.let { " int-pint" .to(it) },
289
+ floPint?.let { " flo-pint" .to(it.toString()) },
290
+ floPint_Untyped?.let { " flo-pint" .to(it) },
291
+ finBin?.let { " fin-bin" .to(it.stringValue) },
292
+ finBin_Untyped?.let { " fin-bin" .to(it) },
293
+ gooZen?.let { " goo-zen" .to(it.integerValue.toString()) },
294
+ gooZen_Untyped?.let { " goo-zen" .to(it) },
295
+ bahEnum?.let { " bah-enum" .to(it.stringValue) },
296
+ bahEnum_Untyped?.let { " bah-enum" .to(it) },
141
297
listStrings?.let { " list-strings" .to(it.joinToString(" ," )) },
298
+ listStrings_Untyped?.let { " list-strings" .to(it) },
142
299
listInts?.let { " list-ints" .to(it.joinToString(" ," ) { it.toString() }) },
300
+ listInts_Untyped?.let { " list-ints" .to(it) },
143
301
listEnums?.let { " list-enums" .to(it.joinToString(" ," ) { it.stringValue }) },
302
+ listEnums_Untyped?.let { " list-enums" .to(it) },
144
303
listIntSpecial?.let { " list-int-special" .to(it.joinToString(" ," ) {
145
304
it.integerValue.toString() }) },
305
+ listIntSpecial_Untyped?.let { " list-int-special" .to(it) },
146
306
* _customInputs .toList().toTypedArray(),
147
307
).toTypedArray()
148
308
)
0 commit comments