
com.tink.rest.apis.BudgetApi.kt Maven / Gradle / Ivy
/**
* NOTE: This class is auto generated by the Swagger Gradle Codegen for the following API: Tink API
*
* More info on this tool is available on https://github.com/Yelp/swagger-gradle-codegen
*/
package com.tink.rest.apis
import com.tink.rest.models.ArchiveBudgetResponse
import com.tink.rest.models.BudgetDetailsResponse
import com.tink.rest.models.BudgetTransactionsResponse
import com.tink.rest.models.CreateBudgetResponse
import com.tink.rest.models.CreateOneOffBudgetRequest
import com.tink.rest.models.CreateRecurringBudgetRequest
import com.tink.rest.models.ListBudgetSpecificationsResponse
import com.tink.rest.models.ListBudgetSummariesResponse
import com.tink.rest.models.UpdateBudgetRequest
import com.tink.rest.models.UpdateBudgetResponse
import retrofit2.Response
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.PUT
@JvmSuppressWildcards
interface BudgetApi {
/**
* Archive budget
* Archives the specified budget.Returns `404 Not Found` if the budget does not exist. Returns `400 Bad Request` if any of the request parameters is incorrect or missing. Returns `500 Internal Server Error` for any unspecified error.
* @param id The ID of the budget. (required)
*/
@PUT("/api/v1/budgets/{id}/archive")
suspend fun archive(
@retrofit2.http.Path("id") id: String
): ArchiveBudgetResponse
/**
* Create one-off budget
* Creates a budget for a specific date interval. Returns `400 Bad Request` if any of the request parameters is incorrect or missing. Returns `500 Internal Server Error` for any unspecified error.
* @param body The one off budget to be created. (required)
*/
@POST("/api/v1/budgets/one-off")
suspend fun createOneOff(
@retrofit2.http.Body body: CreateOneOffBudgetRequest
): CreateBudgetResponse
/**
* Create recurring budget
* Creates a recurring budget with a set periodicity.Returns `400 Bad Request` if any of the request parameters is incorrect or missing. Returns `500 Internal Server Error` for any unspecified error.
* @param body The recurring budget to be created. (required)
*/
@POST("/api/v1/budgets/recurring")
suspend fun createRecurring(
@retrofit2.http.Body body: CreateRecurringBudgetRequest
): CreateBudgetResponse
/**
* Delete budget
* Deletes the specified budget. Returns `404 Not Found` if the budget does not exist. Returns `400 Bad Request` if any of the request parameters is incorrect or missing. Returns `500 Internal Server Error` for any unspecified error.
* @param id The ID of the budget. (required)
*/
@DELETE("/api/v1/budgets/{id}")
suspend fun delete(
@retrofit2.http.Path("id") id: String
): Response
/**
* Get budget details
* Get the specified budget and its periods within the start and end dates. The date parameters are inclusive, thus specifying a date in the middle of a period will include the complete period amounts. Returns `404 Not Found` if the budget does not exist. Returns `400 Bad Request` if any of the request parameters is incorrect or missing. Returns `500 Internal Server Error` for any unspecified error.
* @param id The ID of the budget. (required)
* @param start Date within the first period expressed as UTC epoch timestamp in milliseconds. (optional)
* @param end Date within the last period expressed as UTC epoch timestamp in milliseconds. (optional)
*/
@GET("/api/v1/budgets/{id}/details")
suspend fun getDetails(
@retrofit2.http.Path("id") id: String,
@retrofit2.http.Query("start") start: Long?,
@retrofit2.http.Query("end") end: Long?
): BudgetDetailsResponse
/**
* Get budget transactions
* List all transactions for the specified budget within the start and end date. The date parameters are inclusive. Returns `404 Not Found` if the budget does not exist. Returns `400 Bad Request` if any of the request parameters is incorrect or missing. Returns `500 Internal Server Error` for any unspecified error.
* @param id The ID of the budget. (required)
* @param start Query start date expressed as UTC epoch timestamp in milliseconds. (required)
* @param end Query end date expressed as UTC epoch timestamp in milliseconds. (required)
*/
@GET("/api/v1/budgets/{id}/transactions")
suspend fun getTransactions(
@retrofit2.http.Path("id") id: String,
@retrofit2.http.Query("start") start: Long,
@retrofit2.http.Query("end") end: Long
): BudgetTransactionsResponse
/**
* List budgets
* List all budgets for the user. Returns `500 Internal Server Error` for any unspecified error.
* @param includeArchived Whether to include archived budgets or not in the response. (optional, default to false)
*/
@GET("/api/v1/budgets")
suspend fun listSpecifications(
@retrofit2.http.Query("includeArchived") includeArchived: Boolean?
): ListBudgetSpecificationsResponse
/**
* List budgets with summaries
* List all budgets for the user including current period for each budget. Returns `500 Internal Server Error` for any unspecified error.
* @param includeArchived Whether to include archived budgets or not in the response. (optional, default to false)
*/
@GET("/api/v1/budgets/summaries")
suspend fun listSummaries(
@retrofit2.http.Query("includeArchived") includeArchived: Boolean?
): ListBudgetSummariesResponse
/**
* Update budget
* Updates the specified budget. Returns `404 Not Found` if the budget does not exist. Returns `400 Bad Request` if any of the request parameters is incorrect or missing. Returns `500 Internal Server Error` for any unspecified error.
* @param id The ID of the budget. (required)
* @param body The modified budget to be applied. (required)
*/
@PUT("/api/v1/budgets/{id}")
suspend fun update(
@retrofit2.http.Path("id") id: String,
@retrofit2.http.Body body: UpdateBudgetRequest
): UpdateBudgetResponse
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy