@azure-tools/typespec-azure-resource-manager 0.67.0-dev.2 → 0.67.0-dev.3

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.
@@ -137,6 +137,42 @@ op ArmResourceCheckExistence<
137
137
  Error
138
138
  >;
139
139
 
140
+ /**
141
+ * A resource GET operation template for an Azure Resource Manager Operation Status endpoint.
142
+ * The path is determined by the `Scope` parameter. Use one of the four standard scope models:
143
+ * - `TenantActionScope` (default): `GET /providers/{providerNamespace}/operationStatuses/{operationId}`
144
+ * - `SubscriptionActionScope`: `GET /subscriptions/{subscriptionId}/providers/{providerNamespace}/operationStatuses/{operationId}`
145
+ * - `TenantLocationActionScope`: `GET /providers/{providerNamespace}/locations/{location}/operationStatuses/{operationId}`
146
+ * - `SubscriptionLocationActionScope`: `GET /subscriptions/{subscriptionId}/providers/{providerNamespace}/locations/{location}/operationStatuses/{operationId}`
147
+ *
148
+ * @template Response The type of the response body. Defaults to ArmOperationStatus.
149
+ * @template Scope The scope of the operation. Defaults to TenantActionScope.
150
+ * @template Parameters Optional. Additional non-path parameters (e.g. query or header parameters).
151
+ * @template Error Optional. The error response, if non-standard.
152
+ */
153
+ @autoRoute
154
+ @doc("Get the status of an async operation.")
155
+ @get
156
+ @armResourceCollectionAction
157
+ @Private.armUpdateProviderNamespace
158
+ op GetResourceOperationStatus<
159
+ Response extends {} = ArmOperationStatus,
160
+ Scope extends {} = TenantActionScope,
161
+ Parameters extends {} = {},
162
+ Error extends {} = ErrorResponse
163
+ >(
164
+ ...Azure.ResourceManager.Foundations.DefaultBaseParameters<Scope>,
165
+ ...ProviderNamespace<Scope>,
166
+ ...Scope,
167
+
168
+ @path
169
+ @segment("operationStatuses")
170
+ @doc("The operation ID.")
171
+ operationId: string,
172
+
173
+ ...Parameters,
174
+ ): ArmResponse<Response> | Error;
175
+
140
176
  /**
141
177
  * A long-running resource CreateOrUpdate (PUT)
142
178
  * @template Resource the resource being created or updated
@@ -219,6 +219,38 @@ model TenantActionScope {
219
219
  name: string;
220
220
  }
221
221
 
222
+ /**
223
+ * Scope for operation status endpoints at the tenant level with a location path segment.
224
+ * Use with `GetResourceOperationStatus` to produce:
225
+ * `GET /providers/{providerNamespace}/locations/{location}/operationStatuses/{operationId}`
226
+ *
227
+ * @example
228
+ * ```typespec
229
+ * op getStatus is GetResourceOperationStatus<ArmOperationStatus, TenantLocationActionScope>;
230
+ * ```
231
+ */
232
+ @armVirtualResource
233
+ @tenantResource
234
+ model TenantLocationActionScope {
235
+ ...LocationResourceParameter;
236
+ }
237
+
238
+ /**
239
+ * Scope for operation status endpoints at the subscription level with a location path segment.
240
+ * Use with `GetResourceOperationStatus` to produce:
241
+ * `GET /subscriptions/{subscriptionId}/providers/{providerNamespace}/locations/{location}/operationStatuses/{operationId}`
242
+ *
243
+ * @example
244
+ * ```typespec
245
+ * op getStatus is GetResourceOperationStatus<ArmOperationStatus, SubscriptionLocationActionScope>;
246
+ * ```
247
+ */
248
+ @armVirtualResource
249
+ @subscriptionResource
250
+ model SubscriptionLocationActionScope {
251
+ ...LocationResourceParameter;
252
+ }
253
+
222
254
  /**
223
255
  * Template used by ArmProviderAction templates. This produces following action route:
224
256
  * `/{resourceUri}/providers/Microsoft.SomeRP/someAction`
package/lib/responses.tsp CHANGED
@@ -136,7 +136,9 @@ model ArmAcceptedLroResponse<
136
136
  }
137
137
 
138
138
  /**
139
- * Standard Azure Resource Manager operation status response
139
+ * Standard Azure Resource Manager operation status response, used as the response
140
+ * body for `GetResourceOperationStatus`.
141
+ *
140
142
  * @template Properties Optional resource-specific properties
141
143
  * @template StatusValues The set of allowed values for operation status
142
144
  */
@@ -153,12 +155,9 @@ model ArmOperationStatus<
153
155
  status: StatusValues;
154
156
 
155
157
  /** The unique identifier for the operationStatus resource */
156
- @key
157
- @path
158
- @segment("operationStatuses")
159
158
  id: string;
160
159
 
161
- /** The name of the operationStatus resource */
160
+ /** The name of the operationStatus resource */
162
161
  @visibility(Lifecycle.Read)
163
162
  name?: string;
164
163
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure-tools/typespec-azure-resource-manager",
3
- "version": "0.67.0-dev.2",
3
+ "version": "0.67.0-dev.3",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "TypeSpec Azure Resource Manager library",
6
6
  "homepage": "https://azure.github.io/typespec-azure",