Skip to content

Commit

Permalink
feat(abg)!: replace data class perks by code generation in bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
Vampire committed Dec 9, 2024
1 parent 9d65dc9 commit e1c02e0
Show file tree
Hide file tree
Showing 16 changed files with 1,339 additions and 285 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// This file was generated using action-binding-generator. Don't change it by hand, otherwise your
// changes will be overwritten with the next binding code regeneration.
// See https://github.com/typesafegithub/github-workflows-kt for more info.
@file:Suppress(
"DataClassPrivateConstructor",
"UNUSED_PARAMETER",
)
@file:Suppress("UNUSED_PARAMETER")

package io.github.typesafegithub.workflows.actions.johnsmith

import io.github.typesafegithub.workflows.domain.actions.Action
import io.github.typesafegithub.workflows.domain.actions.RegularAction
import java.util.LinkedHashMap
import kotlin.ExposedCopyVisibility
import java.util.Objects
import kotlin.Any
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
Expand All @@ -27,8 +27,8 @@ import kotlin.collections.Map
* @param _customInputs Type-unsafe map where you can put any inputs that are not yet supported by the binding
* @param _customVersion Allows overriding action's version, for example to use a specific minor version, or a newer version that the binding doesn't yet know about
*/
@ExposedCopyVisibility
public data class ActionBindingV2WithSubAction private constructor(
public class ActionBindingV2WithSubAction(
vararg pleaseUseNamedArguments: Unit,
/**
* Type-unsafe map where you can put any inputs that are not yet supported by the binding
*/
Expand All @@ -49,14 +49,42 @@ public data class ActionBindingV2WithSubAction private constructor(

}

public constructor(
vararg pleaseUseNamedArguments: Unit,
_customInputs: Map<String, String> = mapOf(),
_customVersion: String? = null,
) : this(_customInputs = _customInputs, _customVersion = _customVersion)

@Suppress("SpreadOperator")
override fun toYamlArguments(): LinkedHashMap<String, String> = LinkedHashMap(_customInputs)

override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false
other as ActionBindingV2WithSubAction
return _customInputs == other._customInputs &&
_customVersion == other._customVersion
}

override fun hashCode(): Int = Objects.hash(
_customInputs,
_customVersion,
)

override fun toString(): String = buildString {
append("ActionBindingV2WithSubAction(")
append("""_customInputs=$_customInputs""")
append(", ")
append("""_customVersion=$_customVersion""")
append(")")
}

/**
* @param _customInputs Type-unsafe map where you can put any inputs that are not yet supported by the binding
* @param _customVersion Allows overriding action's version, for example to use a specific minor version, or a newer version that the binding doesn't yet know about
*/
public fun copy(
vararg pleaseUseNamedArguments: Unit,
_customInputs: Map<String, String> = this._customInputs,
_customVersion: String? = this._customVersion,
): ActionBindingV2WithSubAction = ActionBindingV2WithSubAction(
_customInputs = _customInputs,
_customVersion = _customVersion,
)

override fun buildOutputObject(stepId: String): Action.Outputs = Outputs(stepId)
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
// This file was generated using action-binding-generator. Don't change it by hand, otherwise your
// changes will be overwritten with the next binding code regeneration.
// See https://github.com/typesafegithub/github-workflows-kt for more info.
@file:Suppress(
"DataClassPrivateConstructor",
"UNUSED_PARAMETER",
)
@file:Suppress("UNUSED_PARAMETER")

package io.github.typesafegithub.workflows.actions.johnsmith

import io.github.typesafegithub.workflows.domain.actions.Action
import io.github.typesafegithub.workflows.domain.actions.RegularAction
import java.util.LinkedHashMap
import java.util.Objects
import kotlin.Any
import kotlin.Boolean
import kotlin.ExposedCopyVisibility
import kotlin.Float
import kotlin.Int
import kotlin.String
Expand Down Expand Up @@ -57,8 +55,8 @@ import kotlin.collections.toTypedArray
* @param _customInputs Type-unsafe map where you can put any inputs that are not yet supported by the binding
* @param _customVersion Allows overriding action's version, for example to use a specific minor version, or a newer version that the binding doesn't yet know about
*/
@ExposedCopyVisibility
public data class ActionWithAllTypesOfInputsBindingV2 private constructor(
public class ActionWithAllTypesOfInputsBindingV2(
vararg pleaseUseNamedArguments: Unit,
/**
* &lt;required&gt; Short description
*/
Expand Down Expand Up @@ -243,36 +241,6 @@ public data class ActionWithAllTypesOfInputsBindingV2 private constructor(
}
}

public constructor(
vararg pleaseUseNamedArguments: Unit,
fooBar: String? = null,
fooBar_Untyped: String? = null,
bazGoo: Boolean? = null,
bazGoo_Untyped: String? = null,
binKin: Boolean? = null,
binKin_Untyped: String? = null,
intPint: Int? = null,
intPint_Untyped: String? = null,
floPint: Float? = null,
floPint_Untyped: String? = null,
finBin: ActionWithAllTypesOfInputsBindingV2.Bin? = null,
finBin_Untyped: String? = null,
gooZen: ActionWithAllTypesOfInputsBindingV2.Zen? = null,
gooZen_Untyped: String? = null,
bahEnum: ActionWithAllTypesOfInputsBindingV2.BahEnum? = null,
bahEnum_Untyped: String? = null,
listStrings: List<String>? = null,
listStrings_Untyped: String? = null,
listInts: List<Int>? = null,
listInts_Untyped: String? = null,
listEnums: List<ActionWithAllTypesOfInputsBindingV2.MyEnum>? = null,
listEnums_Untyped: String? = null,
listIntSpecial: List<ActionWithAllTypesOfInputsBindingV2.MyInt>? = null,
listIntSpecial_Untyped: String? = null,
_customInputs: Map<String, String> = mapOf(),
_customVersion: String? = null,
) : this(fooBar = fooBar, fooBar_Untyped = fooBar_Untyped, bazGoo = bazGoo, bazGoo_Untyped = bazGoo_Untyped, binKin = binKin, binKin_Untyped = binKin_Untyped, intPint = intPint, intPint_Untyped = intPint_Untyped, floPint = floPint, floPint_Untyped = floPint_Untyped, finBin = finBin, finBin_Untyped = finBin_Untyped, gooZen = gooZen, gooZen_Untyped = gooZen_Untyped, bahEnum = bahEnum, bahEnum_Untyped = bahEnum_Untyped, listStrings = listStrings, listStrings_Untyped = listStrings_Untyped, listInts = listInts, listInts_Untyped = listInts_Untyped, listEnums = listEnums, listEnums_Untyped = listEnums_Untyped, listIntSpecial = listIntSpecial, listIntSpecial_Untyped = listIntSpecial_Untyped, _customInputs = _customInputs, _customVersion = _customVersion)

@Suppress("SpreadOperator")
override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf(
*listOfNotNull(
Expand Down Expand Up @@ -304,6 +272,208 @@ public data class ActionWithAllTypesOfInputsBindingV2 private constructor(
).toTypedArray()
)

override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false
other as ActionWithAllTypesOfInputsBindingV2
return fooBar == other.fooBar &&
fooBar_Untyped == other.fooBar_Untyped &&
bazGoo == other.bazGoo &&
bazGoo_Untyped == other.bazGoo_Untyped &&
binKin == other.binKin &&
binKin_Untyped == other.binKin_Untyped &&
intPint == other.intPint &&
intPint_Untyped == other.intPint_Untyped &&
floPint == other.floPint &&
floPint_Untyped == other.floPint_Untyped &&
finBin == other.finBin &&
finBin_Untyped == other.finBin_Untyped &&
gooZen == other.gooZen &&
gooZen_Untyped == other.gooZen_Untyped &&
bahEnum == other.bahEnum &&
bahEnum_Untyped == other.bahEnum_Untyped &&
listStrings == other.listStrings &&
listStrings_Untyped == other.listStrings_Untyped &&
listInts == other.listInts &&
listInts_Untyped == other.listInts_Untyped &&
listEnums == other.listEnums &&
listEnums_Untyped == other.listEnums_Untyped &&
listIntSpecial == other.listIntSpecial &&
listIntSpecial_Untyped == other.listIntSpecial_Untyped &&
_customInputs == other._customInputs &&
_customVersion == other._customVersion
}

override fun hashCode(): Int = Objects.hash(
fooBar,
fooBar_Untyped,
bazGoo,
bazGoo_Untyped,
binKin,
binKin_Untyped,
intPint,
intPint_Untyped,
floPint,
floPint_Untyped,
finBin,
finBin_Untyped,
gooZen,
gooZen_Untyped,
bahEnum,
bahEnum_Untyped,
listStrings,
listStrings_Untyped,
listInts,
listInts_Untyped,
listEnums,
listEnums_Untyped,
listIntSpecial,
listIntSpecial_Untyped,
_customInputs,
_customVersion,
)

override fun toString(): String = buildString {
append("ActionWithAllTypesOfInputsBindingV2(")
append("""fooBar=$fooBar""")
append(", ")
append("""fooBar_Untyped=$fooBar_Untyped""")
append(", ")
append("""bazGoo=$bazGoo""")
append(", ")
append("""bazGoo_Untyped=$bazGoo_Untyped""")
append(", ")
append("""binKin=$binKin""")
append(", ")
append("""binKin_Untyped=$binKin_Untyped""")
append(", ")
append("""intPint=$intPint""")
append(", ")
append("""intPint_Untyped=$intPint_Untyped""")
append(", ")
append("""floPint=$floPint""")
append(", ")
append("""floPint_Untyped=$floPint_Untyped""")
append(", ")
append("""finBin=$finBin""")
append(", ")
append("""finBin_Untyped=$finBin_Untyped""")
append(", ")
append("""gooZen=$gooZen""")
append(", ")
append("""gooZen_Untyped=$gooZen_Untyped""")
append(", ")
append("""bahEnum=$bahEnum""")
append(", ")
append("""bahEnum_Untyped=$bahEnum_Untyped""")
append(", ")
append("""listStrings=$listStrings""")
append(", ")
append("""listStrings_Untyped=$listStrings_Untyped""")
append(", ")
append("""listInts=$listInts""")
append(", ")
append("""listInts_Untyped=$listInts_Untyped""")
append(", ")
append("""listEnums=$listEnums""")
append(", ")
append("""listEnums_Untyped=$listEnums_Untyped""")
append(", ")
append("""listIntSpecial=$listIntSpecial""")
append(", ")
append("""listIntSpecial_Untyped=$listIntSpecial_Untyped""")
append(", ")
append("""_customInputs=$_customInputs""")
append(", ")
append("""_customVersion=$_customVersion""")
append(")")
}

/**
* @param fooBar &lt;required&gt; Short description
* @param fooBar_Untyped &lt;required&gt; Short description
* @param bazGoo &lt;required&gt; First boolean input!
* @param bazGoo_Untyped &lt;required&gt; First boolean input!
* @param binKin Boolean and nullable
* @param binKin_Untyped Boolean and nullable
* @param intPint &lt;required&gt; Integer
* @param intPint_Untyped &lt;required&gt; Integer
* @param floPint &lt;required&gt; Float
* @param floPint_Untyped &lt;required&gt; Float
* @param finBin &lt;required&gt; Enumeration
* @param finBin_Untyped &lt;required&gt; Enumeration
* @param gooZen &lt;required&gt; Integer with special value
* @param gooZen_Untyped &lt;required&gt; Integer with special value
* @param bahEnum &lt;required&gt; Enum with custom naming
* @param bahEnum_Untyped &lt;required&gt; Enum with custom naming
* @param listStrings List of strings
* @param listStrings_Untyped List of strings
* @param listInts List of integers
* @param listInts_Untyped List of integers
* @param listEnums List of enums
* @param listEnums_Untyped List of enums
* @param listIntSpecial List of integer with special values
* @param listIntSpecial_Untyped List of integer with special values
* @param _customInputs Type-unsafe map where you can put any inputs that are not yet supported by the binding
* @param _customVersion Allows overriding action's version, for example to use a specific minor version, or a newer version that the binding doesn't yet know about
*/
public fun copy(
vararg pleaseUseNamedArguments: Unit,
fooBar: String? = this.fooBar,
fooBar_Untyped: String? = this.fooBar_Untyped,
bazGoo: Boolean? = this.bazGoo,
bazGoo_Untyped: String? = this.bazGoo_Untyped,
binKin: Boolean? = this.binKin,
binKin_Untyped: String? = this.binKin_Untyped,
intPint: Int? = this.intPint,
intPint_Untyped: String? = this.intPint_Untyped,
floPint: Float? = this.floPint,
floPint_Untyped: String? = this.floPint_Untyped,
finBin: ActionWithAllTypesOfInputsBindingV2.Bin? = this.finBin,
finBin_Untyped: String? = this.finBin_Untyped,
gooZen: ActionWithAllTypesOfInputsBindingV2.Zen? = this.gooZen,
gooZen_Untyped: String? = this.gooZen_Untyped,
bahEnum: ActionWithAllTypesOfInputsBindingV2.BahEnum? = this.bahEnum,
bahEnum_Untyped: String? = this.bahEnum_Untyped,
listStrings: List<String>? = this.listStrings,
listStrings_Untyped: String? = this.listStrings_Untyped,
listInts: List<Int>? = this.listInts,
listInts_Untyped: String? = this.listInts_Untyped,
listEnums: List<ActionWithAllTypesOfInputsBindingV2.MyEnum>? = this.listEnums,
listEnums_Untyped: String? = this.listEnums_Untyped,
listIntSpecial: List<ActionWithAllTypesOfInputsBindingV2.MyInt>? = this.listIntSpecial,
listIntSpecial_Untyped: String? = this.listIntSpecial_Untyped,
_customInputs: Map<String, String> = this._customInputs,
_customVersion: String? = this._customVersion,
): ActionWithAllTypesOfInputsBindingV2 = ActionWithAllTypesOfInputsBindingV2(
fooBar = fooBar,
fooBar_Untyped = fooBar_Untyped,
bazGoo = bazGoo,
bazGoo_Untyped = bazGoo_Untyped,
binKin = binKin,
binKin_Untyped = binKin_Untyped,
intPint = intPint,
intPint_Untyped = intPint_Untyped,
floPint = floPint,
floPint_Untyped = floPint_Untyped,
finBin = finBin,
finBin_Untyped = finBin_Untyped,
gooZen = gooZen,
gooZen_Untyped = gooZen_Untyped,
bahEnum = bahEnum,
bahEnum_Untyped = bahEnum_Untyped,
listStrings = listStrings,
listStrings_Untyped = listStrings_Untyped,
listInts = listInts,
listInts_Untyped = listInts_Untyped,
listEnums = listEnums,
listEnums_Untyped = listEnums_Untyped,
listIntSpecial = listIntSpecial,
listIntSpecial_Untyped = listIntSpecial_Untyped,
_customInputs = _customInputs,
_customVersion = _customVersion,
)

override fun buildOutputObject(stepId: String): Outputs = Outputs(stepId)

public sealed class Bin(
Expand Down
Loading

0 comments on commit e1c02e0

Please sign in to comment.