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

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

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

import com.cloudesire.platform.apiclient.dto.model.dto.CompanyDTO;
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.PATCH;
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 CompanyApi
{
    @POST( "company" )
    Call create( @Body CompanyDTO company );

    @POST( "company" )
    Call create( @Body CompanyDTO company, @Query( "type" ) CompanyDTO.Type type );

    @DELETE( "company/externalId={extid}" )
    Call deleteByExternalId( @Path( "extid" ) String extid );

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

    @DELETE( "company/{id}" )
    Call deepDelete( @Path( "id" ) int id, @Query( "deep" ) boolean deep );

    @PATCH( "company/externalId={extId}" )
    Call partialUpdate( @Path( "extId" ) String extId, @Body Object input );

    @GET( "company" )
    Call> getAll( @QueryMap Map pageRequest );

    @GET( "company" )
    Call> getAllPaged(
            @QueryMap Map pageRequest,
            @Query( "email" ) String email,
            @Query( "companyName" ) String companyName
    );

    @GET( "company" )
    Call> getAll( @Query( "enabled" ) Boolean enabled, @QueryMap Map pageRequest );

    @GET( "company/externalId={extId}" )
    Call getByExternalId( @Path( "extId" ) String extId, @Query( "language ") String language );

    @GET( "company/typeahead/{query}" )
    Call> getTypeahead( @Path( "query" ) String query );

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

    @GET( "company/{id}" )
    Call get( @Path( "id" ) int id, @Query( "language" ) String language );

    // TODO use a real object
    @PATCH( "company/{id}" )
    Call partialUpdate( @Path( "id" ) int id, @Body Object input );

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

    @PUT( "company/{id}" )
    Call update( @Path( "id" ) int id, @Body CompanyDTO company, @Query( "language" ) String language );

    @Streaming
    @GET( "company" )
    @Headers( { "Accept:text/csv" } )
    Call getCsv(
            @QueryMap Map pageRequest,
            @Query( "email" ) String email,
            @Query( "companyName" ) String companyName
    );

    @Streaming
    @GET( "company" )
    @Headers( { "Accept:text/csv" } )
    Call getCsv( @QueryMap Map pageRequest );
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy