AlbaApi

<back to all web services

InvestmentRiskProfileRiskRequest

The following routes are available for this service:
PUT/members/{EmployeeGuid}/investmentprofile/risk
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class RecommendedRisk implements IConvertible
{
    String? riskName;
    int? riskValue;
    String? riskId;

    RecommendedRisk({this.riskName,this.riskValue,this.riskId});
    RecommendedRisk.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        riskName = json['riskName'];
        riskValue = json['riskValue'];
        riskId = json['riskId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'riskName': riskName,
        'riskValue': riskValue,
        'riskId': riskId
    };

    getTypeName() => "RecommendedRisk";
    TypeContext? context = _ctx;
}

class RiskModel implements IConvertible
{
    RecommendedRisk? recommendedRisk;
    RecommendedRisk? chosenRisk;

    RiskModel({this.recommendedRisk,this.chosenRisk});
    RiskModel.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        recommendedRisk = JsonConverters.fromJson(json['recommendedRisk'],'RecommendedRisk',context!);
        chosenRisk = JsonConverters.fromJson(json['chosenRisk'],'RecommendedRisk',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'recommendedRisk': JsonConverters.toJson(recommendedRisk,'RecommendedRisk',context!),
        'chosenRisk': JsonConverters.toJson(chosenRisk,'RecommendedRisk',context!)
    };

    getTypeName() => "RiskModel";
    TypeContext? context = _ctx;
}

class InvestmentProductAllocationsSpec implements IConvertible
{
    int? fromAge;
    int? term;
    Map<String,double?>? allocs;
    double? totalAlloc;

    InvestmentProductAllocationsSpec({this.fromAge,this.term,this.allocs,this.totalAlloc});
    InvestmentProductAllocationsSpec.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        fromAge = json['fromAge'];
        term = json['term'];
        allocs = JsonConverters.fromJson(json['allocs'],'Map<String,double?>',context!);
        totalAlloc = JsonConverters.toDouble(json['totalAlloc']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'fromAge': fromAge,
        'term': term,
        'allocs': JsonConverters.toJson(allocs,'Map<String,double?>',context!),
        'totalAlloc': totalAlloc
    };

    getTypeName() => "InvestmentProductAllocationsSpec";
    TypeContext? context = _ctx;
}

class InvestmentProduct implements IConvertible
{
    String? code;
    String? name;
    String? group;
    bool? isAssetClassFund;
    List<InvestmentProductAllocationsSpec>? allocs;
    int? order;
    Map<int,Map<String,double>?>? allocationsDictionary;

    InvestmentProduct({this.code,this.name,this.group,this.isAssetClassFund,this.allocs,this.order,this.allocationsDictionary});
    InvestmentProduct.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        code = json['code'];
        name = json['name'];
        group = json['group'];
        isAssetClassFund = json['isAssetClassFund'];
        allocs = JsonConverters.fromJson(json['allocs'],'List<InvestmentProductAllocationsSpec>',context!);
        order = json['order'];
        allocationsDictionary = JsonConverters.fromJson(json['allocationsDictionary'],'Map<int,Map<String,double>?>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'code': code,
        'name': name,
        'group': group,
        'isAssetClassFund': isAssetClassFund,
        'allocs': JsonConverters.toJson(allocs,'List<InvestmentProductAllocationsSpec>',context!),
        'order': order,
        'allocationsDictionary': JsonConverters.toJson(allocationsDictionary,'Map<int,Map<String,double>?>',context!)
    };

    getTypeName() => "InvestmentProduct";
    TypeContext? context = _ctx;
}

class RecommendedProductType implements IConvertible
{
    String? product;
    String? investmentProduct;
    double? score;
    int? productType;
    List<InvestmentProduct>? investmentProducts;

    RecommendedProductType({this.product,this.investmentProduct,this.score,this.productType,this.investmentProducts});
    RecommendedProductType.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        product = json['product'];
        investmentProduct = json['investmentProduct'];
        score = JsonConverters.toDouble(json['score']);
        productType = json['productType'];
        investmentProducts = JsonConverters.fromJson(json['investmentProducts'],'List<InvestmentProduct>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'product': product,
        'investmentProduct': investmentProduct,
        'score': score,
        'productType': productType,
        'investmentProducts': JsonConverters.toJson(investmentProducts,'List<InvestmentProduct>',context!)
    };

