Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(IAM Identity): re-gen with latest API definition #195

Merged
merged 1 commit into from
Feb 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 87 additions & 7 deletions examples/iam-identity.v1.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ describe('IamIdentityV1', () => {
let accountSettingsEtag = null;

let reportReference = null;
let reportReferenceMfa=null;

test('createApiKey request example', async () => {

Expand Down Expand Up @@ -1013,14 +1014,14 @@ describe('IamIdentityV1', () => {
const params = {
ifMatch: accountSettingsEtag,
accountId: accountId,
restrict_create_service_id: "NOT_RESTRICTED",
restrict_create_platform_apikey: "NOT_RESTRICTED",
restrictCreateServiceId: "NOT_RESTRICTED",
restrictCreatePlatformApikey: "NOT_RESTRICTED",
mfa: "NONE",
userMfa,
session_expiration_in_seconds: "86400",
session_invalidation_in_seconds: "7200",
system_access_token_expiration_in_seconds: '3600',
system_refresh_token_expiration_in_seconds: '2592000',
sessionExpirationInSeconds: "86400",
sessionInvalidationInSeconds: "7200",
systemAccessTokenExpirationInSeconds: '3600',
systemRefreshTokenExpirationInSeconds: '259200',
};

try {
Expand Down Expand Up @@ -1054,7 +1055,7 @@ describe('IamIdentityV1', () => {
try {
const res = await iamIdentityService.createReport(params);
reportReference = res.reference;
console.log(JSON.stringify(reportReference, null, 2));
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
Expand Down Expand Up @@ -1086,4 +1087,83 @@ describe('IamIdentityV1', () => {
}
// end-get_report
});
test('createMfaReport request example', async () => {

consoleLogMock.mockImplementation(output => {
originalLog(output);
});
consoleWarnMock.mockImplementation(output => {
originalWarn(output);
expect(true).toBeFalsy();
});

originalLog('createMfaReport() result:');
// begin-create_mfa_report

const params = {
accountId: accountId,
type: 'mfa_status',
};

try {
const res = await iamIdentityService.createMfaReport(params);
reportReferenceMfa = res.result.reference;
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-create_mfa_report
});
test('getMfaReport request example', async () => {

consoleLogMock.mockImplementation(output => {
originalLog(output);
});
consoleWarnMock.mockImplementation(output => {
originalWarn(output);
expect(true).toBeFalsy();
});

originalLog('getMfaReport() result:');
// begin-get_mfa_report

const params = {
accountId: accountId,
reference: 'latest',
};

try {
const res = await iamIdentityService.getMfaReport(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-get_mfa_report
});
test('getMfaStatus request example', async () => {

consoleLogMock.mockImplementation(output => {
originalLog(output);
});
consoleWarnMock.mockImplementation(output => {
originalWarn(output);
expect(true).toBeFalsy();
});

originalLog('getMfaStatus() result:');
// begin-get_mfa_status

const params = {
accountId: accountId,
iamId: iamId,
};

try {
const res = await iamIdentityService.getMfaStatus(params);
console.log(JSON.stringify(res.result, null, 2));
} catch (err) {
console.warn(err);
}
// end-get_mfa_status
});
});
Loading