Я работаю над назначением, чтобы добавить новый тег в запрос JSON, который мы собираемся вызвать. Запрос ниже.
{
"Version": "1.0",
"RequestingSystemName": "SFORCECS",
"InsuredInformation": {
"Zipcode": "12335",
"StateProvinceCode": "CA",
"PhoneNumber": "(111) 111-2222",
"MiddleName": null,
"LastName": "ABC",
"FirstName": "DEF",
"City": "PLACEWI",
"BirthDate": "1950-01-01",
"AddressLine3": null,
"AddressLine2": null,
"AddressLine1": "111 123 Drive"
},
"BeneficiaryList": [
{
"RelationShipEnum": "Nephew",
"Relationship": 18,
"PrimaryIndicator": 0,
"Percentage": null,
"FullName": "XYZ DEQ"
},
{
"RelationShipEnum": "Niece",
"Relationship": 20,
"PrimaryIndicator": 0,
"Percentage": null,
"FullName": "DEQ XYZ"
}
],
"ApplicationInformation": {
"SignedDateTime": "2010-01-01T01:01:01.000Z",
"ProductIdentifier": "1",
"MarketingSequenceNumber": "11111111111",
"EmailAddress": null,
"ContractNumber": "1111111",
"BasicAmount": "1000",
"AgentID": "12345"
}
}
Теперь моя задача - изменить запрос информации о бенефициаре. Это должно быть так, как показано ниже.
"BeneficiaryList": {"Beneficiary":[
{
"RelationShipEnum": "Nephew",
"Relationship": 18,
"PrimaryIndicator": 0,
"Percentage": null,
"FullName": "XYZ DEQ"
},
{
"RelationShipEnum": "Niece",
"Relationship": 20,
"PrimaryIndicator": 0,
"Percentage": null,
"FullName": "DEQ XYZ"
}
]},
Может кто-нибудь помочь? Класс apex, который генерирует запрос информации о бенефициаре, приведен ниже.
public class ReqBasic{
public class Beneficiary{
public Beneficiary(){}
public Beneficiary(String FullName, Integer PrimaryIndicator, Integer Percentage, Integer Relationship){
this.FullName = FullName;
this.PrimaryIndicator = PrimaryIndicator;
this.Percentage = Percentage;
this.Relationship = Relationship;
}
public Beneficiary(String FullName, String PrimaryIndicator, Integer Percentage, String Relationship){
this.FullName = FullName;
this.setPrimaryIndicatorStr(PrimaryIndicator);
this.Percentage = Percentage;
this.setRelationshipStr(Relationship);
}
}
}
Я не уверен, какие изменения мне нужно внести, чтобы добавить тег получателя: в список BeneficiaryList. Может кто-нибудь помочь?