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 @@ -78,4 +78,11 @@ public InvoiceQuery setCompany( Integer company )
put( COMPANY, company );
return this;
}

public InvoiceQuery setMetadata( MetadataQuery metadata )
{
putAll( metadata );
return this;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.cloudesire.platform.apiclient.query;

import java.util.Map;

public class MetadataQuery extends BaseQuery
{
private static final String METADATA = "metadata";

public MetadataQuery setMetadata( Map<String, Object> metadata )
{
metadata.forEach( ( key, value ) -> {
if ( value == null ) value = "";
put( String.format( "%s[%s]", METADATA, key ), value );
} );
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,11 @@ public OrderQuery setTo( Date to )
put( TO, SimpleDateFormatFactory.dateFormat().format( to ) );
return this;
}

public OrderQuery setMetadata( MetadataQuery metadata )
{
putAll( metadata );
return this;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,29 @@
import com.cloudesire.platform.apiclient.dto.model.enums.ProductType;
import org.apache.commons.lang3.StringUtils;

import java.util.Map;

public class SubscriptionQuery extends PageRequestQuery
{
private static final String FILTER = "filter";
private static final String METADATA = "metadata";
private static final String STATUS = "status";
private static final String TYPE = "type";
private static final String PRODUCT = "product";
private static final String PRODUCT_TYPE = "productType";


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

public SubscriptionQuery setFilter( String value )
public SubscriptionQuery setMetadata( MetadataQuery metadata )
{
put( FILTER, value );
putAll( metadata );
return this;
}

public SubscriptionQuery setMetadata( Map<String, Object> metadata )
public SubscriptionQuery setFilter( String value )
{
metadata.forEach( ( key, value ) -> {
if ( value == null ) value = "";
put( String.format( "%s[%s]", METADATA, key ), value );
} );
put( FILTER, value );
return this;
}

Expand Down