@@ -2109,15 +2109,45 @@ test('createApiKey request example', async () => {
21092109 originalLog ( 'createAccountSettingsTemplate() result:' ) ;
21102110
21112111 // begin-create_account_settings_template
2112- const settings = {
2113- mfa : "LEVEL1" ,
2114- system_access_token_expiration_in_seconds : "3000" ,
2115- }
2112+ // UserMfa
2113+ const userMfaModel = {
2114+ iam_id : iamId ,
2115+ mfa : 'LEVEL1' ,
2116+ } ;
2117+
2118+ // AccountSettingsUserDomainRestriction
2119+ const accountSettingsUserDomainRestrictionModel = {
2120+ realm_id : 'IBMid' ,
2121+ invitation_email_allow_patterns : [ "*.*@sap.com" ] ,
2122+ restrict_invitation : false ,
2123+ } ;
2124+
2125+ // TemplateAccountSettingsRestrictUserDomains
2126+ const templateAccountSettingsRestrictUserDomainsModel = {
2127+ account_sufficient : false ,
2128+ restrictions : [ accountSettingsUserDomainRestrictionModel ] ,
2129+ } ;
2130+
2131+ // TemplateAccountSettings
2132+ const templateAccountSettingsModel = {
2133+ restrict_create_service_id : 'RESTRICTED' ,
2134+ restrict_create_platform_apikey : 'RESTRICTED' ,
2135+ mfa : 'LEVEL1' ,
2136+ user_mfa : [ userMfaModel ] ,
2137+ session_expiration_in_seconds : '86400' ,
2138+ session_invalidation_in_seconds : '7200' ,
2139+ max_sessions_per_identity : '10' ,
2140+ system_access_token_expiration_in_seconds : '3600' ,
2141+ system_refresh_token_expiration_in_seconds : '259200' ,
2142+ restrict_user_list_visibility : 'NOT_RESTRICTED' ,
2143+ restrict_user_domains : templateAccountSettingsRestrictUserDomainsModel ,
2144+ } ;
2145+
21162146 const templateParams = {
21172147 name : accountSettingsTemplateName ,
21182148 description : "IAM enterprise account settings template example" ,
21192149 accountId : enterpriseAccountId ,
2120- accountSettings : settings ,
2150+ accountSettings : templateAccountSettingsModel ,
21212151 }
21222152
21232153 try {
@@ -2201,18 +2231,48 @@ test('createApiKey request example', async () => {
22012231 originalLog ( 'updateAccountSettingsTemplate() result:' ) ;
22022232
22032233 // begin-update_account_settings_template_version
2204- const settings = {
2205- mfa : "LEVEL1" ,
2206- system_access_token_expiration_in_seconds : "3000" ,
2207- }
2234+ // UserMfa
2235+ const userMfaModel = {
2236+ iam_id : iamId ,
2237+ mfa : 'LEVEL1' ,
2238+ } ;
2239+
2240+ // AccountSettingsUserDomainRestriction
2241+ const accountSettingsUserDomainRestrictionModel = {
2242+ realm_id : 'IBMid' ,
2243+ invitation_email_allow_patterns : [ "*.*@sap.com" ] ,
2244+ restrict_invitation : false ,
2245+ } ;
2246+
2247+ // TemplateAccountSettingsRestrictUserDomains
2248+ const templateAccountSettingsRestrictUserDomainsModel = {
2249+ account_sufficient : false ,
2250+ restrictions : [ accountSettingsUserDomainRestrictionModel ] ,
2251+ } ;
2252+
2253+ // TemplateAccountSettings
2254+ const templateAccountSettingsModel = {
2255+ restrict_create_service_id : 'NOT_SET' ,
2256+ restrict_create_platform_apikey : 'NOT_SET' ,
2257+ mfa : 'LEVEL1' ,
2258+ user_mfa : [ userMfaModel ] ,
2259+ session_expiration_in_seconds : '72400' ,
2260+ session_invalidation_in_seconds : '6000' ,
2261+ max_sessions_per_identity : '5' ,
2262+ system_access_token_expiration_in_seconds : '3000' ,
2263+ system_refresh_token_expiration_in_seconds : '59200' ,
2264+ restrict_user_list_visibility : 'RESTRICTED' ,
2265+ restrict_user_domains : templateAccountSettingsRestrictUserDomainsModel ,
2266+ } ;
2267+
22082268 const params = {
22092269 accountId : enterpriseAccountId ,
22102270 templateId : accountSettingsTemplateId ,
22112271 version : accountSettingsTemplateVersion ,
22122272 ifMatch : accountSettingsTemplateEtag ,
22132273 name : accountSettingsTemplateName ,
22142274 description : "IAM enterprise account settings template example - updated" ,
2215- accountSettings : settings ,
2275+ accountSettings : templateAccountSettingsModel ,
22162276 }
22172277 try {
22182278 const res = await iamIdentityService . updateAccountSettingsTemplateVersion ( params ) ;
@@ -2312,18 +2372,46 @@ test('createApiKey request example', async () => {
23122372 originalLog ( 'createNewAccountSettingsTemplateVersion() result:' ) ;
23132373
23142374 // begin-create_account_settings_template_version
2315- const settings = {
2316- mfa : "LEVEL1" ,
2317- system_access_token_expiration_in_seconds : "2600" ,
2318- restrict_create_platform_apikey : "RESTRICTED" ,
2319- restrict_create_service_id : "RESTRICTED" ,
2320- }
2375+ // UserMfa
2376+ const userMfaModel = {
2377+ iam_id : iamId ,
2378+ mfa : 'LEVEL1' ,
2379+ } ;
2380+
2381+ // AccountSettingsUserDomainRestriction
2382+ const accountSettingsUserDomainRestrictionModel = {
2383+ realm_id : 'IBMid' ,
2384+ invitation_email_allow_patterns : [ "*.*@sap.com" ] ,
2385+ restrict_invitation : false ,
2386+ } ;
2387+
2388+ // TemplateAccountSettingsRestrictUserDomains
2389+ const templateAccountSettingsRestrictUserDomainsModel = {
2390+ account_sufficient : false ,
2391+ restrictions : [ accountSettingsUserDomainRestrictionModel ] ,
2392+ } ;
2393+
2394+ // TemplateAccountSettings
2395+ const templateAccountSettingsModel = {
2396+ restrict_create_service_id : 'NOT_SET' ,
2397+ restrict_create_platform_apikey : 'NOT_SET' ,
2398+ mfa : 'LEVEL1' ,
2399+ user_mfa : [ userMfaModel ] ,
2400+ session_expiration_in_seconds : '72400' ,
2401+ session_invalidation_in_seconds : '6000' ,
2402+ max_sessions_per_identity : '5' ,
2403+ system_access_token_expiration_in_seconds : '3000' ,
2404+ system_refresh_token_expiration_in_seconds : '59200' ,
2405+ restrict_user_list_visibility : 'RESTRICTED' ,
2406+ restrict_user_domains : templateAccountSettingsRestrictUserDomainsModel ,
2407+ } ;
2408+
23212409 const templateParams = {
23222410 templateId : accountSettingsTemplateId ,
23232411 name : accountSettingsTemplateName ,
23242412 description : "IAM enterprise account settings template example - new version" ,
23252413 accountId : enterpriseAccountId ,
2326- accountSettings : settings ,
2414+ accountSettings : templateAccountSettingsModel ,
23272415 }
23282416
23292417 try {
0 commit comments