Skip to content

Commit

Permalink
Generated from 984c12a568b2dd36acb521eb3b1c00fbd5b42995 (#2575)
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 Jun 21, 2018
1 parent 223ddb6 commit b957717
Show file tree
Hide file tree
Showing 60 changed files with 1,429 additions and 254 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,72 @@
# regenerated.
# --------------------------------------------------------------------------

from .word import Word
from .line import Line
from .recognition_result import RecognitionResult
from .text_operation_result import TextOperationResult
from .face_rectangle import FaceRectangle
from .celebrities_model import CelebritiesModel
from .category_detail import CategoryDetail
from .category import Category
from .adult_info import AdultInfo
from .color_info import ColorInfo
from .image_type import ImageType
from .image_tag import ImageTag
from .image_caption import ImageCaption
from .image_metadata import ImageMetadata
from .image_description_details import ImageDescriptionDetails
from .face_description import FaceDescription
from .image_analysis import ImageAnalysis
from .ocr_word import OcrWord
from .ocr_line import OcrLine
from .ocr_region import OcrRegion
from .ocr_result import OcrResult
from .model_description import ModelDescription
from .list_models_result import ListModelsResult
from .domain_model_results import DomainModelResults
from .image_description import ImageDescription
from .tag_result import TagResult
from .computer_vision_error import ComputerVisionError, ComputerVisionErrorException
from .image_url import ImageUrl
try:
from .word_py3 import Word
from .line_py3 import Line
from .recognition_result_py3 import RecognitionResult
from .text_operation_result_py3 import TextOperationResult
from .face_rectangle_py3 import FaceRectangle
from .celebrities_model_py3 import CelebritiesModel
from .category_detail_py3 import CategoryDetail
from .category_py3 import Category
from .adult_info_py3 import AdultInfo
from .color_info_py3 import ColorInfo
from .image_type_py3 import ImageType
from .image_tag_py3 import ImageTag
from .image_caption_py3 import ImageCaption
from .image_metadata_py3 import ImageMetadata
from .image_description_details_py3 import ImageDescriptionDetails
from .face_description_py3 import FaceDescription
from .image_analysis_py3 import ImageAnalysis
from .ocr_word_py3 import OcrWord
from .ocr_line_py3 import OcrLine
from .ocr_region_py3 import OcrRegion
from .ocr_result_py3 import OcrResult
from .model_description_py3 import ModelDescription
from .list_models_result_py3 import ListModelsResult
from .domain_model_results_py3 import DomainModelResults
from .image_description_py3 import ImageDescription
from .tag_result_py3 import TagResult
from .computer_vision_error_py3 import ComputerVisionError, ComputerVisionErrorException
from .image_url_py3 import ImageUrl
except (SyntaxError, ImportError):
from .word import Word
from .line import Line
from .recognition_result import RecognitionResult
from .text_operation_result import TextOperationResult
from .face_rectangle import FaceRectangle
from .celebrities_model import CelebritiesModel
from .category_detail import CategoryDetail
from .category import Category
from .adult_info import AdultInfo
from .color_info import ColorInfo
from .image_type import ImageType
from .image_tag import ImageTag
from .image_caption import ImageCaption
from .image_metadata import ImageMetadata
from .image_description_details import ImageDescriptionDetails
from .face_description import FaceDescription
from .image_analysis import ImageAnalysis
from .ocr_word import OcrWord
from .ocr_line import OcrLine
from .ocr_region import OcrRegion
from .ocr_result import OcrResult
from .model_description import ModelDescription
from .list_models_result import ListModelsResult
from .domain_model_results import DomainModelResults
from .image_description import ImageDescription
from .tag_result import TagResult
from .computer_vision_error import ComputerVisionError, ComputerVisionErrorException
from .image_url import ImageUrl
from .computer_vision_api_enums import (
TextOperationStatusCodes,
Gender,
ComputerVisionErrorCodes,
VisualFeatureTypes,
OcrLanguages,
AzureRegions,
Details,
Language1,
DomainModels,
)

Expand Down Expand Up @@ -78,11 +108,11 @@
'ComputerVisionError', 'ComputerVisionErrorException',
'ImageUrl',
'TextOperationStatusCodes',
'Gender',
'ComputerVisionErrorCodes',
'VisualFeatureTypes',
'OcrLanguages',
'AzureRegions',
'Details',
'Language1',
'DomainModels',
]
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ class AdultInfo(Model):
'racy_score': {'key': 'racyScore', 'type': 'float'},
}

