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.ApiVersion;
import com.cloudesire.platform.apiclient.dto.annotations.UnsupportedAPI;
import com.cloudesire.platform.apiclient.dto.model.enums.ResellerPricingVisibility;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

Expand Down Expand Up @@ -65,6 +66,8 @@ public class ResellerPricingDTO extends BaseEntityDTO
@Valid
private List<CustomResellingPriceDTO> customResellingPrices;

private ResellerPricingVisibility visibility;

public ResellerPricingDTO( UrlEntityDTO resellerCatalog, UrlEntityDTO distributorPricing )
{
this.resellerCatalog = resellerCatalog;
Expand Down Expand Up @@ -222,6 +225,16 @@ public void setCustomResellingPrices( List<CustomResellingPriceDTO> customResell
this.customResellingPrices = customResellingPrices;
}

public ResellerPricingVisibility getVisibility()
{
return visibility;
}

public void setVisibility( ResellerPricingVisibility visibility )
{
this.visibility = visibility;
}

@Override
public boolean equals( Object o )
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.cloudesire.platform.apiclient.dto.model.enums;

import io.swagger.annotations.ApiModelProperty;

public enum ResellerPricingVisibility
{
@ApiModelProperty( "Product Version is not visible to customer" )
EXCLUDED,

@ApiModelProperty( "Product Version is visible to customer, but not available for buy" )
INCLUDED,

@ApiModelProperty( "Product Version is available for buy" )
PRICED
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.cloudesire.platform.apiclient.dto.model.dto.ProductVersionDTO;
import com.cloudesire.platform.apiclient.dto.model.dto.ProductVersionDraftDTO;
import com.cloudesire.platform.apiclient.query.ProductVersionQuery;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
Expand Down Expand Up @@ -36,24 +37,47 @@ public interface ProductVersionApi
Call<Void> partialUpdate( @Path( "id" ) int id, @Body Map<String, Object> input,
@Query( "language" ) String language );

@GET( "productVersion" )
Call<List<ProductVersionDTO>> getAll( @QueryMap ProductVersionQuery query );

/**
* @deprecated by {@link #getAll(ProductVersionQuery)}
*/
@Deprecated
@GET( "productVersion" )
Call<List<ProductVersionDTO>> getAll( @Query( "product" ) Integer product );

/**
* @deprecated by {@link #getAll(ProductVersionQuery)}
*/
@Deprecated
@GET( "productVersion" )
Call<List<ProductVersionDTO>> getAll( @Query( "product" ) Integer product,
@QueryMap Map<String, String> pageRequest );

/**
* @deprecated by {@link #getAll(ProductVersionQuery)}
*/
@Deprecated
@GET( "productVersion" )
Call<List<ProductVersionDTO>> getAll(
@Query( "product" ) Integer product,
@Query( "withUnpublished" ) boolean includeUnpublished,
@QueryMap Map<String, String> pageRequest
);

/**
* @deprecated by {@link #getAll(ProductVersionQuery)}
*/
@Deprecated
@GET( "productVersion" )
Call<List<ProductVersionDTO>> getAll( @Query( "product" ) Integer product, @Query( "reseller" ) String reseller,
@QueryMap Map<String, String> pageRequest );

/**
* @deprecated by {@link #getAll(ProductVersionQuery)}
*/
@Deprecated
@GET( "productVersion" )
Call<List<ProductVersionDTO>> getAll(
@Query( "product" ) int product,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import com.cloudesire.platform.apiclient.dto.model.enums.OrderingType;
import com.cloudesire.platform.apiclient.dto.model.enums.ProductType;
import com.cloudesire.platform.apiclient.dto.model.enums.ResellerPricingVisibility;
import org.apache.commons.lang3.StringUtils;

public class ProductQuery extends PageRequestQuery
{
Expand All @@ -16,6 +18,7 @@ public class ProductQuery extends PageRequestQuery
private static final String ORDERING_TYPE = "orderingType";
private static final String CATEGORY_ID = "categoryId";
private static final String TAG = "tag";
private static final String VISIBILITY = "visibility";

public ProductQuery setPageRequest( PageRequestQuery pageRequestQuery )
{
Expand Down Expand Up @@ -98,4 +101,10 @@ public ProductQuery setOnlyActiveConfigurations( boolean flag )
put( ONLY_ACTIVE_CONFIGURATIONS, flag );
return this;
}

public ProductQuery setVisibility( ResellerPricingVisibility... visibility )
{
put( VISIBILITY, StringUtils.join( visibility, ',' ) );
return this;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.cloudesire.platform.apiclient.query;

import com.cloudesire.platform.apiclient.dto.model.enums.ResellerPricingVisibility;
import org.apache.commons.lang3.StringUtils;

public class ProductVersionQuery extends BaseQuery
{
private static final String PRODUCT = "product";
private static final String VISIBILITY = "visibility";
private static final String WITH_UNPUBLISHED = "withUnpublished";

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

public ProductVersionQuery setResellerCatalog( ResellerCatalogQuery resellerCatalogQuery )
{
putAll( resellerCatalogQuery );
return this;
}

public ProductVersionQuery setProduct( int productId )
{
put( PRODUCT, productId );
return this;
}

public ProductVersionQuery includeUnpublished( boolean includeUnpublished )
{
put( WITH_UNPUBLISHED, includeUnpublished );
return this;
}

public ProductVersionQuery setVisibility( ResellerPricingVisibility... visibility )
{
put( VISIBILITY, StringUtils.join( visibility, ',' ) );
return this;
}
}