.bamboo.specs.extension.bamboo-specs-extension.1.3.18.source-code.NotificationExtension.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bamboo-specs-extension Show documentation
Show all versions of bamboo-specs-extension Show documentation
A Kotlin DSL for Bamboo Specs
The newest version!
package com.atlassian.bamboo.specs.extension
import com.atlassian.bamboo.specs.api.builders.AtlassianModule
import com.atlassian.bamboo.specs.api.builders.notification.* // ktlint-disable no-wildcard-imports
fun > Notification.recipient(recipientTypeConstructor: () -> T, init: SpecsDsl = {}) {
val recipient = recipientTypeConstructor()
recipient.init()
this.recipients(recipient)
}
fun Notification.recipient(recipientType: String, init: SpecsDsl = {}) =
recipient({ AnyNotificationRecipient(AtlassianModule(recipientType)) }, init)
internal fun > notificationInitialisation(notificationTypeConstructor: () -> T, init: SpecsDsl = {}): Notification {
val notification = Notification()
notification.type(notificationTypeConstructor())
notification.init()
return notification
}
internal fun notificationInitialisation(notificationTypeType: String, init: SpecsDsl = {}): Notification =
notificationInitialisation({ AnyNotificationType(AtlassianModule(notificationTypeType)) }, init)