Skip to content

Instantly share code, notes, and snippets.

@RobertApikyan
Created December 23, 2020 10:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RobertApikyan/732c092fc0d11aa644ba93a52490628e to your computer and use it in GitHub Desktop.
Save RobertApikyan/732c092fc0d11aa644ba93a52490628e to your computer and use it in GitHub Desktop.
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.PagingResponse
import com.cargoo.android.models.shipment.Shipment
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<PagingResponse<Shipment>>
@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,
@Query("pageNumber") pageNumber: Int,
@Query("pageSize") pageSize: Int
): Call<PagingResponse<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