Skip to content

Commit

Permalink
Signal config endpoints added
Browse files Browse the repository at this point in the history
  • Loading branch information
barbayrak committed Nov 4, 2021
1 parent fce1272 commit 567824d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@ import cryptohopper.android.sdk.SharedModels.ConfigModels.HopperAPIHttpMethod

class HopperAPIUpdateSignalConfigRequest: HopperAPIRequest<HopperCommonMessageResponse> {

constructor(hopperId : String,signalId : Int) {
constructor(hopperId : String,signalId : Int,config : Map<String,Any>) {
this.httpMethod = HopperAPIHttpMethod.PATCH
this.needsAuthentication = true
this.changeUrlPath("/hopper/$hopperId/signal/$signalId")
var arr = mutableMapOf<String,Any>()
for ((k, v) in config) {
arr[k] = v
}
addBodyItem("config",arr)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -984,8 +984,8 @@ class CryptohopperHopper {
/// Update Signal Config
///
/// - Parameter hopperId: (required) Hopper Id
fun updateSignalConfig(hopperId : String,signalId : Int,callback: (String?, HopperAPIError?) -> Unit) {
HopperAPIUpdateSignalConfigRequest( hopperId, signalId).request<HopperCommonMessageResponse>({ data ->
fun updateSignalConfig(hopperId : String,signalId : Int,config : Map<String,Any>,callback: (String?, HopperAPIError?) -> Unit) {
HopperAPIUpdateSignalConfigRequest( hopperId, signalId,config).request<HopperCommonMessageResponse>({ data ->
callback(data.data,null)
},{error ->
callback(null,error)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ data class MarketSignal (
@SerializedName("is_refundable") val isRefundable: Int?,
@SerializedName("price_id") val priceId: String?,
@SerializedName("total_subs") val totalSubs: String?,
@SerializedName("total_reviews") val totalReviews: String?
@SerializedName("total_reviews") val totalReviews: String?,
@SerializedName("config") val config: Map<String,String>?
)

data class MarketSignalReviewData (
Expand Down

0 comments on commit 567824d

Please sign in to comment.