Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ options:
examples-directory: ./examples
omit-unreachable-types: true
output-file: openapi.json
emitter-output-dir: "{project-root}/../data-plane/AnomalyDetector/stable"
emitter-output-dir: "{project-root}/../data-plane/AnomalyDetector/stable/v1.1"
"@azure-tools/typespec-python":
"package-pprint-name": "\"Cognitive Services Anomaly Detector\""
"package-mode": "dataplane"
Expand Down
24 changes: 14 additions & 10 deletions specification/cognitiveservices/ContentSafety/routes.tsp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-client-generator-core";
//import "@azure-tools/typespec-client-generator-core";
import "@typespec/http";
import "@typespec/rest";
import "./models.tsp";
Expand All @@ -9,7 +9,7 @@ using TypeSpec.Rest;
using TypeSpec.Versioning;
using Azure.Core;
using Azure.Core.Traits;
using Azure.ClientGenerator.Core;
//using Azure.ClientGenerator.Core;

namespace ContentSafety;

Expand Down Expand Up @@ -43,46 +43,50 @@ interface ImageOperations {
>;
}

interface BlockOps
extends Azure.Core.ResourceOperations<NoRepeatableRequests &
NoConditionalRequests &
NoClientRequestId> {}
interface TextBlocklists {
@summary("Get Text Blocklist By blocklistName")
@doc("Returns text blocklist details.")
getTextBlocklist is Azure.Core.ResourceRead<TextBlocklist>;
getTextBlocklist is BlockOps.ResourceRead<TextBlocklist>;

@summary("Create Or Update Text Blocklist")
@doc("Updates a text blocklist, if blocklistName does not exist, create a new blocklist.")
createOrUpdateTextBlocklist is Azure.Core.ResourceCreateOrUpdate<TextBlocklist>;
createOrUpdateTextBlocklist is BlockOps.ResourceCreateOrUpdate<TextBlocklist>;

@summary("Delete Text Blocklist By blocklistName")
@doc("Deletes a text blocklist.")
deleteTextBlocklist is Azure.Core.ResourceDelete<TextBlocklist>;
deleteTextBlocklist is BlockOps.ResourceDelete<TextBlocklist>;

@summary("Get All Text Blocklists")
@doc("Get all text blocklists details.")
listTextBlocklists is Azure.Core.ResourceList<TextBlocklist>;
listTextBlocklists is BlockOps.ResourceList<TextBlocklist>;

@summary("Add BlockItems To Text Blocklist")
@doc("Add blockItems to a text blocklist. You can add at most 100 BlockItems in one request.")
addBlockItems is ResourceAction<
addBlockItems is BlockOps.ResourceAction<
TextBlocklist,
AddBlockItemsOptions,
AddBlockItemsResult
>;

@summary("Remove BlockItems From Text Blocklist")
@doc("Remove blockItems from a text blocklist. You can remove at most 100 BlockItems in one request.")
removeBlockItems is ResourceAction<
removeBlockItems is BlockOps.ResourceAction<
TextBlocklist,
RemoveBlockItemsOptions,
NoContentResponse
>;

@summary("Get BlockItem By blocklistName And blockItemId")
@doc("Get blockItem By blockItemId from a text blocklist.")
getTextBlocklistItem is Azure.Core.ResourceRead<TextBlockItem>;
getTextBlocklistItem is BlockOps.ResourceRead<TextBlockItem>;

@summary("Get All BlockItems By blocklistName")
@doc("Get all blockItems in a text blocklist")
listTextBlocklistItems is Azure.Core.ResourceList<
listTextBlocklistItems is BlockOps.ResourceList<
TextBlockItem,
ListQueryParametersTrait<StandardListQueryParameters>
>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ emit:
- "@azure-tools/typespec-autorest"
options:
"@azure-tools/typespec-autorest":
output-file: "contentsafety.json"
azure-resource-provider-folder: ../../../../data-plane
emitter-output-dir: "{project-root}/../"
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/contentsafety.json"
azure-resource-provider-folder: "data-plane"
examples-directory: ./examples
"@azure-tools/typespec-python":
package-name: "azure-ai-contentsafety"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ using TypeSpec.Rest;
namespace AzureHealthInsights;

alias Response = {
#suppress "@azure-tools/typespec-azure-core/no-format" "This is an old spec"
@doc("A processing job identifier.")
@visibility("read")
@key
Expand Down Expand Up @@ -32,7 +33,6 @@ alias Response = {
errors?: Azure.Core.Foundations.Error[];
};


@doc("An inference made by the model regarding a patient.")
model Inference {
@doc("The value of the inference, as relevant for the given inference type.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ using Azure.Core;
using TypeSpec.Http;
namespace AzureHealthInsights;

#suppress "@azure-tools/typespec-azure-core/long-running-polling-operation-required" "This is a template"
@doc("Long running RPC operation template")
op LongRunningRpcOperation<
TParams extends object,
TResponse extends object,
Traits extends object = {}
> is RpcOperation<
TParams & Traits,
Foundations.AcceptedResponse<Traits &
Foundations.LongRunningStatusLocation &
Foundations.RetryAfterHeader &
RepeatabilityResponseHeaders> | TResponse,
Traits
>;
TParams,
TResponse
> is Azure.Core.Foundations.Operation<
TParams & RepeatabilityRequestHeaders,
(Foundations.AcceptedResponse<Foundations.LongRunningStatusLocation &
Foundations.RetryAfterHeader> &
RepeatabilityResponseHeaders) | TResponse,
RepeatabilityRequestHeaders & RepeatabilityResponseHeaders,
Azure.Core.Foundations.ErrorResponse
>;
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,21 @@ interface OncoPhenotype {
@summary("Get Onco Phenotype job details")
@tag("OncoPhenotype")
@doc("Gets the status and details of the Onco Phenotype job.")
@example("./examples/SuccessfulOncoPhenotypeResponse.json", "SuccessfulOncoPhenotypeGetAnalyzeStatus")
@example(
"./examples/SuccessfulOncoPhenotypeResponse.json",
"SuccessfulOncoPhenotypeGetAnalyzeStatus"
)
GetJob is Azure.Core.ResourceRead<OncoPhenotypeResult>;

#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "There is no long-runnign RPC template in Azure.Core"
@summary("Create Onco Phenotype job")
@tag("OncoPhenotype")
@doc("Creates an Onco Phenotype job with the given request body.")
@pollingOperation(OncoPhenotype.GetJob)
@route("/oncophenotype/jobs")
@example("./examples/SuccessfulOncoPhenotypeRequest.json", "SuccessfulOncoPhenotypeAnalyzeRequest")
CreateJob is LongRunningRpcOperation<OncoPhenotypeData, OncoPhenotypeResult, RepeatabilityRequestHeaders>;
@example(
"./examples/SuccessfulOncoPhenotypeRequest.json",
"SuccessfulOncoPhenotypeAnalyzeRequest"
)
CreateJob is LongRunningRpcOperation<OncoPhenotypeData, OncoPhenotypeResult>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@ emit: [

options:
"@azure-tools/typespec-autorest":
output-file: "openapi.json"
azure-resource-provider-folder: "HealthInsights"
emitter-output-dir: "{project-root}/../../data-plane"
output-file: "{azure-resource-provider-folder}/{version-status}/{version}/openapi.json"
examples-directory: "./examples"
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,21 @@ interface TrialMatcher {
@summary("Get Trial Matcher job details")
@tag("TrialMatcher")
@doc("Gets the status and details of the Trial Matcher job.")
@example("./examples/SuccessfulTrialMatcherResponse.json", "SuccessfulTrialMatcherGetAnalyzeStatus")
@example(
"./examples/SuccessfulTrialMatcherResponse.json",
"SuccessfulTrialMatcherGetAnalyzeStatus"
)
GetJob is Azure.Core.ResourceRead<TrialMatcherResult>;

#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "There is no long-runnign RPC template in Azure.Core"
@summary("Create Trial Matcher job")
@tag("TrialMatcher")
@doc("Creates a Trial Matcher job with the given request body.")
@pollingOperation(TrialMatcher.GetJob)
@route("/trialmatcher/jobs")
@example("./examples/SuccessfulTrialMatcherRequest.json", "SuccessfulTrialMatcherAnalyzeRequest")
CreateJob is LongRunningRpcOperation<TrialMatcherData, TrialMatcherResult, RepeatabilityRequestHeaders>;
@example(
"./examples/SuccessfulTrialMatcherRequest.json",
"SuccessfulTrialMatcherAnalyzeRequest"
)
CreateJob is LongRunningRpcOperation<TrialMatcherData, TrialMatcherResult>;
}

Loading