-
Notifications
You must be signed in to change notification settings - Fork 5.1k
/
Target.tsp
79 lines (69 loc) · 2.41 KB
/
Target.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
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "@typespec/openapi";
import "@typespec/rest";
import "./models.tsp";
using TypeSpec.Rest;
using Azure.ResourceManager;
using Azure.ResourceManager.Foundations;
using TypeSpec.Http;
using TypeSpec.OpenAPI;
using Azure.Core;
namespace Microsoft.Chaos;
/**
* Model that represents a Target resource.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-no-record" "existing API"
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "Required to add location to proxy resource."
model Target is Azure.ResourceManager.ProxyResource<Record<unknown>> {
...ResourceNameParameter<
Resource = Target,
KeyName = "targetName",
SegmentName = "targets",
NamePattern = "^[a-zA-Z0-9_\\-\\.]+$"
>;
/**
* Azure location of the resource.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "Existing property implementation."
location?: azureLocation;
}
alias TargetParentResourceParameters = BaseParameters<Target> &
ParentResourceParameters;
#suppress "@azure-tools/typespec-azure-resource-manager/improper-subscription-list-operation" "Does not expose subscription-scoped list, linting error."
@armResourceOperations
interface Targets {
/**
* Get a Target resource that extends a tracked regional resource.
*/
get is ArmResourceRead<Target, TargetParentResourceParameters>;
/**
* Create or update a Target resource that extends a tracked regional resource.
*/
createOrUpdate is ArmResourceCreateOrReplaceSync<
Target,
TargetParentResourceParameters
>;
/**
* Delete a Target resource that extends a tracked regional resource.
*/
delete is ArmResourceDeleteSync<Target, TargetParentResourceParameters>;
/**
* Get a list of Target resources that extend a tracked regional resource.
*/
list is ArmResourceListByParent<
Target,
{
...TargetParentResourceParameters;
@doc("String that sets the continuation token.")
@query("continuationToken")
continuationToken?: string;
},
Response = TargetListResult
>;
}
@@doc(Target.name, "String that represents a Target resource name.");
@@doc(Target.properties, "The properties of the target resource.");
@@doc(Targets.createOrUpdate::parameters.resource,
"Target resource to be created or updated."
);