Created
August 5, 2020 08:46
-
-
Save RobertApikyan/dee736d98f88587091fe6dc18079254a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.cargoo.android.api.apiClient.retrofit.services | |
import com.cargoo.android.models.* | |
import com.cargoo.android.models.chartWidget.ChartWidgetDetails | |
import com.cargoo.android.models.chartWidget.CompanyWidget | |
import com.cargoo.android.models.shipment.ShipmentDetailsResponse | |
import com.cargoo.android.models.shipment.ShipmentResponse | |
import com.cargoo.android.requestBodies.ApprovedCompanyId | |
import com.cargoo.android.requestBodies.CompanySingleAccessBody | |
import com.cargoo.android.requestBodies.EmptySearchBody | |
import com.cargoo.android.requestBodies.RateSearchBody | |
import retrofit2.Call | |
import retrofit2.http.* | |
interface GateWayApiInterface { | |
@POST("Rates/{companyId}/CalculatedSearch") | |
fun getRateSearchResult( | |
@Path("companyId") companyId: Long, | |
@Body rateSearchBody: RateSearchBody | |
): Call<RateSearchResult> | |
@GET("Masterdata/Locations") | |
fun getLocations( | |
@Query("count") count: Int, | |
@Query("skip") skip: Int, | |
@Query("q") text: String | |
): Call<List<Location>> | |
@POST("companies/{companyId}/shipments") | |
fun getShipments( | |
@Path("companyId") companyId: Long, | |
@Query("q") query: String, | |
@Query("pageNumber") pageNumber: Int, | |
@Query("pageSize") pageSize: Int, | |
@Body temp: EmptySearchBody = EmptySearchBody() | |
): Call<ShipmentResponse> | |
@GET("companies/{companyId}/shipments/{shipmentId}") | |
fun getShipmentDetails(@Path("companyId") companyId: Long, @Path("shipmentId") shipmentId: String): Call<ShipmentDetailsResponse> | |
@POST("companies/{companyId}/widgets/{widgetId}") | |
fun getWidgetDetails( | |
@Path("companyId") companyId: Long, | |
@Path("widgetId") widgetId: Int, | |
@Body temp: EmptySearchBody = EmptySearchBody() | |
): Call<ChartWidgetDetails> | |
@GET("users/me") | |
fun getUser(): Call<User> | |
@GET("companies/{companyId}/usercompanywidgets") | |
fun getCompanyWidgets(@Path("companyId") companyId: Long): Call<List<CompanyWidget>> | |
@GET("Users/{userId}/companies/{companyId}/ratesFavorites") | |
fun getFavorites(@Path("userId") userId: Long, @Path("companyId") companyId: Long): Call<List<Favorite>> | |
@GET("Companies/{companyId}/commodities") | |
fun getCommodities(@Path("companyId") companyId: Long): Call<List<Commodity>> | |
@GET("Organizations/{organizationId}/users") | |
fun getUsersAccesses(@Path("organizationId") organizationId: Long): Call<List<UserAccess>> | |
@GET("Organizations/{organizationId}/companies") | |
fun getUserAccessCompanies(@Path("organizationId") organizationId: Long): Call<List<Company>> | |
@GET("AccessRights/user/{userId}/company/{companyId}") | |
fun getUserAccessRightsForCompany(@Path("userId") userId: Long, @Path("companyId") companyId: Long): Call<List<ModuleAccessRight>> | |
@POST("AccessRights/changeAccess") | |
fun changeCompanySingleAccessBody(@Body companySingleAccessBody: CompanySingleAccessBody): Call<Any?> | |
@POST("AccessRights/bulkchange") | |
fun changeCompanyAccessBody(@Body companyAccesses: List<CompanySingleAccessBody>): Call<Any?> | |
@POST("Users/{userId}/reject") | |
fun rejectUserAccess(@Path("userId") userId: Long): Call<Any?> | |
@POST("Users/{userId}/bulkapprove") | |
fun approveUserAccess(@Path("userId") userId: Long, @Body approvedCompanies: List<ApprovedCompanyId>): Call<Any?> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment