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 @@

public final class ApiVersion
{
public static final long V20211004 = 20211004;
public static final long V20210406 = 20210406;
public static final long V20210215 = 20210215;
public static final long V20210125 = 20210125;
Expand Down Expand Up @@ -33,7 +34,7 @@ public final class ApiVersion
public static final long V20180101 = 20180101;
public static final long NO_VERSION = 0;

public static final Long LATEST_API_VERSION = V20210406;
public static final Long LATEST_API_VERSION = V20211004;

private ApiVersion()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package com.cloudesire.platform.apiclient.dto.model.dto;

import com.cloudesire.platform.apiclient.dto.ApiVersion;
import com.cloudesire.platform.apiclient.dto.annotations.FieldAPI;
import com.cloudesire.platform.apiclient.dto.annotations.UnsupportedAPI;
import com.cloudesire.platform.apiclient.dto.model.constants.ErrorKeys;
import com.cloudesire.platform.apiclient.dto.model.enums.BillingItemPresence;
import com.cloudesire.platform.apiclient.dto.model.enums.BillingItemType;
import com.cloudesire.platform.apiclient.dto.model.enums.BillingItemValueType;
import com.fasterxml.jackson.annotation.JsonIgnore;
Expand Down Expand Up @@ -48,8 +52,12 @@ public class BillingItemDTO extends NamedEntityDTO
@ApiModelProperty( "Percentage of revenues for the platform owner" )
private BigDecimal cloudesireQuota;

@ApiModelProperty( "Whether the billing item will be included in every subscription" )
private boolean required;
@FieldAPI( sinceVersion = ApiVersion.V20211004 )
private BillingItemPresence presence = BillingItemPresence.OPTIONAL;

@ApiModelProperty( value = "Whether the billing item will be included in every subscription", hidden = true )
@UnsupportedAPI( sinceVersion = ApiVersion.V20211004 )
private Boolean required;

@ApiModelProperty( "Whether the billing item can be downgraded" )
private boolean downgradable = true;
Expand Down Expand Up @@ -168,12 +176,31 @@ public BillingItemDTO setCloudesireQuota( BigDecimal cloudesireQuota )
return this;
}

public boolean isRequired()
public BillingItemPresence getPresence()
{
return presence;
}

public BillingItemDTO setPresence( BillingItemPresence presence )
{
this.presence = presence;
return this;
}

/**
* @deprecated by {@link #getPresence()}
*/
@Deprecated
public Boolean isRequired()
{
return required;
}

public BillingItemDTO setRequired( boolean required )
/**
* @deprecated by {@link #setPresence(BillingItemPresence)}
*/
@Deprecated
public BillingItemDTO setRequired( Boolean required )
{
this.required = required;
return this;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.cloudesire.platform.apiclient.dto.model.enums;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@ApiModel( "Configuration for the presence of the Billing Item when buying a Subscription" )
public enum BillingItemPresence
{
@ApiModelProperty( "The Billing Item is optional" )
OPTIONAL,

@ApiModelProperty( "The Billing Item will be included in every Subscription" )
REQUIRED,

@ApiModelProperty( "The Billing Item will be suggested for inclusion on purchase" )
RECOMMENDED
}