@azure-tools/typespec-azure-resource-manager 0.37.0 → 0.37.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,7 +20,7 @@ model OperationListResult is Azure.Core.Page<Operation>;
20
20
  * Base model that defines common properties for all ARM resources.
21
21
  */
22
22
  @doc("Common properties for all ARM resources.")
23
- model ArmResource {
23
+ model ArmResource extends ArmResourceBase {
24
24
  @doc("Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}")
25
25
  @visibility("read")
26
26
  id: string;
@@ -36,6 +36,9 @@ model ArmResource {
36
36
  systemData?: SystemData;
37
37
  }
38
38
 
39
+ /** Base class used for type definitions */
40
+ model ArmResourceBase {}
41
+
39
42
  /**
40
43
  * The base tracked resource.
41
44
  */
@@ -216,13 +219,13 @@ model ErrorDetail {
216
219
  * @template TResource The type of the resource.
217
220
  */
218
221
  @resourceBaseParametersOf(TResource)
219
- model BaseParameters<TResource extends ArmResource> {
222
+ model BaseParameters<TResource extends ArmResourceBase> {
220
223
  ...ApiVersionParameter;
221
224
 
222
225
  // unless tenant or extension
223
226
  ...SubscriptionIdParameter;
224
227
 
225
- //unless tenant, subscription, resourceGroup, or extension
228
+ // deprecated, should not be used
226
229
  ...LocationParameter;
227
230
 
228
231
  // unless tenant, subscription, location, or extension
@@ -71,7 +71,7 @@ op ArmResourceListAtScope<
71
71
  @doc("Get a {name}", TResource)
72
72
  @get
73
73
  @armResourceRead(TResource)
74
- op ArmResourceRead<TResource extends ArmResource, TBaseParameters = BaseParameters<TResource>>(
74
+ op ArmResourceRead<TResource extends ArmResourceBase, TBaseParameters = BaseParameters<TResource>>(
75
75
  ...ResourceInstanceParameters<TResource, TBaseParameters>,
76
76
  ): ArmResponse<TResource> | ErrorResponse;
77
77
 
@@ -79,6 +79,7 @@ op ArmResourceRead<TResource extends ArmResource, TBaseParameters = BaseParamete
79
79
  * A long-running resource CreateOrUpdate (PUT)
80
80
  * @template TResource the resource being patched
81
81
  * @template TBaseParameters Optional. Allows overriding the operation parameters
82
+ * @template LroHeaders Optional. Allows overriding the lro headers returned on resource create
82
83
  */
83
84
  @autoRoute
84
85
  @doc("Create a {name}", TResource)
@@ -93,14 +94,18 @@ op ArmResourceRead<TResource extends ArmResource, TBaseParameters = BaseParamete
93
94
  @put
94
95
  op ArmResourceCreateOrUpdateAsync<
95
96
  TResource extends ArmResource,
96
- TBaseParameters = BaseParameters<TResource>
97
+ TBaseParameters = BaseParameters<TResource>,
98
+ LroHeaders extends TypeSpec.Reflection.Model = {}
97
99
  >(
98
100
  ...ResourceInstanceParameters<TResource, TBaseParameters>,
99
101
 
100
102
  @doc("Resource create parameters.")
101
103
  @body
102
104
  resource: TResource,
103
- ): ArmResourceUpdatedResponse<TResource> | ArmResourceCreatedResponse<TResource> | ErrorResponse;
105
+ ): ArmResourceUpdatedResponse<TResource> | ArmResourceCreatedResponse<
106
+ TResource,
107
+ LroHeaders
108
+ > | ErrorResponse;
104
109
 
105
110
  /**
106
111
  * DEPRECATED: Please use ArmResourceCreateOrReplaceSync instead
@@ -142,39 +147,58 @@ op ArmResourceCreateOrReplaceSync<
142
147
  resource: TResource,
143
148
  ): ArmResourceUpdatedResponse<TResource> | ArmResourceCreatedSyncResponse<TResource> | ErrorResponse;
144
149
 
145
- alias ArmResourceCreateOrReplaceAsync<
150
+ op ArmResourceCreateOrReplaceAsync<
146
151
  TResource extends ArmResource,
147
- TBaseParameters = BaseParameters<TResource>
148
- > = ArmResourceCreateOrUpdateAsync<TResource, TBaseParameters>;
152
+ TBaseParameters = BaseParameters<TResource>,
153
+ LroHeaders extends TypeSpec.Reflection.Model = {}
154
+ > is ArmResourceCreateOrUpdateAsync<TResource, TBaseParameters, LroHeaders>;
149
155
 
150
156
  /**
151
- * A long-running resource update that only allows updating resource tags (the minimum)
157
+ * @dev A long-running resource update that only allows updating resource tags (the minimum)
152
158
  * @template TResource the resource being patched
153
159
  * @template TBaseParameters Optional. Allows overriding the operation parameters
160
+ * @template LroHeaders Optional. Allows overriding the lro headers that appear in the Accepted response
154
161
  */
155
- alias ArmTagsPatchAsync<
162
+ op ArmTagsPatchAsync<
156
163
  TResource extends ArmResource,
157
164
  TProperties extends {} = TagsUpdateModel<TResource>,
158
- TBaseParameters = BaseParameters<TResource>
159
- > = ArmCustomPatchAsync<TResource, TagsUpdateModel<TResource>, TBaseParameters>;
165
+ TBaseParameters = BaseParameters<TResource>,
166
+ LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader<
167
+ Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
168
+ TResource,
169
+ string
170
+ >
171
+ > is ArmCustomPatchAsync<TResource, TagsUpdateModel<TResource>, TBaseParameters, LroHeaders>;
160
172
 
161
173
  /**
162
- * A long-running resource update using the items from the resource marked with visibility "update"
174
+ * @dev A long-running resource update using the items from the resource marked with visibility "update"
163
175
  * @template TResource the resource being patched
164
176
  * @template TProperties The model type of the resource properties
165
177
  * @template TBaseParameters Optional. Allows overriding the operation parameters
178
+ * @template LroHeaders Optional. Allows overriding the lro headers returned in the Accepted response
166
179
  */
167
- alias ArmResourcePatchAsync<
180
+ op ArmResourcePatchAsync<
168
181
  TResource extends ArmResource,
169
182
  TProperties extends TypeSpec.Reflection.Model,
170
- TBaseParameters = BaseParameters<TResource>
171
- > = ArmCustomPatchAsync<TResource, ResourceUpdateModel<TResource, TProperties>, TBaseParameters>;
183
+ TBaseParameters = BaseParameters<TResource>,
184
+ LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader<
185
+ Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
186
+ TResource,
187
+ string
188
+ >
189
+ > is ArmCustomPatchAsync<
190
+ TResource,
191
+ ResourceUpdateModel<TResource, TProperties>,
192
+ TBaseParameters,
193
+ LroHeaders
194
+ >;
172
195
 
173
196
  /**
174
197
  * A long-running resource update using a custom PATCH payload (Asynchronous)
175
198
  * @template TResource the resource being patched
176
199
  * @template TPatchModel The input model for the PATCH request
177
200
  * @template TBaseParameters Optional. Allows overriding the operation parameters
201
+ * @template LroHeaders Optional. Allows overriding the lro headers returned in the Accepted response
178
202
  */
179
203
  @autoRoute
180
204
  @doc("Update a {name}", TResource)
@@ -190,36 +214,44 @@ alias ArmResourcePatchAsync<
190
214
  op ArmCustomPatchAsync<
191
215
  TResource extends ArmResource,
192
216
  TPatchModel extends TypeSpec.Reflection.Model = TagsUpdateModel<TResource>,
193
- TBaseParameters = BaseParameters<TResource>
217
+ TBaseParameters = BaseParameters<TResource>,
218
+ LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader<
219
+ Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
220
+ TResource,
221
+ string
222
+ >
194
223
  >(
195
224
  ...ResourceInstanceParameters<TResource, TBaseParameters>,
196
225
 
197
226
  @doc("The resource properties to be updated.")
198
227
  @body
199
228
  properties: TPatchModel,
200
- ): ArmResponse<TResource> | ArmAcceptedLroResponse<"Resource update request accepted."> | ErrorResponse;
229
+ ): ArmResponse<TResource> | ArmAcceptedLroResponse<
230
+ "Resource update request accepted.",
231
+ LroHeaders
232
+ > | ErrorResponse;
201
233
 
202
234
  /**
203
- * A resource update that only allows updating resource tags (the minimum)
235
+ * @dev A resource update that only allows updating resource tags (the minimum)
204
236
  * @template TResource the resource being patched
205
237
  * @template TBaseParameters Optional. Allows overriding the operation parameters
206
238
  */
207
- alias ArmTagsPatchSync<
239
+ op ArmTagsPatchSync<
208
240
  TResource extends ArmResource,
209
241
  TBaseParameters = BaseParameters<TResource>
210
- > = ArmCustomPatchSync<TResource, TagsUpdateModel<TResource>, TBaseParameters>;
242
+ > is ArmCustomPatchSync<TResource, TagsUpdateModel<TResource>, TBaseParameters>;
211
243
 
212
244
  /**
213
- * A resource update using the items from the resource marked with visibility "update"
245
+ * @dev A resource update using the items from the resource marked with visibility "update"
214
246
  * @template TResource the resource being patched
215
247
  * @template TProperties The model type of the resource properties
216
248
  * @template TBaseParameters Optional. Allows overriding the operation parameters
217
249
  */
218
- alias ArmResourcePatchSync<
250
+ op ArmResourcePatchSync<
219
251
  TResource extends ArmResource,
220
252
  TProperties extends TypeSpec.Reflection.Model,
221
253
  TBaseParameters = BaseParameters<TResource>
222
- > = ArmCustomPatchSync<TResource, ResourceUpdateModel<TResource, TProperties>, TBaseParameters>;
254
+ > is ArmCustomPatchSync<TResource, ResourceUpdateModel<TResource, TProperties>, TBaseParameters>;
223
255
 
224
256
  /**
225
257
  * A resource update using a custom PATCH payload (synchronous)
@@ -270,13 +302,15 @@ op ArmResourceDeleteAsyncBase<
270
302
  * @dev Delete a resource asynchronously. DEPRECATED: Use ArmResourceDeleteWithoutOkAsync instead
271
303
  * @template TResource The resource being deleted
272
304
  * @template TBaseParameters Optional. Allows overriding the parameters for the operation
305
+ * @template LroHeaders Optional. Allows overriding the headers in the Accepted response
273
306
  */
274
307
  op ArmResourceDeleteAsync<
275
308
  TResource extends ArmResource,
276
- TBaseParameters = BaseParameters<TResource>
309
+ TBaseParameters = BaseParameters<TResource>,
310
+ LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader
277
311
  > is ArmResourceDeleteAsyncBase<
278
312
  TResource,
279
- ArmDeletedResponse | ArmDeleteAcceptedLroResponse | ArmDeletedNoContentResponse,
313
+ ArmDeletedResponse | ArmDeleteAcceptedLroResponse<LroHeaders> | ArmDeletedNoContentResponse,
280
314
  TBaseParameters
281
315
  >;
282
316
 
@@ -284,13 +318,15 @@ op ArmResourceDeleteAsync<
284
318
  * @dev Delete a resource asynchronously
285
319
  * @template TResource The resource being deleted
286
320
  * @template TBaseParameters Optional. Allows overriding the parameters for the operation
321
+ * @template LroHeaders Optional. Allows overriding the headers returned in the Accepted response
287
322
  */
288
323
  op ArmResourceDeleteWithoutOkAsync<
289
324
  TResource extends ArmResource,
290
- TBaseParameters = BaseParameters<TResource>
325
+ TBaseParameters = BaseParameters<TResource>,
326
+ LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader
291
327
  > is ArmResourceDeleteAsyncBase<
292
328
  TResource,
293
- ArmDeleteAcceptedLroResponse | ArmDeletedNoContentResponse,
329
+ ArmDeleteAcceptedLroResponse<LroHeaders> | ArmDeletedNoContentResponse,
294
330
  TBaseParameters
295
331
  >;
296
332
 
@@ -341,22 +377,28 @@ op ArmResourceActionAsyncBase<
341
377
  ): TResponse | ErrorResponse;
342
378
 
343
379
  /**
344
- * A long-running resource action.
380
+ * @dev A long-running resource action.
345
381
  * @template TResource The resource being acted upon
346
382
  * @template TRequest The request model for the action
347
383
  * @template TResponse The response model for the action
348
384
  * @template TBaseParameters Optional. Allows overriding the parameters for the operation
385
+ * @template LroHeaders Optional. Allows overriding the headers returned in the Accepted response
349
386
  */
350
387
  @returnsDoc("ARM operation completed successfully.")
351
388
  op ArmResourceActionAsync<
352
389
  TResource extends ArmResource,
353
390
  TRequest extends TypeSpec.Reflection.Model | void,
354
391
  TResponse extends TypeSpec.Reflection.Model | void,
355
- TBaseParameters extends TypeSpec.Reflection.Model = BaseParameters<TResource>
392
+ TBaseParameters extends TypeSpec.Reflection.Model = BaseParameters<TResource>,
393
+ LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader<
394
+ Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
395
+ TResponse,
396
+ string
397
+ >
356
398
  > is ArmResourceActionAsyncBase<
357
399
  TResource,
358
400
  TRequest,
359
- ArmAcceptedLroResponse | TResponse,
401
+ ArmAcceptedLroResponse<"Resource operation accepted.", LroHeaders> | TResponse,
360
402
  TBaseParameters
361
403
  >;
362
404
 
@@ -385,15 +427,22 @@ op ArmResourceActionSync<
385
427
  ): TResponse | ErrorResponse;
386
428
 
387
429
  /**
388
- * A long-running resource action that returns no content. DEPRECATED: Use 'ArmResourceActionNoResponseContentAsync' instead
430
+ * @dev A long-running resource action that returns no content. DEPRECATED: Use 'ArmResourceActionNoResponseContentAsync' instead
389
431
  * @template TResource The resource being acted upon
390
432
  * @template TRequest The request model for the action
391
433
  * @template TBaseParameters Optional. Allows overriding the parameters for the operation
434
+ * @template LroHeaders Optional. Allows overriding the headers returned in the Accepted response
435
+ *
392
436
  */
393
437
  op ArmResourceActionNoContentAsync<
394
438
  TResource extends ArmResource,
395
439
  TRequest extends TypeSpec.Reflection.Model | void,
396
- TBaseParameters extends TypeSpec.Reflection.Model = BaseParameters<TResource>
440
+ TBaseParameters extends TypeSpec.Reflection.Model = BaseParameters<TResource>,
441
+ LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader<
442
+ Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
443
+ void,
444
+ string
445
+ >
397
446
  > is ArmResourceActionAsyncBase<
398
447
  TResource,
399
448
  TRequest,
@@ -402,16 +451,27 @@ op ArmResourceActionNoContentAsync<
402
451
  >;
403
452
 
404
453
  /**
405
- * A long-running resource action that returns no content.
454
+ * @dev A long-running resource action that returns no content.
406
455
  * @template TResource The resource being acted upon
407
456
  * @template TRequest The request model for the action
408
457
  * @template TBaseParameters Optional. Allows overriding the parameters for the operation
458
+ * @template Headers Optional. Allows overriding the headers returned in the Accepted response
409
459
  */
410
460
  op ArmResourceActionNoResponseContentAsync<
411
461
  TResource extends ArmResource,
412
462
  TRequest extends TypeSpec.Reflection.Model | void,
413
- TBaseParameters extends TypeSpec.Reflection.Model = BaseParameters<TResource>
414
- > is ArmResourceActionAsyncBase<TResource, TRequest, ArmAcceptedLroResponse, TBaseParameters>;
463
+ TBaseParameters extends TypeSpec.Reflection.Model = BaseParameters<TResource>,
464
+ LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader<
465
+ Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
466
+ void,
467
+ string
468
+ >
469
+ > is ArmResourceActionAsyncBase<
470
+ TResource,
471
+ TRequest,
472
+ ArmAcceptedLroResponse<"Resource operation accepted.", LroHeaders>,
473
+ TBaseParameters
474
+ >;
415
475
 
416
476
  /**
417
477
  * A synchronous resource action that returns no content.
@@ -435,7 +495,7 @@ op ArmResourceActionNoContentSync<
435
495
  ): ArmNoContentResponse<"Action completed successfully."> | ErrorResponse;
436
496
 
437
497
  /**
438
- * Adds check global name availability operation, normally used if
498
+ * @dev Adds check global name availability operation, normally used if
439
499
  * a resource name must be globally unique (for example, if the resource
440
500
  * exposes and endpoint that uses the resource name in the url)
441
501
  * @template TRequest the availability request, defaults to the standard request, containing name and resource type
@@ -455,7 +515,7 @@ op checkGlobalNameAvailability<
455
515
  >;
456
516
 
457
517
  /**
458
- * Adds check location-specific name availability operation, normally used if
518
+ * @dev Adds check location-specific name availability operation, normally used if
459
519
  * a resource name must be globally unique (for example, if the resource
460
520
  * exposes and endpoint that uses the resource name in the url)
461
521
  * @template TRequest the availability request, defaults to the standard request, containing name and resource type
@@ -48,6 +48,7 @@ model SubscriptionIdParameter {
48
48
  }
49
49
 
50
50
  /**
51
+ * DEPRECATED - DO NOT USE
51
52
  * The default location parameter type.
52
53
  */
53
54
  @doc("The default location parameter type.")
@@ -63,6 +64,32 @@ model LocationParameter {
63
64
  location: string;
64
65
  }
65
66
 
67
+ /**
68
+ * The default location parameter type.
69
+ */
70
+ @doc("The default location parameter type.")
71
+ model LocationResourceParameter {
72
+ @path
73
+ @minLength(1)
74
+ @segment("locations")
75
+ @doc("The location name.")
76
+ @key
77
+ @armCommonParameter("LocationParameter", Azure.ResourceManager.CommonTypes.Versions.v3)
78
+ @armCommonParameter("LocationParameter", Azure.ResourceManager.CommonTypes.Versions.v4)
79
+ @armCommonParameter("LocationParameter", Azure.ResourceManager.CommonTypes.Versions.v5)
80
+ location: string;
81
+ }
82
+
83
+ @tenantResource
84
+ model TenantLocationResource {
85
+ ...LocationResourceParameter;
86
+ }
87
+
88
+ @subscriptionResource
89
+ model SubscriptionLocationResource {
90
+ ...LocationResourceParameter;
91
+ }
92
+
66
93
  /**
67
94
  * The default resource group parameter type.
68
95
  */
@@ -100,7 +127,7 @@ model ResourceUriParameter {
100
127
  * @template TBaseParameters The parameters representing the base Uri of the resource
101
128
  */
102
129
  model ResourceInstanceParameters<
103
- TResource extends ArmResource,
130
+ TResource extends ArmResourceBase,
104
131
  TBaseParameters = BaseParameters<TResource>
105
132
  > {
106
133
  ...TBaseParameters;
package/lib/responses.tsp CHANGED
@@ -37,8 +37,10 @@ model ArmDeletedResponse {
37
37
 
38
38
  /**
39
39
  * @dev The response for asynchronous ARM delete ACCEPTED
40
+ * @template LroHeaders Optional. Allows overriding the Lro headers returned in the response.
40
41
  */
41
- model ArmDeleteAcceptedLroResponse is ArmAcceptedLroResponse<"Resource deletion accepted.">;
42
+ model ArmDeleteAcceptedLroResponse<LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader>
43
+ is ArmAcceptedLroResponse<"Resource deletion accepted.", LroHeaders>;
42
44
 
43
45
  /**
44
46
  * @dev The response for synchronous ARM delete ACCEPTED
@@ -46,7 +48,7 @@ model ArmDeleteAcceptedLroResponse is ArmAcceptedLroResponse<"Resource deletion
46
48
  model ArmDeleteAcceptedResponse is ArmAcceptedResponse<"Resource deletion accepted.">;
47
49
 
48
50
  /**
49
- * The standard ACCEPTED response
51
+ * @dev The standard ACCEPTED response
50
52
  * @template TMessage The description of the response status (defaults to `Resource operation accepted`)
51
53
  */
52
54
  @doc(TMessage)
@@ -56,15 +58,119 @@ model ArmAcceptedResponse<TMessage extends valueof string = "Resource operation
56
58
  }
57
59
 
58
60
  /**
59
- * The standard ARM response for asynchronous PATCH, POST, and DELETE operations
60
- * @template TMessage The description of the response status (defaults to `Resource operation accepted`)
61
+ * @dev The standard ARM response for asynchronous PATCH, POST, and DELETE operations
62
+ * @template Description The description of the response status (defaults to `Resource operation accepted`)
63
+ * @template LroHeaders Optional. The lro headers that appear in the Accepted response
61
64
  */
62
- @doc(TMessage)
63
- model ArmAcceptedLroResponse<TMessage extends valueof string = "Resource operation accepted.">
64
- is ArmAcceptedResponse<TMessage> {
65
- @doc("The Location header contains the URL where the status of the long running operation can be checked.")
65
+ @doc(Description)
66
+ model ArmAcceptedLroResponse<
67
+ Description extends valueof string = "Resource operation accepted.",
68
+ LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader
69
+ > {
70
+ ...AcceptedResponse;
71
+ ...Azure.Core.Foundations.RetryAfterHeader;
72
+ ...LroHeaders;
73
+ }
74
+
75
+ /**
76
+ * Standard ARM operation status response
77
+ * @template Properties Optional resource-specific properties
78
+ * @template StatusValues The set of allowed values for operation status
79
+ */
80
+ model ArmOperationStatus<
81
+ Properties extends {} = never,
82
+ StatusValues extends TypeSpec.Reflection.Enum | TypeSpec.Reflection.Union = ResourceProvisioningState
83
+ > is ArmResourceBase {
84
+ /** RP-specific properties for the operationStatus resource, only appears when operation ended with Succeeded status */
85
+ @visibility("read")
86
+ properties?: Properties;
87
+
88
+ /** The operation status */
89
+ @Azure.Core.lroStatus
90
+ status: StatusValues;
91
+
92
+ /** The unique identifier for the operationStatus resource */
93
+ @key
94
+ @path
95
+ @segment("operationStatuses")
96
+ id: Azure.Core.uuid;
97
+
98
+ /** The name of the operationStatus resource */
99
+ @visibility("read")
100
+ name?: string;
101
+
102
+ /** Operation start time */
103
+ @visibility("read")
104
+ startTime?: utcDateTime;
105
+
106
+ /** Operation complete time */
107
+ @visibility("read")
108
+ endTime?: utcDateTime;
109
+
110
+ /** The progress made toward completing the operation */
111
+ @visibility("read")
112
+ percentComplete?: float64;
113
+
114
+ /** Errors that occurred if the operation ended with Canceled or Failed status */
115
+ @visibility("read")
116
+ error?: ErrorDetail;
117
+ }
118
+
119
+ /**
120
+ * The standard header for asynchronous operation polling
121
+ * @template StatusMonitor The status monitor type for lro polling
122
+ * @template UrlValue The value type of the Azure-AsyncOperation header
123
+ */
124
+ model ArmAsyncOperationHeader<
125
+ StatusMonitor extends {} = ArmOperationStatus,
126
+ UrlValue extends string = string
127
+ > {
128
+ /** A link to the status monitor */
129
+ @header("Azure-AsyncOperation")
130
+ @Azure.Core.pollingLocation(Azure.Core.StatusMonitorPollingOptions<StatusMonitor>)
131
+ azureAsyncOperation?: UrlValue;
132
+ }
133
+
134
+ /**
135
+ * The default header for lro PUT and DELETE polling
136
+ * @template LroPollingOptions The polling options when polling the url in the location header
137
+ * @template FinalResult The ultimate final result of the logical operation
138
+ * @template UrlValue The value type for the location header
139
+ */
140
+ model ArmLroLocationHeader<
141
+ LroPollingOptions extends Azure.Core.PollingOptions = Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
142
+ FinalResult extends {} | void = void,
143
+ UrlValue extends string = string
144
+ > {
145
+ /** The Location header contains the URL where the status of the long running operation can be checked. */
146
+ @header("Location")
147
+ @Azure.Core.pollingLocation(LroPollingOptions)
148
+ @Azure.Core.finalLocation(FinalResult)
149
+ location?: UrlValue;
150
+ }
151
+
152
+ /**
153
+ * Provide Both Azure-AsyncOperation and Location headers
154
+ * @template StatusMonitor The type of the polling StatusMonitor when following the Azure-AsyncOperation url
155
+ * @template FinalResult The type of the logical result when following the location header
156
+ * @template PollingUrlValue The value type of the link to the status monitor
157
+ * @template FinalUrlValue The value type fo the link to the final result
158
+ */
159
+ model ArmCombinedLroHeaders<
160
+ StatusMonitor extends {} = ArmOperationStatus,
161
+ FinalResult extends {} | void = void,
162
+ PollingUrlValue extends string = ResourceLocation<StatusMonitor>,
163
+ FinalUrlValue extends string = string
164
+ > {
165
+ /** A link to the status monitor */
166
+ @Azure.Core.pollingLocation(Azure.Core.StatusMonitorPollingOptions<StatusMonitor>)
167
+ @header("Azure-AsyncOperation")
168
+ azureAsyncOperation?: PollingUrlValue;
169
+
170
+ /** The Location header contains the URL where the status of the long running operation can be checked. */
66
171
  @header("Location")
67
- location?: string;
172
+ @Azure.Core.finalLocation(FinalResult)
173
+ location?: FinalUrlValue;
68
174
  }
69
175
 
70
176
  /**
@@ -81,21 +187,36 @@ model ArmNoContentResponse<TMessage extends valueof string = "Operation complete
81
187
  ...NoContentResponse;
82
188
  }
83
189
 
84
- /** Resource update operation succeeded
190
+ /**
191
+ * @dev Resource update operation succeeded
85
192
  * @template TResource The resource being updated
86
193
  */
87
194
  @doc("Resource '{name}' update operation succeeded", TResource)
88
195
  model ArmResourceUpdatedResponse<TResource extends Azure.ResourceManager.Foundations.ArmResource>
89
196
  is ArmResponse<TResource>;
90
197
 
91
- /** Resource create operation succeeded
92
- * @template TResource The resource being updated
198
+ /**
199
+ * @dev Resource create operation succeeded
200
+ * @template Resource The resource being updated
201
+ * @template LroHeaders Optional. The lro headers returned with a Created response
93
202
  */
94
- @doc("Resource '{name}' create operation succeeded", TResource)
95
- model ArmResourceCreatedResponse<TResource extends Azure.ResourceManager.Foundations.ArmResource>
96
- is ArmCreatedResponse<TResource>;
203
+ @doc("Resource '{name}' create operation succeeded", Resource)
204
+ model ArmResourceCreatedResponse<
205
+ Resource extends Azure.ResourceManager.Foundations.ArmResource,
206
+ LroHeaders extends TypeSpec.Reflection.Model = {}
207
+ > {
208
+ ...CreatedResponse;
209
+ ...Azure.Core.Foundations.RetryAfterHeader;
210
+ ...LroHeaders;
211
+
212
+ @Azure.Core.pollingLocation(Azure.Core.StatusMonitorPollingOptions<Resource>)
213
+ @doc("The resource body")
214
+ @body
215
+ body: Resource;
216
+ }
97
217
 
98
- /** Resource synchronous create operation succeeded
218
+ /**
219
+ * @dev Resource synchronous create operation succeeded
99
220
  * @template TResource The resource being updated
100
221
  */
101
222
  @doc("Resource '{name}' create operation succeeded", TResource)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure-tools/typespec-azure-resource-manager",
3
- "version": "0.37.0",
3
+ "version": "0.37.1",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "TypeSpec Azure Resource Manager library",
6
6
  "homepage": "https://azure.github.io/typespec-azure",
@@ -40,8 +40,8 @@
40
40
  ],
41
41
  "peerDependencies": {
42
42
  "@typespec/compiler": "~0.51.0",
43
- "@azure-tools/typespec-azure-core": "~0.37.0",
44
- "@azure-tools/typespec-autorest": "~0.37.0",
43
+ "@azure-tools/typespec-azure-core": "~0.37.2",
44
+ "@azure-tools/typespec-autorest": "~0.37.2",
45
45
  "@typespec/openapi": "~0.51.0",
46
46
  "@typespec/rest": "~0.51.0",
47
47
  "@typespec/http": "~0.51.0",
@@ -50,8 +50,8 @@
50
50
  "devDependencies": {
51
51
  "@typespec/compiler": "~0.51.0",
52
52
  "@typespec/openapi": "~0.51.0",
53
- "@azure-tools/typespec-azure-core": "~0.37.0",
54
- "@azure-tools/typespec-autorest": "~0.37.0",
53
+ "@azure-tools/typespec-azure-core": "~0.37.2",
54
+ "@azure-tools/typespec-autorest": "~0.37.2",
55
55
  "@typespec/rest": "~0.51.0",
56
56
  "@typespec/http": "~0.51.0",
57
57
  "@typespec/versioning": "~0.51.0",