Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLU] regen on 2022-10-01-preview for runtime #26233

Merged
merged 8 commits into from
Oct 18, 2022
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Dict

from azure.core.credentials import TokenCredential


Expand All @@ -42,7 +40,7 @@ class ConversationAnalysisClient(
:type endpoint: str
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:keyword api_version: Api Version. Default value is "2022-05-15-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2022-10-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ class ConversationAnalysisClientConfiguration(Configuration): # pylint: disable
:type endpoint: str
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:keyword api_version: Api Version. Default value is "2022-05-15-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2022-10-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, endpoint: str, credential: "TokenCredential", **kwargs: Any) -> None:
super(ConversationAnalysisClientConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop("api_version", "2022-05-15-preview") # type: str
api_version = kwargs.pop("api_version", "2022-10-01-preview") # type: str

if endpoint is None:
raise ValueError("Parameter 'endpoint' must not be None.")
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ def _authentication_policy(credential):
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if isinstance(credential, AzureKeyCredential):
authentication_policy = AzureKeyCredentialPolicy(
name="Ocp-Apim-Subscription-Key", credential=credential
)
authentication_policy = AzureKeyCredentialPolicy(name="Ocp-Apim-Subscription-Key", credential=credential)
elif credential is not None and not hasattr(credential, "get_token"):
raise TypeError(
f"Unsupported credential: {type(credential)}. Use an instance of AzureKeyCredential "
Expand All @@ -70,8 +68,9 @@ class ConversationAnalysisClient(GeneratedConversationAnalysisClient):
This can be the an instance of AzureKeyCredential if using a Language API key
or a token credential from :mod:`azure.identity`.
:type credential: ~azure.core.credentials.AzureKeyCredential or ~azure.core.credentials.TokenCredential
:keyword api_version: Api Version. Available values are "2022-05-15-preview" and "2022-05-01". Default
value is "2022-05-15-preview". Note that overriding this default value may result in unsupported behavior.
:keyword api_version: Api Version. Available values are "2022-10-01-preview", "2022-05-15-preview",
"2022-05-01". Default value is "2022-10-01-preview". Note that overriding this default value may result in
unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Retry-After header is present.
Expand All @@ -82,13 +81,12 @@ def __init__(self, endpoint: str, credential: Union[AzureKeyCredential, TokenCre
endpoint = endpoint.rstrip("/")
except AttributeError:
raise ValueError("Parameter 'endpoint' must be a string.")

super().__init__(
endpoint=endpoint,
credential=credential, # type: ignore
authentication_policy=kwargs.pop("authentication_policy", _authentication_policy(credential)),
polling_interval=kwargs.pop("polling_interval", POLLING_INTERVAL_DEFAULT),
**kwargs
**kwargs,
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1505,7 +1505,7 @@ def failsafe_deserialize(self, target_obj, data, content_type=None):
try:
return self(target_obj, data, content_type=content_type)
except:
_LOGGER.warning(
_LOGGER.debug(
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
)
return None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Dict

from azure.core.credentials_async import AsyncTokenCredential


Expand All @@ -42,7 +40,7 @@ class ConversationAnalysisClient(
:type endpoint: str
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:keyword api_version: Api Version. Default value is "2022-05-15-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2022-10-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ class ConversationAnalysisClientConfiguration(Configuration): # pylint: disable
:type endpoint: str
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:keyword api_version: Api Version. Default value is "2022-05-15-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2022-10-01-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, endpoint: str, credential: "AsyncTokenCredential", **kwargs: Any) -> None:
super(ConversationAnalysisClientConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop("api_version", "2022-05-15-preview") # type: str
api_version = kwargs.pop("api_version", "2022-10-01-preview") # type: str

if endpoint is None:
raise ValueError("Parameter 'endpoint' must not be None.")
Expand Down
Loading