targetprocess-py 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- targetprocess/__init__.py +231 -0
- targetprocess/_assignables.py +162 -0
- targetprocess/_base.py +318 -0
- targetprocess/_content.py +287 -0
- targetprocess/_dates.py +70 -0
- targetprocess/_entity_types.py +33 -0
- targetprocess/_generals.py +324 -0
- targetprocess/_joins.py +217 -0
- targetprocess/_lookups.py +477 -0
- targetprocess/_nested.py +223 -0
- targetprocess/_observability.py +368 -0
- targetprocess/client.py +430 -0
- targetprocess/exceptions.py +147 -0
- targetprocess/models.py +121 -0
- targetprocess/py.typed +1 -0
- targetprocess/request_handler.py +724 -0
- targetprocess/resources/__init__.py +76 -0
- targetprocess/resources/assignments.py +29 -0
- targetprocess/resources/attachments.py +164 -0
- targetprocess/resources/base.py +563 -0
- targetprocess/resources/bugs.py +20 -0
- targetprocess/resources/comments.py +23 -0
- targetprocess/resources/custom_activities.py +56 -0
- targetprocess/resources/custom_fields.py +27 -0
- targetprocess/resources/custom_rules.py +28 -0
- targetprocess/resources/entities.py +433 -0
- targetprocess/resources/entity_states.py +20 -0
- targetprocess/resources/entity_types.py +61 -0
- targetprocess/resources/epics.py +20 -0
- targetprocess/resources/features.py +20 -0
- targetprocess/resources/iterations.py +20 -0
- targetprocess/resources/priorities.py +85 -0
- targetprocess/resources/processes.py +65 -0
- targetprocess/resources/projects.py +20 -0
- targetprocess/resources/relation_types.py +59 -0
- targetprocess/resources/relations.py +34 -0
- targetprocess/resources/releases.py +20 -0
- targetprocess/resources/requests.py +20 -0
- targetprocess/resources/role_efforts.py +21 -0
- targetprocess/resources/roles.py +52 -0
- targetprocess/resources/severities.py +53 -0
- targetprocess/resources/tasks.py +20 -0
- targetprocess/resources/team_assignments.py +21 -0
- targetprocess/resources/team_iterations.py +24 -0
- targetprocess/resources/teams.py +20 -0
- targetprocess/resources/terms.py +28 -0
- targetprocess/resources/test_cases.py +20 -0
- targetprocess/resources/times.py +392 -0
- targetprocess/resources/user_stories.py +20 -0
- targetprocess/resources/users.py +20 -0
- targetprocess/resources/workflows.py +27 -0
- targetprocess/response_parser.py +113 -0
- targetprocess/transport.py +116 -0
- targetprocess/types.py +56 -0
- targetprocess_py-0.1.0.dist-info/METADATA +476 -0
- targetprocess_py-0.1.0.dist-info/RECORD +58 -0
- targetprocess_py-0.1.0.dist-info/WHEEL +4 -0
- targetprocess_py-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
"""The lookup, configuration and people types outside TP's ``General`` hierarchy.
|
|
2
|
+
|
|
3
|
+
``User`` derives from ``GeneralUser`` upstream; ``EntityState``, ``Priority``,
|
|
4
|
+
``Role``, ``RelationType``, ``Severity``, ``Process``, ``Workflow``,
|
|
5
|
+
``EntityType``, ``Term``, ``CustomActivity`` and ``CustomRule`` derive from
|
|
6
|
+
nothing at all. None of them carry the ``General`` field set, so they extend
|
|
7
|
+
:class:`targetprocess._base.Entity` or :class:`targetprocess._base.NamedEntity`
|
|
8
|
+
directly.
|
|
9
|
+
|
|
10
|
+
Re-exported by :mod:`targetprocess.models`, which stays the import surface
|
|
11
|
+
callers use.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from pydantic import Field
|
|
15
|
+
|
|
16
|
+
from targetprocess._base import Entity, NamedEntity
|
|
17
|
+
from targetprocess._dates import TPDateTime
|
|
18
|
+
from targetprocess._nested import EntityRef, EntityTypeRef, UserRef
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class User(Entity):
|
|
22
|
+
"""User entity for people and authentication.
|
|
23
|
+
|
|
24
|
+
Unlike every other entity, User carries no ``Name`` field - identity is
|
|
25
|
+
expressed via ``FirstName``/``LastName``/``Login``/``FullName`` instead.
|
|
26
|
+
|
|
27
|
+
The allocation fields describe capacity planning: ``weekly_available_hours``
|
|
28
|
+
is the contracted week, ``current_allocation`` the percentage already
|
|
29
|
+
committed, and the ``available_future_*`` pair the same measures projected
|
|
30
|
+
forward.
|
|
31
|
+
|
|
32
|
+
TP declares one further property, ``Password``, which it marks unreadable
|
|
33
|
+
(``CanGet: false``). It is deliberately not declared: it never arrives in a
|
|
34
|
+
response, and a password-shaped attribute would otherwise appear in every
|
|
35
|
+
``model_dump``. Set it through ``users.update(id, Password=...)``, which
|
|
36
|
+
passes fields through verbatim.
|
|
37
|
+
|
|
38
|
+
Attributes:
|
|
39
|
+
email: User email address
|
|
40
|
+
first_name: User first name
|
|
41
|
+
last_name: User last name
|
|
42
|
+
login: User login
|
|
43
|
+
full_name: User full name
|
|
44
|
+
is_active: Whether the user is active
|
|
45
|
+
is_administrator: Whether the user is an administrator
|
|
46
|
+
is_observer: Whether the user is a read-only observer
|
|
47
|
+
is_contributor: Whether the user is a contributor
|
|
48
|
+
is_integration: Whether the account is a service/integration account
|
|
49
|
+
kind: Account kind (e.g. "User", "Requester")
|
|
50
|
+
locale: User locale
|
|
51
|
+
rich_editor: Editor the user writes in (e.g. "Markdown")
|
|
52
|
+
avatar_uri: Path to the user's avatar image
|
|
53
|
+
global_id: TP's cross-instance identifier
|
|
54
|
+
entity_version: Per-record version counter (increments on every edit)
|
|
55
|
+
delete_date: When the account was deleted (None while active)
|
|
56
|
+
last_login_date: When the user last signed in
|
|
57
|
+
access_start_date: Start of the account's access window
|
|
58
|
+
access_end_date: End of the account's access window
|
|
59
|
+
weekly_available_hours: Contracted hours per week
|
|
60
|
+
current_allocation: Percentage of capacity already committed
|
|
61
|
+
current_available_hours: Hours still uncommitted
|
|
62
|
+
available_from: Date the user next has capacity
|
|
63
|
+
available_future_allocation: Projected committed percentage
|
|
64
|
+
available_future_hours: Projected uncommitted hours
|
|
65
|
+
password_hash_algorithm: Algorithm the stored password hash uses
|
|
66
|
+
frontdoor_user_id: Identifier in TP's identity service
|
|
67
|
+
frontdoor_user_roles: Roles held in TP's identity service
|
|
68
|
+
active_directory_name: Directory account name, when AD-linked
|
|
69
|
+
legacy_skills: Free-text skills field retained from older TP versions
|
|
70
|
+
role: User role reference
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
# Identity
|
|
74
|
+
email: str | None = Field(default=None, alias="Email", description="Email address")
|
|
75
|
+
first_name: str | None = Field(default=None, alias="FirstName", description="First name")
|
|
76
|
+
last_name: str | None = Field(default=None, alias="LastName", description="Last name")
|
|
77
|
+
login: str | None = Field(default=None, alias="Login", description="Login")
|
|
78
|
+
full_name: str | None = Field(default=None, alias="FullName", description="Full name")
|
|
79
|
+
avatar_uri: str | None = Field(default=None, alias="AvatarUri", description="Avatar path")
|
|
80
|
+
global_id: str | None = Field(default=None, alias="GlobalId", description="Cross-instance id")
|
|
81
|
+
|
|
82
|
+
# Account flags
|
|
83
|
+
is_active: bool | None = Field(default=None, alias="IsActive", description="Active status")
|
|
84
|
+
is_administrator: bool | None = Field(
|
|
85
|
+
default=None, alias="IsAdministrator", description="Administrator"
|
|
86
|
+
)
|
|
87
|
+
is_observer: bool | None = Field(default=None, alias="IsObserver", description="Observer")
|
|
88
|
+
is_contributor: bool | None = Field(
|
|
89
|
+
default=None, alias="IsContributor", description="Contributor"
|
|
90
|
+
)
|
|
91
|
+
is_integration: bool | None = Field(
|
|
92
|
+
default=None, alias="IsIntegration", description="Service account"
|
|
93
|
+
)
|
|
94
|
+
kind: str | None = Field(default=None, alias="Kind", description="Account kind")
|
|
95
|
+
locale: str | None = Field(default=None, alias="Locale", description="Locale")
|
|
96
|
+
rich_editor: str | None = Field(default=None, alias="RichEditor", description="Editor type")
|
|
97
|
+
entity_version: int | None = Field(
|
|
98
|
+
default=None, alias="EntityVersion", description="Per-record version counter"
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
# Date tracking
|
|
102
|
+
delete_date: TPDateTime | None = Field(
|
|
103
|
+
default=None, alias="DeleteDate", description="Deletion timestamp"
|
|
104
|
+
)
|
|
105
|
+
last_login_date: TPDateTime | None = Field(
|
|
106
|
+
default=None, alias="LastLoginDate", description="Last sign-in"
|
|
107
|
+
)
|
|
108
|
+
access_start_date: TPDateTime | None = Field(
|
|
109
|
+
default=None, alias="AccessStartDate", description="Access window start"
|
|
110
|
+
)
|
|
111
|
+
access_end_date: TPDateTime | None = Field(
|
|
112
|
+
default=None, alias="AccessEndDate", description="Access window end"
|
|
113
|
+
)
|
|
114
|
+
available_from: TPDateTime | None = Field(
|
|
115
|
+
default=None, alias="AvailableFrom", description="Next available from"
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
# Capacity
|
|
119
|
+
weekly_available_hours: float | None = Field(
|
|
120
|
+
default=None, alias="WeeklyAvailableHours", description="Contracted weekly hours"
|
|
121
|
+
)
|
|
122
|
+
current_allocation: int | None = Field(
|
|
123
|
+
default=None, alias="CurrentAllocation", description="Committed capacity (%)"
|
|
124
|
+
)
|
|
125
|
+
current_available_hours: float | None = Field(
|
|
126
|
+
default=None, alias="CurrentAvailableHours", description="Uncommitted hours"
|
|
127
|
+
)
|
|
128
|
+
available_future_allocation: int | None = Field(
|
|
129
|
+
default=None, alias="AvailableFutureAllocation", description="Projected committed (%)"
|
|
130
|
+
)
|
|
131
|
+
available_future_hours: float | None = Field(
|
|
132
|
+
default=None, alias="AvailableFutureHours", description="Projected uncommitted hours"
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
# Identity provider / directory
|
|
136
|
+
password_hash_algorithm: str | None = Field(
|
|
137
|
+
default=None, alias="PasswordHashAlgorithm", description="Password hash algorithm"
|
|
138
|
+
)
|
|
139
|
+
frontdoor_user_id: str | None = Field(
|
|
140
|
+
default=None, alias="FrontdoorUserId", description="Identity-service id"
|
|
141
|
+
)
|
|
142
|
+
frontdoor_user_roles: str | None = Field(
|
|
143
|
+
default=None, alias="FrontdoorUserRoles", description="Identity-service roles"
|
|
144
|
+
)
|
|
145
|
+
active_directory_name: str | None = Field(
|
|
146
|
+
default=None, alias="ActiveDirectoryName", description="AD account name"
|
|
147
|
+
)
|
|
148
|
+
legacy_skills: str | None = Field(
|
|
149
|
+
default=None, alias="LegacySkills", description="Legacy free-text skills"
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
# Relationships
|
|
153
|
+
role: EntityRef | None = Field(default=None, alias="Role", description="User role")
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
class EntityState(NamedEntity):
|
|
157
|
+
"""EntityState entity for workflow states.
|
|
158
|
+
|
|
159
|
+
A single column of a ``Workflow``, scoped to one entity type within one
|
|
160
|
+
process. ``numeric_priority`` is what orders the states along the board -
|
|
161
|
+
the ordering TP renders left to right.
|
|
162
|
+
|
|
163
|
+
Attributes:
|
|
164
|
+
is_initial: Whether this is an initial state
|
|
165
|
+
is_final: Whether this is a final state
|
|
166
|
+
is_planned: Whether this is a planned state
|
|
167
|
+
is_comment_required: Whether TP requires a comment to enter this state
|
|
168
|
+
numeric_priority: Ordering rank along the workflow
|
|
169
|
+
workflow: Owning workflow reference
|
|
170
|
+
entity_type: Entity type the state applies to (deprecated upstream)
|
|
171
|
+
process: Owning process reference (deprecated upstream)
|
|
172
|
+
parent_entity_state: Parent state, for sub-workflow states
|
|
173
|
+
role: Role the state is restricted to, when restricted
|
|
174
|
+
"""
|
|
175
|
+
|
|
176
|
+
# State flags
|
|
177
|
+
is_initial: bool | None = Field(
|
|
178
|
+
default=None, alias="IsInitial", description="Initial state flag"
|
|
179
|
+
)
|
|
180
|
+
is_final: bool | None = Field(default=None, alias="IsFinal", description="Final state flag")
|
|
181
|
+
is_planned: bool | None = Field(
|
|
182
|
+
default=None, alias="IsPlanned", description="Planned state flag"
|
|
183
|
+
)
|
|
184
|
+
is_comment_required: bool | None = Field(
|
|
185
|
+
default=None, alias="IsCommentRequired", description="Comment required to enter"
|
|
186
|
+
)
|
|
187
|
+
numeric_priority: float | None = Field(
|
|
188
|
+
default=None, alias="NumericPriority", description="Ordering rank"
|
|
189
|
+
)
|
|
190
|
+
|
|
191
|
+
# Relationships
|
|
192
|
+
workflow: EntityRef | None = Field(default=None, alias="Workflow", description="Workflow")
|
|
193
|
+
entity_type: EntityTypeRef | None = Field(
|
|
194
|
+
default=None, alias="EntityType", description="Entity type (deprecated upstream)"
|
|
195
|
+
)
|
|
196
|
+
process: EntityRef | None = Field(
|
|
197
|
+
default=None, alias="Process", description="Process (deprecated upstream)"
|
|
198
|
+
)
|
|
199
|
+
parent_entity_state: EntityRef | None = Field(
|
|
200
|
+
default=None, alias="ParentEntityState", description="Parent state"
|
|
201
|
+
)
|
|
202
|
+
role: EntityRef | None = Field(default=None, alias="Role", description="Restricted-to role")
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
class Priority(NamedEntity):
|
|
206
|
+
"""Priority entity, scoped to a single TP entity type.
|
|
207
|
+
|
|
208
|
+
TP defines one priority set per entity type, so a name alone is
|
|
209
|
+
ambiguous instance-wide - "Must Have" is a separate record for
|
|
210
|
+
UserStory, Feature, Epic and PortfolioEpic - while being unique within
|
|
211
|
+
one set. ``entity_type`` is therefore the discriminator that makes a
|
|
212
|
+
name resolve to exactly one record. A Priority carries no Project or
|
|
213
|
+
Process reference: the valid set depends only on the entity type.
|
|
214
|
+
|
|
215
|
+
Attributes:
|
|
216
|
+
importance: Rank within the entity type's set (1 is most important)
|
|
217
|
+
is_default: Whether TP applies this priority when none is supplied
|
|
218
|
+
is_most_important: Whether this is the top rank in its set
|
|
219
|
+
entity_type: The entity type this priority belongs to
|
|
220
|
+
"""
|
|
221
|
+
|
|
222
|
+
importance: int | None = Field(
|
|
223
|
+
default=None, alias="Importance", description="Rank within the entity type's set"
|
|
224
|
+
)
|
|
225
|
+
is_default: bool | None = Field(
|
|
226
|
+
default=None, alias="IsDefault", description="Applied when no priority is supplied"
|
|
227
|
+
)
|
|
228
|
+
is_most_important: bool | None = Field(
|
|
229
|
+
default=None, alias="IsMostImportant", description="Top rank in its set"
|
|
230
|
+
)
|
|
231
|
+
entity_type: EntityTypeRef | None = Field(
|
|
232
|
+
default=None, alias="EntityType", description="Entity type this priority belongs to"
|
|
233
|
+
)
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
class Role(NamedEntity):
|
|
237
|
+
"""Role lookup entity (e.g. Developer, QA Engineer, Product Owner).
|
|
238
|
+
|
|
239
|
+
An Assignment pairs a user with a Role, so resolving a role name to its
|
|
240
|
+
Id is what makes assignment payloads constructible. Roles are defined
|
|
241
|
+
instance-wide - unlike :class:`Priority` they are not scoped by entity
|
|
242
|
+
type. The boolean fields are the permissions the role grants.
|
|
243
|
+
|
|
244
|
+
Attributes:
|
|
245
|
+
description: Role description
|
|
246
|
+
has_effort: Whether work assigned in this role carries effort
|
|
247
|
+
can_change_owner: Whether the role may reassign an entity's owner
|
|
248
|
+
can_prioritize: Whether the role may reorder the backlog
|
|
249
|
+
can_use_personal_access_tokens: Whether the role may mint access tokens
|
|
250
|
+
time_sheet_access: Whether the role may access timesheets
|
|
251
|
+
"""
|
|
252
|
+
|
|
253
|
+
description: str | None = Field(
|
|
254
|
+
default=None, alias="Description", description="Role description"
|
|
255
|
+
)
|
|
256
|
+
has_effort: bool | None = Field(default=None, alias="HasEffort", description="Carries effort")
|
|
257
|
+
can_change_owner: bool | None = Field(
|
|
258
|
+
default=None, alias="CanChangeOwner", description="May reassign owner"
|
|
259
|
+
)
|
|
260
|
+
can_prioritize: bool | None = Field(
|
|
261
|
+
default=None, alias="CanPrioritize", description="May reorder the backlog"
|
|
262
|
+
)
|
|
263
|
+
can_use_personal_access_tokens: bool | None = Field(
|
|
264
|
+
default=None,
|
|
265
|
+
alias="CanUsePersonalAccessTokens",
|
|
266
|
+
description="May mint personal access tokens",
|
|
267
|
+
)
|
|
268
|
+
time_sheet_access: bool | None = Field(
|
|
269
|
+
default=None, alias="TimeSheetAccess", description="May access timesheets"
|
|
270
|
+
)
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
class RelationType(NamedEntity):
|
|
274
|
+
"""Relation-type lookup entity (e.g. Dependency, Blocker, Relation, Duplicate).
|
|
275
|
+
|
|
276
|
+
The read-only lookup that types a ``Relation``. The API declares only ``Id``
|
|
277
|
+
and ``Name``, so nothing is added beyond :class:`NamedEntity`. Ids are
|
|
278
|
+
instance-specific - resolve a name via ``client.relation_types.resolve``
|
|
279
|
+
rather than hardcoding an Id (one production instance maps Dependency 1,
|
|
280
|
+
Blocker 2, Relation 3, Link 4, Duplicate 5, but another may differ).
|
|
281
|
+
"""
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
class Severity(NamedEntity):
|
|
285
|
+
"""Severity lookup entity - how bad a Bug is (e.g. Blocking, Critical, Small).
|
|
286
|
+
|
|
287
|
+
TP defines severities instance-wide and only ``Bug`` carries one, so a
|
|
288
|
+
name is unique across the instance - unlike a :class:`Priority`, which
|
|
289
|
+
repeats per entity type - and ``client.severities.resolve`` takes no
|
|
290
|
+
entity type. ``importance`` ranks the set, the minimum value being the
|
|
291
|
+
most severe.
|
|
292
|
+
|
|
293
|
+
Attributes:
|
|
294
|
+
importance: Rank within the set (1 is the most severe)
|
|
295
|
+
is_default: Whether TP applies this severity when none is supplied
|
|
296
|
+
is_most_important: Whether this is the most severe rank
|
|
297
|
+
is_least_important: Whether this is the least severe rank
|
|
298
|
+
"""
|
|
299
|
+
|
|
300
|
+
importance: int | None = Field(
|
|
301
|
+
default=None, alias="Importance", description="Rank within the set"
|
|
302
|
+
)
|
|
303
|
+
is_default: bool | None = Field(
|
|
304
|
+
default=None, alias="IsDefault", description="Applied when no severity is supplied"
|
|
305
|
+
)
|
|
306
|
+
is_most_important: bool | None = Field(
|
|
307
|
+
default=None, alias="IsMostImportant", description="Most severe rank"
|
|
308
|
+
)
|
|
309
|
+
is_least_important: bool | None = Field(
|
|
310
|
+
default=None, alias="IsLeastImportant", description="Least severe rank"
|
|
311
|
+
)
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
class Process(NamedEntity):
|
|
315
|
+
"""Process entity - the practices, terms, workflows and custom fields a Project follows.
|
|
316
|
+
|
|
317
|
+
A Project follows exactly one process, and the process is what scopes
|
|
318
|
+
its workflows, custom-field definitions and terms - so a process Id is
|
|
319
|
+
the key for filtering any of those collections.
|
|
320
|
+
|
|
321
|
+
One wire name collides here: on a Process, TP's ``CustomFields`` is the
|
|
322
|
+
collection of custom-field *definitions* (an ``Items`` envelope of
|
|
323
|
+
``CustomField`` records), not the values array ``custom_fields`` holds
|
|
324
|
+
on every entity. A default Process payload carries no such key, so plain
|
|
325
|
+
reads parse; ``client.processes`` refuses ``include=["CustomFields"]``
|
|
326
|
+
with ``ValueError`` before any request rather than failing the parse
|
|
327
|
+
afterwards - list the definitions through ``client.custom_fields``
|
|
328
|
+
filtered by ``Process.Id`` instead.
|
|
329
|
+
|
|
330
|
+
Attributes:
|
|
331
|
+
description: Brief description of the process
|
|
332
|
+
is_default: Whether this is the instance default (deprecated upstream)
|
|
333
|
+
"""
|
|
334
|
+
|
|
335
|
+
description: str | None = Field(
|
|
336
|
+
default=None, alias="Description", description="Process description"
|
|
337
|
+
)
|
|
338
|
+
is_default: bool | None = Field(
|
|
339
|
+
default=None, alias="IsDefault", description="Instance default (deprecated upstream)"
|
|
340
|
+
)
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
class Workflow(NamedEntity):
|
|
344
|
+
"""Workflow entity - the states one entity type moves through in one process.
|
|
345
|
+
|
|
346
|
+
A workflow is scoped to a ``Process`` and an ``EntityType``; its columns
|
|
347
|
+
are the :class:`EntityState` records, reachable via
|
|
348
|
+
``client.entity_states`` filtered by ``Workflow.Id``. A sub-workflow
|
|
349
|
+
hangs off ``parent_workflow``. Names repeat across processes, so there is
|
|
350
|
+
no instance-wide name resolver - filter by process and entity type.
|
|
351
|
+
|
|
352
|
+
Attributes:
|
|
353
|
+
process: Owning process reference
|
|
354
|
+
entity_type: Entity type the workflow is defined for
|
|
355
|
+
parent_workflow: Parent workflow, for a sub-workflow
|
|
356
|
+
"""
|
|
357
|
+
|
|
358
|
+
process: EntityRef | None = Field(default=None, alias="Process", description="Process")
|
|
359
|
+
entity_type: EntityTypeRef | None = Field(
|
|
360
|
+
default=None, alias="EntityType", description="Entity type"
|
|
361
|
+
)
|
|
362
|
+
parent_workflow: EntityRef | None = Field(
|
|
363
|
+
default=None, alias="ParentWorkflow", description="Parent workflow"
|
|
364
|
+
)
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
class EntityType(NamedEntity):
|
|
368
|
+
"""EntityType entity - one of the instance's entity types (Bug, UserStory, ...).
|
|
369
|
+
|
|
370
|
+
The instance's own type catalogue, and so the way a client discovers at
|
|
371
|
+
runtime what the instance exposes. TP declares the collection read-only.
|
|
372
|
+
:class:`targetprocess.models.EntityTypeRef` is the *reference* shape other
|
|
373
|
+
entities embed (which can arrive without an ``Id``); this is the full
|
|
374
|
+
record, always identified.
|
|
375
|
+
|
|
376
|
+
Attributes:
|
|
377
|
+
custom_field_scope: Scope of custom fields for the type (None,
|
|
378
|
+
Process or Global)
|
|
379
|
+
is_searchable: Whether entities of the type can be searched
|
|
380
|
+
is_unit_in_hour_only: Whether the type measures effort in hours only
|
|
381
|
+
is_assignable: Whether the type is an Assignable (a work item)
|
|
382
|
+
is_global: Whether the type is global rather than project-scoped
|
|
383
|
+
is_team_assignable: Whether team context applies to the type
|
|
384
|
+
hierarchy_level: Sort rank on views with an entity-type axis
|
|
385
|
+
has_audit_history: Whether the type keeps an audit history
|
|
386
|
+
is_extendable: Whether the type can carry custom fields
|
|
387
|
+
"""
|
|
388
|
+
|
|
389
|
+
custom_field_scope: str | None = Field(
|
|
390
|
+
default=None, alias="CustomFieldScope", description="Custom-field scope"
|
|
391
|
+
)
|
|
392
|
+
is_searchable: bool | None = Field(default=None, alias="IsSearchable", description="Searchable")
|
|
393
|
+
is_unit_in_hour_only: bool | None = Field(
|
|
394
|
+
default=None, alias="IsUnitInHourOnly", description="Effort is hours-only"
|
|
395
|
+
)
|
|
396
|
+
is_assignable: bool | None = Field(
|
|
397
|
+
default=None, alias="IsAssignable", description="Is a work item type"
|
|
398
|
+
)
|
|
399
|
+
is_global: bool | None = Field(default=None, alias="IsGlobal", description="Global type")
|
|
400
|
+
is_team_assignable: bool | None = Field(
|
|
401
|
+
default=None, alias="IsTeamAssignable", description="Team context applies"
|
|
402
|
+
)
|
|
403
|
+
hierarchy_level: int | None = Field(
|
|
404
|
+
default=None, alias="HierarchyLevel", description="Sort rank on entity-type axes"
|
|
405
|
+
)
|
|
406
|
+
has_audit_history: bool | None = Field(
|
|
407
|
+
default=None, alias="HasAuditHistory", description="Keeps an audit history"
|
|
408
|
+
)
|
|
409
|
+
is_extendable: bool | None = Field(
|
|
410
|
+
default=None, alias="IsExtendable", description="Can carry custom fields"
|
|
411
|
+
)
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
class Term(Entity):
|
|
415
|
+
"""Term entity - a process's vocabulary override for an entity type.
|
|
416
|
+
|
|
417
|
+
A Term maps a ``word_key`` (the built-in word) to the ``value`` one
|
|
418
|
+
process displays instead, so an instance can call a User Story a
|
|
419
|
+
"Ticket" in one process and not another. It carries no ``Name``, so it
|
|
420
|
+
extends :class:`targetprocess._base.Entity` directly. TP declares the
|
|
421
|
+
collection read-only and marks it beta.
|
|
422
|
+
|
|
423
|
+
Attributes:
|
|
424
|
+
word_key: The built-in word being overridden
|
|
425
|
+
value: The display value the process uses
|
|
426
|
+
process: Owning process reference
|
|
427
|
+
entity_type: Entity type the term applies to
|
|
428
|
+
"""
|
|
429
|
+
|
|
430
|
+
word_key: str | None = Field(default=None, alias="WordKey", description="Built-in word")
|
|
431
|
+
value: str | None = Field(default=None, alias="Value", description="Display value")
|
|
432
|
+
process: EntityRef | None = Field(default=None, alias="Process", description="Process")
|
|
433
|
+
entity_type: EntityTypeRef | None = Field(
|
|
434
|
+
default=None, alias="EntityType", description="Entity type"
|
|
435
|
+
)
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
class CustomActivity(NamedEntity):
|
|
439
|
+
"""CustomActivity entity - a project-scoped activity that Time is logged against.
|
|
440
|
+
|
|
441
|
+
The non-work-item target for time tracking: a ``Time`` record may
|
|
442
|
+
reference one of these instead of an ``Assignable`` (see
|
|
443
|
+
``Time.custom_activity``). Activities are scoped to a ``Project`` and a
|
|
444
|
+
``User``, so a name may repeat across projects.
|
|
445
|
+
|
|
446
|
+
Attributes:
|
|
447
|
+
created: When the activity was created
|
|
448
|
+
estimate: Estimated effort for the activity
|
|
449
|
+
project: Owning project reference
|
|
450
|
+
user: User the activity belongs to
|
|
451
|
+
"""
|
|
452
|
+
|
|
453
|
+
created: TPDateTime | None = Field(
|
|
454
|
+
default=None, alias="Created", description="Creation timestamp"
|
|
455
|
+
)
|
|
456
|
+
estimate: float | None = Field(default=None, alias="Estimate", description="Estimated effort")
|
|
457
|
+
project: EntityRef | None = Field(default=None, alias="Project", description="Project")
|
|
458
|
+
user: UserRef | None = Field(default=None, alias="User", description="Owning user")
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
class CustomRule(NamedEntity):
|
|
462
|
+
"""CustomRule entity - a user-defined business rule on the instance.
|
|
463
|
+
|
|
464
|
+
TP exposes rules for inspection and toggling only: the collection's
|
|
465
|
+
``/meta`` declares it neither creatable nor deletable, and ``is_enabled``
|
|
466
|
+
is the one settable field, so ``client.custom_rules`` accepts ``update``
|
|
467
|
+
and refuses ``create`` and ``delete`` in every mode.
|
|
468
|
+
|
|
469
|
+
Attributes:
|
|
470
|
+
description: Brief description of the rule
|
|
471
|
+
is_enabled: Whether the rule is switched on (the only settable field)
|
|
472
|
+
"""
|
|
473
|
+
|
|
474
|
+
description: str | None = Field(
|
|
475
|
+
default=None, alias="Description", description="Rule description"
|
|
476
|
+
)
|
|
477
|
+
is_enabled: bool | None = Field(default=None, alias="IsEnabled", description="Switched on")
|