Skip to content

Commit 753f386

Browse files
Migrating Sphere to latest TypeSpec (#24420)
* WIP migrating Sphere * Adding to CI * Add trailing newline * Fix path to spec in eng/pipelines/typespec-ci.yml * Fixed deprecation & documentation on enums * tsp format * Fix spelling * Add PR trigger for specification/sphere --------- Co-authored-by: Mike Harder <[email protected]>
1 parent 67e6d7b commit 753f386

File tree

17 files changed

+991
-702
lines changed

17 files changed

+991
-702
lines changed

eng/pipelines/typespec-ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ pr:
1919
- specification/confidentialledger
2020
- specification/containerservice
2121
- specification/servicenetworking
22+
- specification/sphere
2223
- specification/translation
2324

2425
jobs:
@@ -85,6 +86,11 @@ jobs:
8586
Folder: specification/servicenetworking/ServiceNetworking.Management
8687
DisplayName: Microsoft.ServiceNetworking
8788

89+
- template: templates/steps/typespec-ci.yml
90+
parameters:
91+
Folder: specification/sphere/Sphere.Management
92+
DisplayName: Sphere.Management
93+
8894
- template: templates/steps/typespec-ci.yml
8995
parameters:
9096
Folder: specification/translation/Azure.AI.TextTranslation

specification/sphere/Sphere.Management/cadl-project.yaml

Lines changed: 0 additions & 19 deletions
This file was deleted.

specification/sphere/Sphere.Management/catalog.cadl renamed to specification/sphere/Sphere.Management/catalog.tsp

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import "@cadl-lang/rest";
2-
import "@cadl-lang/versioning";
3-
import "@azure-tools/cadl-autorest";
4-
import "@azure-tools/cadl-azure-core";
5-
import "@azure-tools/cadl-azure-resource-manager";
6-
7-
using Cadl.Http;
8-
using Cadl.Rest;
9-
using Cadl.Versioning;
1+
import "@typespec/rest";
2+
import "@typespec/versioning";
3+
import "@azure-tools/typespec-autorest";
4+
import "@azure-tools/typespec-azure-core";
5+
import "@azure-tools/typespec-azure-resource-manager";
6+
7+
using TypeSpec.Http;
8+
using TypeSpec.Rest;
9+
using TypeSpec.Versioning;
1010
using Azure.ResourceManager.Foundations;
1111
using Azure.Core;
1212
using Azure.ResourceManager;
@@ -26,7 +26,6 @@ model Catalog is TrackedResource<CatalogProperties> {
2626

2727
@doc("Catalog properties")
2828
model CatalogProperties {
29-
3029
@visibility("read")
3130
@doc("The status of the last operation.")
3231
provisioningState?: ProvisioningState;
@@ -39,18 +38,17 @@ model ListDeviceGroupsRequest {
3938
}
4039
@doc("Device insight report.")
4140
model DeviceInsight {
42-
4341
@doc("Device ID")
4442
deviceId: string;
4543

4644
@doc("Event description")
4745
description: string;
4846

4947
@doc("Event start timestamp")
50-
startTimestampUtc: zonedDateTime;
51-
48+
startTimestampUtc: utcDateTime;
49+
5250
@doc("Event end timestamp")
53-
endTimestampUtc: zonedDateTime;
51+
endTimestampUtc: utcDateTime;
5452

5553
@doc("Event category")
5654
eventCategory: string;
@@ -66,21 +64,24 @@ model DeviceInsight {
6664
}
6765

6866
@armResourceOperations
69-
interface Catalogs extends Azure.ResourceManager.ResourceOperations<Catalog, CatalogProperties> {
70-
67+
interface Catalogs
68+
extends Azure.ResourceManager.TrackedResourceOperations<
69+
Catalog,
70+
CatalogProperties
71+
> {
7172
@autoRoute
7273
@doc("Counts devices in catalog.")
7374
@armResourceAction(Catalog)
7475
@post
75-
op countDevices(
76-
...ResourceInstanceParameters<Catalog>,
76+
countDevices(
77+
...ResourceInstanceParameters<Catalog>
7778
): ArmResponse<CountDeviceResponse> | ErrorResponse;
7879

7980
@autoRoute
8081
@doc("Lists device insights for catalog.")
8182
@armResourceAction(Catalog)
8283
@post
83-
op listDeviceInsights(
84+
listDeviceInsights(
8485
...ResourceInstanceParameters<Catalog>,
8586
...ListQueryParameters
8687
): ArmResponse<Page<DeviceInsight>> | ErrorResponse;
@@ -89,7 +90,7 @@ interface Catalogs extends Azure.ResourceManager.ResourceOperations<Catalog, Cat
8990
@doc("Lists devices for catalog.")
9091
@armResourceAction(Catalog)
9192
@post
92-
op listDevices(
93+
listDevices(
9394
...ResourceInstanceParameters<Catalog>,
9495
...ListQueryParameters
9596
): ArmResponse<ResourceListResult<Device>> | ErrorResponse;
@@ -98,7 +99,7 @@ interface Catalogs extends Azure.ResourceManager.ResourceOperations<Catalog, Cat
9899
@doc("Lists deployments for catalog.")
99100
@armResourceAction(Catalog)
100101
@post
101-
op listDeployments(
102+
listDeployments(
102103
...ResourceInstanceParameters<Catalog>,
103104
...ListQueryParameters
104105
): ArmResponse<ResourceListResult<Deployment>> | ErrorResponse;
@@ -107,13 +108,12 @@ interface Catalogs extends Azure.ResourceManager.ResourceOperations<Catalog, Cat
107108
@armResourceAction(Catalog)
108109
@doc("List the device groups for the catalog.")
109110
@post
110-
op listDeviceGroups(
111+
listDeviceGroups(
111112
...ResourceInstanceParameters<Catalog>,
112113
...ListQueryParameters,
114+
113115
@doc("List device groups for catalog.")
114-
@body listDeviceGroupsRequest: ListDeviceGroupsRequest
116+
@body
117+
listDeviceGroupsRequest: ListDeviceGroupsRequest
115118
): ArmResponse<ResourceListResult<DeviceGroup>> | ErrorResponse;
116119
}
117-
118-
119-

specification/sphere/Sphere.Management/certificate.cadl renamed to specification/sphere/Sphere.Management/certificate.tsp

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import "@cadl-lang/rest";
2-
import "@cadl-lang/versioning";
3-
import "@azure-tools/cadl-autorest";
4-
import "@azure-tools/cadl-azure-core";
5-
import "@azure-tools/cadl-azure-resource-manager";
6-
7-
using Cadl.Http;
8-
using Cadl.Rest;
9-
using Cadl.Versioning;
1+
import "@typespec/rest";
2+
import "@typespec/versioning";
3+
import "@azure-tools/typespec-autorest";
4+
import "@azure-tools/typespec-azure-core";
5+
import "@azure-tools/typespec-azure-resource-manager";
6+
7+
using TypeSpec.Http;
8+
using TypeSpec.Rest;
9+
using TypeSpec.Versioning;
1010
using Azure.ResourceManager.Foundations;
1111
using Azure.Core;
1212
using Azure.ResourceManager;
@@ -25,24 +25,26 @@ model Certificate is ProxyResource<CertificateProperties> {
2525
}
2626

2727
@armResourceOperations
28-
interface Certificates extends ProxyResourceOperationsReadList<Certificate, ListQueryParameters> {
29-
28+
interface Certificates
29+
extends ProxyResourceOperationsReadList<Certificate, ListQueryParameters> {
3030
@autoRoute
3131
@doc("Retrieves cert chain.")
3232
@armResourceAction(Certificate)
3333
@post
34-
op retrieveCertChain(
35-
...ResourceInstanceParameters<Certificate>,
34+
retrieveCertChain(
35+
...ResourceInstanceParameters<Certificate>
3636
): ArmResponse<CertificateChainResponse> | ErrorResponse;
3737

3838
@autoRoute
3939
@armResourceAction(Certificate)
4040
@post
4141
@doc("Gets the proof of possession nonce.")
42-
op retrieveProofOfPossessionNonce(
43-
...ResourceInstanceParameters<Certificate>,
42+
retrieveProofOfPossessionNonce(
43+
...ResourceInstanceParameters<Certificate>,
44+
4445
@doc("Proof of possession nonce request body ")
45-
@body proofOfPossessionNonceRequest: ProofOfPossessionNonceRequest
46+
@body
47+
proofOfPossessionNonceRequest: ProofOfPossessionNonceRequest
4648
): ArmResponse<ProofOfPossessionNonceResponse> | ErrorResponse;
4749
}
4850

@@ -66,11 +68,11 @@ model CertificateProperties {
6668

6769
@visibility("read")
6870
@doc("The certificate expiry date.")
69-
expiryUtc?: zonedDateTime;
71+
expiryUtc?: utcDateTime;
7072

7173
@visibility("read")
7274
@doc("The certificate not before date.")
73-
notBeforeUtc?: zonedDateTime;
75+
notBeforeUtc?: utcDateTime;
7476

7577
@visibility("read")
7678
@doc("The status of the last operation.")

specification/sphere/Sphere.Management/common.cadl

Lines changed: 0 additions & 146 deletions
This file was deleted.

0 commit comments

Comments
 (0)