    getTypeName() => "RecommendedProductType";
    TypeContext? context = _ctx;
}

class RecommendedProducts implements IConvertible
{
    RecommendedProductType? recommendedProduct;
    RecommendedProductType? chosenProduct;

    RecommendedProducts({this.recommendedProduct,this.chosenProduct});
    RecommendedProducts.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        recommendedProduct = JsonConverters.fromJson(json['recommendedProduct'],'RecommendedProductType',context!);
        chosenProduct = JsonConverters.fromJson(json['chosenProduct'],'RecommendedProductType',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'recommendedProduct': JsonConverters.toJson(recommendedProduct,'RecommendedProductType',context!),
        'chosenProduct': JsonConverters.toJson(chosenProduct,'RecommendedProductType',context!)
    };

    getTypeName() => "RecommendedProducts";
    TypeContext? context = _ctx;
}

class MatrixNoRisk implements IConvertible
{
    String? minimumAllocationInStocks;
    String? maximumAllocationinStocks;

    MatrixNoRisk({this.minimumAllocationInStocks,this.maximumAllocationinStocks});
    MatrixNoRisk.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        minimumAllocationInStocks = json['minimumAllocationInStocks'];
        maximumAllocationinStocks = json['maximumAllocationinStocks'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'minimumAllocationInStocks': minimumAllocationInStocks,
        'maximumAllocationinStocks': maximumAllocationinStocks
    };

    getTypeName() => "MatrixNoRisk";
    TypeContext? context = _ctx;
}

class RecommendedProductGraph implements IConvertible
{
    List<Map<String,String>>? barGraphData;
    MatrixNoRisk? pieGraphInfo;

    RecommendedProductGraph({this.barGraphData,this.pieGraphInfo});
    RecommendedProductGraph.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        barGraphData = JsonConverters.fromJson(json['barGraphData'],'List<Map<String,String>>',context!);
        pieGraphInfo = JsonConverters.fromJson(json['pieGraphInfo'],'MatrixNoRisk',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'barGraphData': JsonConverters.toJson(barGraphData,'List<Map<String,String>>',context!),
        'pieGraphInfo': JsonConverters.toJson(pieGraphInfo,'MatrixNoRisk',context!)
    };

    getTypeName() => "RecommendedProductGraph";
    TypeContext? context = _ctx;
}

class InvestmentRiskProfileResponse implements IConvertible
{
    RiskModel? risk;
    RecommendedProducts? product;
    RecommendedProductGraph? recommendedProductGraph;
    List<QuestionnaireAnswers>? questionnaireAnswers;

    InvestmentRiskProfileResponse({this.risk,this.product,this.recommendedProductGraph,this.questionnaireAnswers});
    InvestmentRiskProfileResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        risk = JsonConverters.fromJson(json['risk'],'RiskModel',context!);
        product = JsonConverters.fromJson(json['product'],'RecommendedProducts',context!);
        recommendedProductGraph = JsonConverters.fromJson(json['recommendedProductGraph'],'RecommendedProductGraph',context!);
        questionnaireAnswers = JsonConverters.fromJson(json['questionnaireAnswers'],'List<QuestionnaireAnswers>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'risk': JsonConverters.toJson(risk,'RiskModel',context!),
        'product': JsonConverters.toJson(product,'RecommendedProducts',context!),
        'recommendedProductGraph': JsonConverters.toJson(recommendedProductGraph,'RecommendedProductGraph',context!),
        'questionnaireAnswers': JsonConverters.toJson(questionnaireAnswers,'List<QuestionnaireAnswers>',context!)
    };

    getTypeName() => "InvestmentRiskProfileResponse";
    TypeContext? context = _ctx;
}

class InvestmentRiskProfileRiskRequest implements IConvertible
{
    String? employeeGuid;
    String? riskId;

    InvestmentRiskProfileRiskRequest({this.employeeGuid,this.riskId});
    InvestmentRiskProfileRiskRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        employeeGuid = json['employeeGuid'];
        riskId = json['riskId'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'employeeGuid': employeeGuid,
        'riskId': riskId
    };

