Skip to content

Commit

Permalink
feat(IAM Identity): add support for inactivity reports (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
pooraniss-ibm authored Apr 6, 2022
1 parent 31ae04f commit ed2efa4
Show file tree
Hide file tree
Showing 4 changed files with 1,822 additions and 692 deletions.
59 changes: 59 additions & 0 deletions examples/iam-identity.v1.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ describe('IamIdentityV1', () => {

let accountSettingsEtag = null;

let reportReference = null;

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

consoleLogMock.mockImplementation(output => {
Expand Down Expand Up @@ -188,6 +190,7 @@ describe('IamIdentityV1', () => {

const params = {
id: apikeyId,
includeActivity: true,
};

try {
Expand Down Expand Up @@ -361,6 +364,7 @@ describe('IamIdentityV1', () => {

const params = {
id: svcId,
includeActivity: true,
};

try {
Expand Down Expand Up @@ -560,6 +564,7 @@ describe('IamIdentityV1', () => {

const params = {
profileId,
includeActivity: true,
};

try {
Expand Down Expand Up @@ -1016,4 +1021,58 @@ describe('IamIdentityV1', () => {

// end-updateAccountSettings
});
test('createReport request example', async () => {

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

originalLog('createReport() result:');
// begin-create_report

const params = {
accountId: accountId,
type: 'inactive',
duration: '120',
};

try {
const res = await iamIdentityService.createReport(params);
reportReference = res.reference;
console.log(JSON.stringify(reportReference, null, 2));
} catch (err) {
console.warn(err);
}
// end-create_report
});
test('getReport request example', async () => {

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

originalLog('getReport() result:');
// begin-get_report

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

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

0 comments on commit ed2efa4

Please sign in to comment.