Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.cloudesire.platform.apiclient.dto.model.dto.DistributorPricingDTO;
import com.cloudesire.platform.apiclient.dto.model.dto.PercentagePricingPatchDTO;
import com.cloudesire.platform.apiclient.query.DistributorPricingQuery;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
Expand All @@ -24,9 +25,19 @@ public interface DistributorPricingApi
@GET( "distributorPricing" )
Call<List<DistributorPricingDTO>> getAll();

@GET( "distributorPricing" )
Call<List<DistributorPricingDTO>> getAll( @QueryMap DistributorPricingQuery query );

/**
* @deprecated by {@link #getAll(DistributorPricingQuery)}
*/
@GET( "distributorPricing" )
Call<List<DistributorPricingDTO>> getAll( @QueryMap Map<String, String> pageRequest );

/**
* @deprecated by {@link #getAll(DistributorPricingQuery)}
*/
@Deprecated
@GET( "distributorPricing" )
Call<List<DistributorPricingDTO>> getAll(
@Query( "productId" ) Integer productId,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.cloudesire.platform.apiclient.query;

public class DistributorPricingQuery extends BaseQuery
{
private static final String CATALOG_ID = "catalogId";
private static final String PRODUCT_ID = "productId";
private static final String PRODUCT_VERSION_ID = "productVersionId";
private static final String DEPRECATED = "deprecated";

public DistributorPricingQuery setPageRequest( PageRequestQuery pageRequestQuery )
{
putAll( pageRequestQuery );
return this;
}

public DistributorPricingQuery setCatalogId( Integer id )
{
put( CATALOG_ID, id );
return this;
}

public DistributorPricingQuery setProductId( Integer id )
{
put( PRODUCT_ID, id );
return this;
}

public DistributorPricingQuery setProductVersionId( Integer id )
{
put( PRODUCT_VERSION_ID, id );
return this;
}

public DistributorPricingQuery setDeprecated( Boolean deprecated )
{
put( DEPRECATED, deprecated );
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ public class ResellerPricingQuery extends BaseQuery
private static final String RESELLER_ID = "resellerId";
private static final String CATALOG_ID = "catalogId";
private static final String PRODUCT_ID = "productId";
private static final String PRODUCT_VERSION_ID = "productVersionId";
private static final String UNPRICED = "unpriced";

public ResellerPricingQuery setPageRequest( PageRequestQuery pageRequestQuery )
Expand All @@ -13,27 +14,33 @@ public ResellerPricingQuery setPageRequest( PageRequestQuery pageRequestQuery )
return this;
}

public ResellerPricingQuery setResellerId( Integer name )
public ResellerPricingQuery setResellerId( Integer id )
{
put( RESELLER_ID, name );
put( RESELLER_ID, id );
return this;
}

public ResellerPricingQuery setCatalogId( Integer name )
public ResellerPricingQuery setCatalogId( Integer id )
{
put( CATALOG_ID, name );
put( CATALOG_ID, id );
return this;
}

public ResellerPricingQuery setProductId( Integer name )
public ResellerPricingQuery setProductId( Integer id )
{
put( PRODUCT_ID, name );
put( PRODUCT_ID, id );
return this;
}

public ResellerPricingQuery setUnpriced( Boolean name )
public ResellerPricingQuery setProductVersionId( Integer id )
{
put( UNPRICED, name );
put( PRODUCT_VERSION_ID, id );
return this;
}

public ResellerPricingQuery setUnpriced( Boolean unpriced )
{
put( UNPRICED, unpriced );
return this;
}
}