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

com.paysera.lib.inrento.clients.InRentoApiClient.kt Maven / Gradle / Ivy

There is a newer version: 1.0.18
Show newest version
package com.paysera.lib.inrento.clients

import com.paysera.lib.common.retrofit.ApiRequestManager
import com.paysera.lib.common.retrofit.BaseApiClient
import com.paysera.lib.inrento.entities.account.PSAccount
import com.paysera.lib.inrento.entities.portfolio.PSPortfolio
import com.paysera.lib.inrento.entities.project.PSInvestmentEarns
import com.paysera.lib.inrento.entities.project.PSProjectInfo
import com.paysera.lib.inrento.entities.project.PSProjectStatus
import com.paysera.lib.inrento.entities.project.PSProjects
import com.paysera.lib.inrento.entities.questionnaire.QuestionnaireAnswersRequest
import com.paysera.lib.inrento.entities.requests.PSInvestRequest
import com.paysera.lib.inrento.entities.transaction.PSTransactions
import com.paysera.lib.inrento.retrofit.NetworkApiClient
import kotlinx.coroutines.Deferred
import retrofit2.Response

class InRentoApiClient(
    private val networkApiClient: NetworkApiClient,
    apiRequestManager: ApiRequestManager
) : BaseApiClient(apiRequestManager) {

    fun getAccount(): Deferred {
        return networkApiClient.getAccount()
    }

    fun getPortfolio(
        page: Int,
        limit: Int
    ): Deferred {
        return networkApiClient.getPortfolio(
            page = page,
            limit = limit
        )
    }

    fun getTransactions(
        page: Int,
        limit: Int
    ): Deferred {
        return networkApiClient.getTransactions(
            page = page,
            limit = limit
        )
    }

    fun getProjects(
        page: Int,
        limit: Int
    ): Deferred {
        return networkApiClient.getProjects(
            page = page,
            limit = limit
        )
    }

    fun getProject(id: Int): Deferred {
        return networkApiClient.getProject(id)
    }

    fun getProjectStatus(id: Int): Deferred {
        return networkApiClient.getProjectStatus(id)
    }

    fun invest(investRequest: PSInvestRequest): Deferred> {
        return networkApiClient.invest(investRequest)
    }

    fun confirmRiskAgreement(): Deferred> {
        return networkApiClient.confirmRiskAgreement()
    }

    fun saveQuestionnaire(questionnaireAnswersRequest: QuestionnaireAnswersRequest): Deferred> {
        return networkApiClient.saveQuestionnaire(questionnaireAnswersRequest)
    }

    fun getInvestmentEarns(projectId: Int, amount: Double): Deferred {
        return networkApiClient.getInvestmentEarns(projectId, amount)
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy