From 3f37ab3938794337f951239768eb13e5267623d6 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 14 Mar 2019 16:05:01 +0000 Subject: [PATCH] Generated from 36a22093d4037ff1f8aa4325da8146be1d45d6ee Update examples --- .../LICENSE.txt | 2 +- .../README.md | 15 +- .../lib/models/index.ts | 391 +++++++++++-- .../lib/models/mappers.ts | 33 +- .../lib/models/parameters.ts | 21 +- .../lib/predictionAPIClient.ts | 458 ++++++++++++--- .../lib/predictionAPIClientContext.ts | 4 +- .../package.json | 3 +- .../LICENSE.txt | 2 +- .../README.md | 3 - .../lib/models/index.ts | 549 +++++++++++++----- .../lib/models/mappers.ts | 204 +++++-- .../lib/models/parameters.ts | 179 +++++- .../lib/trainingAPIClient.ts | 392 ++++++++++--- .../lib/trainingAPIClientContext.ts | 4 +- .../package.json | 3 +- 16 files changed, 1795 insertions(+), 468 deletions(-) diff --git a/packages/@azure/cognitiveservices-customvision-prediction/LICENSE.txt b/packages/@azure/cognitiveservices-customvision-prediction/LICENSE.txt index 5431ba98b936..8f3d856145c5 100644 --- a/packages/@azure/cognitiveservices-customvision-prediction/LICENSE.txt +++ b/packages/@azure/cognitiveservices-customvision-prediction/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Microsoft +Copyright (c) 2019 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/packages/@azure/cognitiveservices-customvision-prediction/README.md b/packages/@azure/cognitiveservices-customvision-prediction/README.md index 98ea5035fd41..55453181a5b4 100644 --- a/packages/@azure/cognitiveservices-customvision-prediction/README.md +++ b/packages/@azure/cognitiveservices-customvision-prediction/README.md @@ -15,7 +15,7 @@ npm install @azure/cognitiveservices-customvision-prediction ### How to use -#### nodejs - Authentication, client creation and predictImageUrl as an example written in TypeScript. +#### nodejs - Authentication, client creation and classifyImageUrl as an example written in TypeScript. ##### Install @azure/ms-rest-nodeauth @@ -34,12 +34,12 @@ const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; msRestNodeAuth.interactiveLogin().then((creds) => { const client = new PredictionAPIClient(creds, subscriptionId); const projectId = ec7b1657-199d-4d8a-bbb2-89a11a42e02a; + const publishedName = "testpublishedName"; const imageUrl: PredictionAPIModels.ImageUrl = { url: "testurl" }; - const iterationId = ec7b1657-199d-4d8a-bbb2-89a11a42e02a; const application = "testapplication"; - client.predictImageUrl(projectId, imageUrl, iterationId, application).then((result) => { + client.classifyImageUrl(projectId, publishedName, imageUrl, application).then((result) => { console.log("The result is:"); console.log(result); }); @@ -48,7 +48,7 @@ msRestNodeAuth.interactiveLogin().then((creds) => { }); ``` -#### browser - Authentication, client creation and predictImageUrl as an example written in JavaScript. +#### browser - Authentication, client creation and classifyImageUrl as an example written in JavaScript. ##### Install @azure/ms-rest-browserauth @@ -82,12 +82,12 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to } const client = new Azure.CognitiveservicesCustomvisionPrediction.PredictionAPIClient(res.creds, subscriptionId); const projectId = ec7b1657-199d-4d8a-bbb2-89a11a42e02a; + const publishedName = "testpublishedName"; const imageUrl = { url: "testurl" }; - const iterationId = ec7b1657-199d-4d8a-bbb2-89a11a42e02a; const application = "testapplication"; - client.predictImageUrl(projectId, imageUrl, iterationId, application).then((result) => { + client.classifyImageUrl(projectId, publishedName, imageUrl, application).then((result) => { console.log("The result is:"); console.log(result); }).catch((err) => { @@ -104,6 +104,3 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to ## Related projects - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) - - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fpackages%2F%40azure%2Fcognitiveservices-customvision-prediction%2FREADME.png) diff --git a/packages/@azure/cognitiveservices-customvision-prediction/lib/models/index.ts b/packages/@azure/cognitiveservices-customvision-prediction/lib/models/index.ts index 6b1eb61a7e04..9e107d25a9d9 100644 --- a/packages/@azure/cognitiveservices-customvision-prediction/lib/models/index.ts +++ b/packages/@azure/cognitiveservices-customvision-prediction/lib/models/index.ts @@ -14,60 +14,70 @@ import * as msRest from "@azure/ms-rest-js"; /** * @interface * An interface representing ImageUrl. + * Image url. + * */ export interface ImageUrl { /** - * @member {string} [url] + * @member {string} url Url of the image. */ - url?: string; + url: string; } /** * @interface * An interface representing BoundingBox. + * Bounding box that defines a region of an image. + * */ export interface BoundingBox { /** - * @member {number} [left] + * @member {number} left Coordinate of the left boundary. */ - left?: number; + left: number; /** - * @member {number} [top] + * @member {number} top Coordinate of the top boundary. */ - top?: number; + top: number; /** - * @member {number} [width] + * @member {number} width Width. */ - width?: number; + width: number; /** - * @member {number} [height] + * @member {number} height Height. */ - height?: number; + height: number; } /** * @interface * An interface representing Prediction. + * Prediction result. + * */ export interface Prediction { /** - * @member {number} [probability] **NOTE: This property will not be - * serialized. It can only be populated by the server.** + * @member {number} [probability] Probability of the tag. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** */ readonly probability?: number; /** - * @member {string} [tagId] **NOTE: This property will not be serialized. It - * can only be populated by the server.** + * @member {string} [tagId] Id of the predicted tag. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** */ readonly tagId?: string; /** - * @member {string} [tagName] **NOTE: This property will not be serialized. - * It can only be populated by the server.** + * @member {string} [tagName] Name of the predicted tag. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** */ readonly tagName?: string; /** - * @member {BoundingBox} [boundingBox] **NOTE: This property will not be - * serialized. It can only be populated by the server.** + * @member {BoundingBox} [boundingBox] Bounding box of the prediction. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** */ readonly boundingBox?: BoundingBox; } @@ -75,123 +85,376 @@ export interface Prediction { /** * @interface * An interface representing ImagePrediction. + * Result of an image prediction request. + * */ export interface ImagePrediction { /** - * @member {string} [id] **NOTE: This property will not be serialized. It can - * only be populated by the server.** + * @member {string} [id] Prediction Id. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** */ readonly id?: string; /** - * @member {string} [project] **NOTE: This property will not be serialized. - * It can only be populated by the server.** + * @member {string} [project] Project Id. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** */ readonly project?: string; /** - * @member {string} [iteration] **NOTE: This property will not be serialized. - * It can only be populated by the server.** + * @member {string} [iteration] Iteration Id. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** */ readonly iteration?: string; /** - * @member {Date} [created] **NOTE: This property will not be serialized. It - * can only be populated by the server.** + * @member {Date} [created] Date this prediction was created. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** */ readonly created?: Date; /** - * @member {Prediction[]} [predictions] **NOTE: This property will not be - * serialized. It can only be populated by the server.** + * @member {Prediction[]} [predictions] List of predictions. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** */ readonly predictions?: Prediction[]; } /** * @interface - * An interface representing PredictionAPIClientPredictImageUrlOptionalParams. + * An interface representing CustomVisionError. + */ +export interface CustomVisionError { + /** + * @member {CustomVisionErrorCodes} code The error code. Possible values + * include: 'NoError', 'BadRequest', 'BadRequestExceededBatchSize', + * 'BadRequestNotSupported', 'BadRequestInvalidIds', 'BadRequestProjectName', + * 'BadRequestProjectNameNotUnique', 'BadRequestProjectDescription', + * 'BadRequestProjectUnknownDomain', + * 'BadRequestProjectUnknownClassification', + * 'BadRequestProjectUnsupportedDomainTypeChange', + * 'BadRequestProjectUnsupportedExportPlatform', 'BadRequestIterationName', + * 'BadRequestIterationNameNotUnique', 'BadRequestIterationDescription', + * 'BadRequestIterationIsNotTrained', 'BadRequestWorkspaceCannotBeModified', + * 'BadRequestWorkspaceNotDeletable', 'BadRequestTagName', + * 'BadRequestTagNameNotUnique', 'BadRequestTagDescription', + * 'BadRequestTagType', 'BadRequestMultipleNegativeTag', + * 'BadRequestImageTags', 'BadRequestImageRegions', + * 'BadRequestNegativeAndRegularTagOnSameImage', + * 'BadRequestRequiredParamIsNull', 'BadRequestIterationIsPublished', + * 'BadRequestInvalidPublishName', 'BadRequestInvalidPublishTarget', + * 'BadRequestUnpublishFailed', 'BadRequestSubscriptionApi', + * 'BadRequestExceedProjectLimit', + * 'BadRequestExceedIterationPerProjectLimit', + * 'BadRequestExceedTagPerProjectLimit', 'BadRequestExceedTagPerImageLimit', + * 'BadRequestExceededQuota', 'BadRequestCannotMigrateProjectWithName', + * 'BadRequestNotLimitedTrial', 'BadRequestImageBatch', + * 'BadRequestImageStream', 'BadRequestImageUrl', 'BadRequestImageFormat', + * 'BadRequestImageSizeBytes', 'BadRequestImageExceededCount', + * 'BadRequestTrainingNotNeeded', + * 'BadRequestTrainingNotNeededButTrainingPipelineUpdated', + * 'BadRequestTrainingValidationFailed', + * 'BadRequestClassificationTrainingValidationFailed', + * 'BadRequestMultiClassClassificationTrainingValidationFailed', + * 'BadRequestMultiLabelClassificationTrainingValidationFailed', + * 'BadRequestDetectionTrainingValidationFailed', + * 'BadRequestTrainingAlreadyInProgress', + * 'BadRequestDetectionTrainingNotAllowNegativeTag', + * 'BadRequestInvalidEmailAddress', + * 'BadRequestDomainNotSupportedForAdvancedTraining', + * 'BadRequestExportPlatformNotSupportedForAdvancedTraining', + * 'BadRequestReservedBudgetInHoursNotEnoughForAdvancedTraining', + * 'BadRequestExportValidationFailed', 'BadRequestExportAlreadyInProgress', + * 'BadRequestPredictionIdsMissing', 'BadRequestPredictionIdsExceededCount', + * 'BadRequestPredictionTagsExceededCount', + * 'BadRequestPredictionResultsExceededCount', + * 'BadRequestPredictionInvalidApplicationName', + * 'BadRequestPredictionInvalidQueryParameters', 'BadRequestInvalid', + * 'UnsupportedMediaType', 'Forbidden', 'ForbiddenUser', + * 'ForbiddenUserResource', 'ForbiddenUserSignupDisabled', + * 'ForbiddenUserSignupAllowanceExceeded', 'ForbiddenUserDoesNotExist', + * 'ForbiddenUserDisabled', 'ForbiddenUserInsufficientCapability', + * 'ForbiddenDRModeEnabled', 'ForbiddenInvalid', 'NotFound', + * 'NotFoundProject', 'NotFoundProjectDefaultIteration', 'NotFoundIteration', + * 'NotFoundIterationPerformance', 'NotFoundTag', 'NotFoundImage', + * 'NotFoundDomain', 'NotFoundApimSubscription', 'NotFoundInvalid', + * 'Conflict', 'ConflictInvalid', 'ErrorUnknown', + * 'ErrorProjectInvalidWorkspace', + * 'ErrorProjectInvalidPipelineConfiguration', 'ErrorProjectInvalidDomain', + * 'ErrorProjectTrainingRequestFailed', 'ErrorProjectExportRequestFailed', + * 'ErrorFeaturizationServiceUnavailable', 'ErrorFeaturizationQueueTimeout', + * 'ErrorFeaturizationInvalidFeaturizer', + * 'ErrorFeaturizationAugmentationUnavailable', + * 'ErrorFeaturizationUnrecognizedJob', + * 'ErrorFeaturizationAugmentationError', 'ErrorExporterInvalidPlatform', + * 'ErrorExporterInvalidFeaturizer', 'ErrorExporterInvalidClassifier', + * 'ErrorPredictionServiceUnavailable', 'ErrorPredictionModelNotFound', + * 'ErrorPredictionModelNotCached', 'ErrorPrediction', + * 'ErrorPredictionStorage', 'ErrorRegionProposal', 'ErrorInvalid' + */ + code: CustomVisionErrorCodes; + /** + * @member {string} message A message explaining the error reported by the + * service. + */ + message: string; +} + +/** + * @interface + * An interface representing PredictionAPIClientClassifyImageUrlOptionalParams. * Optional Parameters. * * @extends RequestOptionsBase */ -export interface PredictionAPIClientPredictImageUrlOptionalParams extends msRest.RequestOptionsBase { +export interface PredictionAPIClientClassifyImageUrlOptionalParams extends msRest.RequestOptionsBase { /** - * @member {string} [iterationId] Optional. Specifies the id of a particular - * iteration to evaluate against. - * The default iteration for the project will be used when not specified + * @member {string} [application] Optional. Specifies the name of application + * using the endpoint. */ - iterationId?: string; + application?: string; +} + +/** + * @interface + * An interface representing PredictionAPIClientClassifyImageOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PredictionAPIClientClassifyImageOptionalParams extends msRest.RequestOptionsBase { /** * @member {string} [application] Optional. Specifies the name of application - * using the endpoint + * using the endpoint. */ application?: string; } /** * @interface - * An interface representing PredictionAPIClientPredictImageOptionalParams. + * An interface representing PredictionAPIClientClassifyImageUrlWithNoStoreOptionalParams. * Optional Parameters. * * @extends RequestOptionsBase */ -export interface PredictionAPIClientPredictImageOptionalParams extends msRest.RequestOptionsBase { +export interface PredictionAPIClientClassifyImageUrlWithNoStoreOptionalParams extends msRest.RequestOptionsBase { /** - * @member {string} [iterationId] Optional. Specifies the id of a particular - * iteration to evaluate against. - * The default iteration for the project will be used when not specified + * @member {string} [application] Optional. Specifies the name of application + * using the endpoint. */ - iterationId?: string; + application?: string; +} + +/** + * @interface + * An interface representing PredictionAPIClientClassifyImageWithNoStoreOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PredictionAPIClientClassifyImageWithNoStoreOptionalParams extends msRest.RequestOptionsBase { /** * @member {string} [application] Optional. Specifies the name of application - * using the endpoint + * using the endpoint. */ application?: string; } /** * @interface - * An interface representing PredictionAPIClientPredictImageUrlWithNoStoreOptionalParams. + * An interface representing PredictionAPIClientDetectImageUrlOptionalParams. * Optional Parameters. * * @extends RequestOptionsBase */ -export interface PredictionAPIClientPredictImageUrlWithNoStoreOptionalParams extends msRest.RequestOptionsBase { +export interface PredictionAPIClientDetectImageUrlOptionalParams extends msRest.RequestOptionsBase { /** - * @member {string} [iterationId] Optional. Specifies the id of a particular - * iteration to evaluate against. - * The default iteration for the project will be used when not specified + * @member {string} [application] Optional. Specifies the name of application + * using the endpoint. */ - iterationId?: string; + application?: string; +} + +/** + * @interface + * An interface representing PredictionAPIClientDetectImageOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PredictionAPIClientDetectImageOptionalParams extends msRest.RequestOptionsBase { /** * @member {string} [application] Optional. Specifies the name of application - * using the endpoint + * using the endpoint. */ application?: string; } /** * @interface - * An interface representing PredictionAPIClientPredictImageWithNoStoreOptionalParams. + * An interface representing PredictionAPIClientDetectImageUrlWithNoStoreOptionalParams. * Optional Parameters. * * @extends RequestOptionsBase */ -export interface PredictionAPIClientPredictImageWithNoStoreOptionalParams extends msRest.RequestOptionsBase { +export interface PredictionAPIClientDetectImageUrlWithNoStoreOptionalParams extends msRest.RequestOptionsBase { /** - * @member {string} [iterationId] Optional. Specifies the id of a particular - * iteration to evaluate against. - * The default iteration for the project will be used when not specified + * @member {string} [application] Optional. Specifies the name of application + * using the endpoint. */ - iterationId?: string; + application?: string; +} + +/** + * @interface + * An interface representing PredictionAPIClientDetectImageWithNoStoreOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface PredictionAPIClientDetectImageWithNoStoreOptionalParams extends msRest.RequestOptionsBase { /** * @member {string} [application] Optional. Specifies the name of application - * using the endpoint + * using the endpoint. */ application?: string; } /** - * Contains response data for the predictImageUrl operation. + * Defines values for CustomVisionErrorCodes. + * Possible values include: 'NoError', 'BadRequest', 'BadRequestExceededBatchSize', + * 'BadRequestNotSupported', 'BadRequestInvalidIds', 'BadRequestProjectName', + * 'BadRequestProjectNameNotUnique', 'BadRequestProjectDescription', + * 'BadRequestProjectUnknownDomain', 'BadRequestProjectUnknownClassification', + * 'BadRequestProjectUnsupportedDomainTypeChange', 'BadRequestProjectUnsupportedExportPlatform', + * 'BadRequestIterationName', 'BadRequestIterationNameNotUnique', 'BadRequestIterationDescription', + * 'BadRequestIterationIsNotTrained', 'BadRequestWorkspaceCannotBeModified', + * 'BadRequestWorkspaceNotDeletable', 'BadRequestTagName', 'BadRequestTagNameNotUnique', + * 'BadRequestTagDescription', 'BadRequestTagType', 'BadRequestMultipleNegativeTag', + * 'BadRequestImageTags', 'BadRequestImageRegions', 'BadRequestNegativeAndRegularTagOnSameImage', + * 'BadRequestRequiredParamIsNull', 'BadRequestIterationIsPublished', + * 'BadRequestInvalidPublishName', 'BadRequestInvalidPublishTarget', 'BadRequestUnpublishFailed', + * 'BadRequestSubscriptionApi', 'BadRequestExceedProjectLimit', + * 'BadRequestExceedIterationPerProjectLimit', 'BadRequestExceedTagPerProjectLimit', + * 'BadRequestExceedTagPerImageLimit', 'BadRequestExceededQuota', + * 'BadRequestCannotMigrateProjectWithName', 'BadRequestNotLimitedTrial', 'BadRequestImageBatch', + * 'BadRequestImageStream', 'BadRequestImageUrl', 'BadRequestImageFormat', + * 'BadRequestImageSizeBytes', 'BadRequestImageExceededCount', 'BadRequestTrainingNotNeeded', + * 'BadRequestTrainingNotNeededButTrainingPipelineUpdated', 'BadRequestTrainingValidationFailed', + * 'BadRequestClassificationTrainingValidationFailed', + * 'BadRequestMultiClassClassificationTrainingValidationFailed', + * 'BadRequestMultiLabelClassificationTrainingValidationFailed', + * 'BadRequestDetectionTrainingValidationFailed', 'BadRequestTrainingAlreadyInProgress', + * 'BadRequestDetectionTrainingNotAllowNegativeTag', 'BadRequestInvalidEmailAddress', + * 'BadRequestDomainNotSupportedForAdvancedTraining', + * 'BadRequestExportPlatformNotSupportedForAdvancedTraining', + * 'BadRequestReservedBudgetInHoursNotEnoughForAdvancedTraining', + * 'BadRequestExportValidationFailed', 'BadRequestExportAlreadyInProgress', + * 'BadRequestPredictionIdsMissing', 'BadRequestPredictionIdsExceededCount', + * 'BadRequestPredictionTagsExceededCount', 'BadRequestPredictionResultsExceededCount', + * 'BadRequestPredictionInvalidApplicationName', 'BadRequestPredictionInvalidQueryParameters', + * 'BadRequestInvalid', 'UnsupportedMediaType', 'Forbidden', 'ForbiddenUser', + * 'ForbiddenUserResource', 'ForbiddenUserSignupDisabled', 'ForbiddenUserSignupAllowanceExceeded', + * 'ForbiddenUserDoesNotExist', 'ForbiddenUserDisabled', 'ForbiddenUserInsufficientCapability', + * 'ForbiddenDRModeEnabled', 'ForbiddenInvalid', 'NotFound', 'NotFoundProject', + * 'NotFoundProjectDefaultIteration', 'NotFoundIteration', 'NotFoundIterationPerformance', + * 'NotFoundTag', 'NotFoundImage', 'NotFoundDomain', 'NotFoundApimSubscription', 'NotFoundInvalid', + * 'Conflict', 'ConflictInvalid', 'ErrorUnknown', 'ErrorProjectInvalidWorkspace', + * 'ErrorProjectInvalidPipelineConfiguration', 'ErrorProjectInvalidDomain', + * 'ErrorProjectTrainingRequestFailed', 'ErrorProjectExportRequestFailed', + * 'ErrorFeaturizationServiceUnavailable', 'ErrorFeaturizationQueueTimeout', + * 'ErrorFeaturizationInvalidFeaturizer', 'ErrorFeaturizationAugmentationUnavailable', + * 'ErrorFeaturizationUnrecognizedJob', 'ErrorFeaturizationAugmentationError', + * 'ErrorExporterInvalidPlatform', 'ErrorExporterInvalidFeaturizer', + * 'ErrorExporterInvalidClassifier', 'ErrorPredictionServiceUnavailable', + * 'ErrorPredictionModelNotFound', 'ErrorPredictionModelNotCached', 'ErrorPrediction', + * 'ErrorPredictionStorage', 'ErrorRegionProposal', 'ErrorInvalid' + * @readonly + * @enum {string} + */ +export type CustomVisionErrorCodes = 'NoError' | 'BadRequest' | 'BadRequestExceededBatchSize' | 'BadRequestNotSupported' | 'BadRequestInvalidIds' | 'BadRequestProjectName' | 'BadRequestProjectNameNotUnique' | 'BadRequestProjectDescription' | 'BadRequestProjectUnknownDomain' | 'BadRequestProjectUnknownClassification' | 'BadRequestProjectUnsupportedDomainTypeChange' | 'BadRequestProjectUnsupportedExportPlatform' | 'BadRequestIterationName' | 'BadRequestIterationNameNotUnique' | 'BadRequestIterationDescription' | 'BadRequestIterationIsNotTrained' | 'BadRequestWorkspaceCannotBeModified' | 'BadRequestWorkspaceNotDeletable' | 'BadRequestTagName' | 'BadRequestTagNameNotUnique' | 'BadRequestTagDescription' | 'BadRequestTagType' | 'BadRequestMultipleNegativeTag' | 'BadRequestImageTags' | 'BadRequestImageRegions' | 'BadRequestNegativeAndRegularTagOnSameImage' | 'BadRequestRequiredParamIsNull' | 'BadRequestIterationIsPublished' | 'BadRequestInvalidPublishName' | 'BadRequestInvalidPublishTarget' | 'BadRequestUnpublishFailed' | 'BadRequestSubscriptionApi' | 'BadRequestExceedProjectLimit' | 'BadRequestExceedIterationPerProjectLimit' | 'BadRequestExceedTagPerProjectLimit' | 'BadRequestExceedTagPerImageLimit' | 'BadRequestExceededQuota' | 'BadRequestCannotMigrateProjectWithName' | 'BadRequestNotLimitedTrial' | 'BadRequestImageBatch' | 'BadRequestImageStream' | 'BadRequestImageUrl' | 'BadRequestImageFormat' | 'BadRequestImageSizeBytes' | 'BadRequestImageExceededCount' | 'BadRequestTrainingNotNeeded' | 'BadRequestTrainingNotNeededButTrainingPipelineUpdated' | 'BadRequestTrainingValidationFailed' | 'BadRequestClassificationTrainingValidationFailed' | 'BadRequestMultiClassClassificationTrainingValidationFailed' | 'BadRequestMultiLabelClassificationTrainingValidationFailed' | 'BadRequestDetectionTrainingValidationFailed' | 'BadRequestTrainingAlreadyInProgress' | 'BadRequestDetectionTrainingNotAllowNegativeTag' | 'BadRequestInvalidEmailAddress' | 'BadRequestDomainNotSupportedForAdvancedTraining' | 'BadRequestExportPlatformNotSupportedForAdvancedTraining' | 'BadRequestReservedBudgetInHoursNotEnoughForAdvancedTraining' | 'BadRequestExportValidationFailed' | 'BadRequestExportAlreadyInProgress' | 'BadRequestPredictionIdsMissing' | 'BadRequestPredictionIdsExceededCount' | 'BadRequestPredictionTagsExceededCount' | 'BadRequestPredictionResultsExceededCount' | 'BadRequestPredictionInvalidApplicationName' | 'BadRequestPredictionInvalidQueryParameters' | 'BadRequestInvalid' | 'UnsupportedMediaType' | 'Forbidden' | 'ForbiddenUser' | 'ForbiddenUserResource' | 'ForbiddenUserSignupDisabled' | 'ForbiddenUserSignupAllowanceExceeded' | 'ForbiddenUserDoesNotExist' | 'ForbiddenUserDisabled' | 'ForbiddenUserInsufficientCapability' | 'ForbiddenDRModeEnabled' | 'ForbiddenInvalid' | 'NotFound' | 'NotFoundProject' | 'NotFoundProjectDefaultIteration' | 'NotFoundIteration' | 'NotFoundIterationPerformance' | 'NotFoundTag' | 'NotFoundImage' | 'NotFoundDomain' | 'NotFoundApimSubscription' | 'NotFoundInvalid' | 'Conflict' | 'ConflictInvalid' | 'ErrorUnknown' | 'ErrorProjectInvalidWorkspace' | 'ErrorProjectInvalidPipelineConfiguration' | 'ErrorProjectInvalidDomain' | 'ErrorProjectTrainingRequestFailed' | 'ErrorProjectExportRequestFailed' | 'ErrorFeaturizationServiceUnavailable' | 'ErrorFeaturizationQueueTimeout' | 'ErrorFeaturizationInvalidFeaturizer' | 'ErrorFeaturizationAugmentationUnavailable' | 'ErrorFeaturizationUnrecognizedJob' | 'ErrorFeaturizationAugmentationError' | 'ErrorExporterInvalidPlatform' | 'ErrorExporterInvalidFeaturizer' | 'ErrorExporterInvalidClassifier' | 'ErrorPredictionServiceUnavailable' | 'ErrorPredictionModelNotFound' | 'ErrorPredictionModelNotCached' | 'ErrorPrediction' | 'ErrorPredictionStorage' | 'ErrorRegionProposal' | 'ErrorInvalid'; + +/** + * Contains response data for the classifyImageUrl operation. + */ +export type ClassifyImageUrlResponse = ImagePrediction & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ImagePrediction; + }; +}; + +/** + * Contains response data for the classifyImage operation. + */ +export type ClassifyImageResponse = ImagePrediction & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ImagePrediction; + }; +}; + +/** + * Contains response data for the classifyImageUrlWithNoStore operation. + */ +export type ClassifyImageUrlWithNoStoreResponse = ImagePrediction & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ImagePrediction; + }; +}; + +/** + * Contains response data for the classifyImageWithNoStore operation. + */ +export type ClassifyImageWithNoStoreResponse = ImagePrediction & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: ImagePrediction; + }; +}; + +/** + * Contains response data for the detectImageUrl operation. */ -export type PredictImageUrlResponse = ImagePrediction & { +export type DetectImageUrlResponse = ImagePrediction & { /** * The underlying HTTP response. */ @@ -208,9 +471,9 @@ export type PredictImageUrlResponse = ImagePrediction & { }; /** - * Contains response data for the predictImage operation. + * Contains response data for the detectImage operation. */ -export type PredictImageResponse = ImagePrediction & { +export type DetectImageResponse = ImagePrediction & { /** * The underlying HTTP response. */ @@ -227,9 +490,9 @@ export type PredictImageResponse = ImagePrediction & { }; /** - * Contains response data for the predictImageUrlWithNoStore operation. + * Contains response data for the detectImageUrlWithNoStore operation. */ -export type PredictImageUrlWithNoStoreResponse = ImagePrediction & { +export type DetectImageUrlWithNoStoreResponse = ImagePrediction & { /** * The underlying HTTP response. */ @@ -246,9 +509,9 @@ export type PredictImageUrlWithNoStoreResponse = ImagePrediction & { }; /** - * Contains response data for the predictImageWithNoStore operation. + * Contains response data for the detectImageWithNoStore operation. */ -export type PredictImageWithNoStoreResponse = ImagePrediction & { +export type DetectImageWithNoStoreResponse = ImagePrediction & { /** * The underlying HTTP response. */ diff --git a/packages/@azure/cognitiveservices-customvision-prediction/lib/models/mappers.ts b/packages/@azure/cognitiveservices-customvision-prediction/lib/models/mappers.ts index 297aa49abd51..3b94ef7a9cfb 100644 --- a/packages/@azure/cognitiveservices-customvision-prediction/lib/models/mappers.ts +++ b/packages/@azure/cognitiveservices-customvision-prediction/lib/models/mappers.ts @@ -18,7 +18,8 @@ export const ImageUrl: msRest.CompositeMapper = { className: "ImageUrl", modelProperties: { url: { - nullable: true, + required: true, + nullable: false, serializedName: "url", type: { name: "String" @@ -35,6 +36,7 @@ export const BoundingBox: msRest.CompositeMapper = { className: "BoundingBox", modelProperties: { left: { + required: true, nullable: false, serializedName: "left", type: { @@ -42,6 +44,7 @@ export const BoundingBox: msRest.CompositeMapper = { } }, top: { + required: true, nullable: false, serializedName: "top", type: { @@ -49,6 +52,7 @@ export const BoundingBox: msRest.CompositeMapper = { } }, width: { + required: true, nullable: false, serializedName: "width", type: { @@ -56,6 +60,7 @@ export const BoundingBox: msRest.CompositeMapper = { } }, height: { + required: true, nullable: false, serializedName: "height", type: { @@ -97,6 +102,7 @@ export const Prediction: msRest.CompositeMapper = { } }, boundingBox: { + nullable: true, readOnly: true, serializedName: "boundingBox", type: { @@ -147,7 +153,6 @@ export const ImagePrediction: msRest.CompositeMapper = { } }, predictions: { - nullable: true, readOnly: true, serializedName: "predictions", type: { @@ -163,3 +168,27 @@ export const ImagePrediction: msRest.CompositeMapper = { } } }; + +export const CustomVisionError: msRest.CompositeMapper = { + serializedName: "CustomVisionError", + type: { + name: "Composite", + className: "CustomVisionError", + modelProperties: { + code: { + required: true, + serializedName: "code", + type: { + name: "String" + } + }, + message: { + required: true, + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; diff --git a/packages/@azure/cognitiveservices-customvision-prediction/lib/models/parameters.ts b/packages/@azure/cognitiveservices-customvision-prediction/lib/models/parameters.ts index 6e7bf4c720c9..0717a882b8f6 100644 --- a/packages/@azure/cognitiveservices-customvision-prediction/lib/models/parameters.ts +++ b/packages/@azure/cognitiveservices-customvision-prediction/lib/models/parameters.ts @@ -55,27 +55,24 @@ export const imageData: msRest.OperationParameter = { } } }; -export const iterationId: msRest.OperationQueryParameter = { - parameterPath: [ - "options", - "iterationId" - ], +export const projectId: msRest.OperationURLParameter = { + parameterPath: "projectId", mapper: { - nullable: true, - serializedName: "iterationId", + required: true, + nullable: false, + serializedName: "projectId", type: { name: "Uuid" } } }; -export const projectId: msRest.OperationURLParameter = { - parameterPath: "projectId", +export const publishedName: msRest.OperationURLParameter = { + parameterPath: "publishedName", mapper: { required: true, - nullable: false, - serializedName: "projectId", + serializedName: "publishedName", type: { - name: "Uuid" + name: "String" } } }; diff --git a/packages/@azure/cognitiveservices-customvision-prediction/lib/predictionAPIClient.ts b/packages/@azure/cognitiveservices-customvision-prediction/lib/predictionAPIClient.ts index 335e0d423142..e2f6fb0e6e47 100644 --- a/packages/@azure/cognitiveservices-customvision-prediction/lib/predictionAPIClient.ts +++ b/packages/@azure/cognitiveservices-customvision-prediction/lib/predictionAPIClient.ts @@ -17,8 +17,8 @@ import { PredictionAPIClientContext } from "./predictionAPIClientContext"; class PredictionAPIClient extends PredictionAPIClientContext { /** * Initializes a new instance of the PredictionAPIClient class. - * @param apiKey - * @param endpoint Supported Cognitive Services endpoints + * @param apiKey API key. + * @param endpoint Supported Cognitive Services endpoints. * @param [options] The parameter options */ constructor(apiKey: string, endpoint: string, options?: msRest.ServiceClientOptions) { @@ -26,151 +26,384 @@ class PredictionAPIClient extends PredictionAPIClientContext { } /** - * @summary Predict an image url and saves the result - * @param projectId The project id + * @summary Classify an image url and saves the result. + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageUrl An ImageUrl that contains the url of the image to be evaluated. + * @param [options] The optional parameters + * @returns Promise + */ + classifyImageUrl(projectId: string, publishedName: string, imageUrl: Models.ImageUrl, options?: Models.PredictionAPIClientClassifyImageUrlOptionalParams): Promise; + /** + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageUrl An ImageUrl that contains the url of the image to be evaluated. + * @param callback The callback + */ + classifyImageUrl(projectId: string, publishedName: string, imageUrl: Models.ImageUrl, callback: msRest.ServiceCallback): void; + /** + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageUrl An ImageUrl that contains the url of the image to be evaluated. + * @param options The optional parameters + * @param callback The callback + */ + classifyImageUrl(projectId: string, publishedName: string, imageUrl: Models.ImageUrl, options: Models.PredictionAPIClientClassifyImageUrlOptionalParams, callback: msRest.ServiceCallback): void; + classifyImageUrl(projectId: string, publishedName: string, imageUrl: Models.ImageUrl, options?: Models.PredictionAPIClientClassifyImageUrlOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + projectId, + publishedName, + imageUrl, + options + }, + classifyImageUrlOperationSpec, + callback) as Promise; + } + + /** + * @summary Classify an image and saves the result. + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports + * images up to 4MB. + * @param [options] The optional parameters + * @returns Promise + */ + classifyImage(projectId: string, publishedName: string, imageData: msRest.HttpRequestBody, options?: Models.PredictionAPIClientClassifyImageOptionalParams): Promise; + /** + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports + * images up to 4MB. + * @param callback The callback + */ + classifyImage(projectId: string, publishedName: string, imageData: msRest.HttpRequestBody, callback: msRest.ServiceCallback): void; + /** + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports + * images up to 4MB. + * @param options The optional parameters + * @param callback The callback + */ + classifyImage(projectId: string, publishedName: string, imageData: msRest.HttpRequestBody, options: Models.PredictionAPIClientClassifyImageOptionalParams, callback: msRest.ServiceCallback): void; + classifyImage(projectId: string, publishedName: string, imageData: msRest.HttpRequestBody, options?: Models.PredictionAPIClientClassifyImageOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + projectId, + publishedName, + imageData, + options + }, + classifyImageOperationSpec, + callback) as Promise; + } + + /** + * @summary Classify an image url without saving the result. + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. * @param imageUrl An {Iris.Web.Api.Models.ImageUrl} that contains the url of the image to be - * evaluated + * evaluated. * @param [options] The optional parameters - * @returns Promise + * @returns Promise */ - predictImageUrl(projectId: string, imageUrl: Models.ImageUrl, options?: Models.PredictionAPIClientPredictImageUrlOptionalParams): Promise; + classifyImageUrlWithNoStore(projectId: string, publishedName: string, imageUrl: Models.ImageUrl, options?: Models.PredictionAPIClientClassifyImageUrlWithNoStoreOptionalParams): Promise; /** - * @param projectId The project id + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. * @param imageUrl An {Iris.Web.Api.Models.ImageUrl} that contains the url of the image to be - * evaluated + * evaluated. * @param callback The callback */ - predictImageUrl(projectId: string, imageUrl: Models.ImageUrl, callback: msRest.ServiceCallback): void; + classifyImageUrlWithNoStore(projectId: string, publishedName: string, imageUrl: Models.ImageUrl, callback: msRest.ServiceCallback): void; /** - * @param projectId The project id + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. * @param imageUrl An {Iris.Web.Api.Models.ImageUrl} that contains the url of the image to be - * evaluated + * evaluated. * @param options The optional parameters * @param callback The callback */ - predictImageUrl(projectId: string, imageUrl: Models.ImageUrl, options: Models.PredictionAPIClientPredictImageUrlOptionalParams, callback: msRest.ServiceCallback): void; - predictImageUrl(projectId: string, imageUrl: Models.ImageUrl, options?: Models.PredictionAPIClientPredictImageUrlOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + classifyImageUrlWithNoStore(projectId: string, publishedName: string, imageUrl: Models.ImageUrl, options: Models.PredictionAPIClientClassifyImageUrlWithNoStoreOptionalParams, callback: msRest.ServiceCallback): void; + classifyImageUrlWithNoStore(projectId: string, publishedName: string, imageUrl: Models.ImageUrl, options?: Models.PredictionAPIClientClassifyImageUrlWithNoStoreOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.sendOperationRequest( { projectId, + publishedName, imageUrl, options }, - predictImageUrlOperationSpec, - callback) as Promise; + classifyImageUrlWithNoStoreOperationSpec, + callback) as Promise; } /** - * @summary Predict an image and saves the result - * @param projectId The project id - * @param imageData + * @summary Classify an image without saving the result. + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports + * images up to 0MB. * @param [options] The optional parameters - * @returns Promise + * @returns Promise */ - predictImage(projectId: string, imageData: msRest.HttpRequestBody, options?: Models.PredictionAPIClientPredictImageOptionalParams): Promise; + classifyImageWithNoStore(projectId: string, publishedName: string, imageData: msRest.HttpRequestBody, options?: Models.PredictionAPIClientClassifyImageWithNoStoreOptionalParams): Promise; /** - * @param projectId The project id - * @param imageData + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports + * images up to 0MB. * @param callback The callback */ - predictImage(projectId: string, imageData: msRest.HttpRequestBody, callback: msRest.ServiceCallback): void; + classifyImageWithNoStore(projectId: string, publishedName: string, imageData: msRest.HttpRequestBody, callback: msRest.ServiceCallback): void; /** - * @param projectId The project id - * @param imageData + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports + * images up to 0MB. * @param options The optional parameters * @param callback The callback */ - predictImage(projectId: string, imageData: msRest.HttpRequestBody, options: Models.PredictionAPIClientPredictImageOptionalParams, callback: msRest.ServiceCallback): void; - predictImage(projectId: string, imageData: msRest.HttpRequestBody, options?: Models.PredictionAPIClientPredictImageOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + classifyImageWithNoStore(projectId: string, publishedName: string, imageData: msRest.HttpRequestBody, options: Models.PredictionAPIClientClassifyImageWithNoStoreOptionalParams, callback: msRest.ServiceCallback): void; + classifyImageWithNoStore(projectId: string, publishedName: string, imageData: msRest.HttpRequestBody, options?: Models.PredictionAPIClientClassifyImageWithNoStoreOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.sendOperationRequest( { projectId, + publishedName, imageData, options }, - predictImageOperationSpec, - callback) as Promise; + classifyImageWithNoStoreOperationSpec, + callback) as Promise; } /** - * @summary Predict an image url without saving the result - * @param projectId The project id + * @summary Detect objects in an image url and saves the result. + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageUrl An ImageUrl that contains the url of the image to be evaluated. + * @param [options] The optional parameters + * @returns Promise + */ + detectImageUrl(projectId: string, publishedName: string, imageUrl: Models.ImageUrl, options?: Models.PredictionAPIClientDetectImageUrlOptionalParams): Promise; + /** + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageUrl An ImageUrl that contains the url of the image to be evaluated. + * @param callback The callback + */ + detectImageUrl(projectId: string, publishedName: string, imageUrl: Models.ImageUrl, callback: msRest.ServiceCallback): void; + /** + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageUrl An ImageUrl that contains the url of the image to be evaluated. + * @param options The optional parameters + * @param callback The callback + */ + detectImageUrl(projectId: string, publishedName: string, imageUrl: Models.ImageUrl, options: Models.PredictionAPIClientDetectImageUrlOptionalParams, callback: msRest.ServiceCallback): void; + detectImageUrl(projectId: string, publishedName: string, imageUrl: Models.ImageUrl, options?: Models.PredictionAPIClientDetectImageUrlOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + projectId, + publishedName, + imageUrl, + options + }, + detectImageUrlOperationSpec, + callback) as Promise; + } + + /** + * @summary Detect objects in an image and saves the result. + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports + * images up to 4MB. + * @param [options] The optional parameters + * @returns Promise + */ + detectImage(projectId: string, publishedName: string, imageData: msRest.HttpRequestBody, options?: Models.PredictionAPIClientDetectImageOptionalParams): Promise; + /** + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports + * images up to 4MB. + * @param callback The callback + */ + detectImage(projectId: string, publishedName: string, imageData: msRest.HttpRequestBody, callback: msRest.ServiceCallback): void; + /** + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports + * images up to 4MB. + * @param options The optional parameters + * @param callback The callback + */ + detectImage(projectId: string, publishedName: string, imageData: msRest.HttpRequestBody, options: Models.PredictionAPIClientDetectImageOptionalParams, callback: msRest.ServiceCallback): void; + detectImage(projectId: string, publishedName: string, imageData: msRest.HttpRequestBody, options?: Models.PredictionAPIClientDetectImageOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + projectId, + publishedName, + imageData, + options + }, + detectImageOperationSpec, + callback) as Promise; + } + + /** + * @summary Detect objects in an image url without saving the result. + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. * @param imageUrl An {Iris.Web.Api.Models.ImageUrl} that contains the url of the image to be - * evaluated + * evaluated. * @param [options] The optional parameters - * @returns Promise + * @returns Promise */ - predictImageUrlWithNoStore(projectId: string, imageUrl: Models.ImageUrl, options?: Models.PredictionAPIClientPredictImageUrlWithNoStoreOptionalParams): Promise; + detectImageUrlWithNoStore(projectId: string, publishedName: string, imageUrl: Models.ImageUrl, options?: Models.PredictionAPIClientDetectImageUrlWithNoStoreOptionalParams): Promise; /** - * @param projectId The project id + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. * @param imageUrl An {Iris.Web.Api.Models.ImageUrl} that contains the url of the image to be - * evaluated + * evaluated. * @param callback The callback */ - predictImageUrlWithNoStore(projectId: string, imageUrl: Models.ImageUrl, callback: msRest.ServiceCallback): void; + detectImageUrlWithNoStore(projectId: string, publishedName: string, imageUrl: Models.ImageUrl, callback: msRest.ServiceCallback): void; /** - * @param projectId The project id + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. * @param imageUrl An {Iris.Web.Api.Models.ImageUrl} that contains the url of the image to be - * evaluated + * evaluated. * @param options The optional parameters * @param callback The callback */ - predictImageUrlWithNoStore(projectId: string, imageUrl: Models.ImageUrl, options: Models.PredictionAPIClientPredictImageUrlWithNoStoreOptionalParams, callback: msRest.ServiceCallback): void; - predictImageUrlWithNoStore(projectId: string, imageUrl: Models.ImageUrl, options?: Models.PredictionAPIClientPredictImageUrlWithNoStoreOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + detectImageUrlWithNoStore(projectId: string, publishedName: string, imageUrl: Models.ImageUrl, options: Models.PredictionAPIClientDetectImageUrlWithNoStoreOptionalParams, callback: msRest.ServiceCallback): void; + detectImageUrlWithNoStore(projectId: string, publishedName: string, imageUrl: Models.ImageUrl, options?: Models.PredictionAPIClientDetectImageUrlWithNoStoreOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.sendOperationRequest( { projectId, + publishedName, imageUrl, options }, - predictImageUrlWithNoStoreOperationSpec, - callback) as Promise; + detectImageUrlWithNoStoreOperationSpec, + callback) as Promise; } /** - * @summary Predict an image without saving the result - * @param projectId The project id - * @param imageData + * @summary Detect objects in an image without saving the result. + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports + * images up to 0MB. * @param [options] The optional parameters - * @returns Promise + * @returns Promise */ - predictImageWithNoStore(projectId: string, imageData: msRest.HttpRequestBody, options?: Models.PredictionAPIClientPredictImageWithNoStoreOptionalParams): Promise; + detectImageWithNoStore(projectId: string, publishedName: string, imageData: msRest.HttpRequestBody, options?: Models.PredictionAPIClientDetectImageWithNoStoreOptionalParams): Promise; /** - * @param projectId The project id - * @param imageData + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports + * images up to 0MB. * @param callback The callback */ - predictImageWithNoStore(projectId: string, imageData: msRest.HttpRequestBody, callback: msRest.ServiceCallback): void; + detectImageWithNoStore(projectId: string, publishedName: string, imageData: msRest.HttpRequestBody, callback: msRest.ServiceCallback): void; /** - * @param projectId The project id - * @param imageData + * @param projectId The project id. + * @param publishedName Specifies the name of the model to evaluate against. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports + * images up to 0MB. * @param options The optional parameters * @param callback The callback */ - predictImageWithNoStore(projectId: string, imageData: msRest.HttpRequestBody, options: Models.PredictionAPIClientPredictImageWithNoStoreOptionalParams, callback: msRest.ServiceCallback): void; - predictImageWithNoStore(projectId: string, imageData: msRest.HttpRequestBody, options?: Models.PredictionAPIClientPredictImageWithNoStoreOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + detectImageWithNoStore(projectId: string, publishedName: string, imageData: msRest.HttpRequestBody, options: Models.PredictionAPIClientDetectImageWithNoStoreOptionalParams, callback: msRest.ServiceCallback): void; + detectImageWithNoStore(projectId: string, publishedName: string, imageData: msRest.HttpRequestBody, options?: Models.PredictionAPIClientDetectImageWithNoStoreOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.sendOperationRequest( { projectId, + publishedName, imageData, options }, - predictImageWithNoStoreOperationSpec, - callback) as Promise; + detectImageWithNoStoreOperationSpec, + callback) as Promise; } } // Operation Specifications const serializer = new msRest.Serializer(Mappers); -const predictImageUrlOperationSpec: msRest.OperationSpec = { +const classifyImageUrlOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "{projectId}/classify/iterations/{publishedName}/url", + urlParameters: [ + Parameters.endpoint, + Parameters.projectId, + Parameters.publishedName + ], + queryParameters: [ + Parameters.application + ], + headerParameters: [ + Parameters.apiKey + ], + requestBody: { + parameterPath: "imageUrl", + mapper: { + ...Mappers.ImageUrl, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ImagePrediction + }, + default: { + bodyMapper: Mappers.CustomVisionError + } + }, + serializer +}; + +const classifyImageOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "{projectId}/classify/iterations/{publishedName}/image", + urlParameters: [ + Parameters.endpoint, + Parameters.projectId, + Parameters.publishedName + ], + queryParameters: [ + Parameters.application + ], + headerParameters: [ + Parameters.apiKey + ], + formDataParameters: [ + Parameters.imageData + ], + contentType: "multipart/form-data", + responses: { + 200: { + bodyMapper: Mappers.ImagePrediction + }, + default: { + bodyMapper: Mappers.CustomVisionError + } + }, + serializer +}; + +const classifyImageUrlWithNoStoreOperationSpec: msRest.OperationSpec = { httpMethod: "POST", - path: "{projectId}/url", + path: "{projectId}/classify/iterations/{publishedName}/url/nostore", urlParameters: [ Parameters.endpoint, - Parameters.projectId + Parameters.projectId, + Parameters.publishedName ], queryParameters: [ - Parameters.iterationId, Parameters.application ], headerParameters: [ @@ -187,20 +420,22 @@ const predictImageUrlOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.ImagePrediction }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; -const predictImageOperationSpec: msRest.OperationSpec = { +const classifyImageWithNoStoreOperationSpec: msRest.OperationSpec = { httpMethod: "POST", - path: "{projectId}/image", + path: "{projectId}/classify/iterations/{publishedName}/image/nostore", urlParameters: [ Parameters.endpoint, - Parameters.projectId + Parameters.projectId, + Parameters.publishedName ], queryParameters: [ - Parameters.iterationId, Parameters.application ], headerParameters: [ @@ -214,20 +449,22 @@ const predictImageOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.ImagePrediction }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; -const predictImageUrlWithNoStoreOperationSpec: msRest.OperationSpec = { +const detectImageUrlOperationSpec: msRest.OperationSpec = { httpMethod: "POST", - path: "{projectId}/url/nostore", + path: "{projectId}/detect/iterations/{publishedName}/url", urlParameters: [ Parameters.endpoint, - Parameters.projectId + Parameters.projectId, + Parameters.publishedName ], queryParameters: [ - Parameters.iterationId, Parameters.application ], headerParameters: [ @@ -244,20 +481,22 @@ const predictImageUrlWithNoStoreOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.ImagePrediction }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; -const predictImageWithNoStoreOperationSpec: msRest.OperationSpec = { +const detectImageOperationSpec: msRest.OperationSpec = { httpMethod: "POST", - path: "{projectId}/image/nostore", + path: "{projectId}/detect/iterations/{publishedName}/image", urlParameters: [ Parameters.endpoint, - Parameters.projectId + Parameters.projectId, + Parameters.publishedName ], queryParameters: [ - Parameters.iterationId, Parameters.application ], headerParameters: [ @@ -271,7 +510,70 @@ const predictImageWithNoStoreOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.ImagePrediction }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } + }, + serializer +}; + +const detectImageUrlWithNoStoreOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "{projectId}/detect/iterations/{publishedName}/url/nostore", + urlParameters: [ + Parameters.endpoint, + Parameters.projectId, + Parameters.publishedName + ], + queryParameters: [ + Parameters.application + ], + headerParameters: [ + Parameters.apiKey + ], + requestBody: { + parameterPath: "imageUrl", + mapper: { + ...Mappers.ImageUrl, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.ImagePrediction + }, + default: { + bodyMapper: Mappers.CustomVisionError + } + }, + serializer +}; + +const detectImageWithNoStoreOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "{projectId}/detect/iterations/{publishedName}/image/nostore", + urlParameters: [ + Parameters.endpoint, + Parameters.projectId, + Parameters.publishedName + ], + queryParameters: [ + Parameters.application + ], + headerParameters: [ + Parameters.apiKey + ], + formDataParameters: [ + Parameters.imageData + ], + contentType: "multipart/form-data", + responses: { + 200: { + bodyMapper: Mappers.ImagePrediction + }, + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; diff --git a/packages/@azure/cognitiveservices-customvision-prediction/lib/predictionAPIClientContext.ts b/packages/@azure/cognitiveservices-customvision-prediction/lib/predictionAPIClientContext.ts index 0cb8b69f708d..8f1376c42c56 100644 --- a/packages/@azure/cognitiveservices-customvision-prediction/lib/predictionAPIClientContext.ts +++ b/packages/@azure/cognitiveservices-customvision-prediction/lib/predictionAPIClientContext.ts @@ -19,8 +19,8 @@ export class PredictionAPIClientContext extends msRest.ServiceClient { /** * Initializes a new instance of the PredictionAPIClientContext class. - * @param apiKey - * @param endpoint Supported Cognitive Services endpoints + * @param apiKey API key. + * @param endpoint Supported Cognitive Services endpoints. * @param [options] The parameter options */ constructor(apiKey: string, endpoint: string, options?: msRest.ServiceClientOptions) { diff --git a/packages/@azure/cognitiveservices-customvision-prediction/package.json b/packages/@azure/cognitiveservices-customvision-prediction/package.json index 5cc42053eaf4..f24649def77c 100644 --- a/packages/@azure/cognitiveservices-customvision-prediction/package.json +++ b/packages/@azure/cognitiveservices-customvision-prediction/package.json @@ -51,6 +51,5 @@ "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/cognitiveservices-customvision-prediction.js.map'\" -o ./dist/cognitiveservices-customvision-prediction.min.js ./dist/cognitiveservices-customvision-prediction.js", "prepack": "npm install && npm run build" }, - "sideEffects": false, - "authPublish": true + "sideEffects": false } diff --git a/packages/@azure/cognitiveservices-customvision-training/LICENSE.txt b/packages/@azure/cognitiveservices-customvision-training/LICENSE.txt index 5431ba98b936..8f3d856145c5 100644 --- a/packages/@azure/cognitiveservices-customvision-training/LICENSE.txt +++ b/packages/@azure/cognitiveservices-customvision-training/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Microsoft +Copyright (c) 2019 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/packages/@azure/cognitiveservices-customvision-training/README.md b/packages/@azure/cognitiveservices-customvision-training/README.md index a1ca58169429..9d5cee737e35 100644 --- a/packages/@azure/cognitiveservices-customvision-training/README.md +++ b/packages/@azure/cognitiveservices-customvision-training/README.md @@ -92,6 +92,3 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to ## Related projects - [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js) - - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fpackages%2F%40azure%2Fcognitiveservices-customvision-training%2FREADME.png) diff --git a/packages/@azure/cognitiveservices-customvision-training/lib/models/index.ts b/packages/@azure/cognitiveservices-customvision-training/lib/models/index.ts index 24bb92bad151..03063b2cbbdf 100644 --- a/packages/@azure/cognitiveservices-customvision-training/lib/models/index.ts +++ b/packages/@azure/cognitiveservices-customvision-training/lib/models/index.ts @@ -103,29 +103,29 @@ export interface ImageTagCreateSummary { */ export interface ImageRegionCreateEntry { /** - * @member {string} [imageId] Id of the image. + * @member {string} imageId Id of the image. */ - imageId?: string; + imageId: string; /** - * @member {string} [tagId] Id of the tag associated with this region. + * @member {string} tagId Id of the tag associated with this region. */ - tagId?: string; + tagId: string; /** - * @member {number} [left] + * @member {number} left Coordinate of the left boundary. */ - left?: number; + left: number; /** - * @member {number} [top] + * @member {number} top Coordinate of the top boundary. */ - top?: number; + top: number; /** - * @member {number} [width] + * @member {number} width Width. */ - width?: number; + width: number; /** - * @member {number} [height] + * @member {number} height Height. */ - height?: number; + height: number; } /** @@ -167,25 +167,25 @@ export interface ImageRegionCreateResult { */ readonly created?: Date; /** - * @member {string} [tagId] Id of the tag associated with this region. + * @member {string} tagId Id of the tag associated with this region. */ - tagId?: string; + tagId: string; /** - * @member {number} [left] + * @member {number} left Coordinate of the left boundary. */ - left?: number; + left: number; /** - * @member {number} [top] + * @member {number} top Coordinate of the top boundary. */ - top?: number; + top: number; /** - * @member {number} [width] + * @member {number} width Width. */ - width?: number; + width: number; /** - * @member {number} [height] + * @member {number} height Height. */ - height?: number; + height: number; } /** @@ -250,25 +250,25 @@ export interface ImageRegion { */ readonly created?: Date; /** - * @member {string} [tagId] Id of the tag associated with this region. + * @member {string} tagId Id of the tag associated with this region. */ - tagId?: string; + tagId: string; /** - * @member {number} [left] + * @member {number} left Coordinate of the left boundary. */ - left?: number; + left: number; /** - * @member {number} [top] + * @member {number} top Coordinate of the top boundary. */ - top?: number; + top: number; /** - * @member {number} [width] + * @member {number} width Width. */ - width?: number; + width: number; /** - * @member {number} [height] + * @member {number} height Height. */ - height?: number; + height: number; } /** @@ -392,25 +392,25 @@ export interface ImageCreateSummary { */ export interface Region { /** - * @member {string} [tagId] Id of the tag associated with this region. + * @member {string} tagId Id of the tag associated with this region. */ - tagId?: string; + tagId: string; /** - * @member {number} [left] + * @member {number} left Coordinate of the left boundary. */ - left?: number; + left: number; /** - * @member {number} [top] + * @member {number} top Coordinate of the top boundary. */ - top?: number; + top: number; /** - * @member {number} [width] + * @member {number} width Width. */ - width?: number; + width: number; /** - * @member {number} [height] + * @member {number} height Height. */ - height?: number; + height: number; } /** @@ -457,9 +457,9 @@ export interface ImageFileCreateBatch { */ export interface ImageUrlCreateEntry { /** - * @member {string} [url] + * @member {string} url Url of the image. */ - url?: string; + url: string; /** * @member {string[]} [tagIds] */ @@ -491,7 +491,7 @@ export interface ImageUrlCreateBatch { */ export interface ImageIdCreateEntry { /** - * @member {string} [id] + * @member {string} [id] Id of the image. */ id?: string; /** @@ -522,24 +522,26 @@ export interface ImageIdCreateBatch { /** * @interface * An interface representing BoundingBox. + * Bounding box that defines a region of an image. + * */ export interface BoundingBox { /** - * @member {number} [left] + * @member {number} left Coordinate of the left boundary. */ - left?: number; + left: number; /** - * @member {number} [top] + * @member {number} top Coordinate of the top boundary. */ - top?: number; + top: number; /** - * @member {number} [width] + * @member {number} width Width. */ - width?: number; + width: number; /** - * @member {number} [height] + * @member {number} height Height. */ - height?: number; + height: number; } /** @@ -584,37 +586,45 @@ export interface ImageRegionProposal { /** * @interface * An interface representing ImageUrl. + * Image url. + * */ export interface ImageUrl { /** - * @member {string} [url] + * @member {string} url Url of the image. */ - url?: string; + url: string; } /** * @interface * An interface representing Prediction. + * Prediction result. + * */ export interface Prediction { /** - * @member {number} [probability] **NOTE: This property will not be - * serialized. It can only be populated by the server.** + * @member {number} [probability] Probability of the tag. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** */ readonly probability?: number; /** - * @member {string} [tagId] **NOTE: This property will not be serialized. It - * can only be populated by the server.** + * @member {string} [tagId] Id of the predicted tag. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** */ readonly tagId?: string; /** - * @member {string} [tagName] **NOTE: This property will not be serialized. - * It can only be populated by the server.** + * @member {string} [tagName] Name of the predicted tag. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** */ readonly tagName?: string; /** - * @member {BoundingBox} [boundingBox] **NOTE: This property will not be - * serialized. It can only be populated by the server.** + * @member {BoundingBox} [boundingBox] Bounding box of the prediction. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** */ readonly boundingBox?: BoundingBox; } @@ -622,31 +632,38 @@ export interface Prediction { /** * @interface * An interface representing ImagePrediction. + * Result of an image prediction request. + * */ export interface ImagePrediction { /** - * @member {string} [id] **NOTE: This property will not be serialized. It can - * only be populated by the server.** + * @member {string} [id] Prediction Id. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** */ readonly id?: string; /** - * @member {string} [project] **NOTE: This property will not be serialized. - * It can only be populated by the server.** + * @member {string} [project] Project Id. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** */ readonly project?: string; /** - * @member {string} [iteration] **NOTE: This property will not be serialized. - * It can only be populated by the server.** + * @member {string} [iteration] Iteration Id. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** */ readonly iteration?: string; /** - * @member {Date} [created] **NOTE: This property will not be serialized. It - * can only be populated by the server.** + * @member {Date} [created] Date this prediction was created. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** */ readonly created?: Date; /** - * @member {Prediction[]} [predictions] **NOTE: This property will not be - * serialized. It can only be populated by the server.** + * @member {Prediction[]} [predictions] List of predictions. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** */ readonly predictions?: Prediction[]; } @@ -752,28 +769,33 @@ export interface StoredImagePrediction { */ readonly domain?: string; /** - * @member {string} [id] **NOTE: This property will not be serialized. It can - * only be populated by the server.** + * @member {string} [id] Prediction Id. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** */ readonly id?: string; /** - * @member {string} [project] **NOTE: This property will not be serialized. - * It can only be populated by the server.** + * @member {string} [project] Project Id. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** */ readonly project?: string; /** - * @member {string} [iteration] **NOTE: This property will not be serialized. - * It can only be populated by the server.** + * @member {string} [iteration] Iteration Id. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** */ readonly iteration?: string; /** - * @member {Date} [created] **NOTE: This property will not be serialized. It - * can only be populated by the server.** + * @member {Date} [created] Date this prediction was created. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** */ readonly created?: Date; /** - * @member {Prediction[]} [predictions] **NOTE: This property will not be - * serialized. It can only be populated by the server.** + * @member {Prediction[]} [predictions] List of predictions. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** */ readonly predictions?: Prediction[]; } @@ -967,6 +989,11 @@ export interface ProjectSettings { * type of the project. Possible values include: 'Multiclass', 'Multilabel' */ classificationType?: Classifier; + /** + * @member {string[]} [targetExportPlatforms] A list of ExportPlatform that + * the trained model should be able to support. + */ + targetExportPlatforms?: string[]; } /** @@ -977,24 +1004,23 @@ export interface ProjectSettings { */ export interface Project { /** - * @member {string} [id] Gets The project id. + * @member {string} [id] Gets the project id. * **NOTE: This property will not be serialized. It can only be populated by * the server.** */ readonly id?: string; /** - * @member {string} [name] Gets or sets the name of the project. + * @member {string} name Gets or sets the name of the project. */ - name?: string; + name: string; /** - * @member {string} [description] Gets or sets the description of the - * project. + * @member {string} description Gets or sets the description of the project. */ - description?: string; + description: string; /** - * @member {ProjectSettings} [settings] Gets or sets the project settings. + * @member {ProjectSettings} settings Gets or sets the project settings. */ - settings?: ProjectSettings; + settings: ProjectSettings; /** * @member {Date} [created] Gets the date this project was created. * **NOTE: This property will not be serialized. It can only be populated by @@ -1002,18 +1028,25 @@ export interface Project { */ readonly created?: Date; /** - * @member {Date} [lastModified] Gets the date this project was last modifed. + * @member {Date} [lastModified] Gets the date this project was last + * modified. * **NOTE: This property will not be serialized. It can only be populated by * the server.** */ readonly lastModified?: Date; /** * @member {string} [thumbnailUri] Gets the thumbnail url representing the - * project. + * image. * **NOTE: This property will not be serialized. It can only be populated by * the server.** */ readonly thumbnailUri?: string; + /** + * @member {boolean} [drModeEnabled] Gets if the DR mode is on. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly drModeEnabled?: boolean; } /** @@ -1030,14 +1063,9 @@ export interface Iteration { */ readonly id?: string; /** - * @member {string} [name] Gets or sets the name of the iteration. + * @member {string} name Gets or sets the name of the iteration. */ - name?: string; - /** - * @member {boolean} [isDefault] Gets or sets a value indicating whether the - * iteration is the default iteration for the project. - */ - isDefault?: boolean; + name: string; /** * @member {string} [status] Gets the current iteration status. * **NOTE: This property will not be serialized. It can only be populated by @@ -1064,7 +1092,7 @@ export interface Iteration { */ readonly trainedAt?: Date; /** - * @member {string} [projectId] Gets The project id. of the iteration. + * @member {string} [projectId] Gets the project id of the iteration. * **NOTE: This property will not be serialized. It can only be populated by * the server.** */ @@ -1076,6 +1104,13 @@ export interface Iteration { * the server.** */ readonly exportable?: boolean; + /** + * @member {string[]} [exportableTo] A set of platforms this iteration can + * export to. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly exportableTo?: string[]; /** * @member {string} [domainId] Get or sets a guid of the domain the iteration * has been trained on. @@ -1090,6 +1125,26 @@ export interface Iteration { * the server.** */ readonly classificationType?: Classifier; + /** + * @member {TrainingType} [trainingType] Gets the training type of the + * iteration. Possible values include: 'Regular', 'Advanced' + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly trainingType?: TrainingType; + /** + * @member {number} [reservedBudgetInHours] Gets the reserved advanced + * training budget for the iteration. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly reservedBudgetInHours?: number; + /** + * @member {string} [publishName] Name of the published model. + * **NOTE: This property will not be serialized. It can only be populated by + * the server.** + */ + readonly publishName?: string; } /** @@ -1098,19 +1153,19 @@ export interface Iteration { */ export interface ExportModel { /** - * @member {ExportPlatformModel} [platform] Platform of the export. Possible - * values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX' + * @member {ExportPlatform} [platform] Platform of the export. Possible + * values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX', 'VAIDK' * **NOTE: This property will not be serialized. It can only be populated by * the server.** */ - readonly platform?: ExportPlatformModel; + readonly platform?: ExportPlatform; /** - * @member {ExportStatusModel} [status] Status of the export. Possible values + * @member {ExportStatus} [status] Status of the export. Possible values * include: 'Exporting', 'Failed', 'Done' * **NOTE: This property will not be serialized. It can only be populated by * the server.** */ - readonly status?: ExportStatusModel; + readonly status?: ExportStatus; /** * @member {string} [downloadUri] URI used to download the model. * **NOTE: This property will not be serialized. It can only be populated by @@ -1118,12 +1173,12 @@ export interface ExportModel { */ readonly downloadUri?: string; /** - * @member {ExportFlavorModel} [flavor] Flavor of the export. Possible values - * include: 'Linux', 'Windows', 'ONNX10', 'ONNX12' + * @member {ExportFlavor} [flavor] Flavor of the export. Possible values + * include: 'Linux', 'Windows', 'ONNX10', 'ONNX12', 'ARM' * **NOTE: This property will not be serialized. It can only be populated by * the server.** */ - readonly flavor?: ExportFlavorModel; + readonly flavor?: ExportFlavor; /** * @member {boolean} [newerVersionAvailable] Indicates an updated version of * the export package is available and should be re-exported for the latest @@ -1148,18 +1203,18 @@ export interface Tag { */ readonly id?: string; /** - * @member {string} [name] Gets or sets the name of the tag. + * @member {string} name Gets or sets the name of the tag. */ - name?: string; + name: string; /** - * @member {string} [description] Gets or sets the description of the tag. + * @member {string} description Gets or sets the description of the tag. */ - description?: string; + description: string; /** - * @member {TagType} [type] Gets or sets the type of the tag. Possible values + * @member {TagType} type Gets or sets the type of the tag. Possible values * include: 'Regular', 'Negative' */ - type?: TagType; + type: TagType; /** * @member {number} [imageCount] Gets the number of images with this tag. * **NOTE: This property will not be serialized. It can only be populated by @@ -1168,6 +1223,86 @@ export interface Tag { readonly imageCount?: number; } +/** + * @interface + * An interface representing CustomVisionError. + */ +export interface CustomVisionError { + /** + * @member {CustomVisionErrorCodes} code The error code. Possible values + * include: 'NoError', 'BadRequest', 'BadRequestExceededBatchSize', + * 'BadRequestNotSupported', 'BadRequestInvalidIds', 'BadRequestProjectName', + * 'BadRequestProjectNameNotUnique', 'BadRequestProjectDescription', + * 'BadRequestProjectUnknownDomain', + * 'BadRequestProjectUnknownClassification', + * 'BadRequestProjectUnsupportedDomainTypeChange', + * 'BadRequestProjectUnsupportedExportPlatform', 'BadRequestIterationName', + * 'BadRequestIterationNameNotUnique', 'BadRequestIterationDescription', + * 'BadRequestIterationIsNotTrained', 'BadRequestWorkspaceCannotBeModified', + * 'BadRequestWorkspaceNotDeletable', 'BadRequestTagName', + * 'BadRequestTagNameNotUnique', 'BadRequestTagDescription', + * 'BadRequestTagType', 'BadRequestMultipleNegativeTag', + * 'BadRequestImageTags', 'BadRequestImageRegions', + * 'BadRequestNegativeAndRegularTagOnSameImage', + * 'BadRequestRequiredParamIsNull', 'BadRequestIterationIsPublished', + * 'BadRequestInvalidPublishName', 'BadRequestInvalidPublishTarget', + * 'BadRequestUnpublishFailed', 'BadRequestSubscriptionApi', + * 'BadRequestExceedProjectLimit', + * 'BadRequestExceedIterationPerProjectLimit', + * 'BadRequestExceedTagPerProjectLimit', 'BadRequestExceedTagPerImageLimit', + * 'BadRequestExceededQuota', 'BadRequestCannotMigrateProjectWithName', + * 'BadRequestNotLimitedTrial', 'BadRequestImageBatch', + * 'BadRequestImageStream', 'BadRequestImageUrl', 'BadRequestImageFormat', + * 'BadRequestImageSizeBytes', 'BadRequestImageExceededCount', + * 'BadRequestTrainingNotNeeded', + * 'BadRequestTrainingNotNeededButTrainingPipelineUpdated', + * 'BadRequestTrainingValidationFailed', + * 'BadRequestClassificationTrainingValidationFailed', + * 'BadRequestMultiClassClassificationTrainingValidationFailed', + * 'BadRequestMultiLabelClassificationTrainingValidationFailed', + * 'BadRequestDetectionTrainingValidationFailed', + * 'BadRequestTrainingAlreadyInProgress', + * 'BadRequestDetectionTrainingNotAllowNegativeTag', + * 'BadRequestInvalidEmailAddress', + * 'BadRequestDomainNotSupportedForAdvancedTraining', + * 'BadRequestExportPlatformNotSupportedForAdvancedTraining', + * 'BadRequestReservedBudgetInHoursNotEnoughForAdvancedTraining', + * 'BadRequestExportValidationFailed', 'BadRequestExportAlreadyInProgress', + * 'BadRequestPredictionIdsMissing', 'BadRequestPredictionIdsExceededCount', + * 'BadRequestPredictionTagsExceededCount', + * 'BadRequestPredictionResultsExceededCount', + * 'BadRequestPredictionInvalidApplicationName', + * 'BadRequestPredictionInvalidQueryParameters', 'BadRequestInvalid', + * 'UnsupportedMediaType', 'Forbidden', 'ForbiddenUser', + * 'ForbiddenUserResource', 'ForbiddenUserSignupDisabled', + * 'ForbiddenUserSignupAllowanceExceeded', 'ForbiddenUserDoesNotExist', + * 'ForbiddenUserDisabled', 'ForbiddenUserInsufficientCapability', + * 'ForbiddenDRModeEnabled', 'ForbiddenInvalid', 'NotFound', + * 'NotFoundProject', 'NotFoundProjectDefaultIteration', 'NotFoundIteration', + * 'NotFoundIterationPerformance', 'NotFoundTag', 'NotFoundImage', + * 'NotFoundDomain', 'NotFoundApimSubscription', 'NotFoundInvalid', + * 'Conflict', 'ConflictInvalid', 'ErrorUnknown', + * 'ErrorProjectInvalidWorkspace', + * 'ErrorProjectInvalidPipelineConfiguration', 'ErrorProjectInvalidDomain', + * 'ErrorProjectTrainingRequestFailed', 'ErrorProjectExportRequestFailed', + * 'ErrorFeaturizationServiceUnavailable', 'ErrorFeaturizationQueueTimeout', + * 'ErrorFeaturizationInvalidFeaturizer', + * 'ErrorFeaturizationAugmentationUnavailable', + * 'ErrorFeaturizationUnrecognizedJob', + * 'ErrorFeaturizationAugmentationError', 'ErrorExporterInvalidPlatform', + * 'ErrorExporterInvalidFeaturizer', 'ErrorExporterInvalidClassifier', + * 'ErrorPredictionServiceUnavailable', 'ErrorPredictionModelNotFound', + * 'ErrorPredictionModelNotCached', 'ErrorPrediction', + * 'ErrorPredictionStorage', 'ErrorRegionProposal', 'ErrorInvalid' + */ + code: CustomVisionErrorCodes; + /** + * @member {string} message A message explaining the error reported by the + * service. + */ + message: string; +} + /** * @interface * An interface representing TrainingAPIClientGetTaggedImageCountOptionalParams. @@ -1418,6 +1553,42 @@ export interface TrainingAPIClientCreateProjectOptionalParams extends msRest.Req * 'Multilabel' */ classificationType?: ClassificationType; + /** + * @member {string[]} [targetExportPlatforms] List of platforms the trained + * model is intending exporting to. + */ + targetExportPlatforms?: string[]; +} + +/** + * @interface + * An interface representing TrainingAPIClientTrainProjectOptionalParams. + * Optional Parameters. + * + * @extends RequestOptionsBase + */ +export interface TrainingAPIClientTrainProjectOptionalParams extends msRest.RequestOptionsBase { + /** + * @member {TrainingType1} [trainingType] The type of training to use to + * train the project (default: Regular). Possible values include: 'Regular', + * 'Advanced' + */ + trainingType?: TrainingType1; + /** + * @member {number} [reservedBudgetInHours] The number of hours reserved as + * budget for training (if applicable). Default value: 0 . + */ + reservedBudgetInHours?: number; + /** + * @member {boolean} [forceTrain] Whether to force train even if dataset and + * configuration does not change (default: false). Default value: false . + */ + forceTrain?: boolean; + /** + * @member {string} [notificationEmailAddress] The email address to send + * notification to when training finishes (default: null). + */ + notificationEmailAddress?: string; } /** @@ -1430,7 +1601,7 @@ export interface TrainingAPIClientCreateProjectOptionalParams extends msRest.Req export interface TrainingAPIClientExportIterationOptionalParams extends msRest.RequestOptionsBase { /** * @member {Flavor} [flavor] The flavor of the target platform. Possible - * values include: 'Linux', 'Windows', 'ONNX10', 'ONNX12' + * values include: 'Linux', 'Windows', 'ONNX10', 'ONNX12', 'ARM' */ flavor?: Flavor; } @@ -1518,28 +1689,36 @@ export type OrderBy = 'Newest' | 'Oldest' | 'Suggested'; export type Classifier = 'Multiclass' | 'Multilabel'; /** - * Defines values for ExportPlatformModel. - * Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX' + * Defines values for TrainingType. + * Possible values include: 'Regular', 'Advanced' + * @readonly + * @enum {string} + */ +export type TrainingType = 'Regular' | 'Advanced'; + +/** + * Defines values for ExportPlatform. + * Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX', 'VAIDK' * @readonly * @enum {string} */ -export type ExportPlatformModel = 'CoreML' | 'TensorFlow' | 'DockerFile' | 'ONNX'; +export type ExportPlatform = 'CoreML' | 'TensorFlow' | 'DockerFile' | 'ONNX' | 'VAIDK'; /** - * Defines values for ExportStatusModel. + * Defines values for ExportStatus. * Possible values include: 'Exporting', 'Failed', 'Done' * @readonly * @enum {string} */ -export type ExportStatusModel = 'Exporting' | 'Failed' | 'Done'; +export type ExportStatus = 'Exporting' | 'Failed' | 'Done'; /** - * Defines values for ExportFlavorModel. - * Possible values include: 'Linux', 'Windows', 'ONNX10', 'ONNX12' + * Defines values for ExportFlavor. + * Possible values include: 'Linux', 'Windows', 'ONNX10', 'ONNX12', 'ARM' * @readonly * @enum {string} */ -export type ExportFlavorModel = 'Linux' | 'Windows' | 'ONNX10' | 'ONNX12'; +export type ExportFlavor = 'Linux' | 'Windows' | 'ONNX10' | 'ONNX12' | 'ARM'; /** * Defines values for TagType. @@ -1549,6 +1728,60 @@ export type ExportFlavorModel = 'Linux' | 'Windows' | 'ONNX10' | 'ONNX12'; */ export type TagType = 'Regular' | 'Negative'; +/** + * Defines values for CustomVisionErrorCodes. + * Possible values include: 'NoError', 'BadRequest', 'BadRequestExceededBatchSize', + * 'BadRequestNotSupported', 'BadRequestInvalidIds', 'BadRequestProjectName', + * 'BadRequestProjectNameNotUnique', 'BadRequestProjectDescription', + * 'BadRequestProjectUnknownDomain', 'BadRequestProjectUnknownClassification', + * 'BadRequestProjectUnsupportedDomainTypeChange', 'BadRequestProjectUnsupportedExportPlatform', + * 'BadRequestIterationName', 'BadRequestIterationNameNotUnique', 'BadRequestIterationDescription', + * 'BadRequestIterationIsNotTrained', 'BadRequestWorkspaceCannotBeModified', + * 'BadRequestWorkspaceNotDeletable', 'BadRequestTagName', 'BadRequestTagNameNotUnique', + * 'BadRequestTagDescription', 'BadRequestTagType', 'BadRequestMultipleNegativeTag', + * 'BadRequestImageTags', 'BadRequestImageRegions', 'BadRequestNegativeAndRegularTagOnSameImage', + * 'BadRequestRequiredParamIsNull', 'BadRequestIterationIsPublished', + * 'BadRequestInvalidPublishName', 'BadRequestInvalidPublishTarget', 'BadRequestUnpublishFailed', + * 'BadRequestSubscriptionApi', 'BadRequestExceedProjectLimit', + * 'BadRequestExceedIterationPerProjectLimit', 'BadRequestExceedTagPerProjectLimit', + * 'BadRequestExceedTagPerImageLimit', 'BadRequestExceededQuota', + * 'BadRequestCannotMigrateProjectWithName', 'BadRequestNotLimitedTrial', 'BadRequestImageBatch', + * 'BadRequestImageStream', 'BadRequestImageUrl', 'BadRequestImageFormat', + * 'BadRequestImageSizeBytes', 'BadRequestImageExceededCount', 'BadRequestTrainingNotNeeded', + * 'BadRequestTrainingNotNeededButTrainingPipelineUpdated', 'BadRequestTrainingValidationFailed', + * 'BadRequestClassificationTrainingValidationFailed', + * 'BadRequestMultiClassClassificationTrainingValidationFailed', + * 'BadRequestMultiLabelClassificationTrainingValidationFailed', + * 'BadRequestDetectionTrainingValidationFailed', 'BadRequestTrainingAlreadyInProgress', + * 'BadRequestDetectionTrainingNotAllowNegativeTag', 'BadRequestInvalidEmailAddress', + * 'BadRequestDomainNotSupportedForAdvancedTraining', + * 'BadRequestExportPlatformNotSupportedForAdvancedTraining', + * 'BadRequestReservedBudgetInHoursNotEnoughForAdvancedTraining', + * 'BadRequestExportValidationFailed', 'BadRequestExportAlreadyInProgress', + * 'BadRequestPredictionIdsMissing', 'BadRequestPredictionIdsExceededCount', + * 'BadRequestPredictionTagsExceededCount', 'BadRequestPredictionResultsExceededCount', + * 'BadRequestPredictionInvalidApplicationName', 'BadRequestPredictionInvalidQueryParameters', + * 'BadRequestInvalid', 'UnsupportedMediaType', 'Forbidden', 'ForbiddenUser', + * 'ForbiddenUserResource', 'ForbiddenUserSignupDisabled', 'ForbiddenUserSignupAllowanceExceeded', + * 'ForbiddenUserDoesNotExist', 'ForbiddenUserDisabled', 'ForbiddenUserInsufficientCapability', + * 'ForbiddenDRModeEnabled', 'ForbiddenInvalid', 'NotFound', 'NotFoundProject', + * 'NotFoundProjectDefaultIteration', 'NotFoundIteration', 'NotFoundIterationPerformance', + * 'NotFoundTag', 'NotFoundImage', 'NotFoundDomain', 'NotFoundApimSubscription', 'NotFoundInvalid', + * 'Conflict', 'ConflictInvalid', 'ErrorUnknown', 'ErrorProjectInvalidWorkspace', + * 'ErrorProjectInvalidPipelineConfiguration', 'ErrorProjectInvalidDomain', + * 'ErrorProjectTrainingRequestFailed', 'ErrorProjectExportRequestFailed', + * 'ErrorFeaturizationServiceUnavailable', 'ErrorFeaturizationQueueTimeout', + * 'ErrorFeaturizationInvalidFeaturizer', 'ErrorFeaturizationAugmentationUnavailable', + * 'ErrorFeaturizationUnrecognizedJob', 'ErrorFeaturizationAugmentationError', + * 'ErrorExporterInvalidPlatform', 'ErrorExporterInvalidFeaturizer', + * 'ErrorExporterInvalidClassifier', 'ErrorPredictionServiceUnavailable', + * 'ErrorPredictionModelNotFound', 'ErrorPredictionModelNotCached', 'ErrorPrediction', + * 'ErrorPredictionStorage', 'ErrorRegionProposal', 'ErrorInvalid' + * @readonly + * @enum {string} + */ +export type CustomVisionErrorCodes = 'NoError' | 'BadRequest' | 'BadRequestExceededBatchSize' | 'BadRequestNotSupported' | 'BadRequestInvalidIds' | 'BadRequestProjectName' | 'BadRequestProjectNameNotUnique' | 'BadRequestProjectDescription' | 'BadRequestProjectUnknownDomain' | 'BadRequestProjectUnknownClassification' | 'BadRequestProjectUnsupportedDomainTypeChange' | 'BadRequestProjectUnsupportedExportPlatform' | 'BadRequestIterationName' | 'BadRequestIterationNameNotUnique' | 'BadRequestIterationDescription' | 'BadRequestIterationIsNotTrained' | 'BadRequestWorkspaceCannotBeModified' | 'BadRequestWorkspaceNotDeletable' | 'BadRequestTagName' | 'BadRequestTagNameNotUnique' | 'BadRequestTagDescription' | 'BadRequestTagType' | 'BadRequestMultipleNegativeTag' | 'BadRequestImageTags' | 'BadRequestImageRegions' | 'BadRequestNegativeAndRegularTagOnSameImage' | 'BadRequestRequiredParamIsNull' | 'BadRequestIterationIsPublished' | 'BadRequestInvalidPublishName' | 'BadRequestInvalidPublishTarget' | 'BadRequestUnpublishFailed' | 'BadRequestSubscriptionApi' | 'BadRequestExceedProjectLimit' | 'BadRequestExceedIterationPerProjectLimit' | 'BadRequestExceedTagPerProjectLimit' | 'BadRequestExceedTagPerImageLimit' | 'BadRequestExceededQuota' | 'BadRequestCannotMigrateProjectWithName' | 'BadRequestNotLimitedTrial' | 'BadRequestImageBatch' | 'BadRequestImageStream' | 'BadRequestImageUrl' | 'BadRequestImageFormat' | 'BadRequestImageSizeBytes' | 'BadRequestImageExceededCount' | 'BadRequestTrainingNotNeeded' | 'BadRequestTrainingNotNeededButTrainingPipelineUpdated' | 'BadRequestTrainingValidationFailed' | 'BadRequestClassificationTrainingValidationFailed' | 'BadRequestMultiClassClassificationTrainingValidationFailed' | 'BadRequestMultiLabelClassificationTrainingValidationFailed' | 'BadRequestDetectionTrainingValidationFailed' | 'BadRequestTrainingAlreadyInProgress' | 'BadRequestDetectionTrainingNotAllowNegativeTag' | 'BadRequestInvalidEmailAddress' | 'BadRequestDomainNotSupportedForAdvancedTraining' | 'BadRequestExportPlatformNotSupportedForAdvancedTraining' | 'BadRequestReservedBudgetInHoursNotEnoughForAdvancedTraining' | 'BadRequestExportValidationFailed' | 'BadRequestExportAlreadyInProgress' | 'BadRequestPredictionIdsMissing' | 'BadRequestPredictionIdsExceededCount' | 'BadRequestPredictionTagsExceededCount' | 'BadRequestPredictionResultsExceededCount' | 'BadRequestPredictionInvalidApplicationName' | 'BadRequestPredictionInvalidQueryParameters' | 'BadRequestInvalid' | 'UnsupportedMediaType' | 'Forbidden' | 'ForbiddenUser' | 'ForbiddenUserResource' | 'ForbiddenUserSignupDisabled' | 'ForbiddenUserSignupAllowanceExceeded' | 'ForbiddenUserDoesNotExist' | 'ForbiddenUserDisabled' | 'ForbiddenUserInsufficientCapability' | 'ForbiddenDRModeEnabled' | 'ForbiddenInvalid' | 'NotFound' | 'NotFoundProject' | 'NotFoundProjectDefaultIteration' | 'NotFoundIteration' | 'NotFoundIterationPerformance' | 'NotFoundTag' | 'NotFoundImage' | 'NotFoundDomain' | 'NotFoundApimSubscription' | 'NotFoundInvalid' | 'Conflict' | 'ConflictInvalid' | 'ErrorUnknown' | 'ErrorProjectInvalidWorkspace' | 'ErrorProjectInvalidPipelineConfiguration' | 'ErrorProjectInvalidDomain' | 'ErrorProjectTrainingRequestFailed' | 'ErrorProjectExportRequestFailed' | 'ErrorFeaturizationServiceUnavailable' | 'ErrorFeaturizationQueueTimeout' | 'ErrorFeaturizationInvalidFeaturizer' | 'ErrorFeaturizationAugmentationUnavailable' | 'ErrorFeaturizationUnrecognizedJob' | 'ErrorFeaturizationAugmentationError' | 'ErrorExporterInvalidPlatform' | 'ErrorExporterInvalidFeaturizer' | 'ErrorExporterInvalidClassifier' | 'ErrorPredictionServiceUnavailable' | 'ErrorPredictionModelNotFound' | 'ErrorPredictionModelNotCached' | 'ErrorPrediction' | 'ErrorPredictionStorage' | 'ErrorRegionProposal' | 'ErrorInvalid'; + /** * Defines values for OrderBy1. * Possible values include: 'Newest', 'Oldest' @@ -1581,13 +1814,21 @@ export type OrderBy3 = 'Newest' | 'Oldest'; */ export type ClassificationType = 'Multiclass' | 'Multilabel'; +/** + * Defines values for TrainingType1. + * Possible values include: 'Regular', 'Advanced' + * @readonly + * @enum {string} + */ +export type TrainingType1 = 'Regular' | 'Advanced'; + /** * Defines values for Flavor. - * Possible values include: 'Linux', 'Windows', 'ONNX10', 'ONNX12' + * Possible values include: 'Linux', 'Windows', 'ONNX10', 'ONNX12', 'ARM' * @readonly * @enum {string} */ -export type Flavor = 'Linux' | 'Windows' | 'ONNX10' | 'ONNX12'; +export type Flavor = 'Linux' | 'Windows' | 'ONNX10' | 'ONNX12' | 'ARM'; /** * Defines values for Type. @@ -1599,11 +1840,11 @@ export type Type = 'Regular' | 'Negative'; /** * Defines values for Platform. - * Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX' + * Possible values include: 'CoreML', 'TensorFlow', 'DockerFile', 'ONNX', 'VAIDK' * @readonly * @enum {string} */ -export type Platform = 'CoreML' | 'TensorFlow' | 'DockerFile' | 'ONNX'; +export type Platform = 'CoreML' | 'TensorFlow' | 'DockerFile' | 'ONNX' | 'VAIDK'; /** * Contains response data for the getDomains operation. @@ -2073,6 +2314,25 @@ export type UpdateProjectResponse = Project & { }; }; +/** + * Contains response data for the trainProject operation. + */ +export type TrainProjectResponse = Iteration & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: Iteration; + }; +}; + /** * Contains response data for the getIterations operation. */ @@ -2131,9 +2391,13 @@ export type UpdateIterationResponse = Iteration & { }; /** - * Contains response data for the trainProject operation. + * Contains response data for the publishIteration operation. */ -export type TrainProjectResponse = Iteration & { +export type PublishIterationResponse = { + /** + * The parsed response body. + */ + body: boolean; /** * The underlying HTTP response. */ @@ -2145,7 +2409,30 @@ export type TrainProjectResponse = Iteration & { /** * The response body as parsed JSON or XML */ - parsedBody: Iteration; + parsedBody: boolean; + }; +}; + +/** + * Contains response data for the unpublishIteration operation. + */ +export type UnpublishIterationResponse = { + /** + * The parsed response body. + */ + body: boolean; + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + /** + * The response body as parsed JSON or XML + */ + parsedBody: boolean; }; }; diff --git a/packages/@azure/cognitiveservices-customvision-training/lib/models/mappers.ts b/packages/@azure/cognitiveservices-customvision-training/lib/models/mappers.ts index 2b8f9fe2da6c..d998f5aeeff0 100644 --- a/packages/@azure/cognitiveservices-customvision-training/lib/models/mappers.ts +++ b/packages/@azure/cognitiveservices-customvision-training/lib/models/mappers.ts @@ -26,7 +26,7 @@ export const Domain: msRest.CompositeMapper = { } }, name: { - nullable: true, + nullable: false, readOnly: true, serializedName: "name", type: { @@ -92,7 +92,6 @@ export const ImageTagCreateBatch: msRest.CompositeMapper = { className: "ImageTagCreateBatch", modelProperties: { tags: { - nullable: true, serializedName: "tags", type: { name: "Sequence", @@ -164,6 +163,7 @@ export const ImageRegionCreateEntry: msRest.CompositeMapper = { className: "ImageRegionCreateEntry", modelProperties: { imageId: { + required: true, nullable: false, serializedName: "imageId", type: { @@ -171,6 +171,7 @@ export const ImageRegionCreateEntry: msRest.CompositeMapper = { } }, tagId: { + required: true, nullable: false, serializedName: "tagId", type: { @@ -178,6 +179,7 @@ export const ImageRegionCreateEntry: msRest.CompositeMapper = { } }, left: { + required: true, nullable: false, serializedName: "left", type: { @@ -185,6 +187,7 @@ export const ImageRegionCreateEntry: msRest.CompositeMapper = { } }, top: { + required: true, nullable: false, serializedName: "top", type: { @@ -192,6 +195,7 @@ export const ImageRegionCreateEntry: msRest.CompositeMapper = { } }, width: { + required: true, nullable: false, serializedName: "width", type: { @@ -199,6 +203,7 @@ export const ImageRegionCreateEntry: msRest.CompositeMapper = { } }, height: { + required: true, nullable: false, serializedName: "height", type: { @@ -216,7 +221,6 @@ export const ImageRegionCreateBatch: msRest.CompositeMapper = { className: "ImageRegionCreateBatch", modelProperties: { regions: { - nullable: true, serializedName: "regions", type: { name: "Sequence", @@ -255,7 +259,7 @@ export const ImageRegionCreateResult: msRest.CompositeMapper = { } }, tagName: { - nullable: true, + nullable: false, readOnly: true, serializedName: "tagName", type: { @@ -271,6 +275,7 @@ export const ImageRegionCreateResult: msRest.CompositeMapper = { } }, tagId: { + required: true, nullable: false, serializedName: "tagId", type: { @@ -278,6 +283,7 @@ export const ImageRegionCreateResult: msRest.CompositeMapper = { } }, left: { + required: true, nullable: false, serializedName: "left", type: { @@ -285,6 +291,7 @@ export const ImageRegionCreateResult: msRest.CompositeMapper = { } }, top: { + required: true, nullable: false, serializedName: "top", type: { @@ -292,6 +299,7 @@ export const ImageRegionCreateResult: msRest.CompositeMapper = { } }, width: { + required: true, nullable: false, serializedName: "width", type: { @@ -299,6 +307,7 @@ export const ImageRegionCreateResult: msRest.CompositeMapper = { } }, height: { + required: true, nullable: false, serializedName: "height", type: { @@ -373,7 +382,7 @@ export const ImageTag: msRest.CompositeMapper = { } }, tagName: { - nullable: true, + nullable: false, readOnly: true, serializedName: "tagName", type: { @@ -407,7 +416,7 @@ export const ImageRegion: msRest.CompositeMapper = { } }, tagName: { - nullable: true, + nullable: false, readOnly: true, serializedName: "tagName", type: { @@ -423,6 +432,7 @@ export const ImageRegion: msRest.CompositeMapper = { } }, tagId: { + required: true, nullable: false, serializedName: "tagId", type: { @@ -430,6 +440,7 @@ export const ImageRegion: msRest.CompositeMapper = { } }, left: { + required: true, nullable: false, serializedName: "left", type: { @@ -437,6 +448,7 @@ export const ImageRegion: msRest.CompositeMapper = { } }, top: { + required: true, nullable: false, serializedName: "top", type: { @@ -444,6 +456,7 @@ export const ImageRegion: msRest.CompositeMapper = { } }, width: { + required: true, nullable: false, serializedName: "width", type: { @@ -451,6 +464,7 @@ export const ImageRegion: msRest.CompositeMapper = { } }, height: { + required: true, nullable: false, serializedName: "height", type: { @@ -500,7 +514,7 @@ export const Image: msRest.CompositeMapper = { } }, resizedImageUri: { - nullable: true, + nullable: false, readOnly: true, serializedName: "resizedImageUri", type: { @@ -508,7 +522,7 @@ export const Image: msRest.CompositeMapper = { } }, thumbnailUri: { - nullable: true, + nullable: false, readOnly: true, serializedName: "thumbnailUri", type: { @@ -516,7 +530,7 @@ export const Image: msRest.CompositeMapper = { } }, originalImageUri: { - nullable: true, + nullable: false, readOnly: true, serializedName: "originalImageUri", type: { @@ -562,7 +576,7 @@ export const ImageCreateResult: msRest.CompositeMapper = { className: "ImageCreateResult", modelProperties: { sourceUrl: { - nullable: true, + nullable: false, readOnly: true, serializedName: "sourceUrl", type: { @@ -578,6 +592,7 @@ export const ImageCreateResult: msRest.CompositeMapper = { } }, image: { + nullable: false, readOnly: true, serializedName: "image", type: { @@ -604,7 +619,6 @@ export const ImageCreateSummary: msRest.CompositeMapper = { } }, images: { - nullable: true, readOnly: true, serializedName: "images", type: { @@ -628,6 +642,7 @@ export const Region: msRest.CompositeMapper = { className: "Region", modelProperties: { tagId: { + required: true, nullable: false, serializedName: "tagId", type: { @@ -635,6 +650,7 @@ export const Region: msRest.CompositeMapper = { } }, left: { + required: true, nullable: false, serializedName: "left", type: { @@ -642,6 +658,7 @@ export const Region: msRest.CompositeMapper = { } }, top: { + required: true, nullable: false, serializedName: "top", type: { @@ -649,6 +666,7 @@ export const Region: msRest.CompositeMapper = { } }, width: { + required: true, nullable: false, serializedName: "width", type: { @@ -656,6 +674,7 @@ export const Region: msRest.CompositeMapper = { } }, height: { + required: true, nullable: false, serializedName: "height", type: { @@ -673,21 +692,20 @@ export const ImageFileCreateEntry: msRest.CompositeMapper = { className: "ImageFileCreateEntry", modelProperties: { name: { - nullable: true, + nullable: false, serializedName: "name", type: { name: "String" } }, contents: { - nullable: true, + nullable: false, serializedName: "contents", type: { name: "ByteArray" } }, tagIds: { - nullable: true, serializedName: "tagIds", type: { name: "Sequence", @@ -699,7 +717,6 @@ export const ImageFileCreateEntry: msRest.CompositeMapper = { } }, regions: { - nullable: true, serializedName: "regions", type: { name: "Sequence", @@ -722,7 +739,6 @@ export const ImageFileCreateBatch: msRest.CompositeMapper = { className: "ImageFileCreateBatch", modelProperties: { images: { - nullable: true, serializedName: "images", type: { name: "Sequence", @@ -735,7 +751,6 @@ export const ImageFileCreateBatch: msRest.CompositeMapper = { } }, tagIds: { - nullable: true, serializedName: "tagIds", type: { name: "Sequence", @@ -757,14 +772,14 @@ export const ImageUrlCreateEntry: msRest.CompositeMapper = { className: "ImageUrlCreateEntry", modelProperties: { url: { - nullable: true, + required: true, + nullable: false, serializedName: "url", type: { name: "String" } }, tagIds: { - nullable: true, serializedName: "tagIds", type: { name: "Sequence", @@ -776,7 +791,6 @@ export const ImageUrlCreateEntry: msRest.CompositeMapper = { } }, regions: { - nullable: true, serializedName: "regions", type: { name: "Sequence", @@ -799,7 +813,6 @@ export const ImageUrlCreateBatch: msRest.CompositeMapper = { className: "ImageUrlCreateBatch", modelProperties: { images: { - nullable: true, serializedName: "images", type: { name: "Sequence", @@ -812,7 +825,6 @@ export const ImageUrlCreateBatch: msRest.CompositeMapper = { } }, tagIds: { - nullable: true, serializedName: "tagIds", type: { name: "Sequence", @@ -841,7 +853,6 @@ export const ImageIdCreateEntry: msRest.CompositeMapper = { } }, tagIds: { - nullable: true, serializedName: "tagIds", type: { name: "Sequence", @@ -853,7 +864,6 @@ export const ImageIdCreateEntry: msRest.CompositeMapper = { } }, regions: { - nullable: true, serializedName: "regions", type: { name: "Sequence", @@ -876,7 +886,6 @@ export const ImageIdCreateBatch: msRest.CompositeMapper = { className: "ImageIdCreateBatch", modelProperties: { images: { - nullable: true, serializedName: "images", type: { name: "Sequence", @@ -889,7 +898,6 @@ export const ImageIdCreateBatch: msRest.CompositeMapper = { } }, tagIds: { - nullable: true, serializedName: "tagIds", type: { name: "Sequence", @@ -911,6 +919,7 @@ export const BoundingBox: msRest.CompositeMapper = { className: "BoundingBox", modelProperties: { left: { + required: true, nullable: false, serializedName: "left", type: { @@ -918,6 +927,7 @@ export const BoundingBox: msRest.CompositeMapper = { } }, top: { + required: true, nullable: false, serializedName: "top", type: { @@ -925,6 +935,7 @@ export const BoundingBox: msRest.CompositeMapper = { } }, width: { + required: true, nullable: false, serializedName: "width", type: { @@ -932,6 +943,7 @@ export const BoundingBox: msRest.CompositeMapper = { } }, height: { + required: true, nullable: false, serializedName: "height", type: { @@ -957,6 +969,7 @@ export const RegionProposal: msRest.CompositeMapper = { } }, boundingBox: { + nullable: false, readOnly: true, serializedName: "boundingBox", type: { @@ -991,7 +1004,6 @@ export const ImageRegionProposal: msRest.CompositeMapper = { } }, proposals: { - nullable: true, readOnly: true, serializedName: "proposals", type: { @@ -1015,7 +1027,8 @@ export const ImageUrl: msRest.CompositeMapper = { className: "ImageUrl", modelProperties: { url: { - nullable: true, + required: true, + nullable: false, serializedName: "url", type: { name: "String" @@ -1056,6 +1069,7 @@ export const Prediction: msRest.CompositeMapper = { } }, boundingBox: { + nullable: true, readOnly: true, serializedName: "boundingBox", type: { @@ -1106,7 +1120,6 @@ export const ImagePrediction: msRest.CompositeMapper = { } }, predictions: { - nullable: true, readOnly: true, serializedName: "predictions", type: { @@ -1164,14 +1177,14 @@ export const PredictionQueryToken: msRest.CompositeMapper = { className: "PredictionQueryToken", modelProperties: { session: { - nullable: true, + nullable: false, serializedName: "session", type: { name: "String" } }, continuation: { - nullable: true, + nullable: false, serializedName: "continuation", type: { name: "String" @@ -1192,7 +1205,6 @@ export const PredictionQueryToken: msRest.CompositeMapper = { } }, tags: { - nullable: true, serializedName: "tags", type: { name: "Sequence", @@ -1226,7 +1238,7 @@ export const PredictionQueryToken: msRest.CompositeMapper = { } }, application: { - nullable: true, + nullable: false, serializedName: "application", type: { name: "String" @@ -1243,7 +1255,7 @@ export const StoredImagePrediction: msRest.CompositeMapper = { className: "StoredImagePrediction", modelProperties: { resizedImageUri: { - nullable: true, + nullable: false, readOnly: true, serializedName: "resizedImageUri", type: { @@ -1251,7 +1263,7 @@ export const StoredImagePrediction: msRest.CompositeMapper = { } }, thumbnailUri: { - nullable: true, + nullable: false, readOnly: true, serializedName: "thumbnailUri", type: { @@ -1259,7 +1271,7 @@ export const StoredImagePrediction: msRest.CompositeMapper = { } }, originalImageUri: { - nullable: true, + nullable: false, readOnly: true, serializedName: "originalImageUri", type: { @@ -1307,7 +1319,6 @@ export const StoredImagePrediction: msRest.CompositeMapper = { } }, predictions: { - nullable: true, readOnly: true, serializedName: "predictions", type: { @@ -1331,6 +1342,7 @@ export const PredictionQueryResult: msRest.CompositeMapper = { className: "PredictionQueryResult", modelProperties: { token: { + nullable: false, readOnly: true, serializedName: "token", type: { @@ -1339,7 +1351,6 @@ export const PredictionQueryResult: msRest.CompositeMapper = { } }, results: { - nullable: true, readOnly: true, serializedName: "results", type: { @@ -1371,7 +1382,7 @@ export const TagPerformance: msRest.CompositeMapper = { } }, name: { - nullable: true, + nullable: false, readOnly: true, serializedName: "name", type: { @@ -1429,7 +1440,6 @@ export const IterationPerformance: msRest.CompositeMapper = { className: "IterationPerformance", modelProperties: { perTagPerformance: { - nullable: true, readOnly: true, serializedName: "perTagPerformance", type: { @@ -1539,7 +1549,7 @@ export const ImagePerformance: msRest.CompositeMapper = { } }, imageUri: { - nullable: true, + nullable: false, readOnly: true, serializedName: "imageUri", type: { @@ -1547,7 +1557,7 @@ export const ImagePerformance: msRest.CompositeMapper = { } }, thumbnailUri: { - nullable: true, + nullable: false, readOnly: true, serializedName: "thumbnailUri", type: { @@ -1605,6 +1615,17 @@ export const ProjectSettings: msRest.CompositeMapper = { type: { name: "String" } + }, + targetExportPlatforms: { + serializedName: "targetExportPlatforms", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } } } } @@ -1625,20 +1646,24 @@ export const Project: msRest.CompositeMapper = { } }, name: { - nullable: true, + required: true, + nullable: false, serializedName: "name", type: { name: "String" } }, description: { - nullable: true, + required: true, + nullable: false, serializedName: "description", type: { name: "String" } }, settings: { + required: true, + nullable: false, serializedName: "settings", type: { name: "Composite", @@ -1662,12 +1687,20 @@ export const Project: msRest.CompositeMapper = { } }, thumbnailUri: { - nullable: true, + nullable: false, readOnly: true, serializedName: "thumbnailUri", type: { name: "String" } + }, + drModeEnabled: { + nullable: true, + readOnly: true, + serializedName: "drModeEnabled", + type: { + name: "Boolean" + } } } } @@ -1688,21 +1721,15 @@ export const Iteration: msRest.CompositeMapper = { } }, name: { - nullable: true, + required: true, + nullable: false, serializedName: "name", type: { name: "String" } }, - isDefault: { - nullable: false, - serializedName: "isDefault", - type: { - name: "Boolean" - } - }, status: { - nullable: true, + nullable: false, readOnly: true, serializedName: "status", type: { @@ -1749,6 +1776,18 @@ export const Iteration: msRest.CompositeMapper = { name: "Boolean" } }, + exportableTo: { + readOnly: true, + serializedName: "exportableTo", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, domainId: { nullable: true, readOnly: true, @@ -1764,6 +1803,30 @@ export const Iteration: msRest.CompositeMapper = { type: { name: "String" } + }, + trainingType: { + nullable: false, + readOnly: true, + serializedName: "trainingType", + type: { + name: "String" + } + }, + reservedBudgetInHours: { + nullable: false, + readOnly: true, + serializedName: "reservedBudgetInHours", + type: { + name: "Number" + } + }, + publishName: { + nullable: false, + readOnly: true, + serializedName: "publishName", + type: { + name: "String" + } } } } @@ -1792,7 +1855,7 @@ export const ExportModel: msRest.CompositeMapper = { } }, downloadUri: { - nullable: true, + nullable: false, readOnly: true, serializedName: "downloadUri", type: { @@ -1834,20 +1897,23 @@ export const Tag: msRest.CompositeMapper = { } }, name: { - nullable: true, + required: true, + nullable: false, serializedName: "name", type: { name: "String" } }, description: { - nullable: true, + required: true, + nullable: false, serializedName: "description", type: { name: "String" } }, type: { + required: true, nullable: false, serializedName: "type", type: { @@ -1865,3 +1931,27 @@ export const Tag: msRest.CompositeMapper = { } } }; + +export const CustomVisionError: msRest.CompositeMapper = { + serializedName: "CustomVisionError", + type: { + name: "Composite", + className: "CustomVisionError", + modelProperties: { + code: { + required: true, + serializedName: "code", + type: { + name: "String" + } + }, + message: { + required: true, + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; diff --git a/packages/@azure/cognitiveservices-customvision-training/lib/models/parameters.ts b/packages/@azure/cognitiveservices-customvision-training/lib/models/parameters.ts index 96484b314287..5fb7f55d08e6 100644 --- a/packages/@azure/cognitiveservices-customvision-training/lib/models/parameters.ts +++ b/packages/@azure/cognitiveservices-customvision-training/lib/models/parameters.ts @@ -26,7 +26,6 @@ export const classificationType: msRest.OperationQueryParameter = { "classificationType" ], mapper: { - nullable: false, serializedName: "classificationType", type: { name: "String" @@ -39,7 +38,6 @@ export const description: msRest.OperationQueryParameter = { "description" ], mapper: { - nullable: true, serializedName: "description", type: { name: "String" @@ -95,17 +93,33 @@ export const flavor: msRest.OperationQueryParameter = { } } }; +export const forceTrain: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "forceTrain" + ], + mapper: { + serializedName: "forceTrain", + defaultValue: false, + type: { + name: "Boolean" + } + } +}; export const ids: msRest.OperationQueryParameter = { parameterPath: "ids", mapper: { required: true, - nullable: true, serializedName: "ids", + constraints: { + MaxItems: 64, + MinItems: 0 + }, type: { name: "Sequence", element: { type: { - name: "String" + name: "Uuid" } } } @@ -137,13 +151,16 @@ export const imageIds0: msRest.OperationQueryParameter = { parameterPath: "imageIds", mapper: { required: true, - nullable: true, serializedName: "imageIds", + constraints: { + MaxItems: 64, + MinItems: 0 + }, type: { name: "Sequence", element: { type: { - name: "String" + name: "Uuid" } } } @@ -156,13 +173,36 @@ export const imageIds1: msRest.OperationQueryParameter = { "imageIds" ], mapper: { - nullable: true, serializedName: "imageIds", + constraints: { + MaxItems: 256, + MinItems: 0 + }, type: { name: "Sequence", element: { type: { - name: "String" + name: "Uuid" + } + } + } + }, + collectionFormat: msRest.QueryCollectionFormat.Csv +}; +export const imageIds2: msRest.OperationQueryParameter = { + parameterPath: "imageIds", + mapper: { + required: true, + serializedName: "imageIds", + constraints: { + MaxItems: 256, + MinItems: 0 + }, + type: { + name: "Sequence", + element: { + type: { + name: "Uuid" } } } @@ -197,20 +237,32 @@ export const name: msRest.OperationQueryParameter = { parameterPath: "name", mapper: { required: true, - nullable: true, serializedName: "name", type: { name: "String" } } }; +export const notificationEmailAddress: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "notificationEmailAddress" + ], + mapper: { + nullable: true, + serializedName: "notificationEmailAddress", + type: { + name: "String" + } + } +}; export const orderBy: msRest.OperationQueryParameter = { parameterPath: [ "options", "orderBy" ], mapper: { - nullable: false, + nullable: true, serializedName: "orderBy", type: { name: "String" @@ -240,6 +292,16 @@ export const platform: msRest.OperationQueryParameter = { } } }; +export const predictionId: msRest.OperationQueryParameter = { + parameterPath: "predictionId", + mapper: { + required: true, + serializedName: "predictionId", + type: { + name: "String" + } + } +}; export const projectId: msRest.OperationURLParameter = { parameterPath: "projectId", mapper: { @@ -251,23 +313,49 @@ export const projectId: msRest.OperationURLParameter = { } } }; +export const publishName: msRest.OperationQueryParameter = { + parameterPath: "publishName", + mapper: { + required: true, + serializedName: "publishName", + type: { + name: "String" + } + } +}; export const regionIds: msRest.OperationQueryParameter = { parameterPath: "regionIds", mapper: { required: true, - nullable: true, serializedName: "regionIds", + constraints: { + MaxItems: 64, + MinItems: 0 + }, type: { name: "Sequence", element: { type: { - name: "String" + name: "Uuid" } } } }, collectionFormat: msRest.QueryCollectionFormat.Csv }; +export const reservedBudgetInHours: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "reservedBudgetInHours" + ], + mapper: { + serializedName: "reservedBudgetInHours", + defaultValue: 0, + type: { + name: "Number" + } + } +}; export const skip: msRest.OperationQueryParameter = { parameterPath: [ "options", @@ -298,13 +386,12 @@ export const tagIds0: msRest.OperationQueryParameter = { "tagIds" ], mapper: { - nullable: true, serializedName: "tagIds", type: { name: "Sequence", element: { type: { - name: "String" + name: "Uuid" } } } @@ -315,13 +402,38 @@ export const tagIds1: msRest.OperationQueryParameter = { parameterPath: "tagIds", mapper: { required: true, - nullable: true, serializedName: "tagIds", + constraints: { + MaxItems: 20, + MinItems: 0 + }, type: { name: "Sequence", element: { type: { - name: "String" + name: "Uuid" + } + } + } + }, + collectionFormat: msRest.QueryCollectionFormat.Csv +}; +export const tagIds2: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "tagIds" + ], + mapper: { + serializedName: "tagIds", + constraints: { + MaxItems: 20, + MinItems: 0 + }, + type: { + name: "Sequence", + element: { + type: { + name: "Uuid" } } } @@ -336,11 +448,33 @@ export const take: msRest.OperationQueryParameter = { mapper: { serializedName: "take", defaultValue: 50, + constraints: { + InclusiveMaximum: 256, + InclusiveMinimum: 0 + }, type: { name: "Number" } } }; +export const targetExportPlatforms: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "targetExportPlatforms" + ], + mapper: { + serializedName: "targetExportPlatforms", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + collectionFormat: msRest.QueryCollectionFormat.Csv +}; export const threshold: msRest.OperationQueryParameter = { parameterPath: [ "options", @@ -353,13 +487,24 @@ export const threshold: msRest.OperationQueryParameter = { } } }; +export const trainingType: msRest.OperationQueryParameter = { + parameterPath: [ + "options", + "trainingType" + ], + mapper: { + serializedName: "trainingType", + type: { + name: "String" + } + } +}; export const type: msRest.OperationQueryParameter = { parameterPath: [ "options", "type" ], mapper: { - nullable: false, serializedName: "type", type: { name: "String" diff --git a/packages/@azure/cognitiveservices-customvision-training/lib/trainingAPIClient.ts b/packages/@azure/cognitiveservices-customvision-training/lib/trainingAPIClient.ts index 4463e9ab06af..589d94fba0aa 100644 --- a/packages/@azure/cognitiveservices-customvision-training/lib/trainingAPIClient.ts +++ b/packages/@azure/cognitiveservices-customvision-training/lib/trainingAPIClient.ts @@ -17,8 +17,8 @@ import { TrainingAPIClientContext } from "./trainingAPIClientContext"; class TrainingAPIClient extends TrainingAPIClientContext { /** * Initializes a new instance of the TrainingAPIClient class. - * @param apiKey - * @param endpoint Supported Cognitive Services endpoints + * @param apiKey API key. + * @param endpoint Supported Cognitive Services endpoints. * @param [options] The parameter options */ constructor(apiKey: string, endpoint: string, options?: msRest.ServiceClientOptions) { @@ -175,7 +175,7 @@ class TrainingAPIClient extends TrainingAPIClientContext { * @summary Remove a set of tags from a set of images. * @param projectId The project id. * @param imageIds Image ids. Limited to 64 images. - * @param tagIds Tags to be deleted from the specified images. Limted to 20 tags. + * @param tagIds Tags to be deleted from the specified images. Limited to 20 tags. * @param [options] The optional parameters * @returns Promise */ @@ -183,14 +183,14 @@ class TrainingAPIClient extends TrainingAPIClientContext { /** * @param projectId The project id. * @param imageIds Image ids. Limited to 64 images. - * @param tagIds Tags to be deleted from the specified images. Limted to 20 tags. + * @param tagIds Tags to be deleted from the specified images. Limited to 20 tags. * @param callback The callback */ deleteImageTags(projectId: string, imageIds: string[], tagIds: string[], callback: msRest.ServiceCallback): void; /** * @param projectId The project id. * @param imageIds Image ids. Limited to 64 images. - * @param tagIds Tags to be deleted from the specified images. Limted to 20 tags. + * @param tagIds Tags to be deleted from the specified images. Limited to 20 tags. * @param options The optional parameters * @param callback The callback */ @@ -376,20 +376,23 @@ class TrainingAPIClient extends TrainingAPIClientContext { * multiple image files can be sent at once, with a maximum of 64 files * @summary Add the provided images to the set of training images. * @param projectId The project id. - * @param imageData Binary image data. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports + * images up to 6MB. * @param [options] The optional parameters * @returns Promise */ createImagesFromData(projectId: string, imageData: msRest.HttpRequestBody, options?: Models.TrainingAPIClientCreateImagesFromDataOptionalParams): Promise; /** * @param projectId The project id. - * @param imageData Binary image data. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports + * images up to 6MB. * @param callback The callback */ createImagesFromData(projectId: string, imageData: msRest.HttpRequestBody, callback: msRest.ServiceCallback): void; /** * @param projectId The project id. - * @param imageData Binary image data. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports + * images up to 6MB. * @param options The optional parameters * @param callback The callback */ @@ -408,20 +411,20 @@ class TrainingAPIClient extends TrainingAPIClientContext { /** * @summary Delete images from the set of training images. * @param projectId The project id. - * @param imageIds Ids of the images to be deleted. Limted to 256 images per batch. + * @param imageIds Ids of the images to be deleted. Limited to 256 images per batch. * @param [options] The optional parameters * @returns Promise */ deleteImages(projectId: string, imageIds: string[], options?: msRest.RequestOptionsBase): Promise; /** * @param projectId The project id. - * @param imageIds Ids of the images to be deleted. Limted to 256 images per batch. + * @param imageIds Ids of the images to be deleted. Limited to 256 images per batch. * @param callback The callback */ deleteImages(projectId: string, imageIds: string[], callback: msRest.ServiceCallback): void; /** * @param projectId The project id. - * @param imageIds Ids of the images to be deleted. Limted to 256 images per batch. + * @param imageIds Ids of the images to be deleted. Limited to 256 images per batch. * @param options The optional parameters * @param callback The callback */ @@ -510,20 +513,20 @@ class TrainingAPIClient extends TrainingAPIClientContext { * images and 20 tags. * @summary Add the specified predicted images to the set of training images. * @param projectId The project id. - * @param batch Image and tag ids. Limted to 64 images and 20 tags per batch. + * @param batch Image and tag ids. Limited to 64 images and 20 tags per batch. * @param [options] The optional parameters * @returns Promise */ createImagesFromPredictions(projectId: string, batch: Models.ImageIdCreateBatch, options?: msRest.RequestOptionsBase): Promise; /** * @param projectId The project id. - * @param batch Image and tag ids. Limted to 64 images and 20 tags per batch. + * @param batch Image and tag ids. Limited to 64 images and 20 tags per batch. * @param callback The callback */ createImagesFromPredictions(projectId: string, batch: Models.ImageIdCreateBatch, callback: msRest.ServiceCallback): void; /** * @param projectId The project id. - * @param batch Image and tag ids. Limted to 64 images and 20 tags per batch. + * @param batch Image and tag ids. Limited to 64 images and 20 tags per batch. * @param options The optional parameters * @param callback The callback */ @@ -608,23 +611,20 @@ class TrainingAPIClient extends TrainingAPIClientContext { /** * @summary Quick test an image url. * @param projectId The project to evaluate against. - * @param imageUrl An {Iris.Web.Api.Models.ImageUrl} that contains the url of the image to be - * evaluated. + * @param imageUrl An ImageUrl that contains the url of the image to be evaluated. * @param [options] The optional parameters * @returns Promise */ quickTestImageUrl(projectId: string, imageUrl: Models.ImageUrl, options?: Models.TrainingAPIClientQuickTestImageUrlOptionalParams): Promise; /** * @param projectId The project to evaluate against. - * @param imageUrl An {Iris.Web.Api.Models.ImageUrl} that contains the url of the image to be - * evaluated. + * @param imageUrl An ImageUrl that contains the url of the image to be evaluated. * @param callback The callback */ quickTestImageUrl(projectId: string, imageUrl: Models.ImageUrl, callback: msRest.ServiceCallback): void; /** * @param projectId The project to evaluate against. - * @param imageUrl An {Iris.Web.Api.Models.ImageUrl} that contains the url of the image to be - * evaluated. + * @param imageUrl An ImageUrl that contains the url of the image to be evaluated. * @param options The optional parameters * @param callback The callback */ @@ -643,20 +643,23 @@ class TrainingAPIClient extends TrainingAPIClientContext { /** * @summary Quick test an image. * @param projectId The project id. - * @param imageData Binary image data. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports + * images up to 6MB. * @param [options] The optional parameters * @returns Promise */ quickTestImage(projectId: string, imageData: msRest.HttpRequestBody, options?: Models.TrainingAPIClientQuickTestImageOptionalParams): Promise; /** * @param projectId The project id. - * @param imageData Binary image data. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports + * images up to 6MB. * @param callback The callback */ quickTestImage(projectId: string, imageData: msRest.HttpRequestBody, callback: msRest.ServiceCallback): void; /** * @param projectId The project id. - * @param imageData Binary image data. + * @param imageData Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports + * images up to 6MB. * @param options The optional parameters * @param callback The callback */ @@ -951,6 +954,34 @@ class TrainingAPIClient extends TrainingAPIClientContext { callback) as Promise; } + /** + * @summary Queues project for training. + * @param projectId The project id. + * @param [options] The optional parameters + * @returns Promise + */ + trainProject(projectId: string, options?: Models.TrainingAPIClientTrainProjectOptionalParams): Promise; + /** + * @param projectId The project id. + * @param callback The callback + */ + trainProject(projectId: string, callback: msRest.ServiceCallback): void; + /** + * @param projectId The project id. + * @param options The optional parameters + * @param callback The callback + */ + trainProject(projectId: string, options: Models.TrainingAPIClientTrainProjectOptionalParams, callback: msRest.ServiceCallback): void; + trainProject(projectId: string, options?: Models.TrainingAPIClientTrainProjectOptionalParams | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + projectId, + options + }, + trainProjectOperationSpec, + callback) as Promise; + } + /** * @summary Get iterations for the project. * @param projectId The project id. @@ -1080,31 +1111,75 @@ class TrainingAPIClient extends TrainingAPIClientContext { } /** - * @summary Queues project for training. + * @summary Publish a specific iteration. * @param projectId The project id. + * @param iterationId The iteration id. + * @param publishName The name to give the published iteration. + * @param predictionId The id of the prediction resource to publish to. * @param [options] The optional parameters - * @returns Promise + * @returns Promise */ - trainProject(projectId: string, options?: msRest.RequestOptionsBase): Promise; + publishIteration(projectId: string, iterationId: string, publishName: string, predictionId: string, options?: msRest.RequestOptionsBase): Promise; /** * @param projectId The project id. + * @param iterationId The iteration id. + * @param publishName The name to give the published iteration. + * @param predictionId The id of the prediction resource to publish to. * @param callback The callback */ - trainProject(projectId: string, callback: msRest.ServiceCallback): void; + publishIteration(projectId: string, iterationId: string, publishName: string, predictionId: string, callback: msRest.ServiceCallback): void; /** * @param projectId The project id. + * @param iterationId The iteration id. + * @param publishName The name to give the published iteration. + * @param predictionId The id of the prediction resource to publish to. * @param options The optional parameters * @param callback The callback */ - trainProject(projectId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; - trainProject(projectId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + publishIteration(projectId: string, iterationId: string, publishName: string, predictionId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + publishIteration(projectId: string, iterationId: string, publishName: string, predictionId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { return this.sendOperationRequest( { projectId, + iterationId, + publishName, + predictionId, options }, - trainProjectOperationSpec, - callback) as Promise; + publishIterationOperationSpec, + callback) as Promise; + } + + /** + * @summary Unpublish a specific iteration. + * @param projectId The project id. + * @param iterationId The iteration id. + * @param [options] The optional parameters + * @returns Promise + */ + unpublishIteration(projectId: string, iterationId: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param projectId The project id. + * @param iterationId The iteration id. + * @param callback The callback + */ + unpublishIteration(projectId: string, iterationId: string, callback: msRest.ServiceCallback): void; + /** + * @param projectId The project id. + * @param iterationId The iteration id. + * @param options The optional parameters + * @param callback The callback + */ + unpublishIteration(projectId: string, iterationId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + unpublishIteration(projectId: string, iterationId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.sendOperationRequest( + { + projectId, + iterationId, + options + }, + unpublishIterationOperationSpec, + callback) as Promise; } /** @@ -1144,7 +1219,7 @@ class TrainingAPIClient extends TrainingAPIClientContext { * @param projectId The project id. * @param iterationId The iteration id. * @param platform The target platform. Possible values include: 'CoreML', 'TensorFlow', - * 'DockerFile', 'ONNX' + * 'DockerFile', 'ONNX', 'VAIDK' * @param [options] The optional parameters * @returns Promise */ @@ -1153,7 +1228,7 @@ class TrainingAPIClient extends TrainingAPIClientContext { * @param projectId The project id. * @param iterationId The iteration id. * @param platform The target platform. Possible values include: 'CoreML', 'TensorFlow', - * 'DockerFile', 'ONNX' + * 'DockerFile', 'ONNX', 'VAIDK' * @param callback The callback */ exportIteration(projectId: string, iterationId: string, platform: Models.Platform, callback: msRest.ServiceCallback): void; @@ -1161,7 +1236,7 @@ class TrainingAPIClient extends TrainingAPIClientContext { * @param projectId The project id. * @param iterationId The iteration id. * @param platform The target platform. Possible values include: 'CoreML', 'TensorFlow', - * 'DockerFile', 'ONNX' + * 'DockerFile', 'ONNX', 'VAIDK' * @param options The optional parameters * @param callback The callback */ @@ -1365,7 +1440,9 @@ const getDomainsOperationSpec: msRest.OperationSpec = { } } }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -1384,7 +1461,9 @@ const getDomainOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.Domain }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -1412,7 +1491,9 @@ const getTaggedImageCountOperationSpec: msRest.OperationSpec = { } } }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -1439,7 +1520,9 @@ const getUntaggedImageCountOperationSpec: msRest.OperationSpec = { } } }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -1465,7 +1548,9 @@ const createImageTagsOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.ImageTagCreateSummary }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -1486,7 +1571,9 @@ const deleteImageTagsOperationSpec: msRest.OperationSpec = { ], responses: { 204: {}, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -1512,7 +1599,9 @@ const createImageRegionsOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.ImageRegionCreateSummary }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -1532,7 +1621,9 @@ const deleteImageRegionsOperationSpec: msRest.OperationSpec = { ], responses: { 204: {}, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -1546,7 +1637,7 @@ const getTaggedImagesOperationSpec: msRest.OperationSpec = { ], queryParameters: [ Parameters.iterationId0, - Parameters.tagIds0, + Parameters.tagIds2, Parameters.orderBy, Parameters.take, Parameters.skip @@ -1569,7 +1660,9 @@ const getTaggedImagesOperationSpec: msRest.OperationSpec = { } } }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -1605,7 +1698,9 @@ const getUntaggedImagesOperationSpec: msRest.OperationSpec = { } } }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -1639,7 +1734,9 @@ const getImagesByIdsOperationSpec: msRest.OperationSpec = { } } }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -1652,7 +1749,7 @@ const createImagesFromDataOperationSpec: msRest.OperationSpec = { Parameters.projectId ], queryParameters: [ - Parameters.tagIds0 + Parameters.tagIds2 ], headerParameters: [ Parameters.apiKey @@ -1665,7 +1762,9 @@ const createImagesFromDataOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.ImageCreateSummary }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -1678,14 +1777,16 @@ const deleteImagesOperationSpec: msRest.OperationSpec = { Parameters.projectId ], queryParameters: [ - Parameters.imageIds0 + Parameters.imageIds2 ], headerParameters: [ Parameters.apiKey ], responses: { 204: {}, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -1711,7 +1812,9 @@ const createImagesFromFilesOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.ImageCreateSummary }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -1737,7 +1840,9 @@ const createImagesFromUrlsOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.ImageCreateSummary }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -1763,14 +1868,16 @@ const createImagesFromPredictionsOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.ImageCreateSummary }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; const getImageRegionProposalsOperationSpec: msRest.OperationSpec = { httpMethod: "POST", - path: "{projectId}/images/{imageId}/regionproposals", + path: "projects/{projectId}/images/{imageId}/regionproposals", urlParameters: [ Parameters.endpoint, Parameters.projectId, @@ -1783,7 +1890,9 @@ const getImageRegionProposalsOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.ImageRegionProposal }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -1803,7 +1912,9 @@ const deletePredictionOperationSpec: msRest.OperationSpec = { ], responses: { 204: {}, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -1832,7 +1943,9 @@ const quickTestImageUrlOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.ImagePrediction }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -1858,7 +1971,9 @@ const quickTestImageOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.ImagePrediction }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -1884,7 +1999,9 @@ const queryPredictionsOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.PredictionQueryResult }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -1908,7 +2025,9 @@ const getIterationPerformanceOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.IterationPerformance }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -1922,7 +2041,7 @@ const getImagePerformancesOperationSpec: msRest.OperationSpec = { Parameters.iterationId1 ], queryParameters: [ - Parameters.tagIds0, + Parameters.tagIds2, Parameters.orderBy, Parameters.take, Parameters.skip @@ -1945,7 +2064,9 @@ const getImagePerformancesOperationSpec: msRest.OperationSpec = { } } }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -1973,7 +2094,9 @@ const getImagePerformanceCountOperationSpec: msRest.OperationSpec = { } } }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -2002,7 +2125,9 @@ const getProjectsOperationSpec: msRest.OperationSpec = { } } }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -2017,7 +2142,8 @@ const createProjectOperationSpec: msRest.OperationSpec = { Parameters.name, Parameters.description, Parameters.domainId1, - Parameters.classificationType + Parameters.classificationType, + Parameters.targetExportPlatforms ], headerParameters: [ Parameters.apiKey @@ -2026,7 +2152,9 @@ const createProjectOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.Project }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -2045,7 +2173,9 @@ const getProjectOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.Project }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -2062,7 +2192,9 @@ const deleteProjectOperationSpec: msRest.OperationSpec = { ], responses: { 204: {}, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -2088,7 +2220,36 @@ const updateProjectOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.Project }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } + }, + serializer +}; + +const trainProjectOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "projects/{projectId}/train", + urlParameters: [ + Parameters.endpoint, + Parameters.projectId + ], + queryParameters: [ + Parameters.trainingType, + Parameters.reservedBudgetInHours, + Parameters.forceTrain, + Parameters.notificationEmailAddress + ], + headerParameters: [ + Parameters.apiKey + ], + responses: { + 200: { + bodyMapper: Mappers.Iteration + }, + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -2118,7 +2279,9 @@ const getIterationsOperationSpec: msRest.OperationSpec = { } } }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -2138,7 +2301,9 @@ const getIterationOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.Iteration }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -2156,7 +2321,9 @@ const deleteIterationOperationSpec: msRest.OperationSpec = { ], responses: { 204: {}, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -2183,26 +2350,67 @@ const updateIterationOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.Iteration }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; -const trainProjectOperationSpec: msRest.OperationSpec = { +const publishIterationOperationSpec: msRest.OperationSpec = { httpMethod: "POST", - path: "projects/{projectId}/train", + path: "projects/{projectId}/iterations/{iterationId}/publish", urlParameters: [ Parameters.endpoint, - Parameters.projectId + Parameters.projectId, + Parameters.iterationId1 + ], + queryParameters: [ + Parameters.publishName, + Parameters.predictionId ], headerParameters: [ Parameters.apiKey ], responses: { 200: { - bodyMapper: Mappers.Iteration + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Boolean" + } + } }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } + }, + serializer +}; + +const unpublishIterationOperationSpec: msRest.OperationSpec = { + httpMethod: "DELETE", + path: "projects/{projectId}/iterations/{iterationId}/publish", + urlParameters: [ + Parameters.endpoint, + Parameters.projectId, + Parameters.iterationId1 + ], + headerParameters: [ + Parameters.apiKey + ], + responses: { + 200: { + bodyMapper: { + serializedName: "parsedResponse", + type: { + name: "Boolean" + } + } + }, + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -2233,7 +2441,9 @@ const getExportsOperationSpec: msRest.OperationSpec = { } } }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -2257,7 +2467,9 @@ const exportIterationOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.ExportModel }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -2280,7 +2492,9 @@ const getTagOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.Tag }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -2298,7 +2512,9 @@ const deleteTagOperationSpec: msRest.OperationSpec = { ], responses: { 204: {}, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -2325,7 +2541,9 @@ const updateTagOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.Tag }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -2358,7 +2576,9 @@ const getTagsOperationSpec: msRest.OperationSpec = { } } }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; @@ -2382,7 +2602,9 @@ const createTagOperationSpec: msRest.OperationSpec = { 200: { bodyMapper: Mappers.Tag }, - default: {} + default: { + bodyMapper: Mappers.CustomVisionError + } }, serializer }; diff --git a/packages/@azure/cognitiveservices-customvision-training/lib/trainingAPIClientContext.ts b/packages/@azure/cognitiveservices-customvision-training/lib/trainingAPIClientContext.ts index db614b461a96..a3a9e09ecb36 100644 --- a/packages/@azure/cognitiveservices-customvision-training/lib/trainingAPIClientContext.ts +++ b/packages/@azure/cognitiveservices-customvision-training/lib/trainingAPIClientContext.ts @@ -19,8 +19,8 @@ export class TrainingAPIClientContext extends msRest.ServiceClient { /** * Initializes a new instance of the TrainingAPIClientContext class. - * @param apiKey - * @param endpoint Supported Cognitive Services endpoints + * @param apiKey API key. + * @param endpoint Supported Cognitive Services endpoints. * @param [options] The parameter options */ constructor(apiKey: string, endpoint: string, options?: msRest.ServiceClientOptions) { diff --git a/packages/@azure/cognitiveservices-customvision-training/package.json b/packages/@azure/cognitiveservices-customvision-training/package.json index 9ee51ea8e8e1..597a8c0a508b 100644 --- a/packages/@azure/cognitiveservices-customvision-training/package.json +++ b/packages/@azure/cognitiveservices-customvision-training/package.json @@ -51,6 +51,5 @@ "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/cognitiveservices-customvision-training.js.map'\" -o ./dist/cognitiveservices-customvision-training.min.js ./dist/cognitiveservices-customvision-training.js", "prepack": "npm install && npm run build" }, - "sideEffects": false, - "authPublish": true + "sideEffects": false }