All Downloads are FREE. Search and download functionalities are using the official Maven repository.

.bamboo.specs.extension.bamboo-specs-extension.1.3.18.source-code.NotificationExtension.kt Maven / Gradle / Ivy

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)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy