Account Settings Set Request (AccountSettingsAddRequest) Class
The AccountSettingsAddRequest class is used to send a request to the server to add or update account visibility settings for a client. It specifies the client, the business unit, and a list of account profiles with their respective account visibility states.
Purpose
This model is central to changing which accounts a client can see. When a client chooses to hide or show accounts, the frontend or an intermediary service would typically construct this request object to be sent to the Account Settings API.
Properties of AccountSettingsAddRequest
| Property Name | Type | Required | JSON Property Name | Description |
|---|---|---|---|---|
Gcn | string | Yes | gcn | The Global Client Number, identifying the client. |
BusinessUnit | string | Yes | businessUnit | The business unit to which these settings apply (e.g., "PB", "Wealth"). |
ClientAccountProfiles | List<AccountSettingsProfile> | No | A list of client account profiles, each containing a list of accounts and their visibility settings. If null or empty, it might imply no specific profile-level settings are being added/updated for accounts directly under GCN/BusinessUnit combination, or the API handles it differently. The JSON property name is not explicitly defined via [JsonPropertyName] for this field in the provided C# code, so it would default to clientAccountProfiles (camelCase) or ClientAccountProfiles (PascalCase) depending on JSON serialization settings. |
Nested Classes
Account Settings Profile (AccountSettingsProfile) Class
This class represents a specific profile under which accounts are grouped for a client.
Properties of AccountSettingsProfile:
| Property Name | Type | Required | JSON Property Name | Description |
|---|---|---|---|---|
ProfileId | string | No | profileId | An identifier for the client's profile (e.g., a specific user role or view). |
Accounts | List<AccountSettingsProfileAccount> | Yes | accounts | A list of accounts associated with this profile and their visibility settings. Defaults to an empty list. |
Account Settings Profile Account (AccountSettingsProfileAccount) Class
This class defines the structure for an individual account within a profile, including its visibility status. It's similar to AccountModel but tailored for the add request, with some fields being explicitly required.
Properties of AccountSettingsProfileAccount:
| Property Name | Type | Required | JSON Property Name | Description |
|---|---|---|---|---|
AccountNumber | string | Yes | accountNumber | The unique identifier for the account. |
AccountName | string | Yes | accountName | The display name for the account. |
AccountType | string | Yes | accountType | The type of account (e.g., Savings, Cheque). |
AccountStatus | string | No | accountStatus | The current status of the account (e.g., "Active", "Closed"). |
ProductSegment | string | Yes | productSegment | The specific product segment the account belongs to. |
BusinessUnit | string | Yes | businessUnit | The business unit associated with this specific account. Defaults to an empty string. |
AccountHidden | bool | Yes | accountHidden | A boolean flag indicating if the account should be hidden (true) or visible (false). |
Validation
- For
AccountSettingsAddRequest:GcnandBusinessUnitare required. - For
AccountSettingsProfile: TheAccountslist is required (though it can be an empty list). - For
AccountSettingsProfileAccount:AccountNumber,AccountName,AccountType,ProductSegment,BusinessUnit, andAccountHiddenare required.
Example Usage (C#)
This example demonstrates how to create an instance of AccountSettingsAddRequest based on the C# class definitions:
using Investec.AccountSettings.Models;
using System.Collections.Generic;
var request = new AccountSettingsAddRequest
{
Gcn = "123456789",
BusinessUnit = "Private Bank SA",
ClientAccountProfiles = new List<AccountSettingsProfile>
{
new AccountSettingsProfile
{
ProfileId = "DefaultProfile01",
Accounts = new List<AccountSettingsProfileAccount>
{
new AccountSettingsProfileAccount
{
AccountNumber = "ACC001",
AccountName = "My Cheque Account",
AccountType = "Cheque",
AccountStatus = "Active",
ProductSegment = "Transactional",
BusinessUnit = "Private Bank SA",
AccountHidden = false // This account will be visible
},
new AccountSettingsProfileAccount
{
AccountNumber = "ACC002",
AccountName = "My Savings Account",
AccountType = "Savings",
AccountStatus = "Active",
ProductSegment = "Savings",
BusinessUnit = "Private Bank SA",
AccountHidden = true // This account will be hidden
}
}
}
}
};
// This 'request' object would then be serialized (typically to JSON)
// and sent as the body of an HTTP POST or PUT request to the Account Settings API.Note on JSON Property Naming: The ClientAccountProfiles property in AccountSettingsAddRequest does not have an explicit [JsonPropertyName] attribute in the provided C# code. Depending on the JSON serializer configuration (e.g., camelCase vs. PascalCase for property names), the actual JSON field name might be clientAccountProfiles or ClientAccountProfiles.