Skip to content

Commit 35f6f27

Browse files
committed
fix ex26 and minor cleanup of unnecessary cast
1 parent b495915 commit 35f6f27

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

‎src/main/java/com/docusign/controller/examples/EG024ControllerPermissionCreate.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@ public EG024ControllerPermissionCreate(DSConfiguration config, Session session,
4141
@Override
4242
protected Object doWork(WorkArguments args, ModelMap model, HttpServletResponse response)
4343
throws ApiException, IOException {
44-
44+
4545
// Step 2. Construct your API headers
4646
AccountsApi accountsApi = createAccountsApi(session.getBasePath(), user.getAccessToken());
4747

4848
// Step 3. Construct your request body
4949
// We're Overloading the AccountSettings class with AccountSettingsPatch to include the signingUIVersion which is missing in the swagger spec at this time.
5050
Gson gson = new Gson();
5151
AccountRoleSettings settings = DsModelUtils.createDefaultRoleSettings();
52-
AccountRoleSettings newSettings = gson.fromJson(gson.toJson(settings), AccountRoleSettingsPatch.class);
53-
((AccountRoleSettingsPatch) newSettings).signingUiVersion("1");
52+
AccountRoleSettingsPatch newSettings = gson.fromJson(gson.toJson(settings), AccountRoleSettingsPatch.class);
53+
newSettings.signingUiVersion("1");
5454
PermissionProfile profile = new PermissionProfile()
5555
.permissionProfileName(args.getPermissionProfileName())
5656
.settings(newSettings);

‎src/main/java/com/docusign/controller/examples/EG026ControllerPermissionChangeSingleSetting.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ private static AccountRoleSettings changeRandomSettings(AccountRoleSettings sett
113113
// Change this value back to: gson.fromJson(gson.toJson(settings),
114114
// AccountRoleSettings.class);
115115
// as soon as the signinguiversion is added back to the swagger spec.
116-
AccountRoleSettings newSettings = gson.fromJson(gson.toJson(settings), AccountRoleSettingsPatch.class);
116+
// Also change the type back from AccountRoleSettingsPatch to AccountRoleSettings
117+
AccountRoleSettingsPatch newSettings = gson.fromJson(gson.toJson(settings), AccountRoleSettingsPatch.class);
118+
newSettings.signingUiVersion("1");
117119
Random random = new Random(System.currentTimeMillis());
118120

119121
return newSettings.canCreateWorkspaces(randomBool(random)).allowEnvelopeSending(randomBool(random))

0 commit comments

Comments
 (0)