net.nemerosa.ontrack.extension.bitbucket.cloud.client.DefaultBitbucketCloudClientFactory.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ontrack-extension-bitbucket-cloud Show documentation
Show all versions of ontrack-extension-bitbucket-cloud Show documentation
Ontrack module: ontrack-extension-bitbucket-cloud
package net.nemerosa.ontrack.extension.bitbucket.cloud.client
import net.nemerosa.ontrack.extension.bitbucket.cloud.configuration.BitbucketCloudConfiguration
import org.springframework.stereotype.Component
@Component
class DefaultBitbucketCloudClientFactory : BitbucketCloudClientFactory {
override fun getBitbucketCloudClient(config: BitbucketCloudConfiguration): BitbucketCloudClient =
if (config.user != null && config.password != null) {
DefaultBitbucketCloudClient(config.workspace, config.user!!, config.password!!)
} else {
throw IllegalStateException("Bitbucket Cloud user name and app password are required.")
}
}