From 33bd0820bf76b7817056383c68bc83b3608923c4 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 12 Feb 2024 08:31:16 +0000 Subject: [PATCH] CodeGen from PR 27353 in Azure/azure-rest-api-specs Merge e54dd6efb59574eaa60af9ec1d4060711a823258 into 87e46c2a10b8a6d54ac45522659ec0bc9197de39 --- .../ai-content-safety-rest/api-extractor.json | 25 +- .../ai-content-safety-rest/package.json | 2 +- .../review/ai-content-safety.api.md | 1993 +++++++++++++++-- .../src/clientDefinitions.ts | 601 ++++- .../src/contentSafetyClient.ts | 17 +- .../src/isUnexpected.ts | 532 ++++- .../ai-content-safety-rest/src/models.ts | 229 +- .../src/outputModels.ts | 367 ++- .../src/paginateHelper.ts | 33 +- .../ai-content-safety-rest/src/parameters.ts | 291 ++- .../ai-content-safety-rest/src/responses.ts | 670 +++++- .../ai-content-safety-rest/tsconfig.json | 17 +- .../ai-content-safety-rest/tsp-location.yaml | 4 +- 13 files changed, 4283 insertions(+), 498 deletions(-) diff --git a/sdk/contentsafety/ai-content-safety-rest/api-extractor.json b/sdk/contentsafety/ai-content-safety-rest/api-extractor.json index c3efb349c43a..13a4abc8baf1 100644 --- a/sdk/contentsafety/ai-content-safety-rest/api-extractor.json +++ b/sdk/contentsafety/ai-content-safety-rest/api-extractor.json @@ -1,18 +1,31 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", "mainEntryPointFilePath": "./types/src/index.d.ts", - "docModel": { "enabled": true }, - "apiReport": { "enabled": true, "reportFolder": "./review" }, + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, "dtsRollup": { "enabled": true, "untrimmedFilePath": "", "publicTrimmedFilePath": "./types/ai-content-safety.d.ts" }, "messages": { - "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, "extractorMessageReporting": { - "ae-missing-release-tag": { "logLevel": "none" }, - "ae-unresolved-link": { "logLevel": "none" } + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } } } -} +} \ No newline at end of file diff --git a/sdk/contentsafety/ai-content-safety-rest/package.json b/sdk/contentsafety/ai-content-safety-rest/package.json index 9b10f861c4f3..0c8ac784dd9a 100644 --- a/sdk/contentsafety/ai-content-safety-rest/package.json +++ b/sdk/contentsafety/ai-content-safety-rest/package.json @@ -123,4 +123,4 @@ "disableDocsMs": true, "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure-rest/ai-content-safety?view=azure-node-preview" } -} +} \ No newline at end of file diff --git a/sdk/contentsafety/ai-content-safety-rest/review/ai-content-safety.api.md b/sdk/contentsafety/ai-content-safety-rest/review/ai-content-safety.api.md index 557b396ff4ed..d0b94509f085 100644 --- a/sdk/contentsafety/ai-content-safety-rest/review/ai-content-safety.api.md +++ b/sdk/contentsafety/ai-content-safety-rest/review/ai-content-safety.api.md @@ -6,6 +6,7 @@ import { Client } from '@azure-rest/core-client'; import { ClientOptions } from '@azure-rest/core-client'; +import { ErrorModel } from '@azure-rest/core-client'; import { ErrorResponse } from '@azure-rest/core-client'; import { HttpResponse } from '@azure-rest/core-client'; import { KeyCredential } from '@azure/core-auth'; @@ -17,552 +18,2052 @@ import { RequestParameters } from '@azure-rest/core-client'; import { StreamableMethod } from '@azure-rest/core-client'; import { TokenCredential } from '@azure/core-auth'; +// @public +export interface AddImageIncidentSamplesOptions { + incidentSamples: Array; +} + +// @public +export interface AddImageIncidentSamplesResultOutput { + incidentSamples: Array; +} + +// @public +export interface AddOrUpdateTextBlocklistItemsOptions { + blocklistItems: Array; +} + +// @public +export interface AddOrUpdateTextBlocklistItemsResultOutput { + blocklistItems: Array; +} + +// @public +export interface AddTextIncidentSamplesOptions { + incidentSamples: Array; +} + +// @public +export interface AddTextIncidentSamplesResultOutput { + incidentSamples: Array; +} + +// @public +export interface AnalyzeImageOptions { + categories?: string[]; + image: ImageData_2; + incidents?: IncidentOptions; + outputType?: string; +} + +// @public +export interface AnalyzeImageOptionsOutput { + categories?: string[]; + image: ImageDataOutput; + incidents?: IncidentOptionsOutput; + outputType?: string; +} + +// @public +export interface AnalyzeImageResultOutput { + categoriesAnalysis: Array; + incidentMatches?: Array; +} + +// @public +export interface AnalyzeImageWithTextOptions { + categories?: string[]; + enableOcr: boolean; + image: ImageData_2; + text?: string; +} + +// @public +export interface AnalyzeImageWithTextOptionsOutput { + categories?: string[]; + enableOcr: boolean; + image: ImageDataOutput; + text?: string; +} + +// @public +export interface AnalyzeImageWithTextResultOutput { + categoriesAnalysis: Array; +} + +// @public +export interface AnalyzeTextJailbreakOptions { + text: string; +} + +// @public +export interface AnalyzeTextJailbreakOptionsOutput { + text: string; +} + +// @public +export interface AnalyzeTextJailbreakResultOutput { + jailbreakAnalysis: JailbreakAnalysisResultOutput; +} + +// @public +export interface AnalyzeTextOptions { + blocklistNames?: string[]; + categories?: string[]; + haltOnBlocklistHit?: boolean; + incidents?: IncidentOptions; + outputType?: string; + text: string; +} + +// @public +export interface AnalyzeTextOptionsOutput { + blocklistNames?: string[]; + categories?: string[]; + haltOnBlocklistHit?: boolean; + incidents?: IncidentOptionsOutput; + outputType?: string; + text: string; +} + +// @public +export interface AnalyzeTextProtectedMaterialOptions { + text: string; +} + +// @public +export interface AnalyzeTextProtectedMaterialOptionsOutput { + text: string; +} + +// @public +export interface AnalyzeTextProtectedMaterialResultOutput { + protectedMaterialAnalysis: ProtectedMaterialAnalysisResultOutput; +} + +// @public +export interface AnalyzeTextResultOutput { + blocklistsMatch?: Array; + categoriesAnalysis: Array; + citation?: string[]; + incidentMatches?: Array; +} + +// @public +export interface AnnotateTextOptions { + category: string; + text: string; +} + +// @public +export interface AnnotateTextOptionsOutput { + category: string; + text: string; +} + +// @public +export interface AnnotateTextResultOutput { + id: number; + name: string; + reasoning?: string; +} + +// @public +export interface BatchAnalyzeImages { + blobPrefixLocation: string; + delimiter: string; + extensions: string[]; + lastModified?: Date | string; +} + +// @public +export interface BatchAnalyzeImagesOptions { + categories?: string[]; + images: BatchAnalyzeImages; + incidents?: IncidentOptions; + outputType?: string; + resultsBlob: BatchAnalyzeImagesResultsBlob; + resultsStorageMode?: string; +} + +// @public +export interface BatchAnalyzeImagesOptionsOutput { + categories?: string[]; + images: BatchAnalyzeImagesOutput; + incidents?: IncidentOptionsOutput; + outputType?: string; + resultsBlob: BatchAnalyzeImagesResultsBlobOutput; + resultsStorageMode?: string; +} + +// @public +export interface BatchAnalyzeImagesOutput { + blobPrefixLocation: string; + delimiter: string; + extensions: string[]; + lastModified?: string; +} + +// @public +export interface BatchAnalyzeImagesResultsBlob { + blobPrefixLocation: string; + delimiter: string; +} + +// @public +export interface BatchAnalyzeImagesResultsBlobOutput { + blobPrefixLocation: string; + delimiter: string; +} + +// @public (undocumented) +export type ContentSafetyClient = Client & { + path: Routes; +}; + +// @public +function createClient(endpoint: string, credentials: TokenCredential | KeyCredential, options?: ClientOptions): ContentSafetyClient; +export default createClient; + +// @public +export interface DetectUngroundednessOptions { + domain?: string; + gptResource?: GptResource; + groundingSources: string[]; + query?: string; + reasoning?: boolean; + task?: string; + text: string; +} + +// @public +export interface DetectUngroundednessOptionsOutput { + domain?: string; + gptResource?: GptResourceOutput; + groundingSources: string[]; + query?: string; + reasoning?: boolean; + task?: string; + text: string; +} + +// @public +export interface DetectUngroundednessResultOutput { + confidenceScore: number; + ungrounded: boolean; + ungroundedDetails: Array; + ungroundedPercentage: number; +} + +// @public +export type GetArrayType = T extends Array ? TData : never; + +// @public +export type GetPage = (pageLink: string, maxPageSize?: number) => Promise<{ + page: TPage; + nextPageLink?: string; +}>; + +// @public +export interface GptResource { + azureOpenAIEndpoint: string; + deploymentName: string; +} + +// @public +export interface GptResourceOutput { + azureOpenAIEndpoint: string; + deploymentName: string; +} + +// @public (undocumented) +export interface ImageBatchOperationsBatchAnalyzeImage { + get(options?: ImageBatchOperationsGetBatchTaskStatusParameters): StreamableMethod; + put(options: ImageBatchOperationsBatchAnalyzeImageParameters): StreamableMethod; +} + +// @public +export interface ImageBatchOperationsBatchAnalyzeImage200Response extends HttpResponse { + // (undocumented) + body: ImageBatchTaskDetailOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface ImageBatchOperationsBatchAnalyzeImageBodyParam { + body: BatchAnalyzeImagesOptions; +} + +// @public (undocumented) +export interface ImageBatchOperationsBatchAnalyzeImageDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface ImageBatchOperationsBatchAnalyzeImageDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & ImageBatchOperationsBatchAnalyzeImageDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type ImageBatchOperationsBatchAnalyzeImageParameters = ImageBatchOperationsBatchAnalyzeImageBodyParam & RequestParameters; + +// @public +export interface ImageBatchOperationsGetBatchTaskStatus200Response extends HttpResponse { + // (undocumented) + body: ImageBatchTaskDetailOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface ImageBatchOperationsGetBatchTaskStatusDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface ImageBatchOperationsGetBatchTaskStatusDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & ImageBatchOperationsGetBatchTaskStatusDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type ImageBatchOperationsGetBatchTaskStatusParameters = RequestParameters; + +// @public (undocumented) +export interface ImageBatchOperationsListBatchTasks { + get(options?: ImageBatchOperationsListBatchTasksParameters): StreamableMethod; +} + +// @public +export interface ImageBatchOperationsListBatchTasks200Response extends HttpResponse { + // (undocumented) + body: PagedImageBatchTaskDetailOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface ImageBatchOperationsListBatchTasksDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface ImageBatchOperationsListBatchTasksDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & ImageBatchOperationsListBatchTasksDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type ImageBatchOperationsListBatchTasksParameters = ImageBatchOperationsListBatchTasksQueryParam & RequestParameters; + +// @public (undocumented) +export interface ImageBatchOperationsListBatchTasksQueryParam { + // (undocumented) + queryParameters?: ImageBatchOperationsListBatchTasksQueryParamProperties; +} + +// @public (undocumented) +export interface ImageBatchOperationsListBatchTasksQueryParamProperties { + maxpagesize?: number; + skip?: number; + top?: number; +} + +// @public +export interface ImageBatchTaskDetailOutput { + error?: ErrorModel; + id: string; + kind: string; + result: ImageBatchTaskResultOutput; + status: string; +} + +// @public +export interface ImageBatchTaskResultOutput { + createdTime: string; + progressPercentage: number; + resultsBlob: BatchAnalyzeImagesResultsBlobOutput; +} + +// @public +export interface ImageCategoriesAnalysisOutput { + category: string; + severity?: number; +} + +// @public +interface ImageData_2 { + blobUrl?: string; + content?: string; +} +export { ImageData_2 as ImageData } + +// @public +export interface ImageDataOutput { + blobUrl?: string; + content?: string; +} + +// @public +export interface ImageDataResultOutput { + content?: string; +} + +// @public +export interface ImageIncident { + created: Date | string; + description?: string; + incidentName: string; + lastUpdated: Date | string; +} + +// @public +export interface ImageIncidentOutput { + created: string; + description?: string; + incidentName: string; + lastUpdated: string; +} + +// @public +export type ImageIncidentResourceMergeAndPatch = Partial; + +// @public (undocumented) +export interface ImageIncidentsAddIncidentSamples { + post(options?: ImageIncidentsAddIncidentSamplesParameters): StreamableMethod; +} + +// @public +export interface ImageIncidentsAddIncidentSamples200Response extends HttpResponse { + // (undocumented) + body: AddImageIncidentSamplesResultOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface ImageIncidentsAddIncidentSamplesBodyParam { + // (undocumented) + body?: AddImageIncidentSamplesOptions; +} + +// @public (undocumented) +export interface ImageIncidentsAddIncidentSamplesDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface ImageIncidentsAddIncidentSamplesDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & ImageIncidentsAddIncidentSamplesDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type ImageIncidentsAddIncidentSamplesParameters = ImageIncidentsAddIncidentSamplesBodyParam & RequestParameters; + +// @public +export interface ImageIncidentSample { + image?: ImageData_2; +} + +// @public +export interface ImageIncidentSampleResultOutput { + image?: ImageDataResultOutput; + readonly incidentSampleId: string; +} + +// @public +export interface ImageIncidentsCreateOrUpdateIncident200Response extends HttpResponse { + // (undocumented) + body: ImageIncidentOutput; + // (undocumented) + status: "200"; +} + +// @public +export interface ImageIncidentsCreateOrUpdateIncident201Response extends HttpResponse { + // (undocumented) + body: ImageIncidentOutput; + // (undocumented) + status: "201"; +} + +// @public (undocumented) +export interface ImageIncidentsCreateOrUpdateIncidentBodyParam { + body: ImageIncidentResourceMergeAndPatch; +} + +// @public (undocumented) +export interface ImageIncidentsCreateOrUpdateIncidentDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface ImageIncidentsCreateOrUpdateIncidentDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & ImageIncidentsCreateOrUpdateIncidentDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export interface ImageIncidentsCreateOrUpdateIncidentMediaTypesParam { + contentType: "application/merge-patch+json"; +} + +// @public (undocumented) +export type ImageIncidentsCreateOrUpdateIncidentParameters = ImageIncidentsCreateOrUpdateIncidentMediaTypesParam & ImageIncidentsCreateOrUpdateIncidentBodyParam & RequestParameters; + +// @public +export interface ImageIncidentsDeleteIncident204Response extends HttpResponse { + // (undocumented) + status: "204"; +} + +// @public (undocumented) +export interface ImageIncidentsDeleteIncidentDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface ImageIncidentsDeleteIncidentDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & ImageIncidentsDeleteIncidentDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type ImageIncidentsDeleteIncidentParameters = RequestParameters; + +// @public (undocumented) +export interface ImageIncidentsGetIncidents { + delete(options?: ImageIncidentsDeleteIncidentParameters): StreamableMethod; + get(options?: ImageIncidentsGetIncidentsParameters): StreamableMethod; + patch(options: ImageIncidentsCreateOrUpdateIncidentParameters): StreamableMethod; +} + +// @public +export interface ImageIncidentsGetIncidents200Response extends HttpResponse { + // (undocumented) + body: ImageIncidentOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface ImageIncidentsGetIncidentSample { + get(options?: ImageIncidentsGetIncidentSampleParameters): StreamableMethod; +} + +// @public +export interface ImageIncidentsGetIncidentSample200Response extends HttpResponse { + // (undocumented) + body: ImageIncidentSampleResultOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface ImageIncidentsGetIncidentSampleDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface ImageIncidentsGetIncidentSampleDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & ImageIncidentsGetIncidentSampleDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type ImageIncidentsGetIncidentSampleParameters = RequestParameters; + +// @public (undocumented) +export interface ImageIncidentsGetIncidentsDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface ImageIncidentsGetIncidentsDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & ImageIncidentsGetIncidentsDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type ImageIncidentsGetIncidentsParameters = RequestParameters; + +// @public (undocumented) +export interface ImageIncidentsListIncidents { + get(options?: ImageIncidentsListIncidentsParameters): StreamableMethod; +} + +// @public +export interface ImageIncidentsListIncidents200Response extends HttpResponse { + // (undocumented) + body: PagedImageIncidentOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface ImageIncidentsListIncidentSamples { + get(options?: ImageIncidentsListIncidentSamplesParameters): StreamableMethod; +} + +// @public +export interface ImageIncidentsListIncidentSamples200Response extends HttpResponse { + // (undocumented) + body: PagedListImageIncidentSampleResultOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface ImageIncidentsListIncidentSamplesDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface ImageIncidentsListIncidentSamplesDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & ImageIncidentsListIncidentSamplesDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type ImageIncidentsListIncidentSamplesParameters = ImageIncidentsListIncidentSamplesQueryParam & RequestParameters; + +// @public (undocumented) +export interface ImageIncidentsListIncidentSamplesQueryParam { + // (undocumented) + queryParameters?: ImageIncidentsListIncidentSamplesQueryParamProperties; +} + +// @public (undocumented) +export interface ImageIncidentsListIncidentSamplesQueryParamProperties { + maxpagesize?: number; + skip?: number; + top?: number; +} + +// @public (undocumented) +export interface ImageIncidentsListIncidentsDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface ImageIncidentsListIncidentsDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & ImageIncidentsListIncidentsDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type ImageIncidentsListIncidentsParameters = ImageIncidentsListIncidentsQueryParam & RequestParameters; + +// @public (undocumented) +export interface ImageIncidentsListIncidentsQueryParam { + // (undocumented) + queryParameters?: ImageIncidentsListIncidentsQueryParamProperties; +} + +// @public (undocumented) +export interface ImageIncidentsListIncidentsQueryParamProperties { + maxpagesize?: number; + skip?: number; + top?: number; +} + +// @public (undocumented) +export interface ImageIncidentsRemoveIncidentSamples { + post(options?: ImageIncidentsRemoveIncidentSamplesParameters): StreamableMethod; +} + +// @public +export interface ImageIncidentsRemoveIncidentSamples204Response extends HttpResponse { + // (undocumented) + status: "204"; +} + +// @public (undocumented) +export interface ImageIncidentsRemoveIncidentSamplesBodyParam { + // (undocumented) + body?: RemoveImageIncidentSamplesOptions; +} + +// @public (undocumented) +export interface ImageIncidentsRemoveIncidentSamplesDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface ImageIncidentsRemoveIncidentSamplesDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & ImageIncidentsRemoveIncidentSamplesDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type ImageIncidentsRemoveIncidentSamplesParameters = ImageIncidentsRemoveIncidentSamplesBodyParam & RequestParameters; + +// @public (undocumented) +export interface ImageOperationsAnalyzeImage { + post(options: ImageOperationsAnalyzeImageParameters): StreamableMethod; +} + +// @public +export interface ImageOperationsAnalyzeImage200Response extends HttpResponse { + // (undocumented) + body: AnalyzeImageResultOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface ImageOperationsAnalyzeImageBodyParam { + body: AnalyzeImageOptions; +} + +// @public (undocumented) +export interface ImageOperationsAnalyzeImageDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface ImageOperationsAnalyzeImageDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & ImageOperationsAnalyzeImageDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type ImageOperationsAnalyzeImageParameters = ImageOperationsAnalyzeImageBodyParam & RequestParameters; + +// @public +export interface ImageWithTextCategoriesAnalysisOutput { + category: string; + severity?: number; +} + +// @public (undocumented) +export interface ImageWithTextOperationsAnalyzeImageWithText { + post(options: ImageWithTextOperationsAnalyzeImageWithTextParameters): StreamableMethod; +} + +// @public +export interface ImageWithTextOperationsAnalyzeImageWithText200Response extends HttpResponse { + // (undocumented) + body: AnalyzeImageWithTextResultOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface ImageWithTextOperationsAnalyzeImageWithTextBodyParam { + body: AnalyzeImageWithTextOptions; +} + +// @public (undocumented) +export interface ImageWithTextOperationsAnalyzeImageWithTextDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface ImageWithTextOperationsAnalyzeImageWithTextDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & ImageWithTextOperationsAnalyzeImageWithTextDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type ImageWithTextOperationsAnalyzeImageWithTextParameters = ImageWithTextOperationsAnalyzeImageWithTextBodyParam & RequestParameters; + +// @public +export interface IncidentMatchOutput { + incidentName: string; +} + +// @public +export interface IncidentOptions { + haltOnIncidentHit?: boolean; + incidentNames?: string[]; +} + +// @public +export interface IncidentOptionsOutput { + haltOnIncidentHit?: boolean; + incidentNames?: string[]; +} + +// @public (undocumented) +export function isUnexpected(response: TextOperationsAnalyzeText200Response | TextOperationsAnalyzeTextDefaultResponse): response is TextOperationsAnalyzeTextDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: TextOperationsDetectTextJailbreak200Response | TextOperationsDetectTextJailbreakDefaultResponse): response is TextOperationsDetectTextJailbreakDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: TextOperationsDetectTextProtectedMaterial200Response | TextOperationsDetectTextProtectedMaterialDefaultResponse): response is TextOperationsDetectTextProtectedMaterialDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: ImageOperationsAnalyzeImage200Response | ImageOperationsAnalyzeImageDefaultResponse): response is ImageOperationsAnalyzeImageDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: TextBlocklistsGetTextBlocklist200Response | TextBlocklistsGetTextBlocklistDefaultResponse): response is TextBlocklistsGetTextBlocklistDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: TextBlocklistsCreateOrUpdateTextBlocklist200Response | TextBlocklistsCreateOrUpdateTextBlocklist201Response | TextBlocklistsCreateOrUpdateTextBlocklistDefaultResponse): response is TextBlocklistsCreateOrUpdateTextBlocklistDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: TextBlocklistsDeleteTextBlocklist204Response | TextBlocklistsDeleteTextBlocklistDefaultResponse): response is TextBlocklistsDeleteTextBlocklistDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: TextBlocklistsListTextBlocklists200Response | TextBlocklistsListTextBlocklistsDefaultResponse): response is TextBlocklistsListTextBlocklistsDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: TextBlocklistsAddOrUpdateBlocklistItems200Response | TextBlocklistsAddOrUpdateBlocklistItemsDefaultResponse): response is TextBlocklistsAddOrUpdateBlocklistItemsDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: TextBlocklistsRemoveBlocklistItems204Response | TextBlocklistsRemoveBlocklistItemsDefaultResponse): response is TextBlocklistsRemoveBlocklistItemsDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: TextBlocklistsGetTextBlocklistItem200Response | TextBlocklistsGetTextBlocklistItemDefaultResponse): response is TextBlocklistsGetTextBlocklistItemDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: TextBlocklistsListTextBlocklistItems200Response | TextBlocklistsListTextBlocklistItemsDefaultResponse): response is TextBlocklistsListTextBlocklistItemsDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: ImageBatchOperationsBatchAnalyzeImage200Response | ImageBatchOperationsBatchAnalyzeImageDefaultResponse): response is ImageBatchOperationsBatchAnalyzeImageDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: ImageBatchOperationsGetBatchTaskStatus200Response | ImageBatchOperationsGetBatchTaskStatusDefaultResponse): response is ImageBatchOperationsGetBatchTaskStatusDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: ImageBatchOperationsListBatchTasks200Response | ImageBatchOperationsListBatchTasksDefaultResponse): response is ImageBatchOperationsListBatchTasksDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: TextIncidentsGetIncidents200Response | TextIncidentsGetIncidentsDefaultResponse): response is TextIncidentsGetIncidentsDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: TextIncidentsCreateOrUpdateIncident200Response | TextIncidentsCreateOrUpdateIncident201Response | TextIncidentsCreateOrUpdateIncidentDefaultResponse): response is TextIncidentsCreateOrUpdateIncidentDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: TextIncidentsDeleteIncident204Response | TextIncidentsDeleteIncidentDefaultResponse): response is TextIncidentsDeleteIncidentDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: TextIncidentsListIncidents200Response | TextIncidentsListIncidentsDefaultResponse): response is TextIncidentsListIncidentsDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: TextIncidentsAddIncidentSamples200Response | TextIncidentsAddIncidentSamplesDefaultResponse): response is TextIncidentsAddIncidentSamplesDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: TextIncidentsRemoveIncidentSamples204Response | TextIncidentsRemoveIncidentSamplesDefaultResponse): response is TextIncidentsRemoveIncidentSamplesDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: TextIncidentsGetIncidentSample200Response | TextIncidentsGetIncidentSampleDefaultResponse): response is TextIncidentsGetIncidentSampleDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: TextIncidentsListIncidentSamples200Response | TextIncidentsListIncidentSamplesDefaultResponse): response is TextIncidentsListIncidentSamplesDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: ImageIncidentsGetIncidents200Response | ImageIncidentsGetIncidentsDefaultResponse): response is ImageIncidentsGetIncidentsDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: ImageIncidentsCreateOrUpdateIncident200Response | ImageIncidentsCreateOrUpdateIncident201Response | ImageIncidentsCreateOrUpdateIncidentDefaultResponse): response is ImageIncidentsCreateOrUpdateIncidentDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: ImageIncidentsDeleteIncident204Response | ImageIncidentsDeleteIncidentDefaultResponse): response is ImageIncidentsDeleteIncidentDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: ImageIncidentsListIncidents200Response | ImageIncidentsListIncidentsDefaultResponse): response is ImageIncidentsListIncidentsDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: ImageIncidentsAddIncidentSamples200Response | ImageIncidentsAddIncidentSamplesDefaultResponse): response is ImageIncidentsAddIncidentSamplesDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: ImageIncidentsRemoveIncidentSamples204Response | ImageIncidentsRemoveIncidentSamplesDefaultResponse): response is ImageIncidentsRemoveIncidentSamplesDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: ImageIncidentsGetIncidentSample200Response | ImageIncidentsGetIncidentSampleDefaultResponse): response is ImageIncidentsGetIncidentSampleDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: ImageIncidentsListIncidentSamples200Response | ImageIncidentsListIncidentSamplesDefaultResponse): response is ImageIncidentsListIncidentSamplesDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: PromptTextOperationsAnnotateText200Response | PromptTextOperationsAnnotateTextDefaultResponse): response is PromptTextOperationsAnnotateTextDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: TextCategoryCustomizationCreateOrReplaceTextCustomizedCategory200Response | TextCategoryCustomizationCreateOrReplaceTextCustomizedCategory201Response | TextCategoryCustomizationCreateOrReplaceTextCustomizedCategoryDefaultResponse): response is TextCategoryCustomizationCreateOrReplaceTextCustomizedCategoryDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: TextCategoryCustomizationGetTextCustomizedCategory200Response | TextCategoryCustomizationGetTextCustomizedCategoryDefaultResponse): response is TextCategoryCustomizationGetTextCustomizedCategoryDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: TextCategoryCustomizationDeleteTextCustomizedCategory204Response | TextCategoryCustomizationDeleteTextCustomizedCategoryDefaultResponse): response is TextCategoryCustomizationDeleteTextCustomizedCategoryDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: TextCategoryCustomizationListTextCustomizedCategory200Response | TextCategoryCustomizationListTextCustomizedCategoryDefaultResponse): response is TextCategoryCustomizationListTextCustomizedCategoryDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: ImageWithTextOperationsAnalyzeImageWithText200Response | ImageWithTextOperationsAnalyzeImageWithTextDefaultResponse): response is ImageWithTextOperationsAnalyzeImageWithTextDefaultResponse; + +// @public (undocumented) +export function isUnexpected(response: TextUngroundednessDetectionOperationsDetectUngroundedness200Response | TextUngroundednessDetectionOperationsDetectUngroundednessDefaultResponse): response is TextUngroundednessDetectionOperationsDetectUngroundednessDefaultResponse; + +// @public +export interface JailbreakAnalysisResultOutput { + detected: boolean; +} + +// @public +export interface ListImageIncidentSampleResultOutput { + readonly incidentSampleId: string; +} + +// @public +export type PagedImageBatchTaskDetailOutput = Paged; + +// @public +export type PagedImageIncidentOutput = Paged; + +// @public +export type PagedListImageIncidentSampleResultOutput = Paged; + +// @public +export type PagedTextBlocklistItemOutput = Paged; + +// @public +export type PagedTextBlocklistOutput = Paged; + +// @public +export type PagedTextCustomizedCategoryOutput = Paged; + +// @public +export type PagedTextIncidentOutput = Paged; + +// @public +export type PagedTextIncidentSampleOutput = Paged; + +// @public +export function paginate(client: Client, initialResponse: TResponse, options?: PagingOptions): PagedAsyncIterableIterator>; + +// @public +export type PaginateReturn = TResult extends { + body: { + value?: infer TPage; + }; +} ? GetArrayType : Array; + +// @public +export interface PagingOptions { + customGetPage?: GetPage[]>; +} + +// @public +export interface PreDefinedConcept { + concept: string; + description: string; +} + +// @public +export interface PreDefinedConceptOutput { + concept: string; + description: string; +} + +// @public (undocumented) +export interface PromptTextOperationsAnnotateText { + post(options: PromptTextOperationsAnnotateTextParameters): StreamableMethod; +} + +// @public +export interface PromptTextOperationsAnnotateText200Response extends HttpResponse { + // (undocumented) + body: AnnotateTextResultOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface PromptTextOperationsAnnotateTextBodyParam { + body: AnnotateTextOptions; +} + +// @public (undocumented) +export interface PromptTextOperationsAnnotateTextDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface PromptTextOperationsAnnotateTextDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & PromptTextOperationsAnnotateTextDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type PromptTextOperationsAnnotateTextParameters = PromptTextOperationsAnnotateTextBodyParam & RequestParameters; + +// @public +export interface ProtectedMaterialAnalysisResultOutput { + detected: boolean; +} + +// @public +export interface RemoveImageIncidentSamplesOptions { + incidentSampleIds: string[]; +} + +// @public +export interface RemoveTextBlocklistItemsOptions { + blocklistItemIds: string[]; +} + +// @public +export interface RemoveTextIncidentSamplesOptions { + incidentSampleIds: string[]; +} + +// @public (undocumented) +export interface Routes { + (path: "/text:analyze"): TextOperationsAnalyzeText; + (path: "/text:detectJailbreak"): TextOperationsDetectTextJailbreak; + (path: "/text:detectProtectedMaterial"): TextOperationsDetectTextProtectedMaterial; + (path: "/image:analyze"): ImageOperationsAnalyzeImage; + (path: "/text/blocklists/{blocklistName}", blocklistName: string): TextBlocklistsGetTextBlocklist; + (path: "/text/blocklists"): TextBlocklistsListTextBlocklists; + (path: "/text/blocklists/{blocklistName}:addOrUpdateBlocklistItems", blocklistName: string): TextBlocklistsAddOrUpdateBlocklistItems; + (path: "/text/blocklists/{blocklistName}:removeBlocklistItems", blocklistName: string): TextBlocklistsRemoveBlocklistItems; + (path: "/text/blocklists/{blocklistName}/blocklistItems/{blocklistItemId}", blocklistName: string, blocklistItemId: string): TextBlocklistsGetTextBlocklistItem; + (path: "/text/blocklists/{blocklistName}/blocklistItems", blocklistName: string): TextBlocklistsListTextBlocklistItems; + (path: "/image/batchAnalyses/{operationId}", operationId: string): ImageBatchOperationsBatchAnalyzeImage; + (path: "/image/batchAnalyses"): ImageBatchOperationsListBatchTasks; + (path: "/text/incidents/{incidentName}", incidentName: string): TextIncidentsGetIncidents; + (path: "/text/incidents"): TextIncidentsListIncidents; + (path: "/text/incidents/{incidentName}:addIncidentSamples", incidentName: string): TextIncidentsAddIncidentSamples; + (path: "/text/incidents/{incidentName}:removeIncidentSamples", incidentName: string): TextIncidentsRemoveIncidentSamples; + (path: "/text/incidents/{incidentName}/incidentSamples/{incidentSampleId}", incidentName: string, incidentSampleId: string): TextIncidentsGetIncidentSample; + (path: "/text/incidents/{incidentName}/incidentSamples", incidentName: string): TextIncidentsListIncidentSamples; + (path: "/image/incidents/{incidentName}", incidentName: string): ImageIncidentsGetIncidents; + (path: "/image/incidents"): ImageIncidentsListIncidents; + (path: "/image/incidents/{incidentName}:addIncidentSamples", incidentName: string): ImageIncidentsAddIncidentSamples; + (path: "/image/incidents/{incidentName}:removeIncidentSamples", incidentName: string): ImageIncidentsRemoveIncidentSamples; + (path: "/image/incidents/{incidentName}/incidentSamples/{incidentSampleId}", incidentName: string, incidentSampleId: string): ImageIncidentsGetIncidentSample; + (path: "/image/incidents/{incidentName}/incidentSamples", incidentName: string): ImageIncidentsListIncidentSamples; + (path: "/text:adaptiveAnnotate"): PromptTextOperationsAnnotateText; + (path: "/text/categories/{categoryName}", categoryName: string): TextCategoryCustomizationCreateOrReplaceTextCustomizedCategory; + (path: "/text/categories"): TextCategoryCustomizationListTextCustomizedCategory; + (path: "/imageWithText:analyze"): ImageWithTextOperationsAnalyzeImageWithText; + (path: "/text:detectUngroundedness"): TextUngroundednessDetectionOperationsDetectUngroundedness; +} + +// @public +export interface Subcategory { + id: number; + name: string; + statements: string[]; +} + +// @public +export interface SubcategoryOutput { + id: number; + name: string; + statements: string[]; +} + +// @public +export interface TextBlocklist { + blocklistName: string; + description?: string; +} + +// @public +export interface TextBlocklistItem { + description?: string; + text: string; +} + +// @public +export interface TextBlocklistItemOutput { + readonly blocklistItemId: string; + description?: string; + text: string; +} + +// @public +export interface TextBlocklistMatchOutput { + blocklistItemId: string; + blocklistItemText: string; + blocklistName: string; +} + +// @public +export interface TextBlocklistOutput { + blocklistName: string; + description?: string; +} + +// @public +export type TextBlocklistResourceMergeAndPatch = Partial; + +// @public (undocumented) +export interface TextBlocklistsAddOrUpdateBlocklistItems { + post(options: TextBlocklistsAddOrUpdateBlocklistItemsParameters): StreamableMethod; +} + +// @public +export interface TextBlocklistsAddOrUpdateBlocklistItems200Response extends HttpResponse { + // (undocumented) + body: AddOrUpdateTextBlocklistItemsResultOutput; + // (undocumented) + status: "200"; +} + // @public (undocumented) -export interface AddOrUpdateBlocklistItems { - post(options: AddOrUpdateBlocklistItemsParameters): StreamableMethod; +export interface TextBlocklistsAddOrUpdateBlocklistItemsBodyParam { + body: AddOrUpdateTextBlocklistItemsOptions; +} + +// @public (undocumented) +export interface TextBlocklistsAddOrUpdateBlocklistItemsDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface TextBlocklistsAddOrUpdateBlocklistItemsDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & TextBlocklistsAddOrUpdateBlocklistItemsDefaultHeaders; + // (undocumented) + status: string; } +// @public (undocumented) +export type TextBlocklistsAddOrUpdateBlocklistItemsParameters = TextBlocklistsAddOrUpdateBlocklistItemsBodyParam & RequestParameters; + // @public -export interface AddOrUpdateBlocklistItems200Response extends HttpResponse { +export interface TextBlocklistsCreateOrUpdateTextBlocklist200Response extends HttpResponse { // (undocumented) - body: AddOrUpdateTextBlocklistItemsResultOutput; + body: TextBlocklistOutput; // (undocumented) status: "200"; } +// @public +export interface TextBlocklistsCreateOrUpdateTextBlocklist201Response extends HttpResponse { + // (undocumented) + body: TextBlocklistOutput; + // (undocumented) + status: "201"; +} + // @public (undocumented) -export interface AddOrUpdateBlocklistItemsBodyParam { - body: AddOrUpdateTextBlocklistItemsOptions; +export interface TextBlocklistsCreateOrUpdateTextBlocklistBodyParam { + body: TextBlocklistResourceMergeAndPatch; +} + +// @public (undocumented) +export interface TextBlocklistsCreateOrUpdateTextBlocklistDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface TextBlocklistsCreateOrUpdateTextBlocklistDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & TextBlocklistsCreateOrUpdateTextBlocklistDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export interface TextBlocklistsCreateOrUpdateTextBlocklistMediaTypesParam { + contentType: "application/merge-patch+json"; +} + +// @public (undocumented) +export type TextBlocklistsCreateOrUpdateTextBlocklistParameters = TextBlocklistsCreateOrUpdateTextBlocklistMediaTypesParam & TextBlocklistsCreateOrUpdateTextBlocklistBodyParam & RequestParameters; + +// @public +export interface TextBlocklistsDeleteTextBlocklist204Response extends HttpResponse { + // (undocumented) + status: "204"; +} + +// @public (undocumented) +export interface TextBlocklistsDeleteTextBlocklistDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface TextBlocklistsDeleteTextBlocklistDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & TextBlocklistsDeleteTextBlocklistDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type TextBlocklistsDeleteTextBlocklistParameters = RequestParameters; + +// @public (undocumented) +export interface TextBlocklistsGetTextBlocklist { + delete(options?: TextBlocklistsDeleteTextBlocklistParameters): StreamableMethod; + get(options?: TextBlocklistsGetTextBlocklistParameters): StreamableMethod; + patch(options: TextBlocklistsCreateOrUpdateTextBlocklistParameters): StreamableMethod; +} + +// @public +export interface TextBlocklistsGetTextBlocklist200Response extends HttpResponse { + // (undocumented) + body: TextBlocklistOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface TextBlocklistsGetTextBlocklistDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface TextBlocklistsGetTextBlocklistDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & TextBlocklistsGetTextBlocklistDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export interface TextBlocklistsGetTextBlocklistItem { + get(options?: TextBlocklistsGetTextBlocklistItemParameters): StreamableMethod; +} + +// @public +export interface TextBlocklistsGetTextBlocklistItem200Response extends HttpResponse { + // (undocumented) + body: TextBlocklistItemOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface TextBlocklistsGetTextBlocklistItemDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface TextBlocklistsGetTextBlocklistItemDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & TextBlocklistsGetTextBlocklistItemDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type TextBlocklistsGetTextBlocklistItemParameters = RequestParameters; + +// @public (undocumented) +export type TextBlocklistsGetTextBlocklistParameters = RequestParameters; + +// @public (undocumented) +export interface TextBlocklistsListTextBlocklistItems { + get(options?: TextBlocklistsListTextBlocklistItemsParameters): StreamableMethod; +} + +// @public +export interface TextBlocklistsListTextBlocklistItems200Response extends HttpResponse { + // (undocumented) + body: PagedTextBlocklistItemOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface TextBlocklistsListTextBlocklistItemsDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface TextBlocklistsListTextBlocklistItemsDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & TextBlocklistsListTextBlocklistItemsDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type TextBlocklistsListTextBlocklistItemsParameters = TextBlocklistsListTextBlocklistItemsQueryParam & RequestParameters; + +// @public (undocumented) +export interface TextBlocklistsListTextBlocklistItemsQueryParam { + // (undocumented) + queryParameters?: TextBlocklistsListTextBlocklistItemsQueryParamProperties; +} + +// @public (undocumented) +export interface TextBlocklistsListTextBlocklistItemsQueryParamProperties { + maxpagesize?: number; + skip?: number; + top?: number; +} + +// @public (undocumented) +export interface TextBlocklistsListTextBlocklists { + get(options?: TextBlocklistsListTextBlocklistsParameters): StreamableMethod; +} + +// @public +export interface TextBlocklistsListTextBlocklists200Response extends HttpResponse { + // (undocumented) + body: PagedTextBlocklistOutput; + // (undocumented) + status: "200"; +} + +// @public (undocumented) +export interface TextBlocklistsListTextBlocklistsDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface TextBlocklistsListTextBlocklistsDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & TextBlocklistsListTextBlocklistsDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type TextBlocklistsListTextBlocklistsParameters = RequestParameters; + +// @public (undocumented) +export interface TextBlocklistsRemoveBlocklistItems { + post(options: TextBlocklistsRemoveBlocklistItemsParameters): StreamableMethod; +} + +// @public +export interface TextBlocklistsRemoveBlocklistItems204Response extends HttpResponse { + // (undocumented) + status: "204"; +} + +// @public (undocumented) +export interface TextBlocklistsRemoveBlocklistItemsBodyParam { + body: RemoveTextBlocklistItemsOptions; +} + +// @public (undocumented) +export interface TextBlocklistsRemoveBlocklistItemsDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface TextBlocklistsRemoveBlocklistItemsDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & TextBlocklistsRemoveBlocklistItemsDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type TextBlocklistsRemoveBlocklistItemsParameters = TextBlocklistsRemoveBlocklistItemsBodyParam & RequestParameters; + +// @public +export interface TextCategoriesAnalysisOutput { + category: string; + severity?: number; +} + +// @public (undocumented) +export interface TextCategoryCustomizationCreateOrReplaceTextCustomizedCategory { + delete(options?: TextCategoryCustomizationDeleteTextCustomizedCategoryParameters): StreamableMethod; + get(options?: TextCategoryCustomizationGetTextCustomizedCategoryParameters): StreamableMethod; + put(options: TextCategoryCustomizationCreateOrReplaceTextCustomizedCategoryParameters): StreamableMethod; +} + +// @public +export interface TextCategoryCustomizationCreateOrReplaceTextCustomizedCategory200Response extends HttpResponse { + // (undocumented) + body: TextCustomizedCategoryOutput; + // (undocumented) + status: "200"; +} + +// @public +export interface TextCategoryCustomizationCreateOrReplaceTextCustomizedCategory201Response extends HttpResponse { + // (undocumented) + body: TextCustomizedCategoryOutput; + // (undocumented) + status: "201"; +} + +// @public (undocumented) +export interface TextCategoryCustomizationCreateOrReplaceTextCustomizedCategoryBodyParam { + body: TextCustomizedCategory; +} + +// @public (undocumented) +export interface TextCategoryCustomizationCreateOrReplaceTextCustomizedCategoryDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface TextCategoryCustomizationCreateOrReplaceTextCustomizedCategoryDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & TextCategoryCustomizationCreateOrReplaceTextCustomizedCategoryDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type TextCategoryCustomizationCreateOrReplaceTextCustomizedCategoryParameters = TextCategoryCustomizationCreateOrReplaceTextCustomizedCategoryBodyParam & RequestParameters; + +// @public +export interface TextCategoryCustomizationDeleteTextCustomizedCategory204Response extends HttpResponse { + // (undocumented) + status: "204"; +} + +// @public (undocumented) +export interface TextCategoryCustomizationDeleteTextCustomizedCategoryDefaultHeaders { + "x-ms-error-code"?: string; +} + +// @public (undocumented) +export interface TextCategoryCustomizationDeleteTextCustomizedCategoryDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & TextCategoryCustomizationDeleteTextCustomizedCategoryDefaultHeaders; + // (undocumented) + status: string; +} + +// @public (undocumented) +export type TextCategoryCustomizationDeleteTextCustomizedCategoryParameters = RequestParameters; + +// @public +export interface TextCategoryCustomizationGetTextCustomizedCategory200Response extends HttpResponse { + // (undocumented) + body: TextCustomizedCategoryOutput; + // (undocumented) + status: "200"; } // @public (undocumented) -export interface AddOrUpdateBlocklistItemsDefaultHeaders { +export interface TextCategoryCustomizationGetTextCustomizedCategoryDefaultHeaders { "x-ms-error-code"?: string; } // @public (undocumented) -export interface AddOrUpdateBlocklistItemsDefaultResponse extends HttpResponse { +export interface TextCategoryCustomizationGetTextCustomizedCategoryDefaultResponse extends HttpResponse { // (undocumented) body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & AddOrUpdateBlocklistItemsDefaultHeaders; + headers: RawHttpHeaders & TextCategoryCustomizationGetTextCustomizedCategoryDefaultHeaders; // (undocumented) status: string; } // @public (undocumented) -export type AddOrUpdateBlocklistItemsParameters = AddOrUpdateBlocklistItemsBodyParam & RequestParameters; - -// @public -export interface AddOrUpdateTextBlocklistItemsOptions { - blocklistItems: Array; -} - -// @public -export interface AddOrUpdateTextBlocklistItemsResultOutput { - blocklistItems: Array; -} +export type TextCategoryCustomizationGetTextCustomizedCategoryParameters = RequestParameters; // @public (undocumented) -export interface AnalyzeImage { - post(options: AnalyzeImageParameters): StreamableMethod; +export interface TextCategoryCustomizationListTextCustomizedCategory { + get(options?: TextCategoryCustomizationListTextCustomizedCategoryParameters): StreamableMethod; } // @public -export interface AnalyzeImage200Response extends HttpResponse { +export interface TextCategoryCustomizationListTextCustomizedCategory200Response extends HttpResponse { // (undocumented) - body: AnalyzeImageResultOutput; + body: PagedTextCustomizedCategoryOutput; // (undocumented) status: "200"; } // @public (undocumented) -export interface AnalyzeImageBodyParam { - body: AnalyzeImageOptions; -} - -// @public (undocumented) -export interface AnalyzeImageDefaultHeaders { +export interface TextCategoryCustomizationListTextCustomizedCategoryDefaultHeaders { "x-ms-error-code"?: string; } // @public (undocumented) -export interface AnalyzeImageDefaultResponse extends HttpResponse { +export interface TextCategoryCustomizationListTextCustomizedCategoryDefaultResponse extends HttpResponse { // (undocumented) body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & AnalyzeImageDefaultHeaders; + headers: RawHttpHeaders & TextCategoryCustomizationListTextCustomizedCategoryDefaultHeaders; // (undocumented) status: string; } +// @public (undocumented) +export type TextCategoryCustomizationListTextCustomizedCategoryParameters = TextCategoryCustomizationListTextCustomizedCategoryQueryParam & RequestParameters; + +// @public (undocumented) +export interface TextCategoryCustomizationListTextCustomizedCategoryQueryParam { + // (undocumented) + queryParameters?: TextCategoryCustomizationListTextCustomizedCategoryQueryParamProperties; +} + +// @public (undocumented) +export interface TextCategoryCustomizationListTextCustomizedCategoryQueryParamProperties { + maxpagesize?: number; + skip?: number; + top?: number; +} + // @public -export interface AnalyzeImageOptions { - categories?: string[]; - image: ImageData_2; - outputType?: string; +export interface TextCustomizedCategory { + categoryName: string; + emphases?: string[]; + exampleBlobUrl?: string; + preDefinedConcepts?: Array; + subcategories: Array; } // @public -export interface AnalyzeImageOptionsOutput { - categories?: string[]; - image: ImageDataOutput; - outputType?: string; +export interface TextCustomizedCategoryOutput { + categoryName: string; + emphases?: string[]; + exampleBlobUrl?: string; + preDefinedConcepts?: Array; + subcategories: Array; } -// @public (undocumented) -export type AnalyzeImageParameters = AnalyzeImageBodyParam & RequestParameters; +// @public +export interface TextIncident { + created: Date | string; + description?: string; + incidentName: string; + lastUpdated: Date | string; +} // @public -export interface AnalyzeImageResultOutput { - categoriesAnalysis: Array; +export interface TextIncidentOutput { + created: string; + description?: string; + incidentName: string; + lastUpdated: string; } +// @public +export type TextIncidentResourceMergeAndPatch = Partial; + // @public (undocumented) -export interface AnalyzeText { - post(options: AnalyzeTextParameters): StreamableMethod; +export interface TextIncidentsAddIncidentSamples { + post(options?: TextIncidentsAddIncidentSamplesParameters): StreamableMethod; } // @public -export interface AnalyzeText200Response extends HttpResponse { +export interface TextIncidentsAddIncidentSamples200Response extends HttpResponse { // (undocumented) - body: AnalyzeTextResultOutput; + body: AddTextIncidentSamplesResultOutput; // (undocumented) status: "200"; } // @public (undocumented) -export interface AnalyzeTextBodyParam { - body: AnalyzeTextOptions; +export interface TextIncidentsAddIncidentSamplesBodyParam { + // (undocumented) + body?: AddTextIncidentSamplesOptions; } // @public (undocumented) -export interface AnalyzeTextDefaultHeaders { +export interface TextIncidentsAddIncidentSamplesDefaultHeaders { "x-ms-error-code"?: string; } // @public (undocumented) -export interface AnalyzeTextDefaultResponse extends HttpResponse { +export interface TextIncidentsAddIncidentSamplesDefaultResponse extends HttpResponse { // (undocumented) body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & AnalyzeTextDefaultHeaders; + headers: RawHttpHeaders & TextIncidentsAddIncidentSamplesDefaultHeaders; // (undocumented) status: string; } -// @public -export interface AnalyzeTextOptions { - blocklistNames?: string[]; - categories?: string[]; - haltOnBlocklistHit?: boolean; - outputType?: string; - text: string; -} - -// @public -export interface AnalyzeTextOptionsOutput { - blocklistNames?: string[]; - categories?: string[]; - haltOnBlocklistHit?: boolean; - outputType?: string; - text: string; -} - // @public (undocumented) -export type AnalyzeTextParameters = AnalyzeTextBodyParam & RequestParameters; +export type TextIncidentsAddIncidentSamplesParameters = TextIncidentsAddIncidentSamplesBodyParam & RequestParameters; // @public -export interface AnalyzeTextResultOutput { - blocklistsMatch?: Array; - categoriesAnalysis: Array; +export interface TextIncidentSample { + text?: string; } -// @public (undocumented) -export type ContentSafetyClient = Client & { - path: Routes; -}; - // @public -function createClient(endpoint: string, credentials: TokenCredential | KeyCredential, options?: ClientOptions): ContentSafetyClient; -export default createClient; +export interface TextIncidentSampleOutput { + readonly incidentSampleId: string; + text?: string; +} // @public -export interface CreateOrUpdateTextBlocklist200Response extends HttpResponse { +export interface TextIncidentsCreateOrUpdateIncident200Response extends HttpResponse { // (undocumented) - body: TextBlocklistOutput; + body: TextIncidentOutput; // (undocumented) status: "200"; } // @public -export interface CreateOrUpdateTextBlocklist201Response extends HttpResponse { +export interface TextIncidentsCreateOrUpdateIncident201Response extends HttpResponse { // (undocumented) - body: TextBlocklistOutput; + body: TextIncidentOutput; // (undocumented) status: "201"; } // @public (undocumented) -export interface CreateOrUpdateTextBlocklistBodyParam { - body: TextBlocklistResourceMergeAndPatch; +export interface TextIncidentsCreateOrUpdateIncidentBodyParam { + body: TextIncidentResourceMergeAndPatch; } // @public (undocumented) -export interface CreateOrUpdateTextBlocklistDefaultHeaders { +export interface TextIncidentsCreateOrUpdateIncidentDefaultHeaders { "x-ms-error-code"?: string; } // @public (undocumented) -export interface CreateOrUpdateTextBlocklistDefaultResponse extends HttpResponse { +export interface TextIncidentsCreateOrUpdateIncidentDefaultResponse extends HttpResponse { // (undocumented) body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & CreateOrUpdateTextBlocklistDefaultHeaders; + headers: RawHttpHeaders & TextIncidentsCreateOrUpdateIncidentDefaultHeaders; // (undocumented) status: string; } // @public (undocumented) -export interface CreateOrUpdateTextBlocklistMediaTypesParam { +export interface TextIncidentsCreateOrUpdateIncidentMediaTypesParam { contentType: "application/merge-patch+json"; } // @public (undocumented) -export type CreateOrUpdateTextBlocklistParameters = CreateOrUpdateTextBlocklistMediaTypesParam & CreateOrUpdateTextBlocklistBodyParam & RequestParameters; +export type TextIncidentsCreateOrUpdateIncidentParameters = TextIncidentsCreateOrUpdateIncidentMediaTypesParam & TextIncidentsCreateOrUpdateIncidentBodyParam & RequestParameters; // @public -export interface DeleteTextBlocklist204Response extends HttpResponse { +export interface TextIncidentsDeleteIncident204Response extends HttpResponse { // (undocumented) status: "204"; } // @public (undocumented) -export interface DeleteTextBlocklistDefaultHeaders { +export interface TextIncidentsDeleteIncidentDefaultHeaders { "x-ms-error-code"?: string; } // @public (undocumented) -export interface DeleteTextBlocklistDefaultResponse extends HttpResponse { +export interface TextIncidentsDeleteIncidentDefaultResponse extends HttpResponse { // (undocumented) body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & DeleteTextBlocklistDefaultHeaders; + headers: RawHttpHeaders & TextIncidentsDeleteIncidentDefaultHeaders; // (undocumented) status: string; } // @public (undocumented) -export type DeleteTextBlocklistParameters = RequestParameters; +export type TextIncidentsDeleteIncidentParameters = RequestParameters; -// @public -export type GetArrayType = T extends Array ? TData : never; +// @public (undocumented) +export interface TextIncidentsGetIncidents { + delete(options?: TextIncidentsDeleteIncidentParameters): StreamableMethod; + get(options?: TextIncidentsGetIncidentsParameters): StreamableMethod; + patch(options: TextIncidentsCreateOrUpdateIncidentParameters): StreamableMethod; +} // @public -export type GetPage = (pageLink: string, maxPageSize?: number) => Promise<{ - page: TPage; - nextPageLink?: string; -}>; +export interface TextIncidentsGetIncidents200Response extends HttpResponse { + // (undocumented) + body: TextIncidentOutput; + // (undocumented) + status: "200"; +} // @public (undocumented) -export interface GetTextBlocklist { - delete(options?: DeleteTextBlocklistParameters): StreamableMethod; - get(options?: GetTextBlocklistParameters): StreamableMethod; - patch(options: CreateOrUpdateTextBlocklistParameters): StreamableMethod; +export interface TextIncidentsGetIncidentSample { + get(options?: TextIncidentsGetIncidentSampleParameters): StreamableMethod; } // @public -export interface GetTextBlocklist200Response extends HttpResponse { +export interface TextIncidentsGetIncidentSample200Response extends HttpResponse { // (undocumented) - body: TextBlocklistOutput; + body: TextIncidentSampleOutput; // (undocumented) status: "200"; } // @public (undocumented) -export interface GetTextBlocklistDefaultHeaders { +export interface TextIncidentsGetIncidentSampleDefaultHeaders { "x-ms-error-code"?: string; } // @public (undocumented) -export interface GetTextBlocklistDefaultResponse extends HttpResponse { +export interface TextIncidentsGetIncidentSampleDefaultResponse extends HttpResponse { // (undocumented) body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & GetTextBlocklistDefaultHeaders; + headers: RawHttpHeaders & TextIncidentsGetIncidentSampleDefaultHeaders; // (undocumented) status: string; } // @public (undocumented) -export interface GetTextBlocklistItem { - get(options?: GetTextBlocklistItemParameters): StreamableMethod; -} - -// @public -export interface GetTextBlocklistItem200Response extends HttpResponse { - // (undocumented) - body: TextBlocklistItemOutput; - // (undocumented) - status: "200"; -} +export type TextIncidentsGetIncidentSampleParameters = RequestParameters; // @public (undocumented) -export interface GetTextBlocklistItemDefaultHeaders { +export interface TextIncidentsGetIncidentsDefaultHeaders { "x-ms-error-code"?: string; } // @public (undocumented) -export interface GetTextBlocklistItemDefaultResponse extends HttpResponse { +export interface TextIncidentsGetIncidentsDefaultResponse extends HttpResponse { // (undocumented) body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & GetTextBlocklistItemDefaultHeaders; + headers: RawHttpHeaders & TextIncidentsGetIncidentsDefaultHeaders; // (undocumented) status: string; } // @public (undocumented) -export type GetTextBlocklistItemParameters = RequestParameters; +export type TextIncidentsGetIncidentsParameters = RequestParameters; // @public (undocumented) -export type GetTextBlocklistParameters = RequestParameters; +export interface TextIncidentsListIncidents { + get(options?: TextIncidentsListIncidentsParameters): StreamableMethod; +} // @public -export interface ImageCategoriesAnalysisOutput { - category: string; - severity?: number; +export interface TextIncidentsListIncidents200Response extends HttpResponse { + // (undocumented) + body: PagedTextIncidentOutput; + // (undocumented) + status: "200"; } -// @public -interface ImageData_2 { - blobUrl?: string; - content?: string; +// @public (undocumented) +export interface TextIncidentsListIncidentSamples { + get(options?: TextIncidentsListIncidentSamplesParameters): StreamableMethod; } -export { ImageData_2 as ImageData } // @public -export interface ImageDataOutput { - blobUrl?: string; - content?: string; +export interface TextIncidentsListIncidentSamples200Response extends HttpResponse { + // (undocumented) + body: PagedTextIncidentSampleOutput; + // (undocumented) + status: "200"; } // @public (undocumented) -export function isUnexpected(response: AnalyzeText200Response | AnalyzeTextDefaultResponse): response is AnalyzeTextDefaultResponse; +export interface TextIncidentsListIncidentSamplesDefaultHeaders { + "x-ms-error-code"?: string; +} // @public (undocumented) -export function isUnexpected(response: AnalyzeImage200Response | AnalyzeImageDefaultResponse): response is AnalyzeImageDefaultResponse; +export interface TextIncidentsListIncidentSamplesDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & TextIncidentsListIncidentSamplesDefaultHeaders; + // (undocumented) + status: string; +} // @public (undocumented) -export function isUnexpected(response: GetTextBlocklist200Response | GetTextBlocklistDefaultResponse): response is GetTextBlocklistDefaultResponse; +export type TextIncidentsListIncidentSamplesParameters = TextIncidentsListIncidentSamplesQueryParam & RequestParameters; // @public (undocumented) -export function isUnexpected(response: CreateOrUpdateTextBlocklist200Response | CreateOrUpdateTextBlocklist201Response | CreateOrUpdateTextBlocklistDefaultResponse): response is CreateOrUpdateTextBlocklistDefaultResponse; +export interface TextIncidentsListIncidentSamplesQueryParam { + // (undocumented) + queryParameters?: TextIncidentsListIncidentSamplesQueryParamProperties; +} // @public (undocumented) -export function isUnexpected(response: DeleteTextBlocklist204Response | DeleteTextBlocklistDefaultResponse): response is DeleteTextBlocklistDefaultResponse; +export interface TextIncidentsListIncidentSamplesQueryParamProperties { + maxpagesize?: number; + skip?: number; + top?: number; +} // @public (undocumented) -export function isUnexpected(response: ListTextBlocklists200Response | ListTextBlocklistsDefaultResponse): response is ListTextBlocklistsDefaultResponse; +export interface TextIncidentsListIncidentsDefaultHeaders { + "x-ms-error-code"?: string; +} // @public (undocumented) -export function isUnexpected(response: AddOrUpdateBlocklistItems200Response | AddOrUpdateBlocklistItemsDefaultResponse): response is AddOrUpdateBlocklistItemsDefaultResponse; +export interface TextIncidentsListIncidentsDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & TextIncidentsListIncidentsDefaultHeaders; + // (undocumented) + status: string; +} // @public (undocumented) -export function isUnexpected(response: RemoveBlocklistItems204Response | RemoveBlocklistItemsDefaultResponse): response is RemoveBlocklistItemsDefaultResponse; +export type TextIncidentsListIncidentsParameters = TextIncidentsListIncidentsQueryParam & RequestParameters; // @public (undocumented) -export function isUnexpected(response: GetTextBlocklistItem200Response | GetTextBlocklistItemDefaultResponse): response is GetTextBlocklistItemDefaultResponse; +export interface TextIncidentsListIncidentsQueryParam { + // (undocumented) + queryParameters?: TextIncidentsListIncidentsQueryParamProperties; +} // @public (undocumented) -export function isUnexpected(response: ListTextBlocklistItems200Response | ListTextBlocklistItemsDefaultResponse): response is ListTextBlocklistItemsDefaultResponse; +export interface TextIncidentsListIncidentsQueryParamProperties { + maxpagesize?: number; + skip?: number; + top?: number; +} // @public (undocumented) -export interface ListTextBlocklistItems { - get(options?: ListTextBlocklistItemsParameters): StreamableMethod; +export interface TextIncidentsRemoveIncidentSamples { + post(options?: TextIncidentsRemoveIncidentSamplesParameters): StreamableMethod; } // @public -export interface ListTextBlocklistItems200Response extends HttpResponse { +export interface TextIncidentsRemoveIncidentSamples204Response extends HttpResponse { // (undocumented) - body: PagedTextBlocklistItemOutput; + status: "204"; +} + +// @public (undocumented) +export interface TextIncidentsRemoveIncidentSamplesBodyParam { // (undocumented) - status: "200"; + body?: RemoveTextIncidentSamplesOptions; } // @public (undocumented) -export interface ListTextBlocklistItemsDefaultHeaders { +export interface TextIncidentsRemoveIncidentSamplesDefaultHeaders { "x-ms-error-code"?: string; } // @public (undocumented) -export interface ListTextBlocklistItemsDefaultResponse extends HttpResponse { +export interface TextIncidentsRemoveIncidentSamplesDefaultResponse extends HttpResponse { // (undocumented) body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & ListTextBlocklistItemsDefaultHeaders; + headers: RawHttpHeaders & TextIncidentsRemoveIncidentSamplesDefaultHeaders; // (undocumented) status: string; } // @public (undocumented) -export type ListTextBlocklistItemsParameters = ListTextBlocklistItemsQueryParam & RequestParameters; - -// @public (undocumented) -export interface ListTextBlocklistItemsQueryParam { - // (undocumented) - queryParameters?: ListTextBlocklistItemsQueryParamProperties; -} - -// @public (undocumented) -export interface ListTextBlocklistItemsQueryParamProperties { - maxpagesize?: number; - skip?: number; - top?: number; -} +export type TextIncidentsRemoveIncidentSamplesParameters = TextIncidentsRemoveIncidentSamplesBodyParam & RequestParameters; // @public (undocumented) -export interface ListTextBlocklists { - get(options?: ListTextBlocklistsParameters): StreamableMethod; +export interface TextOperationsAnalyzeText { + post(options: TextOperationsAnalyzeTextParameters): StreamableMethod; } // @public -export interface ListTextBlocklists200Response extends HttpResponse { +export interface TextOperationsAnalyzeText200Response extends HttpResponse { // (undocumented) - body: PagedTextBlocklistOutput; + body: AnalyzeTextResultOutput; // (undocumented) status: "200"; } // @public (undocumented) -export interface ListTextBlocklistsDefaultHeaders { +export interface TextOperationsAnalyzeTextBodyParam { + body: AnalyzeTextOptions; +} + +// @public (undocumented) +export interface TextOperationsAnalyzeTextDefaultHeaders { "x-ms-error-code"?: string; } // @public (undocumented) -export interface ListTextBlocklistsDefaultResponse extends HttpResponse { +export interface TextOperationsAnalyzeTextDefaultResponse extends HttpResponse { // (undocumented) body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & ListTextBlocklistsDefaultHeaders; + headers: RawHttpHeaders & TextOperationsAnalyzeTextDefaultHeaders; // (undocumented) status: string; } // @public (undocumented) -export type ListTextBlocklistsParameters = RequestParameters; +export type TextOperationsAnalyzeTextParameters = TextOperationsAnalyzeTextBodyParam & RequestParameters; -// @public -export type PagedTextBlocklistItemOutput = Paged; +// @public (undocumented) +export interface TextOperationsDetectTextJailbreak { + post(options: TextOperationsDetectTextJailbreakParameters): StreamableMethod; +} // @public -export type PagedTextBlocklistOutput = Paged; +export interface TextOperationsDetectTextJailbreak200Response extends HttpResponse { + // (undocumented) + body: AnalyzeTextJailbreakResultOutput; + // (undocumented) + status: "200"; +} -// @public -export function paginate(client: Client, initialResponse: TResponse, options?: PagingOptions): PagedAsyncIterableIterator>; +// @public (undocumented) +export interface TextOperationsDetectTextJailbreakBodyParam { + body: AnalyzeTextJailbreakOptions; +} -// @public -export type PaginateReturn = TResult extends { - body: { - value?: infer TPage; - }; -} ? GetArrayType : Array; +// @public (undocumented) +export interface TextOperationsDetectTextJailbreakDefaultHeaders { + "x-ms-error-code"?: string; +} -// @public -export interface PagingOptions { - customGetPage?: GetPage[]>; +// @public (undocumented) +export interface TextOperationsDetectTextJailbreakDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & TextOperationsDetectTextJailbreakDefaultHeaders; + // (undocumented) + status: string; } // @public (undocumented) -export interface RemoveBlocklistItems { - post(options: RemoveBlocklistItemsParameters): StreamableMethod; +export type TextOperationsDetectTextJailbreakParameters = TextOperationsDetectTextJailbreakBodyParam & RequestParameters; + +// @public (undocumented) +export interface TextOperationsDetectTextProtectedMaterial { + post(options: TextOperationsDetectTextProtectedMaterialParameters): StreamableMethod; } // @public -export interface RemoveBlocklistItems204Response extends HttpResponse { +export interface TextOperationsDetectTextProtectedMaterial200Response extends HttpResponse { // (undocumented) - status: "204"; + body: AnalyzeTextProtectedMaterialResultOutput; + // (undocumented) + status: "200"; } // @public (undocumented) -export interface RemoveBlocklistItemsBodyParam { - body: RemoveTextBlocklistItemsOptions; +export interface TextOperationsDetectTextProtectedMaterialBodyParam { + body: AnalyzeTextProtectedMaterialOptions; } // @public (undocumented) -export interface RemoveBlocklistItemsDefaultHeaders { +export interface TextOperationsDetectTextProtectedMaterialDefaultHeaders { "x-ms-error-code"?: string; } // @public (undocumented) -export interface RemoveBlocklistItemsDefaultResponse extends HttpResponse { +export interface TextOperationsDetectTextProtectedMaterialDefaultResponse extends HttpResponse { // (undocumented) body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & RemoveBlocklistItemsDefaultHeaders; + headers: RawHttpHeaders & TextOperationsDetectTextProtectedMaterialDefaultHeaders; // (undocumented) status: string; } // @public (undocumented) -export type RemoveBlocklistItemsParameters = RemoveBlocklistItemsBodyParam & RequestParameters; - -// @public -export interface RemoveTextBlocklistItemsOptions { - blocklistItemIds: string[]; -} +export type TextOperationsDetectTextProtectedMaterialParameters = TextOperationsDetectTextProtectedMaterialBodyParam & RequestParameters; // @public (undocumented) -export interface Routes { - (path: "/text:analyze"): AnalyzeText; - (path: "/image:analyze"): AnalyzeImage; - (path: "/text/blocklists/{blocklistName}", blocklistName: string): GetTextBlocklist; - (path: "/text/blocklists"): ListTextBlocklists; - (path: "/text/blocklists/{blocklistName}:addOrUpdateBlocklistItems", blocklistName: string): AddOrUpdateBlocklistItems; - (path: "/text/blocklists/{blocklistName}:removeBlocklistItems", blocklistName: string): RemoveBlocklistItems; - (path: "/text/blocklists/{blocklistName}/blocklistItems/{blocklistItemId}", blocklistName: string, blocklistItemId: string): GetTextBlocklistItem; - (path: "/text/blocklists/{blocklistName}/blocklistItems", blocklistName: string): ListTextBlocklistItems; -} - -// @public -export interface TextBlocklist { - blocklistName: string; - description?: string; +export interface TextUngroundednessDetectionOperationsDetectUngroundedness { + post(options: TextUngroundednessDetectionOperationsDetectUngroundednessParameters): StreamableMethod; } // @public -export interface TextBlocklistItem { - description?: string; - text: string; +export interface TextUngroundednessDetectionOperationsDetectUngroundedness200Response extends HttpResponse { + // (undocumented) + body: DetectUngroundednessResultOutput; + // (undocumented) + status: "200"; } -// @public -export interface TextBlocklistItemOutput { - readonly blocklistItemId: string; - description?: string; - text: string; +// @public (undocumented) +export interface TextUngroundednessDetectionOperationsDetectUngroundednessBodyParam { + body: DetectUngroundednessOptions; } -// @public -export interface TextBlocklistMatchOutput { - blocklistItemId: string; - blocklistItemText: string; - blocklistName: string; +// @public (undocumented) +export interface TextUngroundednessDetectionOperationsDetectUngroundednessDefaultHeaders { + "x-ms-error-code"?: string; } -// @public -export interface TextBlocklistOutput { - blocklistName: string; - description?: string; +// @public (undocumented) +export interface TextUngroundednessDetectionOperationsDetectUngroundednessDefaultResponse extends HttpResponse { + // (undocumented) + body: ErrorResponse; + // (undocumented) + headers: RawHttpHeaders & TextUngroundednessDetectionOperationsDetectUngroundednessDefaultHeaders; + // (undocumented) + status: string; } -// @public -export type TextBlocklistResourceMergeAndPatch = Partial; +// @public (undocumented) +export type TextUngroundednessDetectionOperationsDetectUngroundednessParameters = TextUngroundednessDetectionOperationsDetectUngroundednessBodyParam & RequestParameters; // @public -export interface TextCategoriesAnalysisOutput { - category: string; - severity?: number; +export interface UngroundedDetailsOutput { + reason?: string; + text: string; } // (No @packageDocumentation comment for this package) diff --git a/sdk/contentsafety/ai-content-safety-rest/src/clientDefinitions.ts b/sdk/contentsafety/ai-content-safety-rest/src/clientDefinitions.ts index e1d5978a3897..1be7800ac179 100644 --- a/sdk/contentsafety/ai-content-safety-rest/src/clientDefinitions.ts +++ b/sdk/contentsafety/ai-content-safety-rest/src/clientDefinitions.ts @@ -2,142 +2,605 @@ // Licensed under the MIT license. import { - AnalyzeTextParameters, - AnalyzeImageParameters, - GetTextBlocklistParameters, - CreateOrUpdateTextBlocklistParameters, - DeleteTextBlocklistParameters, - ListTextBlocklistsParameters, - AddOrUpdateBlocklistItemsParameters, - RemoveBlocklistItemsParameters, - GetTextBlocklistItemParameters, - ListTextBlocklistItemsParameters, + TextOperationsAnalyzeTextParameters, + TextOperationsDetectTextJailbreakParameters, + TextOperationsDetectTextProtectedMaterialParameters, + ImageOperationsAnalyzeImageParameters, + TextBlocklistsGetTextBlocklistParameters, + TextBlocklistsCreateOrUpdateTextBlocklistParameters, + TextBlocklistsDeleteTextBlocklistParameters, + TextBlocklistsListTextBlocklistsParameters, + TextBlocklistsAddOrUpdateBlocklistItemsParameters, + TextBlocklistsRemoveBlocklistItemsParameters, + TextBlocklistsGetTextBlocklistItemParameters, + TextBlocklistsListTextBlocklistItemsParameters, + ImageBatchOperationsBatchAnalyzeImageParameters, + ImageBatchOperationsGetBatchTaskStatusParameters, + ImageBatchOperationsListBatchTasksParameters, + TextIncidentsGetIncidentsParameters, + TextIncidentsCreateOrUpdateIncidentParameters, + TextIncidentsDeleteIncidentParameters, + TextIncidentsListIncidentsParameters, + TextIncidentsAddIncidentSamplesParameters, + TextIncidentsRemoveIncidentSamplesParameters, + TextIncidentsGetIncidentSampleParameters, + TextIncidentsListIncidentSamplesParameters, + ImageIncidentsGetIncidentsParameters, + ImageIncidentsCreateOrUpdateIncidentParameters, + ImageIncidentsDeleteIncidentParameters, + ImageIncidentsListIncidentsParameters, + ImageIncidentsAddIncidentSamplesParameters, + ImageIncidentsRemoveIncidentSamplesParameters, + ImageIncidentsGetIncidentSampleParameters, + ImageIncidentsListIncidentSamplesParameters, + PromptTextOperationsAnnotateTextParameters, + TextCategoryCustomizationCreateOrReplaceTextCustomizedCategoryParameters, + TextCategoryCustomizationGetTextCustomizedCategoryParameters, + TextCategoryCustomizationDeleteTextCustomizedCategoryParameters, + TextCategoryCustomizationListTextCustomizedCategoryParameters, + ImageWithTextOperationsAnalyzeImageWithTextParameters, + TextUngroundednessDetectionOperationsDetectUngroundednessParameters, } from "./parameters"; import { - AnalyzeText200Response, - AnalyzeTextDefaultResponse, - AnalyzeImage200Response, - AnalyzeImageDefaultResponse, - GetTextBlocklist200Response, - GetTextBlocklistDefaultResponse, - CreateOrUpdateTextBlocklist200Response, - CreateOrUpdateTextBlocklist201Response, - CreateOrUpdateTextBlocklistDefaultResponse, - DeleteTextBlocklist204Response, - DeleteTextBlocklistDefaultResponse, - ListTextBlocklists200Response, - ListTextBlocklistsDefaultResponse, - AddOrUpdateBlocklistItems200Response, - AddOrUpdateBlocklistItemsDefaultResponse, - RemoveBlocklistItems204Response, - RemoveBlocklistItemsDefaultResponse, - GetTextBlocklistItem200Response, - GetTextBlocklistItemDefaultResponse, - ListTextBlocklistItems200Response, - ListTextBlocklistItemsDefaultResponse, + TextOperationsAnalyzeText200Response, + TextOperationsAnalyzeTextDefaultResponse, + TextOperationsDetectTextJailbreak200Response, + TextOperationsDetectTextJailbreakDefaultResponse, + TextOperationsDetectTextProtectedMaterial200Response, + TextOperationsDetectTextProtectedMaterialDefaultResponse, + ImageOperationsAnalyzeImage200Response, + ImageOperationsAnalyzeImageDefaultResponse, + TextBlocklistsGetTextBlocklist200Response, + TextBlocklistsGetTextBlocklistDefaultResponse, + TextBlocklistsCreateOrUpdateTextBlocklist200Response, + TextBlocklistsCreateOrUpdateTextBlocklist201Response, + TextBlocklistsCreateOrUpdateTextBlocklistDefaultResponse, + TextBlocklistsDeleteTextBlocklist204Response, + TextBlocklistsDeleteTextBlocklistDefaultResponse, + TextBlocklistsListTextBlocklists200Response, + TextBlocklistsListTextBlocklistsDefaultResponse, + TextBlocklistsAddOrUpdateBlocklistItems200Response, + TextBlocklistsAddOrUpdateBlocklistItemsDefaultResponse, + TextBlocklistsRemoveBlocklistItems204Response, + TextBlocklistsRemoveBlocklistItemsDefaultResponse, + TextBlocklistsGetTextBlocklistItem200Response, + TextBlocklistsGetTextBlocklistItemDefaultResponse, + TextBlocklistsListTextBlocklistItems200Response, + TextBlocklistsListTextBlocklistItemsDefaultResponse, + ImageBatchOperationsBatchAnalyzeImage200Response, + ImageBatchOperationsBatchAnalyzeImageDefaultResponse, + ImageBatchOperationsGetBatchTaskStatus200Response, + ImageBatchOperationsGetBatchTaskStatusDefaultResponse, + ImageBatchOperationsListBatchTasks200Response, + ImageBatchOperationsListBatchTasksDefaultResponse, + TextIncidentsGetIncidents200Response, + TextIncidentsGetIncidentsDefaultResponse, + TextIncidentsCreateOrUpdateIncident200Response, + TextIncidentsCreateOrUpdateIncident201Response, + TextIncidentsCreateOrUpdateIncidentDefaultResponse, + TextIncidentsDeleteIncident204Response, + TextIncidentsDeleteIncidentDefaultResponse, + TextIncidentsListIncidents200Response, + TextIncidentsListIncidentsDefaultResponse, + TextIncidentsAddIncidentSamples200Response, + TextIncidentsAddIncidentSamplesDefaultResponse, + TextIncidentsRemoveIncidentSamples204Response, + TextIncidentsRemoveIncidentSamplesDefaultResponse, + TextIncidentsGetIncidentSample200Response, + TextIncidentsGetIncidentSampleDefaultResponse, + TextIncidentsListIncidentSamples200Response, + TextIncidentsListIncidentSamplesDefaultResponse, + ImageIncidentsGetIncidents200Response, + ImageIncidentsGetIncidentsDefaultResponse, + ImageIncidentsCreateOrUpdateIncident200Response, + ImageIncidentsCreateOrUpdateIncident201Response, + ImageIncidentsCreateOrUpdateIncidentDefaultResponse, + ImageIncidentsDeleteIncident204Response, + ImageIncidentsDeleteIncidentDefaultResponse, + ImageIncidentsListIncidents200Response, + ImageIncidentsListIncidentsDefaultResponse, + ImageIncidentsAddIncidentSamples200Response, + ImageIncidentsAddIncidentSamplesDefaultResponse, + ImageIncidentsRemoveIncidentSamples204Response, + ImageIncidentsRemoveIncidentSamplesDefaultResponse, + ImageIncidentsGetIncidentSample200Response, + ImageIncidentsGetIncidentSampleDefaultResponse, + ImageIncidentsListIncidentSamples200Response, + ImageIncidentsListIncidentSamplesDefaultResponse, + PromptTextOperationsAnnotateText200Response, + PromptTextOperationsAnnotateTextDefaultResponse, + TextCategoryCustomizationCreateOrReplaceTextCustomizedCategory200Response, + TextCategoryCustomizationCreateOrReplaceTextCustomizedCategory201Response, + TextCategoryCustomizationCreateOrReplaceTextCustomizedCategoryDefaultResponse, + TextCategoryCustomizationGetTextCustomizedCategory200Response, + TextCategoryCustomizationGetTextCustomizedCategoryDefaultResponse, + TextCategoryCustomizationDeleteTextCustomizedCategory204Response, + TextCategoryCustomizationDeleteTextCustomizedCategoryDefaultResponse, + TextCategoryCustomizationListTextCustomizedCategory200Response, + TextCategoryCustomizationListTextCustomizedCategoryDefaultResponse, + ImageWithTextOperationsAnalyzeImageWithText200Response, + ImageWithTextOperationsAnalyzeImageWithTextDefaultResponse, + TextUngroundednessDetectionOperationsDetectUngroundedness200Response, + TextUngroundednessDetectionOperationsDetectUngroundednessDefaultResponse, } from "./responses"; import { Client, StreamableMethod } from "@azure-rest/core-client"; -export interface AnalyzeText { +export interface TextOperationsAnalyzeText { /** A synchronous API for the analysis of potentially harmful text content. Currently, it supports four categories: Hate, SelfHarm, Sexual, and Violence. */ post( - options: AnalyzeTextParameters, - ): StreamableMethod; + options: TextOperationsAnalyzeTextParameters, + ): StreamableMethod< + | TextOperationsAnalyzeText200Response + | TextOperationsAnalyzeTextDefaultResponse + >; +} + +export interface TextOperationsDetectTextJailbreak { + /** A synchronous API for the analysis of text jailbreak. */ + post( + options: TextOperationsDetectTextJailbreakParameters, + ): StreamableMethod< + | TextOperationsDetectTextJailbreak200Response + | TextOperationsDetectTextJailbreakDefaultResponse + >; +} + +export interface TextOperationsDetectTextProtectedMaterial { + /** A synchronous API for the analysis of protected material. */ + post( + options: TextOperationsDetectTextProtectedMaterialParameters, + ): StreamableMethod< + | TextOperationsDetectTextProtectedMaterial200Response + | TextOperationsDetectTextProtectedMaterialDefaultResponse + >; } -export interface AnalyzeImage { +export interface ImageOperationsAnalyzeImage { /** A synchronous API for the analysis of potentially harmful image content. Currently, it supports four categories: Hate, SelfHarm, Sexual, and Violence. */ post( - options: AnalyzeImageParameters, - ): StreamableMethod; + options: ImageOperationsAnalyzeImageParameters, + ): StreamableMethod< + | ImageOperationsAnalyzeImage200Response + | ImageOperationsAnalyzeImageDefaultResponse + >; } -export interface GetTextBlocklist { +export interface TextBlocklistsGetTextBlocklist { /** Returns text blocklist details. */ get( - options?: GetTextBlocklistParameters, - ): StreamableMethod; + options?: TextBlocklistsGetTextBlocklistParameters, + ): StreamableMethod< + | TextBlocklistsGetTextBlocklist200Response + | TextBlocklistsGetTextBlocklistDefaultResponse + >; /** Updates a text blocklist. If the blocklistName does not exist, a new blocklist will be created. */ patch( - options: CreateOrUpdateTextBlocklistParameters, + options: TextBlocklistsCreateOrUpdateTextBlocklistParameters, ): StreamableMethod< - | CreateOrUpdateTextBlocklist200Response - | CreateOrUpdateTextBlocklist201Response - | CreateOrUpdateTextBlocklistDefaultResponse + | TextBlocklistsCreateOrUpdateTextBlocklist200Response + | TextBlocklistsCreateOrUpdateTextBlocklist201Response + | TextBlocklistsCreateOrUpdateTextBlocklistDefaultResponse >; /** Deletes a text blocklist. */ delete( - options?: DeleteTextBlocklistParameters, - ): StreamableMethod; + options?: TextBlocklistsDeleteTextBlocklistParameters, + ): StreamableMethod< + | TextBlocklistsDeleteTextBlocklist204Response + | TextBlocklistsDeleteTextBlocklistDefaultResponse + >; } -export interface ListTextBlocklists { +export interface TextBlocklistsListTextBlocklists { /** Get all text blocklists details. */ get( - options?: ListTextBlocklistsParameters, - ): StreamableMethod; + options?: TextBlocklistsListTextBlocklistsParameters, + ): StreamableMethod< + | TextBlocklistsListTextBlocklists200Response + | TextBlocklistsListTextBlocklistsDefaultResponse + >; } -export interface AddOrUpdateBlocklistItems { +export interface TextBlocklistsAddOrUpdateBlocklistItems { /** Add or update blocklistItems to a text blocklist. You can add or update at most 100 blocklistItems in one request. */ post( - options: AddOrUpdateBlocklistItemsParameters, + options: TextBlocklistsAddOrUpdateBlocklistItemsParameters, ): StreamableMethod< - AddOrUpdateBlocklistItems200Response | AddOrUpdateBlocklistItemsDefaultResponse + | TextBlocklistsAddOrUpdateBlocklistItems200Response + | TextBlocklistsAddOrUpdateBlocklistItemsDefaultResponse >; } -export interface RemoveBlocklistItems { +export interface TextBlocklistsRemoveBlocklistItems { /** Remove blocklistItems from a text blocklist. You can remove at most 100 BlocklistItems in one request. */ post( - options: RemoveBlocklistItemsParameters, - ): StreamableMethod; + options: TextBlocklistsRemoveBlocklistItemsParameters, + ): StreamableMethod< + | TextBlocklistsRemoveBlocklistItems204Response + | TextBlocklistsRemoveBlocklistItemsDefaultResponse + >; } -export interface GetTextBlocklistItem { +export interface TextBlocklistsGetTextBlocklistItem { /** Get blocklistItem by blocklistName and blocklistItemId from a text blocklist. */ get( - options?: GetTextBlocklistItemParameters, - ): StreamableMethod; + options?: TextBlocklistsGetTextBlocklistItemParameters, + ): StreamableMethod< + | TextBlocklistsGetTextBlocklistItem200Response + | TextBlocklistsGetTextBlocklistItemDefaultResponse + >; } -export interface ListTextBlocklistItems { +export interface TextBlocklistsListTextBlocklistItems { /** Get all blocklistItems in a text blocklist. */ get( - options?: ListTextBlocklistItemsParameters, - ): StreamableMethod; + options?: TextBlocklistsListTextBlocklistItemsParameters, + ): StreamableMethod< + | TextBlocklistsListTextBlocklistItems200Response + | TextBlocklistsListTextBlocklistItemsDefaultResponse + >; +} + +export interface ImageBatchOperationsBatchAnalyzeImage { + /** An asynchronous API for the batch analysis of potentially harmful image content. Currently, it supports four categories: Hate, SelfHarm, Sexual, and Violence. */ + put( + options: ImageBatchOperationsBatchAnalyzeImageParameters, + ): StreamableMethod< + | ImageBatchOperationsBatchAnalyzeImage200Response + | ImageBatchOperationsBatchAnalyzeImageDefaultResponse + >; + /** Check the status of a batch image analysis task. */ + get( + options?: ImageBatchOperationsGetBatchTaskStatusParameters, + ): StreamableMethod< + | ImageBatchOperationsGetBatchTaskStatus200Response + | ImageBatchOperationsGetBatchTaskStatusDefaultResponse + >; +} + +export interface ImageBatchOperationsListBatchTasks { + /** List all batch image analysis tasks. */ + get( + options?: ImageBatchOperationsListBatchTasksParameters, + ): StreamableMethod< + | ImageBatchOperationsListBatchTasks200Response + | ImageBatchOperationsListBatchTasksDefaultResponse + >; +} + +export interface TextIncidentsGetIncidents { + /** Returns text incident details. */ + get( + options?: TextIncidentsGetIncidentsParameters, + ): StreamableMethod< + | TextIncidentsGetIncidents200Response + | TextIncidentsGetIncidentsDefaultResponse + >; + /** Updates a text incident. If the text incident does not exist, a new text incident will be created. */ + patch( + options: TextIncidentsCreateOrUpdateIncidentParameters, + ): StreamableMethod< + | TextIncidentsCreateOrUpdateIncident200Response + | TextIncidentsCreateOrUpdateIncident201Response + | TextIncidentsCreateOrUpdateIncidentDefaultResponse + >; + /** Deletes a text incident. */ + delete( + options?: TextIncidentsDeleteIncidentParameters, + ): StreamableMethod< + | TextIncidentsDeleteIncident204Response + | TextIncidentsDeleteIncidentDefaultResponse + >; +} + +export interface TextIncidentsListIncidents { + /** Get all incidents details. */ + get( + options?: TextIncidentsListIncidentsParameters, + ): StreamableMethod< + | TextIncidentsListIncidents200Response + | TextIncidentsListIncidentsDefaultResponse + >; +} + +export interface TextIncidentsAddIncidentSamples { + /** Add textIncidentSamples to an incident. You can add at most 100 textIncidentSamples in one request. */ + post( + options?: TextIncidentsAddIncidentSamplesParameters, + ): StreamableMethod< + | TextIncidentsAddIncidentSamples200Response + | TextIncidentsAddIncidentSamplesDefaultResponse + >; +} + +export interface TextIncidentsRemoveIncidentSamples { + /** Remove textIncidentSamples from an incident. You can remove at most 100 Text Incident in one request. */ + post( + options?: TextIncidentsRemoveIncidentSamplesParameters, + ): StreamableMethod< + | TextIncidentsRemoveIncidentSamples204Response + | TextIncidentsRemoveIncidentSamplesDefaultResponse + >; +} + +export interface TextIncidentsGetIncidentSample { + /** Get textIncidentSample by textIncidentName and textIncidentSampleId from a text incident. */ + get( + options?: TextIncidentsGetIncidentSampleParameters, + ): StreamableMethod< + | TextIncidentsGetIncidentSample200Response + | TextIncidentsGetIncidentSampleDefaultResponse + >; +} + +export interface TextIncidentsListIncidentSamples { + /** Get all TextIncidentSamples in a text incident. */ + get( + options?: TextIncidentsListIncidentSamplesParameters, + ): StreamableMethod< + | TextIncidentsListIncidentSamples200Response + | TextIncidentsListIncidentSamplesDefaultResponse + >; +} + +export interface ImageIncidentsGetIncidents { + /** Returns image incident details. */ + get( + options?: ImageIncidentsGetIncidentsParameters, + ): StreamableMethod< + | ImageIncidentsGetIncidents200Response + | ImageIncidentsGetIncidentsDefaultResponse + >; + /** Updates a image incident. If the image incident does not exist, a new image incident will be created. */ + patch( + options: ImageIncidentsCreateOrUpdateIncidentParameters, + ): StreamableMethod< + | ImageIncidentsCreateOrUpdateIncident200Response + | ImageIncidentsCreateOrUpdateIncident201Response + | ImageIncidentsCreateOrUpdateIncidentDefaultResponse + >; + /** Deletes a image incident. */ + delete( + options?: ImageIncidentsDeleteIncidentParameters, + ): StreamableMethod< + | ImageIncidentsDeleteIncident204Response + | ImageIncidentsDeleteIncidentDefaultResponse + >; +} + +export interface ImageIncidentsListIncidents { + /** Get all incidents details. */ + get( + options?: ImageIncidentsListIncidentsParameters, + ): StreamableMethod< + | ImageIncidentsListIncidents200Response + | ImageIncidentsListIncidentsDefaultResponse + >; +} + +export interface ImageIncidentsAddIncidentSamples { + /** Add imageIncidentSamples to an incident. You can add at most 100 imageIncidentSamples in one request. */ + post( + options?: ImageIncidentsAddIncidentSamplesParameters, + ): StreamableMethod< + | ImageIncidentsAddIncidentSamples200Response + | ImageIncidentsAddIncidentSamplesDefaultResponse + >; +} + +export interface ImageIncidentsRemoveIncidentSamples { + /** Remove imageIncidentSamples from an incident. You can remove at most 100 Image Incident in one request. */ + post( + options?: ImageIncidentsRemoveIncidentSamplesParameters, + ): StreamableMethod< + | ImageIncidentsRemoveIncidentSamples204Response + | ImageIncidentsRemoveIncidentSamplesDefaultResponse + >; +} + +export interface ImageIncidentsGetIncidentSample { + /** Get imageIncidentSample by imageIncidentName and imageIncidentSampleId from a image incident. */ + get( + options?: ImageIncidentsGetIncidentSampleParameters, + ): StreamableMethod< + | ImageIncidentsGetIncidentSample200Response + | ImageIncidentsGetIncidentSampleDefaultResponse + >; +} + +export interface ImageIncidentsListIncidentSamples { + /** Get all ImageIncidentSamples in a image incident. */ + get( + options?: ImageIncidentsListIncidentSamplesParameters, + ): StreamableMethod< + | ImageIncidentsListIncidentSamples200Response + | ImageIncidentsListIncidentSamplesDefaultResponse + >; +} + +export interface PromptTextOperationsAnnotateText { + /** A remote procedure call (RPC) operation. */ + post( + options: PromptTextOperationsAnnotateTextParameters, + ): StreamableMethod< + | PromptTextOperationsAnnotateText200Response + | PromptTextOperationsAnnotateTextDefaultResponse + >; +} + +export interface TextCategoryCustomizationCreateOrReplaceTextCustomizedCategory { + /** Create or replace operation template. */ + put( + options: TextCategoryCustomizationCreateOrReplaceTextCustomizedCategoryParameters, + ): StreamableMethod< + | TextCategoryCustomizationCreateOrReplaceTextCustomizedCategory200Response + | TextCategoryCustomizationCreateOrReplaceTextCustomizedCategory201Response + | TextCategoryCustomizationCreateOrReplaceTextCustomizedCategoryDefaultResponse + >; + /** Resource read operation template. */ + get( + options?: TextCategoryCustomizationGetTextCustomizedCategoryParameters, + ): StreamableMethod< + | TextCategoryCustomizationGetTextCustomizedCategory200Response + | TextCategoryCustomizationGetTextCustomizedCategoryDefaultResponse + >; + /** Resource delete operation template. */ + delete( + options?: TextCategoryCustomizationDeleteTextCustomizedCategoryParameters, + ): StreamableMethod< + | TextCategoryCustomizationDeleteTextCustomizedCategory204Response + | TextCategoryCustomizationDeleteTextCustomizedCategoryDefaultResponse + >; +} + +export interface TextCategoryCustomizationListTextCustomizedCategory { + /** Resource list operation template. */ + get( + options?: TextCategoryCustomizationListTextCustomizedCategoryParameters, + ): StreamableMethod< + | TextCategoryCustomizationListTextCustomizedCategory200Response + | TextCategoryCustomizationListTextCustomizedCategoryDefaultResponse + >; +} + +export interface ImageWithTextOperationsAnalyzeImageWithText { + /** A synchronous API for the analysis of potentially harmful image with text content. Currently, it supports four categories: Hate, SelfHarm, Sexual, and Violence. */ + post( + options: ImageWithTextOperationsAnalyzeImageWithTextParameters, + ): StreamableMethod< + | ImageWithTextOperationsAnalyzeImageWithText200Response + | ImageWithTextOperationsAnalyzeImageWithTextDefaultResponse + >; +} + +export interface TextUngroundednessDetectionOperationsDetectUngroundedness { + /** A synchronous API for the analysis of language model outputs to determine alignment with user-provided information or identify fictional content. */ + post( + options: TextUngroundednessDetectionOperationsDetectUngroundednessParameters, + ): StreamableMethod< + | TextUngroundednessDetectionOperationsDetectUngroundedness200Response + | TextUngroundednessDetectionOperationsDetectUngroundednessDefaultResponse + >; } export interface Routes { /** Resource for '/text:analyze' has methods for the following verbs: post */ - (path: "/text:analyze"): AnalyzeText; + (path: "/text:analyze"): TextOperationsAnalyzeText; + /** Resource for '/text:detectJailbreak' has methods for the following verbs: post */ + (path: "/text:detectJailbreak"): TextOperationsDetectTextJailbreak; + /** Resource for '/text:detectProtectedMaterial' has methods for the following verbs: post */ + ( + path: "/text:detectProtectedMaterial", + ): TextOperationsDetectTextProtectedMaterial; /** Resource for '/image:analyze' has methods for the following verbs: post */ - (path: "/image:analyze"): AnalyzeImage; + (path: "/image:analyze"): ImageOperationsAnalyzeImage; /** Resource for '/text/blocklists/\{blocklistName\}' has methods for the following verbs: get, patch, delete */ - (path: "/text/blocklists/{blocklistName}", blocklistName: string): GetTextBlocklist; + ( + path: "/text/blocklists/{blocklistName}", + blocklistName: string, + ): TextBlocklistsGetTextBlocklist; /** Resource for '/text/blocklists' has methods for the following verbs: get */ - (path: "/text/blocklists"): ListTextBlocklists; + (path: "/text/blocklists"): TextBlocklistsListTextBlocklists; /** Resource for '/text/blocklists/\{blocklistName\}:addOrUpdateBlocklistItems' has methods for the following verbs: post */ ( path: "/text/blocklists/{blocklistName}:addOrUpdateBlocklistItems", blocklistName: string, - ): AddOrUpdateBlocklistItems; + ): TextBlocklistsAddOrUpdateBlocklistItems; /** Resource for '/text/blocklists/\{blocklistName\}:removeBlocklistItems' has methods for the following verbs: post */ ( path: "/text/blocklists/{blocklistName}:removeBlocklistItems", blocklistName: string, - ): RemoveBlocklistItems; + ): TextBlocklistsRemoveBlocklistItems; /** Resource for '/text/blocklists/\{blocklistName\}/blocklistItems/\{blocklistItemId\}' has methods for the following verbs: get */ ( path: "/text/blocklists/{blocklistName}/blocklistItems/{blocklistItemId}", blocklistName: string, blocklistItemId: string, - ): GetTextBlocklistItem; + ): TextBlocklistsGetTextBlocklistItem; /** Resource for '/text/blocklists/\{blocklistName\}/blocklistItems' has methods for the following verbs: get */ ( path: "/text/blocklists/{blocklistName}/blocklistItems", blocklistName: string, - ): ListTextBlocklistItems; + ): TextBlocklistsListTextBlocklistItems; + /** Resource for '/image/batchAnalyses/\{operationId\}' has methods for the following verbs: put, get */ + ( + path: "/image/batchAnalyses/{operationId}", + operationId: string, + ): ImageBatchOperationsBatchAnalyzeImage; + /** Resource for '/image/batchAnalyses' has methods for the following verbs: get */ + (path: "/image/batchAnalyses"): ImageBatchOperationsListBatchTasks; + /** Resource for '/text/incidents/\{incidentName\}' has methods for the following verbs: get, patch, delete */ + ( + path: "/text/incidents/{incidentName}", + incidentName: string, + ): TextIncidentsGetIncidents; + /** Resource for '/text/incidents' has methods for the following verbs: get */ + (path: "/text/incidents"): TextIncidentsListIncidents; + /** Resource for '/text/incidents/\{incidentName\}:addIncidentSamples' has methods for the following verbs: post */ + ( + path: "/text/incidents/{incidentName}:addIncidentSamples", + incidentName: string, + ): TextIncidentsAddIncidentSamples; + /** Resource for '/text/incidents/\{incidentName\}:removeIncidentSamples' has methods for the following verbs: post */ + ( + path: "/text/incidents/{incidentName}:removeIncidentSamples", + incidentName: string, + ): TextIncidentsRemoveIncidentSamples; + /** Resource for '/text/incidents/\{incidentName\}/incidentSamples/\{incidentSampleId\}' has methods for the following verbs: get */ + ( + path: "/text/incidents/{incidentName}/incidentSamples/{incidentSampleId}", + incidentName: string, + incidentSampleId: string, + ): TextIncidentsGetIncidentSample; + /** Resource for '/text/incidents/\{incidentName\}/incidentSamples' has methods for the following verbs: get */ + ( + path: "/text/incidents/{incidentName}/incidentSamples", + incidentName: string, + ): TextIncidentsListIncidentSamples; + /** Resource for '/image/incidents/\{incidentName\}' has methods for the following verbs: get, patch, delete */ + ( + path: "/image/incidents/{incidentName}", + incidentName: string, + ): ImageIncidentsGetIncidents; + /** Resource for '/image/incidents' has methods for the following verbs: get */ + (path: "/image/incidents"): ImageIncidentsListIncidents; + /** Resource for '/image/incidents/\{incidentName\}:addIncidentSamples' has methods for the following verbs: post */ + ( + path: "/image/incidents/{incidentName}:addIncidentSamples", + incidentName: string, + ): ImageIncidentsAddIncidentSamples; + /** Resource for '/image/incidents/\{incidentName\}:removeIncidentSamples' has methods for the following verbs: post */ + ( + path: "/image/incidents/{incidentName}:removeIncidentSamples", + incidentName: string, + ): ImageIncidentsRemoveIncidentSamples; + /** Resource for '/image/incidents/\{incidentName\}/incidentSamples/\{incidentSampleId\}' has methods for the following verbs: get */ + ( + path: "/image/incidents/{incidentName}/incidentSamples/{incidentSampleId}", + incidentName: string, + incidentSampleId: string, + ): ImageIncidentsGetIncidentSample; + /** Resource for '/image/incidents/\{incidentName\}/incidentSamples' has methods for the following verbs: get */ + ( + path: "/image/incidents/{incidentName}/incidentSamples", + incidentName: string, + ): ImageIncidentsListIncidentSamples; + /** Resource for '/text:adaptiveAnnotate' has methods for the following verbs: post */ + (path: "/text:adaptiveAnnotate"): PromptTextOperationsAnnotateText; + /** Resource for '/text/categories/\{categoryName\}' has methods for the following verbs: put, get, delete */ + ( + path: "/text/categories/{categoryName}", + categoryName: string, + ): TextCategoryCustomizationCreateOrReplaceTextCustomizedCategory; + /** Resource for '/text/categories' has methods for the following verbs: get */ + ( + path: "/text/categories", + ): TextCategoryCustomizationListTextCustomizedCategory; + /** Resource for '/imageWithText:analyze' has methods for the following verbs: post */ + (path: "/imageWithText:analyze"): ImageWithTextOperationsAnalyzeImageWithText; + /** Resource for '/text:detectUngroundedness' has methods for the following verbs: post */ + ( + path: "/text:detectUngroundedness", + ): TextUngroundednessDetectionOperationsDetectUngroundedness; } export type ContentSafetyClient = Client & { diff --git a/sdk/contentsafety/ai-content-safety-rest/src/contentSafetyClient.ts b/sdk/contentsafety/ai-content-safety-rest/src/contentSafetyClient.ts index fd46e945ce08..1f17705f0c61 100644 --- a/sdk/contentsafety/ai-content-safety-rest/src/contentSafetyClient.ts +++ b/sdk/contentsafety/ai-content-safety-rest/src/contentSafetyClient.ts @@ -19,8 +19,8 @@ export default function createClient( options: ClientOptions = {}, ): ContentSafetyClient { const baseUrl = options.baseUrl ?? `${endpoint}/contentsafety`; - options.apiVersion = options.apiVersion ?? "2023-10-01"; - const userAgentInfo = `azsdk-js-ai-content-safety-rest/1.0.1`; + options.apiVersion = options.apiVersion ?? "2023-10-30-preview"; + const userAgentInfo = `azsdk-js-ai-content-safety-rest/1.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}` @@ -34,12 +34,19 @@ export default function createClient( logger: options.loggingOptions?.logger ?? logger.info, }, credentials: { - scopes: options.credentials?.scopes ?? ["https://cognitiveservices.azure.com/.default"], - apiKeyHeaderName: options.credentials?.apiKeyHeaderName ?? "Ocp-Apim-Subscription-Key", + scopes: options.credentials?.scopes ?? [ + "https://cognitiveservices.azure.com/.default", + ], + apiKeyHeaderName: + options.credentials?.apiKeyHeaderName ?? "Ocp-Apim-Subscription-Key", }, }; - const client = getClient(baseUrl, credentials, options) as ContentSafetyClient; + const client = getClient( + baseUrl, + credentials, + options, + ) as ContentSafetyClient; return client; } diff --git a/sdk/contentsafety/ai-content-safety-rest/src/isUnexpected.ts b/sdk/contentsafety/ai-content-safety-rest/src/isUnexpected.ts index 87938cf526c2..0bb3522ce7c8 100644 --- a/sdk/contentsafety/ai-content-safety-rest/src/isUnexpected.ts +++ b/sdk/contentsafety/ai-content-safety-rest/src/isUnexpected.ts @@ -2,31 +2,92 @@ // Licensed under the MIT license. import { - AnalyzeText200Response, - AnalyzeTextDefaultResponse, - AnalyzeImage200Response, - AnalyzeImageDefaultResponse, - GetTextBlocklist200Response, - GetTextBlocklistDefaultResponse, - CreateOrUpdateTextBlocklist200Response, - CreateOrUpdateTextBlocklist201Response, - CreateOrUpdateTextBlocklistDefaultResponse, - DeleteTextBlocklist204Response, - DeleteTextBlocklistDefaultResponse, - ListTextBlocklists200Response, - ListTextBlocklistsDefaultResponse, - AddOrUpdateBlocklistItems200Response, - AddOrUpdateBlocklistItemsDefaultResponse, - RemoveBlocklistItems204Response, - RemoveBlocklistItemsDefaultResponse, - GetTextBlocklistItem200Response, - GetTextBlocklistItemDefaultResponse, - ListTextBlocklistItems200Response, - ListTextBlocklistItemsDefaultResponse, + TextOperationsAnalyzeText200Response, + TextOperationsAnalyzeTextDefaultResponse, + TextOperationsDetectTextJailbreak200Response, + TextOperationsDetectTextJailbreakDefaultResponse, + TextOperationsDetectTextProtectedMaterial200Response, + TextOperationsDetectTextProtectedMaterialDefaultResponse, + ImageOperationsAnalyzeImage200Response, + ImageOperationsAnalyzeImageDefaultResponse, + TextBlocklistsGetTextBlocklist200Response, + TextBlocklistsGetTextBlocklistDefaultResponse, + TextBlocklistsCreateOrUpdateTextBlocklist200Response, + TextBlocklistsCreateOrUpdateTextBlocklist201Response, + TextBlocklistsCreateOrUpdateTextBlocklistDefaultResponse, + TextBlocklistsDeleteTextBlocklist204Response, + TextBlocklistsDeleteTextBlocklistDefaultResponse, + TextBlocklistsListTextBlocklists200Response, + TextBlocklistsListTextBlocklistsDefaultResponse, + TextBlocklistsAddOrUpdateBlocklistItems200Response, + TextBlocklistsAddOrUpdateBlocklistItemsDefaultResponse, + TextBlocklistsRemoveBlocklistItems204Response, + TextBlocklistsRemoveBlocklistItemsDefaultResponse, + TextBlocklistsGetTextBlocklistItem200Response, + TextBlocklistsGetTextBlocklistItemDefaultResponse, + TextBlocklistsListTextBlocklistItems200Response, + TextBlocklistsListTextBlocklistItemsDefaultResponse, + ImageBatchOperationsBatchAnalyzeImage200Response, + ImageBatchOperationsBatchAnalyzeImageDefaultResponse, + ImageBatchOperationsGetBatchTaskStatus200Response, + ImageBatchOperationsGetBatchTaskStatusDefaultResponse, + ImageBatchOperationsListBatchTasks200Response, + ImageBatchOperationsListBatchTasksDefaultResponse, + TextIncidentsGetIncidents200Response, + TextIncidentsGetIncidentsDefaultResponse, + TextIncidentsCreateOrUpdateIncident200Response, + TextIncidentsCreateOrUpdateIncident201Response, + TextIncidentsCreateOrUpdateIncidentDefaultResponse, + TextIncidentsDeleteIncident204Response, + TextIncidentsDeleteIncidentDefaultResponse, + TextIncidentsListIncidents200Response, + TextIncidentsListIncidentsDefaultResponse, + TextIncidentsAddIncidentSamples200Response, + TextIncidentsAddIncidentSamplesDefaultResponse, + TextIncidentsRemoveIncidentSamples204Response, + TextIncidentsRemoveIncidentSamplesDefaultResponse, + TextIncidentsGetIncidentSample200Response, + TextIncidentsGetIncidentSampleDefaultResponse, + TextIncidentsListIncidentSamples200Response, + TextIncidentsListIncidentSamplesDefaultResponse, + ImageIncidentsGetIncidents200Response, + ImageIncidentsGetIncidentsDefaultResponse, + ImageIncidentsCreateOrUpdateIncident200Response, + ImageIncidentsCreateOrUpdateIncident201Response, + ImageIncidentsCreateOrUpdateIncidentDefaultResponse, + ImageIncidentsDeleteIncident204Response, + ImageIncidentsDeleteIncidentDefaultResponse, + ImageIncidentsListIncidents200Response, + ImageIncidentsListIncidentsDefaultResponse, + ImageIncidentsAddIncidentSamples200Response, + ImageIncidentsAddIncidentSamplesDefaultResponse, + ImageIncidentsRemoveIncidentSamples204Response, + ImageIncidentsRemoveIncidentSamplesDefaultResponse, + ImageIncidentsGetIncidentSample200Response, + ImageIncidentsGetIncidentSampleDefaultResponse, + ImageIncidentsListIncidentSamples200Response, + ImageIncidentsListIncidentSamplesDefaultResponse, + PromptTextOperationsAnnotateText200Response, + PromptTextOperationsAnnotateTextDefaultResponse, + TextCategoryCustomizationCreateOrReplaceTextCustomizedCategory200Response, + TextCategoryCustomizationCreateOrReplaceTextCustomizedCategory201Response, + TextCategoryCustomizationCreateOrReplaceTextCustomizedCategoryDefaultResponse, + TextCategoryCustomizationGetTextCustomizedCategory200Response, + TextCategoryCustomizationGetTextCustomizedCategoryDefaultResponse, + TextCategoryCustomizationDeleteTextCustomizedCategory204Response, + TextCategoryCustomizationDeleteTextCustomizedCategoryDefaultResponse, + TextCategoryCustomizationListTextCustomizedCategory200Response, + TextCategoryCustomizationListTextCustomizedCategoryDefaultResponse, + ImageWithTextOperationsAnalyzeImageWithText200Response, + ImageWithTextOperationsAnalyzeImageWithTextDefaultResponse, + TextUngroundednessDetectionOperationsDetectUngroundedness200Response, + TextUngroundednessDetectionOperationsDetectUngroundednessDefaultResponse, } from "./responses"; const responseMap: Record = { "POST /text:analyze": ["200"], + "POST /text:detectJailbreak": ["200"], + "POST /text:detectProtectedMaterial": ["200"], "POST /image:analyze": ["200"], "GET /text/blocklists/{blocklistName}": ["200"], "PATCH /text/blocklists/{blocklistName}": ["200", "201"], @@ -34,77 +95,357 @@ const responseMap: Record = { "GET /text/blocklists": ["200"], "POST /text/blocklists/{blocklistName}:addOrUpdateBlocklistItems": ["200"], "POST /text/blocklists/{blocklistName}:removeBlocklistItems": ["204"], - "GET /text/blocklists/{blocklistName}/blocklistItems/{blocklistItemId}": ["200"], + "GET /text/blocklists/{blocklistName}/blocklistItems/{blocklistItemId}": [ + "200", + ], "GET /text/blocklists/{blocklistName}/blocklistItems": ["200"], + "PUT /image/batchAnalyses/{operationId}": ["200"], + "GET /image/batchAnalyses/{operationId}": ["200"], + "GET /image/batchAnalyses": ["200"], + "GET /text/incidents/{incidentName}": ["200"], + "PATCH /text/incidents/{incidentName}": ["200", "201"], + "DELETE /text/incidents/{incidentName}": ["204"], + "GET /text/incidents": ["200"], + "POST /text/incidents/{incidentName}:addIncidentSamples": ["200"], + "POST /text/incidents/{incidentName}:removeIncidentSamples": ["204"], + "GET /text/incidents/{incidentName}/incidentSamples/{incidentSampleId}": [ + "200", + ], + "GET /text/incidents/{incidentName}/incidentSamples": ["200"], + "GET /image/incidents/{incidentName}": ["200"], + "PATCH /image/incidents/{incidentName}": ["200", "201"], + "DELETE /image/incidents/{incidentName}": ["204"], + "GET /image/incidents": ["200"], + "POST /image/incidents/{incidentName}:addIncidentSamples": ["200"], + "POST /image/incidents/{incidentName}:removeIncidentSamples": ["204"], + "GET /image/incidents/{incidentName}/incidentSamples/{incidentSampleId}": [ + "200", + ], + "GET /image/incidents/{incidentName}/incidentSamples": ["200"], + "POST /text:adaptiveAnnotate": ["200"], + "PUT /text/categories/{categoryName}": ["200", "201"], + "GET /text/categories/{categoryName}": ["200"], + "DELETE /text/categories/{categoryName}": ["204"], + "GET /text/categories": ["200"], + "POST /imageWithText:analyze": ["200"], + "POST /text:detectUngroundedness": ["200"], }; export function isUnexpected( - response: AnalyzeText200Response | AnalyzeTextDefaultResponse, -): response is AnalyzeTextDefaultResponse; -export function isUnexpected( - response: AnalyzeImage200Response | AnalyzeImageDefaultResponse, -): response is AnalyzeImageDefaultResponse; -export function isUnexpected( - response: GetTextBlocklist200Response | GetTextBlocklistDefaultResponse, -): response is GetTextBlocklistDefaultResponse; -export function isUnexpected( - response: - | CreateOrUpdateTextBlocklist200Response - | CreateOrUpdateTextBlocklist201Response - | CreateOrUpdateTextBlocklistDefaultResponse, -): response is CreateOrUpdateTextBlocklistDefaultResponse; -export function isUnexpected( - response: DeleteTextBlocklist204Response | DeleteTextBlocklistDefaultResponse, -): response is DeleteTextBlocklistDefaultResponse; -export function isUnexpected( - response: ListTextBlocklists200Response | ListTextBlocklistsDefaultResponse, -): response is ListTextBlocklistsDefaultResponse; -export function isUnexpected( - response: AddOrUpdateBlocklistItems200Response | AddOrUpdateBlocklistItemsDefaultResponse, -): response is AddOrUpdateBlocklistItemsDefaultResponse; -export function isUnexpected( - response: RemoveBlocklistItems204Response | RemoveBlocklistItemsDefaultResponse, -): response is RemoveBlocklistItemsDefaultResponse; -export function isUnexpected( - response: GetTextBlocklistItem200Response | GetTextBlocklistItemDefaultResponse, -): response is GetTextBlocklistItemDefaultResponse; -export function isUnexpected( - response: ListTextBlocklistItems200Response | ListTextBlocklistItemsDefaultResponse, -): response is ListTextBlocklistItemsDefaultResponse; -export function isUnexpected( - response: - | AnalyzeText200Response - | AnalyzeTextDefaultResponse - | AnalyzeImage200Response - | AnalyzeImageDefaultResponse - | GetTextBlocklist200Response - | GetTextBlocklistDefaultResponse - | CreateOrUpdateTextBlocklist200Response - | CreateOrUpdateTextBlocklist201Response - | CreateOrUpdateTextBlocklistDefaultResponse - | DeleteTextBlocklist204Response - | DeleteTextBlocklistDefaultResponse - | ListTextBlocklists200Response - | ListTextBlocklistsDefaultResponse - | AddOrUpdateBlocklistItems200Response - | AddOrUpdateBlocklistItemsDefaultResponse - | RemoveBlocklistItems204Response - | RemoveBlocklistItemsDefaultResponse - | GetTextBlocklistItem200Response - | GetTextBlocklistItemDefaultResponse - | ListTextBlocklistItems200Response - | ListTextBlocklistItemsDefaultResponse, + response: + | TextOperationsAnalyzeText200Response + | TextOperationsAnalyzeTextDefaultResponse, +): response is TextOperationsAnalyzeTextDefaultResponse; +export function isUnexpected( + response: + | TextOperationsDetectTextJailbreak200Response + | TextOperationsDetectTextJailbreakDefaultResponse, +): response is TextOperationsDetectTextJailbreakDefaultResponse; +export function isUnexpected( + response: + | TextOperationsDetectTextProtectedMaterial200Response + | TextOperationsDetectTextProtectedMaterialDefaultResponse, +): response is TextOperationsDetectTextProtectedMaterialDefaultResponse; +export function isUnexpected( + response: + | ImageOperationsAnalyzeImage200Response + | ImageOperationsAnalyzeImageDefaultResponse, +): response is ImageOperationsAnalyzeImageDefaultResponse; +export function isUnexpected( + response: + | TextBlocklistsGetTextBlocklist200Response + | TextBlocklistsGetTextBlocklistDefaultResponse, +): response is TextBlocklistsGetTextBlocklistDefaultResponse; +export function isUnexpected( + response: + | TextBlocklistsCreateOrUpdateTextBlocklist200Response + | TextBlocklistsCreateOrUpdateTextBlocklist201Response + | TextBlocklistsCreateOrUpdateTextBlocklistDefaultResponse, +): response is TextBlocklistsCreateOrUpdateTextBlocklistDefaultResponse; +export function isUnexpected( + response: + | TextBlocklistsDeleteTextBlocklist204Response + | TextBlocklistsDeleteTextBlocklistDefaultResponse, +): response is TextBlocklistsDeleteTextBlocklistDefaultResponse; +export function isUnexpected( + response: + | TextBlocklistsListTextBlocklists200Response + | TextBlocklistsListTextBlocklistsDefaultResponse, +): response is TextBlocklistsListTextBlocklistsDefaultResponse; +export function isUnexpected( + response: + | TextBlocklistsAddOrUpdateBlocklistItems200Response + | TextBlocklistsAddOrUpdateBlocklistItemsDefaultResponse, +): response is TextBlocklistsAddOrUpdateBlocklistItemsDefaultResponse; +export function isUnexpected( + response: + | TextBlocklistsRemoveBlocklistItems204Response + | TextBlocklistsRemoveBlocklistItemsDefaultResponse, +): response is TextBlocklistsRemoveBlocklistItemsDefaultResponse; +export function isUnexpected( + response: + | TextBlocklistsGetTextBlocklistItem200Response + | TextBlocklistsGetTextBlocklistItemDefaultResponse, +): response is TextBlocklistsGetTextBlocklistItemDefaultResponse; +export function isUnexpected( + response: + | TextBlocklistsListTextBlocklistItems200Response + | TextBlocklistsListTextBlocklistItemsDefaultResponse, +): response is TextBlocklistsListTextBlocklistItemsDefaultResponse; +export function isUnexpected( + response: + | ImageBatchOperationsBatchAnalyzeImage200Response + | ImageBatchOperationsBatchAnalyzeImageDefaultResponse, +): response is ImageBatchOperationsBatchAnalyzeImageDefaultResponse; +export function isUnexpected( + response: + | ImageBatchOperationsGetBatchTaskStatus200Response + | ImageBatchOperationsGetBatchTaskStatusDefaultResponse, +): response is ImageBatchOperationsGetBatchTaskStatusDefaultResponse; +export function isUnexpected( + response: + | ImageBatchOperationsListBatchTasks200Response + | ImageBatchOperationsListBatchTasksDefaultResponse, +): response is ImageBatchOperationsListBatchTasksDefaultResponse; +export function isUnexpected( + response: + | TextIncidentsGetIncidents200Response + | TextIncidentsGetIncidentsDefaultResponse, +): response is TextIncidentsGetIncidentsDefaultResponse; +export function isUnexpected( + response: + | TextIncidentsCreateOrUpdateIncident200Response + | TextIncidentsCreateOrUpdateIncident201Response + | TextIncidentsCreateOrUpdateIncidentDefaultResponse, +): response is TextIncidentsCreateOrUpdateIncidentDefaultResponse; +export function isUnexpected( + response: + | TextIncidentsDeleteIncident204Response + | TextIncidentsDeleteIncidentDefaultResponse, +): response is TextIncidentsDeleteIncidentDefaultResponse; +export function isUnexpected( + response: + | TextIncidentsListIncidents200Response + | TextIncidentsListIncidentsDefaultResponse, +): response is TextIncidentsListIncidentsDefaultResponse; +export function isUnexpected( + response: + | TextIncidentsAddIncidentSamples200Response + | TextIncidentsAddIncidentSamplesDefaultResponse, +): response is TextIncidentsAddIncidentSamplesDefaultResponse; +export function isUnexpected( + response: + | TextIncidentsRemoveIncidentSamples204Response + | TextIncidentsRemoveIncidentSamplesDefaultResponse, +): response is TextIncidentsRemoveIncidentSamplesDefaultResponse; +export function isUnexpected( + response: + | TextIncidentsGetIncidentSample200Response + | TextIncidentsGetIncidentSampleDefaultResponse, +): response is TextIncidentsGetIncidentSampleDefaultResponse; +export function isUnexpected( + response: + | TextIncidentsListIncidentSamples200Response + | TextIncidentsListIncidentSamplesDefaultResponse, +): response is TextIncidentsListIncidentSamplesDefaultResponse; +export function isUnexpected( + response: + | ImageIncidentsGetIncidents200Response + | ImageIncidentsGetIncidentsDefaultResponse, +): response is ImageIncidentsGetIncidentsDefaultResponse; +export function isUnexpected( + response: + | ImageIncidentsCreateOrUpdateIncident200Response + | ImageIncidentsCreateOrUpdateIncident201Response + | ImageIncidentsCreateOrUpdateIncidentDefaultResponse, +): response is ImageIncidentsCreateOrUpdateIncidentDefaultResponse; +export function isUnexpected( + response: + | ImageIncidentsDeleteIncident204Response + | ImageIncidentsDeleteIncidentDefaultResponse, +): response is ImageIncidentsDeleteIncidentDefaultResponse; +export function isUnexpected( + response: + | ImageIncidentsListIncidents200Response + | ImageIncidentsListIncidentsDefaultResponse, +): response is ImageIncidentsListIncidentsDefaultResponse; +export function isUnexpected( + response: + | ImageIncidentsAddIncidentSamples200Response + | ImageIncidentsAddIncidentSamplesDefaultResponse, +): response is ImageIncidentsAddIncidentSamplesDefaultResponse; +export function isUnexpected( + response: + | ImageIncidentsRemoveIncidentSamples204Response + | ImageIncidentsRemoveIncidentSamplesDefaultResponse, +): response is ImageIncidentsRemoveIncidentSamplesDefaultResponse; +export function isUnexpected( + response: + | ImageIncidentsGetIncidentSample200Response + | ImageIncidentsGetIncidentSampleDefaultResponse, +): response is ImageIncidentsGetIncidentSampleDefaultResponse; +export function isUnexpected( + response: + | ImageIncidentsListIncidentSamples200Response + | ImageIncidentsListIncidentSamplesDefaultResponse, +): response is ImageIncidentsListIncidentSamplesDefaultResponse; +export function isUnexpected( + response: + | PromptTextOperationsAnnotateText200Response + | PromptTextOperationsAnnotateTextDefaultResponse, +): response is PromptTextOperationsAnnotateTextDefaultResponse; +export function isUnexpected( + response: + | TextCategoryCustomizationCreateOrReplaceTextCustomizedCategory200Response + | TextCategoryCustomizationCreateOrReplaceTextCustomizedCategory201Response + | TextCategoryCustomizationCreateOrReplaceTextCustomizedCategoryDefaultResponse, +): response is TextCategoryCustomizationCreateOrReplaceTextCustomizedCategoryDefaultResponse; +export function isUnexpected( + response: + | TextCategoryCustomizationGetTextCustomizedCategory200Response + | TextCategoryCustomizationGetTextCustomizedCategoryDefaultResponse, +): response is TextCategoryCustomizationGetTextCustomizedCategoryDefaultResponse; +export function isUnexpected( + response: + | TextCategoryCustomizationDeleteTextCustomizedCategory204Response + | TextCategoryCustomizationDeleteTextCustomizedCategoryDefaultResponse, +): response is TextCategoryCustomizationDeleteTextCustomizedCategoryDefaultResponse; +export function isUnexpected( + response: + | TextCategoryCustomizationListTextCustomizedCategory200Response + | TextCategoryCustomizationListTextCustomizedCategoryDefaultResponse, +): response is TextCategoryCustomizationListTextCustomizedCategoryDefaultResponse; +export function isUnexpected( + response: + | ImageWithTextOperationsAnalyzeImageWithText200Response + | ImageWithTextOperationsAnalyzeImageWithTextDefaultResponse, +): response is ImageWithTextOperationsAnalyzeImageWithTextDefaultResponse; +export function isUnexpected( + response: + | TextUngroundednessDetectionOperationsDetectUngroundedness200Response + | TextUngroundednessDetectionOperationsDetectUngroundednessDefaultResponse, +): response is TextUngroundednessDetectionOperationsDetectUngroundednessDefaultResponse; +export function isUnexpected( + response: + | TextOperationsAnalyzeText200Response + | TextOperationsAnalyzeTextDefaultResponse + | TextOperationsDetectTextJailbreak200Response + | TextOperationsDetectTextJailbreakDefaultResponse + | TextOperationsDetectTextProtectedMaterial200Response + | TextOperationsDetectTextProtectedMaterialDefaultResponse + | ImageOperationsAnalyzeImage200Response + | ImageOperationsAnalyzeImageDefaultResponse + | TextBlocklistsGetTextBlocklist200Response + | TextBlocklistsGetTextBlocklistDefaultResponse + | TextBlocklistsCreateOrUpdateTextBlocklist200Response + | TextBlocklistsCreateOrUpdateTextBlocklist201Response + | TextBlocklistsCreateOrUpdateTextBlocklistDefaultResponse + | TextBlocklistsDeleteTextBlocklist204Response + | TextBlocklistsDeleteTextBlocklistDefaultResponse + | TextBlocklistsListTextBlocklists200Response + | TextBlocklistsListTextBlocklistsDefaultResponse + | TextBlocklistsAddOrUpdateBlocklistItems200Response + | TextBlocklistsAddOrUpdateBlocklistItemsDefaultResponse + | TextBlocklistsRemoveBlocklistItems204Response + | TextBlocklistsRemoveBlocklistItemsDefaultResponse + | TextBlocklistsGetTextBlocklistItem200Response + | TextBlocklistsGetTextBlocklistItemDefaultResponse + | TextBlocklistsListTextBlocklistItems200Response + | TextBlocklistsListTextBlocklistItemsDefaultResponse + | ImageBatchOperationsBatchAnalyzeImage200Response + | ImageBatchOperationsBatchAnalyzeImageDefaultResponse + | ImageBatchOperationsGetBatchTaskStatus200Response + | ImageBatchOperationsGetBatchTaskStatusDefaultResponse + | ImageBatchOperationsListBatchTasks200Response + | ImageBatchOperationsListBatchTasksDefaultResponse + | TextIncidentsGetIncidents200Response + | TextIncidentsGetIncidentsDefaultResponse + | TextIncidentsCreateOrUpdateIncident200Response + | TextIncidentsCreateOrUpdateIncident201Response + | TextIncidentsCreateOrUpdateIncidentDefaultResponse + | TextIncidentsDeleteIncident204Response + | TextIncidentsDeleteIncidentDefaultResponse + | TextIncidentsListIncidents200Response + | TextIncidentsListIncidentsDefaultResponse + | TextIncidentsAddIncidentSamples200Response + | TextIncidentsAddIncidentSamplesDefaultResponse + | TextIncidentsRemoveIncidentSamples204Response + | TextIncidentsRemoveIncidentSamplesDefaultResponse + | TextIncidentsGetIncidentSample200Response + | TextIncidentsGetIncidentSampleDefaultResponse + | TextIncidentsListIncidentSamples200Response + | TextIncidentsListIncidentSamplesDefaultResponse + | ImageIncidentsGetIncidents200Response + | ImageIncidentsGetIncidentsDefaultResponse + | ImageIncidentsCreateOrUpdateIncident200Response + | ImageIncidentsCreateOrUpdateIncident201Response + | ImageIncidentsCreateOrUpdateIncidentDefaultResponse + | ImageIncidentsDeleteIncident204Response + | ImageIncidentsDeleteIncidentDefaultResponse + | ImageIncidentsListIncidents200Response + | ImageIncidentsListIncidentsDefaultResponse + | ImageIncidentsAddIncidentSamples200Response + | ImageIncidentsAddIncidentSamplesDefaultResponse + | ImageIncidentsRemoveIncidentSamples204Response + | ImageIncidentsRemoveIncidentSamplesDefaultResponse + | ImageIncidentsGetIncidentSample200Response + | ImageIncidentsGetIncidentSampleDefaultResponse + | ImageIncidentsListIncidentSamples200Response + | ImageIncidentsListIncidentSamplesDefaultResponse + | PromptTextOperationsAnnotateText200Response + | PromptTextOperationsAnnotateTextDefaultResponse + | TextCategoryCustomizationCreateOrReplaceTextCustomizedCategory200Response + | TextCategoryCustomizationCreateOrReplaceTextCustomizedCategory201Response + | TextCategoryCustomizationCreateOrReplaceTextCustomizedCategoryDefaultResponse + | TextCategoryCustomizationGetTextCustomizedCategory200Response + | TextCategoryCustomizationGetTextCustomizedCategoryDefaultResponse + | TextCategoryCustomizationDeleteTextCustomizedCategory204Response + | TextCategoryCustomizationDeleteTextCustomizedCategoryDefaultResponse + | TextCategoryCustomizationListTextCustomizedCategory200Response + | TextCategoryCustomizationListTextCustomizedCategoryDefaultResponse + | ImageWithTextOperationsAnalyzeImageWithText200Response + | ImageWithTextOperationsAnalyzeImageWithTextDefaultResponse + | TextUngroundednessDetectionOperationsDetectUngroundedness200Response + | TextUngroundednessDetectionOperationsDetectUngroundednessDefaultResponse, ): response is - | AnalyzeTextDefaultResponse - | AnalyzeImageDefaultResponse - | GetTextBlocklistDefaultResponse - | CreateOrUpdateTextBlocklistDefaultResponse - | DeleteTextBlocklistDefaultResponse - | ListTextBlocklistsDefaultResponse - | AddOrUpdateBlocklistItemsDefaultResponse - | RemoveBlocklistItemsDefaultResponse - | GetTextBlocklistItemDefaultResponse - | ListTextBlocklistItemsDefaultResponse { + | TextOperationsAnalyzeTextDefaultResponse + | TextOperationsDetectTextJailbreakDefaultResponse + | TextOperationsDetectTextProtectedMaterialDefaultResponse + | ImageOperationsAnalyzeImageDefaultResponse + | TextBlocklistsGetTextBlocklistDefaultResponse + | TextBlocklistsCreateOrUpdateTextBlocklistDefaultResponse + | TextBlocklistsDeleteTextBlocklistDefaultResponse + | TextBlocklistsListTextBlocklistsDefaultResponse + | TextBlocklistsAddOrUpdateBlocklistItemsDefaultResponse + | TextBlocklistsRemoveBlocklistItemsDefaultResponse + | TextBlocklistsGetTextBlocklistItemDefaultResponse + | TextBlocklistsListTextBlocklistItemsDefaultResponse + | ImageBatchOperationsBatchAnalyzeImageDefaultResponse + | ImageBatchOperationsGetBatchTaskStatusDefaultResponse + | ImageBatchOperationsListBatchTasksDefaultResponse + | TextIncidentsGetIncidentsDefaultResponse + | TextIncidentsCreateOrUpdateIncidentDefaultResponse + | TextIncidentsDeleteIncidentDefaultResponse + | TextIncidentsListIncidentsDefaultResponse + | TextIncidentsAddIncidentSamplesDefaultResponse + | TextIncidentsRemoveIncidentSamplesDefaultResponse + | TextIncidentsGetIncidentSampleDefaultResponse + | TextIncidentsListIncidentSamplesDefaultResponse + | ImageIncidentsGetIncidentsDefaultResponse + | ImageIncidentsCreateOrUpdateIncidentDefaultResponse + | ImageIncidentsDeleteIncidentDefaultResponse + | ImageIncidentsListIncidentsDefaultResponse + | ImageIncidentsAddIncidentSamplesDefaultResponse + | ImageIncidentsRemoveIncidentSamplesDefaultResponse + | ImageIncidentsGetIncidentSampleDefaultResponse + | ImageIncidentsListIncidentSamplesDefaultResponse + | PromptTextOperationsAnnotateTextDefaultResponse + | TextCategoryCustomizationCreateOrReplaceTextCustomizedCategoryDefaultResponse + | TextCategoryCustomizationGetTextCustomizedCategoryDefaultResponse + | TextCategoryCustomizationDeleteTextCustomizedCategoryDefaultResponse + | TextCategoryCustomizationListTextCustomizedCategoryDefaultResponse + | ImageWithTextOperationsAnalyzeImageWithTextDefaultResponse + | TextUngroundednessDetectionOperationsDetectUngroundednessDefaultResponse { const lroOriginal = response.headers["x-ms-original-url"]; const url = new URL(lroOriginal ?? response.request.url); const method = response.request.method; @@ -137,17 +478,24 @@ function getParametrizedPathSuccess(method: string, path: string): string[] { // track if we have found a match to return the values found. let found = true; - for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) { - if (candidateParts[i]?.startsWith("{") && candidateParts[i]?.indexOf("}") !== -1) { + for ( + let i = candidateParts.length - 1, j = pathParts.length - 1; + i >= 1 && j >= 1; + i--, j-- + ) { + if ( + candidateParts[i]?.startsWith("{") && + candidateParts[i]?.indexOf("}") !== -1 + ) { const start = candidateParts[i]!.indexOf("}") + 1, end = candidateParts[i]?.length; // If the current part of the candidate is a "template" part // Try to use the suffix of pattern to match the path // {guid} ==> $ // {guid}:export ==> :export$ - const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test( - pathParts[j] || "", - ); + const isMatched = new RegExp( + `${candidateParts[i]?.slice(start, end)}`, + ).test(pathParts[j] || ""); if (!isMatched) { found = false; diff --git a/sdk/contentsafety/ai-content-safety-rest/src/models.ts b/sdk/contentsafety/ai-content-safety-rest/src/models.ts index f3368faf30b4..8754bb02a474 100644 --- a/sdk/contentsafety/ai-content-safety-rest/src/models.ts +++ b/sdk/contentsafety/ai-content-safety-rest/src/models.ts @@ -14,9 +14,31 @@ export interface AnalyzeTextOptions { /** * This refers to the type of text analysis output. If no value is assigned, the default value will be "FourSeverityLevels". * - * Possible values: FourSeverityLevels, EightSeverityLevels + * Possible values: "FourSeverityLevels", "EightSeverityLevels" */ outputType?: string; + /** The incidents to detect. */ + incidents?: IncidentOptions; +} + +/** The text analysis request. */ +export interface IncidentOptions { + /** The accept decision made by service. */ + incidentNames?: string[]; + /** When set to true, further analyses of harmful content will not be performed in cases where incidents are hit. When set to false, all analyses of harmful content will be performed, whether or not incidents are hit. */ + haltOnIncidentHit?: boolean; +} + +/** The text jailbreak analysis request. */ +export interface AnalyzeTextJailbreakOptions { + /** The text needs to be analyzed if it attempt to jailbreak. We support a maximum of 1k Unicode characters (Unicode code points) in the text of one request. */ + text: string; +} + +/** The protected material analysis request. */ +export interface AnalyzeTextProtectedMaterialOptions { + /** The text needs to be analyzed. We support a maximum of 1k Unicode characters (Unicode code points) in the text of one request. */ + text: string; } /** The image analysis request. */ @@ -28,9 +50,11 @@ export interface AnalyzeImageOptions { /** * This refers to the type of image analysis output. If no value is assigned, the default value will be "FourSeverityLevels". * - * Possible values: FourSeverityLevels + * Possible values: "FourSeverityLevels" */ outputType?: string; + /** The incidents to detect. */ + incidents?: IncidentOptions; } /** The image can be either base64 encoded bytes or a blob URL. You can choose only one of these options. If both are provided, the request will be refused. The maximum image size is 2048 x 2048 pixels and should not exceed 4 MB, while the minimum image size is 50 x 50 pixels. */ @@ -68,3 +92,204 @@ export interface RemoveTextBlocklistItemsOptions { /** Array of blocklistItemIds to remove. */ blocklistItemIds: string[]; } + +/** The image batch analysis request. */ +export interface BatchAnalyzeImagesOptions { + /** The blob parameters of images to be analyzed. */ + images: BatchAnalyzeImages; + /** The blob parameters of result files. */ + resultsBlob: BatchAnalyzeImagesResultsBlob; + /** + * The storage mode for the batch task results, either 'CollectiveResultFile' or 'IndividualResultFiles'. + * + * Possible values: "CollectiveResultFile", "IndividualResultFiles" + */ + resultsStorageMode?: string; + /** The categories will be analyzed. If they are not assigned, a default set of analysis results for the categories will be returned. */ + categories?: string[]; + /** + * This refers to the type of image analysis output. If no value is assigned, the default value will be 'FourSeverityLevels'. + * + * Possible values: "FourSeverityLevels" + */ + outputType?: string; + /** The incidents to detect. */ + incidents?: IncidentOptions; +} + +/** The image batch analysis input. */ +export interface BatchAnalyzeImages { + /** The URL to a blob prefix which represents a directory containing all the images to be analyzed in this batch task. */ + blobPrefixLocation: string; + /** The delimiter character you desire to use in the location URL, typically '/'. */ + delimiter: string; + /** An array of strings indicating file extensions of desired images within the logical folder. */ + extensions: string[]; + /** The last modified time (in RFC1123 format) of blobs. Only images that were modified before this time will be analyzed. */ + lastModified?: Date | string; +} + +/** The image batch analysis output. */ +export interface BatchAnalyzeImagesResultsBlob { + /** The URL to a blob prefix which represents a directory. The analysis result file(s) will be written to this directory. */ + blobPrefixLocation: string; + /** The delimiter character you desire to use in the location URL, typically '/'. */ + delimiter: string; +} + +/** Text Incident. */ +export interface TextIncident { + /** incident name. */ + incidentName: string; + /** Incident description. */ + description?: string; + /** Incident created time. */ + created: Date | string; + /** Incident updated time. */ + lastUpdated: Date | string; +} + +/** The request to add incidentSamples to a incident. */ +export interface AddTextIncidentSamplesOptions { + /** Array of incidentSamples to add. */ + incidentSamples: Array; +} + +/** Sample in a Text Incident. */ +export interface TextIncidentSample { + /** IncidentSample text content. */ + text?: string; +} + +/** The request to remove incidentSamples from a incident. */ +export interface RemoveTextIncidentSamplesOptions { + /** Array of incidentSamples to remove. */ + incidentSampleIds: string[]; +} + +/** Image Incident. */ +export interface ImageIncident { + /** incident name. */ + incidentName: string; + /** Incident description. */ + description?: string; + /** Incident created time. */ + created: Date | string; + /** Incident updated time. */ + lastUpdated: Date | string; +} + +/** The request to add incidentSamples to a incident. */ +export interface AddImageIncidentSamplesOptions { + /** Array of incidentSamples to add. */ + incidentSamples: Array; +} + +/** Sample in an Image Incident. */ +export interface ImageIncidentSample { + /** IncidentSample image content. */ + image?: ImageData; +} + +/** The request to remove incidentSamples from a incident. */ +export interface RemoveImageIncidentSamplesOptions { + /** Array of incidentSamples to remove. */ + incidentSampleIds: string[]; +} + +/** Annotate text options */ +export interface AnnotateTextOptions { + /** The text needs to be analyzed. We support a maximum of 10k Unicode characters (Unicode code points) in the text of one request. */ + text: string; + /** The category will be analyzed, you can set your customized category or one of built-in categories in 'Hate','Selfharm', 'Sexual' and 'Violence'. */ + category: string; +} + +/** Text Customized categories. */ +export interface TextCustomizedCategory { + /** Text customizedCategories name. */ + categoryName: string; + /** Some pre defined concepts used in definition. */ + preDefinedConcepts?: Array; + /** Subcategories in the customized category. */ + subcategories: Array; + /** Text customizedCategories emphases. */ + emphases?: string[]; + /** Text url of example jsonl blob. */ + exampleBlobUrl?: string; +} + +/** Pre-defined concept. */ +export interface PreDefinedConcept { + /** The concept name. */ + concept: string; + /** The concept description. */ + description: string; +} + +/** Label definition. */ +export interface Subcategory { + /** The id of subcategory. */ + id: number; + /** The name of subcategory. */ + name: string; + /** The description of subcategory. */ + statements: string[]; +} + +/** The analysis request of the image with text. */ +export interface AnalyzeImageWithTextOptions { + /** The image needs to be analyzed. */ + image: ImageData; + /** The text attached to the image. We support at most 1k characters (unicode code points) in one text request. */ + text?: string; + /** The categories will be analyzed. If they are not assigned, a default set of analysis results for the categories will be returned. */ + categories?: string[]; + /** When set to true, our service will perform OCR and concatenate the recognized text with input text before analyzing. We will recognize at most 256 characters (unicode code points) from input image. The others will be truncated. */ + enableOcr: boolean; +} + +/** The request of ungroundedness detection. */ +export interface DetectUngroundednessOptions { + /** + * The domain of the text for analysis. + * This field is optional, with a default value of Generic. + * + * Possible values: "Generic", "Medical" + */ + domain?: string; + /** + * The task type for the text analysis. + * This field is optional, with a default value of Summarization. + * + * Possible values: "Summarization", "QnA" + */ + task?: string; + /** + * The user's question input in a QnA scenario. + * This field is optional, but if the task type is set to QnA, it becomes required. + */ + query?: string; + /** The text requiring analysis. */ + text: string; + /** The source information used as a grounding reference. */ + groundingSources: string[]; + /** + * A value indicating if the output includes an explanation for the identified ungroundedness. + * This field is optional, with a default value of false. + */ + reasoning?: boolean; + /** + * Connection details for the GPT resource. + * This field will be used only when the 'reasoning' field is set to true; otherwise, it will be ignored. + */ + gptResource?: GptResource; +} + +/** Connection details for the GPT resource. */ +export interface GptResource { + /** Endpoint for Azure OpenAI resource. */ + azureOpenAIEndpoint: string; + /** Deployment model name. */ + deploymentName: string; +} diff --git a/sdk/contentsafety/ai-content-safety-rest/src/outputModels.ts b/sdk/contentsafety/ai-content-safety-rest/src/outputModels.ts index ac215a7b18fa..3f097512a23c 100644 --- a/sdk/contentsafety/ai-content-safety-rest/src/outputModels.ts +++ b/sdk/contentsafety/ai-content-safety-rest/src/outputModels.ts @@ -2,6 +2,7 @@ // Licensed under the MIT license. import { Paged } from "@azure/core-paging"; +import { ErrorModel } from "@azure-rest/core-client"; /** The text analysis request. */ export interface AnalyzeTextOptionsOutput { @@ -16,9 +17,19 @@ export interface AnalyzeTextOptionsOutput { /** * This refers to the type of text analysis output. If no value is assigned, the default value will be "FourSeverityLevels". * - * Possible values: FourSeverityLevels, EightSeverityLevels + * Possible values: "FourSeverityLevels", "EightSeverityLevels" */ outputType?: string; + /** The incidents to detect. */ + incidents?: IncidentOptionsOutput; +} + +/** The text analysis request. */ +export interface IncidentOptionsOutput { + /** The accept decision made by service. */ + incidentNames?: string[]; + /** When set to true, further analyses of harmful content will not be performed in cases where incidents are hit. When set to false, all analyses of harmful content will be performed, whether or not incidents are hit. */ + haltOnIncidentHit?: boolean; } /** The text analysis response. */ @@ -27,6 +38,10 @@ export interface AnalyzeTextResultOutput { blocklistsMatch?: Array; /** Analysis result for categories. */ categoriesAnalysis: Array; + /** The incident match details. */ + incidentMatches?: Array; + /** Chunks in the original text detected as harmful content. Analysis result and scores are caused by these. */ + citation?: string[]; } /** The result of blocklist match. */ @@ -44,13 +59,55 @@ export interface TextCategoriesAnalysisOutput { /** * The text analysis category. * - * Possible values: Hate, SelfHarm, Sexual, Violence + * Possible values: "Hate", "SelfHarm", "Sexual", "Violence" */ category: string; /** The value increases with the severity of the input content. The value of this field is determined by the output type specified in the request. The output type could be ‘FourSeverityLevels’ or ‘EightSeverity Levels’, and the output value can be 0, 2, 4, 6 or 0, 1, 2, 3, 4, 5, 6, or 7. */ severity?: number; } +/** The result of text incident match. */ +export interface IncidentMatchOutput { + /** The name of the matched incident. */ + incidentName: string; +} + +/** The text jailbreak analysis request. */ +export interface AnalyzeTextJailbreakOptionsOutput { + /** The text needs to be analyzed if it attempt to jailbreak. We support a maximum of 1k Unicode characters (Unicode code points) in the text of one request. */ + text: string; +} + +/** The text jailbreak analysis request. */ +export interface AnalyzeTextJailbreakResultOutput { + /** Analysis result for jailbreak. */ + jailbreakAnalysis: JailbreakAnalysisResultOutput; +} + +/** The text jailbreak analysis response. */ +export interface JailbreakAnalysisResultOutput { + /** Analysis result for jailbreak. */ + detected: boolean; +} + +/** The protected material analysis request. */ +export interface AnalyzeTextProtectedMaterialOptionsOutput { + /** The text needs to be analyzed. We support a maximum of 1k Unicode characters (Unicode code points) in the text of one request. */ + text: string; +} + +/** The protected material analysis response. */ +export interface AnalyzeTextProtectedMaterialResultOutput { + /** Analysis result for protected material. */ + protectedMaterialAnalysis: ProtectedMaterialAnalysisResultOutput; +} + +/** The text protected material analysis response. */ +export interface ProtectedMaterialAnalysisResultOutput { + /** Analysis result for protected material.. */ + detected: boolean; +} + /** The image analysis request. */ export interface AnalyzeImageOptionsOutput { /** The image needs to be analyzed. */ @@ -60,9 +117,11 @@ export interface AnalyzeImageOptionsOutput { /** * This refers to the type of image analysis output. If no value is assigned, the default value will be "FourSeverityLevels". * - * Possible values: FourSeverityLevels + * Possible values: "FourSeverityLevels" */ outputType?: string; + /** The incidents to detect. */ + incidents?: IncidentOptionsOutput; } /** The image can be either base64 encoded bytes or a blob URL. You can choose only one of these options. If both are provided, the request will be refused. The maximum image size is 2048 x 2048 pixels and should not exceed 4 MB, while the minimum image size is 50 x 50 pixels. */ @@ -77,6 +136,8 @@ export interface ImageDataOutput { export interface AnalyzeImageResultOutput { /** Analysis result for categories. */ categoriesAnalysis: Array; + /** The incident match details. */ + incidentMatches?: Array; } /** Image analysis result. */ @@ -84,7 +145,7 @@ export interface ImageCategoriesAnalysisOutput { /** * The image analysis category. * - * Possible values: Hate, SelfHarm, Sexual, Violence + * Possible values: "Hate", "SelfHarm", "Sexual", "Violence" */ category: string; /** The value increases with the severity of the input content. The value of this field is determined by the output type specified in the request. The output type could be ‘FourSeverityLevels’, and the output value can be 0, 2, 4, 6. */ @@ -115,7 +176,305 @@ export interface AddOrUpdateTextBlocklistItemsResultOutput { blocklistItems: Array; } +/** The image batch analysis request. */ +export interface BatchAnalyzeImagesOptionsOutput { + /** The blob parameters of images to be analyzed. */ + images: BatchAnalyzeImagesOutput; + /** The blob parameters of result files. */ + resultsBlob: BatchAnalyzeImagesResultsBlobOutput; + /** + * The storage mode for the batch task results, either 'CollectiveResultFile' or 'IndividualResultFiles'. + * + * Possible values: "CollectiveResultFile", "IndividualResultFiles" + */ + resultsStorageMode?: string; + /** The categories will be analyzed. If they are not assigned, a default set of analysis results for the categories will be returned. */ + categories?: string[]; + /** + * This refers to the type of image analysis output. If no value is assigned, the default value will be 'FourSeverityLevels'. + * + * Possible values: "FourSeverityLevels" + */ + outputType?: string; + /** The incidents to detect. */ + incidents?: IncidentOptionsOutput; +} + +/** The image batch analysis input. */ +export interface BatchAnalyzeImagesOutput { + /** The URL to a blob prefix which represents a directory containing all the images to be analyzed in this batch task. */ + blobPrefixLocation: string; + /** The delimiter character you desire to use in the location URL, typically '/'. */ + delimiter: string; + /** An array of strings indicating file extensions of desired images within the logical folder. */ + extensions: string[]; + /** The last modified time (in RFC1123 format) of blobs. Only images that were modified before this time will be analyzed. */ + lastModified?: string; +} + +/** The image batch analysis output. */ +export interface BatchAnalyzeImagesResultsBlobOutput { + /** The URL to a blob prefix which represents a directory. The analysis result file(s) will be written to this directory. */ + blobPrefixLocation: string; + /** The delimiter character you desire to use in the location URL, typically '/'. */ + delimiter: string; +} + +/** Image batch analyze task. */ +export interface ImageBatchTaskDetailOutput { + /** The id of image batch analysis task. */ + id: string; + /** The kind of operation. */ + kind: string; + /** + * The status of the batch image analysis task. + * + * Possible values: "NotStarted", "Running", "Failed", "Succeeded" + */ + status: string; + /** Batch task result. */ + result: ImageBatchTaskResultOutput; + /** Return error detail when the task failed. */ + error?: ErrorModel; +} + +/** Image batch task result. */ +export interface ImageBatchTaskResultOutput { + /** The timestamp of when batch image analysis task was created. */ + createdTime: string; + /** The progress of the batch image analysis task, represented as a percentage (0-100). */ + progressPercentage: number; + /** The blob parameters of result files. */ + resultsBlob: BatchAnalyzeImagesResultsBlobOutput; +} + +/** Text Incident. */ +export interface TextIncidentOutput { + /** incident name. */ + incidentName: string; + /** Incident description. */ + description?: string; + /** Incident created time. */ + created: string; + /** Incident updated time. */ + lastUpdated: string; +} + +/** Sample in a Text Incident. */ +export interface TextIncidentSampleOutput { + /** incident name. */ + readonly incidentSampleId: string; + /** IncidentSample text content. */ + text?: string; +} + +/** The response of adding incidentSamples to the incident. */ +export interface AddTextIncidentSamplesResultOutput { + /** Array of incidentSamples have been added. */ + incidentSamples: Array; +} + +/** Image Incident. */ +export interface ImageIncidentOutput { + /** incident name. */ + incidentName: string; + /** Incident description. */ + description?: string; + /** Incident created time. */ + created: string; + /** Incident updated time. */ + lastUpdated: string; +} + +/** The response of adding incidentSamples to the incident. */ +export interface AddImageIncidentSamplesResultOutput { + /** Array of incidentSamples have been added. */ + incidentSamples: Array; +} + +/** Sample in a Image Incident. */ +export interface ListImageIncidentSampleResultOutput { + /** incident name. */ + readonly incidentSampleId: string; +} + +/** Sample Result in an Image Incident. */ +export interface ImageIncidentSampleResultOutput { + /** incident name. */ + readonly incidentSampleId: string; + /** IncidentSample image content. */ + image?: ImageDataResultOutput; +} + +/** The image result is base64 encoded bytes */ +export interface ImageDataResultOutput { + /** The Base64 encoding of the image. */ + content?: string; +} + +/** Annotate text options */ +export interface AnnotateTextOptionsOutput { + /** The text needs to be analyzed. We support a maximum of 10k Unicode characters (Unicode code points) in the text of one request. */ + text: string; + /** The category will be analyzed, you can set your customized category or one of built-in categories in 'Hate','Selfharm', 'Sexual' and 'Violence'. */ + category: string; +} + +/** The text annotation response. */ +export interface AnnotateTextResultOutput { + /** The id of annotated subcategory. */ + id: number; + /** The name of annotated subcategory. */ + name: string; + /** The reasoning. */ + reasoning?: string; +} + +/** Text Customized categories. */ +export interface TextCustomizedCategoryOutput { + /** Text customizedCategories name. */ + categoryName: string; + /** Some pre defined concepts used in definition. */ + preDefinedConcepts?: Array; + /** Subcategories in the customized category. */ + subcategories: Array; + /** Text customizedCategories emphases. */ + emphases?: string[]; + /** Text url of example jsonl blob. */ + exampleBlobUrl?: string; +} + +/** Pre-defined concept. */ +export interface PreDefinedConceptOutput { + /** The concept name. */ + concept: string; + /** The concept description. */ + description: string; +} + +/** Label definition. */ +export interface SubcategoryOutput { + /** The id of subcategory. */ + id: number; + /** The name of subcategory. */ + name: string; + /** The description of subcategory. */ + statements: string[]; +} + +/** The analysis request of the image with text. */ +export interface AnalyzeImageWithTextOptionsOutput { + /** The image needs to be analyzed. */ + image: ImageDataOutput; + /** The text attached to the image. We support at most 1k characters (unicode code points) in one text request. */ + text?: string; + /** The categories will be analyzed. If they are not assigned, a default set of analysis results for the categories will be returned. */ + categories?: string[]; + /** When set to true, our service will perform OCR and concatenate the recognized text with input text before analyzing. We will recognize at most 256 characters (unicode code points) from input image. The others will be truncated. */ + enableOcr: boolean; +} + +/** The analysis response of the image with text. */ +export interface AnalyzeImageWithTextResultOutput { + /** Analysis result for categories. */ + categoriesAnalysis: Array; +} + +/** ImageWithText analysis result. */ +export interface ImageWithTextCategoriesAnalysisOutput { + /** + * The imageWithtext analysis category. + * + * Possible values: "Hate", "SelfHarm", "Sexual", "Violence" + */ + category: string; + /** The higher the severity of input content, the larger this value is. The values could be: 0,2,4,6. */ + severity?: number; +} + +/** The request of ungroundedness detection. */ +export interface DetectUngroundednessOptionsOutput { + /** + * The domain of the text for analysis. + * This field is optional, with a default value of Generic. + * + * Possible values: "Generic", "Medical" + */ + domain?: string; + /** + * The task type for the text analysis. + * This field is optional, with a default value of Summarization. + * + * Possible values: "Summarization", "QnA" + */ + task?: string; + /** + * The user's question input in a QnA scenario. + * This field is optional, but if the task type is set to QnA, it becomes required. + */ + query?: string; + /** The text requiring analysis. */ + text: string; + /** The source information used as a grounding reference. */ + groundingSources: string[]; + /** + * A value indicating if the output includes an explanation for the identified ungroundedness. + * This field is optional, with a default value of false. + */ + reasoning?: boolean; + /** + * Connection details for the GPT resource. + * This field will be used only when the 'reasoning' field is set to true; otherwise, it will be ignored. + */ + gptResource?: GptResourceOutput; +} + +/** Connection details for the GPT resource. */ +export interface GptResourceOutput { + /** Endpoint for Azure OpenAI resource. */ + azureOpenAIEndpoint: string; + /** Deployment model name. */ + deploymentName: string; +} + +/** The response of ungroundedness detection. */ +export interface DetectUngroundednessResultOutput { + /** Detection result for ungrounded text. */ + ungrounded: boolean; + /** Confidence score of the model in the analysis results. */ + confidenceScore: number; + /** Percentage of ungrounded Text. */ + ungroundedPercentage: number; + /** The detailed information about a text identified as ungrounded. */ + ungroundedDetails: Array; +} + +/** The detailed information about a text identified as ungrounded. */ +export interface UngroundedDetailsOutput { + /** The ungrounded text. */ + text: string; + /** + * The explanation for identifying the text as ungrounded. + * Only when the 'reasoning' field in the input is set to true 'reason' field will be returned. + */ + reason?: string; +} + /** Paged collection of TextBlocklist items */ export type PagedTextBlocklistOutput = Paged; /** Paged collection of TextBlocklistItem items */ export type PagedTextBlocklistItemOutput = Paged; +/** Paged collection of ImageBatchTaskDetail items */ +export type PagedImageBatchTaskDetailOutput = Paged; +/** Paged collection of TextIncident items */ +export type PagedTextIncidentOutput = Paged; +/** Paged collection of TextIncidentSample items */ +export type PagedTextIncidentSampleOutput = Paged; +/** Paged collection of ImageIncident items */ +export type PagedImageIncidentOutput = Paged; +/** Paged collection of ListImageIncidentSampleResult items */ +export type PagedListImageIncidentSampleResultOutput = + Paged; +/** Paged collection of TextCustomizedCategory items */ +export type PagedTextCustomizedCategoryOutput = + Paged; diff --git a/sdk/contentsafety/ai-content-safety-rest/src/paginateHelper.ts b/sdk/contentsafety/ai-content-safety-rest/src/paginateHelper.ts index f0d91c952cda..3aac141db0e7 100644 --- a/sdk/contentsafety/ai-content-safety-rest/src/paginateHelper.ts +++ b/sdk/contentsafety/ai-content-safety-rest/src/paginateHelper.ts @@ -1,8 +1,16 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { getPagedAsyncIterator, PagedAsyncIterableIterator, PagedResult } from "@azure/core-paging"; -import { Client, createRestError, PathUncheckedResponse } from "@azure-rest/core-client"; +import { + getPagedAsyncIterator, + PagedAsyncIterableIterator, + PagedResult, +} from "@azure/core-paging"; +import { + Client, + createRestError, + PathUncheckedResponse, +} from "@azure-rest/core-client"; /** * Helper type to extract the type of an array @@ -67,7 +75,9 @@ export function paginate( typeof customGetPage === "function" ? customGetPage : async (pageLink: string) => { - const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get(); + const result = firstRun + ? initialResponse + : await client.pathUnchecked(pageLink).get(); firstRun = false; checkPagingRequest(result); const nextLink = getNextLink(result.body, nextLinkName); @@ -93,7 +103,9 @@ function getNextLink(body: unknown, nextLinkName?: string): string | undefined { const nextLink = (body as Record)[nextLinkName]; if (typeof nextLink !== "string" && typeof nextLink !== "undefined") { - throw new Error(`Body Property ${nextLinkName} should be a string or undefined`); + throw new Error( + `Body Property ${nextLinkName} should be a string or undefined`, + ); } return nextLink; @@ -121,7 +133,18 @@ function getElements(body: unknown, itemName: string): T[] { * Checks if a request failed */ function checkPagingRequest(response: PathUncheckedResponse): void { - const Http2xxStatusCodes = ["200", "201", "202", "203", "204", "205", "206", "207", "208", "226"]; + const Http2xxStatusCodes = [ + "200", + "201", + "202", + "203", + "204", + "205", + "206", + "207", + "208", + "226", + ]; if (!Http2xxStatusCodes.includes(response.status)) { throw createRestError( `Pagination failed with unexpected statusCode ${response.status}`, diff --git a/sdk/contentsafety/ai-content-safety-rest/src/parameters.ts b/sdk/contentsafety/ai-content-safety-rest/src/parameters.ts index 85a8b04c5d7f..ed0f154071c1 100644 --- a/sdk/contentsafety/ai-content-safety-rest/src/parameters.ts +++ b/sdk/contentsafety/ai-content-safety-rest/src/parameters.ts @@ -4,62 +4,253 @@ import { RequestParameters } from "@azure-rest/core-client"; import { AnalyzeTextOptions, + AnalyzeTextJailbreakOptions, + AnalyzeTextProtectedMaterialOptions, AnalyzeImageOptions, TextBlocklist, AddOrUpdateTextBlocklistItemsOptions, RemoveTextBlocklistItemsOptions, + BatchAnalyzeImagesOptions, + TextIncident, + AddTextIncidentSamplesOptions, + RemoveTextIncidentSamplesOptions, + ImageIncident, + AddImageIncidentSamplesOptions, + RemoveImageIncidentSamplesOptions, + AnnotateTextOptions, + TextCustomizedCategory, + AnalyzeImageWithTextOptions, + DetectUngroundednessOptions, } from "./models"; -export interface AnalyzeTextBodyParam { +export interface TextOperationsAnalyzeTextBodyParam { /** The text analysis request. */ body: AnalyzeTextOptions; } -export type AnalyzeTextParameters = AnalyzeTextBodyParam & RequestParameters; +export type TextOperationsAnalyzeTextParameters = + TextOperationsAnalyzeTextBodyParam & RequestParameters; -export interface AnalyzeImageBodyParam { +export interface TextOperationsDetectTextJailbreakBodyParam { + /** The text jailbreak analysis request. */ + body: AnalyzeTextJailbreakOptions; +} + +export type TextOperationsDetectTextJailbreakParameters = + TextOperationsDetectTextJailbreakBodyParam & RequestParameters; + +export interface TextOperationsDetectTextProtectedMaterialBodyParam { + /** The text protected material analysis request. */ + body: AnalyzeTextProtectedMaterialOptions; +} + +export type TextOperationsDetectTextProtectedMaterialParameters = + TextOperationsDetectTextProtectedMaterialBodyParam & RequestParameters; + +export interface ImageOperationsAnalyzeImageBodyParam { /** The image analysis request. */ body: AnalyzeImageOptions; } -export type AnalyzeImageParameters = AnalyzeImageBodyParam & RequestParameters; -export type GetTextBlocklistParameters = RequestParameters; +export type ImageOperationsAnalyzeImageParameters = + ImageOperationsAnalyzeImageBodyParam & RequestParameters; +export type TextBlocklistsGetTextBlocklistParameters = RequestParameters; /** The resource instance. */ export type TextBlocklistResourceMergeAndPatch = Partial; -export interface CreateOrUpdateTextBlocklistBodyParam { +export interface TextBlocklistsCreateOrUpdateTextBlocklistBodyParam { /** The resource instance. */ body: TextBlocklistResourceMergeAndPatch; } -export interface CreateOrUpdateTextBlocklistMediaTypesParam { +export interface TextBlocklistsCreateOrUpdateTextBlocklistMediaTypesParam { /** This request has a JSON Merge Patch body. */ contentType: "application/merge-patch+json"; } -export type CreateOrUpdateTextBlocklistParameters = CreateOrUpdateTextBlocklistMediaTypesParam & - CreateOrUpdateTextBlocklistBodyParam & - RequestParameters; -export type DeleteTextBlocklistParameters = RequestParameters; -export type ListTextBlocklistsParameters = RequestParameters; +export type TextBlocklistsCreateOrUpdateTextBlocklistParameters = + TextBlocklistsCreateOrUpdateTextBlocklistMediaTypesParam & + TextBlocklistsCreateOrUpdateTextBlocklistBodyParam & + RequestParameters; +export type TextBlocklistsDeleteTextBlocklistParameters = RequestParameters; +export type TextBlocklistsListTextBlocklistsParameters = RequestParameters; -export interface AddOrUpdateBlocklistItemsBodyParam { +export interface TextBlocklistsAddOrUpdateBlocklistItemsBodyParam { /** Options for adding or updating blocklist items. */ body: AddOrUpdateTextBlocklistItemsOptions; } -export type AddOrUpdateBlocklistItemsParameters = AddOrUpdateBlocklistItemsBodyParam & - RequestParameters; +export type TextBlocklistsAddOrUpdateBlocklistItemsParameters = + TextBlocklistsAddOrUpdateBlocklistItemsBodyParam & RequestParameters; -export interface RemoveBlocklistItemsBodyParam { +export interface TextBlocklistsRemoveBlocklistItemsBodyParam { /** Options for removing blocklist items. */ body: RemoveTextBlocklistItemsOptions; } -export type RemoveBlocklistItemsParameters = RemoveBlocklistItemsBodyParam & RequestParameters; -export type GetTextBlocklistItemParameters = RequestParameters; +export type TextBlocklistsRemoveBlocklistItemsParameters = + TextBlocklistsRemoveBlocklistItemsBodyParam & RequestParameters; +export type TextBlocklistsGetTextBlocklistItemParameters = RequestParameters; + +export interface TextBlocklistsListTextBlocklistItemsQueryParamProperties { + /** The number of result items to return. */ + top?: number; + /** The number of result items to skip. */ + skip?: number; + /** The maximum number of result items per page. */ + maxpagesize?: number; +} + +export interface TextBlocklistsListTextBlocklistItemsQueryParam { + queryParameters?: TextBlocklistsListTextBlocklistItemsQueryParamProperties; +} + +export type TextBlocklistsListTextBlocklistItemsParameters = + TextBlocklistsListTextBlocklistItemsQueryParam & RequestParameters; + +export interface ImageBatchOperationsBatchAnalyzeImageBodyParam { + /** The image batch analysis request. */ + body: BatchAnalyzeImagesOptions; +} + +export type ImageBatchOperationsBatchAnalyzeImageParameters = + ImageBatchOperationsBatchAnalyzeImageBodyParam & RequestParameters; +export type ImageBatchOperationsGetBatchTaskStatusParameters = + RequestParameters; + +export interface ImageBatchOperationsListBatchTasksQueryParamProperties { + /** The number of result items to return. */ + top?: number; + /** The number of result items to skip. */ + skip?: number; + /** The maximum number of result items per page. */ + maxpagesize?: number; +} + +export interface ImageBatchOperationsListBatchTasksQueryParam { + queryParameters?: ImageBatchOperationsListBatchTasksQueryParamProperties; +} + +export type ImageBatchOperationsListBatchTasksParameters = + ImageBatchOperationsListBatchTasksQueryParam & RequestParameters; +export type TextIncidentsGetIncidentsParameters = RequestParameters; +/** The resource instance. */ +export type TextIncidentResourceMergeAndPatch = Partial; + +export interface TextIncidentsCreateOrUpdateIncidentBodyParam { + /** The resource instance. */ + body: TextIncidentResourceMergeAndPatch; +} + +export interface TextIncidentsCreateOrUpdateIncidentMediaTypesParam { + /** This request has a JSON Merge Patch body. */ + contentType: "application/merge-patch+json"; +} + +export type TextIncidentsCreateOrUpdateIncidentParameters = + TextIncidentsCreateOrUpdateIncidentMediaTypesParam & + TextIncidentsCreateOrUpdateIncidentBodyParam & + RequestParameters; +export type TextIncidentsDeleteIncidentParameters = RequestParameters; + +export interface TextIncidentsListIncidentsQueryParamProperties { + /** The number of result items to return. */ + top?: number; + /** The number of result items to skip. */ + skip?: number; + /** The maximum number of result items per page. */ + maxpagesize?: number; +} + +export interface TextIncidentsListIncidentsQueryParam { + queryParameters?: TextIncidentsListIncidentsQueryParamProperties; +} + +export type TextIncidentsListIncidentsParameters = + TextIncidentsListIncidentsQueryParam & RequestParameters; + +export interface TextIncidentsAddIncidentSamplesBodyParam { + body?: AddTextIncidentSamplesOptions; +} + +export type TextIncidentsAddIncidentSamplesParameters = + TextIncidentsAddIncidentSamplesBodyParam & RequestParameters; + +export interface TextIncidentsRemoveIncidentSamplesBodyParam { + body?: RemoveTextIncidentSamplesOptions; +} + +export type TextIncidentsRemoveIncidentSamplesParameters = + TextIncidentsRemoveIncidentSamplesBodyParam & RequestParameters; +export type TextIncidentsGetIncidentSampleParameters = RequestParameters; + +export interface TextIncidentsListIncidentSamplesQueryParamProperties { + /** The number of result items to return. */ + top?: number; + /** The number of result items to skip. */ + skip?: number; + /** The maximum number of result items per page. */ + maxpagesize?: number; +} + +export interface TextIncidentsListIncidentSamplesQueryParam { + queryParameters?: TextIncidentsListIncidentSamplesQueryParamProperties; +} + +export type TextIncidentsListIncidentSamplesParameters = + TextIncidentsListIncidentSamplesQueryParam & RequestParameters; +export type ImageIncidentsGetIncidentsParameters = RequestParameters; +/** The resource instance. */ +export type ImageIncidentResourceMergeAndPatch = Partial; + +export interface ImageIncidentsCreateOrUpdateIncidentBodyParam { + /** The resource instance. */ + body: ImageIncidentResourceMergeAndPatch; +} + +export interface ImageIncidentsCreateOrUpdateIncidentMediaTypesParam { + /** This request has a JSON Merge Patch body. */ + contentType: "application/merge-patch+json"; +} + +export type ImageIncidentsCreateOrUpdateIncidentParameters = + ImageIncidentsCreateOrUpdateIncidentMediaTypesParam & + ImageIncidentsCreateOrUpdateIncidentBodyParam & + RequestParameters; +export type ImageIncidentsDeleteIncidentParameters = RequestParameters; + +export interface ImageIncidentsListIncidentsQueryParamProperties { + /** The number of result items to return. */ + top?: number; + /** The number of result items to skip. */ + skip?: number; + /** The maximum number of result items per page. */ + maxpagesize?: number; +} + +export interface ImageIncidentsListIncidentsQueryParam { + queryParameters?: ImageIncidentsListIncidentsQueryParamProperties; +} + +export type ImageIncidentsListIncidentsParameters = + ImageIncidentsListIncidentsQueryParam & RequestParameters; + +export interface ImageIncidentsAddIncidentSamplesBodyParam { + body?: AddImageIncidentSamplesOptions; +} + +export type ImageIncidentsAddIncidentSamplesParameters = + ImageIncidentsAddIncidentSamplesBodyParam & RequestParameters; + +export interface ImageIncidentsRemoveIncidentSamplesBodyParam { + body?: RemoveImageIncidentSamplesOptions; +} + +export type ImageIncidentsRemoveIncidentSamplesParameters = + ImageIncidentsRemoveIncidentSamplesBodyParam & RequestParameters; +export type ImageIncidentsGetIncidentSampleParameters = RequestParameters; -export interface ListTextBlocklistItemsQueryParamProperties { +export interface ImageIncidentsListIncidentSamplesQueryParamProperties { /** The number of result items to return. */ top?: number; /** The number of result items to skip. */ @@ -68,8 +259,64 @@ export interface ListTextBlocklistItemsQueryParamProperties { maxpagesize?: number; } -export interface ListTextBlocklistItemsQueryParam { - queryParameters?: ListTextBlocklistItemsQueryParamProperties; +export interface ImageIncidentsListIncidentSamplesQueryParam { + queryParameters?: ImageIncidentsListIncidentSamplesQueryParamProperties; +} + +export type ImageIncidentsListIncidentSamplesParameters = + ImageIncidentsListIncidentSamplesQueryParam & RequestParameters; + +export interface PromptTextOperationsAnnotateTextBodyParam { + /** The text analysis request. */ + body: AnnotateTextOptions; +} + +export type PromptTextOperationsAnnotateTextParameters = + PromptTextOperationsAnnotateTextBodyParam & RequestParameters; + +export interface TextCategoryCustomizationCreateOrReplaceTextCustomizedCategoryBodyParam { + /** The resource instance. */ + body: TextCustomizedCategory; +} + +export type TextCategoryCustomizationCreateOrReplaceTextCustomizedCategoryParameters = + TextCategoryCustomizationCreateOrReplaceTextCustomizedCategoryBodyParam & + RequestParameters; +export type TextCategoryCustomizationGetTextCustomizedCategoryParameters = + RequestParameters; +export type TextCategoryCustomizationDeleteTextCustomizedCategoryParameters = + RequestParameters; + +export interface TextCategoryCustomizationListTextCustomizedCategoryQueryParamProperties { + /** The number of result items to return. */ + top?: number; + /** The number of result items to skip. */ + skip?: number; + /** The maximum number of result items per page. */ + maxpagesize?: number; +} + +export interface TextCategoryCustomizationListTextCustomizedCategoryQueryParam { + queryParameters?: TextCategoryCustomizationListTextCustomizedCategoryQueryParamProperties; +} + +export type TextCategoryCustomizationListTextCustomizedCategoryParameters = + TextCategoryCustomizationListTextCustomizedCategoryQueryParam & + RequestParameters; + +export interface ImageWithTextOperationsAnalyzeImageWithTextBodyParam { + /** The image with text analysis request. */ + body: AnalyzeImageWithTextOptions; +} + +export type ImageWithTextOperationsAnalyzeImageWithTextParameters = + ImageWithTextOperationsAnalyzeImageWithTextBodyParam & RequestParameters; + +export interface TextUngroundednessDetectionOperationsDetectUngroundednessBodyParam { + /** The ungroundedness detection request. */ + body: DetectUngroundednessOptions; } -export type ListTextBlocklistItemsParameters = ListTextBlocklistItemsQueryParam & RequestParameters; +export type TextUngroundednessDetectionOperationsDetectUngroundednessParameters = + TextUngroundednessDetectionOperationsDetectUngroundednessBodyParam & + RequestParameters; diff --git a/sdk/contentsafety/ai-content-safety-rest/src/responses.ts b/sdk/contentsafety/ai-content-safety-rest/src/responses.ts index fb92d26ddc33..c380366d613c 100644 --- a/sdk/contentsafety/ai-content-safety-rest/src/responses.ts +++ b/sdk/contentsafety/ai-content-safety-rest/src/responses.ts @@ -5,184 +5,772 @@ import { RawHttpHeaders } from "@azure/core-rest-pipeline"; import { HttpResponse, ErrorResponse } from "@azure-rest/core-client"; import { AnalyzeTextResultOutput, + AnalyzeTextJailbreakResultOutput, + AnalyzeTextProtectedMaterialResultOutput, AnalyzeImageResultOutput, TextBlocklistOutput, PagedTextBlocklistOutput, AddOrUpdateTextBlocklistItemsResultOutput, TextBlocklistItemOutput, PagedTextBlocklistItemOutput, + ImageBatchTaskDetailOutput, + PagedImageBatchTaskDetailOutput, + TextIncidentOutput, + PagedTextIncidentOutput, + AddTextIncidentSamplesResultOutput, + TextIncidentSampleOutput, + PagedTextIncidentSampleOutput, + ImageIncidentOutput, + PagedImageIncidentOutput, + AddImageIncidentSamplesResultOutput, + ImageIncidentSampleResultOutput, + PagedListImageIncidentSampleResultOutput, + AnnotateTextResultOutput, + TextCustomizedCategoryOutput, + PagedTextCustomizedCategoryOutput, + AnalyzeImageWithTextResultOutput, + DetectUngroundednessResultOutput, } from "./outputModels"; /** The request has succeeded. */ -export interface AnalyzeText200Response extends HttpResponse { +export interface TextOperationsAnalyzeText200Response extends HttpResponse { status: "200"; body: AnalyzeTextResultOutput; } -export interface AnalyzeTextDefaultHeaders { +export interface TextOperationsAnalyzeTextDefaultHeaders { /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -export interface AnalyzeTextDefaultResponse extends HttpResponse { +export interface TextOperationsAnalyzeTextDefaultResponse extends HttpResponse { status: string; body: ErrorResponse; - headers: RawHttpHeaders & AnalyzeTextDefaultHeaders; + headers: RawHttpHeaders & TextOperationsAnalyzeTextDefaultHeaders; } /** The request has succeeded. */ -export interface AnalyzeImage200Response extends HttpResponse { +export interface TextOperationsDetectTextJailbreak200Response + extends HttpResponse { + status: "200"; + body: AnalyzeTextJailbreakResultOutput; +} + +export interface TextOperationsDetectTextJailbreakDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface TextOperationsDetectTextJailbreakDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & TextOperationsDetectTextJailbreakDefaultHeaders; +} + +/** The request has succeeded. */ +export interface TextOperationsDetectTextProtectedMaterial200Response + extends HttpResponse { + status: "200"; + body: AnalyzeTextProtectedMaterialResultOutput; +} + +export interface TextOperationsDetectTextProtectedMaterialDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface TextOperationsDetectTextProtectedMaterialDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & + TextOperationsDetectTextProtectedMaterialDefaultHeaders; +} + +/** The request has succeeded. */ +export interface ImageOperationsAnalyzeImage200Response extends HttpResponse { status: "200"; body: AnalyzeImageResultOutput; } -export interface AnalyzeImageDefaultHeaders { +export interface ImageOperationsAnalyzeImageDefaultHeaders { /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -export interface AnalyzeImageDefaultResponse extends HttpResponse { +export interface ImageOperationsAnalyzeImageDefaultResponse + extends HttpResponse { status: string; body: ErrorResponse; - headers: RawHttpHeaders & AnalyzeImageDefaultHeaders; + headers: RawHttpHeaders & ImageOperationsAnalyzeImageDefaultHeaders; } /** The request has succeeded. */ -export interface GetTextBlocklist200Response extends HttpResponse { +export interface TextBlocklistsGetTextBlocklist200Response + extends HttpResponse { status: "200"; body: TextBlocklistOutput; } -export interface GetTextBlocklistDefaultHeaders { +export interface TextBlocklistsGetTextBlocklistDefaultHeaders { /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -export interface GetTextBlocklistDefaultResponse extends HttpResponse { +export interface TextBlocklistsGetTextBlocklistDefaultResponse + extends HttpResponse { status: string; body: ErrorResponse; - headers: RawHttpHeaders & GetTextBlocklistDefaultHeaders; + headers: RawHttpHeaders & TextBlocklistsGetTextBlocklistDefaultHeaders; } /** The request has succeeded. */ -export interface CreateOrUpdateTextBlocklist200Response extends HttpResponse { +export interface TextBlocklistsCreateOrUpdateTextBlocklist200Response + extends HttpResponse { status: "200"; body: TextBlocklistOutput; } /** The request has succeeded and a new resource has been created as a result. */ -export interface CreateOrUpdateTextBlocklist201Response extends HttpResponse { +export interface TextBlocklistsCreateOrUpdateTextBlocklist201Response + extends HttpResponse { status: "201"; body: TextBlocklistOutput; } -export interface CreateOrUpdateTextBlocklistDefaultHeaders { +export interface TextBlocklistsCreateOrUpdateTextBlocklistDefaultHeaders { /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -export interface CreateOrUpdateTextBlocklistDefaultResponse extends HttpResponse { +export interface TextBlocklistsCreateOrUpdateTextBlocklistDefaultResponse + extends HttpResponse { status: string; body: ErrorResponse; - headers: RawHttpHeaders & CreateOrUpdateTextBlocklistDefaultHeaders; + headers: RawHttpHeaders & + TextBlocklistsCreateOrUpdateTextBlocklistDefaultHeaders; } /** There is no content to send for this request, but the headers may be useful. */ -export interface DeleteTextBlocklist204Response extends HttpResponse { +export interface TextBlocklistsDeleteTextBlocklist204Response + extends HttpResponse { status: "204"; } -export interface DeleteTextBlocklistDefaultHeaders { +export interface TextBlocklistsDeleteTextBlocklistDefaultHeaders { /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -export interface DeleteTextBlocklistDefaultResponse extends HttpResponse { +export interface TextBlocklistsDeleteTextBlocklistDefaultResponse + extends HttpResponse { status: string; body: ErrorResponse; - headers: RawHttpHeaders & DeleteTextBlocklistDefaultHeaders; + headers: RawHttpHeaders & TextBlocklistsDeleteTextBlocklistDefaultHeaders; } /** The request has succeeded. */ -export interface ListTextBlocklists200Response extends HttpResponse { +export interface TextBlocklistsListTextBlocklists200Response + extends HttpResponse { status: "200"; body: PagedTextBlocklistOutput; } -export interface ListTextBlocklistsDefaultHeaders { +export interface TextBlocklistsListTextBlocklistsDefaultHeaders { /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -export interface ListTextBlocklistsDefaultResponse extends HttpResponse { +export interface TextBlocklistsListTextBlocklistsDefaultResponse + extends HttpResponse { status: string; body: ErrorResponse; - headers: RawHttpHeaders & ListTextBlocklistsDefaultHeaders; + headers: RawHttpHeaders & TextBlocklistsListTextBlocklistsDefaultHeaders; } /** The request has succeeded. */ -export interface AddOrUpdateBlocklistItems200Response extends HttpResponse { +export interface TextBlocklistsAddOrUpdateBlocklistItems200Response + extends HttpResponse { status: "200"; body: AddOrUpdateTextBlocklistItemsResultOutput; } -export interface AddOrUpdateBlocklistItemsDefaultHeaders { +export interface TextBlocklistsAddOrUpdateBlocklistItemsDefaultHeaders { /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -export interface AddOrUpdateBlocklistItemsDefaultResponse extends HttpResponse { +export interface TextBlocklistsAddOrUpdateBlocklistItemsDefaultResponse + extends HttpResponse { status: string; body: ErrorResponse; - headers: RawHttpHeaders & AddOrUpdateBlocklistItemsDefaultHeaders; + headers: RawHttpHeaders & + TextBlocklistsAddOrUpdateBlocklistItemsDefaultHeaders; } /** There is no content to send for this request, but the headers may be useful. */ -export interface RemoveBlocklistItems204Response extends HttpResponse { +export interface TextBlocklistsRemoveBlocklistItems204Response + extends HttpResponse { status: "204"; } -export interface RemoveBlocklistItemsDefaultHeaders { +export interface TextBlocklistsRemoveBlocklistItemsDefaultHeaders { /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -export interface RemoveBlocklistItemsDefaultResponse extends HttpResponse { +export interface TextBlocklistsRemoveBlocklistItemsDefaultResponse + extends HttpResponse { status: string; body: ErrorResponse; - headers: RawHttpHeaders & RemoveBlocklistItemsDefaultHeaders; + headers: RawHttpHeaders & TextBlocklistsRemoveBlocklistItemsDefaultHeaders; } /** The request has succeeded. */ -export interface GetTextBlocklistItem200Response extends HttpResponse { +export interface TextBlocklistsGetTextBlocklistItem200Response + extends HttpResponse { status: "200"; body: TextBlocklistItemOutput; } -export interface GetTextBlocklistItemDefaultHeaders { +export interface TextBlocklistsGetTextBlocklistItemDefaultHeaders { /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -export interface GetTextBlocklistItemDefaultResponse extends HttpResponse { +export interface TextBlocklistsGetTextBlocklistItemDefaultResponse + extends HttpResponse { status: string; body: ErrorResponse; - headers: RawHttpHeaders & GetTextBlocklistItemDefaultHeaders; + headers: RawHttpHeaders & TextBlocklistsGetTextBlocklistItemDefaultHeaders; } /** The request has succeeded. */ -export interface ListTextBlocklistItems200Response extends HttpResponse { +export interface TextBlocklistsListTextBlocklistItems200Response + extends HttpResponse { status: "200"; body: PagedTextBlocklistItemOutput; } -export interface ListTextBlocklistItemsDefaultHeaders { +export interface TextBlocklistsListTextBlocklistItemsDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface TextBlocklistsListTextBlocklistItemsDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & TextBlocklistsListTextBlocklistItemsDefaultHeaders; +} + +/** The request has succeeded. */ +export interface ImageBatchOperationsBatchAnalyzeImage200Response + extends HttpResponse { + status: "200"; + body: ImageBatchTaskDetailOutput; +} + +export interface ImageBatchOperationsBatchAnalyzeImageDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface ImageBatchOperationsBatchAnalyzeImageDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & ImageBatchOperationsBatchAnalyzeImageDefaultHeaders; +} + +/** The request has succeeded. */ +export interface ImageBatchOperationsGetBatchTaskStatus200Response + extends HttpResponse { + status: "200"; + body: ImageBatchTaskDetailOutput; +} + +export interface ImageBatchOperationsGetBatchTaskStatusDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface ImageBatchOperationsGetBatchTaskStatusDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & + ImageBatchOperationsGetBatchTaskStatusDefaultHeaders; +} + +/** The request has succeeded. */ +export interface ImageBatchOperationsListBatchTasks200Response + extends HttpResponse { + status: "200"; + body: PagedImageBatchTaskDetailOutput; +} + +export interface ImageBatchOperationsListBatchTasksDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface ImageBatchOperationsListBatchTasksDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & ImageBatchOperationsListBatchTasksDefaultHeaders; +} + +/** The request has succeeded. */ +export interface TextIncidentsGetIncidents200Response extends HttpResponse { + status: "200"; + body: TextIncidentOutput; +} + +export interface TextIncidentsGetIncidentsDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface TextIncidentsGetIncidentsDefaultResponse extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & TextIncidentsGetIncidentsDefaultHeaders; +} + +/** The request has succeeded. */ +export interface TextIncidentsCreateOrUpdateIncident200Response + extends HttpResponse { + status: "200"; + body: TextIncidentOutput; +} + +/** The request has succeeded and a new resource has been created as a result. */ +export interface TextIncidentsCreateOrUpdateIncident201Response + extends HttpResponse { + status: "201"; + body: TextIncidentOutput; +} + +export interface TextIncidentsCreateOrUpdateIncidentDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface TextIncidentsCreateOrUpdateIncidentDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & TextIncidentsCreateOrUpdateIncidentDefaultHeaders; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface TextIncidentsDeleteIncident204Response extends HttpResponse { + status: "204"; +} + +export interface TextIncidentsDeleteIncidentDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface TextIncidentsDeleteIncidentDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & TextIncidentsDeleteIncidentDefaultHeaders; +} + +/** The request has succeeded. */ +export interface TextIncidentsListIncidents200Response extends HttpResponse { + status: "200"; + body: PagedTextIncidentOutput; +} + +export interface TextIncidentsListIncidentsDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface TextIncidentsListIncidentsDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & TextIncidentsListIncidentsDefaultHeaders; +} + +/** The request has succeeded. */ +export interface TextIncidentsAddIncidentSamples200Response + extends HttpResponse { + status: "200"; + body: AddTextIncidentSamplesResultOutput; +} + +export interface TextIncidentsAddIncidentSamplesDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface TextIncidentsAddIncidentSamplesDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & TextIncidentsAddIncidentSamplesDefaultHeaders; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface TextIncidentsRemoveIncidentSamples204Response + extends HttpResponse { + status: "204"; +} + +export interface TextIncidentsRemoveIncidentSamplesDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface TextIncidentsRemoveIncidentSamplesDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & TextIncidentsRemoveIncidentSamplesDefaultHeaders; +} + +/** The request has succeeded. */ +export interface TextIncidentsGetIncidentSample200Response + extends HttpResponse { + status: "200"; + body: TextIncidentSampleOutput; +} + +export interface TextIncidentsGetIncidentSampleDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface TextIncidentsGetIncidentSampleDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & TextIncidentsGetIncidentSampleDefaultHeaders; +} + +/** The request has succeeded. */ +export interface TextIncidentsListIncidentSamples200Response + extends HttpResponse { + status: "200"; + body: PagedTextIncidentSampleOutput; +} + +export interface TextIncidentsListIncidentSamplesDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface TextIncidentsListIncidentSamplesDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & TextIncidentsListIncidentSamplesDefaultHeaders; +} + +/** The request has succeeded. */ +export interface ImageIncidentsGetIncidents200Response extends HttpResponse { + status: "200"; + body: ImageIncidentOutput; +} + +export interface ImageIncidentsGetIncidentsDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface ImageIncidentsGetIncidentsDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & ImageIncidentsGetIncidentsDefaultHeaders; +} + +/** The request has succeeded. */ +export interface ImageIncidentsCreateOrUpdateIncident200Response + extends HttpResponse { + status: "200"; + body: ImageIncidentOutput; +} + +/** The request has succeeded and a new resource has been created as a result. */ +export interface ImageIncidentsCreateOrUpdateIncident201Response + extends HttpResponse { + status: "201"; + body: ImageIncidentOutput; +} + +export interface ImageIncidentsCreateOrUpdateIncidentDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface ImageIncidentsCreateOrUpdateIncidentDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & ImageIncidentsCreateOrUpdateIncidentDefaultHeaders; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ImageIncidentsDeleteIncident204Response extends HttpResponse { + status: "204"; +} + +export interface ImageIncidentsDeleteIncidentDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface ImageIncidentsDeleteIncidentDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & ImageIncidentsDeleteIncidentDefaultHeaders; +} + +/** The request has succeeded. */ +export interface ImageIncidentsListIncidents200Response extends HttpResponse { + status: "200"; + body: PagedImageIncidentOutput; +} + +export interface ImageIncidentsListIncidentsDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface ImageIncidentsListIncidentsDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & ImageIncidentsListIncidentsDefaultHeaders; +} + +/** The request has succeeded. */ +export interface ImageIncidentsAddIncidentSamples200Response + extends HttpResponse { + status: "200"; + body: AddImageIncidentSamplesResultOutput; +} + +export interface ImageIncidentsAddIncidentSamplesDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface ImageIncidentsAddIncidentSamplesDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & ImageIncidentsAddIncidentSamplesDefaultHeaders; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface ImageIncidentsRemoveIncidentSamples204Response + extends HttpResponse { + status: "204"; +} + +export interface ImageIncidentsRemoveIncidentSamplesDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface ImageIncidentsRemoveIncidentSamplesDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & ImageIncidentsRemoveIncidentSamplesDefaultHeaders; +} + +/** The request has succeeded. */ +export interface ImageIncidentsGetIncidentSample200Response + extends HttpResponse { + status: "200"; + body: ImageIncidentSampleResultOutput; +} + +export interface ImageIncidentsGetIncidentSampleDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface ImageIncidentsGetIncidentSampleDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & ImageIncidentsGetIncidentSampleDefaultHeaders; +} + +/** The request has succeeded. */ +export interface ImageIncidentsListIncidentSamples200Response + extends HttpResponse { + status: "200"; + body: PagedListImageIncidentSampleResultOutput; +} + +export interface ImageIncidentsListIncidentSamplesDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface ImageIncidentsListIncidentSamplesDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & ImageIncidentsListIncidentSamplesDefaultHeaders; +} + +/** The request has succeeded. */ +export interface PromptTextOperationsAnnotateText200Response + extends HttpResponse { + status: "200"; + body: AnnotateTextResultOutput; +} + +export interface PromptTextOperationsAnnotateTextDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface PromptTextOperationsAnnotateTextDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & PromptTextOperationsAnnotateTextDefaultHeaders; +} + +/** The request has succeeded. */ +export interface TextCategoryCustomizationCreateOrReplaceTextCustomizedCategory200Response + extends HttpResponse { + status: "200"; + body: TextCustomizedCategoryOutput; +} + +/** The request has succeeded and a new resource has been created as a result. */ +export interface TextCategoryCustomizationCreateOrReplaceTextCustomizedCategory201Response + extends HttpResponse { + status: "201"; + body: TextCustomizedCategoryOutput; +} + +export interface TextCategoryCustomizationCreateOrReplaceTextCustomizedCategoryDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface TextCategoryCustomizationCreateOrReplaceTextCustomizedCategoryDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & + TextCategoryCustomizationCreateOrReplaceTextCustomizedCategoryDefaultHeaders; +} + +/** The request has succeeded. */ +export interface TextCategoryCustomizationGetTextCustomizedCategory200Response + extends HttpResponse { + status: "200"; + body: TextCustomizedCategoryOutput; +} + +export interface TextCategoryCustomizationGetTextCustomizedCategoryDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface TextCategoryCustomizationGetTextCustomizedCategoryDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & + TextCategoryCustomizationGetTextCustomizedCategoryDefaultHeaders; +} + +/** There is no content to send for this request, but the headers may be useful. */ +export interface TextCategoryCustomizationDeleteTextCustomizedCategory204Response + extends HttpResponse { + status: "204"; +} + +export interface TextCategoryCustomizationDeleteTextCustomizedCategoryDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface TextCategoryCustomizationDeleteTextCustomizedCategoryDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & + TextCategoryCustomizationDeleteTextCustomizedCategoryDefaultHeaders; +} + +/** The request has succeeded. */ +export interface TextCategoryCustomizationListTextCustomizedCategory200Response + extends HttpResponse { + status: "200"; + body: PagedTextCustomizedCategoryOutput; +} + +export interface TextCategoryCustomizationListTextCustomizedCategoryDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface TextCategoryCustomizationListTextCustomizedCategoryDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & + TextCategoryCustomizationListTextCustomizedCategoryDefaultHeaders; +} + +/** The request has succeeded. */ +export interface ImageWithTextOperationsAnalyzeImageWithText200Response + extends HttpResponse { + status: "200"; + body: AnalyzeImageWithTextResultOutput; +} + +export interface ImageWithTextOperationsAnalyzeImageWithTextDefaultHeaders { + /** String error code indicating what went wrong. */ + "x-ms-error-code"?: string; +} + +export interface ImageWithTextOperationsAnalyzeImageWithTextDefaultResponse + extends HttpResponse { + status: string; + body: ErrorResponse; + headers: RawHttpHeaders & + ImageWithTextOperationsAnalyzeImageWithTextDefaultHeaders; +} + +/** The request has succeeded. */ +export interface TextUngroundednessDetectionOperationsDetectUngroundedness200Response + extends HttpResponse { + status: "200"; + body: DetectUngroundednessResultOutput; +} + +export interface TextUngroundednessDetectionOperationsDetectUngroundednessDefaultHeaders { /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -export interface ListTextBlocklistItemsDefaultResponse extends HttpResponse { +export interface TextUngroundednessDetectionOperationsDetectUngroundednessDefaultResponse + extends HttpResponse { status: string; body: ErrorResponse; - headers: RawHttpHeaders & ListTextBlocklistItemsDefaultHeaders; + headers: RawHttpHeaders & + TextUngroundednessDetectionOperationsDetectUngroundednessDefaultHeaders; } diff --git a/sdk/contentsafety/ai-content-safety-rest/tsconfig.json b/sdk/contentsafety/ai-content-safety-rest/tsconfig.json index ddbefcd7cd49..766326d1019f 100644 --- a/sdk/contentsafety/ai-content-safety-rest/tsconfig.json +++ b/sdk/contentsafety/ai-content-safety-rest/tsconfig.json @@ -3,10 +3,19 @@ "compilerOptions": { "outDir": "./dist-esm", "declarationDir": "./types", - "lib": ["es6", "dom"], + "lib": [ + "es6", + "dom" + ], "paths": { - "@azure-rest/ai-content-safety": ["./src/index"] + "@azure-rest/ai-content-safety": [ + "./src/index" + ] } }, - "include": ["src/**/*.ts", "./test/**/*.ts", "samples-dev/**/*.ts"] -} + "include": [ + "src/**/*.ts", + "./test/**/*.ts", + "samples-dev/**/*.ts" + ] +} \ No newline at end of file diff --git a/sdk/contentsafety/ai-content-safety-rest/tsp-location.yaml b/sdk/contentsafety/ai-content-safety-rest/tsp-location.yaml index 9d47983f6b57..666254ec02a2 100644 --- a/sdk/contentsafety/ai-content-safety-rest/tsp-location.yaml +++ b/sdk/contentsafety/ai-content-safety-rest/tsp-location.yaml @@ -1,3 +1,5 @@ directory: specification/cognitiveservices/ContentSafety +commit: 983ef3efcf3bf10eb4867009ee160eec742c2459 repo: Azure/azure-rest-api-specs -commit: 164375e67a1bffb207bcf603772c289dbe42d7b5 +additionalDirectories: [] +