34 34 | /**
|
35 35 | * If manualCreation is true, CodeBuild doesn't create a webhook in GitHub and instead returns `payloadUrl` and `secret` values for the webhook. The `payloadUrl` and `secret` values in the output can be used to manually create a webhook within GitHub.
|
36 36 | *
|
37 37 | * manualCreation is only available for GitHub webhooks.
|
38 38 | */
|
39 39 | public val manualCreation: kotlin.Boolean? = builder.manualCreation
|
40 40 | /**
|
41 41 | * The CodeBuild endpoint where webhook events are sent.
|
42 42 | */
|
43 43 | public val payloadUrl: kotlin.String? = builder.payloadUrl
|
44 + | /**
|
45 + | * A PullRequestBuildPolicy object that defines comment-based approval requirements for triggering builds on pull requests. This policy helps control when automated builds are executed based on contributor permissions and approval workflows.
|
46 + | */
|
47 + | public val pullRequestBuildPolicy: aws.sdk.kotlin.services.codebuild.model.PullRequestBuildPolicy? = builder.pullRequestBuildPolicy
|
44 48 | /**
|
45 49 | * The scope configuration for global or organization webhooks.
|
46 50 | *
|
47 51 | * Global or organization webhooks are only available for GitHub and Github Enterprise webhooks.
|
48 52 | */
|
49 53 | public val scopeConfiguration: aws.sdk.kotlin.services.codebuild.model.ScopeConfiguration? = builder.scopeConfiguration
|
50 54 | /**
|
51 55 | * The secret token of the associated repository.
|
52 56 | *
|
53 57 | * A Bitbucket webhook does not support `secret`.
|
54 58 | */
|
55 59 | public val secret: kotlin.String? = builder.secret
|
56 60 | /**
|
57 61 | * The status of the webhook. Valid values include:
|
58 62 | * + `CREATING`: The webhook is being created.
|
59 63 | * + `CREATE_FAILED`: The webhook has failed to create.
|
60 64 | * + `ACTIVE`: The webhook has succeeded and is active.
|
61 65 | * + `DELETING`: The webhook is being deleted.
|
62 66 | */
|
63 67 | public val status: aws.sdk.kotlin.services.codebuild.model.WebhookStatus? = builder.status
|
64 68 | /**
|
65 69 | * A message associated with the status of a webhook.
|
66 70 | */
|
67 71 | public val statusMessage: kotlin.String? = builder.statusMessage
|
68 72 | /**
|
69 73 | * The URL to the webhook.
|
70 74 | */
|
71 75 | public val url: kotlin.String? = builder.url
|
72 76 |
|
73 77 | public companion object {
|
74 78 | public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.codebuild.model.Webhook = Builder().apply(block).build()
|
75 79 | }
|
76 80 |
|
77 81 | override fun toString(): kotlin.String = buildString {
|
78 82 | append("Webhook(")
|
79 83 | append("branchFilter=$branchFilter,")
|
80 84 | append("buildType=$buildType,")
|
81 85 | append("filterGroups=$filterGroups,")
|
82 86 | append("lastModifiedSecret=$lastModifiedSecret,")
|
83 87 | append("manualCreation=$manualCreation,")
|
84 88 | append("payloadUrl=$payloadUrl,")
|
89 + | append("pullRequestBuildPolicy=$pullRequestBuildPolicy,")
|
85 90 | append("scopeConfiguration=$scopeConfiguration,")
|
86 91 | append("secret=$secret,")
|
87 92 | append("status=$status,")
|
88 93 | append("statusMessage=$statusMessage,")
|
89 94 | append("url=$url")
|
90 95 | append(")")
|
91 96 | }
|
92 97 |
|
93 98 | override fun hashCode(): kotlin.Int {
|
94 99 | var result = branchFilter?.hashCode() ?: 0
|
95 100 | result = 31 * result + (this.buildType?.hashCode() ?: 0)
|
96 101 | result = 31 * result + (this.filterGroups?.hashCode() ?: 0)
|
97 102 | result = 31 * result + (this.lastModifiedSecret?.hashCode() ?: 0)
|
98 103 | result = 31 * result + (this.manualCreation?.hashCode() ?: 0)
|
99 104 | result = 31 * result + (this.payloadUrl?.hashCode() ?: 0)
|
105 + | result = 31 * result + (this.pullRequestBuildPolicy?.hashCode() ?: 0)
|
100 106 | result = 31 * result + (this.scopeConfiguration?.hashCode() ?: 0)
|
101 107 | result = 31 * result + (this.secret?.hashCode() ?: 0)
|
102 108 | result = 31 * result + (this.status?.hashCode() ?: 0)
|
103 109 | result = 31 * result + (this.statusMessage?.hashCode() ?: 0)
|
104 110 | result = 31 * result + (this.url?.hashCode() ?: 0)
|
105 111 | return result
|
106 112 | }
|
107 113 |
|
108 114 | override fun equals(other: kotlin.Any?): kotlin.Boolean {
|
109 115 | if (this === other) return true
|
110 116 | if (other == null || this::class != other::class) return false
|
111 117 |
|
112 118 | other as Webhook
|
113 119 |
|
114 120 | if (branchFilter != other.branchFilter) return false
|
115 121 | if (buildType != other.buildType) return false
|
116 122 | if (filterGroups != other.filterGroups) return false
|
117 123 | if (lastModifiedSecret != other.lastModifiedSecret) return false
|
118 124 | if (manualCreation != other.manualCreation) return false
|
119 125 | if (payloadUrl != other.payloadUrl) return false
|
126 + | if (pullRequestBuildPolicy != other.pullRequestBuildPolicy) return false
|
120 127 | if (scopeConfiguration != other.scopeConfiguration) return false
|
121 128 | if (secret != other.secret) return false
|
122 129 | if (status != other.status) return false
|
123 130 | if (statusMessage != other.statusMessage) return false
|
124 131 | if (url != other.url) return false
|
125 132 |
|
126 133 | return true
|
127 134 | }
|
128 135 |
|
129 136 | public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.codebuild.model.Webhook = Builder(this).apply(block).build()
|
130 137 |
|
131 138 | @SdkDsl
|
132 139 | public class Builder {
|
133 140 | /**
|
134 141 | * A regular expression used to determine which repository branches are built when a webhook is triggered. If the name of a branch matches the regular expression, then it is built. If `branchFilter` is empty, then all branches are built.
|
135 142 | *
|
136 143 | * It is recommended that you use `filterGroups` instead of `branchFilter`.
|
137 144 | */
|
138 145 | public var branchFilter: kotlin.String? = null
|
139 146 | /**
|
140 147 | * Specifies the type of build this webhook will trigger.
|
141 148 | *
|
142 149 | * `RUNNER_BUILDKITE_BUILD` is only available for `NO_SOURCE` source type projects configured for Buildkite runner builds. For more information about CodeBuild-hosted Buildkite runner builds, see [Tutorial: Configure a CodeBuild-hosted Buildkite runner](https://docs.aws.amazon.com/codebuild/latest/userguide/sample-runner-buildkite.html) in the *CodeBuild user guide*.
|
143 150 | */
|
144 151 | public var buildType: aws.sdk.kotlin.services.codebuild.model.WebhookBuildType? = null
|
145 152 | /**
|
146 153 | * An array of arrays of `WebhookFilter` objects used to determine which webhooks are triggered. At least one `WebhookFilter` in the array must specify `EVENT` as its `type`.
|
147 154 | *
|
148 155 | * For a build to be triggered, at least one filter group in the `filterGroups` array must pass. For a filter group to pass, each of its filters must pass.
|
149 156 | */
|
150 157 | public var filterGroups: List<List<WebhookFilter>>? = null
|
151 158 | /**
|
152 159 | * A timestamp that indicates the last time a repository's secret token was modified.
|
153 160 | */
|
154 161 | public var lastModifiedSecret: aws.smithy.kotlin.runtime.time.Instant? = null
|
155 162 | /**
|
156 163 | * If manualCreation is true, CodeBuild doesn't create a webhook in GitHub and instead returns `payloadUrl` and `secret` values for the webhook. The `payloadUrl` and `secret` values in the output can be used to manually create a webhook within GitHub.
|
157 164 | *
|
158 165 | * manualCreation is only available for GitHub webhooks.
|
159 166 | */
|
160 167 | public var manualCreation: kotlin.Boolean? = null
|
161 168 | /**
|
162 169 | * The CodeBuild endpoint where webhook events are sent.
|
163 170 | */
|
164 171 | public var payloadUrl: kotlin.String? = null
|
172 + | /**
|
173 + | * A PullRequestBuildPolicy object that defines comment-based approval requirements for triggering builds on pull requests. This policy helps control when automated builds are executed based on contributor permissions and approval workflows.
|
174 + | */
|
175 + | public var pullRequestBuildPolicy: aws.sdk.kotlin.services.codebuild.model.PullRequestBuildPolicy? = null
|
165 176 | /**
|
166 177 | * The scope configuration for global or organization webhooks.
|
167 178 | *
|
168 179 | * Global or organization webhooks are only available for GitHub and Github Enterprise webhooks.
|
169 180 | */
|
170 181 | public var scopeConfiguration: aws.sdk.kotlin.services.codebuild.model.ScopeConfiguration? = null
|
171 182 | /**
|
172 183 | * The secret token of the associated repository.
|
173 184 | *
|
174 185 | * A Bitbucket webhook does not support `secret`.
|
175 186 | */
|
176 187 | public var secret: kotlin.String? = null
|
177 188 | /**
|
178 189 | * The status of the webhook. Valid values include:
|
179 190 | * + `CREATING`: The webhook is being created.
|
180 191 | * + `CREATE_FAILED`: The webhook has failed to create.
|
181 192 | * + `ACTIVE`: The webhook has succeeded and is active.
|
182 193 | * + `DELETING`: The webhook is being deleted.
|
183 194 | */
|
184 195 | public var status: aws.sdk.kotlin.services.codebuild.model.WebhookStatus? = null
|
185 196 | /**
|
186 197 | * A message associated with the status of a webhook.
|
187 198 | */
|
188 199 | public var statusMessage: kotlin.String? = null
|
189 200 | /**
|
190 201 | * The URL to the webhook.
|
191 202 | */
|
192 203 | public var url: kotlin.String? = null
|
193 204 |
|
194 205 | @PublishedApi
|
195 206 | internal constructor()
|
196 207 | @PublishedApi
|
197 208 | internal constructor(x: aws.sdk.kotlin.services.codebuild.model.Webhook) : this() {
|
198 209 | this.branchFilter = x.branchFilter
|
199 210 | this.buildType = x.buildType
|
200 211 | this.filterGroups = x.filterGroups
|
201 212 | this.lastModifiedSecret = x.lastModifiedSecret
|
202 213 | this.manualCreation = x.manualCreation
|
203 214 | this.payloadUrl = x.payloadUrl
|
215 + | this.pullRequestBuildPolicy = x.pullRequestBuildPolicy
|
204 216 | this.scopeConfiguration = x.scopeConfiguration
|
205 217 | this.secret = x.secret
|
206 218 | this.status = x.status
|
207 219 | this.statusMessage = x.statusMessage
|
208 220 | this.url = x.url
|
209 221 | }
|
210 222 |
|
211 223 | @PublishedApi
|
212 224 | internal fun build(): aws.sdk.kotlin.services.codebuild.model.Webhook = Webhook(this)
|
213 225 |
|
226 + | /**
|
227 + | * construct an [aws.sdk.kotlin.services.codebuild.model.PullRequestBuildPolicy] inside the given [block]
|
228 + | */
|
229 + | public fun pullRequestBuildPolicy(block: aws.sdk.kotlin.services.codebuild.model.PullRequestBuildPolicy.Builder.() -> kotlin.Unit) {
|
230 + | this.pullRequestBuildPolicy = aws.sdk.kotlin.services.codebuild.model.PullRequestBuildPolicy.invoke(block)
|
231 + | }
|
232 + |
|
214 233 | /**
|
215 234 | * construct an [aws.sdk.kotlin.services.codebuild.model.ScopeConfiguration] inside the given [block]
|
216 235 | */
|
217 236 | public fun scopeConfiguration(block: aws.sdk.kotlin.services.codebuild.model.ScopeConfiguration.Builder.() -> kotlin.Unit) {
|
218 237 | this.scopeConfiguration = aws.sdk.kotlin.services.codebuild.model.ScopeConfiguration.invoke(block)
|
219 238 | }
|
220 239 |
|
221 240 | internal fun correctErrors(): Builder {
|
222 241 | return this
|
223 242 | }
|