@@ -73,7 +73,10 @@ def __init__(self, session, object_factory):
7373 self ._object_factory = object_factory
7474 {% if "list" in methods % }
7575 @generator_container
76- def list (self , {% for qp in query_parameters - % }
76+ def list (self , {% for up in url_parameters - % }
77+ {{ up ['name' ] }},
78+ {% endfor - % }
79+ {% for qp in query_parameters - % }
7780 {{ qp ['name' ] }}{% if qp ['optional' ] % }= None {% endif % },
7881 {% endfor - % }
7982 headers = {},
@@ -94,6 +97,9 @@ def list(self, {% for qp in query_parameters -%}
9497 container.
9598
9699 Args:
100+ {% for up in url_parameters -%}
101+ {{ up['name'] }} ({{ up['type']}}): {{ up['description']}}
102+ {% endfor -%}
97103 {% for qp in query_parameters -%}
98104 {{ qp['name'] }} ({{ qp['type']}}): {{ qp['description']}}
99105 {% endfor -%}
@@ -110,6 +116,9 @@ def list(self, {% for qp in query_parameters -%}
110116 ApiError: If the Webex Teams cloud returns an error.
111117
112118 """
119+ {% for up in url_parameters - % }
120+ check_type ({{ up ['name' ] }}, {{ up ['type' ] }})
121+ {% endfor - % }
113122 {% for qp in query_parameters - % }
114123 check_type ({{ qp ['name' ] }}, {{ qp ['type' ] }}{% if qp ['optional' ] % }, optional = True {% endif % })
115124 {% endfor % }
@@ -126,12 +135,22 @@ def list(self, {% for qp in query_parameters -%}
126135 params ['{{qp[' requestName ']}}' ] = params .pop ("{{ qp['name'] }}" )
127136 {% endif % }
128137 {% - endfor % }
138+ {% - if url_parameters % }
139+ {% - set ups = [] - % }
140+ {% for up in url_parameters | map (attribute = 'name' ) - % }
141+ {% set ups = ups .append ( up + "=" + up ) % }
142+ {% - endfor % }
143+ # Add URL parameters to the API endpoint
144+ request_url = API_ENDPOINT .format ({{ ups | join (", " ) }})
145+ {% else % }
146+ request_url = API_ENDPOINT
147+ {% endif % }
129148 # API request - get items
130149
131150 # Update headers
132151 for k , v in headers .items ():
133152 self ._session .headers [k ] = v
134- items = self ._session .get_items (API_ENDPOINT , params = params )
153+ items = self ._session .get_items (request_url , params = params )
135154
136155 # Remove headers
137156 for k , v in headers .items ():
@@ -142,14 +161,20 @@ def list(self, {% for qp in query_parameters -%}
142161 yield self ._object_factory (OBJECT_TYPE , item )
143162 {% endif % }
144163 {% if "create" in methods % }
145- def create (self , {% for cp in create_parameters - % }
146- {{ cp ['name' ] }}{% if cp ['optional' ] % }= None {% endif % },
164+ def create (self , {% for up in url_parameters - % }
165+ {{ up ['name' ] }},
166+ {% endfor - % }
167+ {% for cp in create_parameters - % }
168+ {{ cp ['name' ] }}{% if cp ['optional' ] % }= None {% endif % },
147169 {% endfor - % }
148170
149171 ** request_parameters ):
150172 """Create a {{ object_type }}.
151173
152174 Args:
175+ {% for up in url_parameters -%}
176+ {{ up['name'] }} ({{ up['type']}}): {{ up['description']}}
177+ {% endfor -%}
153178 {% for cp in create_parameters -%}
154179 {{ cp['name'] }} ({{ cp['type']}}): {{ cp['description']}}
155180 {% endfor -%}
@@ -165,6 +190,9 @@ def create(self, {% for cp in create_parameters -%}
165190 ApiError: If the Webex Teams cloud returns an error.
166191
167192 """
193+ {% for up in url_parameters - % }
194+ check_type ({{ up ['name' ] }}, {{ up ['type' ] }})
195+ {% endfor - % }
168196 {% for cp in create_parameters - % }
169197 check_type ({{ cp ['name' ] }}, {{ cp ['type' ] }}{% if cp ['optional' ] % }, optional = True {% endif % })
170198 {% endfor % }
@@ -181,18 +209,31 @@ def create(self, {% for cp in create_parameters -%}
181209 post_data ['{{cp[' requestName ']}}' ] = post_data .pop ("{{ cp['name'] }}" )
182210 {% endif % }
183211 {% - endfor % }
212+ {% - if url_parameters % }
213+ {% - set ups = [] - % }
214+ {% for up in url_parameters | map (attribute = 'name' ) - % }
215+ {% set ups = ups .append ( up + "=" + up ) % }
216+ {% - endfor % }
217+ # Add URL parameters to the API endpoint
218+ request_url = API_ENDPOINT .format ({{ ups | join (", " ) }})
219+ {% else % }
220+ request_url = API_ENDPOINT
221+ {% endif % }
184222 # API request
185- json_data = self ._session .post (API_ENDPOINT , json = post_data )
223+ json_data = self ._session .post (request_url , json = post_data )
186224
187225 # Return a membership object created from the response JSON data
188226 return self ._object_factory (OBJECT_TYPE , json_data )
189227 {% endif % }
190228
191229 {% if "get" in methods % }
192- def get (self , {{ object_type }}Id ):
230+ def get (self , {% for up in url_parameters % }{{ up [ 'name' ]}}, { % endfor % }{ { object_type }}Id ):
193231 """Get details for a {{ object_type }}, by ID.
194232
195233 Args:
234+ {% for up in url_parameters -%}
235+ {{up['name']}} ({{ up['type']}}): {{ up['description']}}
236+ {% endfor -%}
196237 {{ object_type }}Id(basestring): The {{ object_type }} ID.
197238
198239 Returns:
@@ -204,35 +245,64 @@ def get(self, {{ object_type }}Id):
204245 ApiError: If the Webex Teams cloud returns an error.
205246
206247 """
248+ {% for up in url_parameters - % }
249+ check_type ({{ up ['name' ] }}, {{ up ['type' ] }})
250+ {% endfor - % }
207251 check_type ({{ object_type }}Id , basestring )
208-
252+ {% - if url_parameters % }
253+ {% - set ups = [] - % }
254+ {% for up in url_parameters | map (attribute = 'name' ) - % }
255+ {% set ups = ups .append ( up + "=" + up ) % }
256+ {% - endfor % }
257+
258+ # Add URL parameters to the API endpoint
259+ request_url = API_ENDPOINT .format ({{ ups | join (", " ) }})
260+ {% else % }
261+ request_url = API_ENDPOINT
262+ {% endif % }
209263 # API request
210- json_data = self ._session .get (API_ENDPOINT + '/' + {{ object_type }}Id )
264+ json_data = self ._session .get (request_url + '/' + {{ object_type }}Id )
211265
212266 # Return a membership object created from the response JSON data
213267 return self ._object_factory (OBJECT_TYPE , json_data )
214268 {% endif % }
215269
216270 {% if "delete" in methods % }
217- def delete (self , {{ object_type }}Id ):
271+ def delete (self , {% for up in url_parameters % }{{ up [ 'name' ]}}, { % endfor % }{ { object_type }}Id ):
218272 """Delete a {{ object_type }}, by ID.
219273
220274 Args:
275+ {% for up in url_parameters -%}
276+ {{up['name']}} ({{ up['type']}}): {{ up['description']}}
277+ {% endfor -%}
221278 {{ object_type }}Id(basestring): The {{ object_type }} ID.
222279
223280 Raises:
224281 TypeError: If the parameter types are incorrect.
225282 ApiError: If the Webex Teams cloud returns an error.
226283
227284 """
285+ {% for up in url_parameters - % }
286+ check_type ({{ up ['name' ] }}, {{ up ['type' ] }})
287+ {% endfor - % }
228288 check_type ({{ object_type }}Id , basestring )
229-
289+ {% - if url_parameters % }
290+ {% - set ups = [] - % }
291+ {% for up in url_parameters | map (attribute = 'name' ) - % }
292+ {% set ups = ups .append ( up + "=" + up ) % }
293+ {% - endfor % }
294+
295+ # Add URL parameters to the API endpoint
296+ request_url = API_ENDPOINT .format ({{ ups | join (", " ) }})
297+ {% else % }
298+ request_url = API_ENDPOINT
299+ {% endif % }
230300 # API request
231- self ._session .delete (API_ENDPOINT + '/' + {{ object_type }}Id )
301+ self ._session .delete (request_url + '/' + {{ object_type }}Id )
232302 {% endif % }
233303
234304 {% if "update" in methods % }
235- def update (self , {{ object_type }}Id ,
305+ def update (self , {% for up in url_parameters % }{{ up [ 'name' ]}}, { % endfor % }{ { object_type }}Id ,
236306 {% for up in update_parameters - % }
237307 {{ up ['name' ] }}{% if up ['optional' ] % }= None {% endif % },
238308 {% endfor - % }
@@ -241,6 +311,9 @@ def update(self, {{ object_type }}Id,
241311 """Update properties for a {{ object_type }}, by ID.
242312
243313 Args:
314+ {% for up in url_parameters -%}
315+ {{up['name']}} ({{ up['type']}}): {{ up['description']}}
316+ {% endfor -%}
244317 {{ object_type }}Id(basestring): The {{ object_type }} ID.
245318 {% for up in update_parameters -%}
246319 {{ up['name'] }} ({{ up['type']}}): {{ up['description']}}
@@ -258,6 +331,9 @@ def update(self, {{ object_type }}Id,
258331
259332 """
260333 check_type ({{ object_type }}Id , basestring )
334+ {% for up in url_parameters - % }
335+ check_type ({{ up ['name' ] }}, {{ up ['type' ] }})
336+ {% endfor - % }
261337 {% for up in update_parameters - % }
262338 check_type ({{ up ['name' ] }}, {{ up ['type' ] }}{% if up ['optional' ] % }, optional = True {% endif % })
263339 {% endfor % }
@@ -267,16 +343,24 @@ def update(self, {{ object_type }}Id,
267343 {{ up ['name' ] }}= {{ up ['name' ] }},
268344 {% endfor % }
269345 )
270-
271346 {% for up in update_parameters - % }
272347 {% if up ['requestName' ] % }
273348 if {{ up ['name' ] }}:
274349 put_data ['{{up[' requestName ']}}' ] = put_data .pop ("{{ up['name'] }}" )
275350 {% endif % }
276351 {% - endfor % }
277-
352+ {% - if url_parameters % }
353+ {% - set ups = [] - % }
354+ {% for up in url_parameters | map (attribute = 'name' ) - % }
355+ {% set ups = ups .append ( up + "=" + up ) % }
356+ {% - endfor % }
357+ # Add URL parameters to the API endpoint
358+ request_url = API_ENDPOINT .format ({{ ups | join (", " ) }})
359+ {% else % }
360+ request_url = API_ENDPOINT
361+ {% endif % }
278362 # API request
279- json_data = self ._session .put (API_ENDPOINT + '/' + {{ object_type }}Id ,
363+ json_data = self ._session .put (request_url + '/' + {{ object_type }}Id ,
280364 json = put_data )
281365
282366 # Return a membership object created from the response JSON data
0 commit comments