Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions eng/pipelines/typespec-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,8 @@ jobs:
parameters:
Folder: specification/translation/Azure.AI.TextTranslation
DisplayName: AI.TextTranslation

- template: templates/steps/typespec-ci.yml
parameters:
Folder: sphere/Sphere.Management
Comment thread
mikeharder marked this conversation as resolved.
Outdated
DisplayName: Sphere.Management
Comment thread
mikeharder marked this conversation as resolved.
Outdated
19 changes: 0 additions & 19 deletions specification/sphere/Sphere.Management/cadl-project.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import "@cadl-lang/rest";
import "@cadl-lang/versioning";
import "@azure-tools/cadl-autorest";
import "@azure-tools/cadl-azure-core";
import "@azure-tools/cadl-azure-resource-manager";

using Cadl.Http;
using Cadl.Rest;
using Cadl.Versioning;
import "@typespec/rest";
import "@typespec/versioning";
import "@azure-tools/typespec-autorest";
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";

using TypeSpec.Http;
using TypeSpec.Rest;
using TypeSpec.Versioning;
using Azure.ResourceManager.Foundations;
using Azure.Core;
using Azure.ResourceManager;
Expand All @@ -26,7 +26,6 @@ model Catalog is TrackedResource<CatalogProperties> {

@doc("Catalog properties")
model CatalogProperties {

@visibility("read")
@doc("The status of the last operation.")
provisioningState?: ProvisioningState;
Expand All @@ -39,18 +38,17 @@ model ListDeviceGroupsRequest {
}
@doc("Device insight report.")
model DeviceInsight {

@doc("Device ID")
deviceId: string;

@doc("Event description")
description: string;

@doc("Event start timestamp")
startTimestampUtc: zonedDateTime;
startTimestampUtc: utcDateTime;

@doc("Event end timestamp")
endTimestampUtc: zonedDateTime;
endTimestampUtc: utcDateTime;

@doc("Event category")
eventCategory: string;
Expand All @@ -66,21 +64,24 @@ model DeviceInsight {
}

@armResourceOperations
interface Catalogs extends Azure.ResourceManager.ResourceOperations<Catalog, CatalogProperties> {

interface Catalogs
extends Azure.ResourceManager.TrackedResourceOperations<
Catalog,
CatalogProperties
> {
@autoRoute
@doc("Counts devices in catalog.")
@armResourceAction(Catalog)
@post
op countDevices(
...ResourceInstanceParameters<Catalog>,
countDevices(
...ResourceInstanceParameters<Catalog>
): ArmResponse<CountDeviceResponse> | ErrorResponse;

@autoRoute
@doc("Lists device insights for catalog.")
@armResourceAction(Catalog)
@post
op listDeviceInsights(
listDeviceInsights(
...ResourceInstanceParameters<Catalog>,
...ListQueryParameters
): ArmResponse<Page<DeviceInsight>> | ErrorResponse;
Expand All @@ -89,7 +90,7 @@ interface Catalogs extends Azure.ResourceManager.ResourceOperations<Catalog, Cat
@doc("Lists devices for catalog.")
@armResourceAction(Catalog)
@post
op listDevices(
listDevices(
...ResourceInstanceParameters<Catalog>,
...ListQueryParameters
): ArmResponse<ResourceListResult<Device>> | ErrorResponse;
Expand All @@ -98,7 +99,7 @@ interface Catalogs extends Azure.ResourceManager.ResourceOperations<Catalog, Cat
@doc("Lists deployments for catalog.")
@armResourceAction(Catalog)
@post
op listDeployments(
listDeployments(
...ResourceInstanceParameters<Catalog>,
...ListQueryParameters
): ArmResponse<ResourceListResult<Deployment>> | ErrorResponse;
Expand All @@ -107,13 +108,12 @@ interface Catalogs extends Azure.ResourceManager.ResourceOperations<Catalog, Cat
@armResourceAction(Catalog)
@doc("List the device groups for the catalog.")
@post
op listDeviceGroups(
listDeviceGroups(
...ResourceInstanceParameters<Catalog>,
...ListQueryParameters,

@doc("List device groups for catalog.")
@body listDeviceGroupsRequest: ListDeviceGroupsRequest
@body
listDeviceGroupsRequest: ListDeviceGroupsRequest
): ArmResponse<ResourceListResult<DeviceGroup>> | ErrorResponse;
}



Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import "@cadl-lang/rest";
import "@cadl-lang/versioning";
import "@azure-tools/cadl-autorest";
import "@azure-tools/cadl-azure-core";
import "@azure-tools/cadl-azure-resource-manager";

using Cadl.Http;
using Cadl.Rest;
using Cadl.Versioning;
import "@typespec/rest";
import "@typespec/versioning";
import "@azure-tools/typespec-autorest";
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";

using TypeSpec.Http;
using TypeSpec.Rest;
using TypeSpec.Versioning;
using Azure.ResourceManager.Foundations;
using Azure.Core;
using Azure.ResourceManager;
Expand All @@ -25,24 +25,26 @@ model Certificate is ProxyResource<CertificateProperties> {
}

@armResourceOperations
interface Certificates extends ProxyResourceOperationsReadList<Certificate, ListQueryParameters> {

interface Certificates
extends ProxyResourceOperationsReadList<Certificate, ListQueryParameters> {
@autoRoute
@doc("Retrieves cert chain.")
@armResourceAction(Certificate)
@post
op retrieveCertChain(
...ResourceInstanceParameters<Certificate>,
retrieveCertChain(
...ResourceInstanceParameters<Certificate>
): ArmResponse<CertificateChainResponse> | ErrorResponse;

@autoRoute
@armResourceAction(Certificate)
@post
@doc("Gets the proof of possession nonce.")
op retrieveProofOfPossessionNonce(
...ResourceInstanceParameters<Certificate>,
retrieveProofOfPossessionNonce(
...ResourceInstanceParameters<Certificate>,

@doc("Proof of possession nonce request body ")
@body proofOfPossessionNonceRequest: ProofOfPossessionNonceRequest
@body
proofOfPossessionNonceRequest: ProofOfPossessionNonceRequest
): ArmResponse<ProofOfPossessionNonceResponse> | ErrorResponse;
}

Expand All @@ -66,11 +68,11 @@ model CertificateProperties {

@visibility("read")
@doc("The certificate expiry date.")
expiryUtc?: zonedDateTime;
expiryUtc?: utcDateTime;

@visibility("read")
@doc("The certificate not before date.")
notBeforeUtc?: zonedDateTime;
notBeforeUtc?: utcDateTime;

@visibility("read")
@doc("The status of the last operation.")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import "@cadl-lang/openapi";
import "@cadl-lang/rest";
import "@cadl-lang/versioning";
import "@azure-tools/cadl-autorest";
import "@azure-tools/cadl-azure-core";
import "@azure-tools/cadl-azure-resource-manager";

using Cadl.Http;
using Cadl.Rest;
using Cadl.Versioning;
import "@typespec/openapi";
import "@typespec/rest";
import "@typespec/versioning";
import "@azure-tools/typespec-autorest";
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";

using TypeSpec.Http;
using TypeSpec.Rest;
using TypeSpec.Versioning;
using Azure.ResourceManager.Foundations;
using Azure.Core;
using Azure.ResourceManager;
Expand All @@ -30,28 +30,28 @@ enum ProvisioningState {
@doc("Regional data boundary values.")
enum RegionalDataBoundary {
None,
EU
EU,
}

@doc("Allow crash dumps values.")
enum AllowCrashDumpCollection {
Enabled,
Disabled
Disabled,
}

@doc("Certificate status values.")
enum CertificateStatus {
Active,
Inactive,
Expired,
Revoked
Revoked,
}

@doc("Provides the custom '$filter' query parameter for list operations")
model CustomFilterQueryParameter {
@query("$filter")
@doc("Filter the result list using the given expression")
filter?: string;
@query("$filter")
@doc("Filter the result list using the given expression")
filter?: string;
}

@doc("Provides the custom '$top' query parameter for list operations.")
Expand All @@ -75,12 +75,12 @@ model CustomMaxPageSizeQueryParameter {
maxpagesize?: int32;
}

@doc("Provides the most common query parameters for list operations.")
model StandardListQueryParametersWithCorrectNames {
// @doc("Provides the most common query parameters for list operations.")
alias StandardListQueryParametersWithCorrectNames = {
...CustomTopQueryParameter;
...CustomSkipQueryParameter;
...CustomMaxPageSizeQueryParameter;
}
};

@doc("Response to the action call for count devices in a catalog.")
model CountDeviceResponse extends CountElementsResponse {}
Expand All @@ -91,56 +91,67 @@ model CountElementsResponse {
value: int32;
}

@doc("Parameters for paginated APIs")
model ListQueryParameters {
alias ListQueryParameters = {
...CustomFilterQueryParameter;
...StandardListQueryParametersWithCorrectNames;
}
};

// Templates
interface ProxyResourceOperationsReadList<
TResource extends ArmResource,
TListParameters extends object = {}>
TResource extends ArmResource,
TListParameters extends object = {}
>
extends Azure.ResourceManager.ResourceRead<TResource>,
ResourceListByParent<TResource, TListParameters & BaseParameters<TResource>> {}
ResourceListByParent<
TResource,
TListParameters & BaseParameters<TResource>
> {}

interface ProxyResourceOperationsReadListCreateDelete<
TResource extends ArmResource,
TListParameters extends object = {}>
TResource extends ArmResource,
TListParameters extends object = {}
>
extends Azure.ResourceManager.ResourceRead<TResource>,
ResourceListByParent<TResource, TListParameters & BaseParameters<TResource>>,
ResourceListByParent<
TResource,
TListParameters & BaseParameters<TResource>
>,
ResourceCreate<TResource>,
Azure.ResourceManager.ResourceDelete<TResource>{}
Azure.ResourceManager.ResourceDelete<TResource> {}

// Custom update operations
// Custom update operations
@armResourceOperations
interface CustomUpdateOperations{
@autoRoute
@doc("Update a {name}", TResource)
@extension("x-ms-long-running-operation", true)
@extension(
"x-ms-long-running-operation-options",
{
"final-state-via": "location",
}
)
@armResourceUpdate(TResource)
@patch
op ArmCustomPatchAsyncWithLocation<
TResource extends ArmResource,
TPatchModel extends object = TagsUpdateModel<TResource>,
TBaseParameters = BaseParameters<TResource>
>(
...ResourceInstanceParameters<TResource, TBaseParameters>,

@doc("The resource properties to be updated.")
@body
properties: TPatchModel
): ArmResponse<TResource> | ArmAcceptedResponse<"Resource update request accepted."> | ErrorResponse;
interface CustomUpdateOperations {
@autoRoute
@doc("Update a {name}", TResource)
@extension("x-ms-long-running-operation", true)
@extension(
"x-ms-long-running-operation-options",
{
`final-state-via`: "location",
}
)
@armResourceUpdate(TResource)
@patch
ArmCustomPatchAsyncWithLocation<
TResource extends ArmResource,
TPatchModel extends object = TagsUpdateModel<TResource>,
TBaseParameters = BaseParameters<TResource>
>(
...ResourceInstanceParameters<TResource, TBaseParameters>,

@doc("The resource properties to be updated.")
@body
properties: TPatchModel
): ArmResponse<TResource> | ArmAcceptedResponse<"Resource update request accepted."> | ErrorResponse;
}

alias CustomArmResourcePatchAsync<
TResource extends ArmResource,
TProperties extends object,
TBaseParameters = BaseParameters<TResource>
> = CustomUpdateOperations.ArmCustomPatchAsyncWithLocation<TResource, ResourceUpdateModel<TResource, TProperties>, TBaseParameters>;
> = CustomUpdateOperations.ArmCustomPatchAsyncWithLocation<
TResource,
ResourceUpdateModel<TResource, TProperties>,
TBaseParameters
>;
Loading