@azure-tools/typespec-azure-core 0.38.0-dev.6 → 0.38.0-dev.8
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.
- package/README.md +23 -23
- package/lib/decorators.tsp +8 -8
- package/lib/foundations.tsp +130 -130
- package/lib/models.tsp +28 -28
- package/lib/operations.tsp +236 -236
- package/lib/traits.tsp +26 -26
- package/package.json +4 -2
- package/dist/vitest.config.d.ts +0 -3
- package/dist/vitest.config.d.ts.map +0 -1
- package/dist/vitest.config.js +0 -14
- package/dist/vitest.config.js.map +0 -1
package/README.md
CHANGED
|
@@ -100,9 +100,9 @@ Identifies a ModelProperty as containing the final location for the operation re
|
|
|
100
100
|
|
|
101
101
|
##### Parameters
|
|
102
102
|
|
|
103
|
-
| Name | Type | Description
|
|
104
|
-
| ----------- | --------------------- |
|
|
105
|
-
| finalResult | `union Model \| void` | Sets the expected return value for the final result. Overrides<br />any value provided in the decorated property, if the property uses ResourceLocation<
|
|
103
|
+
| Name | Type | Description |
|
|
104
|
+
| ----------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
105
|
+
| finalResult | `union Model \| void` | Sets the expected return value for the final result. Overrides<br />any value provided in the decorated property, if the property uses ResourceLocation<Resource>. |
|
|
106
106
|
|
|
107
107
|
#### `@finalOperation`
|
|
108
108
|
|
|
@@ -118,10 +118,10 @@ Identifies that an operation is the final operation for an LRO.
|
|
|
118
118
|
|
|
119
119
|
##### Parameters
|
|
120
120
|
|
|
121
|
-
| Name | Type | Description
|
|
122
|
-
| --------------- | ----------- |
|
|
123
|
-
| linkedOperation | `Operation` | The linked Operation
|
|
124
|
-
| parameters | `model {}` | Map of `RequestParameter<
|
|
121
|
+
| Name | Type | Description |
|
|
122
|
+
| --------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- |
|
|
123
|
+
| linkedOperation | `Operation` | The linked Operation |
|
|
124
|
+
| parameters | `model {}` | Map of `RequestParameter<Name>` and/or `ResponseProperty<Name>` that will<br />be passed to the linked operation request. |
|
|
125
125
|
|
|
126
126
|
#### `@fixed`
|
|
127
127
|
|
|
@@ -291,10 +291,10 @@ Identifies that an operation is used to retrieve the next page for paged operati
|
|
|
291
291
|
|
|
292
292
|
##### Parameters
|
|
293
293
|
|
|
294
|
-
| Name | Type | Description
|
|
295
|
-
| --------------- | ----------- |
|
|
296
|
-
| linkedOperation | `Operation` | The linked Operation
|
|
297
|
-
| parameters | `model {}` | Map of `RequestParameter<
|
|
294
|
+
| Name | Type | Description |
|
|
295
|
+
| --------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- |
|
|
296
|
+
| linkedOperation | `Operation` | The linked Operation |
|
|
297
|
+
| parameters | `model {}` | Map of `RequestParameter<Name>` and/or `ResponseProperty<Name>` that will<br />be passed to the linked operation request. |
|
|
298
298
|
|
|
299
299
|
#### `@operationLink`
|
|
300
300
|
|
|
@@ -310,11 +310,11 @@ Identifies an operation that is linked to the target operation.
|
|
|
310
310
|
|
|
311
311
|
##### Parameters
|
|
312
312
|
|
|
313
|
-
| Name | Type | Description
|
|
314
|
-
| --------------- | ----------------------- |
|
|
315
|
-
| linkedOperation | `Operation` | The linked Operation
|
|
316
|
-
| linkType | `valueof scalar string` | A string indicating the role of the linked operation
|
|
317
|
-
| parameters | `model {}` | Map of `RequestParameter<
|
|
313
|
+
| Name | Type | Description |
|
|
314
|
+
| --------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------- |
|
|
315
|
+
| linkedOperation | `Operation` | The linked Operation |
|
|
316
|
+
| linkType | `valueof scalar string` | A string indicating the role of the linked operation |
|
|
317
|
+
| parameters | `model {}` | Map of `RequestParameter<Name>` and/or `ResponseProperty<Name>` that will<br />be passed to the linked operation request. |
|
|
318
318
|
|
|
319
319
|
#### `@pagedResult`
|
|
320
320
|
|
|
@@ -346,9 +346,9 @@ Identifies a model property as containing the location to poll for operation sta
|
|
|
346
346
|
|
|
347
347
|
##### Parameters
|
|
348
348
|
|
|
349
|
-
| Name | Type | Description
|
|
350
|
-
| ------- | --------------------------------- |
|
|
351
|
-
| options | `model Azure.Core.PollingOptions` | PollingOptions for the poller pointed to by this link. Overrides<br />settings derived from property value it is decorating, if the value of the<br />property is ResourceLocation<
|
|
349
|
+
| Name | Type | Description |
|
|
350
|
+
| ------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
351
|
+
| options | `model Azure.Core.PollingOptions` | PollingOptions for the poller pointed to by this link. Overrides<br />settings derived from property value it is decorating, if the value of the<br />property is ResourceLocation<Resource> |
|
|
352
352
|
|
|
353
353
|
#### `@pollingOperation`
|
|
354
354
|
|
|
@@ -364,10 +364,10 @@ Identifies that an operation is a polling operation for an LRO.
|
|
|
364
364
|
|
|
365
365
|
##### Parameters
|
|
366
366
|
|
|
367
|
-
| Name | Type | Description
|
|
368
|
-
| --------------- | ----------- |
|
|
369
|
-
| linkedOperation | `Operation` | The linked Operation
|
|
370
|
-
| parameters | `model {}` | Map of `RequestParameter<
|
|
367
|
+
| Name | Type | Description |
|
|
368
|
+
| --------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- |
|
|
369
|
+
| linkedOperation | `Operation` | The linked Operation |
|
|
370
|
+
| parameters | `model {}` | Map of `RequestParameter<Name>` and/or `ResponseProperty<Name>` that will<br />be passed to the linked operation request. |
|
|
371
371
|
|
|
372
372
|
#### `@pollingOperationParameter`
|
|
373
373
|
|
package/lib/decorators.tsp
CHANGED
|
@@ -66,14 +66,14 @@ namespace Azure {
|
|
|
66
66
|
* Identifies a model property as containing the location to poll for operation state.
|
|
67
67
|
* @param options PollingOptions for the poller pointed to by this link. Overrides
|
|
68
68
|
* settings derived from property value it is decorating, if the value of the
|
|
69
|
-
* property is ResourceLocation<
|
|
69
|
+
* property is ResourceLocation<Resource>
|
|
70
70
|
*/
|
|
71
71
|
extern dec pollingLocation(entity: ModelProperty, options?: PollingOptions);
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
74
|
* Identifies a ModelProperty as containing the final location for the operation result.
|
|
75
75
|
* @param finalResult Sets the expected return value for the final result. Overrides
|
|
76
|
-
* any value provided in the decorated property, if the property uses ResourceLocation<
|
|
76
|
+
* any value provided in the decorated property, if the property uses ResourceLocation<Resource>.
|
|
77
77
|
*/
|
|
78
78
|
extern dec finalLocation(entity: ModelProperty, finalResult?: Model | void);
|
|
79
79
|
|
|
@@ -81,7 +81,7 @@ namespace Azure {
|
|
|
81
81
|
* Identifies an operation that is linked to the target operation.
|
|
82
82
|
* @param linkedOperation The linked Operation
|
|
83
83
|
* @param linkType A string indicating the role of the linked operation
|
|
84
|
-
* @param parameters Map of `RequestParameter<
|
|
84
|
+
* @param parameters Map of `RequestParameter<Name>` and/or `ResponseProperty<Name>` that will
|
|
85
85
|
* be passed to the linked operation request.
|
|
86
86
|
*/
|
|
87
87
|
extern dec operationLink(
|
|
@@ -106,7 +106,7 @@ namespace Azure {
|
|
|
106
106
|
/**
|
|
107
107
|
* Identifies that an operation is a polling operation for an LRO.
|
|
108
108
|
* @param linkedOperation The linked Operation
|
|
109
|
-
* @param parameters Map of `RequestParameter<
|
|
109
|
+
* @param parameters Map of `RequestParameter<Name>` and/or `ResponseProperty<Name>` that will
|
|
110
110
|
* be passed to the linked operation request.
|
|
111
111
|
*/
|
|
112
112
|
extern dec pollingOperation(entity: Operation, linkedOperation: Operation, parameters?: {});
|
|
@@ -114,7 +114,7 @@ namespace Azure {
|
|
|
114
114
|
/**
|
|
115
115
|
* Identifies that an operation is the final operation for an LRO.
|
|
116
116
|
* @param linkedOperation The linked Operation
|
|
117
|
-
* @param parameters Map of `RequestParameter<
|
|
117
|
+
* @param parameters Map of `RequestParameter<Name>` and/or `ResponseProperty<Name>` that will
|
|
118
118
|
* be passed to the linked operation request.
|
|
119
119
|
*/
|
|
120
120
|
extern dec finalOperation(entity: Operation, linkedOperation: Operation, parameters?: {});
|
|
@@ -122,7 +122,7 @@ namespace Azure {
|
|
|
122
122
|
/**
|
|
123
123
|
* Identifies that an operation is used to retrieve the next page for paged operations.
|
|
124
124
|
* @param linkedOperation The linked Operation
|
|
125
|
-
* @param parameters Map of `RequestParameter<
|
|
125
|
+
* @param parameters Map of `RequestParameter<Name>` and/or `ResponseProperty<Name>` that will
|
|
126
126
|
* be passed to the linked operation request.
|
|
127
127
|
*/
|
|
128
128
|
extern dec nextPageOperation(entity: Operation, linkedOperation: Operation, parameters?: {});
|
|
@@ -169,14 +169,14 @@ namespace Azure {
|
|
|
169
169
|
extern dec spreadCustomResponseProperties(entity: Model, customizations: {});
|
|
170
170
|
|
|
171
171
|
/**
|
|
172
|
-
* Checks the
|
|
172
|
+
* Checks the Resource parameter of an operation signature to ensure it's a valid resource type.
|
|
173
173
|
* Also marks the operation as a resource operation.
|
|
174
174
|
* @param resourceType The possible resource Type to validate.
|
|
175
175
|
*/
|
|
176
176
|
extern dec ensureResourceType(entity: TypeSpec.Reflection.Operation, resourceType: unknown);
|
|
177
177
|
|
|
178
178
|
/**
|
|
179
|
-
* Checks the
|
|
179
|
+
* Checks the Resource parameter of an operation signature to ensure it's a valid resource type.
|
|
180
180
|
*/
|
|
181
181
|
extern dec needsRoute(entity: TypeSpec.Reflection.Operation);
|
|
182
182
|
|
package/lib/foundations.tsp
CHANGED
|
@@ -34,11 +34,11 @@ enum OperationState {
|
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* Provides status details for long running operations.
|
|
37
|
-
* @template
|
|
38
|
-
* @template
|
|
37
|
+
* @template StatusResult The type of the operation status result.
|
|
38
|
+
* @template StatusError The type of the operation status error. If not provided, the default error is used.
|
|
39
39
|
*/
|
|
40
40
|
@doc("Provides status details for long running operations.")
|
|
41
|
-
model OperationStatus<
|
|
41
|
+
model OperationStatus<StatusResult = never, StatusError = Foundations.Error> {
|
|
42
42
|
@key("operationId")
|
|
43
43
|
@doc("The unique ID of the operation.")
|
|
44
44
|
id: string;
|
|
@@ -47,79 +47,79 @@ model OperationStatus<TStatusResult = never, TStatusError = Foundations.Error> {
|
|
|
47
47
|
status: OperationState;
|
|
48
48
|
|
|
49
49
|
@doc("Error object that describes the error when status is \"Failed\".")
|
|
50
|
-
error?:
|
|
50
|
+
error?: StatusError;
|
|
51
51
|
|
|
52
52
|
@doc("The result of the operation.")
|
|
53
|
-
result?:
|
|
53
|
+
result?: StatusResult;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
/**
|
|
57
57
|
* Conveys the resource instance to an operation as a request body.
|
|
58
|
-
* @template
|
|
58
|
+
* @template Resource The type of the resource instance.
|
|
59
59
|
*/
|
|
60
60
|
@added(Azure.Core.Versions.v1_0_Preview_2)
|
|
61
61
|
@doc("Conveys the resource instance to an operation as a request body.")
|
|
62
|
-
model ResourceBody<
|
|
62
|
+
model ResourceBody<Resource> {
|
|
63
63
|
@doc("The resource instance.")
|
|
64
64
|
@body
|
|
65
|
-
resource:
|
|
65
|
+
resource: Resource;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
// TODO: There is a ARM linter rule that verifies that
|
|
69
69
|
// there is no response body. However, long running
|
|
70
70
|
// operations are allowed to have it.
|
|
71
|
-
alias ResourceCreatedResponse<
|
|
72
|
-
|
|
71
|
+
alias ResourceCreatedResponse<Resource extends TypeSpec.Reflection.Model> = TypeSpec.Http.Response<201> &
|
|
72
|
+
Resource;
|
|
73
73
|
|
|
74
|
-
alias ResourceOkResponse<
|
|
74
|
+
alias ResourceOkResponse<Resource> = TypeSpec.Http.Response<200> & Resource;
|
|
75
75
|
|
|
76
|
-
alias ResourceCreatedOrOkResponse<
|
|
76
|
+
alias ResourceCreatedOrOkResponse<Resource extends TypeSpec.Reflection.Model> = ResourceCreatedResponse<Resource> | ResourceOkResponse<Resource>;
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
79
|
* Response describing the location of a created resource.
|
|
80
80
|
* @template T The type of the created resource.
|
|
81
81
|
*/
|
|
82
|
-
model LocationOfCreatedResourceResponse<
|
|
82
|
+
model LocationOfCreatedResourceResponse<Resource extends TypeSpec.Reflection.Model>
|
|
83
83
|
is TypeSpec.Http.CreatedResponse {
|
|
84
84
|
@finalLocation
|
|
85
85
|
@TypeSpec.Http.header("Location")
|
|
86
|
-
location: ResourceLocation<
|
|
86
|
+
location: ResourceLocation<Resource>;
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
/**
|
|
90
90
|
* Response describing the location of a resource created with a service-provided name.
|
|
91
91
|
* @template T The type of the created resource.
|
|
92
92
|
*/
|
|
93
|
-
model LocationOfCreatedResourceWithServiceProvidedNameResponse<
|
|
93
|
+
model LocationOfCreatedResourceWithServiceProvidedNameResponse<Resource extends TypeSpec.Reflection.Model>
|
|
94
94
|
is TypeSpec.Http.AcceptedResponse {
|
|
95
95
|
@finalLocation
|
|
96
96
|
@TypeSpec.Http.header("Location")
|
|
97
|
-
location: ResourceLocation<
|
|
97
|
+
location: ResourceLocation<Resource>;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
101
|
* Metadata for long running operation status monitor locations.
|
|
102
|
-
* @template
|
|
102
|
+
* @template StatusResult The type of the operation status result.
|
|
103
103
|
*/
|
|
104
104
|
@doc("Metadata for long running operation status monitor locations")
|
|
105
|
-
model LongRunningStatusLocation<
|
|
105
|
+
model LongRunningStatusLocation<StatusResult = never> {
|
|
106
106
|
@pollingLocation
|
|
107
107
|
@doc("The location for monitoring the operation state.")
|
|
108
108
|
@TypeSpec.Http.header("Operation-Location")
|
|
109
|
-
operationLocation: ResourceLocation<OperationStatus<
|
|
109
|
+
operationLocation: ResourceLocation<OperationStatus<StatusResult>>;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
alias AcceptedResponse<
|
|
112
|
+
alias AcceptedResponse<Resource = {}> = TypeSpec.Http.AcceptedResponse & Resource;
|
|
113
113
|
|
|
114
114
|
/**
|
|
115
115
|
* A response containing error details.
|
|
116
|
-
* @template
|
|
116
|
+
* @template Error The type of the error object.
|
|
117
117
|
*/
|
|
118
118
|
@error
|
|
119
119
|
@doc("A response containing error details.")
|
|
120
|
-
model ErrorResponseBase<
|
|
120
|
+
model ErrorResponseBase<Error> {
|
|
121
121
|
@doc("The error object.")
|
|
122
|
-
error:
|
|
122
|
+
error: Error;
|
|
123
123
|
|
|
124
124
|
@header("x-ms-error-code")
|
|
125
125
|
@doc("String error code indicating what went wrong.")
|
|
@@ -174,93 +174,93 @@ model InnerError {
|
|
|
174
174
|
|
|
175
175
|
/**
|
|
176
176
|
* Version of a model for a create or replace operation which only includes updateable properties.
|
|
177
|
-
* @template
|
|
177
|
+
* @template Resource The type of the resource.
|
|
178
178
|
*/
|
|
179
179
|
@omitKeyProperties
|
|
180
|
-
model ResourceCreateOrReplaceModel<
|
|
181
|
-
is UpdateableProperties<DefaultKeyVisibility<
|
|
180
|
+
model ResourceCreateOrReplaceModel<Resource extends TypeSpec.Reflection.Model>
|
|
181
|
+
is UpdateableProperties<DefaultKeyVisibility<Resource, "read">>;
|
|
182
182
|
|
|
183
183
|
/**
|
|
184
184
|
* Collection of properties from a resource that are visible to create or update scopes.
|
|
185
|
-
* @template
|
|
185
|
+
* @template Resource The type of the resource.
|
|
186
186
|
*/
|
|
187
187
|
@withVisibility("create", "update")
|
|
188
|
-
model CreateableAndUpdateableProperties<
|
|
189
|
-
...
|
|
188
|
+
model CreateableAndUpdateableProperties<Resource> {
|
|
189
|
+
...Resource;
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
/**
|
|
193
193
|
* Version of a model for a create or update operation which only includes updateable properties.
|
|
194
|
-
* @template
|
|
194
|
+
* @template Resource The type of the resource.
|
|
195
195
|
*/
|
|
196
196
|
@omitKeyProperties
|
|
197
|
-
model ResourceCreateOrUpdateModel<
|
|
198
|
-
is OptionalProperties<CreateableAndUpdateableProperties<DefaultKeyVisibility<
|
|
197
|
+
model ResourceCreateOrUpdateModel<Resource>
|
|
198
|
+
is OptionalProperties<CreateableAndUpdateableProperties<DefaultKeyVisibility<Resource, "read">>>;
|
|
199
199
|
|
|
200
200
|
/**
|
|
201
201
|
* Version of a model for an update operation which only includes updateable properties.
|
|
202
|
-
* @template
|
|
202
|
+
* @template Resource The type of the resource.
|
|
203
203
|
*/
|
|
204
204
|
@omitKeyProperties
|
|
205
|
-
model ResourceUpdateModel<
|
|
206
|
-
is OptionalProperties<UpdateableProperties<DefaultKeyVisibility<
|
|
205
|
+
model ResourceUpdateModel<Resource>
|
|
206
|
+
is OptionalProperties<UpdateableProperties<DefaultKeyVisibility<Resource, "read">>>;
|
|
207
207
|
|
|
208
208
|
/**
|
|
209
209
|
* A model containing the keys of the provided resource.
|
|
210
|
-
* @template
|
|
210
|
+
* @template Resource The type of the resource.
|
|
211
211
|
*/
|
|
212
212
|
@copyResourceKeyParameters
|
|
213
|
-
model ItemKeysOf<
|
|
213
|
+
model ItemKeysOf<Resource> {}
|
|
214
214
|
|
|
215
215
|
/**
|
|
216
216
|
* A model containing the collection keys of the provided resource's parent resource.
|
|
217
|
-
* @template
|
|
217
|
+
* @template Resource The type of the resource.
|
|
218
218
|
*/
|
|
219
219
|
@copyResourceKeyParameters("parent")
|
|
220
|
-
model CollectionKeysOf<
|
|
220
|
+
model CollectionKeysOf<Resource> {}
|
|
221
221
|
|
|
222
222
|
/**
|
|
223
223
|
* A model describing a set of custom request parameters.
|
|
224
|
-
* @template
|
|
224
|
+
* @template Custom An object describing custom request parameters.
|
|
225
225
|
*/
|
|
226
|
-
@Private.spreadCustomParameters(
|
|
227
|
-
model CustomParameters<
|
|
226
|
+
@Private.spreadCustomParameters(Custom)
|
|
227
|
+
model CustomParameters<Custom extends TypeSpec.Reflection.Model> {}
|
|
228
228
|
|
|
229
229
|
/**
|
|
230
230
|
* A model describing a set of custom response properties.
|
|
231
|
-
* @template
|
|
231
|
+
* @template Custom An object describing custom response properties.
|
|
232
232
|
*/
|
|
233
|
-
@Private.spreadCustomResponseProperties(
|
|
234
|
-
model CustomResponseFields<
|
|
233
|
+
@Private.spreadCustomResponseProperties(Custom)
|
|
234
|
+
model CustomResponseFields<Custom extends TypeSpec.Reflection.Model> {}
|
|
235
235
|
|
|
236
236
|
/**
|
|
237
237
|
* A model describing a customized page of resources.
|
|
238
|
-
* @template
|
|
238
|
+
* @template Resource The type of the resource.
|
|
239
239
|
* @template Traits Traits which apply to the page.
|
|
240
240
|
*/
|
|
241
241
|
@pagedResult
|
|
242
|
-
@friendlyName("Paged{name}",
|
|
243
|
-
@doc("Paged collection of {name} items",
|
|
242
|
+
@friendlyName("Paged{name}", Resource)
|
|
243
|
+
@doc("Paged collection of {name} items", Resource)
|
|
244
244
|
model CustomPage<
|
|
245
|
-
|
|
245
|
+
Resource extends TypeSpec.Reflection.Model,
|
|
246
246
|
Traits extends TypeSpec.Reflection.Model = {}
|
|
247
247
|
> {
|
|
248
|
-
@doc("The {name} items on this page",
|
|
248
|
+
@doc("The {name} items on this page", Resource)
|
|
249
249
|
@items
|
|
250
|
-
value:
|
|
250
|
+
value: Resource[];
|
|
251
251
|
|
|
252
252
|
@doc("The link to the next page of items")
|
|
253
253
|
@nextLink
|
|
254
|
-
nextLink?: ResourceLocation<
|
|
254
|
+
nextLink?: ResourceLocation<Resource>;
|
|
255
255
|
|
|
256
256
|
// Include custom response fields
|
|
257
257
|
...TraitProperties<Traits, TraitLocation.Response, TraitContext.List>;
|
|
258
258
|
}
|
|
259
259
|
|
|
260
260
|
/**
|
|
261
|
-
* The expected shape of model types passed to the
|
|
261
|
+
* The expected shape of model types passed to the Custom parameter of operation signatures.
|
|
262
262
|
*/
|
|
263
|
-
@doc("The expected shape of model types passed to the
|
|
263
|
+
@doc("The expected shape of model types passed to the Custom parameter of operation signatures.")
|
|
264
264
|
model CustomizationFields {
|
|
265
265
|
@doc("An object containing custom parameters that will be included in the operation.")
|
|
266
266
|
parameters?: {};
|
|
@@ -273,171 +273,171 @@ model CustomizationFields {
|
|
|
273
273
|
|
|
274
274
|
/**
|
|
275
275
|
* The most basic operation.
|
|
276
|
-
* @template
|
|
277
|
-
* @template
|
|
276
|
+
* @template Parameters Object describing the request parameters of the operation.
|
|
277
|
+
* @template Response Object describing the response properties of the operation.
|
|
278
278
|
* @template Traits Traits which apply to the operation.
|
|
279
|
-
* @template
|
|
279
|
+
* @template ErrorResponse The type of the error response. If not provided, the default error response type will be used.
|
|
280
280
|
*/
|
|
281
281
|
op Operation<
|
|
282
|
-
|
|
283
|
-
|
|
282
|
+
Parameters extends TypeSpec.Reflection.Model,
|
|
283
|
+
Response,
|
|
284
284
|
Traits extends TypeSpec.Reflection.Model = {},
|
|
285
|
-
|
|
285
|
+
ErrorResponse = Azure.Core.Foundations.ErrorResponse
|
|
286
286
|
>(
|
|
287
287
|
...TraitProperties<
|
|
288
288
|
Traits & VersionParameterTrait<ApiVersionParameter>,
|
|
289
289
|
TraitLocation.ApiVersionParameter
|
|
290
290
|
>,
|
|
291
|
-
...
|
|
292
|
-
):
|
|
291
|
+
...Parameters,
|
|
292
|
+
): Response | ErrorResponse;
|
|
293
293
|
|
|
294
294
|
/**
|
|
295
295
|
* Long-running operation.
|
|
296
|
-
* @template
|
|
297
|
-
* @template
|
|
296
|
+
* @template Parameters Object describing the request parameters of the operation.
|
|
297
|
+
* @template Response Object describing the response properties of the operation. If not provided, the AcceptedResponse type will be used.
|
|
298
298
|
* @template Traits Traits which apply to the operation.
|
|
299
|
-
* @template
|
|
299
|
+
* @template ErrorResponse The type of the error response. If not provided, the default error response type will be used.
|
|
300
300
|
*/
|
|
301
301
|
#suppress "@azure-tools/typespec-providerhub/no-inline-model" "This operation signature is not used in Azure Resource Manager operations (yet)"
|
|
302
302
|
op LongRunningOperation<
|
|
303
|
-
|
|
304
|
-
|
|
303
|
+
Parameters extends TypeSpec.Reflection.Model,
|
|
304
|
+
Response = AcceptedResponse,
|
|
305
305
|
Traits extends TypeSpec.Reflection.Model = {},
|
|
306
|
-
|
|
307
|
-
> is Operation<
|
|
306
|
+
ErrorResponse = Azure.Core.Foundations.ErrorResponse
|
|
307
|
+
> is Operation<Parameters, Response & Foundations.LongRunningStatusLocation, Traits, ErrorResponse>;
|
|
308
308
|
|
|
309
309
|
/**
|
|
310
310
|
* Operation that returns the status of another operation.
|
|
311
|
-
* @template
|
|
312
|
-
* @template
|
|
313
|
-
* @template
|
|
311
|
+
* @template Parameters Object describing the request parameters of the operation.
|
|
312
|
+
* @template StatusResult The type of the operation status result.
|
|
313
|
+
* @template StatusError The type of the operation status error.
|
|
314
314
|
* @template Traits Traits which apply to the operation.
|
|
315
|
-
* @template
|
|
315
|
+
* @template ErrorResponse The type of the error response. If not provided, the default error response type will be used.
|
|
316
316
|
*/
|
|
317
317
|
op GetOperationStatus<
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
318
|
+
Parameters = {},
|
|
319
|
+
StatusResult = never,
|
|
320
|
+
StatusError = Error,
|
|
321
321
|
Traits extends TypeSpec.Reflection.Model = {},
|
|
322
|
-
|
|
322
|
+
ErrorResponse = Azure.Core.Foundations.ErrorResponse
|
|
323
323
|
> is Foundations.Operation<
|
|
324
|
-
|
|
324
|
+
Parameters & {
|
|
325
325
|
@doc("The unique ID of the operation.")
|
|
326
326
|
@path
|
|
327
327
|
operationId: string;
|
|
328
328
|
},
|
|
329
|
-
OperationStatus<
|
|
329
|
+
OperationStatus<StatusResult, StatusError>,
|
|
330
330
|
Traits,
|
|
331
|
-
|
|
331
|
+
ErrorResponse
|
|
332
332
|
>;
|
|
333
333
|
|
|
334
334
|
// Fundamental Resource Operation Shapes
|
|
335
335
|
|
|
336
336
|
/**
|
|
337
337
|
* The most basic operation that applies to a resource.
|
|
338
|
-
* @template
|
|
339
|
-
* @template
|
|
340
|
-
* @template
|
|
338
|
+
* @template Resource The type of the resource.
|
|
339
|
+
* @template Parameters Object describing the request parameters of the operation.
|
|
340
|
+
* @template Response Object describing the response properties of the operation.
|
|
341
341
|
* @template Traits Traits which apply to the operation.
|
|
342
|
-
* @template
|
|
342
|
+
* @template ErrorResponse The type of the error response. If not provided, the default error response type will be used.
|
|
343
343
|
*/
|
|
344
344
|
#suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "This operation must return a status monitor in its response."
|
|
345
345
|
@autoRoute
|
|
346
|
-
@Private.ensureResourceType(
|
|
346
|
+
@Private.ensureResourceType(Resource)
|
|
347
347
|
op ResourceOperation<
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
348
|
+
Resource extends TypeSpec.Reflection.Model,
|
|
349
|
+
Parameters extends TypeSpec.Reflection.Model,
|
|
350
|
+
Response, // No constraint here on purpose, some responses are unions
|
|
351
351
|
Traits extends TypeSpec.Reflection.Model = {},
|
|
352
|
-
|
|
353
|
-
> is Operation<Foundations.ItemKeysOf<
|
|
352
|
+
ErrorResponse = Azure.Core.Foundations.ErrorResponse
|
|
353
|
+
> is Operation<Foundations.ItemKeysOf<Resource> & Parameters, Response, Traits, ErrorResponse>;
|
|
354
354
|
|
|
355
355
|
/**
|
|
356
356
|
* Operation that applies to a collection of resources.
|
|
357
|
-
* @template
|
|
358
|
-
* @template
|
|
359
|
-
* @template
|
|
357
|
+
* @template Resource The type of the resource.
|
|
358
|
+
* @template Parameters Object describing the request parameters of the operation.
|
|
359
|
+
* @template Response Object describing the response properties of the operation.
|
|
360
360
|
* @template Traits Traits which apply to the operation.
|
|
361
|
-
* @template
|
|
361
|
+
* @template ErrorResponse The type of the error response. If not provided, the default error response type will be used.
|
|
362
362
|
*/
|
|
363
363
|
#suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "This operation must return a status monitor in its response."
|
|
364
364
|
@autoRoute
|
|
365
|
-
@Private.ensureResourceType(
|
|
365
|
+
@Private.ensureResourceType(Resource)
|
|
366
366
|
op ResourceCollectionOperation<
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
367
|
+
Resource extends TypeSpec.Reflection.Model,
|
|
368
|
+
Parameters extends TypeSpec.Reflection.Model,
|
|
369
|
+
Response extends TypeSpec.Reflection.Model,
|
|
370
370
|
Traits extends TypeSpec.Reflection.Model = {},
|
|
371
|
-
|
|
371
|
+
ErrorResponse = Azure.Core.Foundations.ErrorResponse
|
|
372
372
|
> is Operation<
|
|
373
|
-
Foundations.CollectionKeysOf<
|
|
374
|
-
|
|
373
|
+
Foundations.CollectionKeysOf<Resource> & Parameters,
|
|
374
|
+
Response,
|
|
375
375
|
Traits,
|
|
376
|
-
|
|
376
|
+
ErrorResponse
|
|
377
377
|
>;
|
|
378
378
|
|
|
379
379
|
/**
|
|
380
380
|
* Operation that lists resources in a paginated way.
|
|
381
|
-
* @template
|
|
382
|
-
* @template
|
|
383
|
-
* @template
|
|
381
|
+
* @template Resource The type of the resource.
|
|
382
|
+
* @template Parameters Object describing the request parameters of the operation.
|
|
383
|
+
* @template Response Object describing the response properties of the operation.
|
|
384
384
|
* @template Traits Traits which apply to the operation.
|
|
385
|
-
* @template
|
|
385
|
+
* @template ErrorResponse The type of the error response. If not provided, the default error response type will be used.
|
|
386
386
|
*/
|
|
387
|
-
@listsResource(
|
|
388
|
-
@Private.ensureResourceType(
|
|
387
|
+
@listsResource(Resource)
|
|
388
|
+
@Private.ensureResourceType(Resource)
|
|
389
389
|
op ResourceList<
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
390
|
+
Resource extends TypeSpec.Reflection.Model,
|
|
391
|
+
Parameters extends TypeSpec.Reflection.Model,
|
|
392
|
+
Response extends TypeSpec.Reflection.Model,
|
|
393
393
|
Traits extends TypeSpec.Reflection.Model = {},
|
|
394
|
-
|
|
395
|
-
> is ResourceCollectionOperation<
|
|
394
|
+
ErrorResponse = Azure.Core.Foundations.ErrorResponse
|
|
395
|
+
> is ResourceCollectionOperation<Resource, Parameters, Response, Traits, ErrorResponse>;
|
|
396
396
|
|
|
397
397
|
/**
|
|
398
398
|
* Operation that lists resources in a non-paginated way.
|
|
399
|
-
* @template
|
|
399
|
+
* @template Resource The type of the resource.
|
|
400
400
|
* @template Traits Traits which apply to the operation.
|
|
401
|
-
* @template
|
|
401
|
+
* @template ErrorResponse The type of the error response. If not provided, the default error response type will be used.
|
|
402
402
|
*/
|
|
403
403
|
#suppress "@azure-tools/typespec-providerhub/no-inline-model" "This operation signature is not used in Azure Resource Manager operations (yet)"
|
|
404
404
|
@autoRoute
|
|
405
405
|
op NonPagedResourceList<
|
|
406
|
-
|
|
406
|
+
Resource extends TypeSpec.Reflection.Model,
|
|
407
407
|
Traits extends TypeSpec.Reflection.Model = {},
|
|
408
|
-
|
|
408
|
+
ErrorResponse = Azure.Core.Foundations.ErrorResponse
|
|
409
409
|
> is Foundations.ResourceList<
|
|
410
|
-
|
|
410
|
+
Resource,
|
|
411
411
|
TraitProperties<Traits, TraitLocation.Parameters, TraitContext.List>,
|
|
412
|
-
Body<
|
|
412
|
+
Body<Resource[]> & TraitProperties<Traits, TraitLocation.Response, TraitContext.List>,
|
|
413
413
|
Traits,
|
|
414
|
-
|
|
414
|
+
ErrorResponse
|
|
415
415
|
>;
|
|
416
416
|
|
|
417
417
|
/**
|
|
418
418
|
* Long-running operation that updates a resource.
|
|
419
|
-
* @template
|
|
419
|
+
* @template Resource The type of the resource.
|
|
420
420
|
* @template Traits Traits which apply to the operation.
|
|
421
|
-
* @template
|
|
421
|
+
* @template ErrorResponse The type of the error response. If not provided, the default error response type will be used.
|
|
422
422
|
*/
|
|
423
|
-
@updatesResource(
|
|
423
|
+
@updatesResource(Resource)
|
|
424
424
|
op LongRunningResourceUpdate<
|
|
425
|
-
|
|
425
|
+
Resource extends TypeSpec.Reflection.Model,
|
|
426
426
|
Traits extends TypeSpec.Reflection.Model = {},
|
|
427
|
-
|
|
427
|
+
ErrorResponse = Azure.Core.Foundations.ErrorResponse
|
|
428
428
|
> is Foundations.ResourceOperation<
|
|
429
|
-
|
|
429
|
+
Resource,
|
|
430
430
|
{
|
|
431
431
|
@doc("This request has a JSON Merge Patch body.")
|
|
432
432
|
@TypeSpec.Http.header("Content-Type")
|
|
433
433
|
contentType: "application/merge-patch+json";
|
|
434
434
|
|
|
435
|
-
...Foundations.ResourceBody<
|
|
435
|
+
...Foundations.ResourceBody<Resource>;
|
|
436
436
|
...TraitProperties<Traits, TraitLocation.Parameters, TraitContext.Update>;
|
|
437
437
|
},
|
|
438
|
-
Foundations.ResourceOkResponse<
|
|
438
|
+
Foundations.ResourceOkResponse<Resource &
|
|
439
439
|
TraitProperties<Traits, TraitLocation.Response, TraitContext.Update> &
|
|
440
|
-
Foundations.LongRunningStatusLocation<
|
|
440
|
+
Foundations.LongRunningStatusLocation<Resource>>,
|
|
441
441
|
Traits,
|
|
442
|
-
|
|
442
|
+
ErrorResponse
|
|
443
443
|
>;
|