Skip to content

Commit 6b51a8d

Browse files
author
SDKAuto
committed
CodeGen from PR 32524 in Azure/azure-rest-api-specs
Merge bf6656b75924a5df6c27a50e5a7288c84a380d1c into 85b13254060355ccbad6317d33f647487dd57ced
1 parent 629d97b commit 6b51a8d

28 files changed

+743
-29203
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"commit": "539a994c986bdd68464988429b2d4c10d42af49b",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"typespec_src": "specification/ai/Azure.AI.Projects",
5+
"@azure-tools/typespec-python": "0.38.3"
6+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"CrossLanguagePackageId": "Azure.AI.Projects",
3+
"CrossLanguageDefinitionId": {
4+
"azure.ai.projects.models.InputData": "Azure.AI.Projects.InputData",
5+
"azure.ai.projects.models.ApplicationInsightsConfiguration": "Azure.AI.Projects.ApplicationInsightsConfiguration",
6+
"azure.ai.projects.models.Trigger": "Azure.AI.Projects.Trigger",
7+
"azure.ai.projects.models.CronTrigger": "Azure.AI.Projects.CronTrigger",
8+
"azure.ai.projects.models.Dataset": "Azure.AI.Projects.Dataset",
9+
"azure.ai.projects.models.Evaluation": "Azure.AI.Projects.Evaluation",
10+
"azure.ai.projects.models.EvaluationSchedule": "Azure.AI.Projects.EvaluationSchedule",
11+
"azure.ai.projects.models.EvaluatorConfiguration": "Azure.AI.Projects.EvaluatorConfiguration",
12+
"azure.ai.projects.models.RecurrenceSchedule": "Azure.AI.Projects.RecurrenceSchedule",
13+
"azure.ai.projects.models.RecurrenceTrigger": "Azure.AI.Projects.RecurrenceTrigger",
14+
"azure.ai.projects.models.SystemData": "Azure.AI.Projects.SystemData",
15+
"azure.ai.projects.models.AuthenticationType": "Azure.AI.Projects.AuthenticationType",
16+
"azure.ai.projects.models.ConnectionType": "Azure.AI.Projects.ConnectionType",
17+
"azure.ai.projects.models.Frequency": "Azure.AI.Projects.Frequency",
18+
"azure.ai.projects.models.WeekDays": "Azure.AI.Projects.WeekDays",
19+
"azure.ai.projects.AIProjectClient.evaluations.get": "Azure.AI.Projects.Evaluations.get",
20+
"azure.ai.projects.AIProjectClient.evaluations.create": "Azure.AI.Projects.Evaluations.create",
21+
"azure.ai.projects.AIProjectClient.evaluations.list": "Azure.AI.Projects.Evaluations.list",
22+
"azure.ai.projects.AIProjectClient.evaluations.update": "Azure.AI.Projects.Evaluations.update",
23+
"azure.ai.projects.AIProjectClient.evaluations.get_schedule": "Azure.AI.Projects.Evaluations.getSchedule",
24+
"azure.ai.projects.AIProjectClient.evaluations.create_or_replace_schedule": "Azure.AI.Projects.Evaluations.createOrReplaceSchedule",
25+
"azure.ai.projects.AIProjectClient.evaluations.list_schedule": "Azure.AI.Projects.Evaluations.listSchedule",
26+
"azure.ai.projects.AIProjectClient.evaluations.disable_schedule": "Azure.AI.Projects.Evaluations.disableSchedule"
27+
}
28+
}

sdk/ai/azure-ai-projects/azure/ai/projects/_client.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
from ._configuration import AIProjectClientConfiguration
1818
from ._serialization import Deserializer, Serializer
19-
from .operations import AgentsOperations, ConnectionsOperations, EvaluationsOperations, TelemetryOperations
19+
from .operations import ConnectionsOperations, EvaluationsOperations, TelemetryOperations
2020