def __init__(self, is_adult_content=None, is_racy_content=None, adult_score=None, racy_score=None):
super(AdultInfo, self).__init__()
self.is_adult_content = is_adult_content
self.is_racy_content = is_racy_content
self.adult_score = adult_score
self.racy_score = racy_score
def __init__(self, **kwargs):
super(AdultInfo, self).__init__(**kwargs)
self.is_adult_content = kwargs.get('is_adult_content', None)
self.is_racy_content = kwargs.get('is_racy_content', None)
self.adult_score = kwargs.get('adult_score', None)
self.racy_score = kwargs.get('racy_score', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class AdultInfo(Model):
"""An object describing whether the image contains adult-oriented content
and/or is racy.
:param is_adult_content: A value indicating if the image contains
adult-oriented content.
:type is_adult_content: bool
:param is_racy_content: A value indicating if the image is race.
:type is_racy_content: bool
:param adult_score: Score from 0 to 1 that indicates how much of adult
content is within the image.
:type adult_score: float
:param racy_score: Score from 0 to 1 that indicates how suggestive is the
image.
:type racy_score: float
"""

_attribute_map = {
'is_adult_content': {'key': 'isAdultContent', 'type': 'bool'},
'is_racy_content': {'key': 'isRacyContent', 'type': 'bool'},
'adult_score': {'key': 'adultScore', 'type': 'float'},
'racy_score': {'key': 'racyScore', 'type': 'float'},
}

def __init__(self, *, is_adult_content: bool=None, is_racy_content: bool=None, adult_score: float=None, racy_score: float=None, **kwargs) -> None:
super(AdultInfo, self).__init__(**kwargs)
self.is_adult_content = is_adult_content
self.is_racy_content = is_racy_content
self.adult_score = adult_score
self.racy_score = racy_score
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Category(Model):
:type name: str
:param score: Scoring of the category.
:type score: float
:param detail: Additional category detail if available.
:param detail:
:type detail:
~azure.cognitiveservices.vision.computervision.models.CategoryDetail
"""
Expand All @@ -30,8 +30,8 @@ class Category(Model):
'detail': {'key': 'detail', 'type': 'CategoryDetail'},
}

def __init__(self, name=None, score=None, detail=None):
super(Category, self).__init__()
self.name = name
self.score = score
self.detail = detail
def __init__(self, **kwargs):
super(Category, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
self.score = kwargs.get('score', None)
self.detail = kwargs.get('detail', None)
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ class CategoryDetail(Model):
'celebrities': {'key': 'celebrities', 'type': '[CelebritiesModel]'},
}

def __init__(self, celebrities=None):
super(CategoryDetail, self).__init__()
self.celebrities = celebrities
def __init__(self, **kwargs):
super(CategoryDetail, self).__init__(**kwargs)
self.celebrities = kwargs.get('celebrities', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class CategoryDetail(Model):
"""An object describing additional category details.
:param celebrities: An array of celebrities if any identified.
:type celebrities:
list[~azure.cognitiveservices.vision.computervision.models.CelebritiesModel]
"""

_attribute_map = {
'celebrities': {'key': 'celebrities', 'type': '[CelebritiesModel]'},
}

def __init__(self, *, celebrities=None, **kwargs) -> None:
super(CategoryDetail, self).__init__(**kwargs)
self.celebrities = celebrities
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class Category(Model):
"""An object describing identified category.
:param name: Name of the category.
:type name: str
:param score: Scoring of the category.
:type score: float
:param detail:
:type detail:
~azure.cognitiveservices.vision.computervision.models.CategoryDetail
"""

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'score': {'key': 'score', 'type': 'float'},
'detail': {'key': 'detail', 'type': 'CategoryDetail'},
}

def __init__(self, *, name: str=None, score: float=None, detail=None, **kwargs) -> None:
super(Category, self).__init__(**kwargs)
self.name = name
self.score = score
self.detail = detail
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class CelebritiesModel(Model):
'face_rectangle': {'key': 'faceRectangle', 'type': 'FaceRectangle'},
}

def __init__(self, name=None, confidence=None, face_rectangle=None):
super(CelebritiesModel, self).__init__()
self.name = name
self.confidence = confidence
self.face_rectangle = face_rectangle
def __init__(self, **kwargs):
super(CelebritiesModel, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
self.confidence = kwargs.get('confidence', None)
self.face_rectangle = kwargs.get('face_rectangle', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class CelebritiesModel(Model):
"""An object describing possible celebrity identification.
:param name: Name of the celebrity.
:type name: str
:param confidence: Level of confidence ranging from 0 to 1.
:type confidence: float
:param face_rectangle:
:type face_rectangle:
~azure.cognitiveservices.vision.computervision.models.FaceRectangle
"""

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'confidence': {'key': 'confidence', 'type': 'float'},
'face_rectangle': {'key': 'faceRectangle', 'type': 'FaceRectangle'},
}

def __init__(self, *, name: str=None, confidence: float=None, face_rectangle=None, **kwargs) -> None:
super(CelebritiesModel, self).__init__(**kwargs)
self.name = name
self.confidence = confidence
self.face_rectangle = face_rectangle
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ class ColorInfo(Model):
'is_bw_img': {'key': 'isBWImg', 'type': 'bool'},
}

def __init__(self, dominant_color_foreground=None, dominant_color_background=None, dominant_colors=None, accent_color=None, is_bw_img=None):
super(ColorInfo, self).__init__()
self.dominant_color_foreground = dominant_color_foreground
self.dominant_color_background = dominant_color_background
self.dominant_colors = dominant_colors
self.accent_color = accent_color
self.is_bw_img = is_bw_img
def __init__(self, **kwargs):
super(ColorInfo, self).__init__(**kwargs)
self.dominant_color_foreground = kwargs.get('dominant_color_foreground', None)
self.dominant_color_background = kwargs.get('dominant_color_background', None)
self.dominant_colors = kwargs.get('dominant_colors', None)
self.accent_color = kwargs.get('accent_color', None)
self.is_bw_img = kwargs.get('is_bw_img', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.serialization import Model


class ColorInfo(Model):
"""An object providing additional metadata describing color attributes.
:param dominant_color_foreground: Possible dominant foreground color.
:type dominant_color_foreground: str
:param dominant_color_background: Possible dominant background color.
:type dominant_color_background: str
:param dominant_colors: An array of possible dominant colors.
:type dominant_colors: list[str]
:param accent_color: Possible accent color.
:type accent_color: str
:param is_bw_img: A value indicating if the image is black and white.
:type is_bw_img: bool
"""

_attribute_map = {
'dominant_color_foreground': {'key': 'dominantColorForeground', 'type': 'str'},
'dominant_color_background': {'key': 'dominantColorBackground', 'type': 'str'},
'dominant_colors': {'key': 'dominantColors', 'type': '[str]'},
'accent_color': {'key': 'accentColor', 'type': 'str'},
'is_bw_img': {'key': 'isBWImg', 'type': 'bool'},
}

def __init__(self, *, dominant_color_foreground: str=None, dominant_color_background: str=None, dominant_colors=None, accent_color: str=None, is_bw_img: bool=None, **kwargs) -> None:
super(ColorInfo, self).__init__(**kwargs)
self.dominant_color_foreground = dominant_color_foreground
self.dominant_color_background = dominant_color_background
self.dominant_colors = dominant_colors
self.accent_color = accent_color
self.is_bw_img = is_bw_img
Loading

0 comments on commit b957717

Please sign in to comment.