Requires the role: | superadmin |
POST | /superadmin/incentives/action | Add a new incentive action |
---|
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
public class dtos
{
@ValidateRequest(Validator="IsAuthenticated")
@ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
public static class CreateIncentiveAction
{
public Integer Id = null;
public IncentiveActionType ActionType = null;
public String Description = null;
public String Page = null;
public String Segment = null;
public String Element = null;
public Integer LicenseTypeId = null;
public Integer getId() { return Id; }
public CreateIncentiveAction setId(Integer value) { this.Id = value; return this; }
public IncentiveActionType getActionType() { return ActionType; }
public CreateIncentiveAction setActionType(IncentiveActionType value) { this.ActionType = value; return this; }
public String getDescription() { return Description; }
public CreateIncentiveAction setDescription(String value) { this.Description = value; return this; }
public String getPage() { return Page; }
public CreateIncentiveAction setPage(String value) { this.Page = value; return this; }
public String getSegment() { return Segment; }
public CreateIncentiveAction setSegment(String value) { this.Segment = value; return this; }
public String getElement() { return Element; }
public CreateIncentiveAction setElement(String value) { this.Element = value; return this; }
public Integer getLicenseTypeId() { return LicenseTypeId; }
public CreateIncentiveAction setLicenseTypeId(Integer value) { this.LicenseTypeId = value; return this; }
}
public static enum IncentiveActionType
{
Upgrade(1),
AddOn(2),
Information(3);
private final int value;
IncentiveActionType(final int intValue) { value = intValue; }
public int getValue() { return value; }
}
public static class IncentiveActionResponse
{
public Integer Id = null;
public String Description = null;
public IncentiveActionType ActionType = null;
public String Page = null;
public String Segment = null;
public String Element = null;
public Integer LicenseTypeId = null;
public LicenseTypeQueryResponse SuggestedLicenseToUpgrade = null;
public Integer getId() { return Id; }
public IncentiveActionResponse setId(Integer value) { this.Id = value; return this; }
public String getDescription() { return Description; }
public IncentiveActionResponse setDescription(String value) { this.Description = value; return this; }
public IncentiveActionType getActionType() { return ActionType; }
public IncentiveActionResponse setActionType(IncentiveActionType value) { this.ActionType = value; return this; }
public String getPage() { return Page; }
public IncentiveActionResponse setPage(String value) { this.Page = value; return this; }
public String getSegment() { return Segment; }
public IncentiveActionResponse setSegment(String value) { this.Segment = value; return this; }
public String getElement() { return Element; }
public IncentiveActionResponse setElement(String value) { this.Element = value; return this; }
public Integer getLicenseTypeId() { return LicenseTypeId; }
public IncentiveActionResponse setLicenseTypeId(Integer value) { this.LicenseTypeId = value; return this; }
public LicenseTypeQueryResponse getSuggestedLicenseToUpgrade() { return SuggestedLicenseToUpgrade; }
public IncentiveActionResponse setSuggestedLicenseToUpgrade(LicenseTypeQueryResponse value) { this.SuggestedLicenseToUpgrade = value; return this; }
}
public static class LicenseTypeQueryResponse
{
/**
* The license type id
*/
@ApiMember(Description="The license type id")
public Integer Id = null;
/**
* The license type name
*/
@ApiMember(Description="The license type name")
public String Name = null;
/**
* The license type description
*/
@ApiMember(Description="The license type description")
public String Description = null;
/**
* If the license type is not a standard license but instead an extra license option. An example would be sending new letter license.
*/
@ApiMember(Description="If the license type is not a standard license but instead an extra license option. An example would be sending new letter license.")
public Boolean IsExtraLicenseOption = null;
/**
* The period of notice for the license in days.
*/
@ApiMember(Description="The period of notice for the license in days.")
public Integer PeriodOfNoticeDays = null;
/**
* The license items for the license type
*/
@ApiMember(Description="The license items for the license type")
public ArrayList<LicenseItemsResponse> Items = null;
/**
* The license prices in each country for the license type
*/
@ApiMember(Description="The license prices in each country for the license type")
public ArrayList<LicensePrice> Prices = null;
public Integer getId() { return Id; }
public LicenseTypeQueryResponse setId(Integer value) { this.Id = value; return this; }
public String getName() { return Name; }
public LicenseTypeQueryResponse setName(String value) { this.Name = value; return this; }
public String getDescription() { return Description; }
public LicenseTypeQueryResponse setDescription(String value) { this.Description = value; return this; }
public Boolean getIsExtraLicenseOption() { return IsExtraLicenseOption; }
public LicenseTypeQueryResponse setIsExtraLicenseOption(Boolean value) { this.IsExtraLicenseOption = value; return this; }
public Integer getPeriodOfNoticeDays() { return PeriodOfNoticeDays; }
public LicenseTypeQueryResponse setPeriodOfNoticeDays(Integer value) { this.PeriodOfNoticeDays = value; return this; }
public ArrayList<LicenseItemsResponse> getItems() { return Items; }
public LicenseTypeQueryResponse setItems(ArrayList<LicenseItemsResponse> value) { this.Items = value; return this; }
public ArrayList<LicensePrice> getPrices() { return Prices; }
public LicenseTypeQueryResponse setPrices(ArrayList<LicensePrice> value) { this.Prices = value; return this; }
}
public static class LicenseItemsResponse
{
public Integer Id = null;
public String Name = null;
public Integer AllowedItems = null;
public Integer getId() { return Id; }
public LicenseItemsResponse setId(Integer value) { this.Id = value; return this; }
public String getName() { return Name; }
public LicenseItemsResponse setName(String value) { this.Name = value; return this; }
public Integer getAllowedItems() { return AllowedItems; }
public LicenseItemsResponse setAllowedItems(Integer value) { this.AllowedItems = value; return this; }
}
public static class LicensePrice extends BaseModel
{
@Ignore()
public Country Country = null;
@Ignore()
public Boolean MonthlyPayment = null;
@Required()
public Integer LicenseTypeId = null;
@Required()
public String CountryId = null;
@Required()
public Integer Price = null;
public Date ModifiedDate = null;
public Country getCountry() { return Country; }
public LicensePrice setCountry(Country value) { this.Country = value; return this; }
public Boolean isMonthlyPayment() { return MonthlyPayment; }
public LicensePrice setMonthlyPayment(Boolean value) { this.MonthlyPayment = value; return this; }
public Integer getLicenseTypeId() { return LicenseTypeId; }
public LicensePrice setLicenseTypeId(Integer value) { this.LicenseTypeId = value; return this; }
public String getCountryId() { return CountryId; }
public LicensePrice setCountryId(String value) { this.CountryId = value; return this; }
public Integer getPrice() { return Price; }
public LicensePrice setPrice(Integer value) { this.Price = value; return this; }
public Date getModifiedDate() { return ModifiedDate; }
public LicensePrice setModifiedDate(Date value) { this.ModifiedDate = value; return this; }
}
public static class BaseModel
{
}
public static class Country extends BaseModel
{
@References(Currency.class)
public String CurrencyId = null;
public Currency CurrencyInfo = null;
@Required()
public String Name = null;
public String Culture = null;
public String TimeZone = null;
public Date ModifiedDate = null;
@Required()
public String Id = null;
public String getCurrencyId() { return CurrencyId; }
public Country setCurrencyId(String value) { this.CurrencyId = value; return this; }
public Currency getCurrencyInfo() { return CurrencyInfo; }
public Country setCurrencyInfo(Currency value) { this.CurrencyInfo = value; return this; }
public String getName() { return Name; }
public Country setName(String value) { this.Name = value; return this; }
public String getCulture() { return Culture; }
public Country setCulture(String value) { this.Culture = value; return this; }
public String getTimeZone() { return TimeZone; }
public Country setTimeZone(String value) { this.TimeZone = value; return this; }
public Date getModifiedDate() { return ModifiedDate; }
public Country setModifiedDate(Date value) { this.ModifiedDate = value; return this; }
public String getId() { return Id; }
public Country setId(String value) { this.Id = value; return this; }
}
public static class Currency extends BaseModel
{
@Required()
public String Name = null;
@Required()
public String CurrencySign = null;
@Required()
public Boolean Active = null;
public Date ModifiedDate = null;
@Required()
public String Id = null;
public String getName() { return Name; }
public Currency setName(String value) { this.Name = value; return this; }
public String getCurrencySign() { return CurrencySign; }
public Currency setCurrencySign(String value) { this.CurrencySign = value; return this; }
public Boolean isActive() { return Active; }
public Currency setActive(Boolean value) { this.Active = value; return this; }
public Date getModifiedDate() { return ModifiedDate; }
public Currency setModifiedDate(Date value) { this.ModifiedDate = value; return this; }
public String getId() { return Id; }
public Currency setId(String value) { this.Id = value; return this; }
}
}
Java CreateIncentiveAction DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /superadmin/incentives/action HTTP/1.1
Host: api.bookmore.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"Id":0,"ActionType":"Upgrade","Description":"String","Page":"String","Segment":"String","Element":"String","LicenseTypeId":0}
HTTP/1.1 200 OK Content-Type: application/json Content-Length: length {"Id":0,"Description":"String","ActionType":"Upgrade","Page":"String","Segment":"String","Element":"String","LicenseTypeId":0,"SuggestedLicenseToUpgrade":{"Id":0,"Name":"String","Description":"String","IsExtraLicenseOption":false,"PeriodOfNoticeDays":0,"Items":[{"Id":0,"Name":"String","AllowedItems":0}],"Prices":[{"Country":{"CurrencyId":"String","CurrencyInfo":{"Name":"String","CurrencySign":"String","Active":false,"ModifiedDate":"0001-01-01T00:00:00.0000000+00:00","Id":"String"},"Name":"String","Culture":"String","TimeZone":"String","ModifiedDate":"0001-01-01T00:00:00.0000000+00:00","Id":"String"},"MonthlyPayment":true,"LicenseTypeId":0,"CountryId":"String","Price":0,"ModifiedDate":"0001-01-01T00:00:00.0000000+00:00"}]}}