Antel Merchandiser App API

<back to all web services

CheckPrincipals

Requires Authentication
The following routes are available for this service:
POST/principal/check
import java.math.*;
import java.util.*;
import net.servicestack.client.*;

public class dtos
{

    public static class CheckPrincipals extends ApiServiceRequest
    {
        public ArrayList<PrincipalAppSync> Principals = null;
        
        public ArrayList<PrincipalAppSync> getPrincipals() { return Principals; }
        public CheckPrincipals setPrincipals(ArrayList<PrincipalAppSync> value) { this.Principals = value; return this; }
    }

    public static class ApiServiceRequest implements IServiceRequest, IHasApiKey, IHasDeviceInfo
    {
        /**
        * The API Key required for authentication
        */
        @ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true)
        public String ApiKey = null;

        /**
        * Latitude of the user making this request
        */
        @ApiMember(DataType="double", Description="Latitude of the user making this request")
        public Double Latitude = null;

        /**
        * Longitude of the user making this request
        */
        @ApiMember(DataType="double", Description="Longitude of the user making this request")
        public Double Longitude = null;
        
        public String getApiKey() { return ApiKey; }
        public ApiServiceRequest setApiKey(String value) { this.ApiKey = value; return this; }
        public Double getLatitude() { return Latitude; }
        public ApiServiceRequest setLatitude(Double value) { this.Latitude = value; return this; }
        public Double getLongitude() { return Longitude; }
        public ApiServiceRequest setLongitude(Double value) { this.Longitude = value; return this; }
    }

    public static class PrincipalAppSync
    {
        public Integer PrincipalId = null;
        public String LastUpdated = null;
        
        public Integer getPrincipalId() { return PrincipalId; }
        public PrincipalAppSync setPrincipalId(Integer value) { this.PrincipalId = value; return this; }
        public String getLastUpdated() { return LastUpdated; }
        public PrincipalAppSync setLastUpdated(String value) { this.LastUpdated = value; return this; }
    }

    public static class CheckPrincipalsResponse extends ApiServiceResponse
    {
        public ArrayList<Integer> PrincipalsToUpdate = null;
        public ArrayList<PrincipalAppSync> PrincipalAppSyncData = null;
        public ArrayList<PrincipalAuthRuleData> AuthRules = null;
        
        public ArrayList<Integer> getPrincipalsToUpdate() { return PrincipalsToUpdate; }
        public CheckPrincipalsResponse setPrincipalsToUpdate(ArrayList<Integer> value) { this.PrincipalsToUpdate = value; return this; }
        public ArrayList<PrincipalAppSync> getPrincipalAppSyncData() { return PrincipalAppSyncData; }
        public CheckPrincipalsResponse setPrincipalAppSyncData(ArrayList<PrincipalAppSync> value) { this.PrincipalAppSyncData = value; return this; }
        public ArrayList<PrincipalAuthRuleData> getAuthRules() { return AuthRules; }
        public CheckPrincipalsResponse setAuthRules(ArrayList<PrincipalAuthRuleData> value) { this.AuthRules = value; return this; }
    }

    public static class ApiServiceResponse implements IServiceResponse
    {
        /**
        * Information about the response.
        */
        @ApiMember(Description="Information about the response.", IsRequired=true)
        public String Description = null;

        /**
        * Heading or summary of the response.
        */
        @ApiMember(Description="Heading or summary of the response.", IsRequired=true)
        public String Heading = null;

        /**
        * Did the intended operation for this response complete successfully?
        */
        @ApiMember(DataType="boolean", Description="Did the intended operation for this response complete successfully?", IsRequired=true)
        public Boolean WasSuccessful = null;

        public ResponseStatus ResponseStatus = null;
        
        public String getDescription() { return Description; }
        public ApiServiceResponse setDescription(String value) { this.Description = value; return this; }
        public String getHeading() { return Heading; }
        public ApiServiceResponse setHeading(String value) { this.Heading = value; return this; }
        public Boolean isWasSuccessful() { return WasSuccessful; }
        public ApiServiceResponse setWasSuccessful(Boolean value) { this.WasSuccessful = value; return this; }
        public ResponseStatus getResponseStatus() { return ResponseStatus; }
        public ApiServiceResponse setResponseStatus(ResponseStatus value) { this.ResponseStatus = value; return this; }
    }

    public static class PrincipalAuthRuleData
    {
        public Integer PrincipalId = null;
        public ArrayList<AuthRuleData> ValueAuthRules = null;
        public ArrayList<AuthRuleData> UnitAuthRules = null;
        
        public Integer getPrincipalId() { return PrincipalId; }
        public PrincipalAuthRuleData setPrincipalId(Integer value) { this.PrincipalId = value; return this; }
        public ArrayList<AuthRuleData> getValueAuthRules() { return ValueAuthRules; }
        public PrincipalAuthRuleData setValueAuthRules(ArrayList<AuthRuleData> value) { this.ValueAuthRules = value; return this; }
        public ArrayList<AuthRuleData> getUnitAuthRules() { return UnitAuthRules; }
        public PrincipalAuthRuleData setUnitAuthRules(ArrayList<AuthRuleData> value) { this.UnitAuthRules = value; return this; }
    }

    public static class AuthRuleData
    {
        public Double FromValue = null;
        public Double ToValue = null;
        public Boolean Allow = null;
        public Boolean AuthRequired = null;
        public String Region = null;
        public String Channel = null;
        public UnitOfMeasureData UnitOfMeasure = null;
        
        public Double getFromValue() { return FromValue; }
        public AuthRuleData setFromValue(Double value) { this.FromValue = value; return this; }
        public Double getToValue() { return ToValue; }
        public AuthRuleData setToValue(Double value) { this.ToValue = value; return this; }
        public Boolean isAllow() { return Allow; }
        public AuthRuleData setAllow(Boolean value) { this.Allow = value; return this; }
        public Boolean isAuthRequired() { return AuthRequired; }
        public AuthRuleData setAuthRequired(Boolean value) { this.AuthRequired = value; return this; }
        public String getRegion() { return Region; }
        public AuthRuleData setRegion(String value) { this.Region = value; return this; }
        public String getChannel() { return Channel; }
        public AuthRuleData setChannel(String value) { this.Channel = value; return this; }
        public UnitOfMeasureData getUnitOfMeasure() { return UnitOfMeasure; }
        public AuthRuleData setUnitOfMeasure(UnitOfMeasureData value) { this.UnitOfMeasure = value; return this; }
    }

    public static class UnitOfMeasureData
    {
        public Integer Id = null;
        public String Name = null;
        
        public Integer getId() { return Id; }
        public UnitOfMeasureData setId(Integer value) { this.Id = value; return this; }
        public String getName() { return Name; }
        public UnitOfMeasureData setName(String value) { this.Name = value; return this; }
    }

}

Java CheckPrincipals DTOs

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

HTTP + JSV

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

POST /principal/check HTTP/1.1 
Host: returnit-api-dev.happen.zone 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Principals: 
	[
		{
			PrincipalId: 0,
			LastUpdated: String
		}
	],
	ApiKey: String,
	Latitude: 0,
	Longitude: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	PrincipalsToUpdate: 
	[
		0
	],
	PrincipalAppSyncData: 
	[
		{
			PrincipalId: 0,
			LastUpdated: String
		}
	],
	AuthRules: 
	[
		{
			PrincipalId: 0,
			ValueAuthRules: 
			[
				{
					
				}
			],
			UnitAuthRules: 
			[
				{
					
				}
			]
		}
	],
	Description: String,
	Heading: String,
	WasSuccessful: False,
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}