-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Expand file tree
/
Copy pathAddressResource.tsp
More file actions
132 lines (119 loc) · 4.08 KB
/
AddressResource.tsp
File metadata and controls
132 lines (119 loc) · 4.08 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
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 TypeSpec.Http;
using TypeSpec.OpenAPI;
namespace Microsoft.EdgeOrder;
/**
* Address Resource.
*/
model AddressResource
is Azure.ResourceManager.TrackedResource<AddressProperties, false> {
...ResourceNameParameter<
Resource = AddressResource,
KeyName = "addressName",
SegmentName = "addresses",
NamePattern = "^[-\\w\\.]+$"
>;
}
@armResourceOperations
interface AddressResources {
/**
* Get information about the specified address.
*/
get is ArmResourceRead<AddressResource>;
/**
* Create a new address with the specified parameters. Existing address cannot be updated with this API and should
* instead be updated with the Update address API.
*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
create is ArmResourceCreateOrReplaceAsync<
AddressResource,
Response = ArmResourceUpdatedResponse<AddressResource> | ArmAcceptedLroResponse,
LroHeaders = ArmLroLocationHeader & Azure.Core.Foundations.RetryAfterHeader
>;
/**
* Update the properties of an existing address.
*/
@patch(#{ implicitOptionality: false })
update is ArmCustomPatchAsync<
AddressResource,
PatchModel = AddressUpdateParameter,
Parameters = {
/**
* Defines the If-Match condition. The patch will be performed only if the ETag of the job on the server matches this value.
*/
#suppress "@azure-tools/typespec-azure-core/casing-style" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
@header("If-Match")
`If-Match`?: string;
}
>;
/**
* Delete an address.
*/
delete is ArmResourceDeleteWithoutOkAsync<AddressResource>;
/**
* List all the addresses available under the given resource group.
*/
listByResourceGroup is ArmResourceListByParent<
AddressResource,
Parameters = {
/**
* $filter is supported to filter based on shipping address properties. Filter supports only equals operation.
*/
@query("$filter")
$filter?: string;
/**
* $skipToken is supported on Get list of addresses, which provides the next page in the list of addresses.
*/
@query("$skipToken")
$skipToken?: string;
/**
* $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller.
*/
@query("$top")
$top?: int32;
},
Response = ArmResponse<AddressResourceList>
>;
/**
* List all the addresses available under the subscription.
*/
listBySubscription is ArmListBySubscription<
AddressResource,
Parameters = {
/**
* $filter is supported to filter based on shipping address properties. Filter supports only equals operation.
*/
@query("$filter")
$filter?: string;
/**
* $skipToken is supported on Get list of addresses, which provides the next page in the list of addresses.
*/
@query("$skipToken")
$skipToken?: string;
/**
* $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller.
*/
@query("$top")
$top?: int32;
},
Response = ArmResponse<AddressResourceList>
>;
}
@@maxLength(AddressResource.name, 24);
@@minLength(AddressResource.name, 3);
@@doc(AddressResource.name,
"The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and underscore only."
);
@@doc(AddressResource.properties, "Properties of an address.");
@@doc(AddressResources.create::parameters.resource,
"Address details from request body."
);
@@doc(AddressResources.update::parameters.properties,
"Address update parameters from request body."
);