Neutron Requester

class NeutronRequester(host: String, userId: String? = null, userToken: String? = null, debugMode: Boolean = false) : EquinoxRequester

The `NeutronRequester** class is useful to communicate with the Neutron's backend

Author

N7ghtm4r3 - Tecknobit

Parameters

host

The host where is running the Neutron's backend

userId

The user identifier

userToken

The user token

debugMode

Whether the requester is still in development and who is developing needs the log of the requester's workflow, if it is enabled all the details of the requests sent and the errors occurred will be printed in the console

See also

Requester

Constructors

Link copied to clipboard
constructor(host: String, userId: String? = null, userToken: String? = null, debugMode: Boolean = false)

Functions

Link copied to clipboard
fun attachInterceptorOnRequest(interceptor: () -> Unit)
Link copied to clipboard
suspend fun changeCurrency(newCurrency: NeutronCurrency): JsonObject

Method to request to change the currency of the user

Link copied to clipboard
open suspend fun changeEmail(newEmail: String): JsonObject
Link copied to clipboard
open override fun changeHost(host: String)
Link copied to clipboard
open suspend fun changeLanguage(newLanguage: String): JsonObject
Link copied to clipboard
open suspend fun changePassword(newPassword: String): JsonObject
Link copied to clipboard
open suspend fun changeProfilePic(profilePicName: String, profilePicBytes: ByteArray): JsonObject
Link copied to clipboard
open fun clearSession()
Link copied to clipboard
suspend fun closeTicket(projectId: String, ticket: TicketRevenue): JsonObject

Method to request to close a ticket

Link copied to clipboard
open suspend fun deleteAccount(): JsonObject
Link copied to clipboard
suspend fun deleteRevenue(revenue: Revenue): JsonObject

Method to request to delete a revenue

Link copied to clipboard
suspend fun deleteTicket(projectId: String, ticket: TicketRevenue): JsonObject

Method to request to delete a ticket

Link copied to clipboard
suspend fun getDynamicAccountData(): JsonObject
Link copied to clipboard
suspend fun getProjectBalance(projectId: String, period: RevenuePeriod, retrieveClosedTickets: Boolean): JsonObject

Method to request the current balance of a project revenue

Link copied to clipboard
suspend fun getProjectRevenue(projectId: String): JsonObject

Method to request a project revenue

Link copied to clipboard
suspend fun getRevenue(revenueId: String): JsonObject

Method to request a revenue by the revenueId specified

Link copied to clipboard
suspend fun getRevenues(page: Int, period: RevenuePeriod, labels: List<RevenueLabel>, retrieveGeneralRevenues: Boolean, retrieveProjectsRevenues: Boolean): JsonObject

Method to request the current revenues owned by the user

Link copied to clipboard
suspend fun getRevenuesLabels(): JsonObject

Method to request the current labels created by the user

Link copied to clipboard
suspend fun getTickets(projectId: String, page: Int, period: RevenuePeriod, retrievePendingTickets: Boolean, retrieveClosedTickets: Boolean): JsonObject

Method to request the tickets attached to the projectId

Link copied to clipboard
suspend fun getWalletStatus(period: RevenuePeriod, labels: List<RevenueLabel>, retrieveGeneralRevenues: Boolean, retrieveProjectsRevenues: Boolean): JsonObject

Method to request the current wallet status of the user

Link copied to clipboard
suspend fun insertRevenue(addingGeneralRevenue: Boolean, revenue: Revenue? = null, title: String, description: String, value: Double, revenueDate: LocalDateTime, labels: List<RevenueLabel> = emptyList()): JsonObject

Method to request the revenue insertion, this includes both the add or editing actions

Link copied to clipboard
suspend fun insertTicket(projectId: String, ticketId: String?, title: String, value: Double, description: String, openingDate: LocalDateTime): JsonObject

Method to request to insert a tickets, this includes both edit and addition of a ticket item

Link copied to clipboard
fun setUserCredentials(userId: String?, userToken: String?)
Link copied to clipboard
open suspend fun signIn(email: String, password: String, language: String, vararg custom: Any?): JsonObject
Link copied to clipboard
suspend fun signUp(serverSecret: String, name: String, surname: String, email: String, password: String, language: String, vararg custom: Any?): JsonObject