@azure-tools/typespec-azure-resource-manager 0.58.0-dev.2 → 0.58.0-dev.4
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 +45 -12
- package/dist/generated-defs/Azure.ResourceManager.Extension.Private.d.ts +25 -0
- package/dist/generated-defs/Azure.ResourceManager.Extension.Private.d.ts.map +1 -0
- package/dist/generated-defs/Azure.ResourceManager.Extension.Private.js +2 -0
- package/dist/generated-defs/Azure.ResourceManager.Extension.Private.js.map +1 -0
- package/dist/generated-defs/Azure.ResourceManager.Legacy.d.ts +14 -1
- package/dist/generated-defs/Azure.ResourceManager.Legacy.d.ts.map +1 -1
- package/dist/generated-defs/Azure.ResourceManager.Private.d.ts +8 -0
- package/dist/generated-defs/Azure.ResourceManager.Private.d.ts.map +1 -1
- package/dist/generated-defs/Azure.ResourceManager.d.ts +20 -6
- package/dist/generated-defs/Azure.ResourceManager.d.ts.map +1 -1
- package/dist/src/lib.d.ts +17 -2
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +6 -0
- package/dist/src/lib.js.map +1 -1
- package/dist/src/linter.d.ts.map +1 -1
- package/dist/src/linter.js +2 -0
- package/dist/src/linter.js.map +1 -1
- package/dist/src/namespace.d.ts.map +1 -1
- package/dist/src/namespace.js +14 -7
- package/dist/src/namespace.js.map +1 -1
- package/dist/src/operations.d.ts +3 -0
- package/dist/src/operations.d.ts.map +1 -1
- package/dist/src/operations.js +37 -2
- package/dist/src/operations.js.map +1 -1
- package/dist/src/private.decorators.d.ts.map +1 -1
- package/dist/src/private.decorators.js +61 -7
- package/dist/src/private.decorators.js.map +1 -1
- package/dist/src/resource.d.ts +16 -1
- package/dist/src/resource.d.ts.map +1 -1
- package/dist/src/resource.js +68 -14
- package/dist/src/resource.js.map +1 -1
- package/dist/src/rules/arm-custom-resource-no-key.d.ts +4 -0
- package/dist/src/rules/arm-custom-resource-no-key.d.ts.map +1 -0
- package/dist/src/rules/arm-custom-resource-no-key.js +28 -0
- package/dist/src/rules/arm-custom-resource-no-key.js.map +1 -0
- package/dist/src/rules/arm-resource-interfaces.d.ts.map +1 -1
- package/dist/src/rules/arm-resource-interfaces.js +2 -1
- package/dist/src/rules/arm-resource-interfaces.js.map +1 -1
- package/dist/src/rules/list-operation.js +1 -1
- package/dist/src/rules/list-operation.js.map +1 -1
- package/dist/src/state.d.ts +2 -0
- package/dist/src/state.d.ts.map +1 -1
- package/dist/src/state.js +2 -0
- package/dist/src/state.js.map +1 -1
- package/dist/src/tsp-index.d.ts.map +1 -1
- package/dist/src/tsp-index.js +2 -1
- package/dist/src/tsp-index.js.map +1 -1
- package/lib/Legacy/arm.legacy.tsp +4 -0
- package/lib/Legacy/decorator.tsp +18 -0
- package/lib/Legacy/extension.tsp +343 -0
- package/lib/Legacy/interfaces.tsp +38 -0
- package/lib/Legacy/operations.tsp +130 -32
- package/lib/arm.tsp +1 -0
- package/lib/common-types/internal.tsp +9 -0
- package/lib/common-types/types-ref.tsp +12 -3
- package/lib/decorators.tsp +38 -6
- package/lib/extension/extension.tsp +6 -0
- package/lib/extension/operations.tsp +507 -0
- package/lib/extension/parameters.tsp +223 -0
- package/lib/extension/private.decorators.tsp +24 -0
- package/lib/private.decorators.tsp +5 -0
- package/package.json +1 -1
package/dist/src/state.js
CHANGED
|
@@ -5,6 +5,7 @@ function azureResourceManagerCreateStateSymbol(name) {
|
|
|
5
5
|
return Symbol.for(`@azure-tools/typespec-azure-resource-manager.${name}`);
|
|
6
6
|
}
|
|
7
7
|
export const ArmStateKeys = {
|
|
8
|
+
armProviderCache: azureResourceManagerCreateStateSymbol("armProviderCache"),
|
|
8
9
|
armProviderNamespaces: azureResourceManagerCreateStateSymbol("armProviderNamespaces"),
|
|
9
10
|
armResourceOperations: azureResourceManagerCreateStateSymbol("armResourceOperations"),
|
|
10
11
|
armResourceCollectionAction: azureResourceManagerCreateStateSymbol("armResourceCollectionAction"),
|
|
@@ -28,5 +29,6 @@ export const ArmStateKeys = {
|
|
|
28
29
|
armCommonDefinitions: azureResourceManagerCreateStateSymbol("armCommonDefinitions"),
|
|
29
30
|
armCommonParameters: azureResourceManagerCreateStateSymbol("armCommonParameters"),
|
|
30
31
|
armCommonTypesVersions: azureResourceManagerCreateStateSymbol("armCommonTypesVersions"),
|
|
32
|
+
armResourceRoute: azureResourceManagerCreateStateSymbol("armResourceRoute"),
|
|
31
33
|
};
|
|
32
34
|
//# sourceMappingURL=state.js.map
|
package/dist/src/state.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/state.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,qBAAqB;AACrB,2DAA2D;AAC3D,SAAS,qCAAqC,CAAC,IAAY;IACzD,OAAO,MAAM,CAAC,GAAG,CAAC,gDAAgD,IAAI,EAAE,CAAC,CAAC;AAC5E,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,qBAAqB,EAAE,qCAAqC,CAAC,uBAAuB,CAAC;IACrF,qBAAqB,EAAE,qCAAqC,CAAC,uBAAuB,CAAC;IACrF,2BAA2B,EAAE,qCAAqC,CAAC,6BAA6B,CAAC;IACjG,qBAAqB,EAAE,qCAAqC,CAAC,oBAAoB,CAAC;IAClF,YAAY,EAAE,qCAAqC,CAAC,cAAc,CAAC;IACnE,oBAAoB,EAAE,qCAAqC,CAAC,sBAAsB,CAAC;IACnF,wBAAwB,EAAE,qCAAqC,CAAC,0BAA0B,CAAC;IAC3F,qBAAqB,EAAE,qCAAqC,CAAC,uBAAuB,CAAC;IACrF,cAAc,EAAE,qCAAqC,CAAC,gBAAgB,CAAC;IACvE,eAAe,EAAE,qCAAqC,CAAC,iBAAiB,CAAC;IAEzE,cAAc;IACd,kBAAkB,EAAE,qCAAqC,CAAC,oBAAoB,CAAC;IAC/E,qBAAqB,EAAE,qCAAqC,CAAC,uBAAuB,CAAC;IACrF,gBAAgB,EAAE,qCAAqC,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E,qCAAqC,CAAC,oBAAoB,CAAC;IAC/E,qBAAqB,EAAE,qCAAqC,CAAC,uBAAuB,CAAC;IACrF,gBAAgB,EAAE,qCAAqC,CAAC,qBAAqB,CAAC;IAC9E,kBAAkB,EAAE,qCAAqC,CAAC,qBAAqB,CAAC;IAChF,mBAAmB,EAAE,qCAAqC,CAAC,qBAAqB,CAAC;IAEjF,uBAAuB;IACvB,iBAAiB,EAAE,qCAAqC,CAAC,mBAAmB,CAAC;IAC7E,2BAA2B,EAAE,qCAAqC,CAAC,6BAA6B,CAAC;IAEjG,oCAAoC;IACpC,oBAAoB,EAAE,qCAAqC,CAAC,sBAAsB,CAAC;IACnF,mBAAmB,EAAE,qCAAqC,CAAC,qBAAqB,CAAC;IACjF,sBAAsB,EAAE,qCAAqC,CAAC,wBAAwB,CAAC;IACvF,gBAAgB,EAAE,qCAAqC,CAAC,kBAAkB,CAAC;CAC5E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsp-index.d.ts","sourceRoot":"","sources":["../../src/tsp-index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tsp-index.d.ts","sourceRoot":"","sources":["../../src/tsp-index.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAmChC,eAAO,MAAM,MAAM,2CAEjB,CAAC"}
|
package/dist/src/tsp-index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { definePackageFlags } from "@typespec/compiler";
|
|
2
2
|
import { $armCommonTypesVersion, $externalTypeRef } from "./common-types.js";
|
|
3
3
|
import { $armLibraryNamespace, $armProviderNamespace, $useLibraryNamespace } from "./namespace.js";
|
|
4
|
-
import { $armResourceAction, $armResourceCollectionAction, $armResourceCreateOrUpdate, $armResourceDelete, $armResourceList, $armResourceRead, $armResourceUpdate, } from "./operations.js";
|
|
4
|
+
import { $armOperationRoute, $armResourceAction, $armResourceCollectionAction, $armResourceCreateOrUpdate, $armResourceDelete, $armResourceList, $armResourceRead, $armResourceUpdate, } from "./operations.js";
|
|
5
5
|
import { $armProviderNameValue, $armResourceOperations, $armVirtualResource, $customAzureResource, $extensionResource, $identifiers, $locationResource, $resourceBaseType, $resourceGroupResource, $singleton, $subscriptionResource, $tenantResource, } from "./resource.js";
|
|
6
6
|
export { $lib } from "./lib.js";
|
|
7
7
|
/** @internal */
|
|
@@ -33,6 +33,7 @@ export const $decorators = {
|
|
|
33
33
|
"Azure.ResourceManager.Legacy": {
|
|
34
34
|
customAzureResource: $customAzureResource,
|
|
35
35
|
externalTypeRef: $externalTypeRef,
|
|
36
|
+
armOperationRoute: $armOperationRoute,
|
|
36
37
|
},
|
|
37
38
|
};
|
|
38
39
|
export const $flags = definePackageFlags({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsp-index.js","sourceRoot":"","sources":["../../src/tsp-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAGxD,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACnG,OAAO,EACL,kBAAkB,EAClB,4BAA4B,EAC5B,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,EACtB,UAAU,EACV,qBAAqB,EACrB,eAAe,GAChB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,gBAAgB;AAChB,MAAM,CAAC,MAAM,WAAW,GAAG;IACz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|
5
|
+
/**
|
|
6
|
+
* Route options for an operation
|
|
7
|
+
*/
|
|
8
|
+
model ArmOperationOptions {
|
|
9
|
+
/** Should a static route be used */
|
|
10
|
+
useStaticRoute?: boolean;
|
|
11
|
+
|
|
12
|
+
/** The status route for operations to use */
|
|
13
|
+
route?: string;
|
|
14
|
+
}
|
|
5
15
|
/**
|
|
6
16
|
* This decorator is used on resources that do not satisfy the definition of a resource
|
|
7
17
|
* but need to be identified as such.
|
|
@@ -13,3 +23,11 @@ extern dec customAzureResource(target: Model);
|
|
|
13
23
|
* @param jsonRef - External reference(e.g. "../../common.json#/definitions/Foo")
|
|
14
24
|
*/
|
|
15
25
|
extern dec externalTypeRef(entity: Model | ModelProperty, jsonRef: valueof string);
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Signifies that an operation is an Azure Resource Manager operation
|
|
29
|
+
* and optionally associates the operation with a route template.
|
|
30
|
+
* @param target The operation to associate the model with
|
|
31
|
+
* @param route Optional route to associate with the operation
|
|
32
|
+
*/
|
|
33
|
+
extern dec armOperationRoute(target: Operation, route?: valueof ArmOperationOptions);
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
import "@typespec/rest";
|
|
2
|
+
import "@typespec/http";
|
|
3
|
+
|
|
4
|
+
namespace Azure.ResourceManager.Legacy;
|
|
5
|
+
|
|
6
|
+
using Http;
|
|
7
|
+
using Azure.ResourceManager.Private;
|
|
8
|
+
using Rest;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* An operation template used to build extension resource operations using non-standard paths.
|
|
12
|
+
* @template TargetParameters The path parameters for the target resource
|
|
13
|
+
* @template ExtensionParentParameters Parent parameters of the extension resource
|
|
14
|
+
* @template ExtensionInstanceParameters The instance parameters of the extension resource
|
|
15
|
+
*/
|
|
16
|
+
@doc("")
|
|
17
|
+
interface ExtensionOperations<
|
|
18
|
+
TargetParameters extends {},
|
|
19
|
+
ExtensionParentParameters extends {},
|
|
20
|
+
ExtensionInstanceParameters extends {}
|
|
21
|
+
> {
|
|
22
|
+
/**
|
|
23
|
+
* A long-running resource CreateOrUpdate (PUT)
|
|
24
|
+
* @template Resource the resource being created or updated
|
|
25
|
+
* @template LroHeaders Optional. Allows overriding the lro headers returned on resource create
|
|
26
|
+
* @template Parameters Optional. Additional parameters after the path parameters
|
|
27
|
+
* @template Response Optional. The success response(s) for the PUT operation
|
|
28
|
+
* @template OptionalRequestBody Optional. Indicates whether the request body is optional
|
|
29
|
+
* @template ErrorType Optional. The error response, if non-standard.
|
|
30
|
+
* @template OperationOptions Optional. The route options for the operation.
|
|
31
|
+
*/
|
|
32
|
+
@armOperationRoute(OperationOptions)
|
|
33
|
+
@doc("Create a {name}", Resource)
|
|
34
|
+
@armResourceCreateOrUpdate(Resource)
|
|
35
|
+
@Azure.Core.Foundations.Private.defaultFinalStateVia(#["location", "azure-async-operation"])
|
|
36
|
+
@put
|
|
37
|
+
CreateOrUpdateAsync<
|
|
38
|
+
Resource extends Foundations.SimpleResource,
|
|
39
|
+
LroHeaders extends TypeSpec.Reflection.Model = ArmAsyncOperationHeader<FinalResult = Resource> &
|
|
40
|
+
Azure.Core.Foundations.RetryAfterHeader,
|
|
41
|
+
Parameters extends {} = {},
|
|
42
|
+
Response extends {} = ArmResourceUpdatedResponse<Resource> | ArmResourceCreatedResponse<
|
|
43
|
+
Resource,
|
|
44
|
+
LroHeaders
|
|
45
|
+
>,
|
|
46
|
+
OptionalRequestBody extends valueof boolean = false,
|
|
47
|
+
ErrorType extends {} = ErrorResponse,
|
|
48
|
+
OperationOptions extends valueof ArmOperationOptions = #{ useStaticRoute: false }
|
|
49
|
+
>(
|
|
50
|
+
...TargetParameters,
|
|
51
|
+
...ExtensionInstanceParameters,
|
|
52
|
+
...Parameters,
|
|
53
|
+
@doc("Resource create parameters.") @armBodyRoot(OptionalRequestBody) resource: Resource,
|
|
54
|
+
): Response | ErrorType;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* A synchronous resource CreateOrUpdate (PUT)
|
|
58
|
+
* @template Resource the resource being created or updated
|
|
59
|
+
* @template Parameters Optional. Additional parameters after the path parameters
|
|
60
|
+
* @template Response Optional. The success response(s) for the PUT operation
|
|
61
|
+
* @template OptionalRequestBody Optional. Indicates whether the request body is optional
|
|
62
|
+
* @template ErrorType Optional. The error response, if non-standard.
|
|
63
|
+
* @template OperationOptions Optional. The route options for the operation.
|
|
64
|
+
*/
|
|
65
|
+
#suppress "@azure-tools/typespec-azure-core/no-private-usage"
|
|
66
|
+
@armOperationRoute(OperationOptions)
|
|
67
|
+
@doc("Create a {name}", Resource)
|
|
68
|
+
@armResourceCreateOrUpdate(Resource)
|
|
69
|
+
@put
|
|
70
|
+
CreateOrUpdateSync<
|
|
71
|
+
Resource extends Foundations.SimpleResource,
|
|
72
|
+
Parameters extends {} = {},
|
|
73
|
+
Response extends {} = ArmResourceUpdatedResponse<Resource> | ArmResourceCreatedSyncResponse<Resource>,
|
|
74
|
+
OptionalRequestBody extends valueof boolean = false,
|
|
75
|
+
ErrorType extends {} = ErrorResponse,
|
|
76
|
+
OperationOptions extends valueof ArmOperationOptions = #{ useStaticRoute: false }
|
|
77
|
+
>(
|
|
78
|
+
...TargetParameters,
|
|
79
|
+
...ExtensionInstanceParameters,
|
|
80
|
+
...Parameters,
|
|
81
|
+
@doc("Resource create parameters.") @armBodyRoot(OptionalRequestBody) resource: Resource,
|
|
82
|
+
): Response | ErrorType;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* A long-running resource Update (PATCH)
|
|
86
|
+
* @template Resource the resource being created or updated
|
|
87
|
+
* @template PatchModel the PATCH request model
|
|
88
|
+
* @template LroHeaders Optional. Allows overriding the lro headers returned on resource create
|
|
89
|
+
* @template Parameters Optional. Additional parameters after the path parameters
|
|
90
|
+
* @template Response Optional. The success response(s) for the PATCH operation
|
|
91
|
+
* @template OptionalRequestBody Optional. Indicates whether the request body is optional
|
|
92
|
+
* @template ErrorType Optional. The error response, if non-standard.
|
|
93
|
+
* @template OperationOptions Optional. The route options for the operation.
|
|
94
|
+
*/
|
|
95
|
+
@armOperationRoute(OperationOptions)
|
|
96
|
+
@doc("Update a {name}", Resource)
|
|
97
|
+
@armResourceUpdate(Resource)
|
|
98
|
+
@patch(#{ implicitOptionality: false })
|
|
99
|
+
CustomPatchAsync<
|
|
100
|
+
Resource extends Foundations.SimpleResource,
|
|
101
|
+
PatchModel extends {} = Azure.ResourceManager.Foundations.TagsUpdateModel<Resource>,
|
|
102
|
+
LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader<
|
|
103
|
+
Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
|
|
104
|
+
Resource,
|
|
105
|
+
string
|
|
106
|
+
> &
|
|
107
|
+
Azure.Core.Foundations.RetryAfterHeader,
|
|
108
|
+
Parameters extends {} = {},
|
|
109
|
+
Response extends {} = ArmResponse<Resource> | ArmAcceptedLroResponse<
|
|
110
|
+
"Resource update request accepted.",
|
|
111
|
+
LroHeaders
|
|
112
|
+
>,
|
|
113
|
+
OptionalRequestBody extends valueof boolean = false,
|
|
114
|
+
ErrorType extends {} = ErrorResponse,
|
|
115
|
+
OperationOptions extends valueof ArmOperationOptions = #{ useStaticRoute: false }
|
|
116
|
+
>(
|
|
117
|
+
...TargetParameters,
|
|
118
|
+
...ExtensionInstanceParameters,
|
|
119
|
+
...Parameters,
|
|
120
|
+
@doc("Resource create parameters.") @armBodyRoot(OptionalRequestBody) properties: PatchModel,
|
|
121
|
+
): Response | ErrorType;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* A synchronous resource Update (PATCH)
|
|
125
|
+
* @template Resource the resource being created or updated
|
|
126
|
+
* @template PatchModel the PATCH request model
|
|
127
|
+
* @template Parameters Optional. Additional parameters after the path parameters
|
|
128
|
+
* @template Response Optional. The success response(s) for the PATCH operation
|
|
129
|
+
* @template OptionalRequestBody Optional. Indicates whether the request body is optional
|
|
130
|
+
* @template ErrorType Optional. The error response, if non-standard.
|
|
131
|
+
* @template OperationOptions Optional. The route options for the operation.
|
|
132
|
+
*/
|
|
133
|
+
@armOperationRoute(OperationOptions)
|
|
134
|
+
@doc("Update a {name}", Resource)
|
|
135
|
+
@armResourceUpdate(Resource)
|
|
136
|
+
@patch(#{ implicitOptionality: false })
|
|
137
|
+
CustomPatchSync<
|
|
138
|
+
Resource extends Foundations.SimpleResource,
|
|
139
|
+
PatchModel extends {} = Azure.ResourceManager.Foundations.TagsUpdateModel<Resource>,
|
|
140
|
+
Parameters extends {} = {},
|
|
141
|
+
Response extends {} = ArmResponse<Resource>,
|
|
142
|
+
OptionalRequestBody extends valueof boolean = false,
|
|
143
|
+
ErrorType extends {} = ErrorResponse,
|
|
144
|
+
OperationOptions extends valueof ArmOperationOptions = #{ useStaticRoute: false }
|
|
145
|
+
>(
|
|
146
|
+
...TargetParameters,
|
|
147
|
+
...ExtensionInstanceParameters,
|
|
148
|
+
...Parameters,
|
|
149
|
+
@doc("Resource create parameters.") @armBodyRoot(OptionalRequestBody) properties: PatchModel,
|
|
150
|
+
): Response | ErrorType;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Delete a resource asynchronously
|
|
154
|
+
* @template Resource The resource being deleted
|
|
155
|
+
* @template LroHeaders The lro headers for the operation
|
|
156
|
+
* @template Parameters Optional. Additional parameters after the path parameters
|
|
157
|
+
* @template Response Optional. The success response(s) for the delete operation
|
|
158
|
+
* @template ErrorType Optional. The error response, if non-standard.
|
|
159
|
+
* @template OperationOptions Optional. The route options for the operation.
|
|
160
|
+
*/
|
|
161
|
+
#suppress "@azure-tools/typespec-azure-core/no-response-body" "Valid"
|
|
162
|
+
@armOperationRoute(OperationOptions)
|
|
163
|
+
@doc("Delete a {name}", Resource)
|
|
164
|
+
@delete
|
|
165
|
+
@deletesResource(Resource)
|
|
166
|
+
@armResourceDelete(Resource)
|
|
167
|
+
DeleteWithoutOkAsync<
|
|
168
|
+
Resource extends Foundations.SimpleResource,
|
|
169
|
+
LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader &
|
|
170
|
+
Azure.Core.Foundations.RetryAfterHeader,
|
|
171
|
+
Parameters extends {} = {},
|
|
172
|
+
Response extends {} = ArmDeleteAcceptedLroResponse<LroHeaders> | ArmDeletedNoContentResponse,
|
|
173
|
+
ErrorType extends {} = ErrorResponse,
|
|
174
|
+
OperationOptions extends valueof ArmOperationOptions = #{ useStaticRoute: false }
|
|
175
|
+
>(...TargetParameters, ...ExtensionInstanceParameters, ...Parameters): Response | ErrorType;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Delete a resource synchronously
|
|
179
|
+
* @template Resource The resource being deleted
|
|
180
|
+
* @template Parameters Optional. Additional parameters after the path parameters
|
|
181
|
+
* @template Response Optional. The success response(s) for the delete operation
|
|
182
|
+
* @template ErrorType Optional. The error response, if non-standard.
|
|
183
|
+
* @template OperationOptions Optional. The route options for the operation.
|
|
184
|
+
*/
|
|
185
|
+
#suppress "@azure-tools/typespec-azure-core/no-response-body" "Valid"
|
|
186
|
+
@armOperationRoute(OperationOptions)
|
|
187
|
+
@doc("Delete a {name}", Resource)
|
|
188
|
+
@delete
|
|
189
|
+
@deletesResource(Resource)
|
|
190
|
+
@armResourceDelete(Resource)
|
|
191
|
+
DeleteSync<
|
|
192
|
+
Resource extends Foundations.SimpleResource,
|
|
193
|
+
Parameters extends {} = {},
|
|
194
|
+
Response extends {} = ArmDeletedResponse | ArmDeletedNoContentResponse,
|
|
195
|
+
ErrorType extends {} = ErrorResponse,
|
|
196
|
+
OperationOptions extends valueof ArmOperationOptions = #{ useStaticRoute: false }
|
|
197
|
+
>(...TargetParameters, ...ExtensionInstanceParameters, ...Parameters): Response | ErrorType;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* @dev Get a resource
|
|
201
|
+
* @template Resource The resource being read
|
|
202
|
+
* @template Parameters Optional. Additional parameters after the path parameters
|
|
203
|
+
* @template Response Optional. The success response for a get operation.
|
|
204
|
+
* @template ErrorType Optional. The error response, if non-standard.
|
|
205
|
+
* @template OperationOptions Optional. The route options for the operation.
|
|
206
|
+
*/
|
|
207
|
+
@armOperationRoute(OperationOptions)
|
|
208
|
+
@doc("Get a {name}", Resource)
|
|
209
|
+
@get
|
|
210
|
+
@readsResource(Resource)
|
|
211
|
+
@armResourceRead(Resource)
|
|
212
|
+
Read<
|
|
213
|
+
Resource extends Foundations.SimpleResource,
|
|
214
|
+
Parameters extends {} = {},
|
|
215
|
+
Response extends {} = ArmResponse<Resource>,
|
|
216
|
+
ErrorType extends {} = ErrorResponse,
|
|
217
|
+
OperationOptions extends valueof ArmOperationOptions = #{ useStaticRoute: false }
|
|
218
|
+
>(...TargetParameters, ...ExtensionInstanceParameters, ...Parameters): Response | ErrorType;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Check a resource's existence via HEAD operation
|
|
222
|
+
* @template Resource The resource being checked
|
|
223
|
+
* @template Parameters Optional. Additional parameters after the path parameters
|
|
224
|
+
* @template Response Optional. The success response for a head operation (by default NoContent or NotFound response).
|
|
225
|
+
* @template ErrorType Optional. The error response, if non-standard.
|
|
226
|
+
* @template OperationOptions Optional. The route options for the operation.
|
|
227
|
+
*/
|
|
228
|
+
@armOperationRoute(OperationOptions)
|
|
229
|
+
@doc("Check for the existence of a {name}", Resource)
|
|
230
|
+
@head
|
|
231
|
+
CheckExistence<
|
|
232
|
+
Resource extends Foundations.SimpleResource,
|
|
233
|
+
Parameters extends {} = {},
|
|
234
|
+
Response extends {} = ArmResourceExistsResponse | ArmResourceNotFoundResponse,
|
|
235
|
+
ErrorType extends {} = ErrorResponse,
|
|
236
|
+
OperationOptions extends valueof ArmOperationOptions = #{ useStaticRoute: false }
|
|
237
|
+
> is Foundations.ArmReadOperation<
|
|
238
|
+
TargetParameters & ExtensionInstanceParameters & Parameters,
|
|
239
|
+
Response,
|
|
240
|
+
ErrorType
|
|
241
|
+
>;
|
|
242
|
+
/**
|
|
243
|
+
* List a resource
|
|
244
|
+
* @template Resource The resource being listed
|
|
245
|
+
* @template Parameters Optional. Additional parameters after the path parameters
|
|
246
|
+
* @template Response Optional. The response returned by the list
|
|
247
|
+
* @template ErrorType Optional. The error response, if non-standard.
|
|
248
|
+
* @template OperationOptions Optional. The route options for the operation.
|
|
249
|
+
*/
|
|
250
|
+
@armOperationRoute(OperationOptions)
|
|
251
|
+
@doc("List a {name}", Resource)
|
|
252
|
+
@get
|
|
253
|
+
@listsResource(Resource)
|
|
254
|
+
@armResourceList(Resource)
|
|
255
|
+
List<
|
|
256
|
+
Resource extends Foundations.SimpleResource,
|
|
257
|
+
Parameters extends {} = {},
|
|
258
|
+
Response extends {} = ArmResponse<ResourceListResult<Resource>>,
|
|
259
|
+
ErrorType extends {} = ErrorResponse,
|
|
260
|
+
OperationOptions extends valueof ArmOperationOptions = #{ useStaticRoute: false }
|
|
261
|
+
>(...TargetParameters, ...ExtensionParentParameters, ...Parameters): Response | ErrorType;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* A synchronous resource action.
|
|
265
|
+
* @template Resource The resource being acted upon
|
|
266
|
+
* @template Request The request model for the action
|
|
267
|
+
* @template Response The response model for the action
|
|
268
|
+
* @template Parameters Optional. Additional parameters after the path parameters
|
|
269
|
+
* @template OptionalRequestBody Optional. Indicates whether the request body is optional
|
|
270
|
+
* @template ErrorType Optional. The error response, if non-standard.
|
|
271
|
+
* @template OperationOptions Optional. The route options for the operation.
|
|
272
|
+
*/
|
|
273
|
+
@doc("")
|
|
274
|
+
@armOperationRoute(OperationOptions)
|
|
275
|
+
@armResourceAction(Resource)
|
|
276
|
+
@Private.enforceConstraint(Resource, Foundations.Resource)
|
|
277
|
+
@post
|
|
278
|
+
@returnsDoc("Azure operation completed successfully.")
|
|
279
|
+
ActionSync<
|
|
280
|
+
Resource extends Foundations.SimpleResource,
|
|
281
|
+
Request extends TypeSpec.Reflection.Model | void,
|
|
282
|
+
Response extends TypeSpec.Reflection.Model | void,
|
|
283
|
+
Parameters extends {} = {},
|
|
284
|
+
OptionalRequestBody extends valueof boolean = false,
|
|
285
|
+
ErrorType extends {} = ErrorResponse,
|
|
286
|
+
OperationOptions extends valueof ArmOperationOptions = #{ useStaticRoute: false }
|
|
287
|
+
>(
|
|
288
|
+
...TargetParameters,
|
|
289
|
+
...ExtensionInstanceParameters,
|
|
290
|
+
...Parameters,
|
|
291
|
+
|
|
292
|
+
@doc("The content of the action request")
|
|
293
|
+
@armBodyRoot(OptionalRequestBody)
|
|
294
|
+
body: Request,
|
|
295
|
+
): Response | ErrorType;
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* A long-running resource action.
|
|
299
|
+
* @template Resource The resource being acted upon
|
|
300
|
+
* @template Request The request model for the action
|
|
301
|
+
* @template Result The result model for the action
|
|
302
|
+
* @template LroHeaders Optional. Allows overriding the headers returned in the Accepted response
|
|
303
|
+
* @template Response The full response union of the action
|
|
304
|
+
* @template Parameters Optional. Additional parameters after the path parameters
|
|
305
|
+
* @template OptionalRequestBody Optional. Indicates whether the request body is optional
|
|
306
|
+
* @template ErrorType Optional. The error response, if non-standard.
|
|
307
|
+
* @template OperationOptions Optional. The route options for the operation.
|
|
308
|
+
*/
|
|
309
|
+
#suppress "@azure-tools/typespec-azure-core/no-response-body" "ARM"
|
|
310
|
+
@doc("")
|
|
311
|
+
@armOperationRoute(OperationOptions)
|
|
312
|
+
@armResourceAction(Resource)
|
|
313
|
+
@Private.enforceConstraint(Resource, Foundations.Resource)
|
|
314
|
+
@post
|
|
315
|
+
@returnsDoc("Azure operation completed successfully.")
|
|
316
|
+
ActionAsync<
|
|
317
|
+
Resource extends Foundations.SimpleResource,
|
|
318
|
+
Request extends TypeSpec.Reflection.Model | void,
|
|
319
|
+
Result extends TypeSpec.Reflection.Model | void,
|
|
320
|
+
LroHeaders extends TypeSpec.Reflection.Model = ArmLroLocationHeader<
|
|
321
|
+
Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
|
|
322
|
+
Result,
|
|
323
|
+
string
|
|
324
|
+
> &
|
|
325
|
+
Azure.Core.Foundations.RetryAfterHeader,
|
|
326
|
+
Parameters extends {} = {},
|
|
327
|
+
Response extends {} | void = ArmAcceptedLroResponse<
|
|
328
|
+
"Resource operation accepted.",
|
|
329
|
+
LroHeaders
|
|
330
|
+
> | Result,
|
|
331
|
+
OptionalRequestBody extends valueof boolean = false,
|
|
332
|
+
ErrorType extends {} = ErrorResponse,
|
|
333
|
+
OperationOptions extends valueof ArmOperationOptions = #{ useStaticRoute: false }
|
|
334
|
+
>(
|
|
335
|
+
...TargetParameters,
|
|
336
|
+
...ExtensionInstanceParameters,
|
|
337
|
+
...Parameters,
|
|
338
|
+
|
|
339
|
+
@doc("The content of the action request")
|
|
340
|
+
@armBodyRoot(OptionalRequestBody)
|
|
341
|
+
body: Request,
|
|
342
|
+
): Response | ErrorType;
|
|
343
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import "@typespec/rest";
|
|
2
|
+
import "@typespec/http";
|
|
3
|
+
|
|
4
|
+
namespace Azure.ResourceManager.Legacy;
|
|
5
|
+
|
|
6
|
+
using Http;
|
|
7
|
+
using Azure.ResourceManager.Foundations;
|
|
8
|
+
using Azure.ResourceManager.Private;
|
|
9
|
+
using Rest;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* This is the interface that implements the standard Azure Resource Manager operation that returns
|
|
13
|
+
* all supported RP operations. You should have exactly one declaration for each
|
|
14
|
+
* Azure Resource Manager service. It implements
|
|
15
|
+
* GET "/providers/{provider-namespace}/operations"
|
|
16
|
+
*
|
|
17
|
+
* @template Response The response returned by the operation list.
|
|
18
|
+
* @template Error the error response returned by the operation list.
|
|
19
|
+
*/
|
|
20
|
+
interface Operations<
|
|
21
|
+
Response extends {} = ArmResponse<OperationListResult>,
|
|
22
|
+
Error extends {} = ErrorResponse
|
|
23
|
+
> {
|
|
24
|
+
@tag("Operations")
|
|
25
|
+
@autoRoute
|
|
26
|
+
@armUpdateProviderNamespace
|
|
27
|
+
@doc("List the operations for the provider")
|
|
28
|
+
@segment("operations")
|
|
29
|
+
@get
|
|
30
|
+
list(
|
|
31
|
+
...ApiVersionParameter,
|
|
32
|
+
|
|
33
|
+
@path
|
|
34
|
+
@segment("providers")
|
|
35
|
+
@doc("The provider namespace (this parameter will not show up in operations).")
|
|
36
|
+
provider: "Microsoft.ThisWillBeReplaced",
|
|
37
|
+
): Response | Error;
|
|
38
|
+
}
|