forked from Azure/azure-rest-api-specs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathemployee.tsp
63 lines (49 loc) · 1.46 KB
/
employee.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
import "@typespec/rest";
import "@typespec/http";
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
using TypeSpec.Rest;
using TypeSpec.Http;
using Azure.Core;
using Azure.ResourceManager;
namespace Microsoft.Contoso;
/** Employee 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 resource provisioning state. */
@lroStatus
union ProvisioningState {
ResourceProvisioningState,
/** The resource is being provisioned */
Provisioning: "Provisioning",
/** The resource is updating */
Updating: "Updating",
/** The resource is being deleted */
Deleting: "Deleting",
/** The resource create request has been accepted */
Accepted: "Accepted",
string,
}
@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>;
}