diff --git a/examples/iam-policy-management.v1.test.js b/examples/iam-policy-management.v1.test.js index 3200374..b465507 100644 --- a/examples/iam-policy-management.v1.test.js +++ b/examples/iam-policy-management.v1.test.js @@ -82,6 +82,10 @@ describe('IamPolicyManagementV1', () => { let exampleRoleTemplateVersion; let exampleRoleAssignmentId; let exampleRoleAssignmentETag; + let exampleRolePolicyTemplateId; + const exampleCustomRoleName = 'TestNodeRole'; + const exampleCustomRoleDisplayName = 'SDK TestNodeRole'; + const exampleCustomRoleDescription = 'SDK TestNodeRole'; // begin-common @@ -1895,9 +1899,18 @@ describe('IamPolicyManagementV1', () => { originalLog('createRoleTemplate() result:'); // begin-create_role_template + const templateRoleModel = { + name: exampleCustomRoleName, + display_name: exampleCustomRoleDisplayName, + service_name: 'am-test-service', + description: exampleCustomRoleDescription, + actions: ['am-test-service.test.create'], + }; + const params = { name: exampleRoleTemplateName, accountId: exampleAccountId, + role: templateRoleModel, }; let res; @@ -1957,9 +1970,7 @@ describe('IamPolicyManagementV1', () => { // TemplateRole const templateRoleModel = { - name: 'GOSDKTestRoleReplace', display_name: 'GOSDKTestRoleReplaceDisplay', - service_name: 'am-test-service', actions: ['am-test-service.test.delete'], }; @@ -2030,9 +2041,7 @@ describe('IamPolicyManagementV1', () => { // TemplateRole const templateRoleModel = { - name: 'GOSDKTestRoleVersionTemplate', display_name: 'GOSDKTestRoleVersionTemplateDisplay', - service_name: 'am-test-service', actions: ['am-test-service.test.create'], }; @@ -2139,6 +2148,79 @@ describe('IamPolicyManagementV1', () => { // end-commit_role_template }); + test('createRolePolicyTemplate request example', async () => { + expect(exampleAccountId).not.toBeNull(); + consoleLogMock.mockImplementation((output) => { + originalLog(output); + }); + consoleWarnMock.mockImplementation((output) => { + // if an error occurs, display the message and then fail the test + originalWarn(output); + expect(true).toBeFalsy(); + }); + + originalLog('createRolePolicyTemplate() result:'); + // begin-create_policy_template + + // Request models needed by this operation. + + // V2PolicyResourceAttribute + const v2PolicyResourceAttributeModel = { + key: 'serviceName', + operator: 'stringEquals', + value: 'am-test-service', + }; + + // V2PolicyResource + const v2PolicyResourceModel = { + attributes: [v2PolicyResourceAttributeModel], + }; + + // Roles + const rolesModel = { + role_id: 'crn:v1:bluemix:public:iam::::role:Viewer', + }; + + // Role template references + const roleTemplateReferencesModel = { + id: exampleRoleTemplateId, + version: exampleRoleTemplateVersion, + }; + + // Grant + const grantModel = { + roles: [rolesModel], + role_template_references: [roleTemplateReferencesModel], + }; + + // Control + const controlModel = { + grant: grantModel, + }; + + // TemplatePolicy + const templatePolicyModel = { + type: 'access', + resource: v2PolicyResourceModel, + control: controlModel, + }; + + const params = { + name: 'SDKNodeExampleTemplate', + accountId: exampleAccountId, + policy: templatePolicyModel, + }; + + try { + const res = await iamPolicyManagementService.createPolicyTemplate(params); + exampleRolePolicyTemplateId = res.result.id; + console.log(JSON.stringify(res.result, null, 2)); + } catch (err) { + console.warn(err); + } + + // end-create_policy_template + }); test('createRoleTemplateAssignment request example', async () => { consoleLogMock.mockImplementation((output) => { originalLog(output); @@ -2296,6 +2378,31 @@ describe('IamPolicyManagementV1', () => { // end-delete_role_assignment }); + test('deleteRolePolicyTemplate request example', async () => { + expect(exampleRolePolicyTemplateId).not.toBeNull(); + consoleLogMock.mockImplementation((output) => { + originalLog(output); + }); + consoleWarnMock.mockImplementation((output) => { + // if an error occurs, display the message and then fail the test + originalWarn(output); + expect(true).toBeFalsy(); + }); + + // begin-delete_role_policy_template + + const params = { + policyTemplateId: exampleRolePolicyTemplateId, + }; + + try { + await iamPolicyManagementService.deletePolicyTemplate(params); + } catch (err) { + console.warn(err); + } + + // end-delete_policy_template + }); test('deleteRoleTemplateVersion request example', async () => { consoleLogMock.mockImplementation((output) => { originalLog(output); diff --git a/iam-policy-management/v1.ts b/iam-policy-management/v1.ts index b362d34..d7dfbec 100644 --- a/iam-policy-management/v1.ts +++ b/iam-policy-management/v1.ts @@ -15,7 +15,7 @@ */ /** - * IBM OpenAPI SDK Code Generator Version: 3.107.1-41b0fbd0-20250825-080732 + * IBM OpenAPI SDK Code Generator Version: 3.103.0-e8b84313-20250402-201816 */ /* eslint-disable max-classes-per-file */ @@ -2134,9 +2134,9 @@ class IamPolicyManagementV1 extends BaseService { * @param {Object} params - The parameters to send to the service. * @param {string} params.policyTemplateId - The policy template ID. * @param {string} params.version - The policy template version. - * @param {string} params.ifMatch - The revision number for updating a policy template version and must match the ETag + * @param {string} params.ifMatch - The revision number for updating a policy template version and must match the Etag * value of the existing policy template version. The Etag can be retrieved using the GET - * /v1/policy_templates/{policy_template_id}/versions/{version} API and looking at the ETag response header. + * /v1/policy_templates/{policy_template_id}/versions/{version} API and looking at the Etag response header. * @param {TemplatePolicy} params.policy - The core set of properties associated with the template's policy object. * @param {string} [params.name] - Required field when creating a new template. Otherwise, this field is optional. If * the field is included, it changes the name value for all existing versions of the template. @@ -4085,8 +4085,8 @@ class IamPolicyManagementV1 extends BaseService { * account. Use this to describe the purpose or context of the role for enterprise users managing IAM templates. * @param {boolean} [params.committed] - Committed status of the template. If committed is set to true, then the * template version can no longer be updated. - * @param {TemplateRole} [params.role] - The role properties that are created in an action resource when the template - * is assigned. + * @param {RoleTemplatePrototypeRole} [params.role] - The role properties that are created in an action resource when + * the template is assigned. * @param {string} [params.acceptLanguage] - Language code for translations * * `default` - English * * `de` - German (Standard) @@ -4282,12 +4282,12 @@ class IamPolicyManagementV1 extends BaseService { * * @param {Object} params - The parameters to send to the service. * @param {string} params.roleTemplateId - The role template ID. - * @param {TemplateRole} params.role - The role properties that are created in an action resource when the template is - * assigned. * @param {string} [params.name] - Required field when creating a new template. Otherwise, this field is optional. If * the field is included, it will change the name value for all existing versions of the template. * @param {string} [params.description] - Description of the role template. This is shown to users in the enterprise * account. Use this to describe the purpose or context of the role for enterprise users managing IAM templates. + * @param {TemplateRole} [params.role] - The role properties that are created in an action resource when the template + * is assigned. * @param {boolean} [params.committed] - Committed status of the template version. If committed is set to true, then * the template version can no longer be updated. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers @@ -4297,12 +4297,12 @@ class IamPolicyManagementV1 extends BaseService { params: IamPolicyManagementV1.CreateRoleTemplateVersionParams ): Promise> { const _params = { ...params }; - const _requiredParams = ['roleTemplateId', 'role']; + const _requiredParams = ['roleTemplateId']; const _validParams = [ 'roleTemplateId', - 'role', 'name', 'description', + 'role', 'committed', 'signal', 'headers', @@ -4313,9 +4313,9 @@ class IamPolicyManagementV1 extends BaseService { } const body = { - 'role': _params.role, 'name': _params.name, 'description': _params.description, + 'role': _params.role, 'committed': _params.committed, }; @@ -4433,12 +4433,12 @@ class IamPolicyManagementV1 extends BaseService { * @param {string} params.ifMatch - The revision number for updating a role template version must match the Etag value * of the existing role template version. The Etag can be retrieved using the GET * /v1/role_templates/{template_id}/versions/{version} API and looking at the Etag response header. - * @param {TemplateRole} params.role - The role properties that are created in an action resource when the template is - * assigned. * @param {string} [params.name] - Required field when creating a new template. Otherwise, this field is optional. If * the field is included, it will change the name value for all existing versions of the template. * @param {string} [params.description] - Description of the role template. This is shown to users in the enterprise * account. Use this to describe the purpose or context of the role for enterprise users managing IAM templates. + * @param {TemplateRole} [params.role] - The role properties that are created in an action resource when the template + * is assigned. * @param {boolean} [params.committed] - Committed status of the template version. If committed is set to true, then * the template version can no longer be updated. * @param {OutgoingHttpHeaders} [params.headers] - Custom request headers @@ -4448,14 +4448,14 @@ class IamPolicyManagementV1 extends BaseService { params: IamPolicyManagementV1.ReplaceRoleTemplateParams ): Promise> { const _params = { ...params }; - const _requiredParams = ['roleTemplateId', 'version', 'ifMatch', 'role']; + const _requiredParams = ['roleTemplateId', 'version', 'ifMatch']; const _validParams = [ 'roleTemplateId', 'version', 'ifMatch', - 'role', 'name', 'description', + 'role', 'committed', 'signal', 'headers', @@ -4466,9 +4466,9 @@ class IamPolicyManagementV1 extends BaseService { } const body = { - 'role': _params.role, 'name': _params.name, 'description': _params.description, + 'role': _params.role, 'committed': _params.committed, }; @@ -5644,9 +5644,9 @@ namespace IamPolicyManagementV1 { policyTemplateId: string; /** The policy template version. */ version: string; - /** The revision number for updating a policy template version and must match the ETag value of the existing + /** The revision number for updating a policy template version and must match the Etag value of the existing * policy template version. The Etag can be retrieved using the GET - * /v1/policy_templates/{policy_template_id}/versions/{version} API and looking at the ETag response header. + * /v1/policy_templates/{policy_template_id}/versions/{version} API and looking at the Etag response header. */ ifMatch: string; /** The core set of properties associated with the template's policy object. */ @@ -6123,7 +6123,7 @@ namespace IamPolicyManagementV1 { */ committed?: boolean; /** The role properties that are created in an action resource when the template is assigned. */ - role?: TemplateRole; + role?: RoleTemplatePrototypeRole; /** Language code for translations * * `default` - English * * `de` - German (Standard) @@ -6167,8 +6167,6 @@ namespace IamPolicyManagementV1 { export interface CreateRoleTemplateVersionParams extends DefaultParams { /** The role template ID. */ roleTemplateId: string; - /** The role properties that are created in an action resource when the template is assigned. */ - role: TemplateRole; /** Required field when creating a new template. Otherwise, this field is optional. If the field is included, it * will change the name value for all existing versions of the template. */ @@ -6177,6 +6175,8 @@ namespace IamPolicyManagementV1 { * purpose or context of the role for enterprise users managing IAM templates. */ description?: string; + /** The role properties that are created in an action resource when the template is assigned. */ + role?: TemplateRole; /** Committed status of the template version. If committed is set to true, then the template version can no * longer be updated. */ @@ -6215,8 +6215,6 @@ namespace IamPolicyManagementV1 { * API and looking at the Etag response header. */ ifMatch: string; - /** The role properties that are created in an action resource when the template is assigned. */ - role: TemplateRole; /** Required field when creating a new template. Otherwise, this field is optional. If the field is included, it * will change the name value for all existing versions of the template. */ @@ -6225,6 +6223,8 @@ namespace IamPolicyManagementV1 { * purpose or context of the role for enterprise users managing IAM templates. */ description?: string; + /** The role properties that are created in an action resource when the template is assigned. */ + role?: TemplateRole; /** Committed status of the template version. If committed is set to true, then the template version can no * longer be updated. */ @@ -7339,7 +7339,7 @@ namespace IamPolicyManagementV1 { } /** - * On success, it includes the action control assigned. + * On success, it includes the role assigned. */ export interface RoleAssignmentResourceCreated { /** role id. */ @@ -7350,7 +7350,7 @@ namespace IamPolicyManagementV1 { * Set of properties of the assigned resource or error message if assignment failed. */ export interface RoleAssignmentResourceRole { - /** On success, it includes the action control assigned. */ + /** On success, it includes the role assigned. */ resource_created?: RoleAssignmentResourceCreated; /** Body parameters for assignment error. */ error_message?: AssignmentResourceError; @@ -7397,7 +7397,7 @@ namespace IamPolicyManagementV1 { */ committed?: boolean; /** The role properties that are created in an action resource when the template is assigned. */ - role?: TemplateRole; + role?: RoleTemplatePrototypeRole; /** The role template ID. */ id?: string; /** The href URL that links to the role templates API by role template ID. */ @@ -7441,6 +7441,32 @@ namespace IamPolicyManagementV1 { role_templates: RoleTemplate[]; } + /** + * The role properties that are created in an action resource when the template is assigned. + */ + export interface RoleTemplatePrototypeRole { + /** The name of the role that is used in the CRN. This must be alphanumeric and capitalized. */ + name: string; + /** The display the name of the role that is shown in the console. */ + display_name: string; + /** The service name that the role refers. */ + service_name?: string; + /** Description of the role. */ + description?: string; + /** The actions of the role. */ + actions: string[]; + } + + /** + * A role template reference associated with a policy template. + */ + export interface RoleTemplateReferencesItem { + /** The role template ID. */ + id: string; + /** Role template version. */ + version: string; + } + /** * A collection of versions for a specific role template. */ @@ -7530,6 +7556,14 @@ namespace IamPolicyManagementV1 { actions: string[]; } + /** + * Specifies the type of access that is granted by the policy. + */ + export interface TemplateControl { + /** Permission is granted by the policy. */ + grant: TemplateGrant; + } + /** * policy template count details. */ @@ -7540,6 +7574,11 @@ namespace IamPolicyManagementV1 { version?: LimitData; } + /** + * Permission is granted by the policy. + */ + export interface TemplateGrant {} + /** * The details of the IAM template that was used to create an enterprise-managed policy in your account. When * returned, this indicates that the policy is created from and managed by a template in the root enterprise account. @@ -7578,7 +7617,7 @@ namespace IamPolicyManagementV1 { /** Additional access conditions associated with the policy. */ rule?: V2PolicyRule; /** Specifies the type of access that is granted by the policy. */ - control?: Control; + control?: TemplateControl; } export namespace TemplatePolicy { export namespace Constants { @@ -7594,12 +7633,10 @@ namespace IamPolicyManagementV1 { * The role properties that are created in an action resource when the template is assigned. */ export interface TemplateRole { - /** The name of the role that is used in the CRN. This must be alphanumeric and capitalized. */ - name: string; /** The display the name of the role that is shown in the console. */ display_name: string; /** The service name that the role refers. */ - service_name: string; + service_name?: string; /** Description of the role. */ description?: string; /** The actions of the role. */ @@ -8005,6 +8042,22 @@ namespace IamPolicyManagementV1 { } } + /** + * TemplateGrantRoleReferences. + */ + export interface TemplateGrantRoleReferences extends TemplateGrant { + /** A set of role template reference IDs granted by the policy. */ + role_template_references: RoleTemplateReferencesItem[]; + } + + /** + * TemplateGrantRoles. + */ + export interface TemplateGrantRoles extends TemplateGrant { + /** A set of role Cloud Resource Names (CRNs) granted by the policy. */ + roles: Roles[]; + } + /** * Rule that specifies additional access that is granted (For example, time-based condition). */ diff --git a/test/integration/iam-policy-management.v1.test.js b/test/integration/iam-policy-management.v1.test.js index 974653a..70f28f7 100644 --- a/test/integration/iam-policy-management.v1.test.js +++ b/test/integration/iam-policy-management.v1.test.js @@ -163,6 +163,7 @@ describe('IamPolicyManagementV1_integration', () => { let testRoleTemplateId; let testRoleTemplateVersion; let testRoleTemplateETag; + let testRolePolicyTemplateId; const testTemplatePolicy = { type: 'access', description: 'SDK Test Policy', @@ -1699,9 +1700,9 @@ describe('IamPolicyManagementV1_integration', () => { const templateRoleModel = { name: testCustomRoleName, display_name: testCustomRoleDisplayName, - service_name: testServiceName, + service_name: 'am-test-service', description: testCustomRoleDescription, - actions: testCustomRoleActions, + actions: ['am-test-service.test.create'], }; const params = { @@ -1722,6 +1723,50 @@ describe('IamPolicyManagementV1_integration', () => { testRoleTemplateETag = res.headers.etag; }); + test('createRolePolicyTemplate()', async () => { + const testRolePolicyTemplate = { + ...testTemplatePolicy, + resource: { + attributes: [ + { + key: 'serviceName', + operator: 'stringEquals', + value: 'am-test-service', + }, + ], + }, + control: { + grant: { + roles: policyRoles, + role_template_references: [ + { + id: testRoleTemplateId, + version: testRoleTemplateVersion, + }, + ], + }, + }, + }; + const testTemplateDescription = 'SDK Test template with viewer role'; + const params = { + name: testTemplateName, + accountId: testAccountId, + policy: testRolePolicyTemplate, + description: testTemplateDescription, + }; + + const response = await service.createPolicyTemplate(params); + expect(response).toBeDefined(); + expect(response.status).toEqual(201); + const { result } = response || {}; + expect(result).toBeDefined(); + expect(result.policy).toEqual(testRolePolicyTemplate); + expect(result.name).toEqual(testTemplateName); + expect(result.description).toEqual(testTemplateDescription); + expect(result.state).toEqual('active'); + testRolePolicyTemplateId = result.id; + }); + test('getRoleTemplate()', async () => { const params = { roleTemplateId: testRoleTemplateId, @@ -1739,9 +1784,7 @@ describe('IamPolicyManagementV1_integration', () => { // TemplateRole const templateRoleModel = { - name: `${testCustomRoleName}Updated`, display_name: `${testCustomRoleDisplayName} Updated`, - service_name: 'am-test-service', description: 'am-test-service service customRole', actions: ['am-test-service.test.delete'], }; @@ -1801,9 +1844,7 @@ describe('IamPolicyManagementV1_integration', () => { // TemplateRole const templateRoleModel = { - name: `${testCustomRoleName}ver`, display_name: `${testCustomRoleDisplayName}TemplateVersion`, - service_name: 'am-test-service', description: 'am-test-service versioon customRole', actions: ['am-test-service.test.create'], }; @@ -1950,6 +1991,17 @@ describe('IamPolicyManagementV1_integration', () => { expect(res.result).toBeDefined(); }); + test('deleteRolePolicyTemplate()', async () => { + const params = { + policyTemplateId: testRolePolicyTemplateId, + }; + + const res = await service.deletePolicyTemplate(params); + expect(res).toBeDefined(); + expect(res.status).toBe(204); + expect(res.result).toBeDefined(); + }); + test('deleteRoleTemplateVersion()', async () => { const params = { roleTemplateId: testRoleTemplateId, diff --git a/test/unit/iam-policy-management.v1.test.js b/test/unit/iam-policy-management.v1.test.js index 5b46dda..5dbbf70 100644 --- a/test/unit/iam-policy-management.v1.test.js +++ b/test/unit/iam-policy-management.v1.test.js @@ -2240,14 +2240,14 @@ describe('IamPolicyManagementV1', () => { role_id: 'testString', }; - // Grant - const grantModel = { + // TemplateGrantRoles + const templateGrantModel = { roles: [rolesModel], }; - // Control - const controlModel = { - grant: grantModel, + // TemplateControl + const templateControlModel = { + grant: templateGrantModel, }; // TemplatePolicy @@ -2258,7 +2258,7 @@ describe('IamPolicyManagementV1', () => { subject: v2PolicySubjectModel, pattern: 'testString', rule: v2PolicyRuleModel, - control: controlModel, + control: templateControlModel, }; function __createPolicyTemplateTest() { @@ -2581,14 +2581,14 @@ describe('IamPolicyManagementV1', () => { role_id: 'testString', }; - // Grant - const grantModel = { + // TemplateGrantRoles + const templateGrantModel = { roles: [rolesModel], }; - // Control - const controlModel = { - grant: grantModel, + // TemplateControl + const templateControlModel = { + grant: templateGrantModel, }; // TemplatePolicy @@ -2599,7 +2599,7 @@ describe('IamPolicyManagementV1', () => { subject: v2PolicySubjectModel, pattern: 'testString', rule: v2PolicyRuleModel, - control: controlModel, + control: templateControlModel, }; function __createPolicyTemplateVersionTest() { @@ -2891,14 +2891,14 @@ describe('IamPolicyManagementV1', () => { role_id: 'testString', }; - // Grant - const grantModel = { + // TemplateGrantRoles + const templateGrantModel = { roles: [rolesModel], }; - // Control - const controlModel = { - grant: grantModel, + // TemplateControl + const templateControlModel = { + grant: templateGrantModel, }; // TemplatePolicy @@ -2909,7 +2909,7 @@ describe('IamPolicyManagementV1', () => { subject: v2PolicySubjectModel, pattern: 'testString', rule: v2PolicyRuleModel, - control: controlModel, + control: templateControlModel, }; function __replacePolicyTemplateTest() { @@ -5782,8 +5782,8 @@ describe('IamPolicyManagementV1', () => { describe('positive tests', () => { // Request models needed by this operation. - // TemplateRole - const templateRoleModel = { + // RoleTemplatePrototypeRole + const roleTemplatePrototypeRoleModel = { name: 'testString', display_name: 'testString', service_name: 'testString', @@ -5797,7 +5797,7 @@ describe('IamPolicyManagementV1', () => { const accountId = 'testString'; const description = 'testString'; const committed = true; - const role = templateRoleModel; + const role = roleTemplatePrototypeRoleModel; const acceptLanguage = 'default'; const createRoleTemplateParams = { name, @@ -6067,7 +6067,6 @@ describe('IamPolicyManagementV1', () => { // TemplateRole const templateRoleModel = { - name: 'testString', display_name: 'testString', service_name: 'testString', description: 'testString', @@ -6077,15 +6076,15 @@ describe('IamPolicyManagementV1', () => { function __createRoleTemplateVersionTest() { // Construct the params object for operation createRoleTemplateVersion const roleTemplateId = 'testString'; - const role = templateRoleModel; const name = 'testString'; const description = 'testString'; + const role = templateRoleModel; const committed = true; const createRoleTemplateVersionParams = { roleTemplateId, - role, name, description, + role, committed, }; @@ -6103,9 +6102,9 @@ describe('IamPolicyManagementV1', () => { const expectedAccept = 'application/json'; const expectedContentType = 'application/json'; checkMediaHeaders(createRequestMock, expectedAccept, expectedContentType); - expect(mockRequestOptions.body.role).toEqual(role); expect(mockRequestOptions.body.name).toEqual(name); expect(mockRequestOptions.body.description).toEqual(description); + expect(mockRequestOptions.body.role).toEqual(role); expect(mockRequestOptions.body.committed).toEqual(committed); expect(mockRequestOptions.path.role_template_id).toEqual(roleTemplateId); } @@ -6128,12 +6127,10 @@ describe('IamPolicyManagementV1', () => { test('should prioritize user-given headers', () => { // parameters const roleTemplateId = 'testString'; - const role = templateRoleModel; const userAccept = 'fake/accept'; const userContentType = 'fake/contentType'; const createRoleTemplateVersionParams = { roleTemplateId, - role, headers: { Accept: userAccept, 'Content-Type': userContentType, @@ -6321,7 +6318,6 @@ describe('IamPolicyManagementV1', () => { // TemplateRole const templateRoleModel = { - name: 'testString', display_name: 'testString', service_name: 'testString', description: 'testString', @@ -6333,17 +6329,17 @@ describe('IamPolicyManagementV1', () => { const roleTemplateId = 'testString'; const version = 'testString'; const ifMatch = 'testString'; - const role = templateRoleModel; const name = 'testString'; const description = 'testString'; + const role = templateRoleModel; const committed = true; const replaceRoleTemplateParams = { roleTemplateId, version, ifMatch, - role, name, description, + role, committed, }; @@ -6362,9 +6358,9 @@ describe('IamPolicyManagementV1', () => { const expectedContentType = 'application/json'; checkMediaHeaders(createRequestMock, expectedAccept, expectedContentType); checkUserHeader(createRequestMock, 'If-Match', ifMatch); - expect(mockRequestOptions.body.role).toEqual(role); expect(mockRequestOptions.body.name).toEqual(name); expect(mockRequestOptions.body.description).toEqual(description); + expect(mockRequestOptions.body.role).toEqual(role); expect(mockRequestOptions.body.committed).toEqual(committed); expect(mockRequestOptions.path.role_template_id).toEqual(roleTemplateId); expect(mockRequestOptions.path.version).toEqual(version); @@ -6390,14 +6386,12 @@ describe('IamPolicyManagementV1', () => { const roleTemplateId = 'testString'; const version = 'testString'; const ifMatch = 'testString'; - const role = templateRoleModel; const userAccept = 'fake/accept'; const userContentType = 'fake/contentType'; const replaceRoleTemplateParams = { roleTemplateId, version, ifMatch, - role, headers: { Accept: userAccept, 'Content-Type': userContentType,