|
126 | 126 | " hr_member_role_id = '{{HRMemberRoleId}}'\n", |
127 | 127 | ")\n", |
128 | 128 | "\n", |
| 129 | + "hr_product_name = 'hr'\n", |
129 | 130 | "products: List[Product] = [\n", |
130 | | - " Product('hr', 'Human Resources', 'Product for Human Resources APIs providing access to employee data, organizational structure, benefits information, and HR management services. Includes JWT-based authentication for HR members.', 'published', False, False, hr_product_xml)\n", |
| 131 | + " Product(hr_product_name, 'Human Resources', 'Product for Human Resources APIs providing access to employee data, organizational structure, benefits information, and HR management services. Includes JWT-based authentication for HR members.', 'published', False, False, hr_product_xml)\n", |
131 | 132 | "]\n", |
132 | 133 | "\n", |
133 | 134 | "# 6) Define the APIs and their operations and policies\n", |
|
136 | 137 | "hremployees_api_path = f'/{api_prefix}employees'\n", |
137 | 138 | "hremployees_get = GET_APIOperation('Gets the employees', utils.read_policy_xml('./hr_get.xml'))\n", |
138 | 139 | "hremployees_post = POST_APIOperation('Creates a new employee', utils.read_policy_xml('./hr_post.xml'))\n", |
139 | | - "hremployees = API(f'{api_prefix}Employees', 'Employees Pro', hremployees_api_path, 'This is a Human Resources API for employee information', utils.read_policy_xml(DEFAULT_XML_POLICY_PATH), operations = [hremployees_get, hremployees_post], tags = tags, productNames = ['hr'])\n", |
| 140 | + "hremployees = API(f'{api_prefix}Employees', 'Employees Pro', hremployees_api_path, 'This is a Human Resources API for employee information', utils.read_policy_xml(DEFAULT_XML_POLICY_PATH), operations = [hremployees_get, hremployees_post], tags = tags, productNames = [hr_product_name])\n", |
140 | 141 | "\n", |
141 | 142 | "# Benefits (HR)\n", |
142 | 143 | "hrbenefits_api_path = f'/{api_prefix}benefits'\n", |
143 | 144 | "hrbenefits_get = GET_APIOperation('Gets employee benefits', utils.read_policy_xml('./hr_get.xml'))\n", |
144 | 145 | "hrbenefits_post = POST_APIOperation('Creates employee benefits', utils.read_policy_xml('./hr_post.xml'))\n", |
145 | | - "hrbenefits = API(f'{api_prefix}Benefits', 'Benefits Pro', hrbenefits_api_path, 'This is a Human Resources API for employee benefits', utils.read_policy_xml(DEFAULT_XML_POLICY_PATH), operations = [hrbenefits_get, hrbenefits_post], tags = tags, productNames = ['hr'])\n", |
| 146 | + "hrbenefits = API(f'{api_prefix}Benefits', 'Benefits Pro', hrbenefits_api_path, 'This is a Human Resources API for employee benefits', utils.read_policy_xml(DEFAULT_XML_POLICY_PATH), operations = [hrbenefits_get, hrbenefits_post], tags = tags, productNames = [hr_product_name])\n", |
146 | 147 | "\n", |
147 | 148 | "# APIs Array\n", |
148 | 149 | "apis: List[API] = [hremployees, hrbenefits]\n", |
|
171 | 172 | "bicep_parameters = {\n", |
172 | 173 | " 'apis': {'value': [api.to_dict() for api in apis]},\n", |
173 | 174 | " 'namedValues': {'value': [nv.to_dict() for nv in nvs]},\n", |
174 | | - " 'policyFragments': {'value': [pf.to_dict() for pf in pfs]}\n", |
| 175 | + " 'policyFragments': {'value': [pf.to_dict() for pf in pfs]},\n", |
| 176 | + " 'products': {'value': [product.to_dict() for product in products]}\n", |
175 | 177 | "}\n", |
176 | 178 | "\n", |
177 | 179 | "# 2) Infrastructure must be in place before samples can be layered on top\n", |
|
0 commit comments