Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TypeSpec-Clean]: Content-safety changes #23965

Merged
merged 3 commits into from
May 13, 2023
Merged
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
22 changes: 12 additions & 10 deletions specification/cognitiveservices/ContentSafety/routes.tsp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-client-generator-core";
import "@typespec/http";
import "@typespec/rest";
import "./models.tsp";
Expand All @@ -9,7 +8,6 @@ using TypeSpec.Rest;
using TypeSpec.Versioning;
using Azure.Core;
using Azure.Core.Traits;
using Azure.ClientGenerator.Core;

namespace ContentSafety;

Expand Down Expand Up @@ -43,46 +41,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 @@ -121,7 +121,7 @@
"type": "string",
"format": "uri",
"description": "The link to the next page of items",
"x-typespec-name": "Rest.ResourceLocation"
"x-typespec-name": "TypeSpec.Rest.ResourceLocation"
}
},
"description": "Paged collection of TextBlocklist items",
Expand Down Expand Up @@ -453,7 +453,7 @@
"type": "string",
"format": "uri",
"description": "The link to the next page of items",
"x-typespec-name": "Rest.ResourceLocation"
"x-typespec-name": "TypeSpec.Rest.ResourceLocation"
}
},
"description": "Paged collection of TextBlockItem items",
Expand Down