Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Commit

Permalink
Generated from 984c12a568b2dd36acb521eb3b1c00fbd5b42995
Browse files Browse the repository at this point in the history
Update CognitiveService ComputerVision Swagger for new extensions (#1)

* Merged PR 17875: Add new languages

Add new languages

Also tidy up the enum definition so that AutoRest generates C# that actually compiles

* Merged PR 17942: Replace fancy quotes with plain single quotes

Make javac compile without complaint even without setting the codepage to utf-8 by dropping the gratuitous typographic quotes.

* Merged PR 17956: Rename url argument for overloaded endpoint to imageUrl

This name will become the name of the argument in Python.  Since you can used named arguments in Python, give them less ambiguous names.

* Changes to make --azure-validator run more cleanly

Errors Fixed
* XmsExamplesRequired/D5001/Documentation (7)
* XmsPathsMustOverloadPaths/R2058/SDKViolation (7)

Errors Ignored
* SecurityDefinitionsStructure/R2054/SDKViolation (1) - API Key scheme for Cognitive Services
* APIVersionPattern/R3012/ARMViolation (1) - Keeping with the Cognitive Services numbering scheme
* OperationsAPIImplementation/R3023/ARMViolation (1) - Not sure what this is

Warnings Fixed
* XmsEnumValidation/R2018/SDKViolation (1)
* DescriptionAndTitleMissing/R4000/SDKViolation (1)

Warnings Ignored
* DescriptionAndTitleMissing/R4000/SDKViolation (35) - description is contained in #ref
* EnumInsteadOfBoolean/R3018/ARMViolation (5) - fix would be a breaking change
* ListInOperationName/R1003/SDKViolation (1) - fix would be a breaking change
* LongRunningOperationsWithLongRunningExtension/R2007/SDKViolation (2) - endpoint will not ultimately yield a 200, as this extension would require
* NonApplicationJsonType/R2004/ARMViolation (15) - fix would be breaking change
* PageableOperation/R2029/SDKViolation (1) - not actually pageable
* ParameterNotDefinedInGlobalParameters/R2015/SDKViolation (1) - All our own parameters specify x-ms-parameter-location
* PostOperationIdContainsUrlVerb/R2066/SDKViolation (7) - fix would be breaking change
  • Loading branch information
AutorestCI committed May 16, 2018
1 parent 1ef50ea commit 489ad7c
Show file tree
Hide file tree
Showing 13 changed files with 324 additions and 216 deletions.
42 changes: 21 additions & 21 deletions lib/services/computerVision/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
The MIT License (MIT)

Copyright (c) 2018 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
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
The MIT License (MIT)
Copyright (c) 2018 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
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
170 changes: 103 additions & 67 deletions lib/services/computerVision/lib/computerVisionAPIClient.d.ts

Large diffs are not rendered by default.

264 changes: 168 additions & 96 deletions lib/services/computerVision/lib/computerVisionAPIClient.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/services/computerVision/lib/models/category.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Category {
* Create a Category.
* @member {string} [name] Name of the category.
* @member {number} [score] Scoring of the category.
* @member {object} [detail] Additional category detail if available.
* @member {object} [detail]
* @member {array} [detail.celebrities] An array of celebrities if any
* identified.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class DomainModelResults {
* @member {array} [celebrities] An array of possible celebritied identified
* in the image.
* @member {string} [requestId] Id of the REST API request.
* @member {object} [metadata] Additional image metadata
* @member {object} [metadata]
* @member {number} [metadata.width] Image width
* @member {number} [metadata.height] Image height
* @member {string} [metadata.format] Image format
Expand Down
3 changes: 2 additions & 1 deletion lib/services/computerVision/lib/models/faceDescription.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ class FaceDescription {
required: false,
serializedName: 'gender',
type: {
name: 'String'
name: 'Enum',
allowedValues: [ 'Male', 'Female' ]
}
},
faceRectangle: {
Expand Down
14 changes: 6 additions & 8 deletions lib/services/computerVision/lib/models/imageAnalysis.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ class ImageAnalysis {
/**
* Create a ImageAnalysis.
* @member {array} [categories] An array indicating identified categories.
* @member {object} [adult] A property scoring on whether the image is
* adult-oriented and/or racy.
* @member {object} [adult]
* @member {boolean} [adult.isAdultContent] A value indicating if the image
* contains adult-oriented content.
* @member {boolean} [adult.isRacyContent] A value indicating if the image is
Expand All @@ -30,7 +29,7 @@ class ImageAnalysis {
* much of adult content is within the image.
* @member {number} [adult.racyScore] Score from 0 to 1 that indicates how
* suggestive is the image.
* @member {object} [color] A property scoring on color spectrums.
* @member {object} [color]
* @member {string} [color.dominantColorForeground] Possible dominant
* foreground color.
* @member {string} [color.dominantColorBackground] Possible dominant
Expand All @@ -40,25 +39,24 @@ class ImageAnalysis {
* @member {string} [color.accentColor] Possible accent color.
* @member {boolean} [color.isBWImg] A value indicating if the image is black
* and white.
* @member {object} [imageType] A property indicating type of image (whether
* it's clipart or line drawing)
* @member {object} [imageType]
* @member {number} [imageType.clipArtType] Confidence level that the image
* is a clip art.
* @member {number} [imageType.lineDrawingType] Confidence level that the
* image is a line drawing.
* @member {array} [tags] A list of tags with confidence level.
* @member {object} [description] Description of the image.
* @member {object} [description]
* @member {array} [description.tags] A collection of image tags.
* @member {array} [description.captions] A list of captions, sorted by
* confidence level.
* @member {string} [description.requestId] Id of the REST API request.
* @member {object} [description.metadata] Image metadata
* @member {object} [description.metadata]
* @member {number} [description.metadata.width] Image width
* @member {number} [description.metadata.height] Image height
* @member {string} [description.metadata.format] Image format
* @member {array} [faces] An array of possible faces within the image.
* @member {string} [requestId] Id of the request for tracking purposes.
* @member {object} [metadata] Image metadata
* @member {object} [metadata]
* @member {number} [metadata.width] Image width
* @member {number} [metadata.height] Image height
* @member {string} [metadata.format] Image format
Expand Down
2 changes: 1 addition & 1 deletion lib/services/computerVision/lib/models/imageDescription.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ImageDescription {
* @member {array} [tags] A collection of image tags.
* @member {array} [captions] A list of captions, sorted by confidence level.
* @member {string} [requestId] Id of the REST API request.
* @member {object} [metadata] Image metadata
* @member {object} [metadata]
* @member {number} [metadata.width] Image width
* @member {number} [metadata.height] Image height
* @member {string} [metadata.format] Image format
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ImageDescriptionDetails {
* @member {array} [tags] A collection of image tags.
* @member {array} [captions] A list of captions, sorted by confidence level.
* @member {string} [requestId] Id of the REST API request.
* @member {object} [metadata] Image metadata
* @member {object} [metadata]
* @member {number} [metadata.width] Image width
* @member {number} [metadata.height] Image height
* @member {string} [metadata.format] Image format
Expand Down
2 changes: 1 addition & 1 deletion lib/services/computerVision/lib/models/imageUrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class ImageUrl {
/**
* Create a ImageUrl.
* @member {string} url
* @member {string} url Publicly reachable URL of an image
*/
constructor() {
}
Expand Down
26 changes: 12 additions & 14 deletions lib/services/computerVision/lib/models/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export interface CategoryDetail {
*
* @member {string} [name] Name of the category.
* @member {number} [score] Scoring of the category.
* @member {object} [detail] Additional category detail if available.
* @member {object} [detail]
* @member {array} [detail.celebrities] An array of celebrities if any
* identified.
*/
Expand Down Expand Up @@ -251,7 +251,7 @@ export interface ImageMetadata {
* @member {array} [tags] A collection of image tags.
* @member {array} [captions] A list of captions, sorted by confidence level.
* @member {string} [requestId] Id of the REST API request.
* @member {object} [metadata] Image metadata
* @member {object} [metadata]
* @member {number} [metadata.width] Image width
* @member {number} [metadata.height] Image height
* @member {string} [metadata.format] Image format
Expand Down Expand Up @@ -295,8 +295,7 @@ export interface FaceDescription {
* Result of AnalyzeImage operation.
*
* @member {array} [categories] An array indicating identified categories.
* @member {object} [adult] A property scoring on whether the image is
* adult-oriented and/or racy.
* @member {object} [adult]
* @member {boolean} [adult.isAdultContent] A value indicating if the image
* contains adult-oriented content.
* @member {boolean} [adult.isRacyContent] A value indicating if the image is
Expand All @@ -305,7 +304,7 @@ export interface FaceDescription {
* much of adult content is within the image.
* @member {number} [adult.racyScore] Score from 0 to 1 that indicates how
* suggestive is the image.
* @member {object} [color] A property scoring on color spectrums.
* @member {object} [color]
* @member {string} [color.dominantColorForeground] Possible dominant
* foreground color.
* @member {string} [color.dominantColorBackground] Possible dominant
Expand All @@ -314,25 +313,24 @@ export interface FaceDescription {
* @member {string} [color.accentColor] Possible accent color.
* @member {boolean} [color.isBWImg] A value indicating if the image is black
* and white.
* @member {object} [imageType] A property indicating type of image (whether
* it's clipart or line drawing)
* @member {object} [imageType]
* @member {number} [imageType.clipArtType] Confidence level that the image is
* a clip art.
* @member {number} [imageType.lineDrawingType] Confidence level that the image
* is a line drawing.
* @member {array} [tags] A list of tags with confidence level.
* @member {object} [description] Description of the image.
* @member {object} [description]
* @member {array} [description.tags] A collection of image tags.
* @member {array} [description.captions] A list of captions, sorted by
* confidence level.
* @member {string} [description.requestId] Id of the REST API request.
* @member {object} [description.metadata] Image metadata
* @member {object} [description.metadata]
* @member {number} [description.metadata.width] Image width
* @member {number} [description.metadata.height] Image height
* @member {string} [description.metadata.format] Image format
* @member {array} [faces] An array of possible faces within the image.
* @member {string} [requestId] Id of the request for tracking purposes.
* @member {object} [metadata] Image metadata
* @member {object} [metadata]
* @member {number} [metadata.width] Image width
* @member {number} [metadata.height] Image height
* @member {string} [metadata.format] Image format
Expand Down Expand Up @@ -474,7 +472,7 @@ export interface ListModelsResult {
* @member {array} [celebrities] An array of possible celebritied identified in
* the image.
* @member {string} [requestId] Id of the REST API request.
* @member {object} [metadata] Additional image metadata
* @member {object} [metadata]
* @member {number} [metadata.width] Image width
* @member {number} [metadata.height] Image height
* @member {string} [metadata.format] Image format
Expand All @@ -495,7 +493,7 @@ export interface DomainModelResults {
* @member {array} [tags] A collection of image tags.
* @member {array} [captions] A list of captions, sorted by confidence level.
* @member {string} [requestId] Id of the REST API request.
* @member {object} [metadata] Image metadata
* @member {object} [metadata]
* @member {number} [metadata.width] Image width
* @member {number} [metadata.height] Image height
* @member {string} [metadata.format] Image format
Expand All @@ -515,7 +513,7 @@ export interface ImageDescription {
*
* @member {array} [tags] A list of tags with confidence level.
* @member {string} [requestId] Id of the REST API request.
* @member {object} [metadata] Image metadata
* @member {object} [metadata]
* @member {number} [metadata.width] Image width
* @member {number} [metadata.height] Image height
* @member {string} [metadata.format] Image format
Expand Down Expand Up @@ -549,7 +547,7 @@ export interface ComputerVisionError {
* @class
* Initializes a new instance of the ImageUrl class.
* @constructor
* @member {string} url
* @member {string} url Publicly reachable URL of an image
*/
export interface ImageUrl {
url: string;
Expand Down
2 changes: 1 addition & 1 deletion lib/services/computerVision/lib/models/tagResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class TagResult {
* Create a TagResult.
* @member {array} [tags] A list of tags with confidence level.
* @member {string} [requestId] Id of the REST API request.
* @member {object} [metadata] Image metadata
* @member {object} [metadata]
* @member {number} [metadata.width] Image width
* @member {number} [metadata.height] Image height
* @member {string} [metadata.format] Image format
Expand Down
9 changes: 6 additions & 3 deletions lib/services/computerVision/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
"name": "azure-cognitiveservices-computervision",
"author": "Microsoft Corporation",
"description": "ComputerVisionAPIClient Library with typescript type definitions for node",
"version": "1.0.1",
"version": "1.0.0-preview",
"dependencies": {
"ms-rest": "^2.3.2"
"ms-rest": "^2.3.3"
},
"keywords": [ "node", "azure" ],
"keywords": [
"node",
"azure"
],
"license": "MIT",
"main": "./lib/computerVisionAPIClient.js",
"types": "./lib/computerVisionAPIClient.d.ts",
Expand Down

0 comments on commit 489ad7c

Please sign in to comment.