net.nemerosa.ontrack.extension.bitbucket.cloud.client.BitbucketCloudClient.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.model.BitbucketCloudProject
import net.nemerosa.ontrack.extension.bitbucket.cloud.model.BitbucketCloudRepository
import java.time.LocalDateTime
/**
* Interface which defines how we talk to Bitbucket Cloud.
*/
interface BitbucketCloudClient {
/**
* Associated workspace slug
*/
val workspace: String
/**
* Gets the list of projects for this client
*
* @return List of projects
*/
val projects: List
/**
* Gets all repositories for this client
*/
val repositories: List
/**
* Given a [repository], returns its last modification date (if any).
*
* @param repository Repository to get the date from
* @return The last update date or `null` if not available
*/
fun getRepositoryLastModified(repository: BitbucketCloudRepository): LocalDateTime?
/**
* Given a [repository], returns its creation date (if any).
*
* @param repository Repository to get the date from
* @return The creation date or `null` if not available
*/
fun getRepositoryCreationDate(repository: BitbucketCloudRepository): LocalDateTime?
/**
* Gets the repository information.
*
* @param repository Repository slug
* @return Repository information
*/
fun getRepository(repository: String): BitbucketCloudRepository
}