Skip to content

Commit e95df0a

Browse files
committed
Creating a new TestService with new structure layout
1 parent be0a8e2 commit e95df0a

34 files changed

+2459
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import "@typespec/rest";
2+
import "@typespec/http";
3+
import "@azure-tools/typespec-azure-core";
4+
import "@azure-tools/typespec-azure-resource-manager";
5+
6+
using TypeSpec.Rest;
7+
using TypeSpec.Http;
8+
using Azure.Core;
9+
using Azure.ResourceManager;
10+
11+
namespace Microsoft.Contoso;
12+
13+
/** Employee resource */
14+
model Employee is TrackedResource<EmployeeProperties> {
15+
...ResourceNameParameter<Employee>;
16+
}
17+
18+
/** Employee properties */
19+
model EmployeeProperties {
20+
/** Age of employee */
21+
age?: int32;
22+
23+
/** City of employee */
24+
city?: string;
25+
26+
/** Profile of employee */
27+
@encode("base64url")
28+
profile?: bytes;
29+
30+
/** The status of the last operation. */
31+
@visibility(Lifecycle.Read)
32+
provisioningState?: ProvisioningState;
33+
}
34+
35+
/** The resource provisioning state. */
36+
@lroStatus
37+
union ProvisioningState {
38+
ResourceProvisioningState,
39+
40+
/** The resource is being provisioned */
41+
Provisioning: "Provisioning",
42+
43+
/** The resource is updating */
44+
Updating: "Updating",
45+
46+
/** The resource is being deleted */
47+
Deleting: "Deleting",
48+
49+
/** The resource create request has been accepted */
50+
Accepted: "Accepted",
51+
52+
string,
53+
}
54+
55+
@armResourceOperations
56+
interface Employees {
57+
get is ArmResourceRead<Employee>;
58+
createOrUpdate is ArmResourceCreateOrReplaceAsync<Employee>;
59+
update is ArmResourcePatchSync<Employee, EmployeeProperties>;
60+
delete is ArmResourceDeleteWithoutOkAsync<Employee>;
61+
listByResourceGroup is ArmResourceListByParent<Employee>;
62+
listBySubscription is ArmListBySubscription<Employee>;
63+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"title": "Employees_CreateOrUpdate",
3+
"operationId": "Employees_CreateOrUpdate",
4+
"parameters": {
5+
"api-version": "2021-10-01-preview",
6+
"subscriptionId": "11809CA1-E126-4017-945E-AA795CD5C5A9",
7+
"resourceGroupName": "rgopenapi",
8+
"employeeName": "9KF-f-8b",
9+
"resource": {
10+
"properties": {
11+
"age": 30,
12+
"city": "gydhnntudughbmxlkyzrskcdkotrxn",
13+
"profile": "ms"
14+
},
15+
"tags": {
16+
"key2913": "urperxmkkhhkp"
17+
},
18+
"location": "itajgxyqozseoygnl"
19+
}
20+
},
21+
"responses": {
22+
"200": {
23+
"body": {
24+
"properties": {
25+
"age": 30,
26+
"city": "gydhnntudughbmxlkyzrskcdkotrxn",
27+
"profile": "ms",
28+
"provisioningState": "Succeeded"
29+
},
30+
"tags": {
31+
"key2913": "urperxmkkhhkp"
32+
},
33+
"location": "itajgxyqozseoygnl",
34+
"id": "/subscriptions/11809CA1-E126-4017-945E-AA795CD5C5A9/resourceGroups/rgopenapi/providers/Microsoft.Contoso/employees/le-8MU--J3W6q8D386p3-iT3",
35+
"name": "xepyxhpb",
36+
"type": "svvamxrdnnv",
37+
"systemData": {
38+
"createdBy": "iewyxsnriqktsvp",
39+
"createdByType": "User",
40+
"createdAt": "2023-05-19T00:28:48.610Z",
41+
"lastModifiedBy": "xrchbnnuzierzpxw",
42+
"lastModifiedByType": "User",
43+
"lastModifiedAt": "2023-05-19T00:28:48.610Z"
44+
}
45+
}
46+
},
47+
"201": {
48+
"headers": {
49+
"Azure-AsyncOperation": "https://contoso.com/operationstatus"
50+
},
51+
"body": {
52+
"properties": {
53+
"age": 30,
54+
"city": "gydhnntudughbmxlkyzrskcdkotrxn",
55+
"profile": "ms",
56+
"provisioningState": "Succeeded"
57+
},
58+
"tags": {
59+
"key2913": "urperxmkkhhkp"
60+
},
61+
"location": "itajgxyqozseoygnl",
62+
"id": "/subscriptions/11809CA1-E126-4017-945E-AA795CD5C5A9/resourceGroups/rgopenapi/providers/Microsoft.Contoso/employees/9KF-f-8b",
63+
"name": "xepyxhpb",
64+
"type": "svvamxrdnnv",
65+
"systemData": {
66+
"createdBy": "iewyxsnriqktsvp",
67+
"createdByType": "User",
68+
"createdAt": "2023-05-19T00:28:48.610Z",
69+
"lastModifiedBy": "xrchbnnuzierzpxw",
70+
"lastModifiedByType": "User",
71+
"lastModifiedAt": "2023-05-19T00:28:48.610Z"
72+
}
73+
}
74+
}
75+
}
76+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"title": "Employees_Delete",
3+
"operationId": "Employees_Delete",
4+
"parameters": {
5+
"api-version": "2021-10-01-preview",
6+
"subscriptionId": "11809CA1-E126-4017-945E-AA795CD5C5A9",
7+
"resourceGroupName": "rgopenapi",
8+
"employeeName": "5vX--BxSu3ux48rI4O9OQ569"
9+
},
10+
"responses": {
11+
"202": {
12+
"headers": {
13+
"Retry-After": 30,
14+
"location": "https://contoso.com/operationstatus"
15+
}
16+
},
17+
"204": {}
18+
}
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"title": "Employees_Get",
3+
"operationId": "Employees_Get",
4+
"parameters": {
5+
"api-version": "2021-10-01-preview",
6+
"subscriptionId": "11809CA1-E126-4017-945E-AA795CD5C5A9",
7+
"resourceGroupName": "rgopenapi",
8+
"employeeName": "le-8MU--J3W6q8D386p3-iT3"
9+
},
10+
"responses": {
11+
"200": {
12+
"body": {
13+
"properties": {
14+
"age": 30,
15+
"city": "gydhnntudughbmxlkyzrskcdkotrxn",
16+
"profile": "ms",
17+
"provisioningState": "Succeeded"
18+
},
19+
"tags": {
20+
"key2913": "urperxmkkhhkp"
21+
},
22+
"location": "itajgxyqozseoygnl",
23+
"id": "/subscriptions/11809CA1-E126-4017-945E-AA795CD5C5A9/resourceGroups/rgopenapi/providers/Microsoft.Contoso/employees/le-8MU--J3W6q8D386p3-iT3",
24+
"name": "xepyxhpb",
25+
"type": "svvamxrdnnv",
26+
"systemData": {
27+
"createdBy": "iewyxsnriqktsvp",
28+
"createdByType": "User",
29+
"createdAt": "2023-05-19T00:28:48.610Z",
30+
"lastModifiedBy": "xrchbnnuzierzpxw",
31+
"lastModifiedByType": "User",
32+
"lastModifiedAt": "2023-05-19T00:28:48.610Z"
33+
}
34+
}
35+
}
36+
}
37+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"title": "Employees_ListByResourceGroup",
3+
"operationId": "Employees_ListByResourceGroup",
4+
"parameters": {
5+
"api-version": "2021-10-01-preview",
6+
"subscriptionId": "11809CA1-E126-4017-945E-AA795CD5C5A9",
7+
"resourceGroupName": "rgopenapi"
8+
},
9+
"responses": {
10+
"200": {
11+
"body": {
12+
"value": [
13+
{
14+
"properties": {
15+
"age": 30,
16+
"city": "gydhnntudughbmxlkyzrskcdkotrxn",
17+
"profile": "ms",
18+
"provisioningState": "Succeeded"
19+
},
20+
"tags": {
21+
"key2913": "urperxmkkhhkp"
22+
},
23+
"location": "itajgxyqozseoygnl",
24+
"id": "/subscriptions/11809CA1-E126-4017-945E-AA795CD5C5A9/resourceGroups/rgopenapi/providers/Microsoft.Contoso/employees/test",
25+
"name": "xepyxhpb",
26+
"type": "svvamxrdnnv",
27+
"systemData": {
28+
"createdBy": "iewyxsnriqktsvp",
29+
"createdByType": "User",
30+
"createdAt": "2023-05-19T00:28:48.610Z",
31+
"lastModifiedBy": "xrchbnnuzierzpxw",
32+
"lastModifiedByType": "User",
33+
"lastModifiedAt": "2023-05-19T00:28:48.610Z"
34+
}
35+
}
36+
],
37+
"nextLink": "https://microsoft.com/a"
38+
}
39+
}
40+
}
41+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"title": "Employees_ListBySubscription",
3+
"operationId": "Employees_ListBySubscription",
4+
"parameters": {
5+
"api-version": "2021-10-01-preview",
6+
"subscriptionId": "11809CA1-E126-4017-945E-AA795CD5C5A9"
7+
},
8+
"responses": {
9+
"200": {
10+
"body": {
11+
"value": [
12+
{
13+
"properties": {
14+
"age": 30,
15+
"city": "gydhnntudughbmxlkyzrskcdkotrxn",
16+
"profile": "ms",
17+
"provisioningState": "Succeeded"
18+
},
19+
"tags": {
20+
"key2913": "urperxmkkhhkp"
21+
},
22+
"location": "itajgxyqozseoygnl",
23+
"id": "/subscriptions/11809CA1-E126-4017-945E-AA795CD5C5A9/resourceGroups/rgopenapi/providers/Microsoft.Contoso/employees/test",
24+
"name": "xepyxhpb",
25+
"type": "svvamxrdnnv",
26+
"systemData": {
27+
"createdBy": "iewyxsnriqktsvp",
28+
"createdByType": "User",
29+
"createdAt": "2023-05-19T00:28:48.610Z",
30+
"lastModifiedBy": "xrchbnnuzierzpxw",
31+
"lastModifiedByType": "User",
32+
"lastModifiedAt": "2023-05-19T00:28:48.610Z"
33+
}
34+
}
35+
],
36+
"nextLink": "https://microsoft.com/a"
37+
}
38+
}
39+
}
40+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"title": "Employees_Update",
3+
"operationId": "Employees_Update",
4+
"parameters": {
5+
"api-version": "2021-10-01-preview",
6+
"subscriptionId": "11809CA1-E126-4017-945E-AA795CD5C5A9",
7+
"resourceGroupName": "rgopenapi",
8+
"employeeName": "-XhyNJ--",
9+
"properties": {
10+
"tags": {
11+
"key7952": "no"
12+
},
13+
"properties": {
14+
"age": 24,
15+
"city": "uyfg",
16+
"profile": "oapgijcswfkruiuuzbwco"
17+
}
18+
}
19+
},
20+
"responses": {
21+
"200": {
22+
"body": {
23+
"properties": {
24+
"age": 30,
25+
"city": "gydhnntudughbmxlkyzrskcdkotrxn",
26+
"profile": "ms",
27+
"provisioningState": "Succeeded"
28+
},
29+
"tags": {
30+
"key2913": "urperxmkkhhkp"
31+
},
32+
"location": "itajgxyqozseoygnl",
33+
"id": "/subscriptions/11809CA1-E126-4017-945E-AA795CD5C5A9/resourceGroups/contoso/providers/Microsoft.Contoso/employees/test",
34+
"name": "xepyxhpb",
35+
"type": "svvamxrdnnv",
36+
"systemData": {
37+
"createdBy": "iewyxsnriqktsvp",
38+
"createdByType": "User",
39+
"createdAt": "2023-05-19T00:28:48.610Z",
40+
"lastModifiedBy": "xrchbnnuzierzpxw",
41+
"lastModifiedByType": "User",
42+
"lastModifiedAt": "2023-05-19T00:28:48.610Z"
43+
}
44+
}
45+
}
46+
}
47+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"title": "Operations_List",
3+
"operationId": "Operations_List",
4+
"parameters": {
5+
"api-version": "2021-10-01-preview"
6+
},
7+
"responses": {
8+
"200": {
9+
"body": {
10+
"value": [
11+
{
12+
"name": "ymeow",
13+
"isDataAction": true,
14+
"display": {
15+
"provider": "qxyznq",
16+
"resource": "bqfwkox",
17+
"operation": "td",
18+
"description": "yvgkhsuwartgxb"
19+
},
20+
"origin": "user",
21+
"actionType": "Internal"
22+
}
23+
],
24+
"nextLink": "https://sample.com/nextLink"
25+
}
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)