BokaMera.API.Host

<back to all web services

CompanyIncentiveQuery

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, bookingsupplier-administrator-read, superadmin
The following routes are available for this service:
GET/companies/{CompanyId}/incentivesIt gets either incentives which are not read or engaged by the current company/administrator.
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 CompanyIncentiveQuery implements ICompany
    {
        /**
        * The company id, if empty will use the company id for the user you are logged in with.
        */
        @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.", IsRequired=true, ParameterType="path")
        public UUID CompanyId = null;
        
        public UUID getCompanyId() { return CompanyId; }
        public CompanyIncentiveQuery setCompanyId(UUID value) { this.CompanyId = value; return this; }
    }

    public static class CompanyIncentivesQueryResponse
    {
        public IList<CompanyIncentiveResponse> Incentives = null;
        public UUID CompanyId = null;
        
        public IList<CompanyIncentiveResponse> getIncentives() { return Incentives; }
        public CompanyIncentivesQueryResponse setIncentives(IList<CompanyIncentiveResponse> value) { this.Incentives = value; return this; }
        public UUID getCompanyId() { return CompanyId; }
        public CompanyIncentivesQueryResponse setCompanyId(UUID value) { this.CompanyId = value; return this; }
    }

    public static class CompanyIncentiveResponse
    {
        public Integer Id = null;
        public String Heading = null;
        public String StorageUrl = null;
        public String SuccessButtonText = null;
        public Integer ActionId = null;
        public Integer InitialDelayInSeconds = null;
        public Integer MaxDisplayCount = null;
        public Date ValidFrom = null;
        public Date ValidTo = null;
        public IncentiveAction Action = null;
        public String Payload = null;
        
        public Integer getId() { return Id; }
        public CompanyIncentiveResponse setId(Integer value) { this.Id = value; return this; }
        public String getHeading() { return Heading; }
        public CompanyIncentiveResponse setHeading(String value) { this.Heading = value; return this; }
        public String getStorageUrl() { return StorageUrl; }
        public CompanyIncentiveResponse setStorageUrl(String value) { this.StorageUrl = value; return this; }
        public String getSuccessButtonText() { return SuccessButtonText; }
        public CompanyIncentiveResponse setSuccessButtonText(String value) { this.SuccessButtonText = value; return this; }
        public Integer getActionId() { return ActionId; }
        public CompanyIncentiveResponse setActionId(Integer value) { this.ActionId = value; return this; }
        public Integer getInitialDelayInSeconds() { return InitialDelayInSeconds; }
        public CompanyIncentiveResponse setInitialDelayInSeconds(Integer value) { this.InitialDelayInSeconds = value; return this; }
        public Integer getMaxDisplayCount() { return MaxDisplayCount; }
        public CompanyIncentiveResponse setMaxDisplayCount(Integer value) { this.MaxDisplayCount = value; return this; }
        public Date getValidFrom() { return ValidFrom; }
        public CompanyIncentiveResponse setValidFrom(Date value) { this.ValidFrom = value; return this; }
        public Date getValidTo() { return ValidTo; }
        public CompanyIncentiveResponse setValidTo(Date value) { this.ValidTo = value; return this; }
        public IncentiveAction getAction() { return Action; }
        public CompanyIncentiveResponse setAction(IncentiveAction value) { this.Action = value; return this; }
        public String getPayload() { return Payload; }
        public CompanyIncentiveResponse setPayload(String value) { this.Payload = value; return this; }
    }

    public static class IncentiveAction extends BaseModel
    {
        public Integer Id = null;
        public IncentiveActionType ActionType = null;
        public String Page = null;
        public String Segment = null;
        public String Element = null;
        
        public Integer getId() { return Id; }
        public IncentiveAction setId(Integer value) { this.Id = value; return this; }
        public IncentiveActionType getActionType() { return ActionType; }
        public IncentiveAction setActionType(IncentiveActionType value) { this.ActionType = value; return this; }
        public String getPage() { return Page; }
        public IncentiveAction setPage(String value) { this.Page = value; return this; }
        public String getSegment() { return Segment; }
        public IncentiveAction setSegment(String value) { this.Segment = value; return this; }
        public String getElement() { return Element; }
        public IncentiveAction setElement(String value) { this.Element = value; return this; }
    }

    public static class BaseModel
    {
        
    }

    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; }
    }

}

Java CompanyIncentiveQuery DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /companies/{CompanyId}/incentives HTTP/1.1 
Host: testapi.bokamera.se 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<CompanyIncentivesQueryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
  <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
  <Incentives i:nil="true" />
</CompanyIncentivesQueryResponse>