POST | /member/validate |
---|
import Foundation
import ServiceStack
public class MemberValidateReq : Codable
{
public var member:Member?
required public init(){}
}
public class Member : Member
{
public var id:String?
public var email:String?
public var employeeGuidString:String?
public var ignoreGender:Bool?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case id
case email
case employeeGuidString
case ignoreGender
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
id = try container.decodeIfPresent(String.self, forKey: .id)
email = try container.decodeIfPresent(String.self, forKey: .email)
employeeGuidString = try container.decodeIfPresent(String.self, forKey: .employeeGuidString)
ignoreGender = try container.decodeIfPresent(Bool.self, forKey: .ignoreGender)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if id != nil { try container.encode(id, forKey: .id) }
if email != nil { try container.encode(email, forKey: .email) }
if employeeGuidString != nil { try container.encode(employeeGuidString, forKey: .employeeGuidString) }
if ignoreGender != nil { try container.encode(ignoreGender, forKey: .ignoreGender) }
}
}
public class HttpResult : Codable
{
public var responseText:String?
public var responseStream:Data?
public var fileInfo:FileInfo?
//virtualFile:IVirtualFile ignored. Swift doesn't support interface properties
public var contentType:String?
public var headers:[String:String] = [:]
public var cookies:[Cookie] = []
public var eTag:String?
@TimeSpan public var age:TimeInterval?
@TimeSpan public var maxAge:TimeInterval?
public var expires:Date?
public var lastModified:Date?
public var cacheControl:CacheControl?
public var resultScope:Func<IDisposable>?
public var allowsPartialResponse:Bool?
public var options:[String:String] = [:]
public var status:Int?
public var statusCode:HttpStatusCode?
public var statusDescription:String?
//response:Object ignored. Type could not be extended in Swift
//responseFilter:IContentTypeWriter ignored. Swift doesn't support interface properties
//requestContext:IRequest ignored. Swift doesn't support interface properties
public var view:String?
public var template:String?
public var paddingLength:Int?
public var isPartialRequest:Bool?
required public init(){}
}
public protocol IVirtualFile
{
//virtualPathProvider:IVirtualPathProvider ignored. Swift doesn't support interface properties
var `extension`:String? { get set }
var length:Int? { get set }
}
public protocol IVirtualPathProvider
{
//rootDirectory:IVirtualDirectory ignored. Swift doesn't support interface properties
var virtualPathSeparator:String? { get set }
var realPathSeparator:String? { get set }
}
public protocol IVirtualDirectory
{
}
// @Flags()
public enum CacheControl : Int, Codable
{
case None = 0
case Public = 1
case Private = 2
case MustRevalidate = 4
case NoCache = 8
case NoStore = 16
case NoTransform = 32
case ProxyRevalidate = 64
}
public protocol IContentTypeWriter
{
}
public protocol IRequest
{
//originalRequest:Object ignored. Type could not be extended in Swift
//response:IResponse ignored. Swift doesn't support interface properties
var operationName:String? { get set }
var verb:String? { get set }
var requestAttributes:RequestAttributes? { get set }
//requestPreferences:IRequestPreferences ignored. Swift doesn't support interface properties
//dto:Object ignored. Type could not be extended in Swift
var contentType:String? { get set }
var isLocal:Bool? { get set }
var userAgent:String? { get set }
var cookies:[String:Cookie]? { get set }
var responseContentType:String? { get set }
var hasExplicitResponseContentType:Bool? { get set }
var items:[String:Object]? { get set }
var headers:NameValueCollection? { get set }
var queryString:NameValueCollection? { get set }
var formData:NameValueCollection? { get set }
var useBufferedStream:Bool? { get set }
var rawUrl:String? { get set }
var absoluteUri:String? { get set }
var userHostAddress:String? { get set }
var remoteIp:String? { get set }
var authorization:String? { get set }
var isSecureConnection:Bool? { get set }
var acceptTypes:[String] { get set }
var pathInfo:String? { get set }
var originalPathInfo:String? { get set }
var inputStream:Data? { get set }
var contentLength:Int? { get set }
var files:[IHttpFile] { get set }
var urlReferrer:Uri? { get set }
}
public protocol IResponse
{
//originalResponse:Object ignored. Type could not be extended in Swift
//request:IRequest ignored. Swift doesn't support interface properties
var statusCode:Int? { get set }
var statusDescription:String? { get set }
var contentType:String? { get set }
var outputStream:Data? { get set }
//dto:Object ignored. Type could not be extended in Swift
var useBufferedStream:Bool? { get set }
var isClosed:Bool? { get set }
var keepAlive:Bool? { get set }
var hasStarted:Bool? { get set }
var items:[String:Object]? { get set }
}
// @Flags()
public enum RequestAttributes : Int, Codable
{
case None = 0
case Localhost = 1
case LocalSubnet = 2
case External = 4
case Secure = 8
case InSecure = 16
case AnySecurityMode = 24
case HttpHead = 32
case HttpGet = 64
case HttpPost = 128
case HttpPut = 256
case HttpDelete = 512
case HttpPatch = 1024
case HttpOptions = 2048
case HttpOther = 4096
case AnyHttpMethod = 8160
case OneWay = 8192
case Reply = 16384
case AnyCallStyle = 24576
case Soap11 = 32768
case Soap12 = 65536
case Xml = 131072
case Json = 262144
case Jsv = 524288
case ProtoBuf = 1048576
case Csv = 2097152
case Html = 4194304
case Wire = 8388608
case MsgPack = 16777216
case FormatOther = 33554432
case AnyFormat = 67076096
case Http = 67108864
case MessageQueue = 134217728
case Tcp = 268435456
case Grpc = 536870912
case EndpointOther = 1073741824
case AnyEndpoint = 2080374784
case InProcess = -2147483648
case InternalNetworkAccess = -2147483645
case AnyNetworkAccessType = -2147483641
case Any = -1
}
public protocol IRequestPreferences
{
var acceptsBrotli:Bool? { get set }
var acceptsDeflate:Bool? { get set }
var acceptsGzip:Bool? { get set }
}
public protocol IHttpFile
{
var name:String? { get set }
var fileName:String? { get set }
var contentLength:Int? { get set }
var contentType:String? { get set }
var inputStream:Data? { get set }
}
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 /member/validate HTTP/1.1
Host: hcbtas-q-albamfs-api.azurewebsites.net
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
member:
{
userId: String,
systemId: String,
schemeCode: String,
sessionId: String,
clientId: String,
clientCode: String,
isDefault: False,
groupId: String,
groupNameUpper: String,
appName: String,
appNameUpper: String,
key: String,
keyUpper: String,
country: String,
locale: String,
ccy: String,
cdy: String,
status: String,
statusCode: String,
category: String,
scheme: String,
primarySalary: String,
email: String,
employer:
{
id: String,
code: String,
name: String,
logo: String,
config: {}
},
roles: 0,
asAt: 0001-01-01,
calcDate: 0001-01-01,
nextEOFY: 0001-06-30,
periodToNextEOFY: 0.5,
year: 0,
hasPartner: False,
includePartner: False,
includePartnerInCalc: False,
homeOwner: False,
targetAge: 0,
targetTime: 0,
targetIncomeR: 0,
targetIncomeRFreq: 0,
targetIncomeRAnnual: 0,
targetP: 0,
includeSS: False,
firstName: String,
lastName: String,
gender: Female,
dob: 0001-01-01,
salary: 0,
people:
[
{
type: Primary,
index: 0,
firstName: String,
lastName: String,
gender: Female,
isAgeInput: False,
dob: 0001-01-01,
age: 0,
exactAge: 0,
ageAtLast30June: 0,
privateHealthInsurance: False,
serviceDate: 0001-01-01,
service: 0,
intService: 0,
ageR: 0,
ageRMonths: 0,
email: String,
salaries:
{
String:
{
type: String,
ccy: String,
amount: 0,
freq: 0,
annualAmount: 0,
indexType: String,
salaryChanges:
[
{
fromAge: 0,
amount: 0
}
]
}
},
salary: 0,
salaryFreq: 0,
salaryChangeSeries:
[
0
],
hasOtherIncome: False,
otherIncome:
[
{
name: String,
type: Pension,
amount: 0,
fromAge: 0,
toAge: 0,
isTaxable: False,
isVector: False,
vector:
[
0
],
custom:
{
String: String
},
asAt: 0001-01-01,
age: 0,
intAge: 0,
year: 0,
periodToNextEOFY: 0.5,
indexType: String,
deflationType: String,
indexTypePre: String,
indexTypePost: String
}
],
socialSecurity:
{
asAt: 0001-01-01,
age: 0,
intAge: 0,
year: 0,
periodToNextEOFY: 0.5,
indexType: String,
deflationType: String,
indexTypePre: String,
indexTypePost: String
},
taxableDeductions: 0,
nonTaxableDeductions: 0,
careerChanges:
{
willTake: False,
breaks:
[
{
fromAge: 0,
toAge: 0,
workingRate: 0
}
],
careerBreakSeries:
[
0
],
totalYears: 0
},
custom:
{
String: String
},
salaryKey: String,
annualProjectibleSalary: 0,
projectionBreakdownCode: Salary You,
lookup: "Salary You:Primary",
ssBreakdownCode: SocialSecurityYou,
ssLookup: "SocialSecurityYou:Primary",
asAt: 0001-01-01,
intAge: 0,
year: 0,
periodToNextEOFY: 0.5,
indexType: String,
deflationType: String,
indexTypePre: String,
indexTypePost: String
}
],
assets:
[
{
type: FinAsset,
owner: Primary,
code: String,
assetIndex: 0,
lookup: "String:Primary:0",
name: String,
ccy: String,
value: 0,
change: 0,
transferTo: 0,
transferAge: 0,
willSpend: False,
minRule: NoMinimum,
maxRule: NoMaximum,
ssTreatment: Exempt,
spendOnAnnuity: False,
contTaxRate: 0,
totalConts: 0,
usePreCalculatedContributions: False,
totalContributions:
[
[
0
]
],
futureAllocations:
[
[
{
String: 0
}
]
],
assetType: FinAsset,
totalContsFreq: 1,
totalLumpSumConts: 0,
contributions:
[
{
code: String,
index: 0,
name: String,
ccy: String,
contTable: String,
isEmployeeCont: False,
employerFlag: False,
type: Fixed,
linkedContIndex: 0,
sourceRate: String,
isTaxable: False,
amount: 0,
coreAmount: 0,
freq: 0,
rate: 0,
coreRate: 0,
fromAge: 0,
toAge: 0,
salary: 0,
annualAmount: 0,
annualCoreAmount: 0,
isAlwaysOneOff: False,
isOneOff: True,
constraintType: LumpSum,
custom:
{
String: String
},
memberRateLookup:
{
0: 0
},
isFromSalary: False,
asAt: 0001-01-01,
age: 0,
intAge: 0,
year: 0,
periodToNextEOFY: 0.5,
indexType: String,
deflationType: String,
indexTypePre: String,
indexTypePost: String
}
],
fees:
[
{
name: String,
ccy: String,
amount: 0,
freq: 0,
annualAmount: 0,
rate: 0,
isTaxable: False,
fromAge: 0,
toAge: 0,
custom:
{
String: String
},
asAt: 0001-01-01,
age: 0,
intAge: 0,
year: 0,
periodToNextEOFY: 0.5,
indexType: String,
deflationType: String,
indexTypePre: String,
indexTypePost: String
}
],
feeCapArrangements:
[
{
name: String,
amount: 0,
indexationRateSeries: 0,
rate: 0,
feesIncluded:
[
0
],
fromTime: 0,
toTime: 0,
custom:
{
String: String
},
asAt: 0001-01-01,
age: 0,
intAge: 0,
year: 0,
periodToNextEOFY: 0.5,
indexType: String,
deflationType: String,
indexTypePre: String,
indexTypePost: String
}
],
custom:
{
String: String
},
rebalance: False,
retLumpSum: False,
allocSeries:
[
{
current:
{
String: 0
},
future:
{
String: 0
}
}
],
currentAssetClassAllocSeries:
{
0:
{
String: 0
}
},
futureAssetClassAllocSeries:
{
0:
{
String: 0
}
},
ratesSource: DB,
alloc:
[
{
name: String,
fromAge: 0,
optAlloc:
{
current:
{
String: 0
},
future:
{
String: 0
}
},
currentAssetClassAlloc:
{
String: 0
},
futureAssetClassAlloc:
{
String: 0
},
totalCurrentAlloc: 0,
totalFutureAlloc: 0
}
],
allocKeys:
[
String
],
returns:
{
String:
[
{
name: String,
fromAge: 0,
earningRate: 0,
taxRate: 0,
returnRate: 0
}
]
},
returnRates:
{
String:
{
earningRates:
[
0
],
taxRates:
[
0
]
}
},
asAt: 0001-01-01,
age: 0,
intAge: 0,
year: 0,
periodToNextEOFY: 0.5,
indexType: String,
deflationType: String,
indexTypePre: String,
indexTypePost: String
}
],
includeAnnuities: False,
annuities:
[
{
priceType: Calc,
price: 0,
owner: Primary,
gender: Female,
ownerAge: 0,
spouseAge: 0,
type: Deferred,
purchaseType: Perc,
purchaseAmount: 0,
percBalanceSpent: 0,
amountSpent: 0,
incomePurchased: 0,
purchaseAge: 0,
deferralPeriod: 0,
indexationName: String,
drStochastic: String,
impliedInflationStochasticSeries: String,
reversion: 0,
guarantee: 0,
timing: 0,
scaleQx: 0,
scaleQxPartner: 0,
scaleImpr: 0,
scaleImprPartner: 0,
ageRating: 0,
spouseAgeRating: 0,
custom:
{
String: String
},
tableName: String,
tableNamePartner: String,
imprFactorTableName: String,
imprFactorTableNamePartner: String,
hasPartnerTables: True,
spouseAgeAtPurchase: 0,
expense: 0,
cacheKey: LifeTables-String-String,
partnerCacheKey: LifeTables-String-String,
targetTpx: 0,
paymentTerm: 0,
asAt: 0001-01-01,
age: 0,
intAge: 0,
year: 0,
periodToNextEOFY: 0.5,
indexType: String,
deflationType: String,
indexTypePre: String,
indexTypePost: String
}
],
spending:
{
selected: String,
willChangeLate: False,
ageRLate: 0,
selectedLate: String,
goals:
[
{
name: String,
amount: 0,
freq: 0,
effectiveFreq: 1,
excludeFromProjection: False,
fromAge: 0,
toAge: 0,
selectedPersonalised: String,
tag: String,
custom:
{
String: String
},
asAt: 0001-01-01,
age: 0,
intAge: 0,
year: 0,
periodToNextEOFY: 0.5,
indexType: String,
deflationType: String,
indexTypePre: String,
indexTypePost: String
}
],
lumpSumType: Perc,
lumpSumRate: 0,
lumpSumAmount: 0,
count: 1,
custom:
{
String: String
},
asAt: 0001-01-01,
age: 0,
intAge: 0,
year: 0,
periodToNextEOFY: 0.5,
indexType: String,
deflationType: String,
indexTypePre: String,
indexTypePost: String
},
investmentProperties:
[
{
owner: Primary,
value: 0,
rentYield: 0,
expense: 0,
downsize: 0,
downsizeAge: 0,
downsizeToAsset: 0,
rates: 0,
lookup: "Prop:Primary",
asAt: 0001-01-01,
age: 0,
intAge: 0,
year: 0,
periodToNextEOFY: 0.5,
indexType: String,
deflationType: String,
indexTypePre: String,
indexTypePost: String
}
],
incomeVectors:
{
String:
[
0
]
},
config:
{
country: String,
clientCode: String,
isStochastic: False,
stochasticLoopType: Parallel,
stochProjServiceLoc: WebServer,
stochProjSvcCallType: Sync,
dataSet: String,
solveTarget: NA,
solveTolerance: 0,
indexationRatesSource: DB,
discRatesSource: DB,
returnRatesSource: DB,
deterministicSim: 0,
stochasticSim: 0,
simCount: 0,
simsToIncludeDetails:
[
0
],
includeBalArray: False,
includeProjectionInStochasticResult: False,
includeFirstProjectionInStochasticResult: False,
usesStochasticData: True,
includeAllSpendingResult: False,
includeAllContributionProjectionResult: False,
includeAllAssetsProjectionResults: False,
includeAllSummaryProjectionResult: False,
includePreCalculatedContributionsInResponse: False,
includedProjections:
[
String
]
},
indexation:
[
{
name: String,
fromAge: 0,
rate: 0
}
],
annuityDisc:
[
{
name: String,
fromAge: 0,
rate: 0
}
],
indexationRates:
{
String:
[
0
]
},
annuityDiscRates:
{
String:
[
0
]
},
balance: 0,
planSomeValue: String,
flag1: False,
flag2: True,
isFriendly: True,
financingOption: String,
totalYears: 7,
totalLoopYears: 100,
age: 0,
ageR: 0,
intAge: 0,
indexType: String,
indexTypePre: String,
indexTypePost: String,
deflationType: String,
custom:
{
String: String
},
countryCalcConfig: {},
summary:
{
age: 0,
salary: 0,
balance: 0,
invOption: String,
contributions:
[
{
code: String,
name: String,
assetCode: String,
assetName: String,
isEmployeeCont: False,
amount: 0,
freq: 0,
rate: 0
}
]
},
lastModified: 0001-01-01,
isReturningUser: False,
clientCountryConfigCacheKey: ClientCountryConfig-String-String,
personalAssets: 0,
resultsSummary:
{
asAt: 0001-01-01,
age: 0,
intAge: 0,
year: 0,
periodToNextEOFY: 0.5,
indexType: String,
deflationType: String,
indexTypePre: String,
indexTypePost: String
},
totalContribution:
{
asAt: 0001-01-01,
age: 0,
intAge: 0,
year: 0,
periodToNextEOFY: 0.5,
indexType: String,
deflationType: String,
indexTypePre: String,
indexTypePost: String
},
id: String
}
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { }