-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Expand file tree
/
Copy pathSchema.tsp
More file actions
106 lines (86 loc) · 2.75 KB
/
Copy pathSchema.tsp
File metadata and controls
106 lines (86 loc) · 2.75 KB
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
import "@typespec/http";
import "@typespec/rest";
import "@typespec/versioning";
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "./ConfigurationModel.tsp";
import "./ConfigurationType.tsp";
import "./ProvisioningState.tsp";
import "./SchemaVersion.tsp";
import "./VersionParameter.tsp";
import "./RemoveVersionResponse.tsp";
using TypeSpec.OpenAPI;
using TypeSpec.Http;
using TypeSpec.Rest;
using TypeSpec.Versioning;
using Azure.Core;
using Azure.ResourceManager;
namespace Microsoft.Edge;
@doc("Schema Properties")
model SchemaProperties {
@doc("Current Version of schema")
@visibility(Lifecycle.Read)
currentVersion?: string;
@doc("Provisioning state of resource")
@visibility(Lifecycle.Read)
provisioningState?: ProvisioningState;
}
@doc("Schema Version With Update Type")
model SchemaVersionWithUpdateType {
@doc("Update type")
updateType?: UpdateType;
@doc("Version to create")
@pattern("^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$")
version?: string;
@doc("Schema Version")
schemaVersion: SchemaVersion;
}
@doc("The updatable properties of the Schema.")
model SchemaUpdate {
@doc("The resource-specific properties for this resource.")
properties?: SchemaUpdateProperties;
#suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@doc("Resource tags.")
tags?: Record<string>;
}
@doc("The updatable properties of the Schema.")
model SchemaUpdateProperties is SchemaProperties;
@doc("Schema Resource")
@resource("schemas")
model Schema is TrackedResource<SchemaProperties> {
@doc("The name of the Schema")
@pattern("^(?!.*\\.\\.)[a-zA-Z0-9-][a-zA-Z0-9._-]{1,68}[a-zA-Z0-9-]$")
@path
@key("schemaName")
@segment("schemas")
name: string;
...EntityTagProperty;
}
@armResourceOperations
interface Schemas {
@doc("Get a Schema Resource")
get is ArmResourceRead<Schema>;
@doc("Create or update a Schema Resource")
createOrUpdate is ArmResourceCreateOrReplaceAsync<Schema>;
@doc("update a Schema Resource")
update is ArmCustomPatchSync<Schema, PatchModel = SchemaUpdate>;
@doc("Delete a Schema Resource")
delete is ArmResourceDeleteWithoutOkAsync<Schema>;
@doc("Create a Schema Version Resource")
createVersion is ArmResourceActionAsync<
Schema,
SchemaVersionWithUpdateType,
SchemaVersion
>;
@doc("Remove Schema Version Resource")
removeVersion is ArmResourceActionSync<
Schema,
VersionParameter,
RemoveVersionResponse
>;
@doc("List by specified resource group")
listByResourceGroup is ArmResourceListByParent<Schema>;
@doc("List by subscription")
listBySubscription is ArmListBySubscription<Schema>;
}