Skip to content

Commit

Permalink
[CLU] regen on 2022-10-01-preview for runtime (#26233)
Browse files Browse the repository at this point in the history
* regenerate on 2022-10-01-preview for CLU runtime

* add rest api docs to the docstrings

* remove patched docstrings for authoring, swagger transform now works to include rest api docs

* use swagger transforms to edit docs instead of patch

* regen runtime/authoring now that specs are in main

* rerecord and fix doc

* add separation between doc comment and link
  • Loading branch information
kristapratico authored Oct 18, 2022
1 parent 9011197 commit 6f7303c
Show file tree
Hide file tree
Showing 42 changed files with 6,314 additions and 5,979 deletions.
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

0 comments on commit 6f7303c

Please sign in to comment.