Skip to content

Commit 0a7f3ed

Browse files
authored
feat(sdk): record-deconsolidation and is_former from robosystems group-lifecycle Phase 3 (#280)
## Summary Regenerated from robosystems `feature/group-lifecycle-phase-3` (group-lifecycle Phase 3, [rs #1926](RoboFinSystems/robosystems#1926)): the `record-deconsolidation` operation with its request and response models, and `is_former` on the ledger entity response. A client **minor**: additive only, generated tier. Waits on the robosystems release that carries [rs #1926](RoboFinSystems/robosystems#1926) before the new operation answers in production; the field and the operation resolve against any server once that release is deployed. Also swept in by the regen: `premium_transferred` on the ownership-change response (added by robosystems #1925, missed by 2.31.0), and `isFormer` in the checked-in `schema.graphql` (the hermetic ariadne-codegen gate is clean). ## Test plan - [x] Regenerated from the local API on the branch (`openapi.json` + the GraphQL schema) - [x] The repo gate green 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_015PxYaVzrbraKFeRALM7rXp
2 parents 937f1f9 + c0ce185 commit 0a7f3ed

10 files changed

Lines changed: 843 additions & 0 deletions
Lines changed: 314 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,314 @@
1+
from http import HTTPStatus
2+
from typing import Any
3+
from urllib.parse import quote
4+
5+
import httpx
6+
7+
from ... import errors
8+
from ...client import AuthenticatedClient, Client
9+
from ...models.error_response import ErrorResponse
10+
from ...models.operation_envelope_deconsolidation_response import (
11+
OperationEnvelopeDeconsolidationResponse,
12+
)
13+
from ...models.record_deconsolidation_request import RecordDeconsolidationRequest
14+
from ...types import UNSET, Response, Unset
15+
16+
17+
def _get_kwargs(
18+
graph_id: str,
19+
*,
20+
body: RecordDeconsolidationRequest,
21+
idempotency_key: None | str | Unset = UNSET,
22+
) -> dict[str, Any]:
23+
headers: dict[str, Any] = {}
24+
if not isinstance(idempotency_key, Unset):
25+
headers["Idempotency-Key"] = idempotency_key
26+
27+
_kwargs: dict[str, Any] = {
28+
"method": "post",
29+
"url": "/extensions/roboledger/{graph_id}/operations/record-deconsolidation".format(
30+
graph_id=quote(str(graph_id), safe=""),
31+
),
32+
}
33+
34+
_kwargs["json"] = body.to_dict()
35+
36+
headers["Content-Type"] = "application/json"
37+
38+
_kwargs["headers"] = headers
39+
return _kwargs
40+
41+
42+
def _parse_response(
43+
*, client: AuthenticatedClient | Client, response: httpx.Response
44+
) -> ErrorResponse | OperationEnvelopeDeconsolidationResponse | None:
45+
if response.status_code == 200:
46+
response_200 = OperationEnvelopeDeconsolidationResponse.from_dict(response.json())
47+
48+
return response_200
49+
50+
if response.status_code == 400:
51+
response_400 = ErrorResponse.from_dict(response.json())
52+
53+
return response_400
54+
55+
if response.status_code == 401:
56+
response_401 = ErrorResponse.from_dict(response.json())
57+
58+
return response_401
59+
60+
if response.status_code == 403:
61+
response_403 = ErrorResponse.from_dict(response.json())
62+
63+
return response_403
64+
65+
if response.status_code == 404:
66+
response_404 = ErrorResponse.from_dict(response.json())
67+
68+
return response_404
69+
70+
if response.status_code == 409:
71+
response_409 = ErrorResponse.from_dict(response.json())
72+
73+
return response_409
74+
75+
if response.status_code == 422:
76+
response_422 = ErrorResponse.from_dict(response.json())
77+
78+
return response_422
79+
80+
if response.status_code == 429:
81+
response_429 = ErrorResponse.from_dict(response.json())
82+
83+
return response_429
84+
85+
if response.status_code == 500:
86+
response_500 = ErrorResponse.from_dict(response.json())
87+
88+
return response_500
89+
90+
if client.raise_on_unexpected_status:
91+
raise errors.UnexpectedStatus(response.status_code, response.content)
92+
else:
93+
return None
94+
95+
96+
def _build_response(
97+
*, client: AuthenticatedClient | Client, response: httpx.Response
98+
) -> Response[ErrorResponse | OperationEnvelopeDeconsolidationResponse]:
99+
return Response(
100+
status_code=HTTPStatus(response.status_code),
101+
content=response.content,
102+
headers=response.headers,
103+
parsed=_parse_response(client=client, response=response),
104+
)
105+
106+
107+
def sync_detailed(
108+
graph_id: str,
109+
*,
110+
client: AuthenticatedClient,
111+
body: RecordDeconsolidationRequest,
112+
idempotency_key: None | str | Unset = UNSET,
113+
) -> Response[ErrorResponse | OperationEnvelopeDeconsolidationResponse]:
114+
"""Record Deconsolidation
115+
116+
Record a member's leaving the group, once `left_on` is set on it: what the parent received for its
117+
shares in cents (0 for a dissolution) and the basis. It writes a draft in the consolidation entity,
118+
dated the first day of the month after the member's last, that its close posts: what the
119+
consolidation entity still holds for the member on its balance-sheet accounts and as the outside
120+
owners' interest is taken off (goodwill, step-ups, the price above book of the investment, the
121+
outside owners' accumulated share), a member in full has the results it earned in the group put back
122+
into the group's equity as they leave with its books, and the difference is the gain or loss on its
123+
leaving: the group's adjustment to the gain the parent's own books took, so the consolidated gain is
124+
the consideration less the carrying amount of what left (ASC 810). The investment and intercompany
125+
eliminations go back on their own in that month's proposals. The parent's own sale entry stays on
126+
its books. Recording again replaces the draft; a posted deconsolidation is reversed first. A
127+
retained interest is not supported yet.
128+
129+
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
130+
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
131+
132+
Args:
133+
graph_id (str):
134+
idempotency_key (None | str | Unset):
135+
body (RecordDeconsolidationRequest): A member has left the group (`left_on` set): what the
136+
parent received
137+
for its shares, and the basis. The entry derecognizes what the
138+
consolidation entity still holds for the member and takes the gain or
139+
loss on its leaving; the parent's own sale entry stays on its books.
140+
141+
Raises:
142+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
143+
httpx.TimeoutException: If the request takes longer than Client.timeout.
144+
145+
Returns:
146+
Response[ErrorResponse | OperationEnvelopeDeconsolidationResponse]
147+
"""
148+
149+
kwargs = _get_kwargs(
150+
graph_id=graph_id,
151+
body=body,
152+
idempotency_key=idempotency_key,
153+
)
154+
155+
response = client.get_httpx_client().request(
156+
**kwargs,
157+
)
158+
159+
return _build_response(client=client, response=response)
160+
161+
162+
def sync(
163+
graph_id: str,
164+
*,
165+
client: AuthenticatedClient,
166+
body: RecordDeconsolidationRequest,
167+
idempotency_key: None | str | Unset = UNSET,
168+
) -> ErrorResponse | OperationEnvelopeDeconsolidationResponse | None:
169+
"""Record Deconsolidation
170+
171+
Record a member's leaving the group, once `left_on` is set on it: what the parent received for its
172+
shares in cents (0 for a dissolution) and the basis. It writes a draft in the consolidation entity,
173+
dated the first day of the month after the member's last, that its close posts: what the
174+
consolidation entity still holds for the member on its balance-sheet accounts and as the outside
175+
owners' interest is taken off (goodwill, step-ups, the price above book of the investment, the
176+
outside owners' accumulated share), a member in full has the results it earned in the group put back
177+
into the group's equity as they leave with its books, and the difference is the gain or loss on its
178+
leaving: the group's adjustment to the gain the parent's own books took, so the consolidated gain is
179+
the consideration less the carrying amount of what left (ASC 810). The investment and intercompany
180+
eliminations go back on their own in that month's proposals. The parent's own sale entry stays on
181+
its books. Recording again replaces the draft; a posted deconsolidation is reversed first. A
182+
retained interest is not supported yet.
183+
184+
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
185+
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
186+
187+
Args:
188+
graph_id (str):
189+
idempotency_key (None | str | Unset):
190+
body (RecordDeconsolidationRequest): A member has left the group (`left_on` set): what the
191+
parent received
192+
for its shares, and the basis. The entry derecognizes what the
193+
consolidation entity still holds for the member and takes the gain or
194+
loss on its leaving; the parent's own sale entry stays on its books.
195+
196+
Raises:
197+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
198+
httpx.TimeoutException: If the request takes longer than Client.timeout.
199+
200+
Returns:
201+
ErrorResponse | OperationEnvelopeDeconsolidationResponse
202+
"""
203+
204+
return sync_detailed(
205+
graph_id=graph_id,
206+
client=client,
207+
body=body,
208+
idempotency_key=idempotency_key,
209+
).parsed
210+
211+
212+
async def asyncio_detailed(
213+
graph_id: str,
214+
*,
215+
client: AuthenticatedClient,
216+
body: RecordDeconsolidationRequest,
217+
idempotency_key: None | str | Unset = UNSET,
218+
) -> Response[ErrorResponse | OperationEnvelopeDeconsolidationResponse]:
219+
"""Record Deconsolidation
220+
221+
Record a member's leaving the group, once `left_on` is set on it: what the parent received for its
222+
shares in cents (0 for a dissolution) and the basis. It writes a draft in the consolidation entity,
223+
dated the first day of the month after the member's last, that its close posts: what the
224+
consolidation entity still holds for the member on its balance-sheet accounts and as the outside
225+
owners' interest is taken off (goodwill, step-ups, the price above book of the investment, the
226+
outside owners' accumulated share), a member in full has the results it earned in the group put back
227+
into the group's equity as they leave with its books, and the difference is the gain or loss on its
228+
leaving: the group's adjustment to the gain the parent's own books took, so the consolidated gain is
229+
the consideration less the carrying amount of what left (ASC 810). The investment and intercompany
230+
eliminations go back on their own in that month's proposals. The parent's own sale entry stays on
231+
its books. Recording again replaces the draft; a posted deconsolidation is reversed first. A
232+
retained interest is not supported yet.
233+
234+
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
235+
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
236+
237+
Args:
238+
graph_id (str):
239+
idempotency_key (None | str | Unset):
240+
body (RecordDeconsolidationRequest): A member has left the group (`left_on` set): what the
241+
parent received
242+
for its shares, and the basis. The entry derecognizes what the
243+
consolidation entity still holds for the member and takes the gain or
244+
loss on its leaving; the parent's own sale entry stays on its books.
245+
246+
Raises:
247+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
248+
httpx.TimeoutException: If the request takes longer than Client.timeout.
249+
250+
Returns:
251+
Response[ErrorResponse | OperationEnvelopeDeconsolidationResponse]
252+
"""
253+
254+
kwargs = _get_kwargs(
255+
graph_id=graph_id,
256+
body=body,
257+
idempotency_key=idempotency_key,
258+
)
259+
260+
response = await client.get_async_httpx_client().request(**kwargs)
261+
262+
return _build_response(client=client, response=response)
263+
264+
265+
async def asyncio(
266+
graph_id: str,
267+
*,
268+
client: AuthenticatedClient,
269+
body: RecordDeconsolidationRequest,
270+
idempotency_key: None | str | Unset = UNSET,
271+
) -> ErrorResponse | OperationEnvelopeDeconsolidationResponse | None:
272+
"""Record Deconsolidation
273+
274+
Record a member's leaving the group, once `left_on` is set on it: what the parent received for its
275+
shares in cents (0 for a dissolution) and the basis. It writes a draft in the consolidation entity,
276+
dated the first day of the month after the member's last, that its close posts: what the
277+
consolidation entity still holds for the member on its balance-sheet accounts and as the outside
278+
owners' interest is taken off (goodwill, step-ups, the price above book of the investment, the
279+
outside owners' accumulated share), a member in full has the results it earned in the group put back
280+
into the group's equity as they leave with its books, and the difference is the gain or loss on its
281+
leaving: the group's adjustment to the gain the parent's own books took, so the consolidated gain is
282+
the consideration less the carrying amount of what left (ASC 810). The investment and intercompany
283+
eliminations go back on their own in that month's proposals. The parent's own sale entry stays on
284+
its books. Recording again replaces the draft; a posted deconsolidation is reversed first. A
285+
retained interest is not supported yet.
286+
287+
**Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours
288+
return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict.
289+
290+
Args:
291+
graph_id (str):
292+
idempotency_key (None | str | Unset):
293+
body (RecordDeconsolidationRequest): A member has left the group (`left_on` set): what the
294+
parent received
295+
for its shares, and the basis. The entry derecognizes what the
296+
consolidation entity still holds for the member and takes the gain or
297+
loss on its leaving; the parent's own sale entry stays on its books.
298+
299+
Raises:
300+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
301+
httpx.TimeoutException: If the request takes longer than Client.timeout.
302+
303+
Returns:
304+
ErrorResponse | OperationEnvelopeDeconsolidationResponse
305+
"""
306+
307+
return (
308+
await asyncio_detailed(
309+
graph_id=graph_id,
310+
client=client,
311+
body=body,
312+
idempotency_key=idempotency_key,
313+
)
314+
).parsed

‎robosystems_client/graphql/schema.graphql‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1816,6 +1816,11 @@ type LedgerEntity {
18161816
"""
18171817
leftOn: Date
18181818

1819+
"""
1820+
True once the month this entity left the group is over: its months in the group are history, readable under it, and it is no longer current. False for a member still in, and through the month it leaves.
1821+
"""
1822+
isFormer: Boolean!
1823+
18191824
"""Provenance: 'native' | 'sec' | 'quickbooks' | 'xero' | 'plaid'."""
18201825
source: String!
18211826

‎robosystems_client/models/__init__.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@
179179
from .database_health_response import DatabaseHealthResponse
180180
from .database_info_response import DatabaseInfoResponse
181181
from .database_storage_entry import DatabaseStorageEntry
182+
from .deconsolidation_response import DeconsolidationResponse
182183
from .delete_connection_disposition import DeleteConnectionDisposition
183184
from .delete_document_op import DeleteDocumentOp
184185
from .delete_file_op import DeleteFileOp
@@ -202,6 +203,7 @@
202203
from .delete_subgraph_op import DeleteSubgraphOp
203204
from .delete_taxonomy_block_request import DeleteTaxonomyBlockRequest
204205
from .delete_taxonomy_block_response import DeleteTaxonomyBlockResponse
206+
from .derecognized_balance import DerecognizedBalance
205207
from .describe_filing_request import DescribeFilingRequest
206208
from .describe_filing_response import DescribeFilingResponse
207209
from .describe_filing_response_counts_type_0 import DescribeFilingResponseCountsType0
@@ -552,6 +554,12 @@
552554
from .operation_envelope_consolidation_worksheet_response_status import (
553555
OperationEnvelopeConsolidationWorksheetResponseStatus,
554556
)
557+
from .operation_envelope_deconsolidation_response import (
558+
OperationEnvelopeDeconsolidationResponse,
559+
)
560+
from .operation_envelope_deconsolidation_response_status import (
561+
OperationEnvelopeDeconsolidationResponseStatus,
562+
)
555563
from .operation_envelope_delete_information_block_response import (
556564
OperationEnvelopeDeleteInformationBlockResponse,
557565
)
@@ -961,6 +969,7 @@
961969
)
962970
from .reconciling_item_regenerated import ReconcilingItemRegenerated
963971
from .record_acquisition_request import RecordAcquisitionRequest
972+
from .record_deconsolidation_request import RecordDeconsolidationRequest
964973
from .record_opening_balance_request import RecordOpeningBalanceRequest
965974
from .record_ownership_change_request import RecordOwnershipChangeRequest
966975
from .record_statement_balance_request import RecordStatementBalanceRequest
@@ -1388,6 +1397,7 @@
13881397
"DatabaseHealthResponse",
13891398
"DatabaseInfoResponse",
13901399
"DatabaseStorageEntry",
1400+
"DeconsolidationResponse",
13911401
"DeleteConnectionDisposition",
13921402
"DeleteDocumentOp",
13931403
"DeleteFileOp",
@@ -1411,6 +1421,7 @@
14111421
"DeleteSubgraphOp",
14121422
"DeleteTaxonomyBlockRequest",
14131423
"DeleteTaxonomyBlockResponse",
1424+
"DerecognizedBalance",
14141425
"DescribeFilingRequest",
14151426
"DescribeFilingResponse",
14161427
"DescribeFilingResponseCountsType0",
@@ -1647,6 +1658,8 @@
16471658
"OperationEnvelopeComputeMetricsResponseStatus",
16481659
"OperationEnvelopeConsolidationWorksheetResponse",
16491660
"OperationEnvelopeConsolidationWorksheetResponseStatus",
1661+
"OperationEnvelopeDeconsolidationResponse",
1662+
"OperationEnvelopeDeconsolidationResponseStatus",
16501663
"OperationEnvelopeDeleteInformationBlockResponse",
16511664
"OperationEnvelopeDeleteInformationBlockResponseStatus",
16521665
"OperationEnvelopeDeletePortfolioBlockResponse",
@@ -1858,6 +1871,7 @@
18581871
"ReconcilingItemPlanDefaultDisposition",
18591872
"ReconcilingItemRegenerated",
18601873
"RecordAcquisitionRequest",
1874+
"RecordDeconsolidationRequest",
18611875
"RecordOpeningBalanceRequest",
18621876
"RecordOwnershipChangeRequest",
18631877
"RecordStatementBalanceRequest",

0 commit comments

Comments
 (0)