    getTypeName() => "InvestmentRiskProfileRiskRequest";
    TypeContext? context = _ctx;
}

class QuestionnaireAnswers implements IConvertible
{
    int? questionNumber;
    int? optionNumber;

    QuestionnaireAnswers({this.questionNumber,this.optionNumber});
    QuestionnaireAnswers.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        questionNumber = json['questionNumber'];
        optionNumber = json['optionNumber'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'questionNumber': questionNumber,
        'optionNumber': optionNumber
    };

    getTypeName() => "QuestionnaireAnswers";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'hcbtas_q_albamfs_api.azurewebsites.net', types: <String, TypeInfo> {
    'RecommendedRisk': TypeInfo(TypeOf.Class, create:() => RecommendedRisk()),
    'RiskModel': TypeInfo(TypeOf.Class, create:() => RiskModel()),
    'InvestmentProductAllocationsSpec': TypeInfo(TypeOf.Class, create:() => InvestmentProductAllocationsSpec()),
    'Map<String,double?>': TypeInfo(TypeOf.Class, create:() => Map<String,double?>()),
    'InvestmentProduct': TypeInfo(TypeOf.Class, create:() => InvestmentProduct()),
    'List<InvestmentProductAllocationsSpec>': TypeInfo(TypeOf.Class, create:() => <InvestmentProductAllocationsSpec>[]),
    'Map<int,Map<String,double>?>': TypeInfo(TypeOf.Class, create:() => Map<int,Map<String,double>?>()),
    'Map<String,double>': TypeInfo(TypeOf.Class, create:() => Map<String,double>()),
    'RecommendedProductType': TypeInfo(TypeOf.Class, create:() => RecommendedProductType()),
    'List<InvestmentProduct>': TypeInfo(TypeOf.Class, create:() => <InvestmentProduct>[]),
    'RecommendedProducts': TypeInfo(TypeOf.Class, create:() => RecommendedProducts()),
    'MatrixNoRisk': TypeInfo(TypeOf.Class, create:() => MatrixNoRisk()),
    'RecommendedProductGraph': TypeInfo(TypeOf.Class, create:() => RecommendedProductGraph()),
    'List<Map<String,String>>': TypeInfo(TypeOf.Class, create:() => <Map<String,String>>[]),
    'InvestmentRiskProfileResponse': TypeInfo(TypeOf.Class, create:() => InvestmentRiskProfileResponse()),
    'List<QuestionnaireAnswers>': TypeInfo(TypeOf.Class, create:() => <QuestionnaireAnswers>[]),
    'QuestionnaireAnswers': TypeInfo(TypeOf.Class, create:() => QuestionnaireAnswers()),
    'InvestmentRiskProfileRiskRequest': TypeInfo(TypeOf.Class, create:() => InvestmentRiskProfileRiskRequest()),
});

Dart InvestmentRiskProfileRiskRequest 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.

PUT /members/{EmployeeGuid}/investmentprofile/risk HTTP/1.1 
Host: hcbtas-q-albamfs-api.azurewebsites.net 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	employeeGuid: 00000000000000000000000000000000,
	riskId: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	risk: 
	{
		recommendedRisk: 
		{
			riskName: String,
			riskValue: 0,
			riskId: String
		},
		chosenRisk: 
		{
			riskName: String,
			riskValue: 0,
			riskId: String
		}
	},
	product: 
	{
		recommendedProduct: 
		{
			product: String,
			investmentProduct: String,
			score: 0,
			productType: 0,
			investmentProducts: 
			[
				{
					riskId: String,
					riskName: String
				}
			]
		},
		chosenProduct: 
		{
			product: String,
			investmentProduct: String,
			score: 0,
			productType: 0,
			investmentProducts: 
			[
				{
					riskId: String,
					riskName: String
				}
			]
		}
	},
	recommendedProductGraph: 
	{
		barGraphData: 
		[
			{
				String: String
			}
		],
		pieGraphInfo: 
		{
			minimumAllocationInStocks: String,
			maximumAllocationinStocks: String
		}
	},
	questionnaireAnswers: 
	[
		{
			questionNumber: 0,
			optionNumber: 0
		}
	]
}