Skip to content

Commit 47daace

Browse files
authored
feat: add queues folder path support (#1091)
1 parent eb5749b commit 47daace

File tree

7 files changed

+712
-83
lines changed

7 files changed

+712
-83
lines changed

packages/uipath-platform/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath-platform"
3-
version = "0.1.13"
3+
version = "0.1.14"
44
description = "HTTP client library for programmatic access to UiPath Platform"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"

packages/uipath-platform/src/uipath/platform/common/_bindings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ def folder_identifier(self) -> str:
4444

4545

4646
class GenericResourceOverwrite(ResourceOverwrite):
47-
resource_type: Literal["process", "index", "app", "asset", "bucket", "mcpServer"]
47+
resource_type: Literal[
48+
"process", "index", "app", "asset", "bucket", "mcpServer", "queue"
49+
]
4850
name: str = Field(alias="name")
4951
folder_path: str = Field(alias="folderPath")
5052

packages/uipath-platform/src/uipath/platform/orchestrator/_queues_service.py

Lines changed: 287 additions & 53 deletions
Large diffs are not rendered by default.

packages/uipath-platform/src/uipath/platform/orchestrator/queues.py

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
"""Models for Orchestrator Queues API."""
22

3+
import warnings
34
from datetime import datetime
45
from enum import Enum
56
from typing import Any, Dict, Optional
67

7-
from pydantic import BaseModel, ConfigDict, Field, field_serializer
8+
from pydantic import BaseModel, ConfigDict, Field, field_serializer, model_validator
89
from typing_extensions import Annotated
910

1011

@@ -42,10 +43,24 @@ def serialize_datetime(self, value):
4243
return value.isoformat() if value else None
4344
return value
4445

45-
name: str = Field(
46-
description="The name of the queue into which the item will be added.",
46+
name: Optional[str] = Field(
47+
default=None,
48+
description="Deprecated: use queue_name on the service method instead. The name of the queue into which the item will be added.",
4749
alias="Name",
4850
)
51+
52+
@model_validator(mode="before")
53+
@classmethod
54+
def warn_name_deprecated(cls, values: Any) -> Any:
55+
"""Emit a deprecation warning when the 'name' field is used directly."""
56+
if isinstance(values, dict) and ("name" in values or "Name" in values):
57+
warnings.warn(
58+
"The 'name' field on QueueItem is deprecated. Pass queue_name to the service method instead.",
59+
DeprecationWarning,
60+
stacklevel=2,
61+
)
62+
return values
63+
4964
priority: Optional[QueueItemPriority] = Field(
5065
default=None,
5166
description="Sets the processing importance for a given item.",
@@ -113,10 +128,24 @@ def serialize_datetime(self, value):
113128
return value.isoformat() if value else None
114129
return value
115130

116-
name: str = Field(
117-
description="The name of the queue in which to search for the next item or in which to insert the item before marking it as InProgress and sending it to the robot.",
131+
name: Optional[str] = Field(
132+
default=None,
133+
description="Deprecated: use queue_name on the service method instead. The name of the queue in which to search for the next item or in which to insert the item before marking it as InProgress and sending it to the robot.",
118134
alias="Name",
119135
)
136+
137+
@model_validator(mode="before")
138+
@classmethod
139+
def warn_name_deprecated(cls, values: Any) -> Any:
140+
"""Emit a deprecation warning when the 'name' field is used directly."""
141+
if isinstance(values, dict) and ("name" in values or "Name" in values):
142+
warnings.warn(
143+
"The 'name' field on TransactionItem is deprecated. Pass queue_name to the service method instead.",
144+
DeprecationWarning,
145+
stacklevel=2,
146+
)
147+
return values
148+
120149
robot_identifier: Optional[str] = Field(
121150
default=None,
122151
description="The unique key identifying the robot that sent the request.",

0 commit comments

Comments
 (0)