2121
if TYPE_CHECKING:
2222
from azure.core.credentials import TokenCredential
@@ -25,8 +25,6 @@
2525
class AIProjectClient:
2626
"""AIProjectClient.
2727
28-
:ivar agents: AgentsOperations operations
29-
:vartype agents: azure.ai.projects.operations.AgentsOperations
3028
:ivar connections: ConnectionsOperations operations
3129
:vartype connections: azure.ai.projects.operations.ConnectionsOperations
3230
:ivar telemetry: TelemetryOperations operations
@@ -93,7 +91,6 @@ def __init__(
9391
self._serialize = Serializer()
9492
self._deserialize = Deserializer()
9593
self._serialize.client_side_validation = False
96-
self.agents = AgentsOperations(self._client, self._config, self._serialize, self._deserialize)
9794
self.connections = ConnectionsOperations(self._client, self._config, self._serialize, self._deserialize)
9895
self.telemetry = TelemetryOperations(self._client, self._config, self._serialize, self._deserialize)
9996
self.evaluations = EvaluationsOperations(self._client, self._config, self._serialize, self._deserialize)

sdk/ai/azure-ai-projects/azure/ai/projects/_model_base.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,15 +373,34 @@ def __ne__(self, other: typing.Any) -> bool:
373373
return not self.__eq__(other)
374374

375375
def keys(self) -> typing.KeysView[str]:
376+
"""
377+
:returns: a set-like object providing a view on D's keys
378+
:rtype: ~typing.KeysView
379+
"""
376380
return self._data.keys()
377381

378382
def values(self) -> typing.ValuesView[typing.Any]:
383+
"""
384+
:returns: an object providing a view on D's values
385+
:rtype: ~typing.ValuesView
386+
"""
379387
return self._data.values()
380388

381389
def items(self) -> typing.ItemsView[str, typing.Any]:
390+
"""
391+
:returns: set-like object providing a view on D's items
392+
:rtype: ~typing.ItemsView
393+
"""
382394
return self._data.items()
383395

384396
def get(self, key: str, default: typing.Any = None) -> typing.Any:
397+
"""
398+
Get the value for key if key is in the dictionary, else default.
399+
:param str key: The key to look up.
400+
:param any default: The value to return if key is not in the dictionary. Defaults to None
401+
:returns: D[k] if k in D, else d.
402+
:rtype: any
403+
"""
385404
try:
386405
return self[key]
387406
except KeyError:
@@ -397,17 +416,38 @@ def pop(self, key: str, default: _T) -> _T: ...
397416
def pop(self, key: str, default: typing.Any) -> typing.Any: ...
398417

399418
def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any:
419+
"""
420+
Removes specified key and return the corresponding value.
421+
:param str key: The key to pop.
422+
:param any default: The value to return if key is not in the dictionary
423+
:returns: The value corresponding to the key.
424+
:rtype: any
425+
:raises KeyError: If key is not found and default is not given.
426+
"""
400427
if default is _UNSET:
401428
return self._data.pop(key)
402429
return self._data.pop(key, default)
403430

404431
def popitem(self) -> typing.Tuple[str, typing.Any]:
432+
"""
433+
Removes and returns some (key, value) pair
434+
:returns: The (key, value) pair.
435+
:rtype: tuple
436+
:raises KeyError: if D is empty.
437+
"""
405438
return self._data.popitem()
406439

407440
def clear(self) -> None:
441+
"""
442+
Remove all items from D.
443+
"""
408444
self._data.clear()
409445

410446
def update(self, *args: typing.Any, **kwargs: typing.Any) -> None:
447+
"""
448+
Updates D from mapping/iterable E and F.
449+
:param any args: Either a mapping object or an iterable of key-value pairs.
450+
"""
411451
self._data.update(*args, **kwargs)
412452

413453
@typing.overload
@@ -417,6 +457,13 @@ def setdefault(self, key: str, default: None = None) -> None: ...
417457
def setdefault(self, key: str, default: typing.Any) -> typing.Any: ...
418458

419459
def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any:
460+
"""
461+
Same as calling D.get(k, d), and setting D[k]=d if k not found
462+
:param str key: The key to look up.
463+
:param any default: The value to set if key is not in the dictionary
464+
:returns: D[k] if k in D, else d.
465+
:rtype: any
466+
"""
420467
if default is _UNSET:
421468
return self._data.setdefault(key)
422469
return self._data.setdefault(key, default)
@@ -910,6 +957,19 @@ def _failsafe_deserialize(
910957
return None
911958

912959

960+
def _failsafe_deserialize_xml(
961+
deserializer: typing.Any,
962+
value: typing.Any,
963+
) -> typing.Any:
964+
try:
965+
return _deserialize_xml(deserializer, value)
966+
except DeserializationError:
967+
_LOGGER.warning(
968+
"Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True
969+
)
970+
return None
971+
972+
913973
class _RestField:
914974
def __init__(
915975
self,

0 commit comments

Comments
 (0)