-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathazure-resource-manager.tsp
109 lines (86 loc) · 2.65 KB
/
azure-resource-manager.tsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import "@typespec/http";
import "@typespec/rest";
import "@typespec/versioning";
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
using TypeSpec.Http;
using TypeSpec.Rest;
using TypeSpec.Versioning;
using Azure.Core;
using Azure.ResourceManager;
/** Contoso Resource Provider management API. */
@armProviderNamespace
@service({
title: "ContosoProviderHubClient",
})
@versioned(Versions)
namespace Microsoft.ContosoProviderHub;
/** Contoso API versions */
enum Versions {
/** 2021-10-01-preview version */
@useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1)
@armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5)
`2021-10-01-preview`,
}
/** A ContosoProviderHub resource */
model Employee is TrackedResource<EmployeeProperties> {
...ResourceNameParameter<Employee>;
}
/** Employee properties */
model EmployeeProperties {
/** Age of employee */
age?: int32;
/** City of employee */
city?: string;
/** Profile of employee */
@encode("base64url")
profile?: bytes;
/** The status of the last operation. */
@visibility("read")
provisioningState?: ProvisioningState;
}
/** The provisioning state of a resource. */
@lroStatus
union ProvisioningState {
string,
/** The resource create request has been accepted */
Accepted: "Accepted",
/** The resource is being provisioned */
Provisioning: "Provisioning",
/** The resource is updating */
Updating: "Updating",
/** Resource has been created. */
Succeeded: "Succeeded",
/** Resource creation failed. */
Failed: "Failed",
/** Resource creation was canceled. */
Canceled: "Canceled",
/** The resource is being deleted */
Deleting: "Deleting",
}
/** Employee move request */
model MoveRequest {
/** The moving from location */
from: string;
/** The moving to location */
to: string;
}
/** Employee move response */
model MoveResponse {
/** The status of the move */
movingStatus: string;
}
interface Operations extends Azure.ResourceManager.Operations {}
@armResourceOperations
interface Employees {
get is ArmResourceRead<Employee>;
createOrUpdate is ArmResourceCreateOrReplaceAsync<Employee>;
update is ArmResourcePatchSync<Employee, EmployeeProperties>;
delete is ArmResourceDeleteWithoutOkAsync<Employee>;
listByResourceGroup is ArmResourceListByParent<Employee>;
listBySubscription is ArmListBySubscription<Employee>;
/** A sample resource action that move employee to different location */
move is ArmResourceActionSync<Employee, MoveRequest, MoveResponse>;
/** A sample HEAD operation to check resource existence */
checkExistence is ArmResourceCheckExistence<Employee>;
}