"use strict";
export class RuleValidationResult {
/** @param {{RuleCode?:string,Message?:string,Key?:string,Tag?:string,ErrorCode?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
RuleCode;
/** @type {string} */
Message;
/** @type {string} */
Key;
/** @type {string} */
Tag;
/** @type {string} */
ErrorCode;
}
export class ValidationErrorList {
/** @param {{ValidationErrors?:RuleValidationResult[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {RuleValidationResult[]} */
ValidationErrors;
}
export class SubscriptionLinkContact {
/** @param {{ContactId?:string,ContactAlternateKey?:string,RoleId?:string,RoleAlternateKey?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {string}
* @description Guid of the contact object within Eros. */
ContactId;
/**
* @type {string}
* @description The unique key that represents the contact on the external system. */
ContactAlternateKey;
/**
* @type {string}
* @description Guid of the Role List Item object within Eros. */
RoleId;
/**
* @type {string}
* @description The unique key that represents the role type on the external system. Note: Use of this is not currently implemented */
RoleAlternateKey;
}
export class LocationCoordinatesModel {
/** @param {{Latitude?:number,Longitude?:number,Altitude?:number,Accuracy?:number,AltitudeAccuracy?:number,Heading?:number,Speed?:number,VerticalSpeed?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {number}
* @description The latitude of an address - geographic coordinates specifying the north-south position of a point on the Earth's surface. */
Latitude;
/**
* @type {number}
* @description The longitude of an address - geographic coordinates specifying the east-west position of a point on the Earth's surface. */
Longitude;
/**
* @type {?number}
* @description The altitude of an address - the altitude above sea level. */
Altitude;
/**
* @type {?number}
* @description Accuracy of the latitude and longitude. */
Accuracy;
/**
* @type {?number}
* @description Accurancy of the Altitude. */
AltitudeAccuracy;
/**
* @type {?number}
* @description Direction you are heading. */
Heading;
/**
* @type {?number}
* @description Speed you are going. */
Speed;
/**
* @type {?number}
* @description Speed your altitude is ascending/descending at. */
VerticalSpeed;
}
export class AddressModel {
/** @param {{DistanceAway?:number,Latitude?:number,Longitude?:number,AddressFormatId?:string,SuburbId?:string,SuburbName?:string,StateShortName?:string,PostCode?:string,CountryId?:string,CountryName?:string,ISOCountryCode?:string,LotNumber?:string,SubUnit?:string,BuildingNumber?:string,StreetNumber?:string,StreetName?:string,AddressLineOne?:string,AddressLineTwo?:string,AddressFull?:string,IsPhysical?:boolean,Notes?:string,AutoMapCoordinates?:boolean,LocationCoordinates?:LocationCoordinatesModel}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {number}
* @description The distance between this project and another specified set of gps coordinates. */
DistanceAway;
/**
* @type {number}
* @description The latitude of an address - geographic coordinates specifying the north-south position of a point on the Earth's surface. */
Latitude;
/**
* @type {number}
* @description The longitude of an address - geographic coordinates specifying the east-west position of a point on the Earth's surface. */
Longitude;
/**
* @type {string}
* @description Address Format Id Guid - this will be determined by the service. */
AddressFormatId;
/**
* @type {string}
* @description Suburb Id Guid - this will attempt to be determined by the SuburbName, StateShortName and Postcode entered. */
SuburbId;
/**
* @type {string}
* @description The suburb name. */
SuburbName;
/**
* @type {string}
* @description The shortened State Name e.g Vic for Victoria. */
StateShortName;
/**
* @type {string}
* @description The suburb postcode. */
PostCode;
/**
* @type {string}
* @description Country Id Guid - this will be determined by the CountrName or ISOCountryCode entered. */
CountryId;
/**
* @type {string}
* @description the name of the country the address is within. */
CountryName;
/**
* @type {string}
* @description A 2 digit ISO Country Code representing the country. */
ISOCountryCode;
/**
* @type {string}
* @description The address Lot number. */
LotNumber;
/**
* @type {string}
* @description The address Sub Unit number. */
SubUnit;
/**
* @type {string}
* @description The address building number. */
BuildingNumber;
/**
* @type {string}
* @description The address street number. */
StreetNumber;
/**
* @type {string}
* @description The address street name including street type. */
StreetName;
/**
* @type {string}
* @description A formatted address Line 1. */
AddressLineOne;
/**
* @type {string}
* @description A formatted address Line 2. */
AddressLineTwo;
/**
* @type {string}
* @description The full address string. */
AddressFull;
/**
* @type {?boolean}
* @description True if the address is a physical location. */
IsPhysical;
/**
* @type {string}
* @description Notes about the address. */
Notes;
/**
* @type {?boolean}
* @description If true, the address is eligible for having its coordinates calculated/updated. */
AutoMapCoordinates;
/**
* @type {LocationCoordinatesModel}
* @description Location Coordinates for the address. */
LocationCoordinates;
}
export class SubscriptionObjectModel {
/** @param {{SuiteDataSourceInstanceId?:string,AlternateKey?:string,ObjectId?:string,RmsTableCtxId?:string,IgnoreValidation?:boolean}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {string}
* @description Guid representing the external systems datasource information. */
SuiteDataSourceInstanceId;
/**
* @type {string}
* @description The unique key that represents the object on the external system. */
AlternateKey;
/**
* @type {string}
* @description Guid of the object within Eros. If ObjectId is known, the external system may pass this instead of the alternate key. */
ObjectId;
/**
* @type {string}
* @description Guid of the RmsTableCtx within Eros. This is used if the alternate key is provided to identify the object to update. */
RmsTableCtxId;
/**
* @type {boolean}
* @description Validation ensures that this object has a value in alternateKey or ObjectId, ignoring validation skips this requirement. */
IgnoreValidation;
}
export class DimensionValueModel {
/** @param {{DimensionValueId?:string,DimensionId?:string,Name?:string,Description?:string,ShortName?:string,TrafficLightId?:string,TrafficLightColour?:string,ObjectConnectionId?:string,OwnerContactId?:string,RecordStatus?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
DimensionValueId;
/** @type {string} */
DimensionId;
/** @type {string} */
Name;
/** @type {string} */
Description;
/** @type {string} */
ShortName;
/** @type {string} */
TrafficLightId;
/** @type {string} */
TrafficLightColour;
/** @type {string} */
ObjectConnectionId;
/** @type {string} */
OwnerContactId;
/** @type {string} */
RecordStatus;
}
export class SubscriptionCommonProjectModel {
/** @param {{Reference?:string,Name?:string,Description?:string,ProjectContacts?:SubscriptionLinkContact[],ProjectAddress?:AddressModel,CustomerContactGroup?:SubscriptionObjectModel,GroupName?:string,StageName?:string,PrimaryProjectImageId?:string,PrimaryProjectPhotoUrl?:string,PrimaryProjectThumbnailUrl?:string,PrimaryProjectPhotoHeight?:number,PrimaryProjectPhotoWidth?:number,DynamicContent?:string,DocumentableObjectConnection?:string,DimensionValues?:DimensionValueModel[],Calendars?:string[],DocumentSiteId?:string,ObjectSubscriptionId?:string,ObjectHash?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {string}
* @description A reference number used for identifying the project in the external system. */
Reference;
/**
* @type {string}
* @description A name for the project. */
Name;
/**
* @type {string}
* @description A description for the project. */
Description;
/**
* @type {SubscriptionLinkContact[]}
* @description A list of ProjectContact records that link contacts (and their role in the project) to the project. */
ProjectContacts;
/**
* @type {AddressModel}
* @description An address for the project. */
ProjectAddress;
/**
* @type {SubscriptionObjectModel}
* @description A link to the Customer Contact Group. */
CustomerContactGroup;
/**
* @type {string}
* @description Project Group Name. */
GroupName;
/**
* @type {string}
* @description Stage Name. */
StageName;
/**
* @type {string}
* @description Guid of the Media Object representing the projects primary image. */
PrimaryProjectImageId;
/**
* @type {string}
* @description URL to the projects primary full image. */
PrimaryProjectPhotoUrl;
/**
* @type {string}
* @description URL to the projects primary thumbnail image. */
PrimaryProjectThumbnailUrl;
/**
* @type {number}
* @description Image height of the projects logo. */
PrimaryProjectPhotoHeight;
/**
* @type {number}
* @description Image height of the projects logo. */
PrimaryProjectPhotoWidth;
/**
* @type {string}
* @description Dynamically linked content. */
DynamicContent;
/**
* @type {string}
* @description If this is 'A' then a documentable ObjectConnection will be created. If this is 'D' then a documentable ObjectConnection will be removed if it exists. Any other value will be ignored. */
DocumentableObjectConnection;
/**
* @type {DimensionValueModel[]}
* @description Dimension values linked to the project. */
DimensionValues;
/**
* @type {string[]}
* @description Dimension values linked to the project. */
Calendars;
/**
* @type {?string}
* @description The Document Site ID. */
DocumentSiteId;
/** @type {string} */
ObjectSubscriptionId;
/** @type {string} */
ObjectHash;
}
export class SaveProject extends ValidationErrorList {
/** @param {{SuiteDataSourceInstanceId?:string,AlternateKey?:string,ObjectId?:string,IgnoreHash?:boolean,IgnoreValidation?:boolean,Project?:SubscriptionCommonProjectModel,LicenseeId?:string,SessionId?:string,ValidationErrors?:RuleValidationResult[]}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
/**
* @type {string}
* @description Guid representing the external systems datasource information. */
SuiteDataSourceInstanceId;
/**
* @type {string}
* @description The unique key that represents the project on the external system. */
AlternateKey;
/**
* @type {string}
* @description Guid of the project object within Eros. If ObjectId is known, the external system may pass this instead of the alternate key. */
ObjectId;
/**
* @type {boolean}
* @description If set to true, the object will be updated/refreshed. If false, the hash representation of the Project model and its data will be compared with the current Project to determine if there are any changes to save. */
IgnoreHash;
/** @type {boolean} */
IgnoreValidation;
/**
* @type {SubscriptionCommonProjectModel}
* @description Object containing all details of the project to be inserted or updated. */
Project;
/** @type {string} */
LicenseeId;
/** @type {string} */
SessionId;
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /jsv/reply/SaveProject HTTP/1.1
Host: production-eros-platform-apisubscription.azurewebsites.net
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
AlternateKey: String,
IgnoreHash: False,
IgnoreValidation: False,
Project:
{
Reference: String,
Name: String,
Description: String,
ProjectContacts:
[
{
ContactAlternateKey: String,
RoleAlternateKey: String
}
],
ProjectAddress:
{
DistanceAway: 0,
Latitude: 0,
Longitude: 0,
SuburbName: String,
StateShortName: String,
PostCode: String,
CountryName: String,
ISOCountryCode: String,
LotNumber: String,
SubUnit: String,
BuildingNumber: String,
StreetNumber: String,
StreetName: String,
AddressLineOne: String,
AddressLineTwo: String,
AddressFull: String,
IsPhysical: False,
Notes: String,
AutoMapCoordinates: False,
LocationCoordinates:
{
Latitude: 0,
Longitude: 0,
Altitude: 0,
Accuracy: 0,
AltitudeAccuracy: 0,
Heading: 0,
Speed: 0,
VerticalSpeed: 0
}
},
CustomerContactGroup:
{
AlternateKey: String,
IgnoreValidation: False
},
GroupName: String,
StageName: String,
PrimaryProjectPhotoUrl: String,
PrimaryProjectThumbnailUrl: String,
PrimaryProjectPhotoHeight: 0,
PrimaryProjectPhotoWidth: 0,
DynamicContent: String,
DocumentableObjectConnection: ,
DimensionValues:
[
{
Name: String,
Description: String,
ShortName: String,
TrafficLightColour: String,
RecordStatus: String
}
],
Calendars:
[
00000000-0000-0000-0000-000000000000
],
DocumentSiteId: 00000000-0000-0000-0000-000000000000,
ObjectHash: String
},
ValidationErrors:
[
{
RuleCode: String,
Message: String,
Key: String,
Tag: String,
ErrorCode: String
}
]
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { ErrorCode: String, Message: String, StackTrace: String, Errors: [ { ErrorCode: String, FieldName: String, Message: String, Meta: { String: String } } ], Meta: { String: String } }