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

com.cloudesire.platform.apiclient.api.CartApi Maven / Gradle / Ivy

The newest version!
package com.cloudesire.platform.apiclient.api;

import com.cloudesire.platform.apiclient.dto.model.dto.CartDTO;
import com.cloudesire.platform.apiclient.query.CartQuery;
import com.cloudesire.platform.apiclient.query.ResellerCatalogQuery;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;
import retrofit2.http.Streaming;

import java.util.List;
import java.util.Map;

public interface CartApi
{
    @POST( "cart" )
    Call create( @Body CartDTO cart );

    @POST( "cart" )
    Call create( @Body CartDTO cart, @QueryMap ResellerCatalogQuery query );

    @GET( "cart" )
    Call> getAll();

    @GET( "cart" )
    Call> getAll( @QueryMap CartQuery query );

    /**
     * @deprecated by {@link #getAll(CartQuery)}
     */
    @Deprecated
    @GET( "cart" )
    Call> getAll( @Query( "customerId" ) int customerId );

    @GET( "cart/{id}" )
    Call get( @Path( "id" ) int id );

    @GET( "cart/{id}" )
    @Headers( { "Accept:text/csv" } )
    @Streaming
    Call getCsv( @Path( "id" ) int id );

    @PUT( "cart/{id}" )
    Call update( @Path( "id" ) int id, @Body CartDTO cart );

    @POST( "cart/{id}/checkout" )
    Call checkout( @Path( "id" ) int id );

    @POST( "cart/{id}/copy" )
    Call copy( @Path( "id" ) int id );

    @DELETE( "cart/{id}" )
    Call delete( @Path( "id" ) int id );

    @GET( "cart/{id}/metadata" )
    Call> getMetadata( @Path( "id" ) int id );

    @PUT( "cart/{id}/metadata" )
    Call updateMetadata( @Path( "id" ) int id, @Body Map payload );

    @DELETE( "cart/{id}/metadata/{key}" )
    Call deleteMetadata( @Path( "id" ) int id, @Path( "key" ) String key );
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy