Skip to content

Commit f2117cf

Browse files
author
SDKAuto
committed
CodeGen from PR 34069 in Azure/azure-rest-api-specs
Merge ba12d1ec7ac9ce8dee0ab981b67fbef77df4d594 into 477d250a0be7659d4c27a6f704b3216c7e549930
1 parent 9194780 commit f2117cf

Some content is hidden

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

49 files changed

+5638
-3847
lines changed

sdk/healthbot/azure-mgmt-healthbot/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Release History
22

3+
## 1.0.0 (2025-05-12)
4+
5+
change log generation failed!!!
6+
37
## 1.0.0b2 (2022-10-28)
48

59
### Features Added
Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,61 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Health Bot Management Client Library.
4-
This package has been tested with Python 3.7+.
4+
This package has been tested with Python 3.9+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
88

99
_Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_
1010

11-
# Usage
11+
## Getting started
1212

13+
### Prerequisites
1314

14-
To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)
15-
16-
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/)
17-
Code samples for this package can be found at [Health Bot Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
18-
Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
15+
- Python 3.9+ is required to use this package.
16+
- [Azure subscription](https://azure.microsoft.com/free/)
1917

18+
### Install the package
2019

21-
# Provide Feedback
20+
```bash
21+
pip install azure-mgmt-healthbot
22+
pip install azure-identity
23+
```
2224

23-
If you encounter any bugs or have suggestions, please file an issue in the
24-
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
25-
section of the project.
25+
### Authentication
26+
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.
28+
29+
- `AZURE_CLIENT_ID` for Azure client ID.
30+
- `AZURE_TENANT_ID` for Azure tenant ID.
31+
- `AZURE_CLIENT_SECRET` for Azure client secret.
32+
33+
In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`.
34+
35+
With above configuration, client can be authenticated by following code:
36+
37+
```python
38+
from azure.identity import DefaultAzureCredential
39+
from azure.mgmt.healthbot import HealthBotMgmtClient
40+
import os
2641

42+
sub_id = os.getenv("AZURE_SUBSCRIPTION_ID")
43+
client = HealthBotMgmtClient(credential=DefaultAzureCredential(), subscription_id=sub_id)
44+
```
2745

46+
## Examples
2847

48+
Code samples for this package can be found at:
49+
- [Search Health Bot Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com
50+
- [Azure Python Mgmt SDK Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
51+
52+
53+
## Troubleshooting
54+
55+
## Next steps
56+
57+
## Provide Feedback
58+
59+
If you encounter any bugs or have suggestions, please file an issue in the
60+
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
61+
section of the project.
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
{
2-
"commit": "e82a24def11ffc98cc263884f9f1742c99f2df5e",
2+
"commit": "928c03a2a93d9f93a6f244b7d8c4769873cc44b5",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.2",
5-
"use": [
6-
"@autorest/[email protected]",
7-
"@autorest/[email protected]"
8-
],
9-
"autorest_command": "autorest specification/healthbot/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
10-
"readme": "specification/healthbot/resource-manager/readme.md"
4+
"typespec_src": "specification/healthbot/Healthbot.Management",
5+
"@azure-tools/typespec-python": "0.44.2"
116
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"CrossLanguagePackageId": "Microsoft.HealthBot",
3+
"CrossLanguageDefinitionId": {
4+
"azure.mgmt.healthbot.models.Error": "Microsoft.HealthBot.Error",
5+
"azure.mgmt.healthbot.models.ErrorAdditionalInfo": "Microsoft.HealthBot.ErrorAdditionalInfo",
6+
"azure.mgmt.healthbot.models.ErrorDetail": "Microsoft.HealthBot.ErrorDetail",
7+
"azure.mgmt.healthbot.models.Resource": "Azure.ResourceManager.CommonTypes.Resource",
8+
"azure.mgmt.healthbot.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource",
9+
"azure.mgmt.healthbot.models.HealthBot": "Microsoft.HealthBot.HealthBot",
10+
"azure.mgmt.healthbot.models.HealthBotKey": "Microsoft.HealthBot.HealthBotKey",
11+
"azure.mgmt.healthbot.models.HealthBotKeysResponse": "Microsoft.HealthBot.HealthBotKeysResponse",
12+
"azure.mgmt.healthbot.models.HealthBotProperties": "Microsoft.HealthBot.HealthBotProperties",
13+
"azure.mgmt.healthbot.models.HealthBotUpdateParameters": "Microsoft.HealthBot.HealthBotUpdateParameters",
14+
"azure.mgmt.healthbot.models.Identity": "Microsoft.HealthBot.Identity",
15+
"azure.mgmt.healthbot.models.KeyVaultProperties": "Microsoft.HealthBot.KeyVaultProperties",
16+
"azure.mgmt.healthbot.models.OperationDetail": "Microsoft.HealthBot.OperationDetail",
17+
"azure.mgmt.healthbot.models.OperationDisplay": "Microsoft.HealthBot.OperationDisplay",
18+
"azure.mgmt.healthbot.models.Sku": "Microsoft.HealthBot.Sku",
19+
"azure.mgmt.healthbot.models.SystemData": "Azure.ResourceManager.CommonTypes.SystemData",
20+
"azure.mgmt.healthbot.models.UserAssignedIdentity": "Microsoft.HealthBot.UserAssignedIdentity",
21+
"azure.mgmt.healthbot.models.UserAssignedIdentityMap": "Microsoft.HealthBot.UserAssignedIdentityMap",
22+
"azure.mgmt.healthbot.models.CreatedByType": "Azure.ResourceManager.CommonTypes.createdByType",
23+
"azure.mgmt.healthbot.models.SkuName": "Microsoft.HealthBot.SkuName",
24+
"azure.mgmt.healthbot.models.ResourceIdentityType": "Microsoft.HealthBot.ResourceIdentityType",
25+
"azure.mgmt.healthbot.operations.Operations.list": "Microsoft.HealthBot.Operations.list",
26+
"azure.mgmt.healthbot.aio.operations.Operations.list": "Microsoft.HealthBot.Operations.list",
27+
"azure.mgmt.healthbot.operations.HealthBotsOperations.get": "Microsoft.HealthBot.HealthBots.get",
28+
"azure.mgmt.healthbot.aio.operations.HealthBotsOperations.get": "Microsoft.HealthBot.HealthBots.get",
29+
"azure.mgmt.healthbot.operations.HealthBotsOperations.begin_create": "Microsoft.HealthBot.HealthBots.create",
30+
"azure.mgmt.healthbot.aio.operations.HealthBotsOperations.begin_create": "Microsoft.HealthBot.HealthBots.create",
31+
"azure.mgmt.healthbot.operations.HealthBotsOperations.begin_update": "Microsoft.HealthBot.HealthBots.update",
32+
"azure.mgmt.healthbot.aio.operations.HealthBotsOperations.begin_update": "Microsoft.HealthBot.HealthBots.update",
33+
"azure.mgmt.healthbot.operations.HealthBotsOperations.begin_delete": "Microsoft.HealthBot.HealthBots.delete",
34+
"azure.mgmt.healthbot.aio.operations.HealthBotsOperations.begin_delete": "Microsoft.HealthBot.HealthBots.delete",
35+
"azure.mgmt.healthbot.operations.HealthBotsOperations.list_by_resource_group": "Microsoft.HealthBot.HealthBots.listByResourceGroup",
36+
"azure.mgmt.healthbot.aio.operations.HealthBotsOperations.list_by_resource_group": "Microsoft.HealthBot.HealthBots.listByResourceGroup",
37+
"azure.mgmt.healthbot.operations.HealthBotsOperations.list": "Microsoft.HealthBot.HealthBots.list",
38+
"azure.mgmt.healthbot.aio.operations.HealthBotsOperations.list": "Microsoft.HealthBot.HealthBots.list",
39+
"azure.mgmt.healthbot.operations.HealthBotsOperations.list_secrets": "Microsoft.HealthBot.HealthBots.listSecrets",
40+
"azure.mgmt.healthbot.aio.operations.HealthBotsOperations.list_secrets": "Microsoft.HealthBot.HealthBots.listSecrets",
41+
"azure.mgmt.healthbot.operations.HealthBotsOperations.regenerate_api_jwt_secret": "Microsoft.HealthBot.HealthBots.regenerateApiJwtSecret",
42+
"azure.mgmt.healthbot.aio.operations.HealthBotsOperations.regenerate_api_jwt_secret": "Microsoft.HealthBot.HealthBots.regenerateApiJwtSecret"
43+
}
44+
}

sdk/healthbot/azure-mgmt-healthbot/azure/mgmt/healthbot/__init__.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,31 @@
22
# --------------------------------------------------------------------------
33
# Copyright (c) Microsoft Corporation. All rights reserved.
44
# Licensed under the MIT License. See License.txt in the project root for license information.
5-
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Code generated by Microsoft (R) Python Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._health_bot_mgmt_client import HealthBotMgmtClient
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._client import HealthBotClient # type: ignore
1016
from ._version import VERSION
1117

1218
__version__ = VERSION
1319

1420
try:
1521
from ._patch import __all__ as _patch_all
16-
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
22+
from ._patch import *
1723
except ImportError:
1824
_patch_all = []
1925
from ._patch import patch_sdk as _patch_sdk
2026

2127
__all__ = [
22-
"HealthBotMgmtClient",
28+
"HealthBotClient",
2329
]
24-
__all__.extend([p for p in _patch_all if p not in __all__])
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2531

2632
_patch_sdk()
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
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 license information.
5+
# Code generated by Microsoft (R) Python Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from copy import deepcopy
10+
from typing import Any, Optional, TYPE_CHECKING, cast
11+
from typing_extensions import Self
12+
13+
from azure.core.pipeline import policies
14+
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.core.settings import settings
16+
from azure.mgmt.core import ARMPipelineClient
17+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
19+
20+
from ._configuration import HealthBotClientConfiguration
21+
from ._utils.serialization import Deserializer, Serializer
22+
from .operations import HealthBotsOperations, Operations
23+
24+
if TYPE_CHECKING:
25+
from azure.core.credentials import TokenCredential
26+
27+
28+
class HealthBotClient:
29+
"""Azure Health Bot is a cloud platform that empowers developers in Healthcare organizations to
30+
build and deploy their compliant, AI-powered virtual health assistants and health bots, that
31+
help them improve processes and reduce costs.
32+
33+
:ivar operations: Operations operations
34+
:vartype operations: azure.mgmt.healthbot.operations.Operations
35+
:ivar health_bots: HealthBotsOperations operations
36+
:vartype health_bots: azure.mgmt.healthbot.operations.HealthBotsOperations
37+
:param credential: Credential used to authenticate requests to the service. Required.
38+
:type credential: ~azure.core.credentials.TokenCredential
39+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
40+
:type subscription_id: str
41+
:param base_url: Service host. Default value is None.
42+
:type base_url: str
43+
:keyword api_version: The API version to use for this operation. Default value is "2024-02-01".
44+
Note that overriding this default value may result in unsupported behavior.
45+
:paramtype api_version: str
46+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
47+
Retry-After header is present.
48+
"""
49+
50+
def __init__(
51+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
52+
) -> None:
53+
_endpoint = "{endpoint}"
54+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
55+
_endpoints = get_arm_endpoints(_cloud)
56+
if not base_url:
57+
base_url = _endpoints["resource_manager"]
58+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
59+
self._config = HealthBotClientConfiguration(
60+
credential=credential,
61+
subscription_id=subscription_id,
62+
base_url=cast(str, base_url),
63+
credential_scopes=credential_scopes,
64+
**kwargs
65+
)
66+
67+
_policies = kwargs.pop("policies", None)
68+
if _policies is None:
69+
_policies = [
70+
policies.RequestIdPolicy(**kwargs),
71+
self._config.headers_policy,
72+
self._config.user_agent_policy,
73+
self._config.proxy_policy,
74+
policies.ContentDecodePolicy(**kwargs),
75+
ARMAutoResourceProviderRegistrationPolicy(),
76+
self._config.redirect_policy,
77+
self._config.retry_policy,
78+
self._config.authentication_policy,
79+
self._config.custom_hook_policy,
80+
self._config.logging_policy,
81+
policies.DistributedTracingPolicy(**kwargs),
82+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
83+
self._config.http_logging_policy,
84+
]
85+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs)
86+
87+
self._serialize = Serializer()
88+
self._deserialize = Deserializer()
89+
self._serialize.client_side_validation = False
90+
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
91+
self.health_bots = HealthBotsOperations(self._client, self._config, self._serialize, self._deserialize)
92+
93+
def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
94+
"""Runs the network request through the client's chained policies.
95+
96+
>>> from azure.core.rest import HttpRequest
97+
>>> request = HttpRequest("GET", "https://www.example.org/")
98+
<HttpRequest [GET], url: 'https://www.example.org/'>
99+
>>> response = client.send_request(request)
100+
<HttpResponse: 200 OK>
101+
102+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
103+
104+
:param request: The network request you want to make. Required.
105+
:type request: ~azure.core.rest.HttpRequest
106+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
107+
:return: The response of your network call. Does not do error handling on your response.
108+
:rtype: ~azure.core.rest.HttpResponse
109+
"""
110+
111+
request_copy = deepcopy(request)
112+
path_format_arguments = {
113+
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
114+
}
115+
116+
request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
117+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
118+
119+
def close(self) -> None:
120+
self._client.close()
121+
122+
def __enter__(self) -> Self:
123+
self._client.__enter__()
124+
return self
125+
126+
def __exit__(self, *exc_details: Any) -> None:
127+
self._client.__exit__(*exc_details)

0 commit comments

Comments
 (0)