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

com.atlassian.bamboo.specs.builders.notification.HipChatRecipient Maven / Gradle / Ivy

There is a newer version: 10.1.0
Show newest version
package com.atlassian.bamboo.specs.builders.notification;

import com.atlassian.bamboo.specs.api.builders.notification.NotificationRecipient;
import com.atlassian.bamboo.specs.model.notification.HipChatRecipientProperties;
import org.jetbrains.annotations.NotNull;

import static com.atlassian.bamboo.specs.api.validators.common.ImporterUtils.checkNotBlank;

/**
 * Represents Hipchat account Bamboo can send notifications to.
 */
public class HipChatRecipient extends NotificationRecipient {

    private String apiToken;
    private String room;
    private boolean notifyUsers;

    /**
     * Specifies api token of the Hipchat account.
     */
    public HipChatRecipient apiToken(@NotNull String apiToken) {
        checkNotBlank("apiToken", apiToken);
        this.apiToken = apiToken;
        return this;
    }

    /**
     * Specifies room to send notifications to.
     */
    public HipChatRecipient room(@NotNull String room) {
        checkNotBlank("room", room);
        this.room = room;
        return this;
    }

    /**
     * Specifies if Hipchat should notify its users when new notification appears in the Hipchat room.
     */
    public HipChatRecipient notifyUsers(boolean notifyUsers) {
        this.notifyUsers = notifyUsers;
        return this;
    }

    @NotNull
    @Override
    protected HipChatRecipientProperties build() {
        return new HipChatRecipientProperties(apiToken, room, notifyUsers);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy