|
| 1 | +// This file was generated using action-binding-generator. Don't change it by hand, otherwise your |
| 2 | +// changes will be overwritten with the next binding code regeneration. |
| 3 | +// See https://github.com/typesafegithub/github-workflows-kt for more info. |
| 4 | +@file:Suppress( |
| 5 | + "DataClassPrivateConstructor", |
| 6 | + "UNUSED_PARAMETER", |
| 7 | +) |
| 8 | + |
| 9 | +package io.github.typesafegithub.workflows.actions.actions |
| 10 | + |
| 11 | +import io.github.typesafegithub.workflows.domain.actions.Action |
| 12 | +import io.github.typesafegithub.workflows.domain.actions.RegularAction |
| 13 | +import java.util.LinkedHashMap |
| 14 | +import kotlin.Int |
| 15 | +import kotlin.String |
| 16 | +import kotlin.Suppress |
| 17 | +import kotlin.Unit |
| 18 | +import kotlin.collections.List |
| 19 | +import kotlin.collections.Map |
| 20 | +import kotlin.collections.toList |
| 21 | +import kotlin.collections.toTypedArray |
| 22 | + |
| 23 | +/** |
| 24 | + * Action: Upload a Build Artifact |
| 25 | + * |
| 26 | + * Upload a build artifact that can be used by subsequent workflow steps |
| 27 | + * |
| 28 | + * [Action on GitHub](https://github.com/actions/upload-artifact) |
| 29 | + */ |
| 30 | +public data class UploadArtifactV4 private constructor( |
| 31 | + /** |
| 32 | + * Artifact name |
| 33 | + */ |
| 34 | + public val name: String? = null, |
| 35 | + /** |
| 36 | + * A file, directory or wildcard pattern that describes what to upload |
| 37 | + */ |
| 38 | + public val path: List<String>, |
| 39 | + /** |
| 40 | + * The desired behavior if no files are found using the provided path. |
| 41 | + * Available Options: |
| 42 | + * warn: Output a warning but do not fail the action |
| 43 | + * error: Fail the action with an error message |
| 44 | + * ignore: Do not output any warnings or errors, the action does not fail |
| 45 | + */ |
| 46 | + public val ifNoFilesFound: UploadArtifactV4.BehaviorIfNoFilesFound? = null, |
| 47 | + /** |
| 48 | + * Duration after which artifact will expire in days. 0 means using default retention. |
| 49 | + * Minimum 1 day. Maximum 90 days unless changed from the repository settings page. |
| 50 | + */ |
| 51 | + public val retentionDays: UploadArtifactV4.RetentionPeriod? = null, |
| 52 | + /** |
| 53 | + * The level of compression for Zlib to be applied to the artifact archive. The value can range |
| 54 | + * from 0 to 9: - 0: No compression - 1: Best speed - 6: Default compression (same as GNU Gzip) - |
| 55 | + * 9: Best compression Higher levels will result in better compression, but will take longer to |
| 56 | + * complete. For large files that are not easily compressed, a value of 0 is recommended for |
| 57 | + * significantly faster uploads. |
| 58 | + */ |
| 59 | + public val compressionLevel: UploadArtifactV4.CompressionLevel? = null, |
| 60 | + /** |
| 61 | + * Type-unsafe map where you can put any inputs that are not yet supported by the binding |
| 62 | + */ |
| 63 | + public val _customInputs: Map<String, String> = mapOf(), |
| 64 | + /** |
| 65 | + * Allows overriding action's version, for example to use a specific minor version, or a newer |
| 66 | + * version that the binding doesn't yet know about |
| 67 | + */ |
| 68 | + public val _customVersion: String? = null, |
| 69 | +) : RegularAction<UploadArtifactV4.Outputs>("actions", "upload-artifact", _customVersion ?: "v4") { |
| 70 | + public constructor( |
| 71 | + vararg pleaseUseNamedArguments: Unit, |
| 72 | + name: String? = null, |
| 73 | + path: List<String>, |
| 74 | + ifNoFilesFound: UploadArtifactV4.BehaviorIfNoFilesFound? = null, |
| 75 | + retentionDays: UploadArtifactV4.RetentionPeriod? = null, |
| 76 | + compressionLevel: UploadArtifactV4.CompressionLevel? = null, |
| 77 | + _customInputs: Map<String, String> = mapOf(), |
| 78 | + _customVersion: String? = null, |
| 79 | + ) : this(name=name, path=path, ifNoFilesFound=ifNoFilesFound, retentionDays=retentionDays, |
| 80 | + compressionLevel=compressionLevel, _customInputs=_customInputs, |
| 81 | + _customVersion=_customVersion) |
| 82 | + |
| 83 | + @Suppress("SpreadOperator") |
| 84 | + override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf( |
| 85 | + *listOfNotNull( |
| 86 | + name?.let { "name" to it }, |
| 87 | + "path" to path.joinToString("\n"), |
| 88 | + ifNoFilesFound?.let { "if-no-files-found" to it.stringValue }, |
| 89 | + retentionDays?.let { "retention-days" to it.integerValue.toString() }, |
| 90 | + compressionLevel?.let { "compression-level" to it.integerValue.toString() }, |
| 91 | + *_customInputs.toList().toTypedArray(), |
| 92 | + ).toTypedArray() |
| 93 | + ) |
| 94 | + |
| 95 | + override fun buildOutputObject(stepId: String): Outputs = Outputs(stepId) |
| 96 | + |
| 97 | + public sealed class BehaviorIfNoFilesFound( |
| 98 | + public val stringValue: String, |
| 99 | + ) { |
| 100 | + public object Warn : UploadArtifactV4.BehaviorIfNoFilesFound("warn") |
| 101 | + |
| 102 | + public object Error : UploadArtifactV4.BehaviorIfNoFilesFound("error") |
| 103 | + |
| 104 | + public object Ignore : UploadArtifactV4.BehaviorIfNoFilesFound("ignore") |
| 105 | + |
| 106 | + public class Custom( |
| 107 | + customStringValue: String, |
| 108 | + ) : UploadArtifactV4.BehaviorIfNoFilesFound(customStringValue) |
| 109 | + } |
| 110 | + |
| 111 | + public sealed class RetentionPeriod( |
| 112 | + public val integerValue: Int, |
| 113 | + ) { |
| 114 | + public class Value( |
| 115 | + requestedValue: Int, |
| 116 | + ) : UploadArtifactV4.RetentionPeriod(requestedValue) |
| 117 | + |
| 118 | + public object Default : UploadArtifactV4.RetentionPeriod(0) |
| 119 | + } |
| 120 | + |
| 121 | + public sealed class CompressionLevel( |
| 122 | + public val integerValue: Int, |
| 123 | + ) { |
| 124 | + public class Value( |
| 125 | + requestedValue: Int, |
| 126 | + ) : UploadArtifactV4.CompressionLevel(requestedValue) |
| 127 | + |
| 128 | + public object NoCompression : UploadArtifactV4.CompressionLevel(0) |
| 129 | + |
| 130 | + public object BestSpeed : UploadArtifactV4.CompressionLevel(1) |
| 131 | + |
| 132 | + public object DefaultCompression : UploadArtifactV4.CompressionLevel(6) |
| 133 | + |
| 134 | + public object BestCompression : UploadArtifactV4.CompressionLevel(9) |
| 135 | + } |
| 136 | + |
| 137 | + public class Outputs( |
| 138 | + stepId: String, |
| 139 | + ) : Action.Outputs(stepId) { |
| 140 | + /** |
| 141 | + * A unique identifier for the artifact that was just uploaded. Empty if artifact upload |
| 142 | + * failed. |
| 143 | + * This ID can be used as input to other APIs to download, delete or get more information |
| 144 | + * about an artifact: https://docs.github.com/en/rest/actions/artifacts |
| 145 | + */ |
| 146 | + public val artifactId: String = "steps.$stepId.outputs.artifact-id" |
| 147 | + } |
| 148 | +} |
0 commit comments