@azure-tools/typespec-azure-resource-manager 0.30.0-dev.1 → 0.30.0-dev.11

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.
@@ -1,4 +1,4 @@
1
- import { getNamespaceFullName, SyntaxKind, } from "@typespec/compiler";
1
+ import { getNamespaceFullName, isTemplateDeclaration, SyntaxKind, } from "@typespec/compiler";
2
2
  import { getResourceOperation } from "@typespec/rest";
3
3
  import { getArmResourceKind } from "../resource.js";
4
4
  /**
@@ -7,11 +7,10 @@ import { getArmResourceKind } from "../resource.js";
7
7
  *@returns true if the operation is defined on a templated interface which hasn't had args filled in
8
8
  */
9
9
  export function isTemplatedInterfaceOperation(target) {
10
- var _a, _b;
10
+ var _a;
11
11
  return (((_a = target.node) === null || _a === void 0 ? void 0 : _a.kind) === SyntaxKind.OperationStatement &&
12
12
  target.interface &&
13
- target.interface.node.templateParameters.length &&
14
- !((_b = target.interface.templateArguments) === null || _b === void 0 ? void 0 : _b.length));
13
+ isTemplateDeclaration(target.interface));
15
14
  }
16
15
  export function isTrackedResource(resourceType) {
17
16
  const resultKind = getArmResourceKind(resourceType);
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/rules/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EAOpB,UAAU,GACX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAsB,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAExE;;;;GAIG;AACH,MAAM,UAAU,6BAA6B,CAAC,MAAiB;;IAC7D,OAAO,CACL,CAAA,MAAA,MAAM,CAAC,IAAI,0CAAE,IAAI,MAAK,UAAU,CAAC,kBAAkB;QACnD,MAAM,CAAC,SAAS;QAChB,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,kBAAkB,CAAC,MAAM;QAC/C,CAAC,CAAA,MAA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,UAAU,CAAC,YAAY,CAAC,CACnC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,OAAgB,EAChB,IAA2E;IAE3E,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IAClC,IAAI,IAAI,CAAC,IAAI,KAAK,eAAe;QAAE,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAClG,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW;QAAE,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC;IACrD,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IAClC,OAAO,oBAAoB,CAAC,IAAI,CAAC,CAAC;AACpC,CAAC"}
@@ -4,6 +4,9 @@ using TypeSpec.Versioning;
4
4
 
5
5
  namespace Azure.ResourceManager.Foundations;
6
6
 
7
+ /**
8
+ * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.
9
+ */
7
10
  @armCommonDefinition
8
11
  @doc("""
9
12
  A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.
@@ -90,6 +93,9 @@ enum ActionType {
90
93
  Internal,
91
94
  }
92
95
 
96
+ /**
97
+ * Localized display information for and operation.
98
+ */
93
99
  @armCommonDefinition
94
100
  @doc("Localized display information for and operation.")
95
101
  model OperationDisplay {
@@ -112,6 +118,9 @@ model OperationDisplay {
112
118
  description?: string;
113
119
  }
114
120
 
121
+ /**
122
+ * The current status of an async operation.
123
+ */
115
124
  @armCommonDefinition
116
125
  @doc("The current status of an async operation.")
117
126
  model OperationStatusResult {
@@ -142,6 +151,9 @@ model OperationStatusResult {
142
151
  error?: ErrorDetail;
143
152
  }
144
153
 
154
+ /**
155
+ * The error detail.
156
+ */
145
157
  @armCommonDefinition
146
158
  @doc("The error detail.")
147
159
  model ErrorDetail {
@@ -168,6 +180,10 @@ model ErrorDetail {
168
180
  additionalInfo?: ErrorAdditionalInfo[];
169
181
  }
170
182
 
183
+ /**
184
+ * Base parameters for a resource.
185
+ * @template TResource The type of the resource.
186
+ */
171
187
  @resourceBaseParametersOf(TResource)
172
188
  model BaseParameters<TResource extends ArmResource> {
173
189
  ...ApiVersionParameter;
@@ -181,31 +197,44 @@ model BaseParameters<TResource extends ArmResource> {
181
197
  ...ResourceUriParameter;
182
198
  }
183
199
 
184
- // The static parameters for a tenant-based resource
200
+ /**
201
+ * The static parameters for a tenant-based resource
202
+ */
185
203
  model TenantBaseParameters {
186
204
  ...ApiVersionParameter;
187
205
  }
188
206
 
189
- // The static parameters for a subscription based resource
207
+ /**
208
+ * The static parameters for a subscription based resource
209
+ */
190
210
  model SubscriptionBaseParameters is TenantBaseParameters {
191
211
  ...SubscriptionIdParameter;
192
212
  }
193
213
 
194
- // The static parameters for a location-based resource
214
+ /**
215
+ * The static parameters for a location-based resource
216
+ */
195
217
  model LocationBaseParameters is SubscriptionBaseParameters {
196
218
  ...LocationParameter;
197
219
  }
198
220
 
199
- // The static parameters for a resource-group based resource
221
+ /**
222
+ * The static parameters for a resource-group based resource
223
+ */
200
224
  model ResourceGroupBaseParameters is SubscriptionBaseParameters {
201
225
  ...ResourceGroupParameter;
202
226
  }
203
227
 
204
- // The static parameters for an extension resource
228
+ /**
229
+ * The static parameters for an extension resource
230
+ */
205
231
  model ExtensionBaseParameters is TenantBaseParameters {
206
232
  ...ResourceUriParameter;
207
233
  }
208
234
 
235
+ /**
236
+ * The resource management error additional info.
237
+ */
209
238
  @armCommonDefinition
210
239
  @doc("The resource management error additional info.")
211
240
  model ErrorAdditionalInfo {
@@ -229,6 +258,9 @@ model ArmTagsProperty {
229
258
  tags?: Record<string>;
230
259
  }
231
260
 
261
+ /**
262
+ * The kind of entity that created the resource.
263
+ */
232
264
  // NOTE: This is how the enum is named in types.json
233
265
  @doc("The kind of entity that created the resource.")
234
266
  enum createdByType {
@@ -238,6 +270,9 @@ enum createdByType {
238
270
  Key,
239
271
  }
240
272
 
273
+ /**
274
+ * Metadata pertaining to creation and last modification of the resource.
275
+ */
241
276
  @armCommonDefinition("systemData")
242
277
  @doc("Metadata pertaining to creation and last modification of the resource.")
243
278
  model SystemData {
@@ -266,6 +301,9 @@ model SystemData {
266
301
  lastModifiedAt?: plainDate;
267
302
  }
268
303
 
304
+ /**
305
+ * The properties of the managed service identities assigned to this resource.
306
+ */
269
307
  @armCommonDefinition("ManagedServiceIdentity", "v4", "managedidentity.json")
270
308
  @doc("The properties of the managed service identities assigned to this resource.")
271
309
  model ManagedIdentityProperties {
@@ -284,6 +322,9 @@ model ManagedIdentityProperties {
284
322
  userAssignedIdentities?: Record<UserAssignedIdentity>;
285
323
  }
286
324
 
325
+ /**
326
+ * The properties of the service-assigned identity associated with this resource.
327
+ */
287
328
  @armCommonDefinition("SystemAssignedServiceIdentity", "v4", "managedidentity.json")
288
329
  @doc("The properties of the service-assigned identity associated with this resource.")
289
330
  model ManagedSystemIdentityProperties {
@@ -299,6 +340,9 @@ model ManagedSystemIdentityProperties {
299
340
  type: ManagedSystemIdentityType;
300
341
  }
301
342
 
343
+ /**
344
+ * A managed identity assigned by the user.
345
+ */
302
346
  @doc("A managed identity assigned by the user.")
303
347
  model UserAssignedIdentity {
304
348
  @doc("The active directory client identifier for this principal.")
@@ -308,6 +352,9 @@ model UserAssignedIdentity {
308
352
  principalId?: string;
309
353
  }
310
354
 
355
+ /**
356
+ * The kind of managed identity assigned to this resource.
357
+ */
311
358
  @doc("The kind of managed identity assigned to this resource.")
312
359
  enum ManagedIdentityType {
313
360
  None,
@@ -316,21 +363,32 @@ enum ManagedIdentityType {
316
363
  SystemAndUserAssigned: "SystemAssigned, UserAssigned",
317
364
  }
318
365
 
366
+ /**
367
+ * The kind of managemed identity assigned to this resource.
368
+ */
319
369
  @doc("The kind of managemed identity assigned to this resource.")
320
370
  enum ManagedSystemIdentityType {
321
371
  None,
322
372
  SystemAssigned,
323
373
  }
324
374
 
325
- // Defines a properties type used to create named resource update models.
326
- // This type is not used directly, it is referenced by ResourceUpdateModel<T>.
375
+ /**
376
+ * Defines a properties type used to create named resource update models.
377
+ * This type is not used directly, it is referenced by ResourceUpdateModel.
378
+ * @template TResource The type of the resource.
379
+ * @template TProperties The type of the properties.
380
+ */
327
381
  @doc("The updatable properties of the {name}.", TResource)
328
382
  @friendlyName("{name}UpdateProperties", TResource)
329
383
  model ResourceUpdateModelProperties<TResource extends ArmResource, TProperties extends object>
330
384
  is OptionalProperties<UpdateableProperties<TProperties>>;
331
385
 
332
- // Defines a model type used to create named resource update models
333
- // e.g. `model MyResourceUpdate is ResourceUpdate<MyResourceProperties> {}`
386
+ /**
387
+ * Defines a model type used to create named resource update models
388
+ * e.g. `model MyResourceUpdate is ResourceUpdate<MyResourceProperties> {}`
389
+ * @template TResource The type of the resource.
390
+ * @template TProperties The type of the properties.
391
+ */
334
392
  @doc("The type used for update operations of the {name}.", TResource)
335
393
  @friendlyName("{name}Update", TResource)
336
394
  @omitIfEmpty("properties")
@@ -340,6 +398,10 @@ model ResourceUpdateModel<TResource extends ArmResource, TProperties extends obj
340
398
  properties?: ResourceUpdateModelProperties<TResource, TProperties>;
341
399
  }
342
400
 
401
+ /**
402
+ * The type used for updating tags in resources.
403
+ * @template TResource The type of the resource.
404
+ */
343
405
  @doc("The type used for updating tags in {name} resources.", TResource)
344
406
  @friendlyName("{name}TagsUpdate", TResource)
345
407
  model TagsUpdateModel<TResource extends ArmResource> {
@@ -350,25 +412,43 @@ model TagsUpdateModel<TResource extends ArmResource> {
350
412
 
351
413
  alias TenantParentScope<TResource extends ArmResource> = TenantScope<TResource>;
352
414
 
353
- // Parameter model for listing a resource at the tenant scope
415
+ /**
416
+ * Parameter model for listing a resource at the tenant scope
417
+ * @template TResource The type of the resource.
418
+ */
354
419
  model TenantScope<TResource extends ArmResource>
355
420
  is ResourceParentParameters<TResource, TenantBaseParameters>;
356
421
 
357
- // Parameter model for listing a resource at the subscription scope
422
+ /**
423
+ * Parameter model for listing a resource at the subscription scope
424
+ * @template TResource The type of the resource.
425
+ */
358
426
  model SubscriptionScope<TResource extends ArmResource>
359
427
  is ResourceParentParameters<TResource, SubscriptionBaseParameters>;
360
428
 
361
- // Parameter model for listing a resource at the location scope
429
+ /**
430
+ * Parameter model for listing a resource at the location scope
431
+ * @template TResource The type of the resource.
432
+ */
362
433
  model LocationScope<TResource extends ArmResource>
363
434
  is ResourceParentParameters<TResource, LocationBaseParameters>;
364
435
 
365
- // Parameter model for listing an extension resource
436
+ /**
437
+ * Parameter model for listing an extension resource
438
+ * @template TResource The type of the resource.
439
+ */
366
440
  model ExtensionScope<TResource extends ArmResource>
367
441
  is ResourceParentParameters<TResource, ExtensionBaseParameters>;
368
442
 
369
- // Parameter model for listing a resource at the resource group scope
443
+ /**
444
+ * Parameter model for listing a resource at the resource group scope
445
+ * @template TResource The type of the resource.
446
+ */
370
447
  model ResourceGroupScope<TResource extends ArmResource> is ResourceParentParameters<TResource>;
371
448
 
449
+ /**
450
+ * Details of the resource plan.
451
+ */
372
452
  @doc("Details of the resource plan.")
373
453
  @armCommonDefinition("Plan")
374
454
  model ResourcePlanType {
@@ -388,6 +468,9 @@ model ResourcePlanType {
388
468
  version?: string;
389
469
  }
390
470
 
471
+ /**
472
+ * The SKU (Stock Keeping Unit) assigned to this resource.
473
+ */
391
474
  @doc("The SKU (Stock Keeping Unit) assigned to this resource.")
392
475
  @armCommonDefinition("Sku")
393
476
  model ResourceSkuType {
@@ -407,6 +490,9 @@ model ResourceSkuType {
407
490
  capacity?: int32;
408
491
  }
409
492
 
493
+ /**
494
+ * Available service tiers for the SKU.
495
+ */
410
496
  @doc("Available service tiers for the SKU.")
411
497
  enum SkuTier {
412
498
  Free,
@@ -415,6 +501,11 @@ enum SkuTier {
415
501
  Premium,
416
502
  }
417
503
 
504
+ /**
505
+ * The type used for update operations of the resource.
506
+ * @template TResource The type of the resource.
507
+ * @template TProperties The type of the properties.
508
+ */
418
509
  @doc("The type used for update operations of the {name}.", TResource)
419
510
  @friendlyName("{name}Update", TResource)
420
511
  model ProxyResourceUpdateModel<TResource extends ArmResource, TProperties extends object> {
@@ -455,6 +546,9 @@ model Operation {
455
546
  actionType?: ActionType;
456
547
  }
457
548
 
549
+ /**
550
+ * The default operationId parameter type.
551
+ */
458
552
  @doc("The default operationId parameter type.")
459
553
  model OperationIdParameter {
460
554
  @path
@@ -463,3 +557,79 @@ model OperationIdParameter {
463
557
  @armCommonParameter("OperationIdParameter")
464
558
  operationId: string;
465
559
  }
560
+
561
+ /**
562
+ * The check availability request body.
563
+ */
564
+ @armCommonDefinition
565
+ @doc("The check availability request body.")
566
+ model CheckNameAvailabilityRequest {
567
+ @doc("The name of the resource for which availability needs to be checked.")
568
+ name?: string;
569
+
570
+ @doc("The resource type.")
571
+ type?: string;
572
+ }
573
+
574
+ /**
575
+ * Possible reasons for a name not being available.
576
+ */
577
+ @doc("Possible reasons for a name not being available.")
578
+ enum CheckNameAvailabilityReason {
579
+ Invalid,
580
+ AlreadyExists,
581
+ }
582
+
583
+ /**
584
+ * The check availability result.
585
+ */
586
+ @armCommonDefinition
587
+ @doc("The check availability result.")
588
+ model CheckNameAvailabilityResponse {
589
+ @doc("Indicates if the resource name is available.")
590
+ nameAvailable?: boolean;
591
+
592
+ @doc("The reason why the given name is not available.")
593
+ reason?: CheckNameAvailabilityReason;
594
+
595
+ @doc("Detailed reason why the given name is not available.")
596
+ message?: string;
597
+ }
598
+
599
+ alias DefaultProviderNamespace = {
600
+ @path
601
+ @TypeSpec.Rest.segment("providers")
602
+ @doc("The provider namespace for the resource.")
603
+ provider: "Microsoft.ThisWillBeReplaced";
604
+ };
605
+
606
+ /**
607
+ * Adds check name availability operation, normally used if
608
+ * a resource name must be globally unique (for example, if the resource
609
+ * exposes an endpoint that uses the resource name in the url)
610
+ * @template TScopeParameters A parameter model with properties representing the scope of the resource
611
+ * @template TRequest The operation request body
612
+ * @template TResponse The operation response
613
+ * @template TAdditionalParams A parameter model with properties representing non-path parameters
614
+ */
615
+ @TypeSpec.Rest.autoRoute
616
+ @armResourceCollectionAction
617
+ @armProviderNameValue
618
+ @doc("Implements global CheckNameAvailability operations")
619
+ @TypeSpec.Rest.action("checkNameAvailability")
620
+ @post
621
+ op checkNameAvailability<
622
+ TScopeParameters extends object,
623
+ TRequest extends object = Azure.ResourceManager.Foundations.CheckNameAvailabilityRequest,
624
+ TResponse extends object = CheckNameAvailabilityResponse,
625
+ TAdditionalParams extends object = {}
626
+ >(
627
+ ...ApiVersionParameter,
628
+ ...TScopeParameters,
629
+ ...DefaultProviderNamespace,
630
+ ...TAdditionalParams,
631
+
632
+ @doc("The CheckAvailability request")
633
+ @body
634
+ body: TRequest
635
+ ): TResponse | ErrorResponse;
package/lib/arm.tsp CHANGED
@@ -25,6 +25,9 @@ using Azure.ResourceManager.Foundations;
25
25
  @versioned(Azure.ResourceManager.Versions)
26
26
  namespace Azure.ResourceManager;
27
27
 
28
+ /**
29
+ * Supported versions of Azure.ResourceManager building blocks.
30
+ */
28
31
  enum Versions {
29
32
  @useDependency(Azure.Core.Versions.v1_0_Preview_1)
30
33
  v1_0_Preview_1: "1.0-preview.1",
@@ -85,3 +85,15 @@ extern dec resourceGroupResource(target: object);
85
85
  * See more details on [different ARM resource type here.](https://azure.github.io/typespec-azure/docs/howtos/ARM/resource-type)
86
86
  */
87
87
  extern dec extensionResource(target: object);
88
+
89
+ /**
90
+ * `@armResourceType` sets the value fo the decorated string
91
+ * property to the type of the ARM resource.
92
+ * @param resource The resource to get the type of
93
+ */
94
+ extern dec armProviderNameValue(target: Operation | object);
95
+
96
+ /**
97
+ * Marks the operation as being a collection action
98
+ */
99
+ extern dec armResourceCollectionAction(target: Operation | object);
@@ -75,6 +75,8 @@ interface TrackedResourceOperations<
75
75
  * `/subscriptions/{id}/resourcegroups/{rg}/providers/Microsoft.XXX/...`
76
76
  *
77
77
  * This is the most common API pattern for Proxy Resources to use.
78
+ * @template TResource the ArmResource that provides these operations
79
+ * @template TBaseParameters The http parameters that are part of the request
78
80
  */
79
81
  interface ProxyResourceOperations<
80
82
  TResource extends ArmResource,
@@ -93,6 +95,8 @@ interface ProxyResourceOperations<
93
95
  * `/providers/Microsoft.XXX/...`
94
96
  *
95
97
  * This is the most common API pattern for Tenant Resources to use.
98
+ * @template TResource the ArmResource that provides these operations
99
+ * @template TProperties RP-specific property bag for the resource
96
100
  */
97
101
  interface TenantResourceOperations<TResource extends ArmResource, TProperties extends object>
98
102
  extends TenantResourceRead<TResource>,
@@ -101,6 +105,13 @@ interface TenantResourceOperations<TResource extends ArmResource, TProperties ex
101
105
  TenantResourceDelete<TResource>,
102
106
  TenantResourceListByParent<TResource> {}
103
107
 
108
+ /**
109
+ * A composite interface for resources that have CRUD operations.
110
+ * @template TResource The ArmResource that provides these operations
111
+ * @template TProperties RP-specific property bag for the resource
112
+ * @template TBaseParameters The http parameters that are part of the request
113
+ * @template TPatchModel The model used for PATCH operations
114
+ */
104
115
  interface ResourceInstanceOperations<
105
116
  TResource extends ArmResource,
106
117
  TProperties extends object,
@@ -112,15 +123,31 @@ interface ResourceInstanceOperations<
112
123
  ResourceUpdate<TResource, TProperties, TBaseParameters>,
113
124
  ResourceDelete<TResource, TBaseParameters> {}
114
125
 
126
+ /**
127
+ * A composite interface for resource collections.
128
+ * @template TResource The ArmResource that provides these operations
129
+ * @template TBaseParameters The http parameters that are part of the request
130
+ */
115
131
  interface ResourceCollectionOperations<
116
132
  TResource extends ArmResource,
117
133
  TBaseParameters = BaseParameters<TResource>
118
134
  > extends ResourceListByParent<TResource, TBaseParameters>, ResourceListBySubscription<TResource> {}
119
135
 
136
+ /**
137
+ * An interface for resources with can be listed by subscription.
138
+ * @template TResource The ArmResource that provides these operations
139
+ */
120
140
  interface ResourceListBySubscription<TResource extends ArmResource> {
121
141
  listBySubscription is ArmListBySubscription<TResource>;
122
142
  }
123
143
 
144
+ /**
145
+ * An interface for resources which can be listed by parent.
146
+ * @template TResource The ArmResource that provides these operations
147
+ * @template TBaseParameters The http parameters that are part of the request
148
+ * @template TParentName The name of the parent resource
149
+ * @template TParentFriendlyName The friendly name of the parent resource
150
+ */
124
151
  interface ResourceListByParent<
125
152
  TResource extends ArmResource,
126
153
  TBaseParameters = BaseParameters<TResource>,
@@ -135,10 +162,20 @@ interface ResourceListByParent<
135
162
  >;
136
163
  }
137
164
 
165
+ /**
166
+ * A composite interface for resources that include a GET operation.
167
+ * @template TResource The ArmResource that provides these operations
168
+ * @template TBaseParameters The http parameters that are part of the request
169
+ */
138
170
  interface ResourceRead<TResource extends ArmResource, TBaseParameters = BaseParameters<TResource>> {
139
171
  get is ArmResourceRead<TResource, TBaseParameters>;
140
172
  }
141
173
 
174
+ /**
175
+ * A composite interface for resources that include a synchronous create or update operation.
176
+ * @template TResource The ArmResource that provides these operations
177
+ * @template TBaseParameters The http parameters that are part of the request
178
+ */
142
179
  interface ResourceCreateSync<
143
180
  TResource extends ArmResource,
144
181
  TBaseParameters = BaseParameters<TResource>
@@ -146,6 +183,11 @@ interface ResourceCreateSync<
146
183
  createOrUpdate is ArmResourceCreateOrUpdateSync<TResource, TBaseParameters>;
147
184
  }
148
185
 
186
+ /**
187
+ * A composite interface for resources that include a long-running create or update operation.
188
+ * @template TResource The ArmResource that provides these operations
189
+ * @template TBaseParameters The http parameters that are part of the request
190
+ */
149
191
  interface ResourceCreateAsync<
150
192
  TResource extends ArmResource,
151
193
  TBaseParameters = BaseParameters<TResource>
@@ -153,6 +195,11 @@ interface ResourceCreateAsync<
153
195
  createOrUpdate is ArmResourceCreateOrUpdateAsync<TResource, TBaseParameters>;
154
196
  }
155
197
 
198
+ /**
199
+ * A composite interface for resources that include a long-running delete operation.
200
+ * @template TResource The ArmResource that provides these operations
201
+ * @template TBaseParameters The http parameters that are part of the request
202
+ */
156
203
  @doc("Delete a resource using the asynchronous call pattern")
157
204
  interface ResourceDeleteAsync<
158
205
  TResource extends ArmResource,
@@ -161,6 +208,11 @@ interface ResourceDeleteAsync<
161
208
  delete is ArmResourceDeleteAsync<TResource, TBaseParameters>;
162
209
  }
163
210
 
211
+ /**
212
+ * A composite interface for resources that include a synchronous delete operation.
213
+ * @template TResource The ArmResource that provides these operations
214
+ * @template TBaseParameters The http parameters that are part of the request
215
+ */
164
216
  @doc("Delete a resource")
165
217
  interface ResourceDeleteSync<
166
218
  TResource extends ArmResource,
@@ -169,6 +221,12 @@ interface ResourceDeleteSync<
169
221
  delete is ArmResourceDeleteSync<TResource, TBaseParameters>;
170
222
  }
171
223
 
224
+ /**
225
+ * A composite interface for resources that include a long-running update operation.
226
+ * @template TResource The ArmResource that provides these operations
227
+ * @template TProperties RP-specific property bag for the resource
228
+ * @template TBaseParameters The http parameters that are part of the request
229
+ */
172
230
  @doc("Asynchronous resource update")
173
231
  interface ResourceUpdateAsync<
174
232
  TResource extends ArmResource,
@@ -182,6 +240,12 @@ interface ResourceUpdateAsync<
182
240
  >;
183
241
  }
184
242
 
243
+ /**
244
+ * A composite interface for resources that include a synchronous update operation.
245
+ * @template TResource The ArmResource that provides these operations
246
+ * @template TProperties RP-specific property bag for the resource
247
+ * @template TBaseParameters The http parameters that are part of the request
248
+ */
185
249
  @doc("Synchronous resource update")
186
250
  interface ResourceUpdateSync<
187
251
  TResource extends ArmResource,
@@ -195,6 +259,11 @@ interface ResourceUpdateSync<
195
259
  >;
196
260
  }
197
261
 
262
+ /**
263
+ * A composite interface for resources that includes CRUD operations.
264
+ * @template TResource The ArmResource that provides these operations
265
+ * @template TProperties RP-specific property bag for the resource
266
+ */
198
267
  interface ExtensionResourceInstanceOperations<
199
268
  TResource extends ArmResource,
200
269
  TProperties extends object
@@ -204,9 +273,18 @@ interface ExtensionResourceInstanceOperations<
204
273
  ExtensionResourceUpdate<TResource, TProperties>,
205
274
  ExtensionResourceDelete<TResource> {}
206
275
 
276
+ /**
277
+ * A composite interface for resource collections that include a paginated list operation.
278
+ * @template TResource The ArmResource that provides these operations
279
+ */
207
280
  interface ExtensionResourceCollectionOperations<TResource extends ArmResource>
208
281
  extends ExtensionResourceList<TResource> {}
209
282
 
283
+ /**
284
+ * A composite interface for resources that include CRUD and list operations.
285
+ * @template TResource The ArmResource that provides these operations
286
+ * @template TProperties RP-specific property bag for the resource
287
+ */
210
288
  interface ExtensionResourceOperations<TResource extends ArmResource, TProperties extends object>
211
289
  extends ExtensionResourceInstanceOperations<TResource, TProperties>,
212
290
  ExtensionResourceCollectionOperations<TResource> {}