workwire 0.6.0__tar.gz → 0.7.0__tar.gz

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.
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.7.0](https://github.com/workwire/workwire-python/compare/v0.6.0...v0.7.0) (2026-11-01)
4
+
5
+
6
+ ### Features
7
+
8
+ * **WOR-569:** backend v1.81.0's spec — jobs.update(reference=), PartyJob and JobRow gain reference ([#28](https://github.com/workwire/workwire-python/issues/28)) ([b94e055](https://github.com/workwire/workwire-python/commit/b94e0556429fbebacbda2f1d444d86f7b755838f))
9
+
3
10
  ## [0.6.0](https://github.com/workwire/workwire-python/compare/v0.5.0...v0.6.0) (2026-10-30)
4
11
 
5
12
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: workwire
3
- Version: 0.6.0
3
+ Version: 0.7.0
4
4
  Summary: Official Python SDK for the Workwire API
5
5
  Project-URL: Homepage, https://github.com/workwire/workwire-python
6
6
  Project-URL: Changelog, https://github.com/workwire/workwire-python/blob/main/CHANGELOG.md
@@ -101,8 +101,10 @@ with `--go-live`.
101
101
  Every project has a location tree under one `site` root
102
102
  (`project.root_location_id`). A party's scope is the locations its work
103
103
  covers, and it gets one Job (`JOB-…`) per scope location. A Job's
104
- `your_reference`, `quantity` and `checked_at` are your org's own, never
105
- shown to the other side.
104
+ `reference`, `quantity` and `checked_at` are your org's own, never shown to
105
+ the other side. `your_reference` is the deprecated spelling of `reference`
106
+ — still served beside it with the same value, and still accepted by
107
+ `client.jobs.update` (one or the other, never both).
106
108
 
107
109
  ```python
108
110
  from workwire import LocationNode, Party
@@ -130,7 +132,7 @@ client.wires.create(
130
132
  ],
131
133
  )
132
134
  page = client.jobs.list(project=project.id) # page.quantity_unit is your org's unit
133
- client.jobs.update(page.data[0].id, your_reference="PO-4471-A", quantity="12.5", checked=True)
135
+ client.jobs.update(page.data[0].id, reference="PO-4471-A", quantity="12.5", checked=True)
134
136
  ```
135
137
 
136
138
  A party Job — each of `client.wires.retrieve(...).parties[i].jobs`, and the
@@ -78,8 +78,10 @@ with `--go-live`.
78
78
  Every project has a location tree under one `site` root
79
79
  (`project.root_location_id`). A party's scope is the locations its work
80
80
  covers, and it gets one Job (`JOB-…`) per scope location. A Job's
81
- `your_reference`, `quantity` and `checked_at` are your org's own, never
82
- shown to the other side.
81
+ `reference`, `quantity` and `checked_at` are your org's own, never shown to
82
+ the other side. `your_reference` is the deprecated spelling of `reference`
83
+ — still served beside it with the same value, and still accepted by
84
+ `client.jobs.update` (one or the other, never both).
83
85
 
84
86
  ```python
85
87
  from workwire import LocationNode, Party
@@ -107,7 +109,7 @@ client.wires.create(
107
109
  ],
108
110
  )
109
111
  page = client.jobs.list(project=project.id) # page.quantity_unit is your org's unit
110
- client.jobs.update(page.data[0].id, your_reference="PO-4471-A", quantity="12.5", checked=True)
112
+ client.jobs.update(page.data[0].id, reference="PO-4471-A", quantity="12.5", checked=True)
111
113
  ```
112
114
 
113
115
  A party Job — each of `client.wires.retrieve(...).parties[i].jobs`, and the
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "workwire"
7
- version = "0.6.0"
7
+ version = "0.7.0"
8
8
  description = "Official Python SDK for the Workwire API"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -147,7 +147,7 @@ OPERATIONS: dict[str, dict[str, object]] = {
147
147
  "updateJob": {
148
148
  "method": "PATCH",
149
149
  "path": "/v1/jobs/{id}",
150
- "request_fields": {"your_reference", "quantity", "checked"},
150
+ "request_fields": {"reference", "your_reference", "quantity", "checked"},
151
151
  "query_params": set(),
152
152
  "response_model": _models.PartyJob,
153
153
  },
@@ -184,10 +184,12 @@ class PartyJob(WorkwireObject):
184
184
  """One Job on a wire party (``JOB-…``) — the party's work at one location
185
185
  of its scope. ``location_name``, ``location_kind`` and ``location_path``
186
186
  (the ancestors, root first; empty at the site root) are the server's
187
- description of where the Job sits in the GC's tree; ``your_reference``,
187
+ description of where the Job sits in the GC's tree; ``reference``,
188
188
  ``quantity`` and ``checked_at`` are **your org's own** fields, never the
189
189
  other side's. ``location_unit_type`` is the location's ``unit_type`` — the
190
- label a builder gives a unit's plan, ``None`` when unset."""
190
+ label a builder gives a unit's plan, ``None`` when unset.
191
+ ``your_reference`` is deprecated — still served, the same value as
192
+ ``reference``, which replaces it."""
191
193
 
192
194
  _nested = {"location_path": JobPathLocation}
193
195
 
@@ -198,6 +200,7 @@ class PartyJob(WorkwireObject):
198
200
  location_kind: str
199
201
  location_unit_type: str | None
200
202
  location_path: list[JobPathLocation]
203
+ reference: str | None
201
204
  your_reference: str | None
202
205
  quantity: str | None
203
206
  checked_at: str | None
@@ -400,15 +403,18 @@ class JobMilestones(WorkwireObject):
400
403
 
401
404
  class JobRow(WorkwireObject):
402
405
  """One row of :meth:`Jobs.list`: the Job with its party, wire, project,
403
- location and counterparty context. ``your_reference``, ``quantity`` and
406
+ location and counterparty context. ``reference``, ``quantity`` and
404
407
  ``checked_at`` are your org's own fields, never the other side's.
405
408
  ``location_unit_type`` is the location's ``unit_type`` — the label a
406
- builder gives a unit's plan, ``None`` when unset."""
409
+ builder gives a unit's plan, ``None`` when unset. ``your_reference`` is
410
+ deprecated — still served, the same value as ``reference``, which
411
+ replaces it."""
407
412
 
408
413
  _nested = {"location_path": JobPathLocation, "milestones": JobMilestones}
409
414
 
410
415
  id: str
411
416
  display_id: str
417
+ reference: str | None
412
418
  your_reference: str | None
413
419
  quantity: str | None
414
420
  checked_at: str | None
@@ -5,8 +5,10 @@ Jobs are derived: a party gets one per scope location
5
5
  (``scope_location_ids`` on ``Party.partnered(...)`` /
6
6
  ``Party.cold_invite(...)``; absent, the whole project), and nothing creates,
7
7
  names or closes one. Each org keeps its own private fields on a Job —
8
- ``your_reference``, ``quantity`` (in the org's ``quantity_unit``) and
9
- ``checked_at`` — never shown to the other side.
8
+ ``reference``, ``quantity`` (in the org's ``quantity_unit``) and
9
+ ``checked_at`` — never shown to the other side. ``your_reference`` is the
10
+ deprecated spelling of ``reference``: still served beside it, the same
11
+ value, and still accepted by :meth:`Jobs.update`.
10
12
  """
11
13
 
12
14
  from __future__ import annotations
@@ -121,6 +123,7 @@ class Jobs:
121
123
  self,
122
124
  job_id: str,
123
125
  *,
126
+ reference: str | None | NotGiven = NOT_GIVEN,
124
127
  your_reference: str | None | NotGiven = NOT_GIVEN,
125
128
  quantity: str | Decimal | None | NotGiven = NOT_GIVEN,
126
129
  checked: bool | None | NotGiven = NOT_GIVEN,
@@ -134,7 +137,10 @@ class Jobs:
134
137
  and the server keeps that field; an explicit ``None`` is sent as
135
138
  ``null`` and clears it. At least one is required.
136
139
 
137
- - ``your_reference`` — your own reference (≤200 characters).
140
+ - ``reference`` — your own reference (≤200 characters).
141
+ - ``your_reference`` — deprecated: still accepted in place of
142
+ ``reference`` and sent as ``your_reference``. Pass one or the
143
+ other, never both (``None`` counts as passed).
138
144
  - ``quantity`` — a decimal string (``"12.5"``) or a
139
145
  ``decimal.Decimal``, in your org's ``quantity_unit``; at most 2
140
146
  decimal places. Never a float.
@@ -145,7 +151,13 @@ class Jobs:
145
151
  your org is not a side of — a draft's Job, for the sub — is a
146
152
  ``NotFoundError``. Returns the Job as your org now sees it.
147
153
  """
154
+ if not isinstance(reference, NotGiven) and not isinstance(your_reference, NotGiven):
155
+ raise ValueError("pass reference or your_reference, not both")
148
156
  body: dict[str, Any] = {}
157
+ if not isinstance(reference, NotGiven):
158
+ if reference is not None and not isinstance(reference, str):
159
+ raise TypeError("reference must be a str or None")
160
+ body["reference"] = reference
149
161
  if not isinstance(your_reference, NotGiven):
150
162
  if your_reference is not None and not isinstance(your_reference, str):
151
163
  raise TypeError("your_reference must be a str or None")
@@ -158,7 +170,7 @@ class Jobs:
158
170
  body["checked"] = checked
159
171
  if not body:
160
172
  raise ValueError(
161
- "pass at least one of your_reference, quantity, checked "
173
+ "pass at least one of reference, quantity, checked "
162
174
  "(None clears a field; leaving one out keeps it)"
163
175
  )
164
176
  data, request_id = self._client._request(
File without changes
File without changes
File without changes
File without changes