Skip to content

Commit e609451

Browse files
author
SDKAuto
committed
CodeGen from PR 10805 in Azure/azure-rest-api-specs
Merge cba165e5e7a0be904ae9584f1bcbd92c8ae07a9f into 731b282
1 parent 98988d2 commit e609451

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+3287
-1634
lines changed

sdk/cognitiveservices/azure-cognitiveservices-formrecognizer/azure/cognitiveservices/formrecognizer/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
# regenerated.
1010
# --------------------------------------------------------------------------
1111

12-
from .form_recognizer_client import FormRecognizerClient
13-
from .version import VERSION
12+
from ._configuration import FormRecognizerClientConfiguration
13+
from ._form_recognizer_client import FormRecognizerClient
14+
__all__ = ['FormRecognizerClient', 'FormRecognizerClientConfiguration']
1415

15-
__all__ = ['FormRecognizerClient']
16+
from .version import VERSION
1617

1718
__version__ = VERSION
1819

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest import Configuration
13+
14+
from .version import VERSION
15+
16+
17+
class FormRecognizerClientConfiguration(Configuration):
18+
"""Configuration for FormRecognizerClient
19+
Note that all parameters used to create this instance are saved as instance
20+
attributes.
21+
22+
:param endpoint: Supported Cognitive Services endpoints (protocol and
23+
hostname, for example: https://westus2.api.cognitive.microsoft.com).
24+
:type endpoint: str
25+
:param credentials: Subscription credentials which uniquely identify
26+
client subscription.
27+
:type credentials: None
28+
"""
29+
30+
def __init__(
31+
self, endpoint, credentials):
32+
33+
if endpoint is None:
34+
raise ValueError("Parameter 'endpoint' must not be None.")
35+
if credentials is None:
36+
raise ValueError("Parameter 'credentials' must not be None.")
37+
base_url = '{endpoint}/formrecognizer/v2.0'
38+
39+
super(FormRecognizerClientConfiguration, self).__init__(base_url)
40+
41+
# Starting Autorest.Python 4.0.64, make connection pool activated by default
42+
self.keep_alive = True
43+
44+
self.add_user_agent('azure-cognitiveservices-formrecognizer/{}'.format(VERSION))
45+
46+
self.endpoint = endpoint
47+
self.credentials = credentials
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
from msrest.service_client import SDKClient
13+
from msrest import Serializer, Deserializer
14+
15+
from ._configuration import FormRecognizerClientConfiguration
16+
from .operations import FormRecognizerClientOperationsMixin
17+
from . import models
18+
19+
20+
class FormRecognizerClient(FormRecognizerClientOperationsMixin, SDKClient):
21+
"""Extracts information from forms and images into structured data.
22+
23+
:ivar config: Configuration for client.
24+
:vartype config: FormRecognizerClientConfiguration
25+
26+
:param endpoint: Supported Cognitive Services endpoints (protocol and
27+
hostname, for example: https://westus2.api.cognitive.microsoft.com).
28+
:type endpoint: str
29+
:param credentials: Subscription credentials which uniquely identify
30+
client subscription.
31+
:type credentials: None
32+
"""
33+
34+
def __init__(
35+
self, endpoint, credentials):
36+
37+
self.config = FormRecognizerClientConfiguration(endpoint, credentials)
38+
super(FormRecognizerClient, self).__init__(self.config.credentials, self.config)
39+
40+
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
41+
self.api_version = '2.0'
42+
self._serialize = Serializer(client_models)
43+
self._deserialize = Deserializer(client_models)
44+

0 commit comments

Comments
 (0)