From d98c7e87fe1097f0168ac7bd749c6182a40b82d4 Mon Sep 17 00:00:00 2001 From: "Joseph T. French" Date: Thu, 7 May 2026 01:43:42 -0500 Subject: [PATCH 1/4] feat: Add new models for security response terms, statement mechanics, and legacy updates - Introduced `SecurityResponseTerms` model to handle instrument-specific terms. - Added `StatementMechanics` model for renderer mechanics related to various statement types. - Created `UpdateLegacyArm` and `UpdateLegacyArmBlockType` models for handling updates to legacy arms. - Implemented `UpdateLegacyArmPayload` model for untyped payloads in legacy updates. - Developed `UpdateScheduleArm` and `UpdateScheduleRequest` models for schedule updates. - Added `ValidationLite` and `VerificationResultLite` models for validation outcomes and verification results. - Introduced `ViewProjections` model to manage different view projections at the envelope boundary. --- .../op_create_portfolio_block.py | 50 +- .../op_create_security.py | 66 ++- .../op_delete_portfolio_block.py | 61 ++- .../op_delete_security.py | 30 +- .../op_update_portfolio_block.py | 50 +- .../op_update_security.py | 38 +- .../op_create_event_block.py | 50 +- .../op_create_information_block.py | 132 +++--- .../op_delete_information_block.py | 119 +++-- .../op_update_event_block.py | 50 +- .../op_update_information_block.py | 120 +++-- .../api/graph_operations/op_delete_graph.py | 12 +- .../cancel_repository_subscription.py | 23 +- robosystems_client/clients/ledger_client.py | 34 +- robosystems_client/models/__init__.py | 172 ++++++- .../models/artifact_response.py | 184 ++++++++ ...y => artifact_response_template_type_0.py} | 10 +- .../models/classification_lite.py | 143 ++++++ robosystems_client/models/connection_lite.py | 180 +++++++ .../models/create_event_block_request.py | 25 +- .../create_event_block_request_metadata.py | 6 +- .../create_information_block_request.py | 100 ---- .../models/create_legacy_arm.py | 97 ++++ .../models/create_legacy_arm_block_type.py | 12 + ...ayload.py => create_legacy_arm_payload.py} | 14 +- .../models/create_portfolio_block_request.py | 3 +- .../models/create_schedule_arm.py | 81 ++++ .../models/create_schedule_request.py | 222 +++++++++ .../models/create_security_request.py | 35 +- .../models/create_security_request_terms.py | 6 +- .../delete_information_block_response.py | 93 ++++ ..._block_request.py => delete_legacy_arm.py} | 49 +- .../models/delete_legacy_arm_block_type.py | 12 + ...ayload.py => delete_legacy_arm_payload.py} | 14 +- .../delete_portfolio_block_operation.py | 4 +- .../models/delete_portfolio_block_response.py | 79 ++++ robosystems_client/models/delete_result.py | 65 +++ .../models/delete_schedule_arm.py | 86 ++++ .../models/delete_schedule_request.py | 68 +++ robosystems_client/models/element_lite.py | 183 ++++++++ robosystems_client/models/entity_lite.py | 95 ++++ .../models/entry_template_request.py | 109 +++++ .../entry_template_request_entry_type.py | 11 + .../models/event_block_envelope.py | 439 ++++++++++++++++++ ...ad.py => event_block_envelope_metadata.py} | 14 +- robosystems_client/models/fact_lite.py | 165 +++++++ robosystems_client/models/fact_set_lite.py | 167 +++++++ .../models/information_block_envelope.py | 383 +++++++++++++++ ...ormation_block_envelope_dimensions_item.py | 47 ++ .../models/information_model_response.py | 97 ++++ robosystems_client/models/metric_mechanics.py | 144 ++++++ .../models/operation_envelope.py | 48 +- ...elope_delete_information_block_response.py | 162 +++++++ ...elete_information_block_response_status.py | 10 + ...nvelope_delete_portfolio_block_response.py | 158 +++++++ ..._delete_portfolio_block_response_status.py | 10 + .../operation_envelope_delete_result.py | 158 +++++++ ...operation_envelope_delete_result_status.py | 10 + ...operation_envelope_event_block_envelope.py | 158 +++++++ ...on_envelope_event_block_envelope_status.py | 10 + ...ion_envelope_information_block_envelope.py | 158 +++++++ ...elope_information_block_envelope_status.py | 10 + ...ation_envelope_portfolio_block_envelope.py | 158 +++++++ ...nvelope_portfolio_block_envelope_status.py | 10 + .../operation_envelope_security_response.py | 158 +++++++ ...ation_envelope_security_response_status.py | 10 + .../models/portfolio_block_envelope.py | 270 +++++++++++ .../portfolio_block_portfolio_fields.py | 15 +- .../models/portfolio_block_portfolio_patch.py | 13 +- .../models/portfolio_block_position_add.py | 26 +- .../portfolio_block_position_dispose.py | 6 +- .../models/portfolio_block_position_update.py | 19 +- .../models/portfolio_block_positions.py | 9 +- robosystems_client/models/position_block.py | 243 ++++++++++ robosystems_client/models/rendering_lite.py | 152 ++++++ .../models/rendering_period_lite.py | 94 ++++ .../models/rendering_row_lite.py | 186 ++++++++ robosystems_client/models/rule_lite.py | 199 ++++++++ robosystems_client/models/rule_target_lite.py | 72 +++ .../models/rule_variable_lite.py | 70 +++ .../models/schedule_mechanics.py | 136 ++++++ .../models/schedule_metadata_request.py | 146 ++++++ robosystems_client/models/security_lite.py | 169 +++++++ .../models/security_response.py | 243 ++++++++++ .../models/security_response_terms.py | 50 ++ .../models/statement_mechanics.py | 116 +++++ .../models/update_event_block_request.py | 8 +- ..._block_request.py => update_legacy_arm.py} | 46 +- .../models/update_legacy_arm_block_type.py | 12 + .../models/update_legacy_arm_payload.py | 50 ++ .../models/update_schedule_arm.py | 91 ++++ .../models/update_schedule_request.py | 167 +++++++ .../models/update_security_operation.py | 21 +- robosystems_client/models/validation_lite.py | 100 ++++ .../models/verification_result_lite.py | 238 ++++++++++ robosystems_client/models/view_projections.py | 105 +++++ 96 files changed, 8168 insertions(+), 581 deletions(-) create mode 100644 robosystems_client/models/artifact_response.py rename robosystems_client/models/{operation_envelope_result_type_0.py => artifact_response_template_type_0.py} (80%) create mode 100644 robosystems_client/models/classification_lite.py create mode 100644 robosystems_client/models/connection_lite.py delete mode 100644 robosystems_client/models/create_information_block_request.py create mode 100644 robosystems_client/models/create_legacy_arm.py create mode 100644 robosystems_client/models/create_legacy_arm_block_type.py rename robosystems_client/models/{delete_information_block_request_payload.py => create_legacy_arm_payload.py} (69%) create mode 100644 robosystems_client/models/create_schedule_arm.py create mode 100644 robosystems_client/models/create_schedule_request.py create mode 100644 robosystems_client/models/delete_information_block_response.py rename robosystems_client/models/{update_information_block_request.py => delete_legacy_arm.py} (50%) create mode 100644 robosystems_client/models/delete_legacy_arm_block_type.py rename robosystems_client/models/{create_information_block_request_payload.py => delete_legacy_arm_payload.py} (68%) create mode 100644 robosystems_client/models/delete_portfolio_block_response.py create mode 100644 robosystems_client/models/delete_result.py create mode 100644 robosystems_client/models/delete_schedule_arm.py create mode 100644 robosystems_client/models/delete_schedule_request.py create mode 100644 robosystems_client/models/element_lite.py create mode 100644 robosystems_client/models/entity_lite.py create mode 100644 robosystems_client/models/entry_template_request.py create mode 100644 robosystems_client/models/entry_template_request_entry_type.py create mode 100644 robosystems_client/models/event_block_envelope.py rename robosystems_client/models/{update_information_block_request_payload.py => event_block_envelope_metadata.py} (66%) create mode 100644 robosystems_client/models/fact_lite.py create mode 100644 robosystems_client/models/fact_set_lite.py create mode 100644 robosystems_client/models/information_block_envelope.py create mode 100644 robosystems_client/models/information_block_envelope_dimensions_item.py create mode 100644 robosystems_client/models/information_model_response.py create mode 100644 robosystems_client/models/metric_mechanics.py create mode 100644 robosystems_client/models/operation_envelope_delete_information_block_response.py create mode 100644 robosystems_client/models/operation_envelope_delete_information_block_response_status.py create mode 100644 robosystems_client/models/operation_envelope_delete_portfolio_block_response.py create mode 100644 robosystems_client/models/operation_envelope_delete_portfolio_block_response_status.py create mode 100644 robosystems_client/models/operation_envelope_delete_result.py create mode 100644 robosystems_client/models/operation_envelope_delete_result_status.py create mode 100644 robosystems_client/models/operation_envelope_event_block_envelope.py create mode 100644 robosystems_client/models/operation_envelope_event_block_envelope_status.py create mode 100644 robosystems_client/models/operation_envelope_information_block_envelope.py create mode 100644 robosystems_client/models/operation_envelope_information_block_envelope_status.py create mode 100644 robosystems_client/models/operation_envelope_portfolio_block_envelope.py create mode 100644 robosystems_client/models/operation_envelope_portfolio_block_envelope_status.py create mode 100644 robosystems_client/models/operation_envelope_security_response.py create mode 100644 robosystems_client/models/operation_envelope_security_response_status.py create mode 100644 robosystems_client/models/portfolio_block_envelope.py create mode 100644 robosystems_client/models/position_block.py create mode 100644 robosystems_client/models/rendering_lite.py create mode 100644 robosystems_client/models/rendering_period_lite.py create mode 100644 robosystems_client/models/rendering_row_lite.py create mode 100644 robosystems_client/models/rule_lite.py create mode 100644 robosystems_client/models/rule_target_lite.py create mode 100644 robosystems_client/models/rule_variable_lite.py create mode 100644 robosystems_client/models/schedule_mechanics.py create mode 100644 robosystems_client/models/schedule_metadata_request.py create mode 100644 robosystems_client/models/security_lite.py create mode 100644 robosystems_client/models/security_response.py create mode 100644 robosystems_client/models/security_response_terms.py create mode 100644 robosystems_client/models/statement_mechanics.py rename robosystems_client/models/{delete_information_block_request.py => update_legacy_arm.py} (53%) create mode 100644 robosystems_client/models/update_legacy_arm_block_type.py create mode 100644 robosystems_client/models/update_legacy_arm_payload.py create mode 100644 robosystems_client/models/update_schedule_arm.py create mode 100644 robosystems_client/models/update_schedule_request.py create mode 100644 robosystems_client/models/validation_lite.py create mode 100644 robosystems_client/models/verification_result_lite.py create mode 100644 robosystems_client/models/view_projections.py diff --git a/robosystems_client/api/extensions_robo_investor/op_create_portfolio_block.py b/robosystems_client/api/extensions_robo_investor/op_create_portfolio_block.py index 9657833..789e69a 100644 --- a/robosystems_client/api/extensions_robo_investor/op_create_portfolio_block.py +++ b/robosystems_client/api/extensions_robo_investor/op_create_portfolio_block.py @@ -8,7 +8,9 @@ from ...client import AuthenticatedClient, Client from ...models.create_portfolio_block_request import CreatePortfolioBlockRequest from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_portfolio_block_envelope import ( + OperationEnvelopePortfolioBlockEnvelope, +) from ...models.operation_error import OperationError from ...types import UNSET, Response, Unset @@ -40,9 +42,15 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopePortfolioBlockEnvelope + | OperationError + | None +): if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopePortfolioBlockEnvelope.from_dict(response.json()) return response_200 @@ -90,7 +98,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopePortfolioBlockEnvelope | OperationError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -105,7 +115,9 @@ def sync_detailed( client: AuthenticatedClient, body: CreatePortfolioBlockRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopePortfolioBlockEnvelope | OperationError +]: """Create Portfolio Block Create a portfolio with optional initial positions in a single atomic envelope. Each position @@ -130,7 +142,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopePortfolioBlockEnvelope | OperationError] """ kwargs = _get_kwargs( @@ -152,7 +164,13 @@ def sync( client: AuthenticatedClient, body: CreatePortfolioBlockRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopePortfolioBlockEnvelope + | OperationError + | None +): """Create Portfolio Block Create a portfolio with optional initial positions in a single atomic envelope. Each position @@ -177,7 +195,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopePortfolioBlockEnvelope | OperationError """ return sync_detailed( @@ -194,7 +212,9 @@ async def asyncio_detailed( client: AuthenticatedClient, body: CreatePortfolioBlockRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopePortfolioBlockEnvelope | OperationError +]: """Create Portfolio Block Create a portfolio with optional initial positions in a single atomic envelope. Each position @@ -219,7 +239,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopePortfolioBlockEnvelope | OperationError] """ kwargs = _get_kwargs( @@ -239,7 +259,13 @@ async def asyncio( client: AuthenticatedClient, body: CreatePortfolioBlockRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopePortfolioBlockEnvelope + | OperationError + | None +): """Create Portfolio Block Create a portfolio with optional initial positions in a single atomic envelope. Each position @@ -264,7 +290,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopePortfolioBlockEnvelope | OperationError """ return ( diff --git a/robosystems_client/api/extensions_robo_investor/op_create_security.py b/robosystems_client/api/extensions_robo_investor/op_create_security.py index e315e6c..eee3f09 100644 --- a/robosystems_client/api/extensions_robo_investor/op_create_security.py +++ b/robosystems_client/api/extensions_robo_investor/op_create_security.py @@ -8,7 +8,9 @@ from ...client import AuthenticatedClient, Client from ...models.create_security_request import CreateSecurityRequest from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_security_response import ( + OperationEnvelopeSecurityResponse, +) from ...models.operation_error import OperationError from ...types import UNSET, Response, Unset @@ -40,9 +42,11 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any | HTTPValidationError | OperationEnvelopeSecurityResponse | OperationError | None +): if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeSecurityResponse.from_dict(response.json()) return response_200 @@ -90,7 +94,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeSecurityResponse | OperationError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -105,7 +111,9 @@ def sync_detailed( client: AuthenticatedClient, body: CreateSecurityRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeSecurityResponse | OperationError +]: """Create Security Register a security (common stock, preferred stock, warrant, convertible note, etc.) owned by this @@ -118,14 +126,19 @@ def sync_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (CreateSecurityRequest): + body (CreateSecurityRequest): CQRS body for `POST /operations/create-security`. + + Mints a new security as Master Data — referenced by positions, never + created inline by portfolio operations. The `terms` blob carries + instrument-specific shape (liquidation preference, strike price, + vesting) used by future waterfall-distribution modeling. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeSecurityResponse | OperationError] """ kwargs = _get_kwargs( @@ -147,7 +160,9 @@ def sync( client: AuthenticatedClient, body: CreateSecurityRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any | HTTPValidationError | OperationEnvelopeSecurityResponse | OperationError | None +): """Create Security Register a security (common stock, preferred stock, warrant, convertible note, etc.) owned by this @@ -160,14 +175,19 @@ def sync( Args: graph_id (str): idempotency_key (None | str | Unset): - body (CreateSecurityRequest): + body (CreateSecurityRequest): CQRS body for `POST /operations/create-security`. + + Mints a new security as Master Data — referenced by positions, never + created inline by portfolio operations. The `terms` blob carries + instrument-specific shape (liquidation preference, strike price, + vesting) used by future waterfall-distribution modeling. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeSecurityResponse | OperationError """ return sync_detailed( @@ -184,7 +204,9 @@ async def asyncio_detailed( client: AuthenticatedClient, body: CreateSecurityRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeSecurityResponse | OperationError +]: """Create Security Register a security (common stock, preferred stock, warrant, convertible note, etc.) owned by this @@ -197,14 +219,19 @@ async def asyncio_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (CreateSecurityRequest): + body (CreateSecurityRequest): CQRS body for `POST /operations/create-security`. + + Mints a new security as Master Data — referenced by positions, never + created inline by portfolio operations. The `terms` blob carries + instrument-specific shape (liquidation preference, strike price, + vesting) used by future waterfall-distribution modeling. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeSecurityResponse | OperationError] """ kwargs = _get_kwargs( @@ -224,7 +251,9 @@ async def asyncio( client: AuthenticatedClient, body: CreateSecurityRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any | HTTPValidationError | OperationEnvelopeSecurityResponse | OperationError | None +): """Create Security Register a security (common stock, preferred stock, warrant, convertible note, etc.) owned by this @@ -237,14 +266,19 @@ async def asyncio( Args: graph_id (str): idempotency_key (None | str | Unset): - body (CreateSecurityRequest): + body (CreateSecurityRequest): CQRS body for `POST /operations/create-security`. + + Mints a new security as Master Data — referenced by positions, never + created inline by portfolio operations. The `terms` blob carries + instrument-specific shape (liquidation preference, strike price, + vesting) used by future waterfall-distribution modeling. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeSecurityResponse | OperationError """ return ( diff --git a/robosystems_client/api/extensions_robo_investor/op_delete_portfolio_block.py b/robosystems_client/api/extensions_robo_investor/op_delete_portfolio_block.py index 8ad39da..3f29652 100644 --- a/robosystems_client/api/extensions_robo_investor/op_delete_portfolio_block.py +++ b/robosystems_client/api/extensions_robo_investor/op_delete_portfolio_block.py @@ -8,7 +8,9 @@ from ...client import AuthenticatedClient, Client from ...models.delete_portfolio_block_operation import DeletePortfolioBlockOperation from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_delete_portfolio_block_response import ( + OperationEnvelopeDeletePortfolioBlockResponse, +) from ...models.operation_error import OperationError from ...types import UNSET, Response, Unset @@ -40,9 +42,17 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeDeletePortfolioBlockResponse + | OperationError + | None +): if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeDeletePortfolioBlockResponse.from_dict( + response.json() + ) return response_200 @@ -90,7 +100,12 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any + | HTTPValidationError + | OperationEnvelopeDeletePortfolioBlockResponse + | OperationError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -105,7 +120,12 @@ def sync_detailed( client: AuthenticatedClient, body: DeletePortfolioBlockOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any + | HTTPValidationError + | OperationEnvelopeDeletePortfolioBlockResponse + | OperationError +]: """Delete Portfolio Block Cascade-delete the portfolio plus all of its positions. When active positions exist, the request @@ -131,7 +151,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeDeletePortfolioBlockResponse | OperationError] """ kwargs = _get_kwargs( @@ -153,7 +173,13 @@ def sync( client: AuthenticatedClient, body: DeletePortfolioBlockOperation, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeDeletePortfolioBlockResponse + | OperationError + | None +): """Delete Portfolio Block Cascade-delete the portfolio plus all of its positions. When active positions exist, the request @@ -179,7 +205,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeDeletePortfolioBlockResponse | OperationError """ return sync_detailed( @@ -196,7 +222,12 @@ async def asyncio_detailed( client: AuthenticatedClient, body: DeletePortfolioBlockOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any + | HTTPValidationError + | OperationEnvelopeDeletePortfolioBlockResponse + | OperationError +]: """Delete Portfolio Block Cascade-delete the portfolio plus all of its positions. When active positions exist, the request @@ -222,7 +253,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeDeletePortfolioBlockResponse | OperationError] """ kwargs = _get_kwargs( @@ -242,7 +273,13 @@ async def asyncio( client: AuthenticatedClient, body: DeletePortfolioBlockOperation, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeDeletePortfolioBlockResponse + | OperationError + | None +): """Delete Portfolio Block Cascade-delete the portfolio plus all of its positions. When active positions exist, the request @@ -268,7 +305,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeDeletePortfolioBlockResponse | OperationError """ return ( diff --git a/robosystems_client/api/extensions_robo_investor/op_delete_security.py b/robosystems_client/api/extensions_robo_investor/op_delete_security.py index a7e18bc..89e3687 100644 --- a/robosystems_client/api/extensions_robo_investor/op_delete_security.py +++ b/robosystems_client/api/extensions_robo_investor/op_delete_security.py @@ -8,7 +8,7 @@ from ...client import AuthenticatedClient, Client from ...models.delete_security_operation import DeleteSecurityOperation from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_delete_result import OperationEnvelopeDeleteResult from ...models.operation_error import OperationError from ...types import UNSET, Response, Unset @@ -40,9 +40,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> Any | HTTPValidationError | OperationEnvelopeDeleteResult | OperationError | None: if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeDeleteResult.from_dict(response.json()) return response_200 @@ -90,7 +90,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeDeleteResult | OperationError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -105,7 +107,9 @@ def sync_detailed( client: AuthenticatedClient, body: DeleteSecurityOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeDeleteResult | OperationError +]: """Delete Security Soft-delete the security (`is_active=false`). Historical positions referencing it remain valid. @@ -124,7 +128,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeDeleteResult | OperationError] """ kwargs = _get_kwargs( @@ -146,7 +150,7 @@ def sync( client: AuthenticatedClient, body: DeleteSecurityOperation, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> Any | HTTPValidationError | OperationEnvelopeDeleteResult | OperationError | None: """Delete Security Soft-delete the security (`is_active=false`). Historical positions referencing it remain valid. @@ -165,7 +169,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeDeleteResult | OperationError """ return sync_detailed( @@ -182,7 +186,9 @@ async def asyncio_detailed( client: AuthenticatedClient, body: DeleteSecurityOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeDeleteResult | OperationError +]: """Delete Security Soft-delete the security (`is_active=false`). Historical positions referencing it remain valid. @@ -201,7 +207,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeDeleteResult | OperationError] """ kwargs = _get_kwargs( @@ -221,7 +227,7 @@ async def asyncio( client: AuthenticatedClient, body: DeleteSecurityOperation, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> Any | HTTPValidationError | OperationEnvelopeDeleteResult | OperationError | None: """Delete Security Soft-delete the security (`is_active=false`). Historical positions referencing it remain valid. @@ -240,7 +246,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeDeleteResult | OperationError """ return ( diff --git a/robosystems_client/api/extensions_robo_investor/op_update_portfolio_block.py b/robosystems_client/api/extensions_robo_investor/op_update_portfolio_block.py index 83d10d0..1b738ea 100644 --- a/robosystems_client/api/extensions_robo_investor/op_update_portfolio_block.py +++ b/robosystems_client/api/extensions_robo_investor/op_update_portfolio_block.py @@ -7,7 +7,9 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_portfolio_block_envelope import ( + OperationEnvelopePortfolioBlockEnvelope, +) from ...models.operation_error import OperationError from ...models.update_portfolio_block_operation import UpdatePortfolioBlockOperation from ...types import UNSET, Response, Unset @@ -40,9 +42,15 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopePortfolioBlockEnvelope + | OperationError + | None +): if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopePortfolioBlockEnvelope.from_dict(response.json()) return response_200 @@ -90,7 +98,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopePortfolioBlockEnvelope | OperationError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -105,7 +115,9 @@ def sync_detailed( client: AuthenticatedClient, body: UpdatePortfolioBlockOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopePortfolioBlockEnvelope | OperationError +]: """Update Portfolio Block Patch portfolio fields and apply position deltas (`add` / `update` / `dispose`) atomically. Partial @@ -129,7 +141,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopePortfolioBlockEnvelope | OperationError] """ kwargs = _get_kwargs( @@ -151,7 +163,13 @@ def sync( client: AuthenticatedClient, body: UpdatePortfolioBlockOperation, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopePortfolioBlockEnvelope + | OperationError + | None +): """Update Portfolio Block Patch portfolio fields and apply position deltas (`add` / `update` / `dispose`) atomically. Partial @@ -175,7 +193,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopePortfolioBlockEnvelope | OperationError """ return sync_detailed( @@ -192,7 +210,9 @@ async def asyncio_detailed( client: AuthenticatedClient, body: UpdatePortfolioBlockOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopePortfolioBlockEnvelope | OperationError +]: """Update Portfolio Block Patch portfolio fields and apply position deltas (`add` / `update` / `dispose`) atomically. Partial @@ -216,7 +236,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopePortfolioBlockEnvelope | OperationError] """ kwargs = _get_kwargs( @@ -236,7 +256,13 @@ async def asyncio( client: AuthenticatedClient, body: UpdatePortfolioBlockOperation, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopePortfolioBlockEnvelope + | OperationError + | None +): """Update Portfolio Block Patch portfolio fields and apply position deltas (`add` / `update` / `dispose`) atomically. Partial @@ -260,7 +286,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopePortfolioBlockEnvelope | OperationError """ return ( diff --git a/robosystems_client/api/extensions_robo_investor/op_update_security.py b/robosystems_client/api/extensions_robo_investor/op_update_security.py index 60a37ef..c637126 100644 --- a/robosystems_client/api/extensions_robo_investor/op_update_security.py +++ b/robosystems_client/api/extensions_robo_investor/op_update_security.py @@ -7,7 +7,9 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_security_response import ( + OperationEnvelopeSecurityResponse, +) from ...models.operation_error import OperationError from ...models.update_security_operation import UpdateSecurityOperation from ...types import UNSET, Response, Unset @@ -40,9 +42,11 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any | HTTPValidationError | OperationEnvelopeSecurityResponse | OperationError | None +): if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeSecurityResponse.from_dict(response.json()) return response_200 @@ -90,7 +94,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeSecurityResponse | OperationError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -105,7 +111,9 @@ def sync_detailed( client: AuthenticatedClient, body: UpdateSecurityOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeSecurityResponse | OperationError +]: """Update Security Update mutable fields on a security (name, type, subtype, terms, share counts, entity linkage). @@ -124,7 +132,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeSecurityResponse | OperationError] """ kwargs = _get_kwargs( @@ -146,7 +154,9 @@ def sync( client: AuthenticatedClient, body: UpdateSecurityOperation, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any | HTTPValidationError | OperationEnvelopeSecurityResponse | OperationError | None +): """Update Security Update mutable fields on a security (name, type, subtype, terms, share counts, entity linkage). @@ -165,7 +175,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeSecurityResponse | OperationError """ return sync_detailed( @@ -182,7 +192,9 @@ async def asyncio_detailed( client: AuthenticatedClient, body: UpdateSecurityOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeSecurityResponse | OperationError +]: """Update Security Update mutable fields on a security (name, type, subtype, terms, share counts, entity linkage). @@ -201,7 +213,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeSecurityResponse | OperationError] """ kwargs = _get_kwargs( @@ -221,7 +233,9 @@ async def asyncio( client: AuthenticatedClient, body: UpdateSecurityOperation, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any | HTTPValidationError | OperationEnvelopeSecurityResponse | OperationError | None +): """Update Security Update mutable fields on a security (name, type, subtype, terms, share counts, entity linkage). @@ -240,7 +254,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeSecurityResponse | OperationError """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_create_event_block.py b/robosystems_client/api/extensions_robo_ledger/op_create_event_block.py index 6b4dd9f..830822d 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_create_event_block.py +++ b/robosystems_client/api/extensions_robo_ledger/op_create_event_block.py @@ -8,7 +8,9 @@ from ...client import AuthenticatedClient, Client from ...models.create_event_block_request import CreateEventBlockRequest from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_event_block_envelope import ( + OperationEnvelopeEventBlockEnvelope, +) from ...models.operation_error import OperationError from ...types import UNSET, Response, Unset @@ -40,9 +42,15 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeEventBlockEnvelope + | OperationError + | None +): if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeEventBlockEnvelope.from_dict(response.json()) return response_200 @@ -90,7 +98,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeEventBlockEnvelope | OperationError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -105,7 +115,9 @@ def sync_detailed( client: AuthenticatedClient, body: CreateEventBlockRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeEventBlockEnvelope | OperationError +]: """Create Event Block Persist a real-world business event. apply_handlers=False (default): capture-only, @@ -125,7 +137,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeEventBlockEnvelope | OperationError] """ kwargs = _get_kwargs( @@ -147,7 +159,13 @@ def sync( client: AuthenticatedClient, body: CreateEventBlockRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeEventBlockEnvelope + | OperationError + | None +): """Create Event Block Persist a real-world business event. apply_handlers=False (default): capture-only, @@ -167,7 +185,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeEventBlockEnvelope | OperationError """ return sync_detailed( @@ -184,7 +202,9 @@ async def asyncio_detailed( client: AuthenticatedClient, body: CreateEventBlockRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeEventBlockEnvelope | OperationError +]: """Create Event Block Persist a real-world business event. apply_handlers=False (default): capture-only, @@ -204,7 +224,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeEventBlockEnvelope | OperationError] """ kwargs = _get_kwargs( @@ -224,7 +244,13 @@ async def asyncio( client: AuthenticatedClient, body: CreateEventBlockRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeEventBlockEnvelope + | OperationError + | None +): """Create Event Block Persist a real-world business event. apply_handlers=False (default): capture-only, @@ -244,7 +270,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeEventBlockEnvelope | OperationError """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_create_information_block.py b/robosystems_client/api/extensions_robo_ledger/op_create_information_block.py index e0620b2..46700c5 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_create_information_block.py +++ b/robosystems_client/api/extensions_robo_ledger/op_create_information_block.py @@ -6,9 +6,12 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.create_information_block_request import CreateInformationBlockRequest +from ...models.create_legacy_arm import CreateLegacyArm +from ...models.create_schedule_arm import CreateScheduleArm from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_information_block_envelope import ( + OperationEnvelopeInformationBlockEnvelope, +) from ...models.operation_error import OperationError from ...types import UNSET, Response, Unset @@ -16,7 +19,7 @@ def _get_kwargs( graph_id: str, *, - body: CreateInformationBlockRequest, + body: CreateLegacyArm | CreateScheduleArm, idempotency_key: None | str | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} @@ -30,7 +33,10 @@ def _get_kwargs( ), } - _kwargs["json"] = body.to_dict() + if isinstance(body, CreateScheduleArm): + _kwargs["json"] = body.to_dict() + else: + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/json" @@ -40,9 +46,15 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeInformationBlockEnvelope + | OperationError + | None +): if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeInformationBlockEnvelope.from_dict(response.json()) return response_200 @@ -90,7 +102,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeInformationBlockEnvelope | OperationError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -103,9 +117,11 @@ def sync_detailed( graph_id: str, *, client: AuthenticatedClient, - body: CreateInformationBlockRequest, + body: CreateLegacyArm | CreateScheduleArm, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeInformationBlockEnvelope | OperationError +]: """Create Information Block Generic Information Block construction entry. `block_type` selects the registered block type; @@ -118,22 +134,20 @@ def sync_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (CreateInformationBlockRequest): Generic create request — discriminator + typed-at- - dispatch payload. - - ``block_type`` selects the registry entry. ``payload`` is validated - against ``BlockTypeRegistryEntry.create_request_model`` (e.g. - :class:`CreateScheduleRequest` for ``block_type='schedule'``) by the - command dispatcher. Chosen over a Pydantic discriminated union on the - top-level request so adding a block type is one registry line, not a - union-arm edit at the request-model layer. + body (CreateLegacyArm | CreateScheduleArm): Create an Information Block. The body is a + discriminated union on + `block_type`: pick the arm matching the block type you want to + create. The schedule arm carries a fully typed payload; statement + and metric arms accept an untyped payload but currently return HTTP + 501 (statements are constructed via `create-report`; metric + construction is pending). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeInformationBlockEnvelope | OperationError] """ kwargs = _get_kwargs( @@ -153,9 +167,15 @@ def sync( graph_id: str, *, client: AuthenticatedClient, - body: CreateInformationBlockRequest, + body: CreateLegacyArm | CreateScheduleArm, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeInformationBlockEnvelope + | OperationError + | None +): """Create Information Block Generic Information Block construction entry. `block_type` selects the registered block type; @@ -168,22 +188,20 @@ def sync( Args: graph_id (str): idempotency_key (None | str | Unset): - body (CreateInformationBlockRequest): Generic create request — discriminator + typed-at- - dispatch payload. - - ``block_type`` selects the registry entry. ``payload`` is validated - against ``BlockTypeRegistryEntry.create_request_model`` (e.g. - :class:`CreateScheduleRequest` for ``block_type='schedule'``) by the - command dispatcher. Chosen over a Pydantic discriminated union on the - top-level request so adding a block type is one registry line, not a - union-arm edit at the request-model layer. + body (CreateLegacyArm | CreateScheduleArm): Create an Information Block. The body is a + discriminated union on + `block_type`: pick the arm matching the block type you want to + create. The schedule arm carries a fully typed payload; statement + and metric arms accept an untyped payload but currently return HTTP + 501 (statements are constructed via `create-report`; metric + construction is pending). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeInformationBlockEnvelope | OperationError """ return sync_detailed( @@ -198,9 +216,11 @@ async def asyncio_detailed( graph_id: str, *, client: AuthenticatedClient, - body: CreateInformationBlockRequest, + body: CreateLegacyArm | CreateScheduleArm, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeInformationBlockEnvelope | OperationError +]: """Create Information Block Generic Information Block construction entry. `block_type` selects the registered block type; @@ -213,22 +233,20 @@ async def asyncio_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (CreateInformationBlockRequest): Generic create request — discriminator + typed-at- - dispatch payload. - - ``block_type`` selects the registry entry. ``payload`` is validated - against ``BlockTypeRegistryEntry.create_request_model`` (e.g. - :class:`CreateScheduleRequest` for ``block_type='schedule'``) by the - command dispatcher. Chosen over a Pydantic discriminated union on the - top-level request so adding a block type is one registry line, not a - union-arm edit at the request-model layer. + body (CreateLegacyArm | CreateScheduleArm): Create an Information Block. The body is a + discriminated union on + `block_type`: pick the arm matching the block type you want to + create. The schedule arm carries a fully typed payload; statement + and metric arms accept an untyped payload but currently return HTTP + 501 (statements are constructed via `create-report`; metric + construction is pending). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeInformationBlockEnvelope | OperationError] """ kwargs = _get_kwargs( @@ -246,9 +264,15 @@ async def asyncio( graph_id: str, *, client: AuthenticatedClient, - body: CreateInformationBlockRequest, + body: CreateLegacyArm | CreateScheduleArm, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeInformationBlockEnvelope + | OperationError + | None +): """Create Information Block Generic Information Block construction entry. `block_type` selects the registered block type; @@ -261,22 +285,20 @@ async def asyncio( Args: graph_id (str): idempotency_key (None | str | Unset): - body (CreateInformationBlockRequest): Generic create request — discriminator + typed-at- - dispatch payload. - - ``block_type`` selects the registry entry. ``payload`` is validated - against ``BlockTypeRegistryEntry.create_request_model`` (e.g. - :class:`CreateScheduleRequest` for ``block_type='schedule'``) by the - command dispatcher. Chosen over a Pydantic discriminated union on the - top-level request so adding a block type is one registry line, not a - union-arm edit at the request-model layer. + body (CreateLegacyArm | CreateScheduleArm): Create an Information Block. The body is a + discriminated union on + `block_type`: pick the arm matching the block type you want to + create. The schedule arm carries a fully typed payload; statement + and metric arms accept an untyped payload but currently return HTTP + 501 (statements are constructed via `create-report`; metric + construction is pending). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeInformationBlockEnvelope | OperationError """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_delete_information_block.py b/robosystems_client/api/extensions_robo_ledger/op_delete_information_block.py index 8ca0bc3..d60f804 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_delete_information_block.py +++ b/robosystems_client/api/extensions_robo_ledger/op_delete_information_block.py @@ -6,9 +6,12 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.delete_information_block_request import DeleteInformationBlockRequest +from ...models.delete_legacy_arm import DeleteLegacyArm +from ...models.delete_schedule_arm import DeleteScheduleArm from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_delete_information_block_response import ( + OperationEnvelopeDeleteInformationBlockResponse, +) from ...models.operation_error import OperationError from ...types import UNSET, Response, Unset @@ -16,7 +19,7 @@ def _get_kwargs( graph_id: str, *, - body: DeleteInformationBlockRequest, + body: DeleteLegacyArm | DeleteScheduleArm, idempotency_key: None | str | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} @@ -30,7 +33,10 @@ def _get_kwargs( ), } - _kwargs["json"] = body.to_dict() + if isinstance(body, DeleteScheduleArm): + _kwargs["json"] = body.to_dict() + else: + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/json" @@ -40,9 +46,17 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeDeleteInformationBlockResponse + | OperationError + | None +): if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeDeleteInformationBlockResponse.from_dict( + response.json() + ) return response_200 @@ -90,7 +104,12 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any + | HTTPValidationError + | OperationEnvelopeDeleteInformationBlockResponse + | OperationError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -103,9 +122,14 @@ def sync_detailed( graph_id: str, *, client: AuthenticatedClient, - body: DeleteInformationBlockRequest, + body: DeleteLegacyArm | DeleteScheduleArm, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any + | HTTPValidationError + | OperationEnvelopeDeleteInformationBlockResponse + | OperationError +]: """Delete Information Block Generic Information Block deletion entry. Returns a thin confirmation (deleted / structure_id / @@ -118,18 +142,18 @@ def sync_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (DeleteInformationBlockRequest): Generic delete request — mirrors - :class:`CreateInformationBlockRequest`. - - Validated against the registry entry's ``delete_request_model``. - Block types that don't support deletion raise ``NotImplementedError``. + body (DeleteLegacyArm | DeleteScheduleArm): Delete an Information Block. The body is a + discriminated union on + `block_type` mirroring `CreateInformationBlockRequest`. The schedule + arm carries a fully typed delete payload; statement and metric arms + return HTTP 501. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeDeleteInformationBlockResponse | OperationError] """ kwargs = _get_kwargs( @@ -149,9 +173,15 @@ def sync( graph_id: str, *, client: AuthenticatedClient, - body: DeleteInformationBlockRequest, + body: DeleteLegacyArm | DeleteScheduleArm, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeDeleteInformationBlockResponse + | OperationError + | None +): """Delete Information Block Generic Information Block deletion entry. Returns a thin confirmation (deleted / structure_id / @@ -164,18 +194,18 @@ def sync( Args: graph_id (str): idempotency_key (None | str | Unset): - body (DeleteInformationBlockRequest): Generic delete request — mirrors - :class:`CreateInformationBlockRequest`. - - Validated against the registry entry's ``delete_request_model``. - Block types that don't support deletion raise ``NotImplementedError``. + body (DeleteLegacyArm | DeleteScheduleArm): Delete an Information Block. The body is a + discriminated union on + `block_type` mirroring `CreateInformationBlockRequest`. The schedule + arm carries a fully typed delete payload; statement and metric arms + return HTTP 501. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeDeleteInformationBlockResponse | OperationError """ return sync_detailed( @@ -190,9 +220,14 @@ async def asyncio_detailed( graph_id: str, *, client: AuthenticatedClient, - body: DeleteInformationBlockRequest, + body: DeleteLegacyArm | DeleteScheduleArm, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any + | HTTPValidationError + | OperationEnvelopeDeleteInformationBlockResponse + | OperationError +]: """Delete Information Block Generic Information Block deletion entry. Returns a thin confirmation (deleted / structure_id / @@ -205,18 +240,18 @@ async def asyncio_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (DeleteInformationBlockRequest): Generic delete request — mirrors - :class:`CreateInformationBlockRequest`. - - Validated against the registry entry's ``delete_request_model``. - Block types that don't support deletion raise ``NotImplementedError``. + body (DeleteLegacyArm | DeleteScheduleArm): Delete an Information Block. The body is a + discriminated union on + `block_type` mirroring `CreateInformationBlockRequest`. The schedule + arm carries a fully typed delete payload; statement and metric arms + return HTTP 501. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeDeleteInformationBlockResponse | OperationError] """ kwargs = _get_kwargs( @@ -234,9 +269,15 @@ async def asyncio( graph_id: str, *, client: AuthenticatedClient, - body: DeleteInformationBlockRequest, + body: DeleteLegacyArm | DeleteScheduleArm, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeDeleteInformationBlockResponse + | OperationError + | None +): """Delete Information Block Generic Information Block deletion entry. Returns a thin confirmation (deleted / structure_id / @@ -249,18 +290,18 @@ async def asyncio( Args: graph_id (str): idempotency_key (None | str | Unset): - body (DeleteInformationBlockRequest): Generic delete request — mirrors - :class:`CreateInformationBlockRequest`. - - Validated against the registry entry's ``delete_request_model``. - Block types that don't support deletion raise ``NotImplementedError``. + body (DeleteLegacyArm | DeleteScheduleArm): Delete an Information Block. The body is a + discriminated union on + `block_type` mirroring `CreateInformationBlockRequest`. The schedule + arm carries a fully typed delete payload; statement and metric arms + return HTTP 501. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeDeleteInformationBlockResponse | OperationError """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_update_event_block.py b/robosystems_client/api/extensions_robo_ledger/op_update_event_block.py index 9b2b4c4..90ff11a 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_update_event_block.py +++ b/robosystems_client/api/extensions_robo_ledger/op_update_event_block.py @@ -7,7 +7,9 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_event_block_envelope import ( + OperationEnvelopeEventBlockEnvelope, +) from ...models.operation_error import OperationError from ...models.update_event_block_request import UpdateEventBlockRequest from ...types import UNSET, Response, Unset @@ -40,9 +42,15 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeEventBlockEnvelope + | OperationError + | None +): if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeEventBlockEnvelope.from_dict(response.json()) return response_200 @@ -90,7 +98,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeEventBlockEnvelope | OperationError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -105,7 +115,9 @@ def sync_detailed( client: AuthenticatedClient, body: UpdateEventBlockRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeEventBlockEnvelope | OperationError +]: """Update Event Block Apply a status transition (captured → committed | voided) and/or field corrections (description, @@ -131,7 +143,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeEventBlockEnvelope | OperationError] """ kwargs = _get_kwargs( @@ -153,7 +165,13 @@ def sync( client: AuthenticatedClient, body: UpdateEventBlockRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeEventBlockEnvelope + | OperationError + | None +): """Update Event Block Apply a status transition (captured → committed | voided) and/or field corrections (description, @@ -179,7 +197,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeEventBlockEnvelope | OperationError """ return sync_detailed( @@ -196,7 +214,9 @@ async def asyncio_detailed( client: AuthenticatedClient, body: UpdateEventBlockRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeEventBlockEnvelope | OperationError +]: """Update Event Block Apply a status transition (captured → committed | voided) and/or field corrections (description, @@ -222,7 +242,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeEventBlockEnvelope | OperationError] """ kwargs = _get_kwargs( @@ -242,7 +262,13 @@ async def asyncio( client: AuthenticatedClient, body: UpdateEventBlockRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeEventBlockEnvelope + | OperationError + | None +): """Update Event Block Apply a status transition (captured → committed | voided) and/or field corrections (description, @@ -268,7 +294,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeEventBlockEnvelope | OperationError """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_update_information_block.py b/robosystems_client/api/extensions_robo_ledger/op_update_information_block.py index c871dca..c4eb694 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_update_information_block.py +++ b/robosystems_client/api/extensions_robo_ledger/op_update_information_block.py @@ -7,16 +7,19 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_information_block_envelope import ( + OperationEnvelopeInformationBlockEnvelope, +) from ...models.operation_error import OperationError -from ...models.update_information_block_request import UpdateInformationBlockRequest +from ...models.update_legacy_arm import UpdateLegacyArm +from ...models.update_schedule_arm import UpdateScheduleArm from ...types import UNSET, Response, Unset def _get_kwargs( graph_id: str, *, - body: UpdateInformationBlockRequest, + body: UpdateLegacyArm | UpdateScheduleArm, idempotency_key: None | str | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} @@ -30,7 +33,10 @@ def _get_kwargs( ), } - _kwargs["json"] = body.to_dict() + if isinstance(body, UpdateScheduleArm): + _kwargs["json"] = body.to_dict() + else: + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/json" @@ -40,9 +46,15 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeInformationBlockEnvelope + | OperationError + | None +): if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeInformationBlockEnvelope.from_dict(response.json()) return response_200 @@ -90,7 +102,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeInformationBlockEnvelope | OperationError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -103,9 +117,11 @@ def sync_detailed( graph_id: str, *, client: AuthenticatedClient, - body: UpdateInformationBlockRequest, + body: UpdateLegacyArm | UpdateScheduleArm, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeInformationBlockEnvelope | OperationError +]: """Update Information Block Generic Information Block update entry. Dispatches by `block_type` to the registered mutation @@ -118,20 +134,19 @@ def sync_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (UpdateInformationBlockRequest): Generic update request — mirrors - :class:`CreateInformationBlockRequest`. - - Validated against the registry entry's ``update_request_model``. - Block types that don't support updates (e.g. the statement family, - whose Structures are library-seeded) surface ``NotImplementedError`` - from their dispatch handler, which the registrar maps to HTTP 501. + body (UpdateLegacyArm | UpdateScheduleArm): Update an Information Block. The body is a + discriminated union on + `block_type` mirroring `CreateInformationBlockRequest`. The schedule + arm carries a fully typed update payload; statement and metric arms + return HTTP 501 (statements are library-seeded; metric updates are + pending). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeInformationBlockEnvelope | OperationError] """ kwargs = _get_kwargs( @@ -151,9 +166,15 @@ def sync( graph_id: str, *, client: AuthenticatedClient, - body: UpdateInformationBlockRequest, + body: UpdateLegacyArm | UpdateScheduleArm, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeInformationBlockEnvelope + | OperationError + | None +): """Update Information Block Generic Information Block update entry. Dispatches by `block_type` to the registered mutation @@ -166,20 +187,19 @@ def sync( Args: graph_id (str): idempotency_key (None | str | Unset): - body (UpdateInformationBlockRequest): Generic update request — mirrors - :class:`CreateInformationBlockRequest`. - - Validated against the registry entry's ``update_request_model``. - Block types that don't support updates (e.g. the statement family, - whose Structures are library-seeded) surface ``NotImplementedError`` - from their dispatch handler, which the registrar maps to HTTP 501. + body (UpdateLegacyArm | UpdateScheduleArm): Update an Information Block. The body is a + discriminated union on + `block_type` mirroring `CreateInformationBlockRequest`. The schedule + arm carries a fully typed update payload; statement and metric arms + return HTTP 501 (statements are library-seeded; metric updates are + pending). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeInformationBlockEnvelope | OperationError """ return sync_detailed( @@ -194,9 +214,11 @@ async def asyncio_detailed( graph_id: str, *, client: AuthenticatedClient, - body: UpdateInformationBlockRequest, + body: UpdateLegacyArm | UpdateScheduleArm, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeInformationBlockEnvelope | OperationError +]: """Update Information Block Generic Information Block update entry. Dispatches by `block_type` to the registered mutation @@ -209,20 +231,19 @@ async def asyncio_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (UpdateInformationBlockRequest): Generic update request — mirrors - :class:`CreateInformationBlockRequest`. - - Validated against the registry entry's ``update_request_model``. - Block types that don't support updates (e.g. the statement family, - whose Structures are library-seeded) surface ``NotImplementedError`` - from their dispatch handler, which the registrar maps to HTTP 501. + body (UpdateLegacyArm | UpdateScheduleArm): Update an Information Block. The body is a + discriminated union on + `block_type` mirroring `CreateInformationBlockRequest`. The schedule + arm carries a fully typed update payload; statement and metric arms + return HTTP 501 (statements are library-seeded; metric updates are + pending). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeInformationBlockEnvelope | OperationError] """ kwargs = _get_kwargs( @@ -240,9 +261,15 @@ async def asyncio( graph_id: str, *, client: AuthenticatedClient, - body: UpdateInformationBlockRequest, + body: UpdateLegacyArm | UpdateScheduleArm, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeInformationBlockEnvelope + | OperationError + | None +): """Update Information Block Generic Information Block update entry. Dispatches by `block_type` to the registered mutation @@ -255,20 +282,19 @@ async def asyncio( Args: graph_id (str): idempotency_key (None | str | Unset): - body (UpdateInformationBlockRequest): Generic update request — mirrors - :class:`CreateInformationBlockRequest`. - - Validated against the registry entry's ``update_request_model``. - Block types that don't support updates (e.g. the statement family, - whose Structures are library-seeded) surface ``NotImplementedError`` - from their dispatch handler, which the registrar maps to HTTP 501. + body (UpdateLegacyArm | UpdateScheduleArm): Update an Information Block. The body is a + discriminated union on + `block_type` mirroring `CreateInformationBlockRequest`. The schedule + arm carries a fully typed update payload; statement and metric arms + return HTTP 501 (statements are library-seeded; metric updates are + pending). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeInformationBlockEnvelope | OperationError """ return ( diff --git a/robosystems_client/api/graph_operations/op_delete_graph.py b/robosystems_client/api/graph_operations/op_delete_graph.py index 5581e00..c12b0d8 100644 --- a/robosystems_client/api/graph_operations/op_delete_graph.py +++ b/robosystems_client/api/graph_operations/op_delete_graph.py @@ -116,7 +116,8 @@ def sync_detailed( body flag: omit it (or pass `false`) to tear down immediately (~10 min); pass `true` to keep the graph usable through the current billing period and tear it down at the period boundary via the existing suspend → deprovision pipeline. Requires `confirm` to equal the URL `graph_id`. Caller must - be admin on the graph. Not allowed on shared repositories. + be both org owner (billing authority) and admin on the graph (operational authority). Not allowed on + shared repositories. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -173,7 +174,8 @@ def sync( body flag: omit it (or pass `false`) to tear down immediately (~10 min); pass `true` to keep the graph usable through the current billing period and tear it down at the period boundary via the existing suspend → deprovision pipeline. Requires `confirm` to equal the URL `graph_id`. Caller must - be admin on the graph. Not allowed on shared repositories. + be both org owner (billing authority) and admin on the graph (operational authority). Not allowed on + shared repositories. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -225,7 +227,8 @@ async def asyncio_detailed( body flag: omit it (or pass `false`) to tear down immediately (~10 min); pass `true` to keep the graph usable through the current billing period and tear it down at the period boundary via the existing suspend → deprovision pipeline. Requires `confirm` to equal the URL `graph_id`. Caller must - be admin on the graph. Not allowed on shared repositories. + be both org owner (billing authority) and admin on the graph (operational authority). Not allowed on + shared repositories. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -280,7 +283,8 @@ async def asyncio( body flag: omit it (or pass `false`) to tear down immediately (~10 min); pass `true` to keep the graph usable through the current billing period and tear it down at the period boundary via the existing suspend → deprovision pipeline. Requires `confirm` to equal the URL `graph_id`. Caller must - be admin on the graph. Not allowed on shared repositories. + be both org owner (billing authority) and admin on the graph (operational authority). Not allowed on + shared repositories. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. diff --git a/robosystems_client/api/subscriptions/cancel_repository_subscription.py b/robosystems_client/api/subscriptions/cancel_repository_subscription.py index 2db2047..043e89e 100644 --- a/robosystems_client/api/subscriptions/cancel_repository_subscription.py +++ b/robosystems_client/api/subscriptions/cancel_repository_subscription.py @@ -10,13 +10,13 @@ from ...models.error_response import ErrorResponse from ...models.graph_subscription_response import GraphSubscriptionResponse from ...models.http_validation_error import HTTPValidationError -from ...types import Response +from ...types import UNSET, Response, Unset def _get_kwargs( graph_id: str, *, - body: CancelSubscriptionRequest, + body: CancelSubscriptionRequest | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} @@ -27,7 +27,8 @@ def _get_kwargs( ), } - _kwargs["json"] = body.to_dict() + if not isinstance(body, Unset): + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/json" @@ -99,7 +100,7 @@ def sync_detailed( graph_id: str, *, client: AuthenticatedClient, - body: CancelSubscriptionRequest, + body: CancelSubscriptionRequest | Unset = UNSET, ) -> Response[ErrorResponse | GraphSubscriptionResponse | HTTPValidationError]: """Cancel Repository Subscription @@ -111,7 +112,7 @@ def sync_detailed( Args: graph_id (str): Repository name (e.g., 'sec', 'industry') - body (CancelSubscriptionRequest): Request to cancel a subscription. + body (CancelSubscriptionRequest | Unset): Request to cancel a subscription. Default behavior cancels at period end (soft cancel). Pass `immediate=True` to terminate the subscription right away — this requires `confirm` to equal @@ -142,7 +143,7 @@ def sync( graph_id: str, *, client: AuthenticatedClient, - body: CancelSubscriptionRequest, + body: CancelSubscriptionRequest | Unset = UNSET, ) -> ErrorResponse | GraphSubscriptionResponse | HTTPValidationError | None: """Cancel Repository Subscription @@ -154,7 +155,7 @@ def sync( Args: graph_id (str): Repository name (e.g., 'sec', 'industry') - body (CancelSubscriptionRequest): Request to cancel a subscription. + body (CancelSubscriptionRequest | Unset): Request to cancel a subscription. Default behavior cancels at period end (soft cancel). Pass `immediate=True` to terminate the subscription right away — this requires `confirm` to equal @@ -180,7 +181,7 @@ async def asyncio_detailed( graph_id: str, *, client: AuthenticatedClient, - body: CancelSubscriptionRequest, + body: CancelSubscriptionRequest | Unset = UNSET, ) -> Response[ErrorResponse | GraphSubscriptionResponse | HTTPValidationError]: """Cancel Repository Subscription @@ -192,7 +193,7 @@ async def asyncio_detailed( Args: graph_id (str): Repository name (e.g., 'sec', 'industry') - body (CancelSubscriptionRequest): Request to cancel a subscription. + body (CancelSubscriptionRequest | Unset): Request to cancel a subscription. Default behavior cancels at period end (soft cancel). Pass `immediate=True` to terminate the subscription right away — this requires `confirm` to equal @@ -221,7 +222,7 @@ async def asyncio( graph_id: str, *, client: AuthenticatedClient, - body: CancelSubscriptionRequest, + body: CancelSubscriptionRequest | Unset = UNSET, ) -> ErrorResponse | GraphSubscriptionResponse | HTTPValidationError | None: """Cancel Repository Subscription @@ -233,7 +234,7 @@ async def asyncio( Args: graph_id (str): Repository name (e.g., 'sec', 'industry') - body (CancelSubscriptionRequest): Request to cancel a subscription. + body (CancelSubscriptionRequest | Unset): Request to cancel a subscription. Default behavior cancels at period end (soft cancel). Pass `immediate=True` to terminate the subscription right away — this requires `confirm` to equal diff --git a/robosystems_client/clients/ledger_client.py b/robosystems_client/clients/ledger_client.py index bfa0000..9ecfa76 100644 --- a/robosystems_client/clients/ledger_client.py +++ b/robosystems_client/clients/ledger_client.py @@ -239,25 +239,19 @@ from ..models.update_event_block_request import UpdateEventBlockRequest from ..models.update_event_handler_request import UpdateEventHandlerRequest from ..models.delete_journal_entry_request import DeleteJournalEntryRequest -from ..models.delete_information_block_request import DeleteInformationBlockRequest -from ..models.delete_information_block_request_payload import ( - DeleteInformationBlockRequestPayload, -) +from ..models.delete_schedule_arm import DeleteScheduleArm +from ..models.delete_schedule_request import DeleteScheduleRequest from ..models.link_entity_taxonomy_request import LinkEntityTaxonomyRequest from ..models.update_journal_entry_request import UpdateJournalEntryRequest -from ..models.update_information_block_request import UpdateInformationBlockRequest -from ..models.update_information_block_request_payload import ( - UpdateInformationBlockRequestPayload, -) +from ..models.update_schedule_arm import UpdateScheduleArm +from ..models.update_schedule_request import UpdateScheduleRequest from ..models.close_period_operation import ClosePeriodOperation from ..models.create_view_request import CreateViewRequest from ..models.create_mapping_association_operation import ( CreateMappingAssociationOperation, ) -from ..models.create_information_block_request import CreateInformationBlockRequest -from ..models.create_information_block_request_payload import ( - CreateInformationBlockRequestPayload, -) +from ..models.create_schedule_arm import CreateScheduleArm +from ..models.create_schedule_request import CreateScheduleRequest from ..models.delete_mapping_association_operation import ( DeleteMappingAssociationOperation, ) @@ -902,8 +896,8 @@ def create_schedule( if schedule_metadata: payload_dict["schedule_metadata"] = schedule_metadata - payload = CreateInformationBlockRequestPayload.from_dict(payload_dict) - body = CreateInformationBlockRequest(block_type="schedule", payload=payload) + payload = CreateScheduleRequest.from_dict(payload_dict) + body = CreateScheduleArm(block_type="schedule", payload=payload) response = op_create_information_block( graph_id=graph_id, body=body, client=self._get_client() ) @@ -977,10 +971,8 @@ def update_schedule( self, graph_id: str, structure_id: str, body: dict[str, Any] ) -> dict[str, Any]: """Update mutable fields on a schedule (name, entry_template, metadata).""" - payload = UpdateInformationBlockRequestPayload.from_dict( - {"structure_id": structure_id, **body} - ) - request = UpdateInformationBlockRequest(block_type="schedule", payload=payload) + payload = UpdateScheduleRequest.from_dict({"structure_id": structure_id, **body}) + request = UpdateScheduleArm(block_type="schedule", payload=payload) response = op_update_information_block( graph_id=graph_id, body=request, client=self._get_client() ) @@ -989,10 +981,8 @@ def update_schedule( def delete_schedule(self, graph_id: str, structure_id: str) -> dict[str, Any]: """Permanently delete a schedule (cascades through facts + associations).""" - payload = DeleteInformationBlockRequestPayload.from_dict( - {"structure_id": structure_id} - ) - body = DeleteInformationBlockRequest(block_type="schedule", payload=payload) + payload = DeleteScheduleRequest.from_dict({"structure_id": structure_id}) + body = DeleteScheduleArm(block_type="schedule", payload=payload) response = op_delete_information_block( graph_id=graph_id, body=body, client=self._get_client() ) diff --git a/robosystems_client/models/__init__.py b/robosystems_client/models/__init__.py index 5ba4060..c1a491b 100644 --- a/robosystems_client/models/__init__.py +++ b/robosystems_client/models/__init__.py @@ -24,6 +24,8 @@ from .agent_response_tokens_used_type_0 import AgentResponseTokensUsedType0 from .api_key_info import APIKeyInfo from .api_keys_response import APIKeysResponse +from .artifact_response import ArtifactResponse +from .artifact_response_template_type_0 import ArtifactResponseTemplateType0 from .auth_response import AuthResponse from .auth_response_org_type_0 import AuthResponseOrgType0 from .auth_response_user import AuthResponseUser @@ -49,7 +51,9 @@ from .change_tier_op_new_tier import ChangeTierOpNewTier from .checkout_response import CheckoutResponse from .checkout_status_response import CheckoutStatusResponse +from .classification_lite import ClassificationLite from .close_period_operation import ClosePeriodOperation +from .connection_lite import ConnectionLite from .connection_options_response import ConnectionOptionsResponse from .connection_provider_info import ConnectionProviderInfo from .connection_provider_info_auth_type import ConnectionProviderInfoAuthType @@ -83,10 +87,9 @@ from .create_event_handler_request_metadata import CreateEventHandlerRequestMetadata from .create_event_handler_request_origin import CreateEventHandlerRequestOrigin from .create_graph_request import CreateGraphRequest -from .create_information_block_request import CreateInformationBlockRequest -from .create_information_block_request_payload import ( - CreateInformationBlockRequestPayload, -) +from .create_legacy_arm import CreateLegacyArm +from .create_legacy_arm_block_type import CreateLegacyArmBlockType +from .create_legacy_arm_payload import CreateLegacyArmPayload from .create_mapping_association_operation import CreateMappingAssociationOperation from .create_mapping_association_operation_association_type import ( CreateMappingAssociationOperationAssociationType, @@ -95,6 +98,8 @@ from .create_publish_list_request import CreatePublishListRequest from .create_report_request import CreateReportRequest from .create_repository_subscription_request import CreateRepositorySubscriptionRequest +from .create_schedule_arm import CreateScheduleArm +from .create_schedule_request import CreateScheduleRequest from .create_security_request import CreateSecurityRequest from .create_security_request_terms import CreateSecurityRequestTerms from .create_subgraph_request import CreateSubgraphRequest @@ -122,15 +127,19 @@ from .database_storage_entry import DatabaseStorageEntry from .delete_file_response import DeleteFileResponse from .delete_graph_op import DeleteGraphOp -from .delete_information_block_request import DeleteInformationBlockRequest -from .delete_information_block_request_payload import ( - DeleteInformationBlockRequestPayload, -) +from .delete_information_block_response import DeleteInformationBlockResponse from .delete_journal_entry_request import DeleteJournalEntryRequest +from .delete_legacy_arm import DeleteLegacyArm +from .delete_legacy_arm_block_type import DeleteLegacyArmBlockType +from .delete_legacy_arm_payload import DeleteLegacyArmPayload from .delete_mapping_association_operation import DeleteMappingAssociationOperation from .delete_portfolio_block_operation import DeletePortfolioBlockOperation +from .delete_portfolio_block_response import DeletePortfolioBlockResponse from .delete_publish_list_operation import DeletePublishListOperation from .delete_report_operation import DeleteReportOperation +from .delete_result import DeleteResult +from .delete_schedule_arm import DeleteScheduleArm +from .delete_schedule_request import DeleteScheduleRequest from .delete_security_operation import DeleteSecurityOperation from .delete_subgraph_op import DeleteSubgraphOp from .delete_taxonomy_block_request import DeleteTaxonomyBlockRequest @@ -147,6 +156,7 @@ from .document_upload_request import DocumentUploadRequest from .document_upload_response import DocumentUploadResponse from .download_quota import DownloadQuota +from .element_lite import ElementLite from .element_update_patch import ElementUpdatePatch from .element_update_patch_metadata_type_0 import ElementUpdatePatchMetadataType0 from .email_verification_request import EmailVerificationRequest @@ -155,8 +165,15 @@ EnhancedCreditTransactionResponseMetadata, ) from .enhanced_file_status_layers import EnhancedFileStatusLayers +from .entity_lite import EntityLite +from .entry_template_request import EntryTemplateRequest +from .entry_template_request_entry_type import EntryTemplateRequestEntryType from .error_response import ErrorResponse from .evaluate_rules_request import EvaluateRulesRequest +from .event_block_envelope import EventBlockEnvelope +from .event_block_envelope_metadata import EventBlockEnvelopeMetadata +from .fact_lite import FactLite +from .fact_set_lite import FactSetLite from .file_info import FileInfo from .file_layer_status import FileLayerStatus from .file_report_request import FileReportRequest @@ -199,6 +216,11 @@ from .health_status import HealthStatus from .health_status_details_type_0 import HealthStatusDetailsType0 from .http_validation_error import HTTPValidationError +from .information_block_envelope import InformationBlockEnvelope +from .information_block_envelope_dimensions_item import ( + InformationBlockEnvelopeDimensionsItem, +) +from .information_model_response import InformationModelResponse from .initial_entity_data import InitialEntityData from .initialize_ledger_request import InitializeLedgerRequest from .instance_usage import InstanceUsage @@ -221,6 +243,7 @@ from .mcp_tool_call_arguments import MCPToolCallArguments from .mcp_tools_response import MCPToolsResponse from .mcp_tools_response_tools_item import MCPToolsResponseToolsItem +from .metric_mechanics import MetricMechanics from .o_auth_callback_request import OAuthCallbackRequest from .o_auth_init_request import OAuthInitRequest from .o_auth_init_request_additional_params_type_0 import ( @@ -235,7 +258,40 @@ from .operation_costs_ai_operations import OperationCostsAiOperations from .operation_costs_token_pricing import OperationCostsTokenPricing from .operation_envelope import OperationEnvelope -from .operation_envelope_result_type_0 import OperationEnvelopeResultType0 +from .operation_envelope_delete_information_block_response import ( + OperationEnvelopeDeleteInformationBlockResponse, +) +from .operation_envelope_delete_information_block_response_status import ( + OperationEnvelopeDeleteInformationBlockResponseStatus, +) +from .operation_envelope_delete_portfolio_block_response import ( + OperationEnvelopeDeletePortfolioBlockResponse, +) +from .operation_envelope_delete_portfolio_block_response_status import ( + OperationEnvelopeDeletePortfolioBlockResponseStatus, +) +from .operation_envelope_delete_result import OperationEnvelopeDeleteResult +from .operation_envelope_delete_result_status import OperationEnvelopeDeleteResultStatus +from .operation_envelope_event_block_envelope import OperationEnvelopeEventBlockEnvelope +from .operation_envelope_event_block_envelope_status import ( + OperationEnvelopeEventBlockEnvelopeStatus, +) +from .operation_envelope_information_block_envelope import ( + OperationEnvelopeInformationBlockEnvelope, +) +from .operation_envelope_information_block_envelope_status import ( + OperationEnvelopeInformationBlockEnvelopeStatus, +) +from .operation_envelope_portfolio_block_envelope import ( + OperationEnvelopePortfolioBlockEnvelope, +) +from .operation_envelope_portfolio_block_envelope_status import ( + OperationEnvelopePortfolioBlockEnvelopeStatus, +) +from .operation_envelope_security_response import OperationEnvelopeSecurityResponse +from .operation_envelope_security_response_status import ( + OperationEnvelopeSecurityResponseStatus, +) from .operation_envelope_status import OperationEnvelopeStatus from .operation_error import OperationError from .operation_error_detail_type_1 import OperationErrorDetailType1 @@ -266,18 +322,23 @@ from .performance_insights_slow_queries_item import PerformanceInsightsSlowQueriesItem from .period_spec import PeriodSpec from .portal_session_response import PortalSessionResponse +from .portfolio_block_envelope import PortfolioBlockEnvelope from .portfolio_block_portfolio_fields import PortfolioBlockPortfolioFields from .portfolio_block_portfolio_patch import PortfolioBlockPortfolioPatch from .portfolio_block_position_add import PortfolioBlockPositionAdd from .portfolio_block_position_dispose import PortfolioBlockPositionDispose from .portfolio_block_position_update import PortfolioBlockPositionUpdate from .portfolio_block_positions import PortfolioBlockPositions +from .position_block import PositionBlock from .query_limits import QueryLimits from .quick_books_connection_config import QuickBooksConnectionConfig from .rate_limits import RateLimits from .regenerate_report_operation import RegenerateReportOperation from .register_request import RegisterRequest from .remove_publish_list_member_operation import RemovePublishListMemberOperation +from .rendering_lite import RenderingLite +from .rendering_period_lite import RenderingPeriodLite +from .rendering_row_lite import RenderingRowLite from .reopen_period_operation import ReopenPeriodOperation from .repository_info import RepositoryInfo from .repository_subscriptions import RepositorySubscriptions @@ -288,6 +349,11 @@ from .reset_password_validate_response import ResetPasswordValidateResponse from .response_mode import ResponseMode from .restore_backup_op import RestoreBackupOp +from .rule_lite import RuleLite +from .rule_target_lite import RuleTargetLite +from .rule_variable_lite import RuleVariableLite +from .schedule_mechanics import ScheduleMechanics +from .schedule_metadata_request import ScheduleMetadataRequest from .schema_export_response import SchemaExportResponse from .schema_export_response_data_stats_type_0 import SchemaExportResponseDataStatsType0 from .schema_export_response_schema_definition_type_0 import ( @@ -308,6 +374,9 @@ from .search_request import SearchRequest from .search_response import SearchResponse from .sec_connection_config import SECConnectionConfig +from .security_lite import SecurityLite +from .security_response import SecurityResponse +from .security_response_terms import SecurityResponseTerms from .selection_criteria import SelectionCriteria from .service_offering_summary import ServiceOfferingSummary from .service_offerings_response import ServiceOfferingsResponse @@ -317,6 +386,7 @@ from .sso_exchange_request import SSOExchangeRequest from .sso_exchange_response import SSOExchangeResponse from .sso_token_response import SSOTokenResponse +from .statement_mechanics import StatementMechanics from .storage_limits import StorageLimits from .storage_summary import StorageSummary from .structure_update_patch import StructureUpdatePatch @@ -393,17 +463,18 @@ UpdateEventHandlerRequestMetadataPatch, ) from .update_file_response_updatefile import UpdateFileResponseUpdatefile -from .update_information_block_request import UpdateInformationBlockRequest -from .update_information_block_request_payload import ( - UpdateInformationBlockRequestPayload, -) from .update_journal_entry_request import UpdateJournalEntryRequest from .update_journal_entry_request_type_type_0 import UpdateJournalEntryRequestTypeType0 +from .update_legacy_arm import UpdateLegacyArm +from .update_legacy_arm_block_type import UpdateLegacyArmBlockType +from .update_legacy_arm_payload import UpdateLegacyArmPayload from .update_member_role_request import UpdateMemberRoleRequest from .update_org_request import UpdateOrgRequest from .update_password_request import UpdatePasswordRequest from .update_portfolio_block_operation import UpdatePortfolioBlockOperation from .update_publish_list_operation import UpdatePublishListOperation +from .update_schedule_arm import UpdateScheduleArm +from .update_schedule_request import UpdateScheduleRequest from .update_security_operation import UpdateSecurityOperation from .update_security_operation_terms_type_0 import UpdateSecurityOperationTermsType0 from .update_taxonomy_block_request import UpdateTaxonomyBlockRequest @@ -413,10 +484,13 @@ from .user_response import UserResponse from .validation_error import ValidationError from .validation_error_context import ValidationErrorContext +from .validation_lite import ValidationLite +from .verification_result_lite import VerificationResultLite from .view_axis_config import ViewAxisConfig from .view_axis_config_element_labels_type_0 import ViewAxisConfigElementLabelsType0 from .view_axis_config_member_labels_type_0 import ViewAxisConfigMemberLabelsType0 from .view_config import ViewConfig +from .view_projections import ViewProjections __all__ = ( "AccountInfo", @@ -439,6 +513,8 @@ "AgentResponseTokensUsedType0", "APIKeyInfo", "APIKeysResponse", + "ArtifactResponse", + "ArtifactResponseTemplateType0", "AuthResponse", "AuthResponseOrgType0", "AuthResponseUser", @@ -462,7 +538,9 @@ "ChangeTierOpNewTier", "CheckoutResponse", "CheckoutStatusResponse", + "ClassificationLite", "ClosePeriodOperation", + "ConnectionLite", "ConnectionOptionsResponse", "ConnectionProviderInfo", "ConnectionProviderInfoAuthType", @@ -490,14 +568,17 @@ "CreateEventHandlerRequestMetadata", "CreateEventHandlerRequestOrigin", "CreateGraphRequest", - "CreateInformationBlockRequest", - "CreateInformationBlockRequestPayload", + "CreateLegacyArm", + "CreateLegacyArmBlockType", + "CreateLegacyArmPayload", "CreateMappingAssociationOperation", "CreateMappingAssociationOperationAssociationType", "CreatePortfolioBlockRequest", "CreatePublishListRequest", "CreateReportRequest", "CreateRepositorySubscriptionRequest", + "CreateScheduleArm", + "CreateScheduleRequest", "CreateSecurityRequest", "CreateSecurityRequestTerms", "CreateSubgraphRequest", @@ -521,13 +602,19 @@ "DatabaseStorageEntry", "DeleteFileResponse", "DeleteGraphOp", - "DeleteInformationBlockRequest", - "DeleteInformationBlockRequestPayload", + "DeleteInformationBlockResponse", "DeleteJournalEntryRequest", + "DeleteLegacyArm", + "DeleteLegacyArmBlockType", + "DeleteLegacyArmPayload", "DeleteMappingAssociationOperation", "DeletePortfolioBlockOperation", + "DeletePortfolioBlockResponse", "DeletePublishListOperation", "DeleteReportOperation", + "DeleteResult", + "DeleteScheduleArm", + "DeleteScheduleRequest", "DeleteSecurityOperation", "DeleteSubgraphOp", "DeleteTaxonomyBlockRequest", @@ -542,14 +629,22 @@ "DocumentUploadRequest", "DocumentUploadResponse", "DownloadQuota", + "ElementLite", "ElementUpdatePatch", "ElementUpdatePatchMetadataType0", "EmailVerificationRequest", "EnhancedCreditTransactionResponse", "EnhancedCreditTransactionResponseMetadata", "EnhancedFileStatusLayers", + "EntityLite", + "EntryTemplateRequest", + "EntryTemplateRequestEntryType", "ErrorResponse", "EvaluateRulesRequest", + "EventBlockEnvelope", + "EventBlockEnvelopeMetadata", + "FactLite", + "FactSetLite", "FileInfo", "FileLayerStatus", "FileReportRequest", @@ -584,6 +679,9 @@ "HealthStatus", "HealthStatusDetailsType0", "HTTPValidationError", + "InformationBlockEnvelope", + "InformationBlockEnvelopeDimensionsItem", + "InformationModelResponse", "InitialEntityData", "InitializeLedgerRequest", "InstanceUsage", @@ -606,6 +704,7 @@ "MCPToolCallArguments", "MCPToolsResponse", "MCPToolsResponseToolsItem", + "MetricMechanics", "OAuthCallbackRequest", "OAuthInitRequest", "OAuthInitRequestAdditionalParamsType0", @@ -616,7 +715,20 @@ "OperationCostsAiOperations", "OperationCostsTokenPricing", "OperationEnvelope", - "OperationEnvelopeResultType0", + "OperationEnvelopeDeleteInformationBlockResponse", + "OperationEnvelopeDeleteInformationBlockResponseStatus", + "OperationEnvelopeDeletePortfolioBlockResponse", + "OperationEnvelopeDeletePortfolioBlockResponseStatus", + "OperationEnvelopeDeleteResult", + "OperationEnvelopeDeleteResultStatus", + "OperationEnvelopeEventBlockEnvelope", + "OperationEnvelopeEventBlockEnvelopeStatus", + "OperationEnvelopeInformationBlockEnvelope", + "OperationEnvelopeInformationBlockEnvelopeStatus", + "OperationEnvelopePortfolioBlockEnvelope", + "OperationEnvelopePortfolioBlockEnvelopeStatus", + "OperationEnvelopeSecurityResponse", + "OperationEnvelopeSecurityResponseStatus", "OperationEnvelopeStatus", "OperationError", "OperationErrorDetailType1", @@ -647,18 +759,23 @@ "PerformanceInsightsSlowQueriesItem", "PeriodSpec", "PortalSessionResponse", + "PortfolioBlockEnvelope", "PortfolioBlockPortfolioFields", "PortfolioBlockPortfolioPatch", "PortfolioBlockPositionAdd", "PortfolioBlockPositionDispose", "PortfolioBlockPositions", "PortfolioBlockPositionUpdate", + "PositionBlock", "QueryLimits", "QuickBooksConnectionConfig", "RateLimits", "RegenerateReportOperation", "RegisterRequest", "RemovePublishListMemberOperation", + "RenderingLite", + "RenderingPeriodLite", + "RenderingRowLite", "ReopenPeriodOperation", "RepositoryInfo", "RepositorySubscriptions", @@ -667,6 +784,11 @@ "ResetPasswordValidateResponse", "ResponseMode", "RestoreBackupOp", + "RuleLite", + "RuleTargetLite", + "RuleVariableLite", + "ScheduleMechanics", + "ScheduleMetadataRequest", "SchemaExportResponse", "SchemaExportResponseDataStatsType0", "SchemaExportResponseSchemaDefinitionType0", @@ -681,6 +803,9 @@ "SearchRequest", "SearchResponse", "SECConnectionConfig", + "SecurityLite", + "SecurityResponse", + "SecurityResponseTerms", "SelectionCriteria", "ServiceOfferingsResponse", "ServiceOfferingSummary", @@ -690,6 +815,7 @@ "SSOExchangeRequest", "SSOExchangeResponse", "SSOTokenResponse", + "StatementMechanics", "StorageLimits", "StorageSummary", "StructureUpdatePatch", @@ -742,15 +868,18 @@ "UpdateEventHandlerRequestMatchMetadataExpressionType0", "UpdateEventHandlerRequestMetadataPatch", "UpdateFileResponseUpdatefile", - "UpdateInformationBlockRequest", - "UpdateInformationBlockRequestPayload", "UpdateJournalEntryRequest", "UpdateJournalEntryRequestTypeType0", + "UpdateLegacyArm", + "UpdateLegacyArmBlockType", + "UpdateLegacyArmPayload", "UpdateMemberRoleRequest", "UpdateOrgRequest", "UpdatePasswordRequest", "UpdatePortfolioBlockOperation", "UpdatePublishListOperation", + "UpdateScheduleArm", + "UpdateScheduleRequest", "UpdateSecurityOperation", "UpdateSecurityOperationTermsType0", "UpdateTaxonomyBlockRequest", @@ -760,8 +889,11 @@ "UserResponse", "ValidationError", "ValidationErrorContext", + "ValidationLite", + "VerificationResultLite", "ViewAxisConfig", "ViewAxisConfigElementLabelsType0", "ViewAxisConfigMemberLabelsType0", "ViewConfig", + "ViewProjections", ) diff --git a/robosystems_client/models/artifact_response.py b/robosystems_client/models/artifact_response.py new file mode 100644 index 0000000..364f32a --- /dev/null +++ b/robosystems_client/models/artifact_response.py @@ -0,0 +1,184 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.artifact_response_template_type_0 import ArtifactResponseTemplateType0 + from ..models.metric_mechanics import MetricMechanics + from ..models.schedule_mechanics import ScheduleMechanics + from ..models.statement_mechanics import StatementMechanics + + +T = TypeVar("T", bound="ArtifactResponse") + + +@_attrs_define +class ArtifactResponse: + """The block's producible-artifact envelope — topic, template, mechanics. + + Attributes: + mechanics (MetricMechanics | ScheduleMechanics | StatementMechanics): + topic (None | str | Unset): Structure.description — the block's human-readable topic. + parenthetical_note (None | str | Unset): e.g. 'in thousands', 'except per share'. + template (ArtifactResponseTemplateType0 | None | Unset): Reusable layout (ordering, subtotals, styling) when + attached. First-class templates are not yet implemented; this field is always null on currently-shipped block + types. + """ + + mechanics: MetricMechanics | ScheduleMechanics | StatementMechanics + topic: None | str | Unset = UNSET + parenthetical_note: None | str | Unset = UNSET + template: ArtifactResponseTemplateType0 | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.artifact_response_template_type_0 import ArtifactResponseTemplateType0 + from ..models.schedule_mechanics import ScheduleMechanics + from ..models.statement_mechanics import StatementMechanics + + mechanics: dict[str, Any] + if isinstance(self.mechanics, ScheduleMechanics): + mechanics = self.mechanics.to_dict() + elif isinstance(self.mechanics, StatementMechanics): + mechanics = self.mechanics.to_dict() + else: + mechanics = self.mechanics.to_dict() + + topic: None | str | Unset + if isinstance(self.topic, Unset): + topic = UNSET + else: + topic = self.topic + + parenthetical_note: None | str | Unset + if isinstance(self.parenthetical_note, Unset): + parenthetical_note = UNSET + else: + parenthetical_note = self.parenthetical_note + + template: dict[str, Any] | None | Unset + if isinstance(self.template, Unset): + template = UNSET + elif isinstance(self.template, ArtifactResponseTemplateType0): + template = self.template.to_dict() + else: + template = self.template + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "mechanics": mechanics, + } + ) + if topic is not UNSET: + field_dict["topic"] = topic + if parenthetical_note is not UNSET: + field_dict["parenthetical_note"] = parenthetical_note + if template is not UNSET: + field_dict["template"] = template + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.artifact_response_template_type_0 import ArtifactResponseTemplateType0 + from ..models.metric_mechanics import MetricMechanics + from ..models.schedule_mechanics import ScheduleMechanics + from ..models.statement_mechanics import StatementMechanics + + d = dict(src_dict) + + def _parse_mechanics( + data: object, + ) -> MetricMechanics | ScheduleMechanics | StatementMechanics: + try: + if not isinstance(data, dict): + raise TypeError() + mechanics_type_0 = ScheduleMechanics.from_dict(data) + + return mechanics_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + mechanics_type_1 = StatementMechanics.from_dict(data) + + return mechanics_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + mechanics_type_2 = MetricMechanics.from_dict(data) + + return mechanics_type_2 + + mechanics = _parse_mechanics(d.pop("mechanics")) + + def _parse_topic(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + topic = _parse_topic(d.pop("topic", UNSET)) + + def _parse_parenthetical_note(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + parenthetical_note = _parse_parenthetical_note(d.pop("parenthetical_note", UNSET)) + + def _parse_template(data: object) -> ArtifactResponseTemplateType0 | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + template_type_0 = ArtifactResponseTemplateType0.from_dict(data) + + return template_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(ArtifactResponseTemplateType0 | None | Unset, data) + + template = _parse_template(d.pop("template", UNSET)) + + artifact_response = cls( + mechanics=mechanics, + topic=topic, + parenthetical_note=parenthetical_note, + template=template, + ) + + artifact_response.additional_properties = d + return artifact_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/operation_envelope_result_type_0.py b/robosystems_client/models/artifact_response_template_type_0.py similarity index 80% rename from robosystems_client/models/operation_envelope_result_type_0.py rename to robosystems_client/models/artifact_response_template_type_0.py index 849621e..ce89950 100644 --- a/robosystems_client/models/operation_envelope_result_type_0.py +++ b/robosystems_client/models/artifact_response_template_type_0.py @@ -6,11 +6,11 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="OperationEnvelopeResultType0") +T = TypeVar("T", bound="ArtifactResponseTemplateType0") @_attrs_define -class OperationEnvelopeResultType0: +class ArtifactResponseTemplateType0: """ """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -25,10 +25,10 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - operation_envelope_result_type_0 = cls() + artifact_response_template_type_0 = cls() - operation_envelope_result_type_0.additional_properties = d - return operation_envelope_result_type_0 + artifact_response_template_type_0.additional_properties = d + return artifact_response_template_type_0 @property def additional_keys(self) -> list[str]: diff --git a/robosystems_client/models/classification_lite.py b/robosystems_client/models/classification_lite.py new file mode 100644 index 0000000..bf4a94a --- /dev/null +++ b/robosystems_client/models/classification_lite.py @@ -0,0 +1,143 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ClassificationLite") + + +@_attrs_define +class ClassificationLite: + """Classification projection — one row per `association_classifications` + junction entry. + + Association-side only: concept_arrangement, member_arrangement, + named_disclosure. Element-side FASB metamodel traits (asset, current, + operating, …) live in `TraitLite` via `element_traits`. + + Carries enough for the envelope caller to render / filter by category + + identifier without a follow-up lookup. The full `public.classifications` + vocabulary catalog (name / description / metadata) is available via the + library GraphQL surface when callers need the details. + + Attributes: + id (str): Classification vocabulary row id. + category (str): One of the 3 association-level categories in the `public.classifications` CHECK constraint: + 'concept_arrangement', 'member_arrangement', or 'named_disclosure'. + identifier (str): Vocabulary identifier within the category — e.g. 'RollUp', 'aggregation', 'AssetsRollUp'. + is_primary (bool | Unset): Whether this is the canonical classification for the (association|element, category) + pair. Non-primary rows capture alternates / AI suggestions alongside the chosen primary. Default: True. + confidence (float | None | Unset): AI/adapter-supplied confidence (0.0-1.0). Null for deterministic library- + seeded rows. + source (None | str | Unset): Provenance — 'arcrole_analysis', 'disclosure_mechanics', 'us-gaap-metamodel', + adapter name, etc. + """ + + id: str + category: str + identifier: str + is_primary: bool | Unset = True + confidence: float | None | Unset = UNSET + source: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + category = self.category + + identifier = self.identifier + + is_primary = self.is_primary + + confidence: float | None | Unset + if isinstance(self.confidence, Unset): + confidence = UNSET + else: + confidence = self.confidence + + source: None | str | Unset + if isinstance(self.source, Unset): + source = UNSET + else: + source = self.source + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "category": category, + "identifier": identifier, + } + ) + if is_primary is not UNSET: + field_dict["is_primary"] = is_primary + if confidence is not UNSET: + field_dict["confidence"] = confidence + if source is not UNSET: + field_dict["source"] = source + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + category = d.pop("category") + + identifier = d.pop("identifier") + + is_primary = d.pop("is_primary", UNSET) + + def _parse_confidence(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + confidence = _parse_confidence(d.pop("confidence", UNSET)) + + def _parse_source(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + source = _parse_source(d.pop("source", UNSET)) + + classification_lite = cls( + id=id, + category=category, + identifier=identifier, + is_primary=is_primary, + confidence=confidence, + source=source, + ) + + classification_lite.additional_properties = d + return classification_lite + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/connection_lite.py b/robosystems_client/models/connection_lite.py new file mode 100644 index 0000000..88d4d51 --- /dev/null +++ b/robosystems_client/models/connection_lite.py @@ -0,0 +1,180 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.classification_lite import ClassificationLite + + +T = TypeVar("T", bound="ConnectionLite") + + +@_attrs_define +class ConnectionLite: + """Connection (= Association) projection. + + Renamed at the API boundary to match Charlie's ontology vocabulary. + The underlying storage table is still ``associations``. + + Attributes: + id (str): + from_element_id (str): + to_element_id (str): + association_type (str): presentation | calculation | mapping | equivalence | general-special | essence-alias + arcrole (None | str | Unset): + order_value (float | None | Unset): + weight (float | None | Unset): + classifications (list[ClassificationLite] | Unset): Association-level classifications — concept_arrangement, + member_arrangement, named_disclosure rows from the junction. Empty for library-seeded associations that haven't + been classified yet. + """ + + id: str + from_element_id: str + to_element_id: str + association_type: str + arcrole: None | str | Unset = UNSET + order_value: float | None | Unset = UNSET + weight: float | None | Unset = UNSET + classifications: list[ClassificationLite] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + from_element_id = self.from_element_id + + to_element_id = self.to_element_id + + association_type = self.association_type + + arcrole: None | str | Unset + if isinstance(self.arcrole, Unset): + arcrole = UNSET + else: + arcrole = self.arcrole + + order_value: float | None | Unset + if isinstance(self.order_value, Unset): + order_value = UNSET + else: + order_value = self.order_value + + weight: float | None | Unset + if isinstance(self.weight, Unset): + weight = UNSET + else: + weight = self.weight + + classifications: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.classifications, Unset): + classifications = [] + for classifications_item_data in self.classifications: + classifications_item = classifications_item_data.to_dict() + classifications.append(classifications_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "from_element_id": from_element_id, + "to_element_id": to_element_id, + "association_type": association_type, + } + ) + if arcrole is not UNSET: + field_dict["arcrole"] = arcrole + if order_value is not UNSET: + field_dict["order_value"] = order_value + if weight is not UNSET: + field_dict["weight"] = weight + if classifications is not UNSET: + field_dict["classifications"] = classifications + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.classification_lite import ClassificationLite + + d = dict(src_dict) + id = d.pop("id") + + from_element_id = d.pop("from_element_id") + + to_element_id = d.pop("to_element_id") + + association_type = d.pop("association_type") + + def _parse_arcrole(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + arcrole = _parse_arcrole(d.pop("arcrole", UNSET)) + + def _parse_order_value(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + order_value = _parse_order_value(d.pop("order_value", UNSET)) + + def _parse_weight(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + weight = _parse_weight(d.pop("weight", UNSET)) + + _classifications = d.pop("classifications", UNSET) + classifications: list[ClassificationLite] | Unset = UNSET + if _classifications is not UNSET: + classifications = [] + for classifications_item_data in _classifications: + classifications_item = ClassificationLite.from_dict(classifications_item_data) + + classifications.append(classifications_item) + + connection_lite = cls( + id=id, + from_element_id=from_element_id, + to_element_id=to_element_id, + association_type=association_type, + arcrole=arcrole, + order_value=order_value, + weight=weight, + classifications=classifications, + ) + + connection_lite.additional_properties = d + return connection_lite + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/create_event_block_request.py b/robosystems_client/models/create_event_block_request.py index 315264b..4ef1aae 100644 --- a/robosystems_client/models/create_event_block_request.py +++ b/robosystems_client/models/create_event_block_request.py @@ -43,19 +43,26 @@ class CreateEventBlockRequest: event_class (CreateEventBlockRequestEventClass | Unset): REA event class. 'economic' events change resources and drive GL postings; 'support' events are audit-trail / value-chain primitives (typically captured with apply_handlers=False). Default: CreateEventBlockRequestEventClass.ECONOMIC. - agent_id (None | str | Unset): Counterparty agent id - resource_type (CreateEventBlockRequestResourceTypeType0 | None | Unset): REA resource kind. One of: goods, - services, money, right, obligation, information, labor. - resource_element_id (None | str | Unset): Specific element being exchanged, if applicable + agent_id (None | str | Unset): ID of the counterparty agent (customer, vendor, employee, lender) involved in the + event. `null` for internal-only events. + resource_type (CreateEventBlockRequestResourceTypeType0 | None | Unset): REA resource kind being exchanged. One + of: `goods`, `services`, `money`, `right`, `obligation`, `information`, `labor`. + resource_element_id (None | str | Unset): ID of the specific element being exchanged, when known (e.g. the cash + account for a treasury movement, the inventory item for a sale). effective_at (datetime.datetime | None | Unset): Accounting recognition date, if different from occurred_at external_id (None | str | Unset): Source-system dedup key. (source, external_id) is enforced unique when external_id is provided, so retries from external adapters are idempotent at the DB level. external_url (None | str | Unset): Deep link back to source-system record - amount (int | None | Unset): Cents, signed - currency (str | Unset): ISO 4217 currency code Default: 'USD'. - description (None | str | Unset): - metadata (CreateEventBlockRequestMetadata | Unset): Event-type-specific payload - dimension_ids (list[str] | Unset): + amount (int | None | Unset): Economic value of the event in **cents** of `currency`, signed. Sign convention + follows the perspective of the entity that owns the graph: inflows positive, outflows negative. `null` for non- + economic events (e.g. `event_class='support'`). + currency (str | Unset): ISO 4217 currency code for `amount`. Default: 'USD'. + description (None | str | Unset): Free-text human-readable summary of the event. + metadata (CreateEventBlockRequestMetadata | Unset): Free-form payload, opaque to the event surface. When + `apply_handlers=True`, the matched handler's metadata schema validates this dict — required keys depend on the + handler registered for `event_type`. Use `preview-event-block` to discover the expected shape without writing. + dimension_ids (list[str] | Unset): IDs of dimension members tagging this event (e.g. department, fund, project). + Propagate to the GL entries produced by the handler. obligated_by_event_id (None | str | Unset): Forward-materialization link: the event that scheduled or obligated this one (e.g. depreciation entries point at the asset_acquired event). discharges_event_id (None | str | Unset): Settlement link: the obligation this event discharges (e.g. diff --git a/robosystems_client/models/create_event_block_request_metadata.py b/robosystems_client/models/create_event_block_request_metadata.py index 001dd2e..e470124 100644 --- a/robosystems_client/models/create_event_block_request_metadata.py +++ b/robosystems_client/models/create_event_block_request_metadata.py @@ -11,7 +11,11 @@ @_attrs_define class CreateEventBlockRequestMetadata: - """Event-type-specific payload""" + """Free-form payload, opaque to the event surface. When `apply_handlers=True`, the matched handler's metadata schema + validates this dict — required keys depend on the handler registered for `event_type`. Use `preview-event-block` to + discover the expected shape without writing. + + """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) diff --git a/robosystems_client/models/create_information_block_request.py b/robosystems_client/models/create_information_block_request.py deleted file mode 100644 index 66e4fc7..0000000 --- a/robosystems_client/models/create_information_block_request.py +++ /dev/null @@ -1,100 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.create_information_block_request_payload import ( - CreateInformationBlockRequestPayload, - ) - - -T = TypeVar("T", bound="CreateInformationBlockRequest") - - -@_attrs_define -class CreateInformationBlockRequest: - """Generic create request — discriminator + typed-at-dispatch payload. - - ``block_type`` selects the registry entry. ``payload`` is validated - against ``BlockTypeRegistryEntry.create_request_model`` (e.g. - :class:`CreateScheduleRequest` for ``block_type='schedule'``) by the - command dispatcher. Chosen over a Pydantic discriminated union on the - top-level request so adding a block type is one registry line, not a - union-arm edit at the request-model layer. - - Attributes: - block_type (str): Block type discriminator. Must match a registered entry in - robosystems.operations.information_block.registry.REGISTRY. - payload (CreateInformationBlockRequestPayload | Unset): Block-type-specific creation payload. Shape-validated - against the registry entry's `create_request_model` at dispatch time; the validation error surfaces as a 422 at - the API boundary. - """ - - block_type: str - payload: CreateInformationBlockRequestPayload | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - block_type = self.block_type - - payload: dict[str, Any] | Unset = UNSET - if not isinstance(self.payload, Unset): - payload = self.payload.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "block_type": block_type, - } - ) - if payload is not UNSET: - field_dict["payload"] = payload - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.create_information_block_request_payload import ( - CreateInformationBlockRequestPayload, - ) - - d = dict(src_dict) - block_type = d.pop("block_type") - - _payload = d.pop("payload", UNSET) - payload: CreateInformationBlockRequestPayload | Unset - if isinstance(_payload, Unset): - payload = UNSET - else: - payload = CreateInformationBlockRequestPayload.from_dict(_payload) - - create_information_block_request = cls( - block_type=block_type, - payload=payload, - ) - - create_information_block_request.additional_properties = d - return create_information_block_request - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/robosystems_client/models/create_legacy_arm.py b/robosystems_client/models/create_legacy_arm.py new file mode 100644 index 0000000..acf5b06 --- /dev/null +++ b/robosystems_client/models/create_legacy_arm.py @@ -0,0 +1,97 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.create_legacy_arm_block_type import CreateLegacyArmBlockType +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.create_legacy_arm_payload import CreateLegacyArmPayload + + +T = TypeVar("T", bound="CreateLegacyArm") + + +@_attrs_define +class CreateLegacyArm: + """Create-information-block body for block types that don't yet have + a typed construction path at the API boundary. + + Statement-family blocks (balance_sheet, income_statement, + cash_flow_statement, equity_statement) are constructed via + `create-report`, not this endpoint. Metric blocks are recognized + but their evaluator has not shipped. Calling this endpoint with one + of these block types returns HTTP 501 with a hint pointing to the + correct construction path. + + Attributes: + block_type (CreateLegacyArmBlockType): Statement-family or metric block type. The endpoint returns 501 for these + values — statements are constructed via `create-report`; metric construction is pending. + payload (CreateLegacyArmPayload | Unset): Untyped payload — typed-arm validation is skipped because the dispatch + handler raises 501 before the payload is consumed. + """ + + block_type: CreateLegacyArmBlockType + payload: CreateLegacyArmPayload | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + block_type = self.block_type.value + + payload: dict[str, Any] | Unset = UNSET + if not isinstance(self.payload, Unset): + payload = self.payload.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "block_type": block_type, + } + ) + if payload is not UNSET: + field_dict["payload"] = payload + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.create_legacy_arm_payload import CreateLegacyArmPayload + + d = dict(src_dict) + block_type = CreateLegacyArmBlockType(d.pop("block_type")) + + _payload = d.pop("payload", UNSET) + payload: CreateLegacyArmPayload | Unset + if isinstance(_payload, Unset): + payload = UNSET + else: + payload = CreateLegacyArmPayload.from_dict(_payload) + + create_legacy_arm = cls( + block_type=block_type, + payload=payload, + ) + + create_legacy_arm.additional_properties = d + return create_legacy_arm + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/create_legacy_arm_block_type.py b/robosystems_client/models/create_legacy_arm_block_type.py new file mode 100644 index 0000000..abbdf69 --- /dev/null +++ b/robosystems_client/models/create_legacy_arm_block_type.py @@ -0,0 +1,12 @@ +from enum import Enum + + +class CreateLegacyArmBlockType(str, Enum): + BALANCE_SHEET = "balance_sheet" + CASH_FLOW_STATEMENT = "cash_flow_statement" + EQUITY_STATEMENT = "equity_statement" + INCOME_STATEMENT = "income_statement" + METRIC = "metric" + + def __str__(self) -> str: + return str(self.value) diff --git a/robosystems_client/models/delete_information_block_request_payload.py b/robosystems_client/models/create_legacy_arm_payload.py similarity index 69% rename from robosystems_client/models/delete_information_block_request_payload.py rename to robosystems_client/models/create_legacy_arm_payload.py index 6018d08..c98700b 100644 --- a/robosystems_client/models/delete_information_block_request_payload.py +++ b/robosystems_client/models/create_legacy_arm_payload.py @@ -6,13 +6,13 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="DeleteInformationBlockRequestPayload") +T = TypeVar("T", bound="CreateLegacyArmPayload") @_attrs_define -class DeleteInformationBlockRequestPayload: - """Block-type-specific delete payload. Typically carries just the structure_id. Shape-validated against the registry - entry's `delete_request_model` at dispatch time. +class CreateLegacyArmPayload: + """Untyped payload — typed-arm validation is skipped because the dispatch handler raises 501 before the payload is + consumed. """ @@ -28,10 +28,10 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - delete_information_block_request_payload = cls() + create_legacy_arm_payload = cls() - delete_information_block_request_payload.additional_properties = d - return delete_information_block_request_payload + create_legacy_arm_payload.additional_properties = d + return create_legacy_arm_payload @property def additional_keys(self) -> list[str]: diff --git a/robosystems_client/models/create_portfolio_block_request.py b/robosystems_client/models/create_portfolio_block_request.py index dd5eca0..28391b0 100644 --- a/robosystems_client/models/create_portfolio_block_request.py +++ b/robosystems_client/models/create_portfolio_block_request.py @@ -26,7 +26,8 @@ class CreatePortfolioBlockRequest: Attributes: portfolio (PortfolioBlockPortfolioFields): Fields settable on the portfolio core when creating a block. - positions (list[PortfolioBlockPositionAdd] | Unset): + positions (list[PortfolioBlockPositionAdd] | Unset): Initial positions to mint inside the new portfolio. Each + references an existing security; pass `[]` to create an empty portfolio. """ portfolio: PortfolioBlockPortfolioFields diff --git a/robosystems_client/models/create_schedule_arm.py b/robosystems_client/models/create_schedule_arm.py new file mode 100644 index 0000000..b9a84b1 --- /dev/null +++ b/robosystems_client/models/create_schedule_arm.py @@ -0,0 +1,81 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.create_schedule_request import CreateScheduleRequest + + +T = TypeVar("T", bound="CreateScheduleArm") + + +@_attrs_define +class CreateScheduleArm: + """Create-information-block body for `block_type="schedule"`. + + Carries a typed schedule payload — full schedule shape is exposed + inline in the OpenAPI schema so SDK callers see every required field. + + Attributes: + block_type (Literal['schedule']): Discriminator value selecting this arm. + payload (CreateScheduleRequest): + """ + + block_type: Literal["schedule"] + payload: CreateScheduleRequest + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + block_type = self.block_type + + payload = self.payload.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "block_type": block_type, + "payload": payload, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.create_schedule_request import CreateScheduleRequest + + d = dict(src_dict) + block_type = cast(Literal["schedule"], d.pop("block_type")) + if block_type != "schedule": + raise ValueError(f"block_type must match const 'schedule', got '{block_type}'") + + payload = CreateScheduleRequest.from_dict(d.pop("payload")) + + create_schedule_arm = cls( + block_type=block_type, + payload=payload, + ) + + create_schedule_arm.additional_properties = d + return create_schedule_arm + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/create_schedule_request.py b/robosystems_client/models/create_schedule_request.py new file mode 100644 index 0000000..01891f3 --- /dev/null +++ b/robosystems_client/models/create_schedule_request.py @@ -0,0 +1,222 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.entry_template_request import EntryTemplateRequest + from ..models.schedule_metadata_request import ScheduleMetadataRequest + + +T = TypeVar("T", bound="CreateScheduleRequest") + + +@_attrs_define +class CreateScheduleRequest: + """ + Attributes: + name (str): Schedule name + element_ids (list[str]): Element IDs to include + period_start (datetime.date): First period start + period_end (datetime.date): Last period end + monthly_amount (int): Monthly amount in cents + entry_template (EntryTemplateRequest): + taxonomy_id (None | str | Unset): Taxonomy ID (auto-creates if omitted) + schedule_metadata (None | ScheduleMetadataRequest | Unset): + closed_through (datetime.date | None | Unset): If provided, facts with period_end ≤ this date are flagged as + 'historical' (already reflected in opening balances, ignored by the close workflow). Used during initial ledger + setup to create schedules whose early facts have already been captured elsewhere. + source_transaction_id (None | str | Unset): Free-form reference to the originating GL transaction (e.g. an + import ID, ledger entry ID, or external system key). Stored in artifact_mechanics for audit; no FK constraint. + """ + + name: str + element_ids: list[str] + period_start: datetime.date + period_end: datetime.date + monthly_amount: int + entry_template: EntryTemplateRequest + taxonomy_id: None | str | Unset = UNSET + schedule_metadata: None | ScheduleMetadataRequest | Unset = UNSET + closed_through: datetime.date | None | Unset = UNSET + source_transaction_id: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.schedule_metadata_request import ScheduleMetadataRequest + + name = self.name + + element_ids = self.element_ids + + period_start = self.period_start.isoformat() + + period_end = self.period_end.isoformat() + + monthly_amount = self.monthly_amount + + entry_template = self.entry_template.to_dict() + + taxonomy_id: None | str | Unset + if isinstance(self.taxonomy_id, Unset): + taxonomy_id = UNSET + else: + taxonomy_id = self.taxonomy_id + + schedule_metadata: dict[str, Any] | None | Unset + if isinstance(self.schedule_metadata, Unset): + schedule_metadata = UNSET + elif isinstance(self.schedule_metadata, ScheduleMetadataRequest): + schedule_metadata = self.schedule_metadata.to_dict() + else: + schedule_metadata = self.schedule_metadata + + closed_through: None | str | Unset + if isinstance(self.closed_through, Unset): + closed_through = UNSET + elif isinstance(self.closed_through, datetime.date): + closed_through = self.closed_through.isoformat() + else: + closed_through = self.closed_through + + source_transaction_id: None | str | Unset + if isinstance(self.source_transaction_id, Unset): + source_transaction_id = UNSET + else: + source_transaction_id = self.source_transaction_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "name": name, + "element_ids": element_ids, + "period_start": period_start, + "period_end": period_end, + "monthly_amount": monthly_amount, + "entry_template": entry_template, + } + ) + if taxonomy_id is not UNSET: + field_dict["taxonomy_id"] = taxonomy_id + if schedule_metadata is not UNSET: + field_dict["schedule_metadata"] = schedule_metadata + if closed_through is not UNSET: + field_dict["closed_through"] = closed_through + if source_transaction_id is not UNSET: + field_dict["source_transaction_id"] = source_transaction_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.entry_template_request import EntryTemplateRequest + from ..models.schedule_metadata_request import ScheduleMetadataRequest + + d = dict(src_dict) + name = d.pop("name") + + element_ids = cast(list[str], d.pop("element_ids")) + + period_start = isoparse(d.pop("period_start")).date() + + period_end = isoparse(d.pop("period_end")).date() + + monthly_amount = d.pop("monthly_amount") + + entry_template = EntryTemplateRequest.from_dict(d.pop("entry_template")) + + def _parse_taxonomy_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + taxonomy_id = _parse_taxonomy_id(d.pop("taxonomy_id", UNSET)) + + def _parse_schedule_metadata( + data: object, + ) -> None | ScheduleMetadataRequest | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + schedule_metadata_type_0 = ScheduleMetadataRequest.from_dict(data) + + return schedule_metadata_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | ScheduleMetadataRequest | Unset, data) + + schedule_metadata = _parse_schedule_metadata(d.pop("schedule_metadata", UNSET)) + + def _parse_closed_through(data: object) -> datetime.date | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + closed_through_type_0 = isoparse(data).date() + + return closed_through_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None | Unset, data) + + closed_through = _parse_closed_through(d.pop("closed_through", UNSET)) + + def _parse_source_transaction_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + source_transaction_id = _parse_source_transaction_id( + d.pop("source_transaction_id", UNSET) + ) + + create_schedule_request = cls( + name=name, + element_ids=element_ids, + period_start=period_start, + period_end=period_end, + monthly_amount=monthly_amount, + entry_template=entry_template, + taxonomy_id=taxonomy_id, + schedule_metadata=schedule_metadata, + closed_through=closed_through, + source_transaction_id=source_transaction_id, + ) + + create_schedule_request.additional_properties = d + return create_schedule_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/create_security_request.py b/robosystems_client/models/create_security_request.py index a4e6335..77b152c 100644 --- a/robosystems_client/models/create_security_request.py +++ b/robosystems_client/models/create_security_request.py @@ -17,16 +17,31 @@ @_attrs_define class CreateSecurityRequest: - """ - Attributes: - name (str): - security_type (str): - entity_id (None | str | Unset): - source_graph_id (None | str | Unset): - security_subtype (None | str | Unset): - terms (CreateSecurityRequestTerms | Unset): - authorized_shares (int | None | Unset): - outstanding_shares (int | None | Unset): + """CQRS body for `POST /operations/create-security`. + + Mints a new security as Master Data — referenced by positions, never + created inline by portfolio operations. The `terms` blob carries + instrument-specific shape (liquidation preference, strike price, + vesting) used by future waterfall-distribution modeling. + + Attributes: + name (str): Display name for the security (e.g. `Common Stock Class A`, `Series A Preferred`). 1-200 characters. + security_type (str): Instrument family. Open vocabulary — common values: `common_stock`, `preferred_stock`, + `warrant`, `convertible_note`, `safe`, `option`, `llc_unit`, `lp_interest`, `restricted_stock_unit`. + entity_id (None | str | Unset): ID of the issuing entity. Optional only if `source_graph_id` is set (pre- + association before the entity is finalized). + source_graph_id (None | str | Unset): Optional pre-association to a tenant company graph. Lets you mint + securities for an entity that hasn't been promoted to a real `entity_id` yet. + security_subtype (None | str | Unset): Free-text refinement of `security_type` (e.g. `class_a`, `series_a`, + `series_seed`). No vocabulary enforcement. + terms (CreateSecurityRequestTerms | Unset): Instrument-specific terms blob (JSONB). Shape depends on + `security_type` — common keys include `liquidation_preference`, `strike_price_cents`, `discount_pct`, + `valuation_cap_cents`, `maturity_date`, `vesting`. Used by future waterfall-distribution modeling; treat as + authoritative storage for instrument mechanics. + authorized_shares (int | None | Unset): Total shares the issuer is authorized to issue for this class. `null` + for instruments where shares aren't a meaningful unit (e.g. convertible notes pre-conversion). + outstanding_shares (int | None | Unset): Shares currently issued and outstanding. Should be ≤ + `authorized_shares` when both are set. """ name: str diff --git a/robosystems_client/models/create_security_request_terms.py b/robosystems_client/models/create_security_request_terms.py index 555ccb7..7f2b7e1 100644 --- a/robosystems_client/models/create_security_request_terms.py +++ b/robosystems_client/models/create_security_request_terms.py @@ -11,7 +11,11 @@ @_attrs_define class CreateSecurityRequestTerms: - """ """ + """Instrument-specific terms blob (JSONB). Shape depends on `security_type` — common keys include + `liquidation_preference`, `strike_price_cents`, `discount_pct`, `valuation_cap_cents`, `maturity_date`, `vesting`. + Used by future waterfall-distribution modeling; treat as authoritative storage for instrument mechanics. + + """ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) diff --git a/robosystems_client/models/delete_information_block_response.py b/robosystems_client/models/delete_information_block_response.py new file mode 100644 index 0000000..4253123 --- /dev/null +++ b/robosystems_client/models/delete_information_block_response.py @@ -0,0 +1,93 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DeleteInformationBlockResponse") + + +@_attrs_define +class DeleteInformationBlockResponse: + """Response for ``delete-information-block``. + + The envelope is gone once the block is deleted, so the response is a + thin confirmation instead — structure_id + block_type + name for + caller bookkeeping. + + Attributes: + structure_id (str): + block_type (str): + name (str): + deleted (bool | Unset): Default: True. + """ + + structure_id: str + block_type: str + name: str + deleted: bool | Unset = True + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + structure_id = self.structure_id + + block_type = self.block_type + + name = self.name + + deleted = self.deleted + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "structure_id": structure_id, + "block_type": block_type, + "name": name, + } + ) + if deleted is not UNSET: + field_dict["deleted"] = deleted + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + structure_id = d.pop("structure_id") + + block_type = d.pop("block_type") + + name = d.pop("name") + + deleted = d.pop("deleted", UNSET) + + delete_information_block_response = cls( + structure_id=structure_id, + block_type=block_type, + name=name, + deleted=deleted, + ) + + delete_information_block_response.additional_properties = d + return delete_information_block_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/update_information_block_request.py b/robosystems_client/models/delete_legacy_arm.py similarity index 50% rename from robosystems_client/models/update_information_block_request.py rename to robosystems_client/models/delete_legacy_arm.py index 6bc1d2c..44de0d9 100644 --- a/robosystems_client/models/update_information_block_request.py +++ b/robosystems_client/models/delete_legacy_arm.py @@ -6,39 +6,38 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field +from ..models.delete_legacy_arm_block_type import DeleteLegacyArmBlockType from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.update_information_block_request_payload import ( - UpdateInformationBlockRequestPayload, - ) + from ..models.delete_legacy_arm_payload import DeleteLegacyArmPayload -T = TypeVar("T", bound="UpdateInformationBlockRequest") +T = TypeVar("T", bound="DeleteLegacyArm") @_attrs_define -class UpdateInformationBlockRequest: - """Generic update request — mirrors :class:`CreateInformationBlockRequest`. +class DeleteLegacyArm: + """Delete-information-block body for block types that don't yet have + a typed delete path at the API boundary. - Validated against the registry entry's ``update_request_model``. - Block types that don't support updates (e.g. the statement family, - whose Structures are library-seeded) surface ``NotImplementedError`` - from their dispatch handler, which the registrar maps to HTTP 501. + Statement-family blocks cannot be deleted per tenant (the underlying + Report should be archived via the report APIs instead). Metric + deletion is not yet implemented. Calls return HTTP 501. Attributes: - block_type (str): Block type discriminator. Must match a registered entry. - payload (UpdateInformationBlockRequestPayload | Unset): Block-type-specific update payload. Typically carries - the structure_id plus whichever fields are editable for this block type. Shape-validated against the registry - entry's `update_request_model` at dispatch time. + block_type (DeleteLegacyArmBlockType): Statement-family or metric block type. Deletion returns 501 — statements + are library-seeded (archive the underlying Report instead); metric deletion is pending. + payload (DeleteLegacyArmPayload | Unset): Untyped payload — typed-arm validation is skipped because the dispatch + handler raises 501 before the payload is consumed. """ - block_type: str - payload: UpdateInformationBlockRequestPayload | Unset = UNSET + block_type: DeleteLegacyArmBlockType + payload: DeleteLegacyArmPayload | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - block_type = self.block_type + block_type = self.block_type.value payload: dict[str, Any] | Unset = UNSET if not isinstance(self.payload, Unset): @@ -58,27 +57,25 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.update_information_block_request_payload import ( - UpdateInformationBlockRequestPayload, - ) + from ..models.delete_legacy_arm_payload import DeleteLegacyArmPayload d = dict(src_dict) - block_type = d.pop("block_type") + block_type = DeleteLegacyArmBlockType(d.pop("block_type")) _payload = d.pop("payload", UNSET) - payload: UpdateInformationBlockRequestPayload | Unset + payload: DeleteLegacyArmPayload | Unset if isinstance(_payload, Unset): payload = UNSET else: - payload = UpdateInformationBlockRequestPayload.from_dict(_payload) + payload = DeleteLegacyArmPayload.from_dict(_payload) - update_information_block_request = cls( + delete_legacy_arm = cls( block_type=block_type, payload=payload, ) - update_information_block_request.additional_properties = d - return update_information_block_request + delete_legacy_arm.additional_properties = d + return delete_legacy_arm @property def additional_keys(self) -> list[str]: diff --git a/robosystems_client/models/delete_legacy_arm_block_type.py b/robosystems_client/models/delete_legacy_arm_block_type.py new file mode 100644 index 0000000..cdadc9c --- /dev/null +++ b/robosystems_client/models/delete_legacy_arm_block_type.py @@ -0,0 +1,12 @@ +from enum import Enum + + +class DeleteLegacyArmBlockType(str, Enum): + BALANCE_SHEET = "balance_sheet" + CASH_FLOW_STATEMENT = "cash_flow_statement" + EQUITY_STATEMENT = "equity_statement" + INCOME_STATEMENT = "income_statement" + METRIC = "metric" + + def __str__(self) -> str: + return str(self.value) diff --git a/robosystems_client/models/create_information_block_request_payload.py b/robosystems_client/models/delete_legacy_arm_payload.py similarity index 68% rename from robosystems_client/models/create_information_block_request_payload.py rename to robosystems_client/models/delete_legacy_arm_payload.py index 5774734..5c3b6f8 100644 --- a/robosystems_client/models/create_information_block_request_payload.py +++ b/robosystems_client/models/delete_legacy_arm_payload.py @@ -6,13 +6,13 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="CreateInformationBlockRequestPayload") +T = TypeVar("T", bound="DeleteLegacyArmPayload") @_attrs_define -class CreateInformationBlockRequestPayload: - """Block-type-specific creation payload. Shape-validated against the registry entry's `create_request_model` at - dispatch time; the validation error surfaces as a 422 at the API boundary. +class DeleteLegacyArmPayload: + """Untyped payload — typed-arm validation is skipped because the dispatch handler raises 501 before the payload is + consumed. """ @@ -28,10 +28,10 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - create_information_block_request_payload = cls() + delete_legacy_arm_payload = cls() - create_information_block_request_payload.additional_properties = d - return create_information_block_request_payload + delete_legacy_arm_payload.additional_properties = d + return delete_legacy_arm_payload @property def additional_keys(self) -> list[str]: diff --git a/robosystems_client/models/delete_portfolio_block_operation.py b/robosystems_client/models/delete_portfolio_block_operation.py index d53abe6..41c9879 100644 --- a/robosystems_client/models/delete_portfolio_block_operation.py +++ b/robosystems_client/models/delete_portfolio_block_operation.py @@ -22,7 +22,9 @@ class DeletePortfolioBlockOperation: Attributes: portfolio_id (str): Target portfolio ID. - confirm_active_positions (bool | Unset): Default: False. + confirm_active_positions (bool | Unset): Required acknowledgement when the portfolio has active positions. Set + `true` to consent to cascade-deleting them; leave `false` and the operation returns 409 if any active positions + exist. Default: False. """ portfolio_id: str diff --git a/robosystems_client/models/delete_portfolio_block_response.py b/robosystems_client/models/delete_portfolio_block_response.py new file mode 100644 index 0000000..8fa6a19 --- /dev/null +++ b/robosystems_client/models/delete_portfolio_block_response.py @@ -0,0 +1,79 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="DeletePortfolioBlockResponse") + + +@_attrs_define +class DeletePortfolioBlockResponse: + """Result envelope for `delete-portfolio-block`. `positions_deleted` + carries the count of position rows removed alongside the portfolio. + + Attributes: + deleted (bool): `true` when the portfolio row was removed. + portfolio_id (str): ID of the portfolio that was deleted. + positions_deleted (int): Count of position rows cascade-deleted with the portfolio. + """ + + deleted: bool + portfolio_id: str + positions_deleted: int + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + deleted = self.deleted + + portfolio_id = self.portfolio_id + + positions_deleted = self.positions_deleted + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "deleted": deleted, + "portfolio_id": portfolio_id, + "positions_deleted": positions_deleted, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + deleted = d.pop("deleted") + + portfolio_id = d.pop("portfolio_id") + + positions_deleted = d.pop("positions_deleted") + + delete_portfolio_block_response = cls( + deleted=deleted, + portfolio_id=portfolio_id, + positions_deleted=positions_deleted, + ) + + delete_portfolio_block_response.additional_properties = d + return delete_portfolio_block_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/delete_result.py b/robosystems_client/models/delete_result.py new file mode 100644 index 0000000..484cf7f --- /dev/null +++ b/robosystems_client/models/delete_result.py @@ -0,0 +1,65 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="DeleteResult") + + +@_attrs_define +class DeleteResult: + """Shared response shape for soft-delete operations (e.g., + `delete-security`). `deleted=true` means a row was flipped; 404 is + raised by the handler when no row existed. + + Attributes: + deleted (bool): `true` when the row was soft-deleted in this call. Always `true` on a 200 response; the 404 path + is taken instead when the row didn't exist. + """ + + deleted: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + deleted = self.deleted + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "deleted": deleted, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + deleted = d.pop("deleted") + + delete_result = cls( + deleted=deleted, + ) + + delete_result.additional_properties = d + return delete_result + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/delete_schedule_arm.py b/robosystems_client/models/delete_schedule_arm.py new file mode 100644 index 0000000..bc710a5 --- /dev/null +++ b/robosystems_client/models/delete_schedule_arm.py @@ -0,0 +1,86 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.delete_schedule_request import DeleteScheduleRequest + + +T = TypeVar("T", bound="DeleteScheduleArm") + + +@_attrs_define +class DeleteScheduleArm: + """Delete-information-block body for `block_type="schedule"`. + + Carries a typed schedule delete payload — just the `structure_id`. + + Attributes: + block_type (Literal['schedule']): Discriminator value selecting this arm. + payload (DeleteScheduleRequest): Delete a schedule — cascades through facts and associations. + + Hard deletes the Structure, all Facts tied to it, and all + Associations tied to it. This is a permanent, irreversible + operation. For ending a schedule early without removing history, + fire `create-event-block(event_type='asset_disposed')` instead — the + handler truncates the schedule + posts the disposal entry atomically. + """ + + block_type: Literal["schedule"] + payload: DeleteScheduleRequest + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + block_type = self.block_type + + payload = self.payload.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "block_type": block_type, + "payload": payload, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.delete_schedule_request import DeleteScheduleRequest + + d = dict(src_dict) + block_type = cast(Literal["schedule"], d.pop("block_type")) + if block_type != "schedule": + raise ValueError(f"block_type must match const 'schedule', got '{block_type}'") + + payload = DeleteScheduleRequest.from_dict(d.pop("payload")) + + delete_schedule_arm = cls( + block_type=block_type, + payload=payload, + ) + + delete_schedule_arm.additional_properties = d + return delete_schedule_arm + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/delete_schedule_request.py b/robosystems_client/models/delete_schedule_request.py new file mode 100644 index 0000000..6a1f009 --- /dev/null +++ b/robosystems_client/models/delete_schedule_request.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="DeleteScheduleRequest") + + +@_attrs_define +class DeleteScheduleRequest: + """Delete a schedule — cascades through facts and associations. + + Hard deletes the Structure, all Facts tied to it, and all + Associations tied to it. This is a permanent, irreversible + operation. For ending a schedule early without removing history, + fire `create-event-block(event_type='asset_disposed')` instead — the + handler truncates the schedule + posts the disposal entry atomically. + + Attributes: + structure_id (str): + """ + + structure_id: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + structure_id = self.structure_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "structure_id": structure_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + structure_id = d.pop("structure_id") + + delete_schedule_request = cls( + structure_id=structure_id, + ) + + delete_schedule_request.additional_properties = d + return delete_schedule_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/element_lite.py b/robosystems_client/models/element_lite.py new file mode 100644 index 0000000..28de549 --- /dev/null +++ b/robosystems_client/models/element_lite.py @@ -0,0 +1,183 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ElementLite") + + +@_attrs_define +class ElementLite: + """Element projection for bundling inside an Information Block envelope. + + Narrower than :class:`LibraryElementResponse` — excludes the heavy fields + (labels, references, classifications) that library browsing needs but + block consumers don't. Agents + frontends ask for those on demand via + the full library GraphQL fields when they need them. + + Attributes: + id (str): + name (str): + element_type (str): concept | abstract | axis | member | hypercube + qname (None | str | Unset): + code (None | str | Unset): + is_abstract (bool | Unset): Default: False. + is_monetary (bool | Unset): Default: True. + balance_type (None | str | Unset): + period_type (None | str | Unset): + """ + + id: str + name: str + element_type: str + qname: None | str | Unset = UNSET + code: None | str | Unset = UNSET + is_abstract: bool | Unset = False + is_monetary: bool | Unset = True + balance_type: None | str | Unset = UNSET + period_type: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + element_type = self.element_type + + qname: None | str | Unset + if isinstance(self.qname, Unset): + qname = UNSET + else: + qname = self.qname + + code: None | str | Unset + if isinstance(self.code, Unset): + code = UNSET + else: + code = self.code + + is_abstract = self.is_abstract + + is_monetary = self.is_monetary + + balance_type: None | str | Unset + if isinstance(self.balance_type, Unset): + balance_type = UNSET + else: + balance_type = self.balance_type + + period_type: None | str | Unset + if isinstance(self.period_type, Unset): + period_type = UNSET + else: + period_type = self.period_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "name": name, + "element_type": element_type, + } + ) + if qname is not UNSET: + field_dict["qname"] = qname + if code is not UNSET: + field_dict["code"] = code + if is_abstract is not UNSET: + field_dict["is_abstract"] = is_abstract + if is_monetary is not UNSET: + field_dict["is_monetary"] = is_monetary + if balance_type is not UNSET: + field_dict["balance_type"] = balance_type + if period_type is not UNSET: + field_dict["period_type"] = period_type + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name") + + element_type = d.pop("element_type") + + def _parse_qname(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + qname = _parse_qname(d.pop("qname", UNSET)) + + def _parse_code(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + code = _parse_code(d.pop("code", UNSET)) + + is_abstract = d.pop("is_abstract", UNSET) + + is_monetary = d.pop("is_monetary", UNSET) + + def _parse_balance_type(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + balance_type = _parse_balance_type(d.pop("balance_type", UNSET)) + + def _parse_period_type(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + period_type = _parse_period_type(d.pop("period_type", UNSET)) + + element_lite = cls( + id=id, + name=name, + element_type=element_type, + qname=qname, + code=code, + is_abstract=is_abstract, + is_monetary=is_monetary, + balance_type=balance_type, + period_type=period_type, + ) + + element_lite.additional_properties = d + return element_lite + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/entity_lite.py b/robosystems_client/models/entity_lite.py new file mode 100644 index 0000000..aeaf08f --- /dev/null +++ b/robosystems_client/models/entity_lite.py @@ -0,0 +1,95 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="EntityLite") + + +@_attrs_define +class EntityLite: + """Lightweight entity projection for embedding in portfolio-block / + position envelopes. Carries identity-only fields; full entity data + lives behind the Master Data entity APIs. + + Attributes: + id (str): Entity ID (`ent_*` ULID). + name (str): Display name of the entity. + source_graph_id (None | str | Unset): Tenant graph this entity is anchored to, when known. `null` for entities + not yet linked to a graph. + """ + + id: str + name: str + source_graph_id: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + source_graph_id: None | str | Unset + if isinstance(self.source_graph_id, Unset): + source_graph_id = UNSET + else: + source_graph_id = self.source_graph_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "name": name, + } + ) + if source_graph_id is not UNSET: + field_dict["source_graph_id"] = source_graph_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name") + + def _parse_source_graph_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + source_graph_id = _parse_source_graph_id(d.pop("source_graph_id", UNSET)) + + entity_lite = cls( + id=id, + name=name, + source_graph_id=source_graph_id, + ) + + entity_lite.additional_properties = d + return entity_lite + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/entry_template_request.py b/robosystems_client/models/entry_template_request.py new file mode 100644 index 0000000..ac35d55 --- /dev/null +++ b/robosystems_client/models/entry_template_request.py @@ -0,0 +1,109 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.entry_template_request_entry_type import EntryTemplateRequestEntryType +from ..types import UNSET, Unset + +T = TypeVar("T", bound="EntryTemplateRequest") + + +@_attrs_define +class EntryTemplateRequest: + """ + Attributes: + debit_element_id (str): Element to debit (e.g., Depreciation Expense) + credit_element_id (str): Element to credit (e.g., Accumulated Depreciation) + entry_type (EntryTemplateRequestEntryType | Unset): Entry type for generated entries Default: + EntryTemplateRequestEntryType.CLOSING. + memo_template (str | Unset): Memo template ({structure_name} is replaced) Default: ''. + auto_reverse (bool | Unset): Auto-generate a reversing entry on the first day of the next period Default: False. + """ + + debit_element_id: str + credit_element_id: str + entry_type: EntryTemplateRequestEntryType | Unset = ( + EntryTemplateRequestEntryType.CLOSING + ) + memo_template: str | Unset = "" + auto_reverse: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + debit_element_id = self.debit_element_id + + credit_element_id = self.credit_element_id + + entry_type: str | Unset = UNSET + if not isinstance(self.entry_type, Unset): + entry_type = self.entry_type.value + + memo_template = self.memo_template + + auto_reverse = self.auto_reverse + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "debit_element_id": debit_element_id, + "credit_element_id": credit_element_id, + } + ) + if entry_type is not UNSET: + field_dict["entry_type"] = entry_type + if memo_template is not UNSET: + field_dict["memo_template"] = memo_template + if auto_reverse is not UNSET: + field_dict["auto_reverse"] = auto_reverse + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + debit_element_id = d.pop("debit_element_id") + + credit_element_id = d.pop("credit_element_id") + + _entry_type = d.pop("entry_type", UNSET) + entry_type: EntryTemplateRequestEntryType | Unset + if isinstance(_entry_type, Unset): + entry_type = UNSET + else: + entry_type = EntryTemplateRequestEntryType(_entry_type) + + memo_template = d.pop("memo_template", UNSET) + + auto_reverse = d.pop("auto_reverse", UNSET) + + entry_template_request = cls( + debit_element_id=debit_element_id, + credit_element_id=credit_element_id, + entry_type=entry_type, + memo_template=memo_template, + auto_reverse=auto_reverse, + ) + + entry_template_request.additional_properties = d + return entry_template_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/entry_template_request_entry_type.py b/robosystems_client/models/entry_template_request_entry_type.py new file mode 100644 index 0000000..e9b043f --- /dev/null +++ b/robosystems_client/models/entry_template_request_entry_type.py @@ -0,0 +1,11 @@ +from enum import Enum + + +class EntryTemplateRequestEntryType(str, Enum): + ADJUSTING = "adjusting" + CLOSING = "closing" + REVERSING = "reversing" + STANDARD = "standard" + + def __str__(self) -> str: + return str(self.value) diff --git a/robosystems_client/models/event_block_envelope.py b/robosystems_client/models/event_block_envelope.py new file mode 100644 index 0000000..d250e66 --- /dev/null +++ b/robosystems_client/models/event_block_envelope.py @@ -0,0 +1,439 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.event_block_envelope_metadata import EventBlockEnvelopeMetadata + + +T = TypeVar("T", bound="EventBlockEnvelope") + + +@_attrs_define +class EventBlockEnvelope: + """Read projection for a single event block. + + Returned by `create-event-block`, `update-event-block`, + `preview-event-block`, and the read-side `get-event-block`. Mirrors + the request shape plus server-assigned fields (id, status, audit + timestamps) and the four nullable correction/duality links. + + Attributes: + id (str): Event ID (`evt_*` ULID). + event_type (str): Open-vocabulary event type (e.g. `invoice_issued`, `bank_transaction`, `control_executed`). + event_category (str): REA category — economic (`sales`, `purchase`, `financing`, `payroll`, `treasury`, + `adjustment`, `recognition`, `other`) or support (`control`, `approval`, `reconciliation`, `inquiry`). + status (str): Lifecycle state. One of: `captured` (raw, pre-classification), `classified` (handler ran, GL + pending), `committed` (GL entries posted), `pending` (committed but awaiting fulfillment of an obligation), + `fulfilled` (obligation discharged), `voided` (canceled — terminal), `superseded` (replaced by a corrected event + — terminal). See `UpdateEventBlockRequest.transition_to` for the valid transition graph. + occurred_at (datetime.datetime): When the event happened in the real world (UTC). + source (str): Capture source (`quickbooks`, `xero`, `plaid`, `native`, `scheduled`, …). Used for adapter + routing. + currency (str): ISO 4217 currency code for `amount`. + metadata (EventBlockEnvelopeMetadata): Free-form payload — handler-specific keys when the event ran through a + handler, otherwise whatever the adapter captured. + dimension_ids (list[str]): Dimension-member IDs tagging this event (department, fund, project). Propagate to GL + entries produced by the handler. + event_class (str): REA event class — `economic` (drives GL postings) or `support` (audit-trail / value-chain + primitive, no GL impact). + created_at (datetime.datetime): Row creation timestamp (UTC). + created_by (str): ID of the user who captured the event. For adapter-sourced events, the system actor associated + with the adapter. + effective_at (datetime.datetime | None | Unset): Accounting recognition date, when different from `occurred_at`. + external_id (None | str | Unset): Source-system dedup key. Unique with `source` when set, so adapter retries are + idempotent. + external_url (None | str | Unset): Deep link back to the source-system record. + amount (int | None | Unset): Economic value in **cents** of `currency`, signed (inflows positive, outflows + negative). `null` for non-economic events. + description (None | str | Unset): Free-text human-readable summary. + agent_id (None | str | Unset): Counterparty agent ID, when the event involves one. + resource_type (None | str | Unset): REA resource kind being exchanged (`goods`, `services`, `money`, `right`, + `obligation`, `information`, `labor`). + resource_element_id (None | str | Unset): Specific element ID being exchanged, when known. + replaced_by_event_id (None | str | Unset): ID of the event that replaces this one. Set when this event was + superseded (`status='superseded'`); points forward in the correction chain. + replaces_event_id (None | str | Unset): ID of the event this one replaces, when applicable. Points backward in + the correction chain. Mirror of `replaced_by_event_id` on the predecessor. + obligated_by_event_id (None | str | Unset): Forward-materialization link — the event that scheduled or obligated + this one (e.g. depreciation entries point at the originating `asset_acquired` event). + discharges_event_id (None | str | Unset): Settlement link — the obligation this event discharges (e.g. + `cash_received` pointing at the originating `sale_invoiced`). + """ + + id: str + event_type: str + event_category: str + status: str + occurred_at: datetime.datetime + source: str + currency: str + metadata: EventBlockEnvelopeMetadata + dimension_ids: list[str] + event_class: str + created_at: datetime.datetime + created_by: str + effective_at: datetime.datetime | None | Unset = UNSET + external_id: None | str | Unset = UNSET + external_url: None | str | Unset = UNSET + amount: int | None | Unset = UNSET + description: None | str | Unset = UNSET + agent_id: None | str | Unset = UNSET + resource_type: None | str | Unset = UNSET + resource_element_id: None | str | Unset = UNSET + replaced_by_event_id: None | str | Unset = UNSET + replaces_event_id: None | str | Unset = UNSET + obligated_by_event_id: None | str | Unset = UNSET + discharges_event_id: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + event_type = self.event_type + + event_category = self.event_category + + status = self.status + + occurred_at = self.occurred_at.isoformat() + + source = self.source + + currency = self.currency + + metadata = self.metadata.to_dict() + + dimension_ids = self.dimension_ids + + event_class = self.event_class + + created_at = self.created_at.isoformat() + + created_by = self.created_by + + effective_at: None | str | Unset + if isinstance(self.effective_at, Unset): + effective_at = UNSET + elif isinstance(self.effective_at, datetime.datetime): + effective_at = self.effective_at.isoformat() + else: + effective_at = self.effective_at + + external_id: None | str | Unset + if isinstance(self.external_id, Unset): + external_id = UNSET + else: + external_id = self.external_id + + external_url: None | str | Unset + if isinstance(self.external_url, Unset): + external_url = UNSET + else: + external_url = self.external_url + + amount: int | None | Unset + if isinstance(self.amount, Unset): + amount = UNSET + else: + amount = self.amount + + description: None | str | Unset + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + agent_id: None | str | Unset + if isinstance(self.agent_id, Unset): + agent_id = UNSET + else: + agent_id = self.agent_id + + resource_type: None | str | Unset + if isinstance(self.resource_type, Unset): + resource_type = UNSET + else: + resource_type = self.resource_type + + resource_element_id: None | str | Unset + if isinstance(self.resource_element_id, Unset): + resource_element_id = UNSET + else: + resource_element_id = self.resource_element_id + + replaced_by_event_id: None | str | Unset + if isinstance(self.replaced_by_event_id, Unset): + replaced_by_event_id = UNSET + else: + replaced_by_event_id = self.replaced_by_event_id + + replaces_event_id: None | str | Unset + if isinstance(self.replaces_event_id, Unset): + replaces_event_id = UNSET + else: + replaces_event_id = self.replaces_event_id + + obligated_by_event_id: None | str | Unset + if isinstance(self.obligated_by_event_id, Unset): + obligated_by_event_id = UNSET + else: + obligated_by_event_id = self.obligated_by_event_id + + discharges_event_id: None | str | Unset + if isinstance(self.discharges_event_id, Unset): + discharges_event_id = UNSET + else: + discharges_event_id = self.discharges_event_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "event_type": event_type, + "event_category": event_category, + "status": status, + "occurred_at": occurred_at, + "source": source, + "currency": currency, + "metadata": metadata, + "dimension_ids": dimension_ids, + "event_class": event_class, + "created_at": created_at, + "created_by": created_by, + } + ) + if effective_at is not UNSET: + field_dict["effective_at"] = effective_at + if external_id is not UNSET: + field_dict["external_id"] = external_id + if external_url is not UNSET: + field_dict["external_url"] = external_url + if amount is not UNSET: + field_dict["amount"] = amount + if description is not UNSET: + field_dict["description"] = description + if agent_id is not UNSET: + field_dict["agent_id"] = agent_id + if resource_type is not UNSET: + field_dict["resource_type"] = resource_type + if resource_element_id is not UNSET: + field_dict["resource_element_id"] = resource_element_id + if replaced_by_event_id is not UNSET: + field_dict["replaced_by_event_id"] = replaced_by_event_id + if replaces_event_id is not UNSET: + field_dict["replaces_event_id"] = replaces_event_id + if obligated_by_event_id is not UNSET: + field_dict["obligated_by_event_id"] = obligated_by_event_id + if discharges_event_id is not UNSET: + field_dict["discharges_event_id"] = discharges_event_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.event_block_envelope_metadata import EventBlockEnvelopeMetadata + + d = dict(src_dict) + id = d.pop("id") + + event_type = d.pop("event_type") + + event_category = d.pop("event_category") + + status = d.pop("status") + + occurred_at = isoparse(d.pop("occurred_at")) + + source = d.pop("source") + + currency = d.pop("currency") + + metadata = EventBlockEnvelopeMetadata.from_dict(d.pop("metadata")) + + dimension_ids = cast(list[str], d.pop("dimension_ids")) + + event_class = d.pop("event_class") + + created_at = isoparse(d.pop("created_at")) + + created_by = d.pop("created_by") + + def _parse_effective_at(data: object) -> datetime.datetime | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + effective_at_type_0 = isoparse(data) + + return effective_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None | Unset, data) + + effective_at = _parse_effective_at(d.pop("effective_at", UNSET)) + + def _parse_external_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + external_id = _parse_external_id(d.pop("external_id", UNSET)) + + def _parse_external_url(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + external_url = _parse_external_url(d.pop("external_url", UNSET)) + + def _parse_amount(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + amount = _parse_amount(d.pop("amount", UNSET)) + + def _parse_description(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + description = _parse_description(d.pop("description", UNSET)) + + def _parse_agent_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + agent_id = _parse_agent_id(d.pop("agent_id", UNSET)) + + def _parse_resource_type(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + resource_type = _parse_resource_type(d.pop("resource_type", UNSET)) + + def _parse_resource_element_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + resource_element_id = _parse_resource_element_id( + d.pop("resource_element_id", UNSET) + ) + + def _parse_replaced_by_event_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + replaced_by_event_id = _parse_replaced_by_event_id( + d.pop("replaced_by_event_id", UNSET) + ) + + def _parse_replaces_event_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + replaces_event_id = _parse_replaces_event_id(d.pop("replaces_event_id", UNSET)) + + def _parse_obligated_by_event_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + obligated_by_event_id = _parse_obligated_by_event_id( + d.pop("obligated_by_event_id", UNSET) + ) + + def _parse_discharges_event_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + discharges_event_id = _parse_discharges_event_id( + d.pop("discharges_event_id", UNSET) + ) + + event_block_envelope = cls( + id=id, + event_type=event_type, + event_category=event_category, + status=status, + occurred_at=occurred_at, + source=source, + currency=currency, + metadata=metadata, + dimension_ids=dimension_ids, + event_class=event_class, + created_at=created_at, + created_by=created_by, + effective_at=effective_at, + external_id=external_id, + external_url=external_url, + amount=amount, + description=description, + agent_id=agent_id, + resource_type=resource_type, + resource_element_id=resource_element_id, + replaced_by_event_id=replaced_by_event_id, + replaces_event_id=replaces_event_id, + obligated_by_event_id=obligated_by_event_id, + discharges_event_id=discharges_event_id, + ) + + event_block_envelope.additional_properties = d + return event_block_envelope + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/update_information_block_request_payload.py b/robosystems_client/models/event_block_envelope_metadata.py similarity index 66% rename from robosystems_client/models/update_information_block_request_payload.py rename to robosystems_client/models/event_block_envelope_metadata.py index 34c40b6..b747e5b 100644 --- a/robosystems_client/models/update_information_block_request_payload.py +++ b/robosystems_client/models/event_block_envelope_metadata.py @@ -6,13 +6,13 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="UpdateInformationBlockRequestPayload") +T = TypeVar("T", bound="EventBlockEnvelopeMetadata") @_attrs_define -class UpdateInformationBlockRequestPayload: - """Block-type-specific update payload. Typically carries the structure_id plus whichever fields are editable for this - block type. Shape-validated against the registry entry's `update_request_model` at dispatch time. +class EventBlockEnvelopeMetadata: + """Free-form payload — handler-specific keys when the event ran through a handler, otherwise whatever the adapter + captured. """ @@ -28,10 +28,10 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - update_information_block_request_payload = cls() + event_block_envelope_metadata = cls() - update_information_block_request_payload.additional_properties = d - return update_information_block_request_payload + event_block_envelope_metadata.additional_properties = d + return event_block_envelope_metadata @property def additional_keys(self) -> list[str]: diff --git a/robosystems_client/models/fact_lite.py b/robosystems_client/models/fact_lite.py new file mode 100644 index 0000000..79d6b53 --- /dev/null +++ b/robosystems_client/models/fact_lite.py @@ -0,0 +1,165 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="FactLite") + + +@_attrs_define +class FactLite: + """Fact projection — just the values the envelope caller cares about. + + Attributes: + id (str): + element_id (str): + value (float): + period_end (datetime.date): + period_type (str): + fact_scope (str): historical | in_scope + period_start (datetime.date | None | Unset): + unit (str | Unset): Default: 'USD'. + fact_set_id (None | str | Unset): + """ + + id: str + element_id: str + value: float + period_end: datetime.date + period_type: str + fact_scope: str + period_start: datetime.date | None | Unset = UNSET + unit: str | Unset = "USD" + fact_set_id: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + element_id = self.element_id + + value = self.value + + period_end = self.period_end.isoformat() + + period_type = self.period_type + + fact_scope = self.fact_scope + + period_start: None | str | Unset + if isinstance(self.period_start, Unset): + period_start = UNSET + elif isinstance(self.period_start, datetime.date): + period_start = self.period_start.isoformat() + else: + period_start = self.period_start + + unit = self.unit + + fact_set_id: None | str | Unset + if isinstance(self.fact_set_id, Unset): + fact_set_id = UNSET + else: + fact_set_id = self.fact_set_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "element_id": element_id, + "value": value, + "period_end": period_end, + "period_type": period_type, + "fact_scope": fact_scope, + } + ) + if period_start is not UNSET: + field_dict["period_start"] = period_start + if unit is not UNSET: + field_dict["unit"] = unit + if fact_set_id is not UNSET: + field_dict["fact_set_id"] = fact_set_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + element_id = d.pop("element_id") + + value = d.pop("value") + + period_end = isoparse(d.pop("period_end")).date() + + period_type = d.pop("period_type") + + fact_scope = d.pop("fact_scope") + + def _parse_period_start(data: object) -> datetime.date | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + period_start_type_0 = isoparse(data).date() + + return period_start_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None | Unset, data) + + period_start = _parse_period_start(d.pop("period_start", UNSET)) + + unit = d.pop("unit", UNSET) + + def _parse_fact_set_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + fact_set_id = _parse_fact_set_id(d.pop("fact_set_id", UNSET)) + + fact_lite = cls( + id=id, + element_id=element_id, + value=value, + period_end=period_end, + period_type=period_type, + fact_scope=fact_scope, + period_start=period_start, + unit=unit, + fact_set_id=fact_set_id, + ) + + fact_lite.additional_properties = d + return fact_lite + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/fact_set_lite.py b/robosystems_client/models/fact_set_lite.py new file mode 100644 index 0000000..55d2b02 --- /dev/null +++ b/robosystems_client/models/fact_set_lite.py @@ -0,0 +1,167 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="FactSetLite") + + +@_attrs_define +class FactSetLite: + """FactSet projection — period-specific instantiation of the Structure. + + The envelope carries one ``FactSetLite`` per block when a FactSet row + exists for the requested period; legacy writes that pre-date FactSet + stamping leave ``fact_set`` null until the expand pass starts + populating those rows. + + Attributes: + id (str): + period_end (datetime.date): + factset_type (str): 'report' | 'schedule' | 'custom'. Enum closure enforced by the ``public.fact_sets`` CHECK + constraint. + entity_id (str): + structure_id (None | str | Unset): + period_start (datetime.date | None | Unset): + report_id (None | str | Unset): Back-pointer to the ``reports`` table while ``report_id`` still lives on facts. + Drops out once the retirement migration lands. + """ + + id: str + period_end: datetime.date + factset_type: str + entity_id: str + structure_id: None | str | Unset = UNSET + period_start: datetime.date | None | Unset = UNSET + report_id: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + period_end = self.period_end.isoformat() + + factset_type = self.factset_type + + entity_id = self.entity_id + + structure_id: None | str | Unset + if isinstance(self.structure_id, Unset): + structure_id = UNSET + else: + structure_id = self.structure_id + + period_start: None | str | Unset + if isinstance(self.period_start, Unset): + period_start = UNSET + elif isinstance(self.period_start, datetime.date): + period_start = self.period_start.isoformat() + else: + period_start = self.period_start + + report_id: None | str | Unset + if isinstance(self.report_id, Unset): + report_id = UNSET + else: + report_id = self.report_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "period_end": period_end, + "factset_type": factset_type, + "entity_id": entity_id, + } + ) + if structure_id is not UNSET: + field_dict["structure_id"] = structure_id + if period_start is not UNSET: + field_dict["period_start"] = period_start + if report_id is not UNSET: + field_dict["report_id"] = report_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + period_end = isoparse(d.pop("period_end")).date() + + factset_type = d.pop("factset_type") + + entity_id = d.pop("entity_id") + + def _parse_structure_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + structure_id = _parse_structure_id(d.pop("structure_id", UNSET)) + + def _parse_period_start(data: object) -> datetime.date | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + period_start_type_0 = isoparse(data).date() + + return period_start_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None | Unset, data) + + period_start = _parse_period_start(d.pop("period_start", UNSET)) + + def _parse_report_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + report_id = _parse_report_id(d.pop("report_id", UNSET)) + + fact_set_lite = cls( + id=id, + period_end=period_end, + factset_type=factset_type, + entity_id=entity_id, + structure_id=structure_id, + period_start=period_start, + report_id=report_id, + ) + + fact_set_lite.additional_properties = d + return fact_set_lite + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/information_block_envelope.py b/robosystems_client/models/information_block_envelope.py new file mode 100644 index 0000000..e1ebe54 --- /dev/null +++ b/robosystems_client/models/information_block_envelope.py @@ -0,0 +1,383 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.artifact_response import ArtifactResponse + from ..models.connection_lite import ConnectionLite + from ..models.element_lite import ElementLite + from ..models.fact_lite import FactLite + from ..models.fact_set_lite import FactSetLite + from ..models.information_block_envelope_dimensions_item import ( + InformationBlockEnvelopeDimensionsItem, + ) + from ..models.information_model_response import InformationModelResponse + from ..models.rule_lite import RuleLite + from ..models.verification_result_lite import VerificationResultLite + from ..models.view_projections import ViewProjections + + +T = TypeVar("T", bound="InformationBlockEnvelope") + + +@_attrs_define +class InformationBlockEnvelope: + """The Information Block exchange format. + + One envelope per block instance. Carries the block's identity + type, + Information-Model attributes, the Artifact branch (mechanics + + topic/template), and bundled atoms (elements, connections, facts). + Rules / dimensions / FactSet / verification_results are present-but- + empty for blocks where the upstream content (rule engine, FactSet + expand, dimension catalog) has not yet been implemented. + + Attributes: + id (str): + block_type (str): Discriminator — 'schedule', … + name (str): + display_name (str): Registry-sourced display label (e.g., 'Schedule'). + category (str): Registry-sourced sidebar grouping ('Close', 'Reporting', …). + information_model (InformationModelResponse): The block's intrinsic shape — concept + member arrangement + patterns. + artifact (ArtifactResponse): The block's producible-artifact envelope — topic, template, mechanics. + taxonomy_id (None | str | Unset): Source taxonomy the Structure was seeded from. Always present for currently- + registered block types (the Structure → Taxonomy FK is non-null); declared optional to keep the shape forward- + compatible with future synthetic blocks that don't originate from a taxonomy. + taxonomy_name (None | str | Unset): Display name of the source taxonomy. + elements (list[ElementLite] | Unset): + connections (list[ConnectionLite] | Unset): + facts (list[FactLite] | Unset): + rules (list[RuleLite] | Unset): + dimensions (list[InformationBlockEnvelopeDimensionsItem] | Unset): + fact_set (FactSetLite | None | Unset): The period-specific FactSet this envelope instantiates. Null when the + underlying block has no FactSet row yet — typically library-seeded statement Structures with no tenant-generated + facts, or Schedule rows written before the create-side FactSet stamping was added. + verification_results (list[VerificationResultLite] | Unset): + view (ViewProjections | Unset): Charlie's six ``type-of View`` arms, surfaced at the envelope boundary. + + Each projection is computed server-side at envelope-build time when + its source data is available. The frontend's ``BlockView`` dispatcher + routes to the projection component matching the user's selected view + mode; missing projections (those still in backlog) render as empty + states without breaking the dispatcher. + + Today: ``rendering`` is computed for the statement family. + Other arms (``fact_table``, ``model_structure``, ``verification_results``, + ``report_elements``, ``business_rules``) come online as their backend + support lands; ``fact_table`` is trivially derivable from + ``InformationBlockEnvelope.facts`` and may stay as a frontend-only + projection. + """ + + id: str + block_type: str + name: str + display_name: str + category: str + information_model: InformationModelResponse + artifact: ArtifactResponse + taxonomy_id: None | str | Unset = UNSET + taxonomy_name: None | str | Unset = UNSET + elements: list[ElementLite] | Unset = UNSET + connections: list[ConnectionLite] | Unset = UNSET + facts: list[FactLite] | Unset = UNSET + rules: list[RuleLite] | Unset = UNSET + dimensions: list[InformationBlockEnvelopeDimensionsItem] | Unset = UNSET + fact_set: FactSetLite | None | Unset = UNSET + verification_results: list[VerificationResultLite] | Unset = UNSET + view: ViewProjections | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.fact_set_lite import FactSetLite + + id = self.id + + block_type = self.block_type + + name = self.name + + display_name = self.display_name + + category = self.category + + information_model = self.information_model.to_dict() + + artifact = self.artifact.to_dict() + + taxonomy_id: None | str | Unset + if isinstance(self.taxonomy_id, Unset): + taxonomy_id = UNSET + else: + taxonomy_id = self.taxonomy_id + + taxonomy_name: None | str | Unset + if isinstance(self.taxonomy_name, Unset): + taxonomy_name = UNSET + else: + taxonomy_name = self.taxonomy_name + + elements: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.elements, Unset): + elements = [] + for elements_item_data in self.elements: + elements_item = elements_item_data.to_dict() + elements.append(elements_item) + + connections: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.connections, Unset): + connections = [] + for connections_item_data in self.connections: + connections_item = connections_item_data.to_dict() + connections.append(connections_item) + + facts: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.facts, Unset): + facts = [] + for facts_item_data in self.facts: + facts_item = facts_item_data.to_dict() + facts.append(facts_item) + + rules: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.rules, Unset): + rules = [] + for rules_item_data in self.rules: + rules_item = rules_item_data.to_dict() + rules.append(rules_item) + + dimensions: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.dimensions, Unset): + dimensions = [] + for dimensions_item_data in self.dimensions: + dimensions_item = dimensions_item_data.to_dict() + dimensions.append(dimensions_item) + + fact_set: dict[str, Any] | None | Unset + if isinstance(self.fact_set, Unset): + fact_set = UNSET + elif isinstance(self.fact_set, FactSetLite): + fact_set = self.fact_set.to_dict() + else: + fact_set = self.fact_set + + verification_results: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.verification_results, Unset): + verification_results = [] + for verification_results_item_data in self.verification_results: + verification_results_item = verification_results_item_data.to_dict() + verification_results.append(verification_results_item) + + view: dict[str, Any] | Unset = UNSET + if not isinstance(self.view, Unset): + view = self.view.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "block_type": block_type, + "name": name, + "display_name": display_name, + "category": category, + "information_model": information_model, + "artifact": artifact, + } + ) + if taxonomy_id is not UNSET: + field_dict["taxonomy_id"] = taxonomy_id + if taxonomy_name is not UNSET: + field_dict["taxonomy_name"] = taxonomy_name + if elements is not UNSET: + field_dict["elements"] = elements + if connections is not UNSET: + field_dict["connections"] = connections + if facts is not UNSET: + field_dict["facts"] = facts + if rules is not UNSET: + field_dict["rules"] = rules + if dimensions is not UNSET: + field_dict["dimensions"] = dimensions + if fact_set is not UNSET: + field_dict["fact_set"] = fact_set + if verification_results is not UNSET: + field_dict["verification_results"] = verification_results + if view is not UNSET: + field_dict["view"] = view + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.artifact_response import ArtifactResponse + from ..models.connection_lite import ConnectionLite + from ..models.element_lite import ElementLite + from ..models.fact_lite import FactLite + from ..models.fact_set_lite import FactSetLite + from ..models.information_block_envelope_dimensions_item import ( + InformationBlockEnvelopeDimensionsItem, + ) + from ..models.information_model_response import InformationModelResponse + from ..models.rule_lite import RuleLite + from ..models.verification_result_lite import VerificationResultLite + from ..models.view_projections import ViewProjections + + d = dict(src_dict) + id = d.pop("id") + + block_type = d.pop("block_type") + + name = d.pop("name") + + display_name = d.pop("display_name") + + category = d.pop("category") + + information_model = InformationModelResponse.from_dict(d.pop("information_model")) + + artifact = ArtifactResponse.from_dict(d.pop("artifact")) + + def _parse_taxonomy_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + taxonomy_id = _parse_taxonomy_id(d.pop("taxonomy_id", UNSET)) + + def _parse_taxonomy_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + taxonomy_name = _parse_taxonomy_name(d.pop("taxonomy_name", UNSET)) + + _elements = d.pop("elements", UNSET) + elements: list[ElementLite] | Unset = UNSET + if _elements is not UNSET: + elements = [] + for elements_item_data in _elements: + elements_item = ElementLite.from_dict(elements_item_data) + + elements.append(elements_item) + + _connections = d.pop("connections", UNSET) + connections: list[ConnectionLite] | Unset = UNSET + if _connections is not UNSET: + connections = [] + for connections_item_data in _connections: + connections_item = ConnectionLite.from_dict(connections_item_data) + + connections.append(connections_item) + + _facts = d.pop("facts", UNSET) + facts: list[FactLite] | Unset = UNSET + if _facts is not UNSET: + facts = [] + for facts_item_data in _facts: + facts_item = FactLite.from_dict(facts_item_data) + + facts.append(facts_item) + + _rules = d.pop("rules", UNSET) + rules: list[RuleLite] | Unset = UNSET + if _rules is not UNSET: + rules = [] + for rules_item_data in _rules: + rules_item = RuleLite.from_dict(rules_item_data) + + rules.append(rules_item) + + _dimensions = d.pop("dimensions", UNSET) + dimensions: list[InformationBlockEnvelopeDimensionsItem] | Unset = UNSET + if _dimensions is not UNSET: + dimensions = [] + for dimensions_item_data in _dimensions: + dimensions_item = InformationBlockEnvelopeDimensionsItem.from_dict( + dimensions_item_data + ) + + dimensions.append(dimensions_item) + + def _parse_fact_set(data: object) -> FactSetLite | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + fact_set_type_0 = FactSetLite.from_dict(data) + + return fact_set_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(FactSetLite | None | Unset, data) + + fact_set = _parse_fact_set(d.pop("fact_set", UNSET)) + + _verification_results = d.pop("verification_results", UNSET) + verification_results: list[VerificationResultLite] | Unset = UNSET + if _verification_results is not UNSET: + verification_results = [] + for verification_results_item_data in _verification_results: + verification_results_item = VerificationResultLite.from_dict( + verification_results_item_data + ) + + verification_results.append(verification_results_item) + + _view = d.pop("view", UNSET) + view: ViewProjections | Unset + if isinstance(_view, Unset): + view = UNSET + else: + view = ViewProjections.from_dict(_view) + + information_block_envelope = cls( + id=id, + block_type=block_type, + name=name, + display_name=display_name, + category=category, + information_model=information_model, + artifact=artifact, + taxonomy_id=taxonomy_id, + taxonomy_name=taxonomy_name, + elements=elements, + connections=connections, + facts=facts, + rules=rules, + dimensions=dimensions, + fact_set=fact_set, + verification_results=verification_results, + view=view, + ) + + information_block_envelope.additional_properties = d + return information_block_envelope + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/information_block_envelope_dimensions_item.py b/robosystems_client/models/information_block_envelope_dimensions_item.py new file mode 100644 index 0000000..bd6345c --- /dev/null +++ b/robosystems_client/models/information_block_envelope_dimensions_item.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="InformationBlockEnvelopeDimensionsItem") + + +@_attrs_define +class InformationBlockEnvelopeDimensionsItem: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + information_block_envelope_dimensions_item = cls() + + information_block_envelope_dimensions_item.additional_properties = d + return information_block_envelope_dimensions_item + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/information_model_response.py b/robosystems_client/models/information_model_response.py new file mode 100644 index 0000000..338579e --- /dev/null +++ b/robosystems_client/models/information_model_response.py @@ -0,0 +1,97 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="InformationModelResponse") + + +@_attrs_define +class InformationModelResponse: + """The block's intrinsic shape — concept + member arrangement patterns. + + Attributes: + concept_arrangement (None | str | Unset): roll_up | roll_forward | variance | adjustment | set | arithmetic | + textblock. Null for block types where the concept arrangement is implicit in their mechanics. + member_arrangement (None | str | Unset): aggregation | nonaggregation, or null if non-hypercube. + """ + + concept_arrangement: None | str | Unset = UNSET + member_arrangement: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + concept_arrangement: None | str | Unset + if isinstance(self.concept_arrangement, Unset): + concept_arrangement = UNSET + else: + concept_arrangement = self.concept_arrangement + + member_arrangement: None | str | Unset + if isinstance(self.member_arrangement, Unset): + member_arrangement = UNSET + else: + member_arrangement = self.member_arrangement + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if concept_arrangement is not UNSET: + field_dict["concept_arrangement"] = concept_arrangement + if member_arrangement is not UNSET: + field_dict["member_arrangement"] = member_arrangement + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + + def _parse_concept_arrangement(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + concept_arrangement = _parse_concept_arrangement( + d.pop("concept_arrangement", UNSET) + ) + + def _parse_member_arrangement(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + member_arrangement = _parse_member_arrangement(d.pop("member_arrangement", UNSET)) + + information_model_response = cls( + concept_arrangement=concept_arrangement, + member_arrangement=member_arrangement, + ) + + information_model_response.additional_properties = d + return information_model_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/metric_mechanics.py b/robosystems_client/models/metric_mechanics.py new file mode 100644 index 0000000..0d8c7dd --- /dev/null +++ b/robosystems_client/models/metric_mechanics.py @@ -0,0 +1,144 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="MetricMechanics") + + +@_attrs_define +class MetricMechanics: + """Derivative mechanics for ``block_type='metric'``. + + A metric block composes its facts from one or more source blocks at + read time — covenant tests, ratios, KPI trend computations. The typed + arm ships today so the discriminated union covers all three + construction modes (declarative / compositional / derivative); the + derivation evaluator that actually computes facts from source-block + FactSets is not yet implemented. + + ``source_block_ids`` is the ordered list of Structure ids this metric + derives from; ``derivation_type`` names the kind of computation + (``ratio``, ``trailing_twelve_month``, ``covenant_test``, …), and + ``expression`` carries the agent-authored derivation string that the + evaluator will consume at envelope build time. + + Attributes: + kind (Literal['metric'] | Unset): Default: 'metric'. + source_block_ids (list[str] | Unset): Ordered list of Structure ids this metric sources from. Must be non-empty + at evaluation time; empty lists are accepted so library scaffolding can register metric templates before source + linkage is wired. + derivation_type (None | str | Unset): Free-form label for the derivation kind — 'ratio', + 'trailing_twelve_month', 'covenant_test', etc. The evaluator dispatches on this tag; the set may be locked with + a CHECK constraint once the derivation catalog stabilizes. + expression (None | str | Unset): Derivation expression in the metric DSL — evaluated at envelope read time to + produce the derivative fact value. Opaque string today; the metric-side parser / evaluator is not yet + implemented. + unit (str | Unset): Output unit of the derived value — 'ratio', 'percent', 'USD', 'count', etc. Used by the + renderer to format the metric badge. Default: 'ratio'. + """ + + kind: Literal["metric"] | Unset = "metric" + source_block_ids: list[str] | Unset = UNSET + derivation_type: None | str | Unset = UNSET + expression: None | str | Unset = UNSET + unit: str | Unset = "ratio" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + kind = self.kind + + source_block_ids: list[str] | Unset = UNSET + if not isinstance(self.source_block_ids, Unset): + source_block_ids = self.source_block_ids + + derivation_type: None | str | Unset + if isinstance(self.derivation_type, Unset): + derivation_type = UNSET + else: + derivation_type = self.derivation_type + + expression: None | str | Unset + if isinstance(self.expression, Unset): + expression = UNSET + else: + expression = self.expression + + unit = self.unit + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if kind is not UNSET: + field_dict["kind"] = kind + if source_block_ids is not UNSET: + field_dict["source_block_ids"] = source_block_ids + if derivation_type is not UNSET: + field_dict["derivation_type"] = derivation_type + if expression is not UNSET: + field_dict["expression"] = expression + if unit is not UNSET: + field_dict["unit"] = unit + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + kind = cast(Literal["metric"] | Unset, d.pop("kind", UNSET)) + if kind != "metric" and not isinstance(kind, Unset): + raise ValueError(f"kind must match const 'metric', got '{kind}'") + + source_block_ids = cast(list[str], d.pop("source_block_ids", UNSET)) + + def _parse_derivation_type(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + derivation_type = _parse_derivation_type(d.pop("derivation_type", UNSET)) + + def _parse_expression(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + expression = _parse_expression(d.pop("expression", UNSET)) + + unit = d.pop("unit", UNSET) + + metric_mechanics = cls( + kind=kind, + source_block_ids=source_block_ids, + derivation_type=derivation_type, + expression=expression, + unit=unit, + ) + + metric_mechanics.additional_properties = d + return metric_mechanics + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/operation_envelope.py b/robosystems_client/models/operation_envelope.py index 41a2b0f..37d54f9 100644 --- a/robosystems_client/models/operation_envelope.py +++ b/robosystems_client/models/operation_envelope.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -9,10 +9,6 @@ from ..models.operation_envelope_status import OperationEnvelopeStatus from ..types import UNSET, Unset -if TYPE_CHECKING: - from ..models.operation_envelope_result_type_0 import OperationEnvelopeResultType0 - - T = TypeVar("T", bound="OperationEnvelope") @@ -31,6 +27,11 @@ class OperationEnvelope: ``operation_id`` so the audit log and any partial SSE events stay correlatable. + ``TResult`` parameterizes the ``result`` field so per-op response shapes + surface in OpenAPI. Operations that pin ``OperationSpec.result_type`` get + ``OperationEnvelope[YourEnvelope]`` as their response model; ops that + don't keep the default ``Any`` shape (`result: any | null` on the wire). + Fields: - ``operation``: kebab-case command name (e.g. ``close-period``) - ``operation_id``: ``op_``-prefixed ULID; always present, usable for @@ -51,7 +52,7 @@ class OperationEnvelope: operation_id (str): op_-prefixed ULID for audit and SSE correlation status (OperationEnvelopeStatus): Operation lifecycle state at (str): ISO-8601 UTC timestamp - result (list[Any] | None | OperationEnvelopeResultType0 | Unset): Command-specific result payload + result (Any | None | Unset): Command-specific result payload created_by (None | str | Unset): User ID that initiated the operation (null for legacy callers) idempotent_replay (bool | Unset): True when this envelope came from the idempotency cache — the underlying command did not execute again. False on fresh executions. Default: False. @@ -61,14 +62,12 @@ class OperationEnvelope: operation_id: str status: OperationEnvelopeStatus at: str - result: list[Any] | None | OperationEnvelopeResultType0 | Unset = UNSET + result: Any | None | Unset = UNSET created_by: None | str | Unset = UNSET idempotent_replay: bool | Unset = False additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.operation_envelope_result_type_0 import OperationEnvelopeResultType0 - operation = self.operation operation_id = self.operation_id @@ -77,14 +76,9 @@ def to_dict(self) -> dict[str, Any]: at = self.at - result: dict[str, Any] | list[Any] | None | Unset + result: Any | None | Unset if isinstance(self.result, Unset): result = UNSET - elif isinstance(self.result, OperationEnvelopeResultType0): - result = self.result.to_dict() - elif isinstance(self.result, list): - result = self.result - else: result = self.result @@ -117,8 +111,6 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.operation_envelope_result_type_0 import OperationEnvelopeResultType0 - d = dict(src_dict) operation = d.pop("operation") @@ -128,30 +120,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: at = d.pop("at") - def _parse_result( - data: object, - ) -> list[Any] | None | OperationEnvelopeResultType0 | Unset: + def _parse_result(data: object) -> Any | None | Unset: if data is None: return data if isinstance(data, Unset): return data - try: - if not isinstance(data, dict): - raise TypeError() - result_type_0 = OperationEnvelopeResultType0.from_dict(data) - - return result_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, list): - raise TypeError() - result_type_1 = cast(list[Any], data) - - return result_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[Any] | None | OperationEnvelopeResultType0 | Unset, data) + return cast(Any | None | Unset, data) result = _parse_result(d.pop("result", UNSET)) diff --git a/robosystems_client/models/operation_envelope_delete_information_block_response.py b/robosystems_client/models/operation_envelope_delete_information_block_response.py new file mode 100644 index 0000000..b9be672 --- /dev/null +++ b/robosystems_client/models/operation_envelope_delete_information_block_response.py @@ -0,0 +1,162 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.operation_envelope_delete_information_block_response_status import ( + OperationEnvelopeDeleteInformationBlockResponseStatus, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.delete_information_block_response import DeleteInformationBlockResponse + + +T = TypeVar("T", bound="OperationEnvelopeDeleteInformationBlockResponse") + + +@_attrs_define +class OperationEnvelopeDeleteInformationBlockResponse: + """ + Attributes: + operation (str): Kebab-case operation name + operation_id (str): op_-prefixed ULID for audit and SSE correlation + status (OperationEnvelopeDeleteInformationBlockResponseStatus): Operation lifecycle state + at (str): ISO-8601 UTC timestamp + result (DeleteInformationBlockResponse | None | Unset): Command-specific result payload + created_by (None | str | Unset): User ID that initiated the operation (null for legacy callers) + idempotent_replay (bool | Unset): True when this envelope came from the idempotency cache — the underlying + command did not execute again. False on fresh executions. Default: False. + """ + + operation: str + operation_id: str + status: OperationEnvelopeDeleteInformationBlockResponseStatus + at: str + result: DeleteInformationBlockResponse | None | Unset = UNSET + created_by: None | str | Unset = UNSET + idempotent_replay: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.delete_information_block_response import ( + DeleteInformationBlockResponse, + ) + + operation = self.operation + + operation_id = self.operation_id + + status = self.status.value + + at = self.at + + result: dict[str, Any] | None | Unset + if isinstance(self.result, Unset): + result = UNSET + elif isinstance(self.result, DeleteInformationBlockResponse): + result = self.result.to_dict() + else: + result = self.result + + created_by: None | str | Unset + if isinstance(self.created_by, Unset): + created_by = UNSET + else: + created_by = self.created_by + + idempotent_replay = self.idempotent_replay + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "operation": operation, + "operationId": operation_id, + "status": status, + "at": at, + } + ) + if result is not UNSET: + field_dict["result"] = result + if created_by is not UNSET: + field_dict["createdBy"] = created_by + if idempotent_replay is not UNSET: + field_dict["idempotentReplay"] = idempotent_replay + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.delete_information_block_response import ( + DeleteInformationBlockResponse, + ) + + d = dict(src_dict) + operation = d.pop("operation") + + operation_id = d.pop("operationId") + + status = OperationEnvelopeDeleteInformationBlockResponseStatus(d.pop("status")) + + at = d.pop("at") + + def _parse_result(data: object) -> DeleteInformationBlockResponse | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + result_type_0 = DeleteInformationBlockResponse.from_dict(data) + + return result_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(DeleteInformationBlockResponse | None | Unset, data) + + result = _parse_result(d.pop("result", UNSET)) + + def _parse_created_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + created_by = _parse_created_by(d.pop("createdBy", UNSET)) + + idempotent_replay = d.pop("idempotentReplay", UNSET) + + operation_envelope_delete_information_block_response = cls( + operation=operation, + operation_id=operation_id, + status=status, + at=at, + result=result, + created_by=created_by, + idempotent_replay=idempotent_replay, + ) + + operation_envelope_delete_information_block_response.additional_properties = d + return operation_envelope_delete_information_block_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/operation_envelope_delete_information_block_response_status.py b/robosystems_client/models/operation_envelope_delete_information_block_response_status.py new file mode 100644 index 0000000..a6ab4dc --- /dev/null +++ b/robosystems_client/models/operation_envelope_delete_information_block_response_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class OperationEnvelopeDeleteInformationBlockResponseStatus(str, Enum): + COMPLETED = "completed" + FAILED = "failed" + PENDING = "pending" + + def __str__(self) -> str: + return str(self.value) diff --git a/robosystems_client/models/operation_envelope_delete_portfolio_block_response.py b/robosystems_client/models/operation_envelope_delete_portfolio_block_response.py new file mode 100644 index 0000000..fa432cc --- /dev/null +++ b/robosystems_client/models/operation_envelope_delete_portfolio_block_response.py @@ -0,0 +1,158 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.operation_envelope_delete_portfolio_block_response_status import ( + OperationEnvelopeDeletePortfolioBlockResponseStatus, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.delete_portfolio_block_response import DeletePortfolioBlockResponse + + +T = TypeVar("T", bound="OperationEnvelopeDeletePortfolioBlockResponse") + + +@_attrs_define +class OperationEnvelopeDeletePortfolioBlockResponse: + """ + Attributes: + operation (str): Kebab-case operation name + operation_id (str): op_-prefixed ULID for audit and SSE correlation + status (OperationEnvelopeDeletePortfolioBlockResponseStatus): Operation lifecycle state + at (str): ISO-8601 UTC timestamp + result (DeletePortfolioBlockResponse | None | Unset): Command-specific result payload + created_by (None | str | Unset): User ID that initiated the operation (null for legacy callers) + idempotent_replay (bool | Unset): True when this envelope came from the idempotency cache — the underlying + command did not execute again. False on fresh executions. Default: False. + """ + + operation: str + operation_id: str + status: OperationEnvelopeDeletePortfolioBlockResponseStatus + at: str + result: DeletePortfolioBlockResponse | None | Unset = UNSET + created_by: None | str | Unset = UNSET + idempotent_replay: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.delete_portfolio_block_response import DeletePortfolioBlockResponse + + operation = self.operation + + operation_id = self.operation_id + + status = self.status.value + + at = self.at + + result: dict[str, Any] | None | Unset + if isinstance(self.result, Unset): + result = UNSET + elif isinstance(self.result, DeletePortfolioBlockResponse): + result = self.result.to_dict() + else: + result = self.result + + created_by: None | str | Unset + if isinstance(self.created_by, Unset): + created_by = UNSET + else: + created_by = self.created_by + + idempotent_replay = self.idempotent_replay + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "operation": operation, + "operationId": operation_id, + "status": status, + "at": at, + } + ) + if result is not UNSET: + field_dict["result"] = result + if created_by is not UNSET: + field_dict["createdBy"] = created_by + if idempotent_replay is not UNSET: + field_dict["idempotentReplay"] = idempotent_replay + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.delete_portfolio_block_response import DeletePortfolioBlockResponse + + d = dict(src_dict) + operation = d.pop("operation") + + operation_id = d.pop("operationId") + + status = OperationEnvelopeDeletePortfolioBlockResponseStatus(d.pop("status")) + + at = d.pop("at") + + def _parse_result(data: object) -> DeletePortfolioBlockResponse | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + result_type_0 = DeletePortfolioBlockResponse.from_dict(data) + + return result_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(DeletePortfolioBlockResponse | None | Unset, data) + + result = _parse_result(d.pop("result", UNSET)) + + def _parse_created_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + created_by = _parse_created_by(d.pop("createdBy", UNSET)) + + idempotent_replay = d.pop("idempotentReplay", UNSET) + + operation_envelope_delete_portfolio_block_response = cls( + operation=operation, + operation_id=operation_id, + status=status, + at=at, + result=result, + created_by=created_by, + idempotent_replay=idempotent_replay, + ) + + operation_envelope_delete_portfolio_block_response.additional_properties = d + return operation_envelope_delete_portfolio_block_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/operation_envelope_delete_portfolio_block_response_status.py b/robosystems_client/models/operation_envelope_delete_portfolio_block_response_status.py new file mode 100644 index 0000000..9d6b25d --- /dev/null +++ b/robosystems_client/models/operation_envelope_delete_portfolio_block_response_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class OperationEnvelopeDeletePortfolioBlockResponseStatus(str, Enum): + COMPLETED = "completed" + FAILED = "failed" + PENDING = "pending" + + def __str__(self) -> str: + return str(self.value) diff --git a/robosystems_client/models/operation_envelope_delete_result.py b/robosystems_client/models/operation_envelope_delete_result.py new file mode 100644 index 0000000..9deae06 --- /dev/null +++ b/robosystems_client/models/operation_envelope_delete_result.py @@ -0,0 +1,158 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.operation_envelope_delete_result_status import ( + OperationEnvelopeDeleteResultStatus, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.delete_result import DeleteResult + + +T = TypeVar("T", bound="OperationEnvelopeDeleteResult") + + +@_attrs_define +class OperationEnvelopeDeleteResult: + """ + Attributes: + operation (str): Kebab-case operation name + operation_id (str): op_-prefixed ULID for audit and SSE correlation + status (OperationEnvelopeDeleteResultStatus): Operation lifecycle state + at (str): ISO-8601 UTC timestamp + result (DeleteResult | None | Unset): Command-specific result payload + created_by (None | str | Unset): User ID that initiated the operation (null for legacy callers) + idempotent_replay (bool | Unset): True when this envelope came from the idempotency cache — the underlying + command did not execute again. False on fresh executions. Default: False. + """ + + operation: str + operation_id: str + status: OperationEnvelopeDeleteResultStatus + at: str + result: DeleteResult | None | Unset = UNSET + created_by: None | str | Unset = UNSET + idempotent_replay: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.delete_result import DeleteResult + + operation = self.operation + + operation_id = self.operation_id + + status = self.status.value + + at = self.at + + result: dict[str, Any] | None | Unset + if isinstance(self.result, Unset): + result = UNSET + elif isinstance(self.result, DeleteResult): + result = self.result.to_dict() + else: + result = self.result + + created_by: None | str | Unset + if isinstance(self.created_by, Unset): + created_by = UNSET + else: + created_by = self.created_by + + idempotent_replay = self.idempotent_replay + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "operation": operation, + "operationId": operation_id, + "status": status, + "at": at, + } + ) + if result is not UNSET: + field_dict["result"] = result + if created_by is not UNSET: + field_dict["createdBy"] = created_by + if idempotent_replay is not UNSET: + field_dict["idempotentReplay"] = idempotent_replay + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.delete_result import DeleteResult + + d = dict(src_dict) + operation = d.pop("operation") + + operation_id = d.pop("operationId") + + status = OperationEnvelopeDeleteResultStatus(d.pop("status")) + + at = d.pop("at") + + def _parse_result(data: object) -> DeleteResult | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + result_type_0 = DeleteResult.from_dict(data) + + return result_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(DeleteResult | None | Unset, data) + + result = _parse_result(d.pop("result", UNSET)) + + def _parse_created_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + created_by = _parse_created_by(d.pop("createdBy", UNSET)) + + idempotent_replay = d.pop("idempotentReplay", UNSET) + + operation_envelope_delete_result = cls( + operation=operation, + operation_id=operation_id, + status=status, + at=at, + result=result, + created_by=created_by, + idempotent_replay=idempotent_replay, + ) + + operation_envelope_delete_result.additional_properties = d + return operation_envelope_delete_result + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/operation_envelope_delete_result_status.py b/robosystems_client/models/operation_envelope_delete_result_status.py new file mode 100644 index 0000000..e137c49 --- /dev/null +++ b/robosystems_client/models/operation_envelope_delete_result_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class OperationEnvelopeDeleteResultStatus(str, Enum): + COMPLETED = "completed" + FAILED = "failed" + PENDING = "pending" + + def __str__(self) -> str: + return str(self.value) diff --git a/robosystems_client/models/operation_envelope_event_block_envelope.py b/robosystems_client/models/operation_envelope_event_block_envelope.py new file mode 100644 index 0000000..3c439f1 --- /dev/null +++ b/robosystems_client/models/operation_envelope_event_block_envelope.py @@ -0,0 +1,158 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.operation_envelope_event_block_envelope_status import ( + OperationEnvelopeEventBlockEnvelopeStatus, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.event_block_envelope import EventBlockEnvelope + + +T = TypeVar("T", bound="OperationEnvelopeEventBlockEnvelope") + + +@_attrs_define +class OperationEnvelopeEventBlockEnvelope: + """ + Attributes: + operation (str): Kebab-case operation name + operation_id (str): op_-prefixed ULID for audit and SSE correlation + status (OperationEnvelopeEventBlockEnvelopeStatus): Operation lifecycle state + at (str): ISO-8601 UTC timestamp + result (EventBlockEnvelope | None | Unset): Command-specific result payload + created_by (None | str | Unset): User ID that initiated the operation (null for legacy callers) + idempotent_replay (bool | Unset): True when this envelope came from the idempotency cache — the underlying + command did not execute again. False on fresh executions. Default: False. + """ + + operation: str + operation_id: str + status: OperationEnvelopeEventBlockEnvelopeStatus + at: str + result: EventBlockEnvelope | None | Unset = UNSET + created_by: None | str | Unset = UNSET + idempotent_replay: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.event_block_envelope import EventBlockEnvelope + + operation = self.operation + + operation_id = self.operation_id + + status = self.status.value + + at = self.at + + result: dict[str, Any] | None | Unset + if isinstance(self.result, Unset): + result = UNSET + elif isinstance(self.result, EventBlockEnvelope): + result = self.result.to_dict() + else: + result = self.result + + created_by: None | str | Unset + if isinstance(self.created_by, Unset): + created_by = UNSET + else: + created_by = self.created_by + + idempotent_replay = self.idempotent_replay + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "operation": operation, + "operationId": operation_id, + "status": status, + "at": at, + } + ) + if result is not UNSET: + field_dict["result"] = result + if created_by is not UNSET: + field_dict["createdBy"] = created_by + if idempotent_replay is not UNSET: + field_dict["idempotentReplay"] = idempotent_replay + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.event_block_envelope import EventBlockEnvelope + + d = dict(src_dict) + operation = d.pop("operation") + + operation_id = d.pop("operationId") + + status = OperationEnvelopeEventBlockEnvelopeStatus(d.pop("status")) + + at = d.pop("at") + + def _parse_result(data: object) -> EventBlockEnvelope | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + result_type_0 = EventBlockEnvelope.from_dict(data) + + return result_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(EventBlockEnvelope | None | Unset, data) + + result = _parse_result(d.pop("result", UNSET)) + + def _parse_created_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + created_by = _parse_created_by(d.pop("createdBy", UNSET)) + + idempotent_replay = d.pop("idempotentReplay", UNSET) + + operation_envelope_event_block_envelope = cls( + operation=operation, + operation_id=operation_id, + status=status, + at=at, + result=result, + created_by=created_by, + idempotent_replay=idempotent_replay, + ) + + operation_envelope_event_block_envelope.additional_properties = d + return operation_envelope_event_block_envelope + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/operation_envelope_event_block_envelope_status.py b/robosystems_client/models/operation_envelope_event_block_envelope_status.py new file mode 100644 index 0000000..377ad83 --- /dev/null +++ b/robosystems_client/models/operation_envelope_event_block_envelope_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class OperationEnvelopeEventBlockEnvelopeStatus(str, Enum): + COMPLETED = "completed" + FAILED = "failed" + PENDING = "pending" + + def __str__(self) -> str: + return str(self.value) diff --git a/robosystems_client/models/operation_envelope_information_block_envelope.py b/robosystems_client/models/operation_envelope_information_block_envelope.py new file mode 100644 index 0000000..c272da4 --- /dev/null +++ b/robosystems_client/models/operation_envelope_information_block_envelope.py @@ -0,0 +1,158 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.operation_envelope_information_block_envelope_status import ( + OperationEnvelopeInformationBlockEnvelopeStatus, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.information_block_envelope import InformationBlockEnvelope + + +T = TypeVar("T", bound="OperationEnvelopeInformationBlockEnvelope") + + +@_attrs_define +class OperationEnvelopeInformationBlockEnvelope: + """ + Attributes: + operation (str): Kebab-case operation name + operation_id (str): op_-prefixed ULID for audit and SSE correlation + status (OperationEnvelopeInformationBlockEnvelopeStatus): Operation lifecycle state + at (str): ISO-8601 UTC timestamp + result (InformationBlockEnvelope | None | Unset): Command-specific result payload + created_by (None | str | Unset): User ID that initiated the operation (null for legacy callers) + idempotent_replay (bool | Unset): True when this envelope came from the idempotency cache — the underlying + command did not execute again. False on fresh executions. Default: False. + """ + + operation: str + operation_id: str + status: OperationEnvelopeInformationBlockEnvelopeStatus + at: str + result: InformationBlockEnvelope | None | Unset = UNSET + created_by: None | str | Unset = UNSET + idempotent_replay: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.information_block_envelope import InformationBlockEnvelope + + operation = self.operation + + operation_id = self.operation_id + + status = self.status.value + + at = self.at + + result: dict[str, Any] | None | Unset + if isinstance(self.result, Unset): + result = UNSET + elif isinstance(self.result, InformationBlockEnvelope): + result = self.result.to_dict() + else: + result = self.result + + created_by: None | str | Unset + if isinstance(self.created_by, Unset): + created_by = UNSET + else: + created_by = self.created_by + + idempotent_replay = self.idempotent_replay + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "operation": operation, + "operationId": operation_id, + "status": status, + "at": at, + } + ) + if result is not UNSET: + field_dict["result"] = result + if created_by is not UNSET: + field_dict["createdBy"] = created_by + if idempotent_replay is not UNSET: + field_dict["idempotentReplay"] = idempotent_replay + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.information_block_envelope import InformationBlockEnvelope + + d = dict(src_dict) + operation = d.pop("operation") + + operation_id = d.pop("operationId") + + status = OperationEnvelopeInformationBlockEnvelopeStatus(d.pop("status")) + + at = d.pop("at") + + def _parse_result(data: object) -> InformationBlockEnvelope | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + result_type_0 = InformationBlockEnvelope.from_dict(data) + + return result_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(InformationBlockEnvelope | None | Unset, data) + + result = _parse_result(d.pop("result", UNSET)) + + def _parse_created_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + created_by = _parse_created_by(d.pop("createdBy", UNSET)) + + idempotent_replay = d.pop("idempotentReplay", UNSET) + + operation_envelope_information_block_envelope = cls( + operation=operation, + operation_id=operation_id, + status=status, + at=at, + result=result, + created_by=created_by, + idempotent_replay=idempotent_replay, + ) + + operation_envelope_information_block_envelope.additional_properties = d + return operation_envelope_information_block_envelope + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/operation_envelope_information_block_envelope_status.py b/robosystems_client/models/operation_envelope_information_block_envelope_status.py new file mode 100644 index 0000000..af6f65e --- /dev/null +++ b/robosystems_client/models/operation_envelope_information_block_envelope_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class OperationEnvelopeInformationBlockEnvelopeStatus(str, Enum): + COMPLETED = "completed" + FAILED = "failed" + PENDING = "pending" + + def __str__(self) -> str: + return str(self.value) diff --git a/robosystems_client/models/operation_envelope_portfolio_block_envelope.py b/robosystems_client/models/operation_envelope_portfolio_block_envelope.py new file mode 100644 index 0000000..ee2d529 --- /dev/null +++ b/robosystems_client/models/operation_envelope_portfolio_block_envelope.py @@ -0,0 +1,158 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.operation_envelope_portfolio_block_envelope_status import ( + OperationEnvelopePortfolioBlockEnvelopeStatus, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.portfolio_block_envelope import PortfolioBlockEnvelope + + +T = TypeVar("T", bound="OperationEnvelopePortfolioBlockEnvelope") + + +@_attrs_define +class OperationEnvelopePortfolioBlockEnvelope: + """ + Attributes: + operation (str): Kebab-case operation name + operation_id (str): op_-prefixed ULID for audit and SSE correlation + status (OperationEnvelopePortfolioBlockEnvelopeStatus): Operation lifecycle state + at (str): ISO-8601 UTC timestamp + result (None | PortfolioBlockEnvelope | Unset): Command-specific result payload + created_by (None | str | Unset): User ID that initiated the operation (null for legacy callers) + idempotent_replay (bool | Unset): True when this envelope came from the idempotency cache — the underlying + command did not execute again. False on fresh executions. Default: False. + """ + + operation: str + operation_id: str + status: OperationEnvelopePortfolioBlockEnvelopeStatus + at: str + result: None | PortfolioBlockEnvelope | Unset = UNSET + created_by: None | str | Unset = UNSET + idempotent_replay: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.portfolio_block_envelope import PortfolioBlockEnvelope + + operation = self.operation + + operation_id = self.operation_id + + status = self.status.value + + at = self.at + + result: dict[str, Any] | None | Unset + if isinstance(self.result, Unset): + result = UNSET + elif isinstance(self.result, PortfolioBlockEnvelope): + result = self.result.to_dict() + else: + result = self.result + + created_by: None | str | Unset + if isinstance(self.created_by, Unset): + created_by = UNSET + else: + created_by = self.created_by + + idempotent_replay = self.idempotent_replay + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "operation": operation, + "operationId": operation_id, + "status": status, + "at": at, + } + ) + if result is not UNSET: + field_dict["result"] = result + if created_by is not UNSET: + field_dict["createdBy"] = created_by + if idempotent_replay is not UNSET: + field_dict["idempotentReplay"] = idempotent_replay + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.portfolio_block_envelope import PortfolioBlockEnvelope + + d = dict(src_dict) + operation = d.pop("operation") + + operation_id = d.pop("operationId") + + status = OperationEnvelopePortfolioBlockEnvelopeStatus(d.pop("status")) + + at = d.pop("at") + + def _parse_result(data: object) -> None | PortfolioBlockEnvelope | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + result_type_0 = PortfolioBlockEnvelope.from_dict(data) + + return result_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | PortfolioBlockEnvelope | Unset, data) + + result = _parse_result(d.pop("result", UNSET)) + + def _parse_created_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + created_by = _parse_created_by(d.pop("createdBy", UNSET)) + + idempotent_replay = d.pop("idempotentReplay", UNSET) + + operation_envelope_portfolio_block_envelope = cls( + operation=operation, + operation_id=operation_id, + status=status, + at=at, + result=result, + created_by=created_by, + idempotent_replay=idempotent_replay, + ) + + operation_envelope_portfolio_block_envelope.additional_properties = d + return operation_envelope_portfolio_block_envelope + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/operation_envelope_portfolio_block_envelope_status.py b/robosystems_client/models/operation_envelope_portfolio_block_envelope_status.py new file mode 100644 index 0000000..5f8cb84 --- /dev/null +++ b/robosystems_client/models/operation_envelope_portfolio_block_envelope_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class OperationEnvelopePortfolioBlockEnvelopeStatus(str, Enum): + COMPLETED = "completed" + FAILED = "failed" + PENDING = "pending" + + def __str__(self) -> str: + return str(self.value) diff --git a/robosystems_client/models/operation_envelope_security_response.py b/robosystems_client/models/operation_envelope_security_response.py new file mode 100644 index 0000000..764b2fc --- /dev/null +++ b/robosystems_client/models/operation_envelope_security_response.py @@ -0,0 +1,158 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.operation_envelope_security_response_status import ( + OperationEnvelopeSecurityResponseStatus, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.security_response import SecurityResponse + + +T = TypeVar("T", bound="OperationEnvelopeSecurityResponse") + + +@_attrs_define +class OperationEnvelopeSecurityResponse: + """ + Attributes: + operation (str): Kebab-case operation name + operation_id (str): op_-prefixed ULID for audit and SSE correlation + status (OperationEnvelopeSecurityResponseStatus): Operation lifecycle state + at (str): ISO-8601 UTC timestamp + result (None | SecurityResponse | Unset): Command-specific result payload + created_by (None | str | Unset): User ID that initiated the operation (null for legacy callers) + idempotent_replay (bool | Unset): True when this envelope came from the idempotency cache — the underlying + command did not execute again. False on fresh executions. Default: False. + """ + + operation: str + operation_id: str + status: OperationEnvelopeSecurityResponseStatus + at: str + result: None | SecurityResponse | Unset = UNSET + created_by: None | str | Unset = UNSET + idempotent_replay: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.security_response import SecurityResponse + + operation = self.operation + + operation_id = self.operation_id + + status = self.status.value + + at = self.at + + result: dict[str, Any] | None | Unset + if isinstance(self.result, Unset): + result = UNSET + elif isinstance(self.result, SecurityResponse): + result = self.result.to_dict() + else: + result = self.result + + created_by: None | str | Unset + if isinstance(self.created_by, Unset): + created_by = UNSET + else: + created_by = self.created_by + + idempotent_replay = self.idempotent_replay + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "operation": operation, + "operationId": operation_id, + "status": status, + "at": at, + } + ) + if result is not UNSET: + field_dict["result"] = result + if created_by is not UNSET: + field_dict["createdBy"] = created_by + if idempotent_replay is not UNSET: + field_dict["idempotentReplay"] = idempotent_replay + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.security_response import SecurityResponse + + d = dict(src_dict) + operation = d.pop("operation") + + operation_id = d.pop("operationId") + + status = OperationEnvelopeSecurityResponseStatus(d.pop("status")) + + at = d.pop("at") + + def _parse_result(data: object) -> None | SecurityResponse | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + result_type_0 = SecurityResponse.from_dict(data) + + return result_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | SecurityResponse | Unset, data) + + result = _parse_result(d.pop("result", UNSET)) + + def _parse_created_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + created_by = _parse_created_by(d.pop("createdBy", UNSET)) + + idempotent_replay = d.pop("idempotentReplay", UNSET) + + operation_envelope_security_response = cls( + operation=operation, + operation_id=operation_id, + status=status, + at=at, + result=result, + created_by=created_by, + idempotent_replay=idempotent_replay, + ) + + operation_envelope_security_response.additional_properties = d + return operation_envelope_security_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/operation_envelope_security_response_status.py b/robosystems_client/models/operation_envelope_security_response_status.py new file mode 100644 index 0000000..37dcaaf --- /dev/null +++ b/robosystems_client/models/operation_envelope_security_response_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class OperationEnvelopeSecurityResponseStatus(str, Enum): + COMPLETED = "completed" + FAILED = "failed" + PENDING = "pending" + + def __str__(self) -> str: + return str(self.value) diff --git a/robosystems_client/models/portfolio_block_envelope.py b/robosystems_client/models/portfolio_block_envelope.py new file mode 100644 index 0000000..5663222 --- /dev/null +++ b/robosystems_client/models/portfolio_block_envelope.py @@ -0,0 +1,270 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.entity_lite import EntityLite + from ..models.position_block import PositionBlock + + +T = TypeVar("T", bound="PortfolioBlockEnvelope") + + +@_attrs_define +class PortfolioBlockEnvelope: + """Molecular response shape for portfolio-block operations. + + Bundles the portfolio core, its embedded positions, and pre-computed + totals into a single payload — the contract for `create-portfolio-block`, + `update-portfolio-block`, and the read-side `get-portfolio-block`. + Cents-precision values aren't surfaced here; use `PositionResponse` + / `PortfolioResponse` for those. + + Attributes: + id (str): Portfolio ID (`port_*` ULID). + name (str): Display name. + base_currency (str): ISO 4217 currency code for portfolio aggregates. + positions (list[PositionBlock]): All positions in this portfolio, including disposed ones (filter by `status` + for active-only display). + total_cost_basis_dollars (float): Sum of `cost_basis_dollars` across every position. + active_position_count (int): Count of positions with `status='active'`. + created_at (datetime.datetime): Row creation timestamp (UTC). + updated_at (datetime.datetime): Last-modified timestamp (UTC). + description (None | str | Unset): Free-text description. + strategy (None | str | Unset): Free-text strategy classification. + inception_date (datetime.date | None | Unset): Date the portfolio was established. + owner (EntityLite | None | Unset): Embedded owning entity, when set. `null` for unattributed portfolios. + total_current_value_dollars (float | None | Unset): Sum of `current_value_dollars` across every position. `null` + when any active position lacks a mark. + """ + + id: str + name: str + base_currency: str + positions: list[PositionBlock] + total_cost_basis_dollars: float + active_position_count: int + created_at: datetime.datetime + updated_at: datetime.datetime + description: None | str | Unset = UNSET + strategy: None | str | Unset = UNSET + inception_date: datetime.date | None | Unset = UNSET + owner: EntityLite | None | Unset = UNSET + total_current_value_dollars: float | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.entity_lite import EntityLite + + id = self.id + + name = self.name + + base_currency = self.base_currency + + positions = [] + for positions_item_data in self.positions: + positions_item = positions_item_data.to_dict() + positions.append(positions_item) + + total_cost_basis_dollars = self.total_cost_basis_dollars + + active_position_count = self.active_position_count + + created_at = self.created_at.isoformat() + + updated_at = self.updated_at.isoformat() + + description: None | str | Unset + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + strategy: None | str | Unset + if isinstance(self.strategy, Unset): + strategy = UNSET + else: + strategy = self.strategy + + inception_date: None | str | Unset + if isinstance(self.inception_date, Unset): + inception_date = UNSET + elif isinstance(self.inception_date, datetime.date): + inception_date = self.inception_date.isoformat() + else: + inception_date = self.inception_date + + owner: dict[str, Any] | None | Unset + if isinstance(self.owner, Unset): + owner = UNSET + elif isinstance(self.owner, EntityLite): + owner = self.owner.to_dict() + else: + owner = self.owner + + total_current_value_dollars: float | None | Unset + if isinstance(self.total_current_value_dollars, Unset): + total_current_value_dollars = UNSET + else: + total_current_value_dollars = self.total_current_value_dollars + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "name": name, + "base_currency": base_currency, + "positions": positions, + "total_cost_basis_dollars": total_cost_basis_dollars, + "active_position_count": active_position_count, + "created_at": created_at, + "updated_at": updated_at, + } + ) + if description is not UNSET: + field_dict["description"] = description + if strategy is not UNSET: + field_dict["strategy"] = strategy + if inception_date is not UNSET: + field_dict["inception_date"] = inception_date + if owner is not UNSET: + field_dict["owner"] = owner + if total_current_value_dollars is not UNSET: + field_dict["total_current_value_dollars"] = total_current_value_dollars + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.entity_lite import EntityLite + from ..models.position_block import PositionBlock + + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name") + + base_currency = d.pop("base_currency") + + positions = [] + _positions = d.pop("positions") + for positions_item_data in _positions: + positions_item = PositionBlock.from_dict(positions_item_data) + + positions.append(positions_item) + + total_cost_basis_dollars = d.pop("total_cost_basis_dollars") + + active_position_count = d.pop("active_position_count") + + created_at = isoparse(d.pop("created_at")) + + updated_at = isoparse(d.pop("updated_at")) + + def _parse_description(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + description = _parse_description(d.pop("description", UNSET)) + + def _parse_strategy(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + strategy = _parse_strategy(d.pop("strategy", UNSET)) + + def _parse_inception_date(data: object) -> datetime.date | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + inception_date_type_0 = isoparse(data).date() + + return inception_date_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None | Unset, data) + + inception_date = _parse_inception_date(d.pop("inception_date", UNSET)) + + def _parse_owner(data: object) -> EntityLite | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + owner_type_0 = EntityLite.from_dict(data) + + return owner_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(EntityLite | None | Unset, data) + + owner = _parse_owner(d.pop("owner", UNSET)) + + def _parse_total_current_value_dollars(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + total_current_value_dollars = _parse_total_current_value_dollars( + d.pop("total_current_value_dollars", UNSET) + ) + + portfolio_block_envelope = cls( + id=id, + name=name, + base_currency=base_currency, + positions=positions, + total_cost_basis_dollars=total_cost_basis_dollars, + active_position_count=active_position_count, + created_at=created_at, + updated_at=updated_at, + description=description, + strategy=strategy, + inception_date=inception_date, + owner=owner, + total_current_value_dollars=total_current_value_dollars, + ) + + portfolio_block_envelope.additional_properties = d + return portfolio_block_envelope + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/portfolio_block_portfolio_fields.py b/robosystems_client/models/portfolio_block_portfolio_fields.py index 79b0593..ac28a62 100644 --- a/robosystems_client/models/portfolio_block_portfolio_fields.py +++ b/robosystems_client/models/portfolio_block_portfolio_fields.py @@ -18,12 +18,15 @@ class PortfolioBlockPortfolioFields: """Fields settable on the portfolio core when creating a block. Attributes: - name (str): - description (None | str | Unset): - strategy (None | str | Unset): - inception_date (datetime.date | None | Unset): - base_currency (str | Unset): Default: 'USD'. - entity_id (None | str | Unset): + name (str): Display name for the portfolio. 1-200 characters. + description (None | str | Unset): Free-text description of the portfolio. + strategy (None | str | Unset): Free-text strategy classification (e.g. `value`, `growth`, `income`). Open + vocabulary. + inception_date (datetime.date | None | Unset): Date the portfolio was established (YYYY-MM-DD). + base_currency (str | Unset): ISO 4217 currency code used for portfolio-level aggregates (e.g. + `total_cost_basis_dollars`). Default: 'USD'. + entity_id (None | str | Unset): ID of the owning entity (e.g. fund, trust, or person). Optional — leave unset + for unattributed portfolios. """ name: str diff --git a/robosystems_client/models/portfolio_block_portfolio_patch.py b/robosystems_client/models/portfolio_block_portfolio_patch.py index 8b419d7..d2bfd9f 100644 --- a/robosystems_client/models/portfolio_block_portfolio_patch.py +++ b/robosystems_client/models/portfolio_block_portfolio_patch.py @@ -18,12 +18,13 @@ class PortfolioBlockPortfolioPatch: """Patchable portfolio fields on `update-portfolio-block`. Unset fields ignored. Attributes: - name (None | str | Unset): - description (None | str | Unset): - strategy (None | str | Unset): - inception_date (datetime.date | None | Unset): - base_currency (None | str | Unset): - entity_id (None | str | Unset): + name (None | str | Unset): New display name. Unset = unchanged. + description (None | str | Unset): New description. Unset = unchanged. + strategy (None | str | Unset): New strategy classification. Unset = unchanged. + inception_date (datetime.date | None | Unset): New inception date (YYYY-MM-DD). Unset = unchanged. + base_currency (None | str | Unset): New ISO 4217 base currency code. Unset = unchanged. Note: changing base + currency does not retroactively reprice historical positions. + entity_id (None | str | Unset): New owning-entity ID. Unset = unchanged. """ name: None | str | Unset = UNSET diff --git a/robosystems_client/models/portfolio_block_position_add.py b/robosystems_client/models/portfolio_block_position_add.py index d3a432f..66b9bd2 100644 --- a/robosystems_client/models/portfolio_block_position_add.py +++ b/robosystems_client/models/portfolio_block_position_add.py @@ -21,16 +21,22 @@ class PortfolioBlockPositionAdd: (Master Data CRUD owns that lifecycle). Attributes: - security_id (str): - quantity (float): - quantity_type (str | Unset): Default: 'shares'. - cost_basis (int | Unset): Default: 0. - currency (str | Unset): Default: 'USD'. - current_value (int | None | Unset): - valuation_date (datetime.date | None | Unset): - valuation_source (None | str | Unset): - acquisition_date (datetime.date | None | Unset): - notes (None | str | Unset): + security_id (str): ID of the existing security this position holds. Securities are minted via `create-security`; + the operation returns 404 if the ID is unknown. + quantity (float): Quantity held, in units defined by `quantity_type` (e.g. share count for `shares`, face value + for `principal`). + quantity_type (str | Unset): Unit basis for `quantity`. Common values: `shares` (equity units), `units` + (generic), `principal` (debt face value). Default: 'shares'. + cost_basis (int | Unset): Total cost basis for this lot, in **cents** of `currency`. Stored as integer cents to + avoid float precision drift; $1,250.00 USD is `125000`. Default: 0. + currency (str | Unset): ISO 4217 currency code for `cost_basis` and `current_value`. Default: 'USD'. + current_value (int | None | Unset): Latest mark-to-market value in **cents** of `currency`, or `null` if + unmarked. Pair with `valuation_date` and `valuation_source` when set. + valuation_date (datetime.date | None | Unset): Date `current_value` was sourced (YYYY-MM-DD). + valuation_source (None | str | Unset): Free-text source attribution for `current_value` (e.g. `manual`, + `broker_statement`, vendor name). + acquisition_date (datetime.date | None | Unset): Date the position was originally acquired (YYYY-MM-DD). + notes (None | str | Unset): Free-text notes attached to the position. """ security_id: str diff --git a/robosystems_client/models/portfolio_block_position_dispose.py b/robosystems_client/models/portfolio_block_position_dispose.py index b07c63a..61b3c3c 100644 --- a/robosystems_client/models/portfolio_block_position_dispose.py +++ b/robosystems_client/models/portfolio_block_position_dispose.py @@ -20,8 +20,10 @@ class PortfolioBlockPositionDispose: `metadata.disposition_reason`. Attributes: - id (str): - disposition_reason (None | str | Unset): + id (str): Target position ID to dispose. Must belong to the portfolio identified by `portfolio_id` on the parent + operation. + disposition_reason (None | str | Unset): Optional free-text reason recorded under `metadata.disposition_reason` + on the disposed position. """ id: str diff --git a/robosystems_client/models/portfolio_block_position_update.py b/robosystems_client/models/portfolio_block_position_update.py index 1e5a096..c87be7c 100644 --- a/robosystems_client/models/portfolio_block_position_update.py +++ b/robosystems_client/models/portfolio_block_position_update.py @@ -20,15 +20,16 @@ class PortfolioBlockPositionUpdate: Unset fields are ignored; `id` is the only required field. Attributes: - id (str): - quantity (float | None | Unset): - quantity_type (None | str | Unset): - cost_basis (int | None | Unset): - current_value (int | None | Unset): - valuation_date (datetime.date | None | Unset): - valuation_source (None | str | Unset): - acquisition_date (datetime.date | None | Unset): - notes (None | str | Unset): + id (str): Target position ID. Must belong to the portfolio identified by `portfolio_id` on the parent operation. + quantity (float | None | Unset): New quantity in units of `quantity_type`. Unset = unchanged. + quantity_type (None | str | Unset): New unit basis (`shares` | `units` | `principal`). Unset = unchanged. + cost_basis (int | None | Unset): New cost basis in **cents** of the position's currency. Unset = unchanged. + current_value (int | None | Unset): New mark-to-market value in **cents**. Unset = unchanged. Set alongside + `valuation_date` / `valuation_source` to record a fresh valuation event. + valuation_date (datetime.date | None | Unset): New valuation date (YYYY-MM-DD). Unset = unchanged. + valuation_source (None | str | Unset): New valuation source attribution. Unset = unchanged. + acquisition_date (datetime.date | None | Unset): New acquisition date (YYYY-MM-DD). Unset = unchanged. + notes (None | str | Unset): New notes. Unset = unchanged. """ id: str diff --git a/robosystems_client/models/portfolio_block_positions.py b/robosystems_client/models/portfolio_block_positions.py index 889eff1..a2862e3 100644 --- a/robosystems_client/models/portfolio_block_positions.py +++ b/robosystems_client/models/portfolio_block_positions.py @@ -22,9 +22,12 @@ class PortfolioBlockPositions: """Position deltas applied atomically inside `update-portfolio-block`. Attributes: - add (list[PortfolioBlockPositionAdd] | Unset): - update (list[PortfolioBlockPositionUpdate] | Unset): - dispose (list[PortfolioBlockPositionDispose] | Unset): + add (list[PortfolioBlockPositionAdd] | Unset): New positions to mint inside this portfolio. Each references an + existing `security_id`. + update (list[PortfolioBlockPositionUpdate] | Unset): Patches to existing positions, addressed by position `id`. + Unset fields on each entry are left unchanged. + dispose (list[PortfolioBlockPositionDispose] | Unset): Positions to soft-dispose, addressed by position `id`. + Status flips to `disposed` and `disposition_date` is stamped. """ add: list[PortfolioBlockPositionAdd] | Unset = UNSET diff --git a/robosystems_client/models/position_block.py b/robosystems_client/models/position_block.py new file mode 100644 index 0000000..99d24c6 --- /dev/null +++ b/robosystems_client/models/position_block.py @@ -0,0 +1,243 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.security_lite import SecurityLite + + +T = TypeVar("T", bound="PositionBlock") + + +@_attrs_define +class PositionBlock: + """Position projection embedded inside a `PortfolioBlockEnvelope`. + + Pre-converts cents fields to dollars (`cost_basis_dollars`, + `current_value_dollars`) for display; the cents-precision fields + live on the standalone `PositionResponse`. Embeds a `SecurityLite` + so callers can render the security name without a follow-up fetch. + + Attributes: + id (str): Position ID (`pos_*` ULID). + quantity (float): Quantity held in `quantity_type` units. + quantity_type (str): Unit basis (`shares`, `units`, `principal`). + cost_basis_dollars (float): Cost basis in dollars (pre-converted from cents). + status (str): Lifecycle state (`active`, `disposed`, `archived`). See `PositionResponse.status` for the full + vocabulary. + security (SecurityLite): Lightweight security projection for embedding in position + envelopes. Skips `terms`, `outstanding_shares`, etc. — fetch the + full `SecurityResponse` when those are needed. + current_value_dollars (float | None | Unset): Latest mark-to-market value in dollars. `null` when the position + has not been marked. + valuation_date (datetime.date | None | Unset): Date the current value was sourced. + valuation_source (None | str | Unset): Free-text source attribution for the valuation. + acquisition_date (datetime.date | None | Unset): Date the position was acquired. + notes (None | str | Unset): Free-text notes attached to the position. + """ + + id: str + quantity: float + quantity_type: str + cost_basis_dollars: float + status: str + security: SecurityLite + current_value_dollars: float | None | Unset = UNSET + valuation_date: datetime.date | None | Unset = UNSET + valuation_source: None | str | Unset = UNSET + acquisition_date: datetime.date | None | Unset = UNSET + notes: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + quantity = self.quantity + + quantity_type = self.quantity_type + + cost_basis_dollars = self.cost_basis_dollars + + status = self.status + + security = self.security.to_dict() + + current_value_dollars: float | None | Unset + if isinstance(self.current_value_dollars, Unset): + current_value_dollars = UNSET + else: + current_value_dollars = self.current_value_dollars + + valuation_date: None | str | Unset + if isinstance(self.valuation_date, Unset): + valuation_date = UNSET + elif isinstance(self.valuation_date, datetime.date): + valuation_date = self.valuation_date.isoformat() + else: + valuation_date = self.valuation_date + + valuation_source: None | str | Unset + if isinstance(self.valuation_source, Unset): + valuation_source = UNSET + else: + valuation_source = self.valuation_source + + acquisition_date: None | str | Unset + if isinstance(self.acquisition_date, Unset): + acquisition_date = UNSET + elif isinstance(self.acquisition_date, datetime.date): + acquisition_date = self.acquisition_date.isoformat() + else: + acquisition_date = self.acquisition_date + + notes: None | str | Unset + if isinstance(self.notes, Unset): + notes = UNSET + else: + notes = self.notes + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "quantity": quantity, + "quantity_type": quantity_type, + "cost_basis_dollars": cost_basis_dollars, + "status": status, + "security": security, + } + ) + if current_value_dollars is not UNSET: + field_dict["current_value_dollars"] = current_value_dollars + if valuation_date is not UNSET: + field_dict["valuation_date"] = valuation_date + if valuation_source is not UNSET: + field_dict["valuation_source"] = valuation_source + if acquisition_date is not UNSET: + field_dict["acquisition_date"] = acquisition_date + if notes is not UNSET: + field_dict["notes"] = notes + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.security_lite import SecurityLite + + d = dict(src_dict) + id = d.pop("id") + + quantity = d.pop("quantity") + + quantity_type = d.pop("quantity_type") + + cost_basis_dollars = d.pop("cost_basis_dollars") + + status = d.pop("status") + + security = SecurityLite.from_dict(d.pop("security")) + + def _parse_current_value_dollars(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + current_value_dollars = _parse_current_value_dollars( + d.pop("current_value_dollars", UNSET) + ) + + def _parse_valuation_date(data: object) -> datetime.date | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + valuation_date_type_0 = isoparse(data).date() + + return valuation_date_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None | Unset, data) + + valuation_date = _parse_valuation_date(d.pop("valuation_date", UNSET)) + + def _parse_valuation_source(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + valuation_source = _parse_valuation_source(d.pop("valuation_source", UNSET)) + + def _parse_acquisition_date(data: object) -> datetime.date | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + acquisition_date_type_0 = isoparse(data).date() + + return acquisition_date_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None | Unset, data) + + acquisition_date = _parse_acquisition_date(d.pop("acquisition_date", UNSET)) + + def _parse_notes(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + notes = _parse_notes(d.pop("notes", UNSET)) + + position_block = cls( + id=id, + quantity=quantity, + quantity_type=quantity_type, + cost_basis_dollars=cost_basis_dollars, + status=status, + security=security, + current_value_dollars=current_value_dollars, + valuation_date=valuation_date, + valuation_source=valuation_source, + acquisition_date=acquisition_date, + notes=notes, + ) + + position_block.additional_properties = d + return position_block + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/rendering_lite.py b/robosystems_client/models/rendering_lite.py new file mode 100644 index 0000000..3bb4a13 --- /dev/null +++ b/robosystems_client/models/rendering_lite.py @@ -0,0 +1,152 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.rendering_period_lite import RenderingPeriodLite + from ..models.rendering_row_lite import RenderingRowLite + from ..models.validation_lite import ValidationLite + + +T = TypeVar("T", bound="RenderingLite") + + +@_attrs_define +class RenderingLite: + """Pre-computed rendering projection of an Information Block. + + Computed server-side at envelope-build time for blocks where rendering + is deterministic (the statement family today; future block types add + their own rendering builders). The frontend's ``BlockView`` + ``Rendering`` projection consumes this directly — no client-side + rollup, depth computation, or calculation walk needed. + + Attributes: + rows (list[RenderingRowLite] | Unset): + periods (list[RenderingPeriodLite] | Unset): + validation (None | Unset | ValidationLite): + unmapped_count (int | Unset): Default: 0. + """ + + rows: list[RenderingRowLite] | Unset = UNSET + periods: list[RenderingPeriodLite] | Unset = UNSET + validation: None | Unset | ValidationLite = UNSET + unmapped_count: int | Unset = 0 + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.validation_lite import ValidationLite + + rows: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.rows, Unset): + rows = [] + for rows_item_data in self.rows: + rows_item = rows_item_data.to_dict() + rows.append(rows_item) + + periods: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.periods, Unset): + periods = [] + for periods_item_data in self.periods: + periods_item = periods_item_data.to_dict() + periods.append(periods_item) + + validation: dict[str, Any] | None | Unset + if isinstance(self.validation, Unset): + validation = UNSET + elif isinstance(self.validation, ValidationLite): + validation = self.validation.to_dict() + else: + validation = self.validation + + unmapped_count = self.unmapped_count + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if rows is not UNSET: + field_dict["rows"] = rows + if periods is not UNSET: + field_dict["periods"] = periods + if validation is not UNSET: + field_dict["validation"] = validation + if unmapped_count is not UNSET: + field_dict["unmapped_count"] = unmapped_count + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.rendering_period_lite import RenderingPeriodLite + from ..models.rendering_row_lite import RenderingRowLite + from ..models.validation_lite import ValidationLite + + d = dict(src_dict) + _rows = d.pop("rows", UNSET) + rows: list[RenderingRowLite] | Unset = UNSET + if _rows is not UNSET: + rows = [] + for rows_item_data in _rows: + rows_item = RenderingRowLite.from_dict(rows_item_data) + + rows.append(rows_item) + + _periods = d.pop("periods", UNSET) + periods: list[RenderingPeriodLite] | Unset = UNSET + if _periods is not UNSET: + periods = [] + for periods_item_data in _periods: + periods_item = RenderingPeriodLite.from_dict(periods_item_data) + + periods.append(periods_item) + + def _parse_validation(data: object) -> None | Unset | ValidationLite: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + validation_type_0 = ValidationLite.from_dict(data) + + return validation_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | Unset | ValidationLite, data) + + validation = _parse_validation(d.pop("validation", UNSET)) + + unmapped_count = d.pop("unmapped_count", UNSET) + + rendering_lite = cls( + rows=rows, + periods=periods, + validation=validation, + unmapped_count=unmapped_count, + ) + + rendering_lite.additional_properties = d + return rendering_lite + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/rendering_period_lite.py b/robosystems_client/models/rendering_period_lite.py new file mode 100644 index 0000000..07ee9f7 --- /dev/null +++ b/robosystems_client/models/rendering_period_lite.py @@ -0,0 +1,94 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="RenderingPeriodLite") + + +@_attrs_define +class RenderingPeriodLite: + """One period column in a rendered statement. + + Attributes: + start (datetime.date): + end (datetime.date): + label (None | str | Unset): + """ + + start: datetime.date + end: datetime.date + label: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + start = self.start.isoformat() + + end = self.end.isoformat() + + label: None | str | Unset + if isinstance(self.label, Unset): + label = UNSET + else: + label = self.label + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "start": start, + "end": end, + } + ) + if label is not UNSET: + field_dict["label"] = label + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + start = isoparse(d.pop("start")).date() + + end = isoparse(d.pop("end")).date() + + def _parse_label(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + label = _parse_label(d.pop("label", UNSET)) + + rendering_period_lite = cls( + start=start, + end=end, + label=label, + ) + + rendering_period_lite.additional_properties = d + return rendering_period_lite + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/rendering_row_lite.py b/robosystems_client/models/rendering_row_lite.py new file mode 100644 index 0000000..d99e8ff --- /dev/null +++ b/robosystems_client/models/rendering_row_lite.py @@ -0,0 +1,186 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="RenderingRowLite") + + +@_attrs_define +class RenderingRowLite: + """One row of a server-side rendered statement. + + Mirrors :class:`FactRow` from the legacy + :mod:`robosystems.operations.roboledger.reports.fact_grid` but lives at + the API boundary so envelope consumers don't depend on the + fact-grid module. ``values`` is one entry per period column in + :class:`RenderingLite.periods`. + + Attributes: + element_id (str): + element_name (str): + element_qname (None | str | Unset): + classification (None | str | Unset): FASB elementsOfFinancialStatements trait identifier — 'asset', 'liability', + 'equity', 'revenue', 'expense'. Surfaced so the viewer can color-code or group rows without a follow-up trait + lookup. + balance_type (None | str | Unset): + values (list[float | None] | Unset): + is_subtotal (bool | Unset): Default: False. + depth (int | Unset): Default: 0. + """ + + element_id: str + element_name: str + element_qname: None | str | Unset = UNSET + classification: None | str | Unset = UNSET + balance_type: None | str | Unset = UNSET + values: list[float | None] | Unset = UNSET + is_subtotal: bool | Unset = False + depth: int | Unset = 0 + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + element_id = self.element_id + + element_name = self.element_name + + element_qname: None | str | Unset + if isinstance(self.element_qname, Unset): + element_qname = UNSET + else: + element_qname = self.element_qname + + classification: None | str | Unset + if isinstance(self.classification, Unset): + classification = UNSET + else: + classification = self.classification + + balance_type: None | str | Unset + if isinstance(self.balance_type, Unset): + balance_type = UNSET + else: + balance_type = self.balance_type + + values: list[float | None] | Unset = UNSET + if not isinstance(self.values, Unset): + values = [] + for values_item_data in self.values: + values_item: float | None + values_item = values_item_data + values.append(values_item) + + is_subtotal = self.is_subtotal + + depth = self.depth + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "element_id": element_id, + "element_name": element_name, + } + ) + if element_qname is not UNSET: + field_dict["element_qname"] = element_qname + if classification is not UNSET: + field_dict["classification"] = classification + if balance_type is not UNSET: + field_dict["balance_type"] = balance_type + if values is not UNSET: + field_dict["values"] = values + if is_subtotal is not UNSET: + field_dict["is_subtotal"] = is_subtotal + if depth is not UNSET: + field_dict["depth"] = depth + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + element_id = d.pop("element_id") + + element_name = d.pop("element_name") + + def _parse_element_qname(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + element_qname = _parse_element_qname(d.pop("element_qname", UNSET)) + + def _parse_classification(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + classification = _parse_classification(d.pop("classification", UNSET)) + + def _parse_balance_type(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + balance_type = _parse_balance_type(d.pop("balance_type", UNSET)) + + _values = d.pop("values", UNSET) + values: list[float | None] | Unset = UNSET + if _values is not UNSET: + values = [] + for values_item_data in _values: + + def _parse_values_item(data: object) -> float | None: + if data is None: + return data + return cast(float | None, data) + + values_item = _parse_values_item(values_item_data) + + values.append(values_item) + + is_subtotal = d.pop("is_subtotal", UNSET) + + depth = d.pop("depth", UNSET) + + rendering_row_lite = cls( + element_id=element_id, + element_name=element_name, + element_qname=element_qname, + classification=classification, + balance_type=balance_type, + values=values, + is_subtotal=is_subtotal, + depth=depth, + ) + + rendering_row_lite.additional_properties = d + return rendering_row_lite + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/rule_lite.py b/robosystems_client/models/rule_lite.py new file mode 100644 index 0000000..c18d70d --- /dev/null +++ b/robosystems_client/models/rule_lite.py @@ -0,0 +1,199 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.rule_target_lite import RuleTargetLite + from ..models.rule_variable_lite import RuleVariableLite + + +T = TypeVar("T", bound="RuleLite") + + +@_attrs_define +class RuleLite: + """Rule projection for the Information Block envelope. + + One row per ``public.rules`` entry scoped to this block. The rule + engine consumes ``rule_expression`` + ``rule_variables`` to evaluate + against the in-scope fact set; the envelope surfaces the rules so + the UI can render them as a checklist alongside any persisted + verification results. + + Attributes: + id (str): + rule_category (str): One of 8 cm:VerificationRule subclasses — AutomatedAccountingAndReportingChecks, + FundamentalAccountingConceptRelation, PeerConsistencyRule, PriorPeriodConsistencyRule, + ReportLevelModelStructureRule, ReportingSystemSpecificRule, ToDoManualTask, XBRLTechnicalSyntaxRule. + rule_pattern (str): One of 10 cm:BusinessRulePattern mechanisms — Adjustment, CoExists, EqualTo, Exists, + GreaterThan, GreaterThanOrEqualToZero, LessThan, RollForward, RollUp, Variance. + rule_expression (str): + rule_target (None | RuleTargetLite | Unset): + rule_variables (list[RuleVariableLite] | Unset): + rule_message (None | str | Unset): + rule_severity (str | Unset): Failure severity — 'info' | 'warning' | 'error'. Enum closure enforced by the + ``public.rules`` CHECK constraint. Default: 'error'. + rule_origin (str | Unset): Provenance — 'forked' (from an upstream artifact, e.g. Seattle Method) or 'native' + (authored in this seed or by a tenant). Enum closure enforced by the ``public.rules`` CHECK constraint. Default: + 'native'. + """ + + id: str + rule_category: str + rule_pattern: str + rule_expression: str + rule_target: None | RuleTargetLite | Unset = UNSET + rule_variables: list[RuleVariableLite] | Unset = UNSET + rule_message: None | str | Unset = UNSET + rule_severity: str | Unset = "error" + rule_origin: str | Unset = "native" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.rule_target_lite import RuleTargetLite + + id = self.id + + rule_category = self.rule_category + + rule_pattern = self.rule_pattern + + rule_expression = self.rule_expression + + rule_target: dict[str, Any] | None | Unset + if isinstance(self.rule_target, Unset): + rule_target = UNSET + elif isinstance(self.rule_target, RuleTargetLite): + rule_target = self.rule_target.to_dict() + else: + rule_target = self.rule_target + + rule_variables: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.rule_variables, Unset): + rule_variables = [] + for rule_variables_item_data in self.rule_variables: + rule_variables_item = rule_variables_item_data.to_dict() + rule_variables.append(rule_variables_item) + + rule_message: None | str | Unset + if isinstance(self.rule_message, Unset): + rule_message = UNSET + else: + rule_message = self.rule_message + + rule_severity = self.rule_severity + + rule_origin = self.rule_origin + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "rule_category": rule_category, + "rule_pattern": rule_pattern, + "rule_expression": rule_expression, + } + ) + if rule_target is not UNSET: + field_dict["rule_target"] = rule_target + if rule_variables is not UNSET: + field_dict["rule_variables"] = rule_variables + if rule_message is not UNSET: + field_dict["rule_message"] = rule_message + if rule_severity is not UNSET: + field_dict["rule_severity"] = rule_severity + if rule_origin is not UNSET: + field_dict["rule_origin"] = rule_origin + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.rule_target_lite import RuleTargetLite + from ..models.rule_variable_lite import RuleVariableLite + + d = dict(src_dict) + id = d.pop("id") + + rule_category = d.pop("rule_category") + + rule_pattern = d.pop("rule_pattern") + + rule_expression = d.pop("rule_expression") + + def _parse_rule_target(data: object) -> None | RuleTargetLite | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + rule_target_type_0 = RuleTargetLite.from_dict(data) + + return rule_target_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | RuleTargetLite | Unset, data) + + rule_target = _parse_rule_target(d.pop("rule_target", UNSET)) + + _rule_variables = d.pop("rule_variables", UNSET) + rule_variables: list[RuleVariableLite] | Unset = UNSET + if _rule_variables is not UNSET: + rule_variables = [] + for rule_variables_item_data in _rule_variables: + rule_variables_item = RuleVariableLite.from_dict(rule_variables_item_data) + + rule_variables.append(rule_variables_item) + + def _parse_rule_message(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + rule_message = _parse_rule_message(d.pop("rule_message", UNSET)) + + rule_severity = d.pop("rule_severity", UNSET) + + rule_origin = d.pop("rule_origin", UNSET) + + rule_lite = cls( + id=id, + rule_category=rule_category, + rule_pattern=rule_pattern, + rule_expression=rule_expression, + rule_target=rule_target, + rule_variables=rule_variables, + rule_message=rule_message, + rule_severity=rule_severity, + rule_origin=rule_origin, + ) + + rule_lite.additional_properties = d + return rule_lite + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/rule_target_lite.py b/robosystems_client/models/rule_target_lite.py new file mode 100644 index 0000000..919f0be --- /dev/null +++ b/robosystems_client/models/rule_target_lite.py @@ -0,0 +1,72 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="RuleTargetLite") + + +@_attrs_define +class RuleTargetLite: + """Polymorphic rule target — points at the atom the rule is scoped to. + + Attributes: + target_kind (str): Which atom type the rule targets — 'structure' | 'element' | 'association' | 'taxonomy'. Enum + closure enforced by the ``public.rules`` CHECK constraint. + target_ref_id (str): UUID of the target atom — structure_id, element_id, association_id, or taxonomy_id + depending on ``target_kind``. + """ + + target_kind: str + target_ref_id: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + target_kind = self.target_kind + + target_ref_id = self.target_ref_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "target_kind": target_kind, + "target_ref_id": target_ref_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + target_kind = d.pop("target_kind") + + target_ref_id = d.pop("target_ref_id") + + rule_target_lite = cls( + target_kind=target_kind, + target_ref_id=target_ref_id, + ) + + rule_target_lite.additional_properties = d + return rule_target_lite + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/rule_variable_lite.py b/robosystems_client/models/rule_variable_lite.py new file mode 100644 index 0000000..ef077ed --- /dev/null +++ b/robosystems_client/models/rule_variable_lite.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="RuleVariableLite") + + +@_attrs_define +class RuleVariableLite: + """`$Variable` → concept qname binding for a rule expression. + + Attributes: + variable_name (str): Local name in the rule expression, e.g. 'Assets'. + variable_qname (str): Concept qname the variable resolves to, e.g. 'fac:Assets'. + """ + + variable_name: str + variable_qname: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + variable_name = self.variable_name + + variable_qname = self.variable_qname + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "variable_name": variable_name, + "variable_qname": variable_qname, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + variable_name = d.pop("variable_name") + + variable_qname = d.pop("variable_qname") + + rule_variable_lite = cls( + variable_name=variable_name, + variable_qname=variable_qname, + ) + + rule_variable_lite.additional_properties = d + return rule_variable_lite + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/schedule_mechanics.py b/robosystems_client/models/schedule_mechanics.py new file mode 100644 index 0000000..8476216 --- /dev/null +++ b/robosystems_client/models/schedule_mechanics.py @@ -0,0 +1,136 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.entry_template_request import EntryTemplateRequest + from ..models.schedule_metadata_request import ScheduleMetadataRequest + + +T = TypeVar("T", bound="ScheduleMechanics") + + +@_attrs_define +class ScheduleMechanics: + """Closing-entry generator mechanics for ``block_type='schedule'``. + + Reads directly from the typed ``structures.artifact_mechanics`` JSONB + column. ``entry_template`` and ``schedule_metadata`` are typed + sub-models (reusing the wire-level request shapes so OpenAPI emits one + canonical type per concept); the envelope builder falls back to + ``structures.metadata_`` for legacy Schedule rows that the tenant + backfill hasn't yet migrated to the typed column. + + Attributes: + entry_template (EntryTemplateRequest): + kind (Literal['closing_entry_generator'] | Unset): Default: 'closing_entry_generator'. + schedule_metadata (None | ScheduleMetadataRequest | Unset): Method (straight_line / declining_balance / + units_of_production), original_amount, residual_value, useful_life_months, optional asset_element_id for net- + book-value cross-reference. + periods_with_entries (int | Unset): Number of in-scope periods that have at least one closing entry posted. + Runtime state derived at envelope-build time from the Entry table. Default: 0. + """ + + entry_template: EntryTemplateRequest + kind: Literal["closing_entry_generator"] | Unset = "closing_entry_generator" + schedule_metadata: None | ScheduleMetadataRequest | Unset = UNSET + periods_with_entries: int | Unset = 0 + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.schedule_metadata_request import ScheduleMetadataRequest + + entry_template = self.entry_template.to_dict() + + kind = self.kind + + schedule_metadata: dict[str, Any] | None | Unset + if isinstance(self.schedule_metadata, Unset): + schedule_metadata = UNSET + elif isinstance(self.schedule_metadata, ScheduleMetadataRequest): + schedule_metadata = self.schedule_metadata.to_dict() + else: + schedule_metadata = self.schedule_metadata + + periods_with_entries = self.periods_with_entries + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "entry_template": entry_template, + } + ) + if kind is not UNSET: + field_dict["kind"] = kind + if schedule_metadata is not UNSET: + field_dict["schedule_metadata"] = schedule_metadata + if periods_with_entries is not UNSET: + field_dict["periods_with_entries"] = periods_with_entries + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.entry_template_request import EntryTemplateRequest + from ..models.schedule_metadata_request import ScheduleMetadataRequest + + d = dict(src_dict) + entry_template = EntryTemplateRequest.from_dict(d.pop("entry_template")) + + kind = cast(Literal["closing_entry_generator"] | Unset, d.pop("kind", UNSET)) + if kind != "closing_entry_generator" and not isinstance(kind, Unset): + raise ValueError(f"kind must match const 'closing_entry_generator', got '{kind}'") + + def _parse_schedule_metadata( + data: object, + ) -> None | ScheduleMetadataRequest | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + schedule_metadata_type_0 = ScheduleMetadataRequest.from_dict(data) + + return schedule_metadata_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | ScheduleMetadataRequest | Unset, data) + + schedule_metadata = _parse_schedule_metadata(d.pop("schedule_metadata", UNSET)) + + periods_with_entries = d.pop("periods_with_entries", UNSET) + + schedule_mechanics = cls( + entry_template=entry_template, + kind=kind, + schedule_metadata=schedule_metadata, + periods_with_entries=periods_with_entries, + ) + + schedule_mechanics.additional_properties = d + return schedule_mechanics + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/schedule_metadata_request.py b/robosystems_client/models/schedule_metadata_request.py new file mode 100644 index 0000000..359fa31 --- /dev/null +++ b/robosystems_client/models/schedule_metadata_request.py @@ -0,0 +1,146 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ScheduleMetadataRequest") + + +@_attrs_define +class ScheduleMetadataRequest: + """ + Attributes: + method (str | Unset): Calculation method. 'straight_line' (default) distributes `monthly_amount` evenly across + periods with the final period absorbing rounding. 'custom' requires `periodic_amounts` — the generator uses + those values verbatim instead of computing. Other strings are labels only; fact values still come from + `monthly_amount` or `periodic_amounts`. Default: 'straight_line'. + original_amount (int | Unset): Cost basis in cents Default: 0. + residual_value (int | Unset): Salvage value in cents Default: 0. + useful_life_months (int | Unset): Useful life in months Default: 0. + asset_element_id (None | str | Unset): BS asset element for net book value + periodic_amounts (list[int] | None | Unset): Explicit per-period amounts in cents. When set, the generator uses + these values instead of `monthly_amount` — enabling non-straight-line schedules (effective-interest bond + discount amortization, day-count interest accrual, variable lease payments, pre-computed effective-yield curves, + etc.). Length must match the number of monthly periods between `period_start` and `period_end`; sum must equal + `original_amount` exactly. The auto-generated SumEquals rule proves Σ = original regardless of the curve shape. + """ + + method: str | Unset = "straight_line" + original_amount: int | Unset = 0 + residual_value: int | Unset = 0 + useful_life_months: int | Unset = 0 + asset_element_id: None | str | Unset = UNSET + periodic_amounts: list[int] | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + method = self.method + + original_amount = self.original_amount + + residual_value = self.residual_value + + useful_life_months = self.useful_life_months + + asset_element_id: None | str | Unset + if isinstance(self.asset_element_id, Unset): + asset_element_id = UNSET + else: + asset_element_id = self.asset_element_id + + periodic_amounts: list[int] | None | Unset + if isinstance(self.periodic_amounts, Unset): + periodic_amounts = UNSET + elif isinstance(self.periodic_amounts, list): + periodic_amounts = self.periodic_amounts + + else: + periodic_amounts = self.periodic_amounts + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if method is not UNSET: + field_dict["method"] = method + if original_amount is not UNSET: + field_dict["original_amount"] = original_amount + if residual_value is not UNSET: + field_dict["residual_value"] = residual_value + if useful_life_months is not UNSET: + field_dict["useful_life_months"] = useful_life_months + if asset_element_id is not UNSET: + field_dict["asset_element_id"] = asset_element_id + if periodic_amounts is not UNSET: + field_dict["periodic_amounts"] = periodic_amounts + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + method = d.pop("method", UNSET) + + original_amount = d.pop("original_amount", UNSET) + + residual_value = d.pop("residual_value", UNSET) + + useful_life_months = d.pop("useful_life_months", UNSET) + + def _parse_asset_element_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + asset_element_id = _parse_asset_element_id(d.pop("asset_element_id", UNSET)) + + def _parse_periodic_amounts(data: object) -> list[int] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + periodic_amounts_type_0 = cast(list[int], data) + + return periodic_amounts_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[int] | None | Unset, data) + + periodic_amounts = _parse_periodic_amounts(d.pop("periodic_amounts", UNSET)) + + schedule_metadata_request = cls( + method=method, + original_amount=original_amount, + residual_value=residual_value, + useful_life_months=useful_life_months, + asset_element_id=asset_element_id, + periodic_amounts=periodic_amounts, + ) + + schedule_metadata_request.additional_properties = d + return schedule_metadata_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/security_lite.py b/robosystems_client/models/security_lite.py new file mode 100644 index 0000000..0ad4157 --- /dev/null +++ b/robosystems_client/models/security_lite.py @@ -0,0 +1,169 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.entity_lite import EntityLite + + +T = TypeVar("T", bound="SecurityLite") + + +@_attrs_define +class SecurityLite: + """Lightweight security projection for embedding in position + envelopes. Skips `terms`, `outstanding_shares`, etc. — fetch the + full `SecurityResponse` when those are needed. + + Attributes: + id (str): Security ID (`sec_*` ULID). + name (str): Display name of the security. + security_type (str): Instrument family (e.g. `common_stock`, `preferred_stock`, `warrant`). + is_active (bool): `true` when the security is in active status. + security_subtype (None | str | Unset): Optional subtype refinement (e.g. `class_a`). + issuer (EntityLite | None | Unset): Embedded issuer entity, when one is linked. `null` for pre-issuer + securities. + source_graph_id (None | str | Unset): Tenant graph the security is pre-associated to, if any. + """ + + id: str + name: str + security_type: str + is_active: bool + security_subtype: None | str | Unset = UNSET + issuer: EntityLite | None | Unset = UNSET + source_graph_id: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.entity_lite import EntityLite + + id = self.id + + name = self.name + + security_type = self.security_type + + is_active = self.is_active + + security_subtype: None | str | Unset + if isinstance(self.security_subtype, Unset): + security_subtype = UNSET + else: + security_subtype = self.security_subtype + + issuer: dict[str, Any] | None | Unset + if isinstance(self.issuer, Unset): + issuer = UNSET + elif isinstance(self.issuer, EntityLite): + issuer = self.issuer.to_dict() + else: + issuer = self.issuer + + source_graph_id: None | str | Unset + if isinstance(self.source_graph_id, Unset): + source_graph_id = UNSET + else: + source_graph_id = self.source_graph_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "name": name, + "security_type": security_type, + "is_active": is_active, + } + ) + if security_subtype is not UNSET: + field_dict["security_subtype"] = security_subtype + if issuer is not UNSET: + field_dict["issuer"] = issuer + if source_graph_id is not UNSET: + field_dict["source_graph_id"] = source_graph_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.entity_lite import EntityLite + + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name") + + security_type = d.pop("security_type") + + is_active = d.pop("is_active") + + def _parse_security_subtype(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + security_subtype = _parse_security_subtype(d.pop("security_subtype", UNSET)) + + def _parse_issuer(data: object) -> EntityLite | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + issuer_type_0 = EntityLite.from_dict(data) + + return issuer_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(EntityLite | None | Unset, data) + + issuer = _parse_issuer(d.pop("issuer", UNSET)) + + def _parse_source_graph_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + source_graph_id = _parse_source_graph_id(d.pop("source_graph_id", UNSET)) + + security_lite = cls( + id=id, + name=name, + security_type=security_type, + is_active=is_active, + security_subtype=security_subtype, + issuer=issuer, + source_graph_id=source_graph_id, + ) + + security_lite.additional_properties = d + return security_lite + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/security_response.py b/robosystems_client/models/security_response.py new file mode 100644 index 0000000..6bb180a --- /dev/null +++ b/robosystems_client/models/security_response.py @@ -0,0 +1,243 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.security_response_terms import SecurityResponseTerms + + +T = TypeVar("T", bound="SecurityResponse") + + +@_attrs_define +class SecurityResponse: + """Read projection for a single security. + + Attributes: + id (str): Security ID (`sec_*` ULID). + name (str): Display name of the security. + security_type (str): Instrument family (e.g. `common_stock`, `preferred_stock`, `warrant`, `convertible_note`). + terms (SecurityResponseTerms): Instrument-specific terms blob. Shape depends on `security_type` — see + `CreateSecurityRequest.terms` for common keys. + is_active (bool): `true` when the security is in active status; `false` after a soft-delete or deactivation. + created_at (datetime.datetime): Row creation timestamp (UTC). + updated_at (datetime.datetime): Last-modified timestamp (UTC). + entity_id (None | str | Unset): ID of the issuing entity, when set. + entity_name (None | str | Unset): Cached display name of the issuing entity, denormalized for list rendering. + May lag the entity row's current name briefly. + source_graph_id (None | str | Unset): Tenant graph this security is pre-associated to, when the issuer entity + hasn't been promoted yet. + security_subtype (None | str | Unset): Optional subtype refinement (e.g. `class_a`, `series_a`). + authorized_shares (int | None | Unset): Total shares authorized for this class, when set. + outstanding_shares (int | None | Unset): Shares currently issued and outstanding. + """ + + id: str + name: str + security_type: str + terms: SecurityResponseTerms + is_active: bool + created_at: datetime.datetime + updated_at: datetime.datetime + entity_id: None | str | Unset = UNSET + entity_name: None | str | Unset = UNSET + source_graph_id: None | str | Unset = UNSET + security_subtype: None | str | Unset = UNSET + authorized_shares: int | None | Unset = UNSET + outstanding_shares: int | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + security_type = self.security_type + + terms = self.terms.to_dict() + + is_active = self.is_active + + created_at = self.created_at.isoformat() + + updated_at = self.updated_at.isoformat() + + entity_id: None | str | Unset + if isinstance(self.entity_id, Unset): + entity_id = UNSET + else: + entity_id = self.entity_id + + entity_name: None | str | Unset + if isinstance(self.entity_name, Unset): + entity_name = UNSET + else: + entity_name = self.entity_name + + source_graph_id: None | str | Unset + if isinstance(self.source_graph_id, Unset): + source_graph_id = UNSET + else: + source_graph_id = self.source_graph_id + + security_subtype: None | str | Unset + if isinstance(self.security_subtype, Unset): + security_subtype = UNSET + else: + security_subtype = self.security_subtype + + authorized_shares: int | None | Unset + if isinstance(self.authorized_shares, Unset): + authorized_shares = UNSET + else: + authorized_shares = self.authorized_shares + + outstanding_shares: int | None | Unset + if isinstance(self.outstanding_shares, Unset): + outstanding_shares = UNSET + else: + outstanding_shares = self.outstanding_shares + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "name": name, + "security_type": security_type, + "terms": terms, + "is_active": is_active, + "created_at": created_at, + "updated_at": updated_at, + } + ) + if entity_id is not UNSET: + field_dict["entity_id"] = entity_id + if entity_name is not UNSET: + field_dict["entity_name"] = entity_name + if source_graph_id is not UNSET: + field_dict["source_graph_id"] = source_graph_id + if security_subtype is not UNSET: + field_dict["security_subtype"] = security_subtype + if authorized_shares is not UNSET: + field_dict["authorized_shares"] = authorized_shares + if outstanding_shares is not UNSET: + field_dict["outstanding_shares"] = outstanding_shares + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.security_response_terms import SecurityResponseTerms + + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name") + + security_type = d.pop("security_type") + + terms = SecurityResponseTerms.from_dict(d.pop("terms")) + + is_active = d.pop("is_active") + + created_at = isoparse(d.pop("created_at")) + + updated_at = isoparse(d.pop("updated_at")) + + def _parse_entity_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + entity_id = _parse_entity_id(d.pop("entity_id", UNSET)) + + def _parse_entity_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + entity_name = _parse_entity_name(d.pop("entity_name", UNSET)) + + def _parse_source_graph_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + source_graph_id = _parse_source_graph_id(d.pop("source_graph_id", UNSET)) + + def _parse_security_subtype(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + security_subtype = _parse_security_subtype(d.pop("security_subtype", UNSET)) + + def _parse_authorized_shares(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + authorized_shares = _parse_authorized_shares(d.pop("authorized_shares", UNSET)) + + def _parse_outstanding_shares(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + outstanding_shares = _parse_outstanding_shares(d.pop("outstanding_shares", UNSET)) + + security_response = cls( + id=id, + name=name, + security_type=security_type, + terms=terms, + is_active=is_active, + created_at=created_at, + updated_at=updated_at, + entity_id=entity_id, + entity_name=entity_name, + source_graph_id=source_graph_id, + security_subtype=security_subtype, + authorized_shares=authorized_shares, + outstanding_shares=outstanding_shares, + ) + + security_response.additional_properties = d + return security_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/security_response_terms.py b/robosystems_client/models/security_response_terms.py new file mode 100644 index 0000000..7678a3e --- /dev/null +++ b/robosystems_client/models/security_response_terms.py @@ -0,0 +1,50 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="SecurityResponseTerms") + + +@_attrs_define +class SecurityResponseTerms: + """Instrument-specific terms blob. Shape depends on `security_type` — see `CreateSecurityRequest.terms` for common + keys. + + """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + security_response_terms = cls() + + security_response_terms.additional_properties = d + return security_response_terms + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/statement_mechanics.py b/robosystems_client/models/statement_mechanics.py new file mode 100644 index 0000000..a7ed5c0 --- /dev/null +++ b/robosystems_client/models/statement_mechanics.py @@ -0,0 +1,116 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="StatementMechanics") + + +@_attrs_define +class StatementMechanics: + """Renderer mechanics for the statement family of block types. + + Covers ``balance_sheet``, ``income_statement``, ``cash_flow_statement``, + and ``equity_statement``. All fields are optional so library-seeded + rows that haven't been enriched yet still validate against an empty + tagged body. The existing ``statement(...)`` GraphQL field continues + to serve rendered output; this mechanics model is the source of truth + for future renderer configuration. + + Attributes: + kind (Literal['statement_renderer'] | Unset): Default: 'statement_renderer'. + template_id (None | str | Unset): Pinned template id — when set, the renderer uses that template's layout + instead of the block's default. The templates table is not yet implemented; the column is reserved so tenant + writes can stamp it without another migration round-trip when it lands. + rollup_root_element_ids (list[str] | Unset): Element ids that anchor the statement's roll-up roots (e.g. the + Assets and LiabilitiesAndEquity totals on a Balance Sheet). Empty on library-seeded rows until tenant adoption. + period_comparisons (int | Unset): Number of period columns to render in comparative mode: 1 = single-period, 2 = + prior-period comparison, 3-4 = multi-year trailing view. Defaults to single-period; overridden by the template + when one is attached. Default: 1. + """ + + kind: Literal["statement_renderer"] | Unset = "statement_renderer" + template_id: None | str | Unset = UNSET + rollup_root_element_ids: list[str] | Unset = UNSET + period_comparisons: int | Unset = 1 + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + kind = self.kind + + template_id: None | str | Unset + if isinstance(self.template_id, Unset): + template_id = UNSET + else: + template_id = self.template_id + + rollup_root_element_ids: list[str] | Unset = UNSET + if not isinstance(self.rollup_root_element_ids, Unset): + rollup_root_element_ids = self.rollup_root_element_ids + + period_comparisons = self.period_comparisons + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if kind is not UNSET: + field_dict["kind"] = kind + if template_id is not UNSET: + field_dict["template_id"] = template_id + if rollup_root_element_ids is not UNSET: + field_dict["rollup_root_element_ids"] = rollup_root_element_ids + if period_comparisons is not UNSET: + field_dict["period_comparisons"] = period_comparisons + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + kind = cast(Literal["statement_renderer"] | Unset, d.pop("kind", UNSET)) + if kind != "statement_renderer" and not isinstance(kind, Unset): + raise ValueError(f"kind must match const 'statement_renderer', got '{kind}'") + + def _parse_template_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + template_id = _parse_template_id(d.pop("template_id", UNSET)) + + rollup_root_element_ids = cast(list[str], d.pop("rollup_root_element_ids", UNSET)) + + period_comparisons = d.pop("period_comparisons", UNSET) + + statement_mechanics = cls( + kind=kind, + template_id=template_id, + rollup_root_element_ids=rollup_root_element_ids, + period_comparisons=period_comparisons, + ) + + statement_mechanics.additional_properties = d + return statement_mechanics + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/update_event_block_request.py b/robosystems_client/models/update_event_block_request.py index a55b8f2..2bdae81 100644 --- a/robosystems_client/models/update_event_block_request.py +++ b/robosystems_client/models/update_event_block_request.py @@ -29,7 +29,7 @@ class UpdateEventBlockRequest: All fields except event_id are optional — only supplied fields are updated. Attributes: - event_id (str): + event_id (str): Target event ID. transition_to (None | Unset | UpdateEventBlockRequestTransitionToType0): Status transition. Valid moves depend on current status: captured → committed | voided | superseded; classified → committed | pending | fulfilled | voided | superseded; committed → pending | fulfilled | voided | superseded; pending → fulfilled | voided | @@ -37,8 +37,10 @@ class UpdateEventBlockRequest: fulfilled are usually set by handlers, not by callers, but the transition is allowed for corrections. superseded_by_id (None | str | Unset): New event id that replaces this one. Required when transition_to='superseded'. - description (None | str | Unset): - effective_at (datetime.datetime | None | Unset): + description (None | str | Unset): Replacement free-text summary. Unset = unchanged; pass an empty string to + clear. + effective_at (datetime.datetime | None | Unset): New accounting recognition date. Unset = unchanged. Useful when + an event was captured against the wrong period. metadata_patch (UpdateEventBlockRequestMetadataPatch | Unset): Key-value pairs merged into existing metadata (additive patch, not replace). obligated_by_event_id (None | str | Unset): Set/update the forward-materialization link. diff --git a/robosystems_client/models/delete_information_block_request.py b/robosystems_client/models/update_legacy_arm.py similarity index 53% rename from robosystems_client/models/delete_information_block_request.py rename to robosystems_client/models/update_legacy_arm.py index 25098a6..405e568 100644 --- a/robosystems_client/models/delete_information_block_request.py +++ b/robosystems_client/models/update_legacy_arm.py @@ -6,36 +6,38 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field +from ..models.update_legacy_arm_block_type import UpdateLegacyArmBlockType from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.delete_information_block_request_payload import ( - DeleteInformationBlockRequestPayload, - ) + from ..models.update_legacy_arm_payload import UpdateLegacyArmPayload -T = TypeVar("T", bound="DeleteInformationBlockRequest") +T = TypeVar("T", bound="UpdateLegacyArm") @_attrs_define -class DeleteInformationBlockRequest: - """Generic delete request — mirrors :class:`CreateInformationBlockRequest`. +class UpdateLegacyArm: + """Update-information-block body for block types that don't yet have + a typed update path at the API boundary. - Validated against the registry entry's ``delete_request_model``. - Block types that don't support deletion raise ``NotImplementedError``. + Statement-family blocks are library-seeded and immutable. Metric + block updates are not yet implemented. Calling this endpoint with + one of these block types returns HTTP 501. Attributes: - block_type (str): Block type discriminator. Must match a registered entry. - payload (DeleteInformationBlockRequestPayload | Unset): Block-type-specific delete payload. Typically carries - just the structure_id. Shape-validated against the registry entry's `delete_request_model` at dispatch time. + block_type (UpdateLegacyArmBlockType): Statement-family or metric block type. Updates return 501 — statement + Structures are library-seeded; metric updates are pending. + payload (UpdateLegacyArmPayload | Unset): Untyped payload — typed-arm validation is skipped because the dispatch + handler raises 501 before the payload is consumed. """ - block_type: str - payload: DeleteInformationBlockRequestPayload | Unset = UNSET + block_type: UpdateLegacyArmBlockType + payload: UpdateLegacyArmPayload | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - block_type = self.block_type + block_type = self.block_type.value payload: dict[str, Any] | Unset = UNSET if not isinstance(self.payload, Unset): @@ -55,27 +57,25 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.delete_information_block_request_payload import ( - DeleteInformationBlockRequestPayload, - ) + from ..models.update_legacy_arm_payload import UpdateLegacyArmPayload d = dict(src_dict) - block_type = d.pop("block_type") + block_type = UpdateLegacyArmBlockType(d.pop("block_type")) _payload = d.pop("payload", UNSET) - payload: DeleteInformationBlockRequestPayload | Unset + payload: UpdateLegacyArmPayload | Unset if isinstance(_payload, Unset): payload = UNSET else: - payload = DeleteInformationBlockRequestPayload.from_dict(_payload) + payload = UpdateLegacyArmPayload.from_dict(_payload) - delete_information_block_request = cls( + update_legacy_arm = cls( block_type=block_type, payload=payload, ) - delete_information_block_request.additional_properties = d - return delete_information_block_request + update_legacy_arm.additional_properties = d + return update_legacy_arm @property def additional_keys(self) -> list[str]: diff --git a/robosystems_client/models/update_legacy_arm_block_type.py b/robosystems_client/models/update_legacy_arm_block_type.py new file mode 100644 index 0000000..0e3f1fd --- /dev/null +++ b/robosystems_client/models/update_legacy_arm_block_type.py @@ -0,0 +1,12 @@ +from enum import Enum + + +class UpdateLegacyArmBlockType(str, Enum): + BALANCE_SHEET = "balance_sheet" + CASH_FLOW_STATEMENT = "cash_flow_statement" + EQUITY_STATEMENT = "equity_statement" + INCOME_STATEMENT = "income_statement" + METRIC = "metric" + + def __str__(self) -> str: + return str(self.value) diff --git a/robosystems_client/models/update_legacy_arm_payload.py b/robosystems_client/models/update_legacy_arm_payload.py new file mode 100644 index 0000000..0f1037d --- /dev/null +++ b/robosystems_client/models/update_legacy_arm_payload.py @@ -0,0 +1,50 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="UpdateLegacyArmPayload") + + +@_attrs_define +class UpdateLegacyArmPayload: + """Untyped payload — typed-arm validation is skipped because the dispatch handler raises 501 before the payload is + consumed. + + """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + update_legacy_arm_payload = cls() + + update_legacy_arm_payload.additional_properties = d + return update_legacy_arm_payload + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/update_schedule_arm.py b/robosystems_client/models/update_schedule_arm.py new file mode 100644 index 0000000..71a1258 --- /dev/null +++ b/robosystems_client/models/update_schedule_arm.py @@ -0,0 +1,91 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.update_schedule_request import UpdateScheduleRequest + + +T = TypeVar("T", bound="UpdateScheduleArm") + + +@_attrs_define +class UpdateScheduleArm: + """Update-information-block body for `block_type="schedule"`. + + Carries a typed schedule update payload — full editable shape is + exposed inline. + + Attributes: + block_type (Literal['schedule']): Discriminator value selecting this arm. + payload (UpdateScheduleRequest): Update mutable fields on a schedule. + + Editable: name, entry_template, schedule_metadata (all live on the + Structure row / its metadata_ JSONB column). + + NOT editable via this op: period_start, period_end, monthly_amount. + Those require fact regeneration — fire an event block that terminates + the schedule (e.g., `asset_disposed`) and create a fresh schedule via + `create-schedule`. + + Omitted fields are left unchanged. + """ + + block_type: Literal["schedule"] + payload: UpdateScheduleRequest + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + block_type = self.block_type + + payload = self.payload.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "block_type": block_type, + "payload": payload, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_schedule_request import UpdateScheduleRequest + + d = dict(src_dict) + block_type = cast(Literal["schedule"], d.pop("block_type")) + if block_type != "schedule": + raise ValueError(f"block_type must match const 'schedule', got '{block_type}'") + + payload = UpdateScheduleRequest.from_dict(d.pop("payload")) + + update_schedule_arm = cls( + block_type=block_type, + payload=payload, + ) + + update_schedule_arm.additional_properties = d + return update_schedule_arm + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/update_schedule_request.py b/robosystems_client/models/update_schedule_request.py new file mode 100644 index 0000000..f08432b --- /dev/null +++ b/robosystems_client/models/update_schedule_request.py @@ -0,0 +1,167 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.entry_template_request import EntryTemplateRequest + from ..models.schedule_metadata_request import ScheduleMetadataRequest + + +T = TypeVar("T", bound="UpdateScheduleRequest") + + +@_attrs_define +class UpdateScheduleRequest: + """Update mutable fields on a schedule. + + Editable: name, entry_template, schedule_metadata (all live on the + Structure row / its metadata_ JSONB column). + + NOT editable via this op: period_start, period_end, monthly_amount. + Those require fact regeneration — fire an event block that terminates + the schedule (e.g., `asset_disposed`) and create a fresh schedule via + `create-schedule`. + + Omitted fields are left unchanged. + + Attributes: + structure_id (str): + name (None | str | Unset): + entry_template (EntryTemplateRequest | None | Unset): + schedule_metadata (None | ScheduleMetadataRequest | Unset): + """ + + structure_id: str + name: None | str | Unset = UNSET + entry_template: EntryTemplateRequest | None | Unset = UNSET + schedule_metadata: None | ScheduleMetadataRequest | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.entry_template_request import EntryTemplateRequest + from ..models.schedule_metadata_request import ScheduleMetadataRequest + + structure_id = self.structure_id + + name: None | str | Unset + if isinstance(self.name, Unset): + name = UNSET + else: + name = self.name + + entry_template: dict[str, Any] | None | Unset + if isinstance(self.entry_template, Unset): + entry_template = UNSET + elif isinstance(self.entry_template, EntryTemplateRequest): + entry_template = self.entry_template.to_dict() + else: + entry_template = self.entry_template + + schedule_metadata: dict[str, Any] | None | Unset + if isinstance(self.schedule_metadata, Unset): + schedule_metadata = UNSET + elif isinstance(self.schedule_metadata, ScheduleMetadataRequest): + schedule_metadata = self.schedule_metadata.to_dict() + else: + schedule_metadata = self.schedule_metadata + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "structure_id": structure_id, + } + ) + if name is not UNSET: + field_dict["name"] = name + if entry_template is not UNSET: + field_dict["entry_template"] = entry_template + if schedule_metadata is not UNSET: + field_dict["schedule_metadata"] = schedule_metadata + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.entry_template_request import EntryTemplateRequest + from ..models.schedule_metadata_request import ScheduleMetadataRequest + + d = dict(src_dict) + structure_id = d.pop("structure_id") + + def _parse_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + name = _parse_name(d.pop("name", UNSET)) + + def _parse_entry_template(data: object) -> EntryTemplateRequest | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + entry_template_type_0 = EntryTemplateRequest.from_dict(data) + + return entry_template_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(EntryTemplateRequest | None | Unset, data) + + entry_template = _parse_entry_template(d.pop("entry_template", UNSET)) + + def _parse_schedule_metadata( + data: object, + ) -> None | ScheduleMetadataRequest | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + schedule_metadata_type_0 = ScheduleMetadataRequest.from_dict(data) + + return schedule_metadata_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | ScheduleMetadataRequest | Unset, data) + + schedule_metadata = _parse_schedule_metadata(d.pop("schedule_metadata", UNSET)) + + update_schedule_request = cls( + structure_id=structure_id, + name=name, + entry_template=entry_template, + schedule_metadata=schedule_metadata, + ) + + update_schedule_request.additional_properties = d + return update_schedule_request + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/update_security_operation.py b/robosystems_client/models/update_security_operation.py index d01c8ca..c7623ef 100644 --- a/robosystems_client/models/update_security_operation.py +++ b/robosystems_client/models/update_security_operation.py @@ -23,15 +23,18 @@ class UpdateSecurityOperation: Attributes: security_id (str): Target security ID. - entity_id (None | str | Unset): - source_graph_id (None | str | Unset): - name (None | str | Unset): - security_type (None | str | Unset): - security_subtype (None | str | Unset): - terms (None | Unset | UpdateSecurityOperationTermsType0): - is_active (bool | None | Unset): - authorized_shares (int | None | Unset): - outstanding_shares (int | None | Unset): + entity_id (None | str | Unset): Reassign to a different issuing entity. Unset = unchanged. + source_graph_id (None | str | Unset): Update the pre-association tenant graph. Unset = unchanged. + name (None | str | Unset): New display name. Unset = unchanged. + security_type (None | str | Unset): New instrument family. Unset = unchanged. Reclassifying a security may + invalidate existing `terms` shape; the operation does not validate the cross-field consistency. + security_subtype (None | str | Unset): New subtype refinement. Unset = unchanged. + terms (None | Unset | UpdateSecurityOperationTermsType0): Replacement terms blob. Pass `null`/omit to leave + existing terms unchanged; pass `{}` to clear them. + is_active (bool | None | Unset): Active flag. Set `false` to soft-deactivate (positions remain addressable but + the security is hidden from active lookups). + authorized_shares (int | None | Unset): New authorized share count. Unset = unchanged. + outstanding_shares (int | None | Unset): New outstanding share count. Unset = unchanged. """ security_id: str diff --git a/robosystems_client/models/validation_lite.py b/robosystems_client/models/validation_lite.py new file mode 100644 index 0000000..5652a4d --- /dev/null +++ b/robosystems_client/models/validation_lite.py @@ -0,0 +1,100 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ValidationLite") + + +@_attrs_define +class ValidationLite: + """Outcome of guard-rail validation on a rendered statement. + + Distinct from :class:`VerificationResultLite` (which surfaces the + rule-engine outcomes from ``public.verification_results``). This lite + type carries the synchronous guard-rail checks computed at + envelope-build time — accounting equation, totals foot, etc. + + Attributes: + passed (bool | Unset): Default: True. + checks (list[str] | Unset): + failures (list[str] | Unset): + warnings (list[str] | Unset): + """ + + passed: bool | Unset = True + checks: list[str] | Unset = UNSET + failures: list[str] | Unset = UNSET + warnings: list[str] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + passed = self.passed + + checks: list[str] | Unset = UNSET + if not isinstance(self.checks, Unset): + checks = self.checks + + failures: list[str] | Unset = UNSET + if not isinstance(self.failures, Unset): + failures = self.failures + + warnings: list[str] | Unset = UNSET + if not isinstance(self.warnings, Unset): + warnings = self.warnings + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if passed is not UNSET: + field_dict["passed"] = passed + if checks is not UNSET: + field_dict["checks"] = checks + if failures is not UNSET: + field_dict["failures"] = failures + if warnings is not UNSET: + field_dict["warnings"] = warnings + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + passed = d.pop("passed", UNSET) + + checks = cast(list[str], d.pop("checks", UNSET)) + + failures = cast(list[str], d.pop("failures", UNSET)) + + warnings = cast(list[str], d.pop("warnings", UNSET)) + + validation_lite = cls( + passed=passed, + checks=checks, + failures=failures, + warnings=warnings, + ) + + validation_lite.additional_properties = d + return validation_lite + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/verification_result_lite.py b/robosystems_client/models/verification_result_lite.py new file mode 100644 index 0000000..e6abbf1 --- /dev/null +++ b/robosystems_client/models/verification_result_lite.py @@ -0,0 +1,238 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="VerificationResultLite") + + +@_attrs_define +class VerificationResultLite: + """Persisted outcome of one Rule evaluation. + + One row per ``public.verification_results`` entry the rule engine + writes. The envelope surfaces them so the block viewer's + "Verification Results" tab and MCP ``list-verification-failures`` + tool can render + aggregate without a second round-trip. + + Attributes: + id (str): + rule_id (str): + status (str): 'pass' | 'fail' | 'error' | 'skipped'. Enum closure enforced by the + ``public.verification_results`` CHECK constraint. + structure_id (None | str | Unset): + fact_set_id (None | str | Unset): + message (None | str | Unset): + period_start (datetime.date | None | Unset): + period_end (datetime.date | None | Unset): + evaluated_at (datetime.datetime | None | Unset): + """ + + id: str + rule_id: str + status: str + structure_id: None | str | Unset = UNSET + fact_set_id: None | str | Unset = UNSET + message: None | str | Unset = UNSET + period_start: datetime.date | None | Unset = UNSET + period_end: datetime.date | None | Unset = UNSET + evaluated_at: datetime.datetime | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + rule_id = self.rule_id + + status = self.status + + structure_id: None | str | Unset + if isinstance(self.structure_id, Unset): + structure_id = UNSET + else: + structure_id = self.structure_id + + fact_set_id: None | str | Unset + if isinstance(self.fact_set_id, Unset): + fact_set_id = UNSET + else: + fact_set_id = self.fact_set_id + + message: None | str | Unset + if isinstance(self.message, Unset): + message = UNSET + else: + message = self.message + + period_start: None | str | Unset + if isinstance(self.period_start, Unset): + period_start = UNSET + elif isinstance(self.period_start, datetime.date): + period_start = self.period_start.isoformat() + else: + period_start = self.period_start + + period_end: None | str | Unset + if isinstance(self.period_end, Unset): + period_end = UNSET + elif isinstance(self.period_end, datetime.date): + period_end = self.period_end.isoformat() + else: + period_end = self.period_end + + evaluated_at: None | str | Unset + if isinstance(self.evaluated_at, Unset): + evaluated_at = UNSET + elif isinstance(self.evaluated_at, datetime.datetime): + evaluated_at = self.evaluated_at.isoformat() + else: + evaluated_at = self.evaluated_at + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "rule_id": rule_id, + "status": status, + } + ) + if structure_id is not UNSET: + field_dict["structure_id"] = structure_id + if fact_set_id is not UNSET: + field_dict["fact_set_id"] = fact_set_id + if message is not UNSET: + field_dict["message"] = message + if period_start is not UNSET: + field_dict["period_start"] = period_start + if period_end is not UNSET: + field_dict["period_end"] = period_end + if evaluated_at is not UNSET: + field_dict["evaluated_at"] = evaluated_at + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + rule_id = d.pop("rule_id") + + status = d.pop("status") + + def _parse_structure_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + structure_id = _parse_structure_id(d.pop("structure_id", UNSET)) + + def _parse_fact_set_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + fact_set_id = _parse_fact_set_id(d.pop("fact_set_id", UNSET)) + + def _parse_message(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + message = _parse_message(d.pop("message", UNSET)) + + def _parse_period_start(data: object) -> datetime.date | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + period_start_type_0 = isoparse(data).date() + + return period_start_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None | Unset, data) + + period_start = _parse_period_start(d.pop("period_start", UNSET)) + + def _parse_period_end(data: object) -> datetime.date | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + period_end_type_0 = isoparse(data).date() + + return period_end_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None | Unset, data) + + period_end = _parse_period_end(d.pop("period_end", UNSET)) + + def _parse_evaluated_at(data: object) -> datetime.datetime | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + evaluated_at_type_0 = isoparse(data) + + return evaluated_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None | Unset, data) + + evaluated_at = _parse_evaluated_at(d.pop("evaluated_at", UNSET)) + + verification_result_lite = cls( + id=id, + rule_id=rule_id, + status=status, + structure_id=structure_id, + fact_set_id=fact_set_id, + message=message, + period_start=period_start, + period_end=period_end, + evaluated_at=evaluated_at, + ) + + verification_result_lite.additional_properties = d + return verification_result_lite + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/view_projections.py b/robosystems_client/models/view_projections.py new file mode 100644 index 0000000..3404938 --- /dev/null +++ b/robosystems_client/models/view_projections.py @@ -0,0 +1,105 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.rendering_lite import RenderingLite + + +T = TypeVar("T", bound="ViewProjections") + + +@_attrs_define +class ViewProjections: + """Charlie's six ``type-of View`` arms, surfaced at the envelope boundary. + + Each projection is computed server-side at envelope-build time when + its source data is available. The frontend's ``BlockView`` dispatcher + routes to the projection component matching the user's selected view + mode; missing projections (those still in backlog) render as empty + states without breaking the dispatcher. + + Today: ``rendering`` is computed for the statement family. + Other arms (``fact_table``, ``model_structure``, ``verification_results``, + ``report_elements``, ``business_rules``) come online as their backend + support lands; ``fact_table`` is trivially derivable from + ``InformationBlockEnvelope.facts`` and may stay as a frontend-only + projection. + + Attributes: + rendering (None | RenderingLite | Unset): + """ + + rendering: None | RenderingLite | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.rendering_lite import RenderingLite + + rendering: dict[str, Any] | None | Unset + if isinstance(self.rendering, Unset): + rendering = UNSET + elif isinstance(self.rendering, RenderingLite): + rendering = self.rendering.to_dict() + else: + rendering = self.rendering + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if rendering is not UNSET: + field_dict["rendering"] = rendering + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.rendering_lite import RenderingLite + + d = dict(src_dict) + + def _parse_rendering(data: object) -> None | RenderingLite | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + rendering_type_0 = RenderingLite.from_dict(data) + + return rendering_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | RenderingLite | Unset, data) + + rendering = _parse_rendering(d.pop("rendering", UNSET)) + + view_projections = cls( + rendering=rendering, + ) + + view_projections.additional_properties = d + return view_projections + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties From 775cc87a402076ac7b38700f19cb7b74842108f7 Mon Sep 17 00:00:00 2001 From: "Joseph T. French" Date: Thu, 7 May 2026 02:12:40 -0500 Subject: [PATCH 2/4] refactor: Improve handling of OperationEnvelope in InvestorClient and LedgerClient --- robosystems_client/clients/investor_client.py | 21 ++++++++++++-- robosystems_client/clients/ledger_client.py | 29 +++++++++++++------ 2 files changed, 38 insertions(+), 12 deletions(-) diff --git a/robosystems_client/clients/investor_client.py b/robosystems_client/clients/investor_client.py index 17e7f87..889eb86 100644 --- a/robosystems_client/clients/investor_client.py +++ b/robosystems_client/clients/investor_client.py @@ -57,7 +57,6 @@ from ..models.create_security_request import CreateSecurityRequest from ..models.delete_portfolio_block_operation import DeletePortfolioBlockOperation from ..models.delete_security_operation import DeleteSecurityOperation -from ..models.operation_envelope import OperationEnvelope from ..models.update_portfolio_block_operation import UpdatePortfolioBlockOperation from ..models.update_security_operation import UpdateSecurityOperation @@ -107,14 +106,30 @@ def _query( cleaned = strip_none_vars(variables) if variables else None return self._get_graphql_client().execute(graph_id, query, cleaned) - def _call_op(self, label: str, response: Any) -> OperationEnvelope: + # The backend's `OperationEnvelope` is generic on the result type + # (`OperationEnvelope[T]`). Each typed op generates a separate + # `OperationEnvelope` attrs class in the SDK, with no + # shared base — so an `isinstance(envelope, OperationEnvelope)` check + # would reject typed ops like `create-portfolio-block`. We duck-type + # on the four envelope fields instead, which keeps the helper working + # for every current and future typed op without import bookkeeping. + _ENVELOPE_FIELDS = ("operation", "operation_id", "status", "result") + + def _is_envelope(self, value: Any) -> bool: + return all(hasattr(value, f) for f in self._ENVELOPE_FIELDS) + + def _call_op(self, label: str, response: Any) -> Any: if response.status_code not in (HTTPStatus.OK, HTTPStatus.ACCEPTED): raise RuntimeError( f"{label} failed: {response.status_code}: {response.content!r}" ) envelope = response.parsed - if not isinstance(envelope, OperationEnvelope): + if not self._is_envelope(envelope): raise RuntimeError(f"{label} failed: unexpected response shape: {envelope!r}") + # Normalize result to a plain dict — typed envelopes carry the result + # as an attrs class (e.g. `PortfolioBlockEnvelope`). + if envelope.result is not None and hasattr(envelope.result, "to_dict"): + envelope.result = envelope.result.to_dict() return envelope # ── Portfolios ────────────────────────────────────────────────────── diff --git a/robosystems_client/clients/ledger_client.py b/robosystems_client/clients/ledger_client.py index 9ecfa76..24c4f2f 100644 --- a/robosystems_client/clients/ledger_client.py +++ b/robosystems_client/clients/ledger_client.py @@ -261,7 +261,6 @@ from ..models.delete_publish_list_operation import DeletePublishListOperation from ..models.delete_report_operation import DeleteReportOperation from ..models.file_report_request import FileReportRequest -from ..models.operation_envelope import OperationEnvelope from ..models.regenerate_report_operation import RegenerateReportOperation from ..models.transition_filing_status_request import TransitionFilingStatusRequest from ..models.remove_publish_list_member_operation import ( @@ -344,25 +343,37 @@ def _query( cleaned = strip_none_vars(variables) if variables else None return self._get_graphql_client().execute(graph_id, query, cleaned) - def _unwrap(self, label: str, envelope: OperationEnvelope | Any) -> Any: + # The backend's `OperationEnvelope` is generic on the result type + # (`OperationEnvelope[T]`). Each typed op generates a separate + # `OperationEnvelope` attrs class in the SDK, with no + # shared base — so an `isinstance(envelope, OperationEnvelope)` check + # would reject typed ops like `create-event-block`. We duck-type on + # the four envelope fields instead, which keeps the helper working + # for every current and future typed op without import bookkeeping. + _ENVELOPE_FIELDS = ("operation", "operation_id", "status", "result") + + def _is_envelope(self, value: Any) -> bool: + return all(hasattr(value, f) for f in self._ENVELOPE_FIELDS) + + def _unwrap(self, label: str, envelope: Any) -> Any: """Unwrap an operation envelope and return `result` (None on failure).""" - if not isinstance(envelope, OperationEnvelope): + if not self._is_envelope(envelope): raise RuntimeError(f"{label} failed: {envelope!r}") - # envelope.result is untyped dict / list / None in the generated model return envelope.result - def _call_op(self, label: str, response: Any) -> OperationEnvelope: + def _call_op(self, label: str, response: Any) -> Any: """Common error handling for every generated op_* REST call.""" if response.status_code not in (HTTPStatus.OK, HTTPStatus.ACCEPTED): raise RuntimeError( f"{label} failed: {response.status_code}: {response.content!r}" ) envelope = response.parsed - if not isinstance(envelope, OperationEnvelope): + if not self._is_envelope(envelope): raise RuntimeError(f"{label} failed: unexpected response shape: {envelope!r}") - # Normalize result to a plain dict — the generated SDK sometimes - # wraps it in an OperationEnvelopeResultType0 attrs class instead - # of a dict, depending on the response shape. + # Normalize result to a plain dict — typed envelopes carry the result + # as an attrs class (e.g. `EventBlockEnvelope`); untyped envelopes + # (Any-default) sometimes wrap it in `OperationEnvelopeResultType0`. + # Either way, downstream callers expect `dict[str, Any]`. if envelope.result is not None and hasattr(envelope.result, "to_dict"): envelope.result = envelope.result.to_dict() return envelope From f3e7afd52aadb2060eb939732cc0e865ef1f6419 Mon Sep 17 00:00:00 2001 From: "Joseph T. French" Date: Thu, 7 May 2026 14:12:08 -0500 Subject: [PATCH 3/4] Add models for taxonomy block structure and related entities - Introduced StructureSummary model to represent various report structures. - Added TaxonomyBlockAssociation model for associations within taxonomy blocks. - Created TaxonomyBlockElement model to represent elements in taxonomy. - Implemented TaxonomyBlockElementOrigin enum for element provenance. - Developed TaxonomyBlockEnvelope model to encapsulate taxonomy block data. - Added TaxonomyBlockEnvelopeVerificationResultsItem model for verification results. - Created TaxonomyBlockRule model to define rules for taxonomy blocks. - Implemented TaxonomyBlockStructure model for structure definitions. - Added TransactionPreview model for planned GL entry lines. --- .../op_add_publish_list_members.py | 69 +- .../op_auto_map_elements.py | 36 +- .../extensions_robo_ledger/op_close_period.py | 76 +- .../extensions_robo_ledger/op_create_agent.py | 86 ++- .../op_create_event_handler.py | 106 ++- .../op_create_mapping_association.py | 98 ++- .../op_create_publish_list.py | 60 +- .../op_create_report.py | 88 ++- .../op_create_taxonomy_block.py | 50 +- .../op_delete_journal_entry.py | 30 +- .../op_delete_mapping_association.py | 48 +- .../op_delete_publish_list.py | 56 +- .../op_delete_report.py | 32 +- .../op_delete_taxonomy_block.py | 61 +- .../op_evaluate_rules.py | 50 +- .../extensions_robo_ledger/op_file_report.py | 32 +- .../op_initialize_ledger.py | 98 ++- .../op_link_entity_taxonomy.py | 86 ++- .../op_preview_event_block.py | 59 +- .../op_regenerate_report.py | 56 +- .../op_remove_publish_list_member.py | 40 +- .../op_reopen_period.py | 62 +- .../op_set_close_target.py | 62 +- .../extensions_robo_ledger/op_share_report.py | 60 +- .../op_transition_filing_status.py | 24 +- .../extensions_robo_ledger/op_update_agent.py | 66 +- .../op_update_entity.py | 80 ++- .../op_update_event_handler.py | 82 ++- .../op_update_journal_entry.py | 50 +- .../op_update_publish_list.py | 40 +- .../op_update_taxonomy_block.py | 50 +- robosystems_client/models/__init__.py | 210 ++++++ .../add_publish_list_members_operation.py | 8 +- .../models/association_response.py | 283 ++++++++ .../models/auto_map_elements_operation.py | 13 +- .../models/close_period_operation.py | 15 +- .../models/close_period_response.py | 97 +++ .../models/create_agent_request.py | 47 +- .../models/create_event_handler_request.py | 68 +- .../create_event_handler_request_metadata.py | 2 +- .../create_mapping_association_operation.py | 27 +- .../models/create_publish_list_request.py | 10 +- .../models/create_report_request.py | 42 +- .../models/delete_journal_entry_request.py | 2 +- .../delete_mapping_association_operation.py | 7 +- .../models/delete_publish_list_operation.py | 9 +- .../models/delete_report_operation.py | 5 +- robosystems_client/models/delete_result.py | 17 +- .../models/delete_taxonomy_block_request.py | 5 +- .../models/delete_taxonomy_block_response.py | 99 +++ .../models/entity_taxonomy_response.py | 108 +++ .../models/evaluate_rules_request.py | 3 +- .../models/evaluate_rules_response.py | 109 +++ .../models/evaluate_rules_response_summary.py | 47 ++ .../models/event_handler_response.py | 447 ++++++++++++ ...sponse_match_metadata_expression_type_0.py | 47 ++ ...t_handler_response_transaction_template.py | 47 ++ .../models/file_report_request.py | 2 + .../models/fiscal_calendar_response.py | 274 ++++++++ .../models/fiscal_period_summary.py | 124 ++++ .../models/initialize_ledger_request.py | 34 +- .../models/initialize_ledger_response.py | 89 +++ .../models/journal_entry_line_item_input.py | 8 +- .../journal_entry_line_item_response.py | 116 ++++ .../models/journal_entry_response.py | 238 +++++++ .../models/ledger_agent_response.py | 391 +++++++++++ .../ledger_agent_response_address_type_0.py | 47 ++ .../models/ledger_entity_response.py | 650 ++++++++++++++++++ .../models/link_entity_taxonomy_request.py | 21 +- ...operation_envelope_association_response.py | 158 +++++ ...on_envelope_association_response_status.py | 10 + ...peration_envelope_close_period_response.py | 158 +++++ ...n_envelope_close_period_response_status.py | 10 + ...envelope_delete_taxonomy_block_response.py | 158 +++++ ...e_delete_taxonomy_block_response_status.py | 10 + ...ation_envelope_entity_taxonomy_response.py | 158 +++++ ...nvelope_entity_taxonomy_response_status.py | 10 + ...ration_envelope_evaluate_rules_response.py | 158 +++++ ...envelope_evaluate_rules_response_status.py | 10 + ...eration_envelope_event_handler_response.py | 158 +++++ ..._envelope_event_handler_response_status.py | 10 + ...ation_envelope_fiscal_calendar_response.py | 158 +++++ ...nvelope_fiscal_calendar_response_status.py | 10 + ...ion_envelope_initialize_ledger_response.py | 158 +++++ ...elope_initialize_ledger_response_status.py | 10 + ...eration_envelope_journal_entry_response.py | 158 +++++ ..._envelope_journal_entry_response_status.py | 10 + ...peration_envelope_ledger_agent_response.py | 158 +++++ ...n_envelope_ledger_agent_response_status.py | 10 + ...eration_envelope_ledger_entity_response.py | 158 +++++ ..._envelope_ledger_entity_response_status.py | 10 + ...n_envelope_preview_event_block_response.py | 158 +++++ ...ope_preview_event_block_response_status.py | 10 + ...peration_envelope_publish_list_response.py | 158 +++++ ...n_envelope_publish_list_response_status.py | 10 + .../operation_envelope_report_response.py | 158 +++++ ...eration_envelope_report_response_status.py | 10 + ...peration_envelope_share_report_response.py | 158 +++++ ...n_envelope_share_report_response_status.py | 10 + ...ration_envelope_taxonomy_block_envelope.py | 158 +++++ ...envelope_taxonomy_block_envelope_status.py | 10 + ...velopelist_publish_list_member_response.py | 167 +++++ ...ist_publish_list_member_response_status.py | 10 + robosystems_client/models/period_spec.py | 18 +- .../models/preview_event_block_response.py | 164 +++++ ...w_event_block_response_handler_metadata.py | 50 ++ .../models/publish_list_member_response.py | 130 ++++ .../models/publish_list_response.py | 127 ++++ .../models/regenerate_report_operation.py | 17 +- .../remove_publish_list_member_operation.py | 7 +- .../models/reopen_period_operation.py | 6 +- robosystems_client/models/report_response.py | 544 +++++++++++++++ .../report_response_rule_summary_type_0.py | 47 ++ .../models/set_close_target_operation.py | 2 +- .../models/share_report_operation.py | 7 +- .../models/share_report_response.py | 85 +++ .../models/share_result_item.py | 102 +++ .../models/structure_summary.py | 83 +++ .../models/taxonomy_block_association.py | 156 +++++ .../models/taxonomy_block_element.py | 220 ++++++ .../models/taxonomy_block_element_origin.py | 9 + .../models/taxonomy_block_envelope.py | 371 ++++++++++ ...lock_envelope_verification_results_item.py | 47 ++ .../models/taxonomy_block_rule.py | 155 +++++ .../models/taxonomy_block_structure.py | 120 ++++ .../models/transaction_preview.py | 102 +++ .../transition_filing_status_request.py | 5 +- .../models/update_agent_request.py | 34 +- .../update_agent_request_metadata_patch.py | 2 +- .../models/update_entity_request.py | 56 +- .../models/update_event_handler_request.py | 41 +- ...te_event_handler_request_metadata_patch.py | 2 +- .../models/update_journal_entry_request.py | 12 +- .../models/update_publish_list_operation.py | 9 +- 134 files changed, 10531 insertions(+), 725 deletions(-) create mode 100644 robosystems_client/models/association_response.py create mode 100644 robosystems_client/models/close_period_response.py create mode 100644 robosystems_client/models/delete_taxonomy_block_response.py create mode 100644 robosystems_client/models/entity_taxonomy_response.py create mode 100644 robosystems_client/models/evaluate_rules_response.py create mode 100644 robosystems_client/models/evaluate_rules_response_summary.py create mode 100644 robosystems_client/models/event_handler_response.py create mode 100644 robosystems_client/models/event_handler_response_match_metadata_expression_type_0.py create mode 100644 robosystems_client/models/event_handler_response_transaction_template.py create mode 100644 robosystems_client/models/fiscal_calendar_response.py create mode 100644 robosystems_client/models/fiscal_period_summary.py create mode 100644 robosystems_client/models/initialize_ledger_response.py create mode 100644 robosystems_client/models/journal_entry_line_item_response.py create mode 100644 robosystems_client/models/journal_entry_response.py create mode 100644 robosystems_client/models/ledger_agent_response.py create mode 100644 robosystems_client/models/ledger_agent_response_address_type_0.py create mode 100644 robosystems_client/models/ledger_entity_response.py create mode 100644 robosystems_client/models/operation_envelope_association_response.py create mode 100644 robosystems_client/models/operation_envelope_association_response_status.py create mode 100644 robosystems_client/models/operation_envelope_close_period_response.py create mode 100644 robosystems_client/models/operation_envelope_close_period_response_status.py create mode 100644 robosystems_client/models/operation_envelope_delete_taxonomy_block_response.py create mode 100644 robosystems_client/models/operation_envelope_delete_taxonomy_block_response_status.py create mode 100644 robosystems_client/models/operation_envelope_entity_taxonomy_response.py create mode 100644 robosystems_client/models/operation_envelope_entity_taxonomy_response_status.py create mode 100644 robosystems_client/models/operation_envelope_evaluate_rules_response.py create mode 100644 robosystems_client/models/operation_envelope_evaluate_rules_response_status.py create mode 100644 robosystems_client/models/operation_envelope_event_handler_response.py create mode 100644 robosystems_client/models/operation_envelope_event_handler_response_status.py create mode 100644 robosystems_client/models/operation_envelope_fiscal_calendar_response.py create mode 100644 robosystems_client/models/operation_envelope_fiscal_calendar_response_status.py create mode 100644 robosystems_client/models/operation_envelope_initialize_ledger_response.py create mode 100644 robosystems_client/models/operation_envelope_initialize_ledger_response_status.py create mode 100644 robosystems_client/models/operation_envelope_journal_entry_response.py create mode 100644 robosystems_client/models/operation_envelope_journal_entry_response_status.py create mode 100644 robosystems_client/models/operation_envelope_ledger_agent_response.py create mode 100644 robosystems_client/models/operation_envelope_ledger_agent_response_status.py create mode 100644 robosystems_client/models/operation_envelope_ledger_entity_response.py create mode 100644 robosystems_client/models/operation_envelope_ledger_entity_response_status.py create mode 100644 robosystems_client/models/operation_envelope_preview_event_block_response.py create mode 100644 robosystems_client/models/operation_envelope_preview_event_block_response_status.py create mode 100644 robosystems_client/models/operation_envelope_publish_list_response.py create mode 100644 robosystems_client/models/operation_envelope_publish_list_response_status.py create mode 100644 robosystems_client/models/operation_envelope_report_response.py create mode 100644 robosystems_client/models/operation_envelope_report_response_status.py create mode 100644 robosystems_client/models/operation_envelope_share_report_response.py create mode 100644 robosystems_client/models/operation_envelope_share_report_response_status.py create mode 100644 robosystems_client/models/operation_envelope_taxonomy_block_envelope.py create mode 100644 robosystems_client/models/operation_envelope_taxonomy_block_envelope_status.py create mode 100644 robosystems_client/models/operation_envelopelist_publish_list_member_response.py create mode 100644 robosystems_client/models/operation_envelopelist_publish_list_member_response_status.py create mode 100644 robosystems_client/models/preview_event_block_response.py create mode 100644 robosystems_client/models/preview_event_block_response_handler_metadata.py create mode 100644 robosystems_client/models/publish_list_member_response.py create mode 100644 robosystems_client/models/publish_list_response.py create mode 100644 robosystems_client/models/report_response.py create mode 100644 robosystems_client/models/report_response_rule_summary_type_0.py create mode 100644 robosystems_client/models/share_report_response.py create mode 100644 robosystems_client/models/share_result_item.py create mode 100644 robosystems_client/models/structure_summary.py create mode 100644 robosystems_client/models/taxonomy_block_association.py create mode 100644 robosystems_client/models/taxonomy_block_element.py create mode 100644 robosystems_client/models/taxonomy_block_element_origin.py create mode 100644 robosystems_client/models/taxonomy_block_envelope.py create mode 100644 robosystems_client/models/taxonomy_block_envelope_verification_results_item.py create mode 100644 robosystems_client/models/taxonomy_block_rule.py create mode 100644 robosystems_client/models/taxonomy_block_structure.py create mode 100644 robosystems_client/models/transaction_preview.py diff --git a/robosystems_client/api/extensions_robo_ledger/op_add_publish_list_members.py b/robosystems_client/api/extensions_robo_ledger/op_add_publish_list_members.py index 9be68b7..6408b78 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_add_publish_list_members.py +++ b/robosystems_client/api/extensions_robo_ledger/op_add_publish_list_members.py @@ -9,7 +9,9 @@ from ...models.add_publish_list_members_operation import AddPublishListMembersOperation from ...models.error_response import ErrorResponse from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelopelist_publish_list_member_response import ( + OperationEnvelopelistPublishListMemberResponse, +) from ...types import UNSET, Response, Unset @@ -40,9 +42,16 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ( + ErrorResponse + | HTTPValidationError + | OperationEnvelopelistPublishListMemberResponse + | None +): if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopelistPublishListMemberResponse.from_dict( + response.json() + ) return response_200 @@ -94,7 +103,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ + ErrorResponse | HTTPValidationError | OperationEnvelopelistPublishListMemberResponse +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -109,10 +120,13 @@ def sync_detailed( client: AuthenticatedClient, body: AddPublishListMembersOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ + ErrorResponse | HTTPValidationError | OperationEnvelopelistPublishListMemberResponse +]: """Add Members to Publish List - + Add one or more recipient graphs to a publish list. Targets must exist and have the same extension + enabled (e.g. roboledger). Self-graph rejected (422); already-member rejected (409). **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -120,14 +134,14 @@ def sync_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (AddPublishListMembersOperation): + body (AddPublishListMembersOperation): Add recipient graphs to a publish list. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopelistPublishListMemberResponse] """ kwargs = _get_kwargs( @@ -149,10 +163,16 @@ def sync( client: AuthenticatedClient, body: AddPublishListMembersOperation, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ( + ErrorResponse + | HTTPValidationError + | OperationEnvelopelistPublishListMemberResponse + | None +): """Add Members to Publish List - + Add one or more recipient graphs to a publish list. Targets must exist and have the same extension + enabled (e.g. roboledger). Self-graph rejected (422); already-member rejected (409). **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -160,14 +180,14 @@ def sync( Args: graph_id (str): idempotency_key (None | str | Unset): - body (AddPublishListMembersOperation): + body (AddPublishListMembersOperation): Add recipient graphs to a publish list. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopelistPublishListMemberResponse """ return sync_detailed( @@ -184,10 +204,13 @@ async def asyncio_detailed( client: AuthenticatedClient, body: AddPublishListMembersOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ + ErrorResponse | HTTPValidationError | OperationEnvelopelistPublishListMemberResponse +]: """Add Members to Publish List - + Add one or more recipient graphs to a publish list. Targets must exist and have the same extension + enabled (e.g. roboledger). Self-graph rejected (422); already-member rejected (409). **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -195,14 +218,14 @@ async def asyncio_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (AddPublishListMembersOperation): + body (AddPublishListMembersOperation): Add recipient graphs to a publish list. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopelistPublishListMemberResponse] """ kwargs = _get_kwargs( @@ -222,10 +245,16 @@ async def asyncio( client: AuthenticatedClient, body: AddPublishListMembersOperation, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ( + ErrorResponse + | HTTPValidationError + | OperationEnvelopelistPublishListMemberResponse + | None +): """Add Members to Publish List - + Add one or more recipient graphs to a publish list. Targets must exist and have the same extension + enabled (e.g. roboledger). Self-graph rejected (422); already-member rejected (409). **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -233,14 +262,14 @@ async def asyncio( Args: graph_id (str): idempotency_key (None | str | Unset): - body (AddPublishListMembersOperation): + body (AddPublishListMembersOperation): Add recipient graphs to a publish list. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopelistPublishListMemberResponse """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_auto_map_elements.py b/robosystems_client/api/extensions_robo_ledger/op_auto_map_elements.py index 36e425c..d87ffb0 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_auto_map_elements.py +++ b/robosystems_client/api/extensions_robo_ledger/op_auto_map_elements.py @@ -122,7 +122,14 @@ def sync_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (AutoMapElementsOperation): Request body for the auto-map-elements async operation. + body (AutoMapElementsOperation): Run the MappingAgent over a mapping structure (async). + + The MappingAgent walks every unmapped CoA element and proposes + associations to reporting concepts. Confidence thresholds: ≥0.90 + auto-approved (association created), 0.70-0.89 flagged for review + (created with `confidence` set; surface it in your UI), <0.70 skipped. + Returns a `pending` envelope immediately; subscribe to the SSE stream + for progress. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -164,7 +171,14 @@ def sync( Args: graph_id (str): idempotency_key (None | str | Unset): - body (AutoMapElementsOperation): Request body for the auto-map-elements async operation. + body (AutoMapElementsOperation): Run the MappingAgent over a mapping structure (async). + + The MappingAgent walks every unmapped CoA element and proposes + associations to reporting concepts. Confidence thresholds: ≥0.90 + auto-approved (association created), 0.70-0.89 flagged for review + (created with `confidence` set; surface it in your UI), <0.70 skipped. + Returns a `pending` envelope immediately; subscribe to the SSE stream + for progress. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -201,7 +215,14 @@ async def asyncio_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (AutoMapElementsOperation): Request body for the auto-map-elements async operation. + body (AutoMapElementsOperation): Run the MappingAgent over a mapping structure (async). + + The MappingAgent walks every unmapped CoA element and proposes + associations to reporting concepts. Confidence thresholds: ≥0.90 + auto-approved (association created), 0.70-0.89 flagged for review + (created with `confidence` set; surface it in your UI), <0.70 skipped. + Returns a `pending` envelope immediately; subscribe to the SSE stream + for progress. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -241,7 +262,14 @@ async def asyncio( Args: graph_id (str): idempotency_key (None | str | Unset): - body (AutoMapElementsOperation): Request body for the auto-map-elements async operation. + body (AutoMapElementsOperation): Run the MappingAgent over a mapping structure (async). + + The MappingAgent walks every unmapped CoA element and proposes + associations to reporting concepts. Confidence thresholds: ≥0.90 + auto-approved (association created), 0.70-0.89 flagged for review + (created with `confidence` set; surface it in your UI), <0.70 skipped. + Returns a `pending` envelope immediately; subscribe to the SSE stream + for progress. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/robosystems_client/api/extensions_robo_ledger/op_close_period.py b/robosystems_client/api/extensions_robo_ledger/op_close_period.py index c48f567..ecd87a6 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_close_period.py +++ b/robosystems_client/api/extensions_robo_ledger/op_close_period.py @@ -9,7 +9,9 @@ from ...models.close_period_operation import ClosePeriodOperation from ...models.error_response import ErrorResponse from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_close_period_response import ( + OperationEnvelopeClosePeriodResponse, +) from ...types import UNSET, Response, Unset @@ -40,9 +42,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeClosePeriodResponse | None: if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeClosePeriodResponse.from_dict(response.json()) return response_200 @@ -94,7 +96,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ + ErrorResponse | HTTPValidationError | OperationEnvelopeClosePeriodResponse +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -109,10 +113,16 @@ def sync_detailed( client: AuthenticatedClient, body: ClosePeriodOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ + ErrorResponse | HTTPValidationError | OperationEnvelopeClosePeriodResponse +]: """Close Fiscal Period - + Lock a single fiscal period. Posts draft entries, runs the balance-sheet equation check, advances + `closed_through` by one, and auto-advances `close_target` if this close caught up to it. Period must + be exactly `closed_through + 1` — sequence violations return 422 with structured `blockers`. Common + blockers: `sync_stale` (override with `allow_stale_sync=true` after manual verification), + `period_incomplete` (draft entries unbalanced), `sequence_violation` (out-of-order). **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -120,14 +130,17 @@ def sync_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (ClosePeriodOperation): + body (ClosePeriodOperation): Close a single fiscal period. Carries the YYYY-MM `period` in + the + request body alongside the close-time options inherited from + :class:`ClosePeriodRequest`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopeClosePeriodResponse] """ kwargs = _get_kwargs( @@ -149,10 +162,14 @@ def sync( client: AuthenticatedClient, body: ClosePeriodOperation, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeClosePeriodResponse | None: """Close Fiscal Period - + Lock a single fiscal period. Posts draft entries, runs the balance-sheet equation check, advances + `closed_through` by one, and auto-advances `close_target` if this close caught up to it. Period must + be exactly `closed_through + 1` — sequence violations return 422 with structured `blockers`. Common + blockers: `sync_stale` (override with `allow_stale_sync=true` after manual verification), + `period_incomplete` (draft entries unbalanced), `sequence_violation` (out-of-order). **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -160,14 +177,17 @@ def sync( Args: graph_id (str): idempotency_key (None | str | Unset): - body (ClosePeriodOperation): + body (ClosePeriodOperation): Close a single fiscal period. Carries the YYYY-MM `period` in + the + request body alongside the close-time options inherited from + :class:`ClosePeriodRequest`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopeClosePeriodResponse """ return sync_detailed( @@ -184,10 +204,16 @@ async def asyncio_detailed( client: AuthenticatedClient, body: ClosePeriodOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ + ErrorResponse | HTTPValidationError | OperationEnvelopeClosePeriodResponse +]: """Close Fiscal Period - + Lock a single fiscal period. Posts draft entries, runs the balance-sheet equation check, advances + `closed_through` by one, and auto-advances `close_target` if this close caught up to it. Period must + be exactly `closed_through + 1` — sequence violations return 422 with structured `blockers`. Common + blockers: `sync_stale` (override with `allow_stale_sync=true` after manual verification), + `period_incomplete` (draft entries unbalanced), `sequence_violation` (out-of-order). **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -195,14 +221,17 @@ async def asyncio_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (ClosePeriodOperation): + body (ClosePeriodOperation): Close a single fiscal period. Carries the YYYY-MM `period` in + the + request body alongside the close-time options inherited from + :class:`ClosePeriodRequest`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopeClosePeriodResponse] """ kwargs = _get_kwargs( @@ -222,10 +251,14 @@ async def asyncio( client: AuthenticatedClient, body: ClosePeriodOperation, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeClosePeriodResponse | None: """Close Fiscal Period - + Lock a single fiscal period. Posts draft entries, runs the balance-sheet equation check, advances + `closed_through` by one, and auto-advances `close_target` if this close caught up to it. Period must + be exactly `closed_through + 1` — sequence violations return 422 with structured `blockers`. Common + blockers: `sync_stale` (override with `allow_stale_sync=true` after manual verification), + `period_incomplete` (draft entries unbalanced), `sequence_violation` (out-of-order). **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -233,14 +266,17 @@ async def asyncio( Args: graph_id (str): idempotency_key (None | str | Unset): - body (ClosePeriodOperation): + body (ClosePeriodOperation): Close a single fiscal period. Carries the YYYY-MM `period` in + the + request body alongside the close-time options inherited from + :class:`ClosePeriodRequest`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopeClosePeriodResponse """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_create_agent.py b/robosystems_client/api/extensions_robo_ledger/op_create_agent.py index 3c027d8..48faf46 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_create_agent.py +++ b/robosystems_client/api/extensions_robo_ledger/op_create_agent.py @@ -8,7 +8,9 @@ from ...client import AuthenticatedClient, Client from ...models.create_agent_request import CreateAgentRequest from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_ledger_agent_response import ( + OperationEnvelopeLedgerAgentResponse, +) from ...models.operation_error import OperationError from ...types import UNSET, Response, Unset @@ -40,9 +42,15 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeLedgerAgentResponse + | OperationError + | None +): if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeLedgerAgentResponse.from_dict(response.json()) return response_200 @@ -90,7 +98,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeLedgerAgentResponse | OperationError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -105,7 +115,9 @@ def sync_detailed( client: AuthenticatedClient, body: CreateAgentRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeLedgerAgentResponse | OperationError +]: """Create Agent Create a counterparty record (customer, vendor, employee, etc.). The (source, external_id) pair is a @@ -117,14 +129,21 @@ def sync_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (CreateAgentRequest): + body (CreateAgentRequest): Create a new economic counterparty. + + ``agent_type`` is the relationship category (customer, vendor, + employee, etc.) — the same legal entity may have multiple Agent rows + if they play multiple roles (e.g. a vendor who also became a + customer). ``source`` distinguishes integration-imported rows from + native-created ones; ``external_id`` carries the source-system's + primary key for sync. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeLedgerAgentResponse | OperationError] """ kwargs = _get_kwargs( @@ -146,7 +165,13 @@ def sync( client: AuthenticatedClient, body: CreateAgentRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeLedgerAgentResponse + | OperationError + | None +): """Create Agent Create a counterparty record (customer, vendor, employee, etc.). The (source, external_id) pair is a @@ -158,14 +183,21 @@ def sync( Args: graph_id (str): idempotency_key (None | str | Unset): - body (CreateAgentRequest): + body (CreateAgentRequest): Create a new economic counterparty. + + ``agent_type`` is the relationship category (customer, vendor, + employee, etc.) — the same legal entity may have multiple Agent rows + if they play multiple roles (e.g. a vendor who also became a + customer). ``source`` distinguishes integration-imported rows from + native-created ones; ``external_id`` carries the source-system's + primary key for sync. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeLedgerAgentResponse | OperationError """ return sync_detailed( @@ -182,7 +214,9 @@ async def asyncio_detailed( client: AuthenticatedClient, body: CreateAgentRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeLedgerAgentResponse | OperationError +]: """Create Agent Create a counterparty record (customer, vendor, employee, etc.). The (source, external_id) pair is a @@ -194,14 +228,21 @@ async def asyncio_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (CreateAgentRequest): + body (CreateAgentRequest): Create a new economic counterparty. + + ``agent_type`` is the relationship category (customer, vendor, + employee, etc.) — the same legal entity may have multiple Agent rows + if they play multiple roles (e.g. a vendor who also became a + customer). ``source`` distinguishes integration-imported rows from + native-created ones; ``external_id`` carries the source-system's + primary key for sync. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeLedgerAgentResponse | OperationError] """ kwargs = _get_kwargs( @@ -221,7 +262,13 @@ async def asyncio( client: AuthenticatedClient, body: CreateAgentRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeLedgerAgentResponse + | OperationError + | None +): """Create Agent Create a counterparty record (customer, vendor, employee, etc.). The (source, external_id) pair is a @@ -233,14 +280,21 @@ async def asyncio( Args: graph_id (str): idempotency_key (None | str | Unset): - body (CreateAgentRequest): + body (CreateAgentRequest): Create a new economic counterparty. + + ``agent_type`` is the relationship category (customer, vendor, + employee, etc.) — the same legal entity may have multiple Agent rows + if they play multiple roles (e.g. a vendor who also became a + customer). ``source`` distinguishes integration-imported rows from + native-created ones; ``external_id`` carries the source-system's + primary key for sync. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeLedgerAgentResponse | OperationError """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_create_event_handler.py b/robosystems_client/api/extensions_robo_ledger/op_create_event_handler.py index 93d3707..6b560d7 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_create_event_handler.py +++ b/robosystems_client/api/extensions_robo_ledger/op_create_event_handler.py @@ -8,7 +8,9 @@ from ...client import AuthenticatedClient, Client from ...models.create_event_handler_request import CreateEventHandlerRequest from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_event_handler_response import ( + OperationEnvelopeEventHandlerResponse, +) from ...models.operation_error import OperationError from ...types import UNSET, Response, Unset @@ -40,9 +42,15 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeEventHandlerResponse + | OperationError + | None +): if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeEventHandlerResponse.from_dict(response.json()) return response_200 @@ -90,7 +98,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeEventHandlerResponse | OperationError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -105,7 +115,9 @@ def sync_detailed( client: AuthenticatedClient, body: CreateEventHandlerRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeEventHandlerResponse | OperationError +]: """Create Event Handler Define a rule that fires GL transactions when a matching event block is created with @@ -120,14 +132,26 @@ def sync_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (CreateEventHandlerRequest): + body (CreateEventHandlerRequest): Register a new event-type → transaction-template rule. + + When ``create-event-block`` runs with ``apply_handlers=True``, the + registry resolves the *highest-priority active* handler whose match + criteria all match the event, then evaluates the + ``transaction_template`` to produce GL rows. Match precedence: among + active handlers for the same ``event_type``, the one with the most + specific match (more match fields satisfied) wins; ties broken by + ``priority`` desc, then ``created_at`` asc. + + All match fields except ``event_type`` are optional — leaving them + unset matches anything. Use ``match_metadata_expression`` for + fine-grained discrimination (e.g. only payroll categories). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeEventHandlerResponse | OperationError] """ kwargs = _get_kwargs( @@ -149,7 +173,13 @@ def sync( client: AuthenticatedClient, body: CreateEventHandlerRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeEventHandlerResponse + | OperationError + | None +): """Create Event Handler Define a rule that fires GL transactions when a matching event block is created with @@ -164,14 +194,26 @@ def sync( Args: graph_id (str): idempotency_key (None | str | Unset): - body (CreateEventHandlerRequest): + body (CreateEventHandlerRequest): Register a new event-type → transaction-template rule. + + When ``create-event-block`` runs with ``apply_handlers=True``, the + registry resolves the *highest-priority active* handler whose match + criteria all match the event, then evaluates the + ``transaction_template`` to produce GL rows. Match precedence: among + active handlers for the same ``event_type``, the one with the most + specific match (more match fields satisfied) wins; ties broken by + ``priority`` desc, then ``created_at`` asc. + + All match fields except ``event_type`` are optional — leaving them + unset matches anything. Use ``match_metadata_expression`` for + fine-grained discrimination (e.g. only payroll categories). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeEventHandlerResponse | OperationError """ return sync_detailed( @@ -188,7 +230,9 @@ async def asyncio_detailed( client: AuthenticatedClient, body: CreateEventHandlerRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeEventHandlerResponse | OperationError +]: """Create Event Handler Define a rule that fires GL transactions when a matching event block is created with @@ -203,14 +247,26 @@ async def asyncio_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (CreateEventHandlerRequest): + body (CreateEventHandlerRequest): Register a new event-type → transaction-template rule. + + When ``create-event-block`` runs with ``apply_handlers=True``, the + registry resolves the *highest-priority active* handler whose match + criteria all match the event, then evaluates the + ``transaction_template`` to produce GL rows. Match precedence: among + active handlers for the same ``event_type``, the one with the most + specific match (more match fields satisfied) wins; ties broken by + ``priority`` desc, then ``created_at`` asc. + + All match fields except ``event_type`` are optional — leaving them + unset matches anything. Use ``match_metadata_expression`` for + fine-grained discrimination (e.g. only payroll categories). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeEventHandlerResponse | OperationError] """ kwargs = _get_kwargs( @@ -230,7 +286,13 @@ async def asyncio( client: AuthenticatedClient, body: CreateEventHandlerRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeEventHandlerResponse + | OperationError + | None +): """Create Event Handler Define a rule that fires GL transactions when a matching event block is created with @@ -245,14 +307,26 @@ async def asyncio( Args: graph_id (str): idempotency_key (None | str | Unset): - body (CreateEventHandlerRequest): + body (CreateEventHandlerRequest): Register a new event-type → transaction-template rule. + + When ``create-event-block`` runs with ``apply_handlers=True``, the + registry resolves the *highest-priority active* handler whose match + criteria all match the event, then evaluates the + ``transaction_template`` to produce GL rows. Match precedence: among + active handlers for the same ``event_type``, the one with the most + specific match (more match fields satisfied) wins; ties broken by + ``priority`` desc, then ``created_at`` asc. + + All match fields except ``event_type`` are optional — leaving them + unset matches anything. Use ``match_metadata_expression`` for + fine-grained discrimination (e.g. only payroll categories). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeEventHandlerResponse | OperationError """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_create_mapping_association.py b/robosystems_client/api/extensions_robo_ledger/op_create_mapping_association.py index 0d222f6..80b590b 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_create_mapping_association.py +++ b/robosystems_client/api/extensions_robo_ledger/op_create_mapping_association.py @@ -10,7 +10,9 @@ CreateMappingAssociationOperation, ) from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_association_response import ( + OperationEnvelopeAssociationResponse, +) from ...models.operation_error import OperationError from ...types import UNSET, Response, Unset @@ -42,9 +44,15 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeAssociationResponse + | OperationError + | None +): if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeAssociationResponse.from_dict(response.json()) return response_200 @@ -92,7 +100,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeAssociationResponse | OperationError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -107,10 +117,13 @@ def sync_detailed( client: AuthenticatedClient, body: CreateMappingAssociationOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeAssociationResponse | OperationError +]: """Create Mapping Association - Link a chart-of-accounts element to a US GAAP reporting concept. + Link a chart-of-accounts element to a US GAAP reporting concept. One mapping edge per call — use + `auto-map-elements` for bulk AI-assisted mapping. Duplicate (from, to, type) tuples return 409. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -118,18 +131,19 @@ def sync_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (CreateMappingAssociationOperation): CQRS-shaped body for `POST /operations/create- - mapping-association`. + body (CreateMappingAssociationOperation): Create one CoA → reporting-concept mapping edge. - Bundles the target mapping structure's `mapping_id` with the association - payload so REST + MCP share a single body type via the registrar. + This is the iterative, AI-assisted craft path. Each call adds a single + association to the target mapping structure. Use `auto-map-elements` + to create many at once via the MappingAgent. Reject duplicates: if + the (from, to, type) tuple already exists, the call returns 409. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeAssociationResponse | OperationError] """ kwargs = _get_kwargs( @@ -151,10 +165,17 @@ def sync( client: AuthenticatedClient, body: CreateMappingAssociationOperation, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeAssociationResponse + | OperationError + | None +): """Create Mapping Association - Link a chart-of-accounts element to a US GAAP reporting concept. + Link a chart-of-accounts element to a US GAAP reporting concept. One mapping edge per call — use + `auto-map-elements` for bulk AI-assisted mapping. Duplicate (from, to, type) tuples return 409. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -162,18 +183,19 @@ def sync( Args: graph_id (str): idempotency_key (None | str | Unset): - body (CreateMappingAssociationOperation): CQRS-shaped body for `POST /operations/create- - mapping-association`. + body (CreateMappingAssociationOperation): Create one CoA → reporting-concept mapping edge. - Bundles the target mapping structure's `mapping_id` with the association - payload so REST + MCP share a single body type via the registrar. + This is the iterative, AI-assisted craft path. Each call adds a single + association to the target mapping structure. Use `auto-map-elements` + to create many at once via the MappingAgent. Reject duplicates: if + the (from, to, type) tuple already exists, the call returns 409. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeAssociationResponse | OperationError """ return sync_detailed( @@ -190,10 +212,13 @@ async def asyncio_detailed( client: AuthenticatedClient, body: CreateMappingAssociationOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeAssociationResponse | OperationError +]: """Create Mapping Association - Link a chart-of-accounts element to a US GAAP reporting concept. + Link a chart-of-accounts element to a US GAAP reporting concept. One mapping edge per call — use + `auto-map-elements` for bulk AI-assisted mapping. Duplicate (from, to, type) tuples return 409. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -201,18 +226,19 @@ async def asyncio_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (CreateMappingAssociationOperation): CQRS-shaped body for `POST /operations/create- - mapping-association`. + body (CreateMappingAssociationOperation): Create one CoA → reporting-concept mapping edge. - Bundles the target mapping structure's `mapping_id` with the association - payload so REST + MCP share a single body type via the registrar. + This is the iterative, AI-assisted craft path. Each call adds a single + association to the target mapping structure. Use `auto-map-elements` + to create many at once via the MappingAgent. Reject duplicates: if + the (from, to, type) tuple already exists, the call returns 409. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeAssociationResponse | OperationError] """ kwargs = _get_kwargs( @@ -232,10 +258,17 @@ async def asyncio( client: AuthenticatedClient, body: CreateMappingAssociationOperation, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeAssociationResponse + | OperationError + | None +): """Create Mapping Association - Link a chart-of-accounts element to a US GAAP reporting concept. + Link a chart-of-accounts element to a US GAAP reporting concept. One mapping edge per call — use + `auto-map-elements` for bulk AI-assisted mapping. Duplicate (from, to, type) tuples return 409. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -243,18 +276,19 @@ async def asyncio( Args: graph_id (str): idempotency_key (None | str | Unset): - body (CreateMappingAssociationOperation): CQRS-shaped body for `POST /operations/create- - mapping-association`. + body (CreateMappingAssociationOperation): Create one CoA → reporting-concept mapping edge. - Bundles the target mapping structure's `mapping_id` with the association - payload so REST + MCP share a single body type via the registrar. + This is the iterative, AI-assisted craft path. Each call adds a single + association to the target mapping structure. Use `auto-map-elements` + to create many at once via the MappingAgent. Reject duplicates: if + the (from, to, type) tuple already exists, the call returns 409. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeAssociationResponse | OperationError """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_create_publish_list.py b/robosystems_client/api/extensions_robo_ledger/op_create_publish_list.py index b0a4753..94af440 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_create_publish_list.py +++ b/robosystems_client/api/extensions_robo_ledger/op_create_publish_list.py @@ -9,7 +9,9 @@ from ...models.create_publish_list_request import CreatePublishListRequest from ...models.error_response import ErrorResponse from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_publish_list_response import ( + OperationEnvelopePublishListResponse, +) from ...types import UNSET, Response, Unset @@ -40,9 +42,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopePublishListResponse | None: if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopePublishListResponse.from_dict(response.json()) return response_200 @@ -94,7 +96,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ + ErrorResponse | HTTPValidationError | OperationEnvelopePublishListResponse +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -109,10 +113,13 @@ def sync_detailed( client: AuthenticatedClient, body: CreatePublishListRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ + ErrorResponse | HTTPValidationError | OperationEnvelopePublishListResponse +]: """Create Publish List - + Create a publish list (a saved set of recipient graphs). Members are managed separately via + add/remove-member operations. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -120,14 +127,16 @@ def sync_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (CreatePublishListRequest): + body (CreatePublishListRequest): Create a new publish list. Members are added separately + via + `add-publish-list-members`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopePublishListResponse] """ kwargs = _get_kwargs( @@ -149,10 +158,11 @@ def sync( client: AuthenticatedClient, body: CreatePublishListRequest, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopePublishListResponse | None: """Create Publish List - + Create a publish list (a saved set of recipient graphs). Members are managed separately via + add/remove-member operations. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -160,14 +170,16 @@ def sync( Args: graph_id (str): idempotency_key (None | str | Unset): - body (CreatePublishListRequest): + body (CreatePublishListRequest): Create a new publish list. Members are added separately + via + `add-publish-list-members`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopePublishListResponse """ return sync_detailed( @@ -184,10 +196,13 @@ async def asyncio_detailed( client: AuthenticatedClient, body: CreatePublishListRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ + ErrorResponse | HTTPValidationError | OperationEnvelopePublishListResponse +]: """Create Publish List - + Create a publish list (a saved set of recipient graphs). Members are managed separately via + add/remove-member operations. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -195,14 +210,16 @@ async def asyncio_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (CreatePublishListRequest): + body (CreatePublishListRequest): Create a new publish list. Members are added separately + via + `add-publish-list-members`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopePublishListResponse] """ kwargs = _get_kwargs( @@ -222,10 +239,11 @@ async def asyncio( client: AuthenticatedClient, body: CreatePublishListRequest, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopePublishListResponse | None: """Create Publish List - + Create a publish list (a saved set of recipient graphs). Members are managed separately via + add/remove-member operations. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -233,14 +251,16 @@ async def asyncio( Args: graph_id (str): idempotency_key (None | str | Unset): - body (CreatePublishListRequest): + body (CreatePublishListRequest): Create a new publish list. Members are added separately + via + `add-publish-list-members`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopePublishListResponse """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_create_report.py b/robosystems_client/api/extensions_robo_ledger/op_create_report.py index a7b166d..30cadf5 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_create_report.py +++ b/robosystems_client/api/extensions_robo_ledger/op_create_report.py @@ -9,7 +9,7 @@ from ...models.create_report_request import CreateReportRequest from ...models.error_response import ErrorResponse from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_report_response import OperationEnvelopeReportResponse from ...types import UNSET, Response, Unset @@ -40,9 +40,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse | None: if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeReportResponse.from_dict(response.json()) return response_200 @@ -94,7 +94,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -109,7 +109,7 @@ def sync_detailed( client: AuthenticatedClient, body: CreateReportRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse]: """Create Report Generates report facts from the ledger and marks the report as published. @@ -120,14 +120,28 @@ def sync_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (CreateReportRequest): + body (CreateReportRequest): Generate report facts from the ledger and publish a Report + definition. + + The report is materialized synchronously: we resolve the taxonomy + + CoA mapping, roll up GL facts into reportable concepts, attach them + to a fresh ``Report`` row, evaluate any reporting-rule structures + (cell-level checks), and stamp ``generation_status='published'``. + Subsequent ``regenerate-report`` calls re-run the same pipeline against + the latest ledger state without creating a new Report row. + + ``period_start``/``period_end``/``comparative`` is the simple path + (auto-derives current + prior period). For multi-column reports + (YTD-by-quarter, multi-year) supply ``periods`` explicitly — when + set, ``period_start``/``period_end``/``comparative`` are ignored as + inputs to period generation. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse] """ kwargs = _get_kwargs( @@ -149,7 +163,7 @@ def sync( client: AuthenticatedClient, body: CreateReportRequest, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse | None: """Create Report Generates report facts from the ledger and marks the report as published. @@ -160,14 +174,28 @@ def sync( Args: graph_id (str): idempotency_key (None | str | Unset): - body (CreateReportRequest): + body (CreateReportRequest): Generate report facts from the ledger and publish a Report + definition. + + The report is materialized synchronously: we resolve the taxonomy + + CoA mapping, roll up GL facts into reportable concepts, attach them + to a fresh ``Report`` row, evaluate any reporting-rule structures + (cell-level checks), and stamp ``generation_status='published'``. + Subsequent ``regenerate-report`` calls re-run the same pipeline against + the latest ledger state without creating a new Report row. + + ``period_start``/``period_end``/``comparative`` is the simple path + (auto-derives current + prior period). For multi-column reports + (YTD-by-quarter, multi-year) supply ``periods`` explicitly — when + set, ``period_start``/``period_end``/``comparative`` are ignored as + inputs to period generation. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse """ return sync_detailed( @@ -184,7 +212,7 @@ async def asyncio_detailed( client: AuthenticatedClient, body: CreateReportRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse]: """Create Report Generates report facts from the ledger and marks the report as published. @@ -195,14 +223,28 @@ async def asyncio_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (CreateReportRequest): + body (CreateReportRequest): Generate report facts from the ledger and publish a Report + definition. + + The report is materialized synchronously: we resolve the taxonomy + + CoA mapping, roll up GL facts into reportable concepts, attach them + to a fresh ``Report`` row, evaluate any reporting-rule structures + (cell-level checks), and stamp ``generation_status='published'``. + Subsequent ``regenerate-report`` calls re-run the same pipeline against + the latest ledger state without creating a new Report row. + + ``period_start``/``period_end``/``comparative`` is the simple path + (auto-derives current + prior period). For multi-column reports + (YTD-by-quarter, multi-year) supply ``periods`` explicitly — when + set, ``period_start``/``period_end``/``comparative`` are ignored as + inputs to period generation. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse] """ kwargs = _get_kwargs( @@ -222,7 +264,7 @@ async def asyncio( client: AuthenticatedClient, body: CreateReportRequest, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse | None: """Create Report Generates report facts from the ledger and marks the report as published. @@ -233,14 +275,28 @@ async def asyncio( Args: graph_id (str): idempotency_key (None | str | Unset): - body (CreateReportRequest): + body (CreateReportRequest): Generate report facts from the ledger and publish a Report + definition. + + The report is materialized synchronously: we resolve the taxonomy + + CoA mapping, roll up GL facts into reportable concepts, attach them + to a fresh ``Report`` row, evaluate any reporting-rule structures + (cell-level checks), and stamp ``generation_status='published'``. + Subsequent ``regenerate-report`` calls re-run the same pipeline against + the latest ledger state without creating a new Report row. + + ``period_start``/``period_end``/``comparative`` is the simple path + (auto-derives current + prior period). For multi-column reports + (YTD-by-quarter, multi-year) supply ``periods`` explicitly — when + set, ``period_start``/``period_end``/``comparative`` are ignored as + inputs to period generation. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_create_taxonomy_block.py b/robosystems_client/api/extensions_robo_ledger/op_create_taxonomy_block.py index bf2899a..c062e99 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_create_taxonomy_block.py +++ b/robosystems_client/api/extensions_robo_ledger/op_create_taxonomy_block.py @@ -8,7 +8,9 @@ from ...client import AuthenticatedClient, Client from ...models.create_taxonomy_block_request import CreateTaxonomyBlockRequest from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_taxonomy_block_envelope import ( + OperationEnvelopeTaxonomyBlockEnvelope, +) from ...models.operation_error import OperationError from ...types import UNSET, Response, Unset @@ -40,9 +42,15 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeTaxonomyBlockEnvelope + | OperationError + | None +): if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeTaxonomyBlockEnvelope.from_dict(response.json()) return response_200 @@ -90,7 +98,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeTaxonomyBlockEnvelope | OperationError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -105,7 +115,9 @@ def sync_detailed( client: AuthenticatedClient, body: CreateTaxonomyBlockRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeTaxonomyBlockEnvelope | OperationError +]: """Create Taxonomy Block Create a taxonomy block atomically: one envelope carrying the taxonomy row plus its structures, @@ -136,7 +148,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeTaxonomyBlockEnvelope | OperationError] """ kwargs = _get_kwargs( @@ -158,7 +170,13 @@ def sync( client: AuthenticatedClient, body: CreateTaxonomyBlockRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeTaxonomyBlockEnvelope + | OperationError + | None +): """Create Taxonomy Block Create a taxonomy block atomically: one envelope carrying the taxonomy row plus its structures, @@ -189,7 +207,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeTaxonomyBlockEnvelope | OperationError """ return sync_detailed( @@ -206,7 +224,9 @@ async def asyncio_detailed( client: AuthenticatedClient, body: CreateTaxonomyBlockRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeTaxonomyBlockEnvelope | OperationError +]: """Create Taxonomy Block Create a taxonomy block atomically: one envelope carrying the taxonomy row plus its structures, @@ -237,7 +257,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeTaxonomyBlockEnvelope | OperationError] """ kwargs = _get_kwargs( @@ -257,7 +277,13 @@ async def asyncio( client: AuthenticatedClient, body: CreateTaxonomyBlockRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeTaxonomyBlockEnvelope + | OperationError + | None +): """Create Taxonomy Block Create a taxonomy block atomically: one envelope carrying the taxonomy row plus its structures, @@ -288,7 +314,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeTaxonomyBlockEnvelope | OperationError """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_delete_journal_entry.py b/robosystems_client/api/extensions_robo_ledger/op_delete_journal_entry.py index df8be21..6f4d3cc 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_delete_journal_entry.py +++ b/robosystems_client/api/extensions_robo_ledger/op_delete_journal_entry.py @@ -8,7 +8,7 @@ from ...client import AuthenticatedClient, Client from ...models.delete_journal_entry_request import DeleteJournalEntryRequest from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_delete_result import OperationEnvelopeDeleteResult from ...models.operation_error import OperationError from ...types import UNSET, Response, Unset @@ -40,9 +40,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> Any | HTTPValidationError | OperationEnvelopeDeleteResult | OperationError | None: if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeDeleteResult.from_dict(response.json()) return response_200 @@ -90,7 +90,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeDeleteResult | OperationError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -105,7 +107,9 @@ def sync_detailed( client: AuthenticatedClient, body: DeleteJournalEntryRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeDeleteResult | OperationError +]: """Delete Journal Entry Hard-delete a draft journal entry. Posted entries are immutable and must be reversed instead. @@ -125,7 +129,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeDeleteResult | OperationError] """ kwargs = _get_kwargs( @@ -147,7 +151,7 @@ def sync( client: AuthenticatedClient, body: DeleteJournalEntryRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> Any | HTTPValidationError | OperationEnvelopeDeleteResult | OperationError | None: """Delete Journal Entry Hard-delete a draft journal entry. Posted entries are immutable and must be reversed instead. @@ -167,7 +171,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeDeleteResult | OperationError """ return sync_detailed( @@ -184,7 +188,9 @@ async def asyncio_detailed( client: AuthenticatedClient, body: DeleteJournalEntryRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeDeleteResult | OperationError +]: """Delete Journal Entry Hard-delete a draft journal entry. Posted entries are immutable and must be reversed instead. @@ -204,7 +210,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeDeleteResult | OperationError] """ kwargs = _get_kwargs( @@ -224,7 +230,7 @@ async def asyncio( client: AuthenticatedClient, body: DeleteJournalEntryRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> Any | HTTPValidationError | OperationEnvelopeDeleteResult | OperationError | None: """Delete Journal Entry Hard-delete a draft journal entry. Posted entries are immutable and must be reversed instead. @@ -244,7 +250,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeDeleteResult | OperationError """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_delete_mapping_association.py b/robosystems_client/api/extensions_robo_ledger/op_delete_mapping_association.py index c5fac48..50010ec 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_delete_mapping_association.py +++ b/robosystems_client/api/extensions_robo_ledger/op_delete_mapping_association.py @@ -11,7 +11,7 @@ ) from ...models.error_response import ErrorResponse from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_delete_result import OperationEnvelopeDeleteResult from ...types import UNSET, Response, Unset @@ -42,9 +42,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult | None: if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeDeleteResult.from_dict(response.json()) return response_200 @@ -96,7 +96,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -111,10 +111,11 @@ def sync_detailed( client: AuthenticatedClient, body: DeleteMappingAssociationOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult]: """Delete Mapping Association - + Remove a single CoA → reporting-concept mapping edge. The mapping structure itself remains; only the + association row is dropped. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -122,14 +123,15 @@ def sync_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (DeleteMappingAssociationOperation): + body (DeleteMappingAssociationOperation): Delete a single CoA → reporting-concept mapping + edge. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult] """ kwargs = _get_kwargs( @@ -151,10 +153,11 @@ def sync( client: AuthenticatedClient, body: DeleteMappingAssociationOperation, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult | None: """Delete Mapping Association - + Remove a single CoA → reporting-concept mapping edge. The mapping structure itself remains; only the + association row is dropped. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -162,14 +165,15 @@ def sync( Args: graph_id (str): idempotency_key (None | str | Unset): - body (DeleteMappingAssociationOperation): + body (DeleteMappingAssociationOperation): Delete a single CoA → reporting-concept mapping + edge. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult """ return sync_detailed( @@ -186,10 +190,11 @@ async def asyncio_detailed( client: AuthenticatedClient, body: DeleteMappingAssociationOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult]: """Delete Mapping Association - + Remove a single CoA → reporting-concept mapping edge. The mapping structure itself remains; only the + association row is dropped. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -197,14 +202,15 @@ async def asyncio_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (DeleteMappingAssociationOperation): + body (DeleteMappingAssociationOperation): Delete a single CoA → reporting-concept mapping + edge. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult] """ kwargs = _get_kwargs( @@ -224,10 +230,11 @@ async def asyncio( client: AuthenticatedClient, body: DeleteMappingAssociationOperation, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult | None: """Delete Mapping Association - + Remove a single CoA → reporting-concept mapping edge. The mapping structure itself remains; only the + association row is dropped. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -235,14 +242,15 @@ async def asyncio( Args: graph_id (str): idempotency_key (None | str | Unset): - body (DeleteMappingAssociationOperation): + body (DeleteMappingAssociationOperation): Delete a single CoA → reporting-concept mapping + edge. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_delete_publish_list.py b/robosystems_client/api/extensions_robo_ledger/op_delete_publish_list.py index fd610b9..920a47c 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_delete_publish_list.py +++ b/robosystems_client/api/extensions_robo_ledger/op_delete_publish_list.py @@ -9,7 +9,7 @@ from ...models.delete_publish_list_operation import DeletePublishListOperation from ...models.error_response import ErrorResponse from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_delete_result import OperationEnvelopeDeleteResult from ...types import UNSET, Response, Unset @@ -40,9 +40,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult | None: if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeDeleteResult.from_dict(response.json()) return response_200 @@ -94,7 +94,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -109,10 +109,11 @@ def sync_detailed( client: AuthenticatedClient, body: DeletePublishListOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult]: """Delete Publish List - + Delete a publish list and its membership rows. Reports previously shared via this list are not + affected — each share is an independent copy in the recipient's graph. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -120,14 +121,17 @@ def sync_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (DeletePublishListOperation): + body (DeletePublishListOperation): Delete a publish list. All membership rows are removed; + reports + previously shared via this list are not affected (each share is an + independent copy in the recipient's graph). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult] """ kwargs = _get_kwargs( @@ -149,10 +153,11 @@ def sync( client: AuthenticatedClient, body: DeletePublishListOperation, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult | None: """Delete Publish List - + Delete a publish list and its membership rows. Reports previously shared via this list are not + affected — each share is an independent copy in the recipient's graph. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -160,14 +165,17 @@ def sync( Args: graph_id (str): idempotency_key (None | str | Unset): - body (DeletePublishListOperation): + body (DeletePublishListOperation): Delete a publish list. All membership rows are removed; + reports + previously shared via this list are not affected (each share is an + independent copy in the recipient's graph). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult """ return sync_detailed( @@ -184,10 +192,11 @@ async def asyncio_detailed( client: AuthenticatedClient, body: DeletePublishListOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult]: """Delete Publish List - + Delete a publish list and its membership rows. Reports previously shared via this list are not + affected — each share is an independent copy in the recipient's graph. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -195,14 +204,17 @@ async def asyncio_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (DeletePublishListOperation): + body (DeletePublishListOperation): Delete a publish list. All membership rows are removed; + reports + previously shared via this list are not affected (each share is an + independent copy in the recipient's graph). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult] """ kwargs = _get_kwargs( @@ -222,10 +234,11 @@ async def asyncio( client: AuthenticatedClient, body: DeletePublishListOperation, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult | None: """Delete Publish List - + Delete a publish list and its membership rows. Reports previously shared via this list are not + affected — each share is an independent copy in the recipient's graph. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -233,14 +246,17 @@ async def asyncio( Args: graph_id (str): idempotency_key (None | str | Unset): - body (DeletePublishListOperation): + body (DeletePublishListOperation): Delete a publish list. All membership rows are removed; + reports + previously shared via this list are not affected (each share is an + independent copy in the recipient's graph). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_delete_report.py b/robosystems_client/api/extensions_robo_ledger/op_delete_report.py index 0f412f3..8b57cc5 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_delete_report.py +++ b/robosystems_client/api/extensions_robo_ledger/op_delete_report.py @@ -9,7 +9,7 @@ from ...models.delete_report_operation import DeleteReportOperation from ...models.error_response import ErrorResponse from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_delete_result import OperationEnvelopeDeleteResult from ...types import UNSET, Response, Unset @@ -40,9 +40,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult | None: if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeDeleteResult.from_dict(response.json()) return response_200 @@ -94,7 +94,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -109,7 +109,7 @@ def sync_detailed( client: AuthenticatedClient, body: DeleteReportOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult]: """Delete Report Deletes the report definition and all generated facts. @@ -120,14 +120,14 @@ def sync_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (DeleteReportOperation): + body (DeleteReportOperation): Delete a Report definition and all its facts. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult] """ kwargs = _get_kwargs( @@ -149,7 +149,7 @@ def sync( client: AuthenticatedClient, body: DeleteReportOperation, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult | None: """Delete Report Deletes the report definition and all generated facts. @@ -160,14 +160,14 @@ def sync( Args: graph_id (str): idempotency_key (None | str | Unset): - body (DeleteReportOperation): + body (DeleteReportOperation): Delete a Report definition and all its facts. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult """ return sync_detailed( @@ -184,7 +184,7 @@ async def asyncio_detailed( client: AuthenticatedClient, body: DeleteReportOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult]: """Delete Report Deletes the report definition and all generated facts. @@ -195,14 +195,14 @@ async def asyncio_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (DeleteReportOperation): + body (DeleteReportOperation): Delete a Report definition and all its facts. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult] """ kwargs = _get_kwargs( @@ -222,7 +222,7 @@ async def asyncio( client: AuthenticatedClient, body: DeleteReportOperation, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult | None: """Delete Report Deletes the report definition and all generated facts. @@ -233,14 +233,14 @@ async def asyncio( Args: graph_id (str): idempotency_key (None | str | Unset): - body (DeleteReportOperation): + body (DeleteReportOperation): Delete a Report definition and all its facts. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_delete_taxonomy_block.py b/robosystems_client/api/extensions_robo_ledger/op_delete_taxonomy_block.py index 1e39b7a..6ef3acd 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_delete_taxonomy_block.py +++ b/robosystems_client/api/extensions_robo_ledger/op_delete_taxonomy_block.py @@ -8,7 +8,9 @@ from ...client import AuthenticatedClient, Client from ...models.delete_taxonomy_block_request import DeleteTaxonomyBlockRequest from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_delete_taxonomy_block_response import ( + OperationEnvelopeDeleteTaxonomyBlockResponse, +) from ...models.operation_error import OperationError from ...types import UNSET, Response, Unset @@ -40,9 +42,17 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeDeleteTaxonomyBlockResponse + | OperationError + | None +): if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeDeleteTaxonomyBlockResponse.from_dict( + response.json() + ) return response_200 @@ -90,7 +100,12 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any + | HTTPValidationError + | OperationEnvelopeDeleteTaxonomyBlockResponse + | OperationError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -105,7 +120,12 @@ def sync_detailed( client: AuthenticatedClient, body: DeleteTaxonomyBlockRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any + | HTTPValidationError + | OperationEnvelopeDeleteTaxonomyBlockResponse + | OperationError +]: """Delete Taxonomy Block Delete a taxonomy block and return a thin confirmation. `cascade_facts=True` also deletes Fact rows @@ -131,7 +151,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeDeleteTaxonomyBlockResponse | OperationError] """ kwargs = _get_kwargs( @@ -153,7 +173,13 @@ def sync( client: AuthenticatedClient, body: DeleteTaxonomyBlockRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeDeleteTaxonomyBlockResponse + | OperationError + | None +): """Delete Taxonomy Block Delete a taxonomy block and return a thin confirmation. `cascade_facts=True` also deletes Fact rows @@ -179,7 +205,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeDeleteTaxonomyBlockResponse | OperationError """ return sync_detailed( @@ -196,7 +222,12 @@ async def asyncio_detailed( client: AuthenticatedClient, body: DeleteTaxonomyBlockRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any + | HTTPValidationError + | OperationEnvelopeDeleteTaxonomyBlockResponse + | OperationError +]: """Delete Taxonomy Block Delete a taxonomy block and return a thin confirmation. `cascade_facts=True` also deletes Fact rows @@ -222,7 +253,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeDeleteTaxonomyBlockResponse | OperationError] """ kwargs = _get_kwargs( @@ -242,7 +273,13 @@ async def asyncio( client: AuthenticatedClient, body: DeleteTaxonomyBlockRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeDeleteTaxonomyBlockResponse + | OperationError + | None +): """Delete Taxonomy Block Delete a taxonomy block and return a thin confirmation. `cascade_facts=True` also deletes Fact rows @@ -268,7 +305,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeDeleteTaxonomyBlockResponse | OperationError """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_evaluate_rules.py b/robosystems_client/api/extensions_robo_ledger/op_evaluate_rules.py index 93715f4..0f18492 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_evaluate_rules.py +++ b/robosystems_client/api/extensions_robo_ledger/op_evaluate_rules.py @@ -8,7 +8,9 @@ from ...client import AuthenticatedClient, Client from ...models.evaluate_rules_request import EvaluateRulesRequest from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_evaluate_rules_response import ( + OperationEnvelopeEvaluateRulesResponse, +) from ...models.operation_error import OperationError from ...types import UNSET, Response, Unset @@ -40,9 +42,15 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeEvaluateRulesResponse + | OperationError + | None +): if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeEvaluateRulesResponse.from_dict(response.json()) return response_200 @@ -90,7 +98,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeEvaluateRulesResponse | OperationError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -105,7 +115,9 @@ def sync_detailed( client: AuthenticatedClient, body: EvaluateRulesRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeEvaluateRulesResponse | OperationError +]: """Evaluate Rules for an Information Block Runs every rule targeting the given structure (plus element- and association-scoped rules for the @@ -135,7 +147,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeEvaluateRulesResponse | OperationError] """ kwargs = _get_kwargs( @@ -157,7 +169,13 @@ def sync( client: AuthenticatedClient, body: EvaluateRulesRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeEvaluateRulesResponse + | OperationError + | None +): """Evaluate Rules for an Information Block Runs every rule targeting the given structure (plus element- and association-scoped rules for the @@ -187,7 +205,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeEvaluateRulesResponse | OperationError """ return sync_detailed( @@ -204,7 +222,9 @@ async def asyncio_detailed( client: AuthenticatedClient, body: EvaluateRulesRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeEvaluateRulesResponse | OperationError +]: """Evaluate Rules for an Information Block Runs every rule targeting the given structure (plus element- and association-scoped rules for the @@ -234,7 +254,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeEvaluateRulesResponse | OperationError] """ kwargs = _get_kwargs( @@ -254,7 +274,13 @@ async def asyncio( client: AuthenticatedClient, body: EvaluateRulesRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeEvaluateRulesResponse + | OperationError + | None +): """Evaluate Rules for an Information Block Runs every rule targeting the given structure (plus element- and association-scoped rules for the @@ -284,7 +310,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeEvaluateRulesResponse | OperationError """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_file_report.py b/robosystems_client/api/extensions_robo_ledger/op_file_report.py index 2eafb29..2f21449 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_file_report.py +++ b/robosystems_client/api/extensions_robo_ledger/op_file_report.py @@ -9,7 +9,7 @@ from ...models.error_response import ErrorResponse from ...models.file_report_request import FileReportRequest from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_report_response import OperationEnvelopeReportResponse from ...types import UNSET, Response, Unset @@ -40,9 +40,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse | None: if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeReportResponse.from_dict(response.json()) return response_200 @@ -94,7 +94,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -109,7 +109,7 @@ def sync_detailed( client: AuthenticatedClient, body: FileReportRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse]: """File Report Transitions the Report's filing_status to 'filed' — locks the package. Allowed from 'draft' or @@ -127,13 +127,15 @@ def sync_detailed( ``filed_at`` are stamped from the auth context + server clock; the request itself carries no fields today (kept as a model for OpenAPI shape consistency and to avoid breaking changes if we add fields). + Use ``transition-filing-status`` for the non-file legs of the + lifecycle (`draft ↔ under_review`, `filed → archived`). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse] """ kwargs = _get_kwargs( @@ -155,7 +157,7 @@ def sync( client: AuthenticatedClient, body: FileReportRequest, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse | None: """File Report Transitions the Report's filing_status to 'filed' — locks the package. Allowed from 'draft' or @@ -173,13 +175,15 @@ def sync( ``filed_at`` are stamped from the auth context + server clock; the request itself carries no fields today (kept as a model for OpenAPI shape consistency and to avoid breaking changes if we add fields). + Use ``transition-filing-status`` for the non-file legs of the + lifecycle (`draft ↔ under_review`, `filed → archived`). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse """ return sync_detailed( @@ -196,7 +200,7 @@ async def asyncio_detailed( client: AuthenticatedClient, body: FileReportRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse]: """File Report Transitions the Report's filing_status to 'filed' — locks the package. Allowed from 'draft' or @@ -214,13 +218,15 @@ async def asyncio_detailed( ``filed_at`` are stamped from the auth context + server clock; the request itself carries no fields today (kept as a model for OpenAPI shape consistency and to avoid breaking changes if we add fields). + Use ``transition-filing-status`` for the non-file legs of the + lifecycle (`draft ↔ under_review`, `filed → archived`). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse] """ kwargs = _get_kwargs( @@ -240,7 +246,7 @@ async def asyncio( client: AuthenticatedClient, body: FileReportRequest, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse | None: """File Report Transitions the Report's filing_status to 'filed' — locks the package. Allowed from 'draft' or @@ -258,13 +264,15 @@ async def asyncio( ``filed_at`` are stamped from the auth context + server clock; the request itself carries no fields today (kept as a model for OpenAPI shape consistency and to avoid breaking changes if we add fields). + Use ``transition-filing-status`` for the non-file legs of the + lifecycle (`draft ↔ under_review`, `filed → archived`). Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_initialize_ledger.py b/robosystems_client/api/extensions_robo_ledger/op_initialize_ledger.py index 46f3811..3efd981 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_initialize_ledger.py +++ b/robosystems_client/api/extensions_robo_ledger/op_initialize_ledger.py @@ -9,7 +9,9 @@ from ...models.error_response import ErrorResponse from ...models.http_validation_error import HTTPValidationError from ...models.initialize_ledger_request import InitializeLedgerRequest -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_initialize_ledger_response import ( + OperationEnvelopeInitializeLedgerResponse, +) from ...types import UNSET, Response, Unset @@ -40,9 +42,11 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ( + ErrorResponse | HTTPValidationError | OperationEnvelopeInitializeLedgerResponse | None +): if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeInitializeLedgerResponse.from_dict(response.json()) return response_200 @@ -94,7 +98,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ + ErrorResponse | HTTPValidationError | OperationEnvelopeInitializeLedgerResponse +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -109,7 +115,9 @@ def sync_detailed( client: AuthenticatedClient, body: InitializeLedgerRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ + ErrorResponse | HTTPValidationError | OperationEnvelopeInitializeLedgerResponse +]: """Initialize Ledger One-time setup: creates the fiscal calendar and seeds periods. Returns 409 if already initialized. @@ -120,14 +128,27 @@ def sync_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (InitializeLedgerRequest): + body (InitializeLedgerRequest): One-time setup for a graph's fiscal calendar. + + Creates the `FiscalCalendar` row, seeds `FiscalPeriod` rows from + ``earliest_data_period`` (or 24 months ago) through the current month, + and stamps periods on or before ``closed_through`` as already closed. + Subsequent calls return 409 — there's no re-initialize. + + The two pointers it sets up: + + - ``closed_through`` (system-maintained): the latest period whose + books are locked. Set on init for businesses with prior close + history; null for a fresh start. + - ``close_target`` (user-controlled): the goal date the user is + closing toward. Set independently via `set-close-target`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopeInitializeLedgerResponse] """ kwargs = _get_kwargs( @@ -149,7 +170,9 @@ def sync( client: AuthenticatedClient, body: InitializeLedgerRequest, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ( + ErrorResponse | HTTPValidationError | OperationEnvelopeInitializeLedgerResponse | None +): """Initialize Ledger One-time setup: creates the fiscal calendar and seeds periods. Returns 409 if already initialized. @@ -160,14 +183,27 @@ def sync( Args: graph_id (str): idempotency_key (None | str | Unset): - body (InitializeLedgerRequest): + body (InitializeLedgerRequest): One-time setup for a graph's fiscal calendar. + + Creates the `FiscalCalendar` row, seeds `FiscalPeriod` rows from + ``earliest_data_period`` (or 24 months ago) through the current month, + and stamps periods on or before ``closed_through`` as already closed. + Subsequent calls return 409 — there's no re-initialize. + + The two pointers it sets up: + + - ``closed_through`` (system-maintained): the latest period whose + books are locked. Set on init for businesses with prior close + history; null for a fresh start. + - ``close_target`` (user-controlled): the goal date the user is + closing toward. Set independently via `set-close-target`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopeInitializeLedgerResponse """ return sync_detailed( @@ -184,7 +220,9 @@ async def asyncio_detailed( client: AuthenticatedClient, body: InitializeLedgerRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ + ErrorResponse | HTTPValidationError | OperationEnvelopeInitializeLedgerResponse +]: """Initialize Ledger One-time setup: creates the fiscal calendar and seeds periods. Returns 409 if already initialized. @@ -195,14 +233,27 @@ async def asyncio_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (InitializeLedgerRequest): + body (InitializeLedgerRequest): One-time setup for a graph's fiscal calendar. + + Creates the `FiscalCalendar` row, seeds `FiscalPeriod` rows from + ``earliest_data_period`` (or 24 months ago) through the current month, + and stamps periods on or before ``closed_through`` as already closed. + Subsequent calls return 409 — there's no re-initialize. + + The two pointers it sets up: + + - ``closed_through`` (system-maintained): the latest period whose + books are locked. Set on init for businesses with prior close + history; null for a fresh start. + - ``close_target`` (user-controlled): the goal date the user is + closing toward. Set independently via `set-close-target`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopeInitializeLedgerResponse] """ kwargs = _get_kwargs( @@ -222,7 +273,9 @@ async def asyncio( client: AuthenticatedClient, body: InitializeLedgerRequest, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ( + ErrorResponse | HTTPValidationError | OperationEnvelopeInitializeLedgerResponse | None +): """Initialize Ledger One-time setup: creates the fiscal calendar and seeds periods. Returns 409 if already initialized. @@ -233,14 +286,27 @@ async def asyncio( Args: graph_id (str): idempotency_key (None | str | Unset): - body (InitializeLedgerRequest): + body (InitializeLedgerRequest): One-time setup for a graph's fiscal calendar. + + Creates the `FiscalCalendar` row, seeds `FiscalPeriod` rows from + ``earliest_data_period`` (or 24 months ago) through the current month, + and stamps periods on or before ``closed_through`` as already closed. + Subsequent calls return 409 — there's no re-initialize. + + The two pointers it sets up: + + - ``closed_through`` (system-maintained): the latest period whose + books are locked. Set on init for businesses with prior close + history; null for a fresh start. + - ``close_target`` (user-controlled): the goal date the user is + closing toward. Set independently via `set-close-target`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopeInitializeLedgerResponse """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_link_entity_taxonomy.py b/robosystems_client/api/extensions_robo_ledger/op_link_entity_taxonomy.py index 5265756..aa32431 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_link_entity_taxonomy.py +++ b/robosystems_client/api/extensions_robo_ledger/op_link_entity_taxonomy.py @@ -8,7 +8,9 @@ from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError from ...models.link_entity_taxonomy_request import LinkEntityTaxonomyRequest -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_entity_taxonomy_response import ( + OperationEnvelopeEntityTaxonomyResponse, +) from ...models.operation_error import OperationError from ...types import UNSET, Response, Unset @@ -40,9 +42,15 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeEntityTaxonomyResponse + | OperationError + | None +): if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeEntityTaxonomyResponse.from_dict(response.json()) return response_200 @@ -90,7 +98,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeEntityTaxonomyResponse | OperationError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -105,7 +115,9 @@ def sync_detailed( client: AuthenticatedClient, body: LinkEntityTaxonomyRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeEntityTaxonomyResponse | OperationError +]: """Link Entity to Taxonomy Link the graph's entity to a taxonomy. Idempotent — returns existing linkage if it already exists. @@ -122,15 +134,20 @@ def sync_detailed( ENTITY_HAS_TAXONOMY edge). This is how a graph declares "this entity reports under this taxonomy." - For chart_of_accounts taxonomies, this tells the platform which CoA the - entity uses. For reporting taxonomies, which standard (us-gaap, ifrs). + For ``chart_of_accounts`` taxonomies, this tells the platform which CoA + the entity uses. For reporting taxonomies, which standard (us-gaap, + ifrs). Idempotent — re-linking returns the existing edge unchanged. + + CoA blocks auto-link at create time; use this to switch the primary + CoA, link a reporting extension, or attach a custom ontology + explicitly. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeEntityTaxonomyResponse | OperationError] """ kwargs = _get_kwargs( @@ -152,7 +169,13 @@ def sync( client: AuthenticatedClient, body: LinkEntityTaxonomyRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeEntityTaxonomyResponse + | OperationError + | None +): """Link Entity to Taxonomy Link the graph's entity to a taxonomy. Idempotent — returns existing linkage if it already exists. @@ -169,15 +192,20 @@ def sync( ENTITY_HAS_TAXONOMY edge). This is how a graph declares "this entity reports under this taxonomy." - For chart_of_accounts taxonomies, this tells the platform which CoA the - entity uses. For reporting taxonomies, which standard (us-gaap, ifrs). + For ``chart_of_accounts`` taxonomies, this tells the platform which CoA + the entity uses. For reporting taxonomies, which standard (us-gaap, + ifrs). Idempotent — re-linking returns the existing edge unchanged. + + CoA blocks auto-link at create time; use this to switch the primary + CoA, link a reporting extension, or attach a custom ontology + explicitly. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeEntityTaxonomyResponse | OperationError """ return sync_detailed( @@ -194,7 +222,9 @@ async def asyncio_detailed( client: AuthenticatedClient, body: LinkEntityTaxonomyRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeEntityTaxonomyResponse | OperationError +]: """Link Entity to Taxonomy Link the graph's entity to a taxonomy. Idempotent — returns existing linkage if it already exists. @@ -211,15 +241,20 @@ async def asyncio_detailed( ENTITY_HAS_TAXONOMY edge). This is how a graph declares "this entity reports under this taxonomy." - For chart_of_accounts taxonomies, this tells the platform which CoA the - entity uses. For reporting taxonomies, which standard (us-gaap, ifrs). + For ``chart_of_accounts`` taxonomies, this tells the platform which CoA + the entity uses. For reporting taxonomies, which standard (us-gaap, + ifrs). Idempotent — re-linking returns the existing edge unchanged. + + CoA blocks auto-link at create time; use this to switch the primary + CoA, link a reporting extension, or attach a custom ontology + explicitly. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeEntityTaxonomyResponse | OperationError] """ kwargs = _get_kwargs( @@ -239,7 +274,13 @@ async def asyncio( client: AuthenticatedClient, body: LinkEntityTaxonomyRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeEntityTaxonomyResponse + | OperationError + | None +): """Link Entity to Taxonomy Link the graph's entity to a taxonomy. Idempotent — returns existing linkage if it already exists. @@ -256,15 +297,20 @@ async def asyncio( ENTITY_HAS_TAXONOMY edge). This is how a graph declares "this entity reports under this taxonomy." - For chart_of_accounts taxonomies, this tells the platform which CoA the - entity uses. For reporting taxonomies, which standard (us-gaap, ifrs). + For ``chart_of_accounts`` taxonomies, this tells the platform which CoA + the entity uses. For reporting taxonomies, which standard (us-gaap, + ifrs). Idempotent — re-linking returns the existing edge unchanged. + + CoA blocks auto-link at create time; use this to switch the primary + CoA, link a reporting extension, or attach a custom ontology + explicitly. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeEntityTaxonomyResponse | OperationError """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_preview_event_block.py b/robosystems_client/api/extensions_robo_ledger/op_preview_event_block.py index 2612252..d38365e 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_preview_event_block.py +++ b/robosystems_client/api/extensions_robo_ledger/op_preview_event_block.py @@ -8,7 +8,9 @@ from ...client import AuthenticatedClient, Client from ...models.create_event_block_request import CreateEventBlockRequest from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_preview_event_block_response import ( + OperationEnvelopePreviewEventBlockResponse, +) from ...models.operation_error import OperationError from ...types import UNSET, Response, Unset @@ -40,9 +42,15 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopePreviewEventBlockResponse + | OperationError + | None +): if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopePreviewEventBlockResponse.from_dict(response.json()) return response_200 @@ -90,7 +98,12 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any + | HTTPValidationError + | OperationEnvelopePreviewEventBlockResponse + | OperationError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -105,7 +118,12 @@ def sync_detailed( client: AuthenticatedClient, body: CreateEventBlockRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any + | HTTPValidationError + | OperationEnvelopePreviewEventBlockResponse + | OperationError +]: """Preview Event Block Dry-run: resolve the matching handler and evaluate the transaction template without writing any @@ -125,7 +143,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopePreviewEventBlockResponse | OperationError] """ kwargs = _get_kwargs( @@ -147,7 +165,13 @@ def sync( client: AuthenticatedClient, body: CreateEventBlockRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopePreviewEventBlockResponse + | OperationError + | None +): """Preview Event Block Dry-run: resolve the matching handler and evaluate the transaction template without writing any @@ -167,7 +191,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopePreviewEventBlockResponse | OperationError """ return sync_detailed( @@ -184,7 +208,12 @@ async def asyncio_detailed( client: AuthenticatedClient, body: CreateEventBlockRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any + | HTTPValidationError + | OperationEnvelopePreviewEventBlockResponse + | OperationError +]: """Preview Event Block Dry-run: resolve the matching handler and evaluate the transaction template without writing any @@ -204,7 +233,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopePreviewEventBlockResponse | OperationError] """ kwargs = _get_kwargs( @@ -224,7 +253,13 @@ async def asyncio( client: AuthenticatedClient, body: CreateEventBlockRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopePreviewEventBlockResponse + | OperationError + | None +): """Preview Event Block Dry-run: resolve the matching handler and evaluate the transaction template without writing any @@ -244,7 +279,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopePreviewEventBlockResponse | OperationError """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_regenerate_report.py b/robosystems_client/api/extensions_robo_ledger/op_regenerate_report.py index 4af18b3..c801f53 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_regenerate_report.py +++ b/robosystems_client/api/extensions_robo_ledger/op_regenerate_report.py @@ -8,7 +8,7 @@ from ...client import AuthenticatedClient, Client from ...models.error_response import ErrorResponse from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_report_response import OperationEnvelopeReportResponse from ...models.regenerate_report_operation import RegenerateReportOperation from ...types import UNSET, Response, Unset @@ -40,9 +40,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse | None: if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeReportResponse.from_dict(response.json()) return response_200 @@ -94,7 +94,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -109,10 +109,11 @@ def sync_detailed( client: AuthenticatedClient, body: RegenerateReportOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse]: """Regenerate Report - + Re-runs fact generation for an existing Report against the latest ledger state. Pass + `period_start`/`period_end`/`periods` only if you want to change the reporting window. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -120,14 +121,17 @@ def sync_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (RegenerateReportOperation): + body (RegenerateReportOperation): Regenerate facts for an existing Report. Carries + `report_id` from + the path-style RPC body; period overrides are inherited from + :class:`RegenerateReportRequest`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse] """ kwargs = _get_kwargs( @@ -149,10 +153,11 @@ def sync( client: AuthenticatedClient, body: RegenerateReportOperation, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse | None: """Regenerate Report - + Re-runs fact generation for an existing Report against the latest ledger state. Pass + `period_start`/`period_end`/`periods` only if you want to change the reporting window. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -160,14 +165,17 @@ def sync( Args: graph_id (str): idempotency_key (None | str | Unset): - body (RegenerateReportOperation): + body (RegenerateReportOperation): Regenerate facts for an existing Report. Carries + `report_id` from + the path-style RPC body; period overrides are inherited from + :class:`RegenerateReportRequest`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse """ return sync_detailed( @@ -184,10 +192,11 @@ async def asyncio_detailed( client: AuthenticatedClient, body: RegenerateReportOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse]: """Regenerate Report - + Re-runs fact generation for an existing Report against the latest ledger state. Pass + `period_start`/`period_end`/`periods` only if you want to change the reporting window. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -195,14 +204,17 @@ async def asyncio_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (RegenerateReportOperation): + body (RegenerateReportOperation): Regenerate facts for an existing Report. Carries + `report_id` from + the path-style RPC body; period overrides are inherited from + :class:`RegenerateReportRequest`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse] """ kwargs = _get_kwargs( @@ -222,10 +234,11 @@ async def asyncio( client: AuthenticatedClient, body: RegenerateReportOperation, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse | None: """Regenerate Report - + Re-runs fact generation for an existing Report against the latest ledger state. Pass + `period_start`/`period_end`/`periods` only if you want to change the reporting window. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -233,14 +246,17 @@ async def asyncio( Args: graph_id (str): idempotency_key (None | str | Unset): - body (RegenerateReportOperation): + body (RegenerateReportOperation): Regenerate facts for an existing Report. Carries + `report_id` from + the path-style RPC body; period overrides are inherited from + :class:`RegenerateReportRequest`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_remove_publish_list_member.py b/robosystems_client/api/extensions_robo_ledger/op_remove_publish_list_member.py index e5bd4d0..a9b3a3d 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_remove_publish_list_member.py +++ b/robosystems_client/api/extensions_robo_ledger/op_remove_publish_list_member.py @@ -8,7 +8,7 @@ from ...client import AuthenticatedClient, Client from ...models.error_response import ErrorResponse from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_delete_result import OperationEnvelopeDeleteResult from ...models.remove_publish_list_member_operation import ( RemovePublishListMemberOperation, ) @@ -42,9 +42,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult | None: if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeDeleteResult.from_dict(response.json()) return response_200 @@ -96,7 +96,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -111,10 +111,10 @@ def sync_detailed( client: AuthenticatedClient, body: RemovePublishListMemberOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult]: """Remove Member from Publish List - + Remove a single recipient from a publish list. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -122,14 +122,14 @@ def sync_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (RemovePublishListMemberOperation): + body (RemovePublishListMemberOperation): Remove a single recipient from a publish list. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult] """ kwargs = _get_kwargs( @@ -151,10 +151,10 @@ def sync( client: AuthenticatedClient, body: RemovePublishListMemberOperation, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult | None: """Remove Member from Publish List - + Remove a single recipient from a publish list. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -162,14 +162,14 @@ def sync( Args: graph_id (str): idempotency_key (None | str | Unset): - body (RemovePublishListMemberOperation): + body (RemovePublishListMemberOperation): Remove a single recipient from a publish list. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult """ return sync_detailed( @@ -186,10 +186,10 @@ async def asyncio_detailed( client: AuthenticatedClient, body: RemovePublishListMemberOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult]: """Remove Member from Publish List - + Remove a single recipient from a publish list. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -197,14 +197,14 @@ async def asyncio_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (RemovePublishListMemberOperation): + body (RemovePublishListMemberOperation): Remove a single recipient from a publish list. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult] """ kwargs = _get_kwargs( @@ -224,10 +224,10 @@ async def asyncio( client: AuthenticatedClient, body: RemovePublishListMemberOperation, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult | None: """Remove Member from Publish List - + Remove a single recipient from a publish list. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -235,14 +235,14 @@ async def asyncio( Args: graph_id (str): idempotency_key (None | str | Unset): - body (RemovePublishListMemberOperation): + body (RemovePublishListMemberOperation): Remove a single recipient from a publish list. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopeDeleteResult """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_reopen_period.py b/robosystems_client/api/extensions_robo_ledger/op_reopen_period.py index 5784b0b..4ae1a7e 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_reopen_period.py +++ b/robosystems_client/api/extensions_robo_ledger/op_reopen_period.py @@ -8,7 +8,9 @@ from ...client import AuthenticatedClient, Client from ...models.error_response import ErrorResponse from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_fiscal_calendar_response import ( + OperationEnvelopeFiscalCalendarResponse, +) from ...models.reopen_period_operation import ReopenPeriodOperation from ...types import UNSET, Response, Unset @@ -40,9 +42,11 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ( + ErrorResponse | HTTPValidationError | OperationEnvelopeFiscalCalendarResponse | None +): if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeFiscalCalendarResponse.from_dict(response.json()) return response_200 @@ -94,7 +98,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ + ErrorResponse | HTTPValidationError | OperationEnvelopeFiscalCalendarResponse +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -109,10 +115,14 @@ def sync_detailed( client: AuthenticatedClient, body: ReopenPeriodOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ + ErrorResponse | HTTPValidationError | OperationEnvelopeFiscalCalendarResponse +]: """Reopen Fiscal Period - Decrements `closed_through` by one — only the most recently closed period can be reopened. + Decrement `closed_through` by one. Only the most recently closed period can be reopened (no reach- + back). The required `reason` is captured in the audit log. Use sparingly — reopen invalidates + downstream artifacts that trusted the closed state (reports, shared filings). **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -120,14 +130,14 @@ def sync_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (ReopenPeriodOperation): + body (ReopenPeriodOperation): Reopen the most recently closed fiscal period. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopeFiscalCalendarResponse] """ kwargs = _get_kwargs( @@ -149,10 +159,14 @@ def sync( client: AuthenticatedClient, body: ReopenPeriodOperation, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ( + ErrorResponse | HTTPValidationError | OperationEnvelopeFiscalCalendarResponse | None +): """Reopen Fiscal Period - Decrements `closed_through` by one — only the most recently closed period can be reopened. + Decrement `closed_through` by one. Only the most recently closed period can be reopened (no reach- + back). The required `reason` is captured in the audit log. Use sparingly — reopen invalidates + downstream artifacts that trusted the closed state (reports, shared filings). **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -160,14 +174,14 @@ def sync( Args: graph_id (str): idempotency_key (None | str | Unset): - body (ReopenPeriodOperation): + body (ReopenPeriodOperation): Reopen the most recently closed fiscal period. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopeFiscalCalendarResponse """ return sync_detailed( @@ -184,10 +198,14 @@ async def asyncio_detailed( client: AuthenticatedClient, body: ReopenPeriodOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ + ErrorResponse | HTTPValidationError | OperationEnvelopeFiscalCalendarResponse +]: """Reopen Fiscal Period - Decrements `closed_through` by one — only the most recently closed period can be reopened. + Decrement `closed_through` by one. Only the most recently closed period can be reopened (no reach- + back). The required `reason` is captured in the audit log. Use sparingly — reopen invalidates + downstream artifacts that trusted the closed state (reports, shared filings). **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -195,14 +213,14 @@ async def asyncio_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (ReopenPeriodOperation): + body (ReopenPeriodOperation): Reopen the most recently closed fiscal period. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopeFiscalCalendarResponse] """ kwargs = _get_kwargs( @@ -222,10 +240,14 @@ async def asyncio( client: AuthenticatedClient, body: ReopenPeriodOperation, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ( + ErrorResponse | HTTPValidationError | OperationEnvelopeFiscalCalendarResponse | None +): """Reopen Fiscal Period - Decrements `closed_through` by one — only the most recently closed period can be reopened. + Decrement `closed_through` by one. Only the most recently closed period can be reopened (no reach- + back). The required `reason` is captured in the audit log. Use sparingly — reopen invalidates + downstream artifacts that trusted the closed state (reports, shared filings). **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -233,14 +255,14 @@ async def asyncio( Args: graph_id (str): idempotency_key (None | str | Unset): - body (ReopenPeriodOperation): + body (ReopenPeriodOperation): Reopen the most recently closed fiscal period. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopeFiscalCalendarResponse """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_set_close_target.py b/robosystems_client/api/extensions_robo_ledger/op_set_close_target.py index d448dcc..8451031 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_set_close_target.py +++ b/robosystems_client/api/extensions_robo_ledger/op_set_close_target.py @@ -8,7 +8,9 @@ from ...client import AuthenticatedClient, Client from ...models.error_response import ErrorResponse from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_fiscal_calendar_response import ( + OperationEnvelopeFiscalCalendarResponse, +) from ...models.set_close_target_operation import SetCloseTargetOperation from ...types import UNSET, Response, Unset @@ -40,9 +42,11 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ( + ErrorResponse | HTTPValidationError | OperationEnvelopeFiscalCalendarResponse | None +): if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeFiscalCalendarResponse.from_dict(response.json()) return response_200 @@ -94,7 +98,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ + ErrorResponse | HTTPValidationError | OperationEnvelopeFiscalCalendarResponse +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -109,11 +115,15 @@ def sync_detailed( client: AuthenticatedClient, body: SetCloseTargetOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ + ErrorResponse | HTTPValidationError | OperationEnvelopeFiscalCalendarResponse +]: """Set Close Target - Period format: YYYY-MM. The close target is the user-controlled goal date, distinct from - `closed_through` (what's actually closed). + Set the user-controlled goal period for closing (`close_target`). Format: YYYY-MM. Distinct from + `closed_through` (what's actually locked) — setting a target doesn't close anything; call `close- + period` for that. The catch-up sequence between `closed_through` and this target appears on the + response's `fiscal_calendar.catch_up_sequence`. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -128,7 +138,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopeFiscalCalendarResponse] """ kwargs = _get_kwargs( @@ -150,11 +160,15 @@ def sync( client: AuthenticatedClient, body: SetCloseTargetOperation, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ( + ErrorResponse | HTTPValidationError | OperationEnvelopeFiscalCalendarResponse | None +): """Set Close Target - Period format: YYYY-MM. The close target is the user-controlled goal date, distinct from - `closed_through` (what's actually closed). + Set the user-controlled goal period for closing (`close_target`). Format: YYYY-MM. Distinct from + `closed_through` (what's actually locked) — setting a target doesn't close anything; call `close- + period` for that. The catch-up sequence between `closed_through` and this target appears on the + response's `fiscal_calendar.catch_up_sequence`. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -169,7 +183,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopeFiscalCalendarResponse """ return sync_detailed( @@ -186,11 +200,15 @@ async def asyncio_detailed( client: AuthenticatedClient, body: SetCloseTargetOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ + ErrorResponse | HTTPValidationError | OperationEnvelopeFiscalCalendarResponse +]: """Set Close Target - Period format: YYYY-MM. The close target is the user-controlled goal date, distinct from - `closed_through` (what's actually closed). + Set the user-controlled goal period for closing (`close_target`). Format: YYYY-MM. Distinct from + `closed_through` (what's actually locked) — setting a target doesn't close anything; call `close- + period` for that. The catch-up sequence between `closed_through` and this target appears on the + response's `fiscal_calendar.catch_up_sequence`. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -205,7 +223,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopeFiscalCalendarResponse] """ kwargs = _get_kwargs( @@ -225,11 +243,15 @@ async def asyncio( client: AuthenticatedClient, body: SetCloseTargetOperation, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ( + ErrorResponse | HTTPValidationError | OperationEnvelopeFiscalCalendarResponse | None +): """Set Close Target - Period format: YYYY-MM. The close target is the user-controlled goal date, distinct from - `closed_through` (what's actually closed). + Set the user-controlled goal period for closing (`close_target`). Format: YYYY-MM. Distinct from + `closed_through` (what's actually locked) — setting a target doesn't close anything; call `close- + period` for that. The catch-up sequence between `closed_through` and this target appears on the + response's `fiscal_calendar.catch_up_sequence`. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -244,7 +266,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopeFiscalCalendarResponse """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_share_report.py b/robosystems_client/api/extensions_robo_ledger/op_share_report.py index 3de2f12..1409c53 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_share_report.py +++ b/robosystems_client/api/extensions_robo_ledger/op_share_report.py @@ -8,7 +8,9 @@ from ...client import AuthenticatedClient, Client from ...models.error_response import ErrorResponse from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_share_report_response import ( + OperationEnvelopeShareReportResponse, +) from ...models.share_report_operation import ShareReportOperation from ...types import UNSET, Response, Unset @@ -40,9 +42,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeShareReportResponse | None: if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeShareReportResponse.from_dict(response.json()) return response_200 @@ -94,7 +96,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ + ErrorResponse | HTTPValidationError | OperationEnvelopeShareReportResponse +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -109,10 +113,15 @@ def sync_detailed( client: AuthenticatedClient, body: ShareReportOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ + ErrorResponse | HTTPValidationError | OperationEnvelopeShareReportResponse +]: """Share Report - Only published reports can be shared. Sends the report to all members of the target publish list. + Pushes a published report to every member of the target publish list. Each share is an independent + copy: the report row + all its facts are cloned into the recipient's tenant schema with + `source_graph_id` / `source_report_id` provenance fields populated. Per-target outcomes (success or + error) surface in the response — share does not fail-fast across targets. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -120,14 +129,14 @@ def sync_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (ShareReportOperation): + body (ShareReportOperation): Share a published Report to every member of a publish list. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopeShareReportResponse] """ kwargs = _get_kwargs( @@ -149,10 +158,13 @@ def sync( client: AuthenticatedClient, body: ShareReportOperation, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeShareReportResponse | None: """Share Report - Only published reports can be shared. Sends the report to all members of the target publish list. + Pushes a published report to every member of the target publish list. Each share is an independent + copy: the report row + all its facts are cloned into the recipient's tenant schema with + `source_graph_id` / `source_report_id` provenance fields populated. Per-target outcomes (success or + error) surface in the response — share does not fail-fast across targets. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -160,14 +172,14 @@ def sync( Args: graph_id (str): idempotency_key (None | str | Unset): - body (ShareReportOperation): + body (ShareReportOperation): Share a published Report to every member of a publish list. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopeShareReportResponse """ return sync_detailed( @@ -184,10 +196,15 @@ async def asyncio_detailed( client: AuthenticatedClient, body: ShareReportOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ + ErrorResponse | HTTPValidationError | OperationEnvelopeShareReportResponse +]: """Share Report - Only published reports can be shared. Sends the report to all members of the target publish list. + Pushes a published report to every member of the target publish list. Each share is an independent + copy: the report row + all its facts are cloned into the recipient's tenant schema with + `source_graph_id` / `source_report_id` provenance fields populated. Per-target outcomes (success or + error) surface in the response — share does not fail-fast across targets. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -195,14 +212,14 @@ async def asyncio_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (ShareReportOperation): + body (ShareReportOperation): Share a published Report to every member of a publish list. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopeShareReportResponse] """ kwargs = _get_kwargs( @@ -222,10 +239,13 @@ async def asyncio( client: AuthenticatedClient, body: ShareReportOperation, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeShareReportResponse | None: """Share Report - Only published reports can be shared. Sends the report to all members of the target publish list. + Pushes a published report to every member of the target publish list. Each share is an independent + copy: the report row + all its facts are cloned into the recipient's tenant schema with + `source_graph_id` / `source_report_id` provenance fields populated. Per-target outcomes (success or + error) surface in the response — share does not fail-fast across targets. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -233,14 +253,14 @@ async def asyncio( Args: graph_id (str): idempotency_key (None | str | Unset): - body (ShareReportOperation): + body (ShareReportOperation): Share a published Report to every member of a publish list. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopeShareReportResponse """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_transition_filing_status.py b/robosystems_client/api/extensions_robo_ledger/op_transition_filing_status.py index bf20e88..d03d680 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_transition_filing_status.py +++ b/robosystems_client/api/extensions_robo_ledger/op_transition_filing_status.py @@ -8,7 +8,7 @@ from ...client import AuthenticatedClient, Client from ...models.error_response import ErrorResponse from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_report_response import OperationEnvelopeReportResponse from ...models.transition_filing_status_request import TransitionFilingStatusRequest from ...types import UNSET, Response, Unset @@ -40,9 +40,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse | None: if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeReportResponse.from_dict(response.json()) return response_200 @@ -94,7 +94,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -109,7 +109,7 @@ def sync_detailed( client: AuthenticatedClient, body: TransitionFilingStatusRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse]: """Transition Filing Status Move a Report along the non-file legs of the filing lifecycle (draft ↔ under_review, filed → @@ -134,7 +134,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse] """ kwargs = _get_kwargs( @@ -156,7 +156,7 @@ def sync( client: AuthenticatedClient, body: TransitionFilingStatusRequest, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse | None: """Transition Filing Status Move a Report along the non-file legs of the filing lifecycle (draft ↔ under_review, filed → @@ -181,7 +181,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse """ return sync_detailed( @@ -198,7 +198,7 @@ async def asyncio_detailed( client: AuthenticatedClient, body: TransitionFilingStatusRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse]: """Transition Filing Status Move a Report along the non-file legs of the filing lifecycle (draft ↔ under_review, filed → @@ -223,7 +223,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse] """ kwargs = _get_kwargs( @@ -243,7 +243,7 @@ async def asyncio( client: AuthenticatedClient, body: TransitionFilingStatusRequest, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse | None: """Transition Filing Status Move a Report along the non-file legs of the filing lifecycle (draft ↔ under_review, filed → @@ -268,7 +268,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopeReportResponse """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_update_agent.py b/robosystems_client/api/extensions_robo_ledger/op_update_agent.py index 741cac4..d4a2ce5 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_update_agent.py +++ b/robosystems_client/api/extensions_robo_ledger/op_update_agent.py @@ -7,7 +7,9 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_ledger_agent_response import ( + OperationEnvelopeLedgerAgentResponse, +) from ...models.operation_error import OperationError from ...models.update_agent_request import UpdateAgentRequest from ...types import UNSET, Response, Unset @@ -40,9 +42,15 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeLedgerAgentResponse + | OperationError + | None +): if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeLedgerAgentResponse.from_dict(response.json()) return response_200 @@ -90,7 +98,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeLedgerAgentResponse | OperationError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -105,7 +115,9 @@ def sync_detailed( client: AuthenticatedClient, body: UpdateAgentRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeLedgerAgentResponse | OperationError +]: """Update Agent Patch counterparty fields. Only supplied fields are updated. Set is_active=false to deactivate @@ -117,14 +129,16 @@ def sync_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (UpdateAgentRequest): + body (UpdateAgentRequest): Patch an agent. All fields except ``agent_id`` are optional — + pass only what changes. ``metadata_patch`` is deep-merged into the + existing metadata dict. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeLedgerAgentResponse | OperationError] """ kwargs = _get_kwargs( @@ -146,7 +160,13 @@ def sync( client: AuthenticatedClient, body: UpdateAgentRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeLedgerAgentResponse + | OperationError + | None +): """Update Agent Patch counterparty fields. Only supplied fields are updated. Set is_active=false to deactivate @@ -158,14 +178,16 @@ def sync( Args: graph_id (str): idempotency_key (None | str | Unset): - body (UpdateAgentRequest): + body (UpdateAgentRequest): Patch an agent. All fields except ``agent_id`` are optional — + pass only what changes. ``metadata_patch`` is deep-merged into the + existing metadata dict. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeLedgerAgentResponse | OperationError """ return sync_detailed( @@ -182,7 +204,9 @@ async def asyncio_detailed( client: AuthenticatedClient, body: UpdateAgentRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeLedgerAgentResponse | OperationError +]: """Update Agent Patch counterparty fields. Only supplied fields are updated. Set is_active=false to deactivate @@ -194,14 +218,16 @@ async def asyncio_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (UpdateAgentRequest): + body (UpdateAgentRequest): Patch an agent. All fields except ``agent_id`` are optional — + pass only what changes. ``metadata_patch`` is deep-merged into the + existing metadata dict. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeLedgerAgentResponse | OperationError] """ kwargs = _get_kwargs( @@ -221,7 +247,13 @@ async def asyncio( client: AuthenticatedClient, body: UpdateAgentRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeLedgerAgentResponse + | OperationError + | None +): """Update Agent Patch counterparty fields. Only supplied fields are updated. Set is_active=false to deactivate @@ -233,14 +265,16 @@ async def asyncio( Args: graph_id (str): idempotency_key (None | str | Unset): - body (UpdateAgentRequest): + body (UpdateAgentRequest): Patch an agent. All fields except ``agent_id`` are optional — + pass only what changes. ``metadata_patch`` is deep-merged into the + existing metadata dict. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeLedgerAgentResponse | OperationError """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_update_entity.py b/robosystems_client/api/extensions_robo_ledger/op_update_entity.py index 9e25f81..4851fa5 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_update_entity.py +++ b/robosystems_client/api/extensions_robo_ledger/op_update_entity.py @@ -8,7 +8,9 @@ from ...client import AuthenticatedClient, Client from ...models.error_response import ErrorResponse from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_ledger_entity_response import ( + OperationEnvelopeLedgerEntityResponse, +) from ...models.update_entity_request import UpdateEntityRequest from ...types import UNSET, Response, Unset @@ -40,9 +42,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeLedgerEntityResponse | None: if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeLedgerEntityResponse.from_dict(response.json()) return response_200 @@ -94,7 +96,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ + ErrorResponse | HTTPValidationError | OperationEnvelopeLedgerEntityResponse +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -109,10 +113,13 @@ def sync_detailed( client: AuthenticatedClient, body: UpdateEntityRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ + ErrorResponse | HTTPValidationError | OperationEnvelopeLedgerEntityResponse +]: """Update Entity - Only provided (non-null) fields are updated. + Update the graph's primary entity. Only provided (non-null) fields are updated. The graph is + implicit in the URL — the operation always targets the graph's primary entity. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -120,15 +127,20 @@ def sync_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (UpdateEntityRequest): Request to update entity details. Only provided fields are - updated. + body (UpdateEntityRequest): Update the graph's primary entity. All fields are optional — + pass only what changes. Identifiers (CIK, LEI, tax_id) are typically + set once at onboarding; address fields are flattened to make them + easy to project into reporting forms (1099, state filings). + + The graph is implicit (URL path) — there's no `entity_id` field + because the operation always targets the graph's primary entity. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopeLedgerEntityResponse] """ kwargs = _get_kwargs( @@ -150,10 +162,11 @@ def sync( client: AuthenticatedClient, body: UpdateEntityRequest, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeLedgerEntityResponse | None: """Update Entity - Only provided (non-null) fields are updated. + Update the graph's primary entity. Only provided (non-null) fields are updated. The graph is + implicit in the URL — the operation always targets the graph's primary entity. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -161,15 +174,20 @@ def sync( Args: graph_id (str): idempotency_key (None | str | Unset): - body (UpdateEntityRequest): Request to update entity details. Only provided fields are - updated. + body (UpdateEntityRequest): Update the graph's primary entity. All fields are optional — + pass only what changes. Identifiers (CIK, LEI, tax_id) are typically + set once at onboarding; address fields are flattened to make them + easy to project into reporting forms (1099, state filings). + + The graph is implicit (URL path) — there's no `entity_id` field + because the operation always targets the graph's primary entity. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopeLedgerEntityResponse """ return sync_detailed( @@ -186,10 +204,13 @@ async def asyncio_detailed( client: AuthenticatedClient, body: UpdateEntityRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ + ErrorResponse | HTTPValidationError | OperationEnvelopeLedgerEntityResponse +]: """Update Entity - Only provided (non-null) fields are updated. + Update the graph's primary entity. Only provided (non-null) fields are updated. The graph is + implicit in the URL — the operation always targets the graph's primary entity. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -197,15 +218,20 @@ async def asyncio_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (UpdateEntityRequest): Request to update entity details. Only provided fields are - updated. + body (UpdateEntityRequest): Update the graph's primary entity. All fields are optional — + pass only what changes. Identifiers (CIK, LEI, tax_id) are typically + set once at onboarding; address fields are flattened to make them + easy to project into reporting forms (1099, state filings). + + The graph is implicit (URL path) — there's no `entity_id` field + because the operation always targets the graph's primary entity. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopeLedgerEntityResponse] """ kwargs = _get_kwargs( @@ -225,10 +251,11 @@ async def asyncio( client: AuthenticatedClient, body: UpdateEntityRequest, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopeLedgerEntityResponse | None: """Update Entity - Only provided (non-null) fields are updated. + Update the graph's primary entity. Only provided (non-null) fields are updated. The graph is + implicit in the URL — the operation always targets the graph's primary entity. **Idempotency**: supply an `Idempotency-Key` header to make safe retries; replays within 24 hours return the same envelope. Reusing the key with a different body returns HTTP 409 Conflict. @@ -236,15 +263,20 @@ async def asyncio( Args: graph_id (str): idempotency_key (None | str | Unset): - body (UpdateEntityRequest): Request to update entity details. Only provided fields are - updated. + body (UpdateEntityRequest): Update the graph's primary entity. All fields are optional — + pass only what changes. Identifiers (CIK, LEI, tax_id) are typically + set once at onboarding; address fields are flattened to make them + easy to project into reporting forms (1099, state filings). + + The graph is implicit (URL path) — there's no `entity_id` field + because the operation always targets the graph's primary entity. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopeLedgerEntityResponse """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_update_event_handler.py b/robosystems_client/api/extensions_robo_ledger/op_update_event_handler.py index 8ddcf29..3a15957 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_update_event_handler.py +++ b/robosystems_client/api/extensions_robo_ledger/op_update_event_handler.py @@ -7,7 +7,9 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_event_handler_response import ( + OperationEnvelopeEventHandlerResponse, +) from ...models.operation_error import OperationError from ...models.update_event_handler_request import UpdateEventHandlerRequest from ...types import UNSET, Response, Unset @@ -40,9 +42,15 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeEventHandlerResponse + | OperationError + | None +): if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeEventHandlerResponse.from_dict(response.json()) return response_200 @@ -90,7 +98,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeEventHandlerResponse | OperationError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -105,7 +115,9 @@ def sync_detailed( client: AuthenticatedClient, body: UpdateEventHandlerRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeEventHandlerResponse | OperationError +]: """Update Event Handler Patch an event handler's match criteria, template, priority, or active state. Pass approve=true to @@ -117,14 +129,20 @@ def sync_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (UpdateEventHandlerRequest): + body (UpdateEventHandlerRequest): Update an existing event handler. All fields except + ``event_handler_id`` are optional — pass only what changes. + + ``transaction_template`` is **fully replaced** when supplied (no + partial template patches). ``metadata_patch`` does deep-merge into + the existing metadata. ``approve=true`` sets ``approved_by`` and + ``approved_at``; ``approve=false`` clears them. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeEventHandlerResponse | OperationError] """ kwargs = _get_kwargs( @@ -146,7 +164,13 @@ def sync( client: AuthenticatedClient, body: UpdateEventHandlerRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeEventHandlerResponse + | OperationError + | None +): """Update Event Handler Patch an event handler's match criteria, template, priority, or active state. Pass approve=true to @@ -158,14 +182,20 @@ def sync( Args: graph_id (str): idempotency_key (None | str | Unset): - body (UpdateEventHandlerRequest): + body (UpdateEventHandlerRequest): Update an existing event handler. All fields except + ``event_handler_id`` are optional — pass only what changes. + + ``transaction_template`` is **fully replaced** when supplied (no + partial template patches). ``metadata_patch`` does deep-merge into + the existing metadata. ``approve=true`` sets ``approved_by`` and + ``approved_at``; ``approve=false`` clears them. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeEventHandlerResponse | OperationError """ return sync_detailed( @@ -182,7 +212,9 @@ async def asyncio_detailed( client: AuthenticatedClient, body: UpdateEventHandlerRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeEventHandlerResponse | OperationError +]: """Update Event Handler Patch an event handler's match criteria, template, priority, or active state. Pass approve=true to @@ -194,14 +226,20 @@ async def asyncio_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (UpdateEventHandlerRequest): + body (UpdateEventHandlerRequest): Update an existing event handler. All fields except + ``event_handler_id`` are optional — pass only what changes. + + ``transaction_template`` is **fully replaced** when supplied (no + partial template patches). ``metadata_patch`` does deep-merge into + the existing metadata. ``approve=true`` sets ``approved_by`` and + ``approved_at``; ``approve=false`` clears them. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeEventHandlerResponse | OperationError] """ kwargs = _get_kwargs( @@ -221,7 +259,13 @@ async def asyncio( client: AuthenticatedClient, body: UpdateEventHandlerRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeEventHandlerResponse + | OperationError + | None +): """Update Event Handler Patch an event handler's match criteria, template, priority, or active state. Pass approve=true to @@ -233,14 +277,20 @@ async def asyncio( Args: graph_id (str): idempotency_key (None | str | Unset): - body (UpdateEventHandlerRequest): + body (UpdateEventHandlerRequest): Update an existing event handler. All fields except + ``event_handler_id`` are optional — pass only what changes. + + ``transaction_template`` is **fully replaced** when supplied (no + partial template patches). ``metadata_patch`` does deep-merge into + the existing metadata. ``approve=true`` sets ``approved_by`` and + ``approved_at``; ``approve=false`` clears them. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeEventHandlerResponse | OperationError """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_update_journal_entry.py b/robosystems_client/api/extensions_robo_ledger/op_update_journal_entry.py index 331758f..b115166 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_update_journal_entry.py +++ b/robosystems_client/api/extensions_robo_ledger/op_update_journal_entry.py @@ -7,7 +7,9 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_journal_entry_response import ( + OperationEnvelopeJournalEntryResponse, +) from ...models.operation_error import OperationError from ...models.update_journal_entry_request import UpdateJournalEntryRequest from ...types import UNSET, Response, Unset @@ -40,9 +42,15 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeJournalEntryResponse + | OperationError + | None +): if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeJournalEntryResponse.from_dict(response.json()) return response_200 @@ -90,7 +98,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeJournalEntryResponse | OperationError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -105,7 +115,9 @@ def sync_detailed( client: AuthenticatedClient, body: UpdateJournalEntryRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeJournalEntryResponse | OperationError +]: """Update Journal Entry Update a draft journal entry. Posted entries are immutable and must be corrected via `create-event- @@ -132,7 +144,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeJournalEntryResponse | OperationError] """ kwargs = _get_kwargs( @@ -154,7 +166,13 @@ def sync( client: AuthenticatedClient, body: UpdateJournalEntryRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeJournalEntryResponse + | OperationError + | None +): """Update Journal Entry Update a draft journal entry. Posted entries are immutable and must be corrected via `create-event- @@ -181,7 +199,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeJournalEntryResponse | OperationError """ return sync_detailed( @@ -198,7 +216,9 @@ async def asyncio_detailed( client: AuthenticatedClient, body: UpdateJournalEntryRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeJournalEntryResponse | OperationError +]: """Update Journal Entry Update a draft journal entry. Posted entries are immutable and must be corrected via `create-event- @@ -225,7 +245,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeJournalEntryResponse | OperationError] """ kwargs = _get_kwargs( @@ -245,7 +265,13 @@ async def asyncio( client: AuthenticatedClient, body: UpdateJournalEntryRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeJournalEntryResponse + | OperationError + | None +): """Update Journal Entry Update a draft journal entry. Posted entries are immutable and must be corrected via `create-event- @@ -272,7 +298,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeJournalEntryResponse | OperationError """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_update_publish_list.py b/robosystems_client/api/extensions_robo_ledger/op_update_publish_list.py index 5d2da1a..b506744 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_update_publish_list.py +++ b/robosystems_client/api/extensions_robo_ledger/op_update_publish_list.py @@ -8,7 +8,9 @@ from ...client import AuthenticatedClient, Client from ...models.error_response import ErrorResponse from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_publish_list_response import ( + OperationEnvelopePublishListResponse, +) from ...models.update_publish_list_operation import UpdatePublishListOperation from ...types import UNSET, Response, Unset @@ -40,9 +42,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopePublishListResponse | None: if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopePublishListResponse.from_dict(response.json()) return response_200 @@ -94,7 +96,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ + ErrorResponse | HTTPValidationError | OperationEnvelopePublishListResponse +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -109,7 +113,9 @@ def sync_detailed( client: AuthenticatedClient, body: UpdatePublishListOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ + ErrorResponse | HTTPValidationError | OperationEnvelopePublishListResponse +]: """Update Publish List Updates the publish list's `name` and/or `description`. Membership is managed via add/remove-member @@ -121,14 +127,14 @@ def sync_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (UpdatePublishListOperation): + body (UpdatePublishListOperation): Update a publish list's metadata. Carries `list_id`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopePublishListResponse] """ kwargs = _get_kwargs( @@ -150,7 +156,7 @@ def sync( client: AuthenticatedClient, body: UpdatePublishListOperation, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopePublishListResponse | None: """Update Publish List Updates the publish list's `name` and/or `description`. Membership is managed via add/remove-member @@ -162,14 +168,14 @@ def sync( Args: graph_id (str): idempotency_key (None | str | Unset): - body (UpdatePublishListOperation): + body (UpdatePublishListOperation): Update a publish list's metadata. Carries `list_id`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopePublishListResponse """ return sync_detailed( @@ -186,7 +192,9 @@ async def asyncio_detailed( client: AuthenticatedClient, body: UpdatePublishListOperation, idempotency_key: None | str | Unset = UNSET, -) -> Response[ErrorResponse | HTTPValidationError | OperationEnvelope]: +) -> Response[ + ErrorResponse | HTTPValidationError | OperationEnvelopePublishListResponse +]: """Update Publish List Updates the publish list's `name` and/or `description`. Membership is managed via add/remove-member @@ -198,14 +206,14 @@ async def asyncio_detailed( Args: graph_id (str): idempotency_key (None | str | Unset): - body (UpdatePublishListOperation): + body (UpdatePublishListOperation): Update a publish list's metadata. Carries `list_id`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[ErrorResponse | HTTPValidationError | OperationEnvelope] + Response[ErrorResponse | HTTPValidationError | OperationEnvelopePublishListResponse] """ kwargs = _get_kwargs( @@ -225,7 +233,7 @@ async def asyncio( client: AuthenticatedClient, body: UpdatePublishListOperation, idempotency_key: None | str | Unset = UNSET, -) -> ErrorResponse | HTTPValidationError | OperationEnvelope | None: +) -> ErrorResponse | HTTPValidationError | OperationEnvelopePublishListResponse | None: """Update Publish List Updates the publish list's `name` and/or `description`. Membership is managed via add/remove-member @@ -237,14 +245,14 @@ async def asyncio( Args: graph_id (str): idempotency_key (None | str | Unset): - body (UpdatePublishListOperation): + body (UpdatePublishListOperation): Update a publish list's metadata. Carries `list_id`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - ErrorResponse | HTTPValidationError | OperationEnvelope + ErrorResponse | HTTPValidationError | OperationEnvelopePublishListResponse """ return ( diff --git a/robosystems_client/api/extensions_robo_ledger/op_update_taxonomy_block.py b/robosystems_client/api/extensions_robo_ledger/op_update_taxonomy_block.py index 8f10522..2bda1b8 100644 --- a/robosystems_client/api/extensions_robo_ledger/op_update_taxonomy_block.py +++ b/robosystems_client/api/extensions_robo_ledger/op_update_taxonomy_block.py @@ -7,7 +7,9 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.http_validation_error import HTTPValidationError -from ...models.operation_envelope import OperationEnvelope +from ...models.operation_envelope_taxonomy_block_envelope import ( + OperationEnvelopeTaxonomyBlockEnvelope, +) from ...models.operation_error import OperationError from ...models.update_taxonomy_block_request import UpdateTaxonomyBlockRequest from ...types import UNSET, Response, Unset @@ -40,9 +42,15 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeTaxonomyBlockEnvelope + | OperationError + | None +): if response.status_code == 200: - response_200 = OperationEnvelope.from_dict(response.json()) + response_200 = OperationEnvelopeTaxonomyBlockEnvelope.from_dict(response.json()) return response_200 @@ -90,7 +98,9 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeTaxonomyBlockEnvelope | OperationError +]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -105,7 +115,9 @@ def sync_detailed( client: AuthenticatedClient, body: UpdateTaxonomyBlockRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeTaxonomyBlockEnvelope | OperationError +]: """Update Taxonomy Block Incrementally mutate a taxonomy block via typed delta lists (elements/structures/associations/rules @@ -131,7 +143,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeTaxonomyBlockEnvelope | OperationError] """ kwargs = _get_kwargs( @@ -153,7 +165,13 @@ def sync( client: AuthenticatedClient, body: UpdateTaxonomyBlockRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeTaxonomyBlockEnvelope + | OperationError + | None +): """Update Taxonomy Block Incrementally mutate a taxonomy block via typed delta lists (elements/structures/associations/rules @@ -179,7 +197,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeTaxonomyBlockEnvelope | OperationError """ return sync_detailed( @@ -196,7 +214,9 @@ async def asyncio_detailed( client: AuthenticatedClient, body: UpdateTaxonomyBlockRequest, idempotency_key: None | str | Unset = UNSET, -) -> Response[Any | HTTPValidationError | OperationEnvelope | OperationError]: +) -> Response[ + Any | HTTPValidationError | OperationEnvelopeTaxonomyBlockEnvelope | OperationError +]: """Update Taxonomy Block Incrementally mutate a taxonomy block via typed delta lists (elements/structures/associations/rules @@ -222,7 +242,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Any | HTTPValidationError | OperationEnvelope | OperationError] + Response[Any | HTTPValidationError | OperationEnvelopeTaxonomyBlockEnvelope | OperationError] """ kwargs = _get_kwargs( @@ -242,7 +262,13 @@ async def asyncio( client: AuthenticatedClient, body: UpdateTaxonomyBlockRequest, idempotency_key: None | str | Unset = UNSET, -) -> Any | HTTPValidationError | OperationEnvelope | OperationError | None: +) -> ( + Any + | HTTPValidationError + | OperationEnvelopeTaxonomyBlockEnvelope + | OperationError + | None +): """Update Taxonomy Block Incrementally mutate a taxonomy block via typed delta lists (elements/structures/associations/rules @@ -268,7 +294,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Any | HTTPValidationError | OperationEnvelope | OperationError + Any | HTTPValidationError | OperationEnvelopeTaxonomyBlockEnvelope | OperationError """ return ( diff --git a/robosystems_client/models/__init__.py b/robosystems_client/models/__init__.py index c1a491b..ee91f98 100644 --- a/robosystems_client/models/__init__.py +++ b/robosystems_client/models/__init__.py @@ -26,6 +26,7 @@ from .api_keys_response import APIKeysResponse from .artifact_response import ArtifactResponse from .artifact_response_template_type_0 import ArtifactResponseTemplateType0 +from .association_response import AssociationResponse from .auth_response import AuthResponse from .auth_response_org_type_0 import AuthResponseOrgType0 from .auth_response_user import AuthResponseUser @@ -53,6 +54,7 @@ from .checkout_status_response import CheckoutStatusResponse from .classification_lite import ClassificationLite from .close_period_operation import ClosePeriodOperation +from .close_period_response import ClosePeriodResponse from .connection_lite import ConnectionLite from .connection_options_response import ConnectionOptionsResponse from .connection_provider_info import ConnectionProviderInfo @@ -143,6 +145,7 @@ from .delete_security_operation import DeleteSecurityOperation from .delete_subgraph_op import DeleteSubgraphOp from .delete_taxonomy_block_request import DeleteTaxonomyBlockRequest +from .delete_taxonomy_block_response import DeleteTaxonomyBlockResponse from .detailed_transactions_response import DetailedTransactionsResponse from .detailed_transactions_response_date_range import ( DetailedTransactionsResponseDateRange, @@ -166,12 +169,22 @@ ) from .enhanced_file_status_layers import EnhancedFileStatusLayers from .entity_lite import EntityLite +from .entity_taxonomy_response import EntityTaxonomyResponse from .entry_template_request import EntryTemplateRequest from .entry_template_request_entry_type import EntryTemplateRequestEntryType from .error_response import ErrorResponse from .evaluate_rules_request import EvaluateRulesRequest +from .evaluate_rules_response import EvaluateRulesResponse +from .evaluate_rules_response_summary import EvaluateRulesResponseSummary from .event_block_envelope import EventBlockEnvelope from .event_block_envelope_metadata import EventBlockEnvelopeMetadata +from .event_handler_response import EventHandlerResponse +from .event_handler_response_match_metadata_expression_type_0 import ( + EventHandlerResponseMatchMetadataExpressionType0, +) +from .event_handler_response_transaction_template import ( + EventHandlerResponseTransactionTemplate, +) from .fact_lite import FactLite from .fact_set_lite import FactSetLite from .file_info import FileInfo @@ -181,6 +194,8 @@ from .file_upload_request import FileUploadRequest from .file_upload_response import FileUploadResponse from .financial_statement_analysis_request import FinancialStatementAnalysisRequest +from .fiscal_calendar_response import FiscalCalendarResponse +from .fiscal_period_summary import FiscalPeriodSummary from .forgot_password_request import ForgotPasswordRequest from .forgot_password_response_forgotpassword import ( ForgotPasswordResponseForgotpassword, @@ -223,12 +238,18 @@ from .information_model_response import InformationModelResponse from .initial_entity_data import InitialEntityData from .initialize_ledger_request import InitializeLedgerRequest +from .initialize_ledger_response import InitializeLedgerResponse from .instance_usage import InstanceUsage from .invite_member_request import InviteMemberRequest from .invoice import Invoice from .invoice_line_item import InvoiceLineItem from .invoices_response import InvoicesResponse from .journal_entry_line_item_input import JournalEntryLineItemInput +from .journal_entry_line_item_response import JournalEntryLineItemResponse +from .journal_entry_response import JournalEntryResponse +from .ledger_agent_response import LedgerAgentResponse +from .ledger_agent_response_address_type_0 import LedgerAgentResponseAddressType0 +from .ledger_entity_response import LedgerEntityResponse from .link_entity_taxonomy_request import LinkEntityTaxonomyRequest from .link_entity_taxonomy_request_basis import LinkEntityTaxonomyRequestBasis from .list_connections_provider_type_0 import ListConnectionsProviderType0 @@ -258,6 +279,18 @@ from .operation_costs_ai_operations import OperationCostsAiOperations from .operation_costs_token_pricing import OperationCostsTokenPricing from .operation_envelope import OperationEnvelope +from .operation_envelope_association_response import ( + OperationEnvelopeAssociationResponse, +) +from .operation_envelope_association_response_status import ( + OperationEnvelopeAssociationResponseStatus, +) +from .operation_envelope_close_period_response import ( + OperationEnvelopeClosePeriodResponse, +) +from .operation_envelope_close_period_response_status import ( + OperationEnvelopeClosePeriodResponseStatus, +) from .operation_envelope_delete_information_block_response import ( OperationEnvelopeDeleteInformationBlockResponse, ) @@ -272,27 +305,115 @@ ) from .operation_envelope_delete_result import OperationEnvelopeDeleteResult from .operation_envelope_delete_result_status import OperationEnvelopeDeleteResultStatus +from .operation_envelope_delete_taxonomy_block_response import ( + OperationEnvelopeDeleteTaxonomyBlockResponse, +) +from .operation_envelope_delete_taxonomy_block_response_status import ( + OperationEnvelopeDeleteTaxonomyBlockResponseStatus, +) +from .operation_envelope_entity_taxonomy_response import ( + OperationEnvelopeEntityTaxonomyResponse, +) +from .operation_envelope_entity_taxonomy_response_status import ( + OperationEnvelopeEntityTaxonomyResponseStatus, +) +from .operation_envelope_evaluate_rules_response import ( + OperationEnvelopeEvaluateRulesResponse, +) +from .operation_envelope_evaluate_rules_response_status import ( + OperationEnvelopeEvaluateRulesResponseStatus, +) from .operation_envelope_event_block_envelope import OperationEnvelopeEventBlockEnvelope from .operation_envelope_event_block_envelope_status import ( OperationEnvelopeEventBlockEnvelopeStatus, ) +from .operation_envelope_event_handler_response import ( + OperationEnvelopeEventHandlerResponse, +) +from .operation_envelope_event_handler_response_status import ( + OperationEnvelopeEventHandlerResponseStatus, +) +from .operation_envelope_fiscal_calendar_response import ( + OperationEnvelopeFiscalCalendarResponse, +) +from .operation_envelope_fiscal_calendar_response_status import ( + OperationEnvelopeFiscalCalendarResponseStatus, +) from .operation_envelope_information_block_envelope import ( OperationEnvelopeInformationBlockEnvelope, ) from .operation_envelope_information_block_envelope_status import ( OperationEnvelopeInformationBlockEnvelopeStatus, ) +from .operation_envelope_initialize_ledger_response import ( + OperationEnvelopeInitializeLedgerResponse, +) +from .operation_envelope_initialize_ledger_response_status import ( + OperationEnvelopeInitializeLedgerResponseStatus, +) +from .operation_envelope_journal_entry_response import ( + OperationEnvelopeJournalEntryResponse, +) +from .operation_envelope_journal_entry_response_status import ( + OperationEnvelopeJournalEntryResponseStatus, +) +from .operation_envelope_ledger_agent_response import ( + OperationEnvelopeLedgerAgentResponse, +) +from .operation_envelope_ledger_agent_response_status import ( + OperationEnvelopeLedgerAgentResponseStatus, +) +from .operation_envelope_ledger_entity_response import ( + OperationEnvelopeLedgerEntityResponse, +) +from .operation_envelope_ledger_entity_response_status import ( + OperationEnvelopeLedgerEntityResponseStatus, +) from .operation_envelope_portfolio_block_envelope import ( OperationEnvelopePortfolioBlockEnvelope, ) from .operation_envelope_portfolio_block_envelope_status import ( OperationEnvelopePortfolioBlockEnvelopeStatus, ) +from .operation_envelope_preview_event_block_response import ( + OperationEnvelopePreviewEventBlockResponse, +) +from .operation_envelope_preview_event_block_response_status import ( + OperationEnvelopePreviewEventBlockResponseStatus, +) +from .operation_envelope_publish_list_response import ( + OperationEnvelopePublishListResponse, +) +from .operation_envelope_publish_list_response_status import ( + OperationEnvelopePublishListResponseStatus, +) +from .operation_envelope_report_response import OperationEnvelopeReportResponse +from .operation_envelope_report_response_status import ( + OperationEnvelopeReportResponseStatus, +) from .operation_envelope_security_response import OperationEnvelopeSecurityResponse from .operation_envelope_security_response_status import ( OperationEnvelopeSecurityResponseStatus, ) +from .operation_envelope_share_report_response import ( + OperationEnvelopeShareReportResponse, +) +from .operation_envelope_share_report_response_status import ( + OperationEnvelopeShareReportResponseStatus, +) from .operation_envelope_status import OperationEnvelopeStatus +from .operation_envelope_taxonomy_block_envelope import ( + OperationEnvelopeTaxonomyBlockEnvelope, +) +from .operation_envelope_taxonomy_block_envelope_status import ( + OperationEnvelopeTaxonomyBlockEnvelopeStatus, +) +from .operation_envelopelist_publish_list_member_response import ( + OperationEnvelopelistPublishListMemberResponse, +) +from .operation_envelopelist_publish_list_member_response_status import ( + OperationEnvelopelistPublishListMemberResponseStatus, +) from .operation_error import OperationError from .operation_error_detail_type_1 import OperationErrorDetailType1 from .org_detail_response import OrgDetailResponse @@ -330,6 +451,12 @@ from .portfolio_block_position_update import PortfolioBlockPositionUpdate from .portfolio_block_positions import PortfolioBlockPositions from .position_block import PositionBlock +from .preview_event_block_response import PreviewEventBlockResponse +from .preview_event_block_response_handler_metadata import ( + PreviewEventBlockResponseHandlerMetadata, +) +from .publish_list_member_response import PublishListMemberResponse +from .publish_list_response import PublishListResponse from .query_limits import QueryLimits from .quick_books_connection_config import QuickBooksConnectionConfig from .rate_limits import RateLimits @@ -340,6 +467,8 @@ from .rendering_period_lite import RenderingPeriodLite from .rendering_row_lite import RenderingRowLite from .reopen_period_operation import ReopenPeriodOperation +from .report_response import ReportResponse +from .report_response_rule_summary_type_0 import ReportResponseRuleSummaryType0 from .repository_info import RepositoryInfo from .repository_subscriptions import RepositorySubscriptions from .resend_verification_email_response_resendverificationemail import ( @@ -382,6 +511,8 @@ from .service_offerings_response import ServiceOfferingsResponse from .set_close_target_operation import SetCloseTargetOperation from .share_report_operation import ShareReportOperation +from .share_report_response import ShareReportResponse +from .share_result_item import ShareResultItem from .sso_complete_request import SSOCompleteRequest from .sso_exchange_request import SSOExchangeRequest from .sso_exchange_response import SSOExchangeResponse @@ -389,6 +520,7 @@ from .statement_mechanics import StatementMechanics from .storage_limits import StorageLimits from .storage_summary import StorageSummary +from .structure_summary import StructureSummary from .structure_update_patch import StructureUpdatePatch from .structure_update_patch_metadata_type_0 import StructureUpdatePatchMetadataType0 from .subgraph_quota_response import SubgraphQuotaResponse @@ -406,6 +538,7 @@ from .table_list_response import TableListResponse from .table_query_request import TableQueryRequest from .table_query_response import TableQueryResponse +from .taxonomy_block_association import TaxonomyBlockAssociation from .taxonomy_block_association_request import TaxonomyBlockAssociationRequest from .taxonomy_block_association_request_association_type import ( TaxonomyBlockAssociationRequestAssociationType, @@ -413,8 +546,15 @@ from .taxonomy_block_association_request_metadata import ( TaxonomyBlockAssociationRequestMetadata, ) +from .taxonomy_block_element import TaxonomyBlockElement +from .taxonomy_block_element_origin import TaxonomyBlockElementOrigin from .taxonomy_block_element_request import TaxonomyBlockElementRequest from .taxonomy_block_element_request_metadata import TaxonomyBlockElementRequestMetadata +from .taxonomy_block_envelope import TaxonomyBlockEnvelope +from .taxonomy_block_envelope_verification_results_item import ( + TaxonomyBlockEnvelopeVerificationResultsItem, +) +from .taxonomy_block_rule import TaxonomyBlockRule from .taxonomy_block_rule_request import TaxonomyBlockRuleRequest from .taxonomy_block_rule_request_metadata import TaxonomyBlockRuleRequestMetadata from .taxonomy_block_rule_request_rule_category import ( @@ -427,6 +567,7 @@ from .taxonomy_block_rule_request_variables_item import ( TaxonomyBlockRuleRequestVariablesItem, ) +from .taxonomy_block_structure import TaxonomyBlockStructure from .taxonomy_block_structure_request import TaxonomyBlockStructureRequest from .taxonomy_block_structure_request_metadata import ( TaxonomyBlockStructureRequestMetadata, @@ -436,6 +577,7 @@ ) from .tier_capacity import TierCapacity from .token_pricing import TokenPricing +from .transaction_preview import TransactionPreview from .transaction_summary_response import TransactionSummaryResponse from .transaction_template import TransactionTemplate from .transaction_template_entry import TransactionTemplateEntry @@ -515,6 +657,7 @@ "APIKeysResponse", "ArtifactResponse", "ArtifactResponseTemplateType0", + "AssociationResponse", "AuthResponse", "AuthResponseOrgType0", "AuthResponseUser", @@ -540,6 +683,7 @@ "CheckoutStatusResponse", "ClassificationLite", "ClosePeriodOperation", + "ClosePeriodResponse", "ConnectionLite", "ConnectionOptionsResponse", "ConnectionProviderInfo", @@ -618,6 +762,7 @@ "DeleteSecurityOperation", "DeleteSubgraphOp", "DeleteTaxonomyBlockRequest", + "DeleteTaxonomyBlockResponse", "DetailedTransactionsResponse", "DetailedTransactionsResponseDateRange", "DetailedTransactionsResponseSummary", @@ -637,12 +782,18 @@ "EnhancedCreditTransactionResponseMetadata", "EnhancedFileStatusLayers", "EntityLite", + "EntityTaxonomyResponse", "EntryTemplateRequest", "EntryTemplateRequestEntryType", "ErrorResponse", "EvaluateRulesRequest", + "EvaluateRulesResponse", + "EvaluateRulesResponseSummary", "EventBlockEnvelope", "EventBlockEnvelopeMetadata", + "EventHandlerResponse", + "EventHandlerResponseMatchMetadataExpressionType0", + "EventHandlerResponseTransactionTemplate", "FactLite", "FactSetLite", "FileInfo", @@ -652,6 +803,8 @@ "FileUploadRequest", "FileUploadResponse", "FinancialStatementAnalysisRequest", + "FiscalCalendarResponse", + "FiscalPeriodSummary", "ForgotPasswordRequest", "ForgotPasswordResponseForgotpassword", "GetCurrentAuthUserResponseGetcurrentauthuser", @@ -684,12 +837,18 @@ "InformationModelResponse", "InitialEntityData", "InitializeLedgerRequest", + "InitializeLedgerResponse", "InstanceUsage", "InviteMemberRequest", "Invoice", "InvoiceLineItem", "InvoicesResponse", "JournalEntryLineItemInput", + "JournalEntryLineItemResponse", + "JournalEntryResponse", + "LedgerAgentResponse", + "LedgerAgentResponseAddressType0", + "LedgerEntityResponse", "LinkEntityTaxonomyRequest", "LinkEntityTaxonomyRequestBasis", "ListConnectionsProviderType0", @@ -715,21 +874,55 @@ "OperationCostsAiOperations", "OperationCostsTokenPricing", "OperationEnvelope", + "OperationEnvelopeAssociationResponse", + "OperationEnvelopeAssociationResponseStatus", + "OperationEnvelopeClosePeriodResponse", + "OperationEnvelopeClosePeriodResponseStatus", "OperationEnvelopeDeleteInformationBlockResponse", "OperationEnvelopeDeleteInformationBlockResponseStatus", "OperationEnvelopeDeletePortfolioBlockResponse", "OperationEnvelopeDeletePortfolioBlockResponseStatus", "OperationEnvelopeDeleteResult", "OperationEnvelopeDeleteResultStatus", + "OperationEnvelopeDeleteTaxonomyBlockResponse", + "OperationEnvelopeDeleteTaxonomyBlockResponseStatus", + "OperationEnvelopeEntityTaxonomyResponse", + "OperationEnvelopeEntityTaxonomyResponseStatus", + "OperationEnvelopeEvaluateRulesResponse", + "OperationEnvelopeEvaluateRulesResponseStatus", "OperationEnvelopeEventBlockEnvelope", "OperationEnvelopeEventBlockEnvelopeStatus", + "OperationEnvelopeEventHandlerResponse", + "OperationEnvelopeEventHandlerResponseStatus", + "OperationEnvelopeFiscalCalendarResponse", + "OperationEnvelopeFiscalCalendarResponseStatus", "OperationEnvelopeInformationBlockEnvelope", "OperationEnvelopeInformationBlockEnvelopeStatus", + "OperationEnvelopeInitializeLedgerResponse", + "OperationEnvelopeInitializeLedgerResponseStatus", + "OperationEnvelopeJournalEntryResponse", + "OperationEnvelopeJournalEntryResponseStatus", + "OperationEnvelopeLedgerAgentResponse", + "OperationEnvelopeLedgerAgentResponseStatus", + "OperationEnvelopeLedgerEntityResponse", + "OperationEnvelopeLedgerEntityResponseStatus", + "OperationEnvelopelistPublishListMemberResponse", + "OperationEnvelopelistPublishListMemberResponseStatus", "OperationEnvelopePortfolioBlockEnvelope", "OperationEnvelopePortfolioBlockEnvelopeStatus", + "OperationEnvelopePreviewEventBlockResponse", + "OperationEnvelopePreviewEventBlockResponseStatus", + "OperationEnvelopePublishListResponse", + "OperationEnvelopePublishListResponseStatus", + "OperationEnvelopeReportResponse", + "OperationEnvelopeReportResponseStatus", "OperationEnvelopeSecurityResponse", "OperationEnvelopeSecurityResponseStatus", + "OperationEnvelopeShareReportResponse", + "OperationEnvelopeShareReportResponseStatus", "OperationEnvelopeStatus", + "OperationEnvelopeTaxonomyBlockEnvelope", + "OperationEnvelopeTaxonomyBlockEnvelopeStatus", "OperationError", "OperationErrorDetailType1", "OrgDetailResponse", @@ -767,6 +960,10 @@ "PortfolioBlockPositions", "PortfolioBlockPositionUpdate", "PositionBlock", + "PreviewEventBlockResponse", + "PreviewEventBlockResponseHandlerMetadata", + "PublishListMemberResponse", + "PublishListResponse", "QueryLimits", "QuickBooksConnectionConfig", "RateLimits", @@ -777,6 +974,8 @@ "RenderingPeriodLite", "RenderingRowLite", "ReopenPeriodOperation", + "ReportResponse", + "ReportResponseRuleSummaryType0", "RepositoryInfo", "RepositorySubscriptions", "ResendVerificationEmailResponseResendverificationemail", @@ -811,6 +1010,8 @@ "ServiceOfferingSummary", "SetCloseTargetOperation", "ShareReportOperation", + "ShareReportResponse", + "ShareResultItem", "SSOCompleteRequest", "SSOExchangeRequest", "SSOExchangeResponse", @@ -818,6 +1019,7 @@ "StatementMechanics", "StorageLimits", "StorageSummary", + "StructureSummary", "StructureUpdatePatch", "StructureUpdatePatchMetadataType0", "SubgraphQuotaResponse", @@ -833,22 +1035,30 @@ "TableListResponse", "TableQueryRequest", "TableQueryResponse", + "TaxonomyBlockAssociation", "TaxonomyBlockAssociationRequest", "TaxonomyBlockAssociationRequestAssociationType", "TaxonomyBlockAssociationRequestMetadata", + "TaxonomyBlockElement", + "TaxonomyBlockElementOrigin", "TaxonomyBlockElementRequest", "TaxonomyBlockElementRequestMetadata", + "TaxonomyBlockEnvelope", + "TaxonomyBlockEnvelopeVerificationResultsItem", + "TaxonomyBlockRule", "TaxonomyBlockRuleRequest", "TaxonomyBlockRuleRequestMetadata", "TaxonomyBlockRuleRequestRuleCategory", "TaxonomyBlockRuleRequestRulePattern", "TaxonomyBlockRuleRequestSeverity", "TaxonomyBlockRuleRequestVariablesItem", + "TaxonomyBlockStructure", "TaxonomyBlockStructureRequest", "TaxonomyBlockStructureRequestMetadata", "TaxonomyBlockStructureRequestStructureType", "TierCapacity", "TokenPricing", + "TransactionPreview", "TransactionSummaryResponse", "TransactionTemplate", "TransactionTemplateEntry", diff --git a/robosystems_client/models/add_publish_list_members_operation.py b/robosystems_client/models/add_publish_list_members_operation.py index 212beea..ff9046f 100644 --- a/robosystems_client/models/add_publish_list_members_operation.py +++ b/robosystems_client/models/add_publish_list_members_operation.py @@ -11,10 +11,12 @@ @_attrs_define class AddPublishListMembersOperation: - """ + """Add recipient graphs to a publish list. + Attributes: - target_graph_ids (list[str]): Graph IDs to add to this list - list_id (str): + target_graph_ids (list[str]): Graph IDs to add. Each must exist and have the same extension (roboledger / + roboinvestor) enabled. Self-graph rejected. + list_id (str): The publish list to add members to. """ target_graph_ids: list[str] diff --git a/robosystems_client/models/association_response.py b/robosystems_client/models/association_response.py new file mode 100644 index 0000000..5fee555 --- /dev/null +++ b/robosystems_client/models/association_response.py @@ -0,0 +1,283 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AssociationResponse") + + +@_attrs_define +class AssociationResponse: + """One edge between two elements within a structure (parent/child + presentation, calculation rollup, mapping, equivalence). + + ``association_type`` discriminates the edge semantics. Mapping edges + are the user-facing path (CoA → reporting concept); presentation / + calculation edges express structure layout and roll-ups. + ``confidence`` is set on AI-suggested mappings (≥0.90 auto-approved, + 0.70-0.89 flagged for review). + + Attributes: + id (str): + structure_id (str): + from_element_id (str): + to_element_id (str): + association_type (str): + from_element_name (None | str | Unset): + from_element_qname (None | str | Unset): + to_element_name (None | str | Unset): + to_element_qname (None | str | Unset): + order_value (float | None | Unset): + weight (float | None | Unset): + confidence (float | None | Unset): + suggested_by (None | str | Unset): + approved_by (None | str | Unset): + """ + + id: str + structure_id: str + from_element_id: str + to_element_id: str + association_type: str + from_element_name: None | str | Unset = UNSET + from_element_qname: None | str | Unset = UNSET + to_element_name: None | str | Unset = UNSET + to_element_qname: None | str | Unset = UNSET + order_value: float | None | Unset = UNSET + weight: float | None | Unset = UNSET + confidence: float | None | Unset = UNSET + suggested_by: None | str | Unset = UNSET + approved_by: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + structure_id = self.structure_id + + from_element_id = self.from_element_id + + to_element_id = self.to_element_id + + association_type = self.association_type + + from_element_name: None | str | Unset + if isinstance(self.from_element_name, Unset): + from_element_name = UNSET + else: + from_element_name = self.from_element_name + + from_element_qname: None | str | Unset + if isinstance(self.from_element_qname, Unset): + from_element_qname = UNSET + else: + from_element_qname = self.from_element_qname + + to_element_name: None | str | Unset + if isinstance(self.to_element_name, Unset): + to_element_name = UNSET + else: + to_element_name = self.to_element_name + + to_element_qname: None | str | Unset + if isinstance(self.to_element_qname, Unset): + to_element_qname = UNSET + else: + to_element_qname = self.to_element_qname + + order_value: float | None | Unset + if isinstance(self.order_value, Unset): + order_value = UNSET + else: + order_value = self.order_value + + weight: float | None | Unset + if isinstance(self.weight, Unset): + weight = UNSET + else: + weight = self.weight + + confidence: float | None | Unset + if isinstance(self.confidence, Unset): + confidence = UNSET + else: + confidence = self.confidence + + suggested_by: None | str | Unset + if isinstance(self.suggested_by, Unset): + suggested_by = UNSET + else: + suggested_by = self.suggested_by + + approved_by: None | str | Unset + if isinstance(self.approved_by, Unset): + approved_by = UNSET + else: + approved_by = self.approved_by + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "structure_id": structure_id, + "from_element_id": from_element_id, + "to_element_id": to_element_id, + "association_type": association_type, + } + ) + if from_element_name is not UNSET: + field_dict["from_element_name"] = from_element_name + if from_element_qname is not UNSET: + field_dict["from_element_qname"] = from_element_qname + if to_element_name is not UNSET: + field_dict["to_element_name"] = to_element_name + if to_element_qname is not UNSET: + field_dict["to_element_qname"] = to_element_qname + if order_value is not UNSET: + field_dict["order_value"] = order_value + if weight is not UNSET: + field_dict["weight"] = weight + if confidence is not UNSET: + field_dict["confidence"] = confidence + if suggested_by is not UNSET: + field_dict["suggested_by"] = suggested_by + if approved_by is not UNSET: + field_dict["approved_by"] = approved_by + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + structure_id = d.pop("structure_id") + + from_element_id = d.pop("from_element_id") + + to_element_id = d.pop("to_element_id") + + association_type = d.pop("association_type") + + def _parse_from_element_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + from_element_name = _parse_from_element_name(d.pop("from_element_name", UNSET)) + + def _parse_from_element_qname(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + from_element_qname = _parse_from_element_qname(d.pop("from_element_qname", UNSET)) + + def _parse_to_element_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + to_element_name = _parse_to_element_name(d.pop("to_element_name", UNSET)) + + def _parse_to_element_qname(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + to_element_qname = _parse_to_element_qname(d.pop("to_element_qname", UNSET)) + + def _parse_order_value(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + order_value = _parse_order_value(d.pop("order_value", UNSET)) + + def _parse_weight(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + weight = _parse_weight(d.pop("weight", UNSET)) + + def _parse_confidence(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + confidence = _parse_confidence(d.pop("confidence", UNSET)) + + def _parse_suggested_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + suggested_by = _parse_suggested_by(d.pop("suggested_by", UNSET)) + + def _parse_approved_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + approved_by = _parse_approved_by(d.pop("approved_by", UNSET)) + + association_response = cls( + id=id, + structure_id=structure_id, + from_element_id=from_element_id, + to_element_id=to_element_id, + association_type=association_type, + from_element_name=from_element_name, + from_element_qname=from_element_qname, + to_element_name=to_element_name, + to_element_qname=to_element_qname, + order_value=order_value, + weight=weight, + confidence=confidence, + suggested_by=suggested_by, + approved_by=approved_by, + ) + + association_response.additional_properties = d + return association_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/auto_map_elements_operation.py b/robosystems_client/models/auto_map_elements_operation.py index 3f76d50..48b3043 100644 --- a/robosystems_client/models/auto_map_elements_operation.py +++ b/robosystems_client/models/auto_map_elements_operation.py @@ -11,10 +11,17 @@ @_attrs_define class AutoMapElementsOperation: - """Request body for the auto-map-elements async operation. + """Run the MappingAgent over a mapping structure (async). - Attributes: - mapping_id (str): + The MappingAgent walks every unmapped CoA element and proposes + associations to reporting concepts. Confidence thresholds: ≥0.90 + auto-approved (association created), 0.70-0.89 flagged for review + (created with `confidence` set; surface it in your UI), <0.70 skipped. + Returns a `pending` envelope immediately; subscribe to the SSE stream + for progress. + + Attributes: + mapping_id (str): The mapping structure to populate. """ mapping_id: str diff --git a/robosystems_client/models/close_period_operation.py b/robosystems_client/models/close_period_operation.py index 2d82466..494f607 100644 --- a/robosystems_client/models/close_period_operation.py +++ b/robosystems_client/models/close_period_operation.py @@ -13,12 +13,15 @@ @_attrs_define class ClosePeriodOperation: - """ - Attributes: - period (str): - note (None | str | Unset): Free-form note attached to the close event - allow_stale_sync (bool | Unset): Override the sync-currency gate. Only use when you have manually verified that - the source data for the period is complete. Default: False. + """Close a single fiscal period. Carries the YYYY-MM `period` in the + request body alongside the close-time options inherited from + :class:`ClosePeriodRequest`. + + Attributes: + period (str): Period to close, in YYYY-MM. Must be exactly `closed_through + 1` — close runs sequentially. + note (None | str | Unset): Free-form note attached to the close event + allow_stale_sync (bool | Unset): Override the sync-currency gate. Only use when you have manually verified that + the source data for the period is complete. Default: False. """ period: str diff --git a/robosystems_client/models/close_period_response.py b/robosystems_client/models/close_period_response.py new file mode 100644 index 0000000..014dd00 --- /dev/null +++ b/robosystems_client/models/close_period_response.py @@ -0,0 +1,97 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.fiscal_calendar_response import FiscalCalendarResponse + + +T = TypeVar("T", bound="ClosePeriodResponse") + + +@_attrs_define +class ClosePeriodResponse: + """Response from a single-period close operation. + + Attributes: + fiscal_calendar (FiscalCalendarResponse): Current fiscal calendar state for a graph. + period (str): + entries_posted (int | Unset): Number of draft entries transitioned to posted Default: 0. + target_auto_advanced (bool | Unset): Whether close_target was auto-advanced because it was reached Default: + False. + """ + + fiscal_calendar: FiscalCalendarResponse + period: str + entries_posted: int | Unset = 0 + target_auto_advanced: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + fiscal_calendar = self.fiscal_calendar.to_dict() + + period = self.period + + entries_posted = self.entries_posted + + target_auto_advanced = self.target_auto_advanced + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "fiscal_calendar": fiscal_calendar, + "period": period, + } + ) + if entries_posted is not UNSET: + field_dict["entries_posted"] = entries_posted + if target_auto_advanced is not UNSET: + field_dict["target_auto_advanced"] = target_auto_advanced + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.fiscal_calendar_response import FiscalCalendarResponse + + d = dict(src_dict) + fiscal_calendar = FiscalCalendarResponse.from_dict(d.pop("fiscal_calendar")) + + period = d.pop("period") + + entries_posted = d.pop("entries_posted", UNSET) + + target_auto_advanced = d.pop("target_auto_advanced", UNSET) + + close_period_response = cls( + fiscal_calendar=fiscal_calendar, + period=period, + entries_posted=entries_posted, + target_auto_advanced=target_auto_advanced, + ) + + close_period_response.additional_properties = d + return close_period_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/create_agent_request.py b/robosystems_client/models/create_agent_request.py index 7392ff8..b9c3340 100644 --- a/robosystems_client/models/create_agent_request.py +++ b/robosystems_client/models/create_agent_request.py @@ -20,24 +20,35 @@ @_attrs_define class CreateAgentRequest: - """ - Attributes: - agent_type (str): 'customer' | 'vendor' | 'employee' | 'owner' | 'supplier' | 'government' | 'lender' | 'self' | - 'other' - name (str): - legal_name (None | str | Unset): - tax_id (None | str | Unset): - registration_number (None | str | Unset): - duns (None | str | Unset): - lei (None | str | Unset): - email (None | str | Unset): - phone (None | str | Unset): - address (CreateAgentRequestAddressType0 | None | Unset): - source (str | Unset): 'quickbooks' | 'xero' | 'plaid' | 'native' Default: 'native'. - external_id (None | str | Unset): - is_active (bool | Unset): Default: True. - is_1099_recipient (bool | Unset): Default: False. - metadata (CreateAgentRequestMetadata | Unset): + """Create a new economic counterparty. + + ``agent_type`` is the relationship category (customer, vendor, + employee, etc.) — the same legal entity may have multiple Agent rows + if they play multiple roles (e.g. a vendor who also became a + customer). ``source`` distinguishes integration-imported rows from + native-created ones; ``external_id`` carries the source-system's + primary key for sync. + + Attributes: + agent_type (str): Relationship category: 'customer' | 'vendor' | 'employee' | 'owner' | 'supplier' | + 'government' | 'lender' | 'self' | 'other'. + name (str): Display name shown in lists and on transactions. + legal_name (None | str | Unset): Full registered legal name (when different from `name`). + tax_id (None | str | Unset): Tax ID (EIN / SSN / VAT). Used for 1099 / withholding reporting. + registration_number (None | str | Unset): Registry-issued company number (e.g. state corp file number). + duns (None | str | Unset): Dun & Bradstreet DUNS number. + lei (None | str | Unset): Legal Entity Identifier (ISO 17442). + email (None | str | Unset): + phone (None | str | Unset): + address (CreateAgentRequestAddressType0 | None | Unset): Free-form address object (e.g. {"line1": "...", "city": + "...", "state": "...", "postal_code": "..."}). + source (str | Unset): Provenance: 'native' (created in-app), 'quickbooks' / 'xero' / 'plaid' (synced from + integration). Drives reconciliation behavior. Default: 'native'. + external_id (None | str | Unset): Source system primary key — used to match on subsequent syncs. + is_active (bool | Unset): Inactive agents stay in history but can't be picked for new txns. Default: True. + is_1099_recipient (bool | Unset): Marks a vendor as 1099-eligible. Drives year-end 1099 reporting. Default: + False. + metadata (CreateAgentRequestMetadata | Unset): """ agent_type: str diff --git a/robosystems_client/models/create_event_handler_request.py b/robosystems_client/models/create_event_handler_request.py index 29b3bf8..fc90086 100644 --- a/robosystems_client/models/create_event_handler_request.py +++ b/robosystems_client/models/create_event_handler_request.py @@ -24,33 +24,49 @@ @_attrs_define class CreateEventHandlerRequest: - """ - Attributes: - name (str): - event_type (str): - transaction_template (TransactionTemplate): The handler's output spec — one or more balanced entries to post. - - Wire shape:: - - { - "transactions": [{ - "entry_template": { - "debit": {"element_id": "elem_...", "amount": "{{ event.amount }}"}, - "credit": {"element_id": "elem_...", "amount": "{{ event.amount }}"} + """Register a new event-type → transaction-template rule. + + When ``create-event-block`` runs with ``apply_handlers=True``, the + registry resolves the *highest-priority active* handler whose match + criteria all match the event, then evaluates the + ``transaction_template`` to produce GL rows. Match precedence: among + active handlers for the same ``event_type``, the one with the most + specific match (more match fields satisfied) wins; ties broken by + ``priority`` desc, then ``created_at`` asc. + + All match fields except ``event_type`` are optional — leaving them + unset matches anything. Use ``match_metadata_expression`` for + fine-grained discrimination (e.g. only payroll categories). + + Attributes: + name (str): Human-readable handler name (unique per graph). + event_type (str): Event type to match. Matches the `event_type` field on incoming events from `create-event- + block`. + transaction_template (TransactionTemplate): The handler's output spec — one or more balanced entries to post. + + Wire shape:: + + { + "transactions": [{ + "entry_template": { + "debit": {"element_id": "elem_...", "amount": "{{ event.amount }}"}, + "credit": {"element_id": "elem_...", "amount": "{{ event.amount }}"} + } + }] } - }] - } - description (None | str | Unset): - event_category (None | str | Unset): - match_source (None | str | Unset): - match_agent_type (None | str | Unset): - match_resource_type (None | str | Unset): - match_metadata_expression (CreateEventHandlerRequestMatchMetadataExpressionType0 | None | Unset): JSONPath-style - equality map against event.metadata, e.g. {"category": "payroll"} or {"metadata.category": "payroll"} - priority (int | Unset): Default: 0. - is_active (bool | Unset): Default: True. - origin (CreateEventHandlerRequestOrigin | Unset): Default: CreateEventHandlerRequestOrigin.TENANT. - metadata (CreateEventHandlerRequestMetadata | Unset): + description (None | str | Unset): Free-form description shown in admin UIs. + event_category (None | str | Unset): Optional category filter (e.g. 'expense', 'revenue'). + match_source (None | str | Unset): Match the event's `source` field (e.g. 'quickbooks', 'plaid'). Useful when + the same event_type comes from multiple integrations. + match_agent_type (None | str | Unset): Match agent-emitted events by agent_type. + match_resource_type (None | str | Unset): Match resource-bound events by resource_type. + match_metadata_expression (CreateEventHandlerRequestMatchMetadataExpressionType0 | None | Unset): JSONPath-style + equality map against event.metadata, e.g. {"category": "payroll"} or {"metadata.category": "payroll"} + priority (int | Unset): Tiebreaker when multiple equally-specific handlers match. Higher = wins. Default: 0. + is_active (bool | Unset): Inactive handlers are ignored at match time. Default: True. + origin (CreateEventHandlerRequestOrigin | Unset): Provenance of the handler. `tenant` = author by graph owner; + `hub` = platform-shipped template (immutable for tenants). Default: CreateEventHandlerRequestOrigin.TENANT. + metadata (CreateEventHandlerRequestMetadata | Unset): Free-form metadata stored alongside the handler. """ name: str diff --git a/robosystems_client/models/create_event_handler_request_metadata.py b/robosystems_client/models/create_event_handler_request_metadata.py index 403f67c..5bfec00 100644 --- a/robosystems_client/models/create_event_handler_request_metadata.py +++ b/robosystems_client/models/create_event_handler_request_metadata.py @@ -11,7 +11,7 @@ @_attrs_define class CreateEventHandlerRequestMetadata: - """ """ + """Free-form metadata stored alongside the handler.""" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) diff --git a/robosystems_client/models/create_mapping_association_operation.py b/robosystems_client/models/create_mapping_association_operation.py index 96d20f0..126ef1c 100644 --- a/robosystems_client/models/create_mapping_association_operation.py +++ b/robosystems_client/models/create_mapping_association_operation.py @@ -16,21 +16,28 @@ @_attrs_define class CreateMappingAssociationOperation: - """CQRS-shaped body for `POST /operations/create-mapping-association`. + """Create one CoA → reporting-concept mapping edge. - Bundles the target mapping structure's `mapping_id` with the association - payload so REST + MCP share a single body type via the registrar. + This is the iterative, AI-assisted craft path. Each call adds a single + association to the target mapping structure. Use `auto-map-elements` + to create many at once via the MappingAgent. Reject duplicates: if + the (from, to, type) tuple already exists, the call returns 409. Attributes: - from_element_id (str): - to_element_id (str): + from_element_id (str): Source element (typically a CoA element). + to_element_id (str): Target element (typically a US GAAP reporting concept). mapping_id (str): Target mapping structure ID. - association_type (CreateMappingAssociationOperationAssociationType | Unset): Default: + association_type (CreateMappingAssociationOperationAssociationType | Unset): Edge semantics. `mapping` rolls up + CoA elements into reporting concepts; `presentation` orders concepts in a structure; `calculation` carries + debit/credit weights; `equivalence` is a synonym link. Default: CreateMappingAssociationOperationAssociationType.MAPPING. - order_value (float | None | Unset): - weight (float | None | Unset): - confidence (float | None | Unset): - suggested_by (None | str | Unset): + order_value (float | None | Unset): Display order within the structure (lower = earlier). + weight (float | None | Unset): Calculation weight (typically +1.0 or -1.0). Used by calculation linkbases to + express signed roll-ups. + confidence (float | None | Unset): Confidence score (0–1). For AI-suggested mappings: ≥0.90 auto-approved, + 0.70–0.89 flagged for review, <0.70 skipped. + suggested_by (None | str | Unset): Source of the suggestion (e.g., 'mapping_agent', 'user'). Captured for audit; + not used by the runtime. """ from_element_id: str diff --git a/robosystems_client/models/create_publish_list_request.py b/robosystems_client/models/create_publish_list_request.py index 4f1c949..df33ba8 100644 --- a/robosystems_client/models/create_publish_list_request.py +++ b/robosystems_client/models/create_publish_list_request.py @@ -13,10 +13,12 @@ @_attrs_define class CreatePublishListRequest: - """ - Attributes: - name (str): List name - description (None | str | Unset): Optional description + """Create a new publish list. Members are added separately via + `add-publish-list-members`. + + Attributes: + name (str): Human-readable list name (must be unique per graph). + description (None | str | Unset): Free-form description shown to list owners. """ name: str diff --git a/robosystems_client/models/create_report_request.py b/robosystems_client/models/create_report_request.py index 4bed6a5..4704c14 100644 --- a/robosystems_client/models/create_report_request.py +++ b/robosystems_client/models/create_report_request.py @@ -19,18 +19,36 @@ @_attrs_define class CreateReportRequest: - """ - Attributes: - name (str): Report name - mapping_id (str): Mapping structure ID for CoA→GAAP rollup - period_start (datetime.date): Period start date (inclusive) - period_end (datetime.date): Period end date (inclusive) - taxonomy_id (str | Unset): Taxonomy ID — determines which structures are available Default: - 'tax_usgaap_reporting'. - period_type (str | Unset): Period type: monthly, quarterly, annual Default: 'quarterly'. - comparative (bool | Unset): Include prior period comparison Default: True. - periods (list[PeriodSpec] | None | Unset): Multi-period columns. Overrides period_start/period_end/comparative - when set. + """Generate report facts from the ledger and publish a Report definition. + + The report is materialized synchronously: we resolve the taxonomy + + CoA mapping, roll up GL facts into reportable concepts, attach them + to a fresh ``Report`` row, evaluate any reporting-rule structures + (cell-level checks), and stamp ``generation_status='published'``. + Subsequent ``regenerate-report`` calls re-run the same pipeline against + the latest ledger state without creating a new Report row. + + ``period_start``/``period_end``/``comparative`` is the simple path + (auto-derives current + prior period). For multi-column reports + (YTD-by-quarter, multi-year) supply ``periods`` explicitly — when + set, ``period_start``/``period_end``/``comparative`` are ignored as + inputs to period generation. + + Attributes: + name (str): Human-readable report name shown in lists and headers. + mapping_id (str): Mapping structure that rolls up the tenant's chart of accounts to the taxonomy's reporting + concepts. Created via `create-mapping-association` / `auto-map-elements`. + period_start (datetime.date): Current-period start (inclusive). Ignored when `periods` is supplied. + period_end (datetime.date): Current-period end (inclusive). Must be >= `period_start`. Ignored when `periods` is + supplied. + taxonomy_id (str | Unset): Taxonomy that defines the structures (BS / IS / CF / Equity / Schedules) this report + can render. Defaults to the platform US GAAP reporting taxonomy. Default: 'tax_usgaap_reporting'. + period_type (str | Unset): Period cadence: `monthly`, `quarterly`, or `annual`. Default: 'quarterly'. + comparative (bool | Unset): When true, automatically generates a prior-period column (same length as the current + period). Ignored when `periods` is supplied. Default: True. + periods (list[PeriodSpec] | None | Unset): Explicit period columns. When set, overrides + `period_start`/`period_end`/`comparative`. Use for multi-period layouts (YTD-by-quarter, multi-year, custom + rolling windows). """ name: str diff --git a/robosystems_client/models/delete_journal_entry_request.py b/robosystems_client/models/delete_journal_entry_request.py index dd3edd0..83780d4 100644 --- a/robosystems_client/models/delete_journal_entry_request.py +++ b/robosystems_client/models/delete_journal_entry_request.py @@ -15,7 +15,7 @@ class DeleteJournalEntryRequest: deleted — reverse them instead. Attributes: - entry_id (str): + entry_id (str): The draft entry to delete. """ entry_id: str diff --git a/robosystems_client/models/delete_mapping_association_operation.py b/robosystems_client/models/delete_mapping_association_operation.py index 9ee674f..a450f9c 100644 --- a/robosystems_client/models/delete_mapping_association_operation.py +++ b/robosystems_client/models/delete_mapping_association_operation.py @@ -11,10 +11,11 @@ @_attrs_define class DeleteMappingAssociationOperation: - """ + """Delete a single CoA → reporting-concept mapping edge. + Attributes: - mapping_id (str): - association_id (str): + mapping_id (str): The mapping structure containing the association. + association_id (str): The association edge to delete. """ mapping_id: str diff --git a/robosystems_client/models/delete_publish_list_operation.py b/robosystems_client/models/delete_publish_list_operation.py index 4d5cce3..645acd1 100644 --- a/robosystems_client/models/delete_publish_list_operation.py +++ b/robosystems_client/models/delete_publish_list_operation.py @@ -11,9 +11,12 @@ @_attrs_define class DeletePublishListOperation: - """ - Attributes: - list_id (str): + """Delete a publish list. All membership rows are removed; reports + previously shared via this list are not affected (each share is an + independent copy in the recipient's graph). + + Attributes: + list_id (str): The publish list to delete. """ list_id: str diff --git a/robosystems_client/models/delete_report_operation.py b/robosystems_client/models/delete_report_operation.py index d82022e..c8810e0 100644 --- a/robosystems_client/models/delete_report_operation.py +++ b/robosystems_client/models/delete_report_operation.py @@ -11,9 +11,10 @@ @_attrs_define class DeleteReportOperation: - """ + """Delete a Report definition and all its facts. + Attributes: - report_id (str): + report_id (str): The Report to delete. """ report_id: str diff --git a/robosystems_client/models/delete_result.py b/robosystems_client/models/delete_result.py index 484cf7f..2aa1d64 100644 --- a/robosystems_client/models/delete_result.py +++ b/robosystems_client/models/delete_result.py @@ -11,13 +11,20 @@ @_attrs_define class DeleteResult: - """Shared response shape for soft-delete operations (e.g., - `delete-security`). `deleted=true` means a row was flipped; 404 is - raised by the handler when no row existed. + """Shared response shape for delete / soft-delete operations. + + ``deleted=True`` means the operation succeeded (a row was deleted or + flipped). The handler returns 404 instead when the row didn't exist + to begin with — the response shape is never used to communicate "not + found". + + Defined once here to avoid OpenAPI components key collisions + between roboledger and roboinvestor (both surfaces produced + separate ``DeleteResult`` classes before consolidation). Attributes: - deleted (bool): `true` when the row was soft-deleted in this call. Always `true` on a 200 response; the 404 path - is taken instead when the row didn't exist. + deleted (bool): `true` when the row was deleted in this call. Always `true` today — 404 covers the not-found + case at the HTTP layer rather than via this field. """ deleted: bool diff --git a/robosystems_client/models/delete_taxonomy_block_request.py b/robosystems_client/models/delete_taxonomy_block_request.py index c743604..62f4191 100644 --- a/robosystems_client/models/delete_taxonomy_block_request.py +++ b/robosystems_client/models/delete_taxonomy_block_request.py @@ -21,9 +21,10 @@ class DeleteTaxonomyBlockRequest: ``facts_deleted``. Attributes: - taxonomy_id (str): + taxonomy_id (str): The taxonomy to delete. reason (str): Human-readable justification (audit log). - cascade_facts (bool | Unset): Default: False. + cascade_facts (bool | Unset): When true, also deletes any Fact rows referencing elements in this taxonomy. When + false (default), the operation fails with 422 if such rows exist. Default: False. """ taxonomy_id: str diff --git a/robosystems_client/models/delete_taxonomy_block_response.py b/robosystems_client/models/delete_taxonomy_block_response.py new file mode 100644 index 0000000..1bb0c26 --- /dev/null +++ b/robosystems_client/models/delete_taxonomy_block_response.py @@ -0,0 +1,99 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="DeleteTaxonomyBlockResponse") + + +@_attrs_define +class DeleteTaxonomyBlockResponse: + """Response for ``delete-taxonomy-block``. + + Attributes: + taxonomy_id (str): + name (str): + deleted (bool | Unset): Default: True. + facts_deleted (int | Unset): Default: 0. + cascade_applied (bool | Unset): Default: False. + """ + + taxonomy_id: str + name: str + deleted: bool | Unset = True + facts_deleted: int | Unset = 0 + cascade_applied: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + taxonomy_id = self.taxonomy_id + + name = self.name + + deleted = self.deleted + + facts_deleted = self.facts_deleted + + cascade_applied = self.cascade_applied + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "taxonomy_id": taxonomy_id, + "name": name, + } + ) + if deleted is not UNSET: + field_dict["deleted"] = deleted + if facts_deleted is not UNSET: + field_dict["facts_deleted"] = facts_deleted + if cascade_applied is not UNSET: + field_dict["cascade_applied"] = cascade_applied + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + taxonomy_id = d.pop("taxonomy_id") + + name = d.pop("name") + + deleted = d.pop("deleted", UNSET) + + facts_deleted = d.pop("facts_deleted", UNSET) + + cascade_applied = d.pop("cascade_applied", UNSET) + + delete_taxonomy_block_response = cls( + taxonomy_id=taxonomy_id, + name=name, + deleted=deleted, + facts_deleted=facts_deleted, + cascade_applied=cascade_applied, + ) + + delete_taxonomy_block_response.additional_properties = d + return delete_taxonomy_block_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/entity_taxonomy_response.py b/robosystems_client/models/entity_taxonomy_response.py new file mode 100644 index 0000000..55315b7 --- /dev/null +++ b/robosystems_client/models/entity_taxonomy_response.py @@ -0,0 +1,108 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="EntityTaxonomyResponse") + + +@_attrs_define +class EntityTaxonomyResponse: + """Result of `link-entity-taxonomy` — the ENTITY_HAS_TAXONOMY edge. + + Attributes: + entity_id (str): The entity that was linked. + taxonomy_id (str): The taxonomy that was linked. + basis (str): Linkage role (see request). + is_primary (bool): Whether this is the primary linkage. + adoption_context (None | str | Unset): Adoption context recorded at link time. + """ + + entity_id: str + taxonomy_id: str + basis: str + is_primary: bool + adoption_context: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + entity_id = self.entity_id + + taxonomy_id = self.taxonomy_id + + basis = self.basis + + is_primary = self.is_primary + + adoption_context: None | str | Unset + if isinstance(self.adoption_context, Unset): + adoption_context = UNSET + else: + adoption_context = self.adoption_context + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "entity_id": entity_id, + "taxonomy_id": taxonomy_id, + "basis": basis, + "is_primary": is_primary, + } + ) + if adoption_context is not UNSET: + field_dict["adoption_context"] = adoption_context + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + entity_id = d.pop("entity_id") + + taxonomy_id = d.pop("taxonomy_id") + + basis = d.pop("basis") + + is_primary = d.pop("is_primary") + + def _parse_adoption_context(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + adoption_context = _parse_adoption_context(d.pop("adoption_context", UNSET)) + + entity_taxonomy_response = cls( + entity_id=entity_id, + taxonomy_id=taxonomy_id, + basis=basis, + is_primary=is_primary, + adoption_context=adoption_context, + ) + + entity_taxonomy_response.additional_properties = d + return entity_taxonomy_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/evaluate_rules_request.py b/robosystems_client/models/evaluate_rules_request.py index c8badc2..db2842f 100644 --- a/robosystems_client/models/evaluate_rules_request.py +++ b/robosystems_client/models/evaluate_rules_request.py @@ -27,7 +27,8 @@ class EvaluateRulesRequest: for each element regardless of period. Attributes: - structure_id (str): + structure_id (str): Structure to evaluate rules for. Resolves all rules scoped to this structure plus rules + attached to its elements and associations. fact_set_id (None | str | Unset): Optional FactSet id to stamp on each VerificationResult row. Allows results to be scoped to a specific period run once write paths populate the FactSet table on every run. period_start (datetime.date | None | Unset): Lower bound on the fact period window (inclusive). diff --git a/robosystems_client/models/evaluate_rules_response.py b/robosystems_client/models/evaluate_rules_response.py new file mode 100644 index 0000000..aa08ea2 --- /dev/null +++ b/robosystems_client/models/evaluate_rules_response.py @@ -0,0 +1,109 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.evaluate_rules_response_summary import EvaluateRulesResponseSummary + from ..models.verification_result_lite import VerificationResultLite + + +T = TypeVar("T", bound="EvaluateRulesResponse") + + +@_attrs_define +class EvaluateRulesResponse: + """Response for the ``evaluate-rules`` operation. + + ``results`` is the full list of :class:`VerificationResultLite` rows + written by this evaluation run. ``summary`` gives counts keyed by + status for quick display without iterating the list. + + Attributes: + structure_id (str): + results (list[VerificationResultLite]): + summary (EvaluateRulesResponseSummary | Unset): Status counts keyed by outcome string: ``{'pass': N, 'fail': N, + 'error': N, 'skipped': N}``. + """ + + structure_id: str + results: list[VerificationResultLite] + summary: EvaluateRulesResponseSummary | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + structure_id = self.structure_id + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + summary: dict[str, Any] | Unset = UNSET + if not isinstance(self.summary, Unset): + summary = self.summary.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "structure_id": structure_id, + "results": results, + } + ) + if summary is not UNSET: + field_dict["summary"] = summary + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.evaluate_rules_response_summary import EvaluateRulesResponseSummary + from ..models.verification_result_lite import VerificationResultLite + + d = dict(src_dict) + structure_id = d.pop("structure_id") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = VerificationResultLite.from_dict(results_item_data) + + results.append(results_item) + + _summary = d.pop("summary", UNSET) + summary: EvaluateRulesResponseSummary | Unset + if isinstance(_summary, Unset): + summary = UNSET + else: + summary = EvaluateRulesResponseSummary.from_dict(_summary) + + evaluate_rules_response = cls( + structure_id=structure_id, + results=results, + summary=summary, + ) + + evaluate_rules_response.additional_properties = d + return evaluate_rules_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/evaluate_rules_response_summary.py b/robosystems_client/models/evaluate_rules_response_summary.py new file mode 100644 index 0000000..22858f4 --- /dev/null +++ b/robosystems_client/models/evaluate_rules_response_summary.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="EvaluateRulesResponseSummary") + + +@_attrs_define +class EvaluateRulesResponseSummary: + """Status counts keyed by outcome string: ``{'pass': N, 'fail': N, 'error': N, 'skipped': N}``.""" + + additional_properties: dict[str, int] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + evaluate_rules_response_summary = cls() + + evaluate_rules_response_summary.additional_properties = d + return evaluate_rules_response_summary + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> int: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: int) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/event_handler_response.py b/robosystems_client/models/event_handler_response.py new file mode 100644 index 0000000..8422c93 --- /dev/null +++ b/robosystems_client/models/event_handler_response.py @@ -0,0 +1,447 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.event_handler_response_match_metadata_expression_type_0 import ( + EventHandlerResponseMatchMetadataExpressionType0, + ) + from ..models.event_handler_response_transaction_template import ( + EventHandlerResponseTransactionTemplate, + ) + + +T = TypeVar("T", bound="EventHandlerResponse") + + +@_attrs_define +class EventHandlerResponse: + """ + Attributes: + id (str): + name (str): + event_type (str): + transaction_template (EventHandlerResponseTransactionTemplate): + priority (int): + is_active (bool): + origin (str): + description (None | str | Unset): + event_category (None | str | Unset): + match_source (None | str | Unset): + match_agent_type (None | str | Unset): + match_resource_type (None | str | Unset): + match_metadata_expression (EventHandlerResponseMatchMetadataExpressionType0 | None | Unset): + suggested_by (None | str | Unset): + confidence (float | None | Unset): + approved_by (None | str | Unset): + approved_at (datetime.datetime | None | Unset): + created_at (datetime.datetime | None | Unset): + updated_at (datetime.datetime | None | Unset): + created_by (None | str | Unset): + """ + + id: str + name: str + event_type: str + transaction_template: EventHandlerResponseTransactionTemplate + priority: int + is_active: bool + origin: str + description: None | str | Unset = UNSET + event_category: None | str | Unset = UNSET + match_source: None | str | Unset = UNSET + match_agent_type: None | str | Unset = UNSET + match_resource_type: None | str | Unset = UNSET + match_metadata_expression: ( + EventHandlerResponseMatchMetadataExpressionType0 | None | Unset + ) = UNSET + suggested_by: None | str | Unset = UNSET + confidence: float | None | Unset = UNSET + approved_by: None | str | Unset = UNSET + approved_at: datetime.datetime | None | Unset = UNSET + created_at: datetime.datetime | None | Unset = UNSET + updated_at: datetime.datetime | None | Unset = UNSET + created_by: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.event_handler_response_match_metadata_expression_type_0 import ( + EventHandlerResponseMatchMetadataExpressionType0, + ) + + id = self.id + + name = self.name + + event_type = self.event_type + + transaction_template = self.transaction_template.to_dict() + + priority = self.priority + + is_active = self.is_active + + origin = self.origin + + description: None | str | Unset + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + event_category: None | str | Unset + if isinstance(self.event_category, Unset): + event_category = UNSET + else: + event_category = self.event_category + + match_source: None | str | Unset + if isinstance(self.match_source, Unset): + match_source = UNSET + else: + match_source = self.match_source + + match_agent_type: None | str | Unset + if isinstance(self.match_agent_type, Unset): + match_agent_type = UNSET + else: + match_agent_type = self.match_agent_type + + match_resource_type: None | str | Unset + if isinstance(self.match_resource_type, Unset): + match_resource_type = UNSET + else: + match_resource_type = self.match_resource_type + + match_metadata_expression: dict[str, Any] | None | Unset + if isinstance(self.match_metadata_expression, Unset): + match_metadata_expression = UNSET + elif isinstance( + self.match_metadata_expression, EventHandlerResponseMatchMetadataExpressionType0 + ): + match_metadata_expression = self.match_metadata_expression.to_dict() + else: + match_metadata_expression = self.match_metadata_expression + + suggested_by: None | str | Unset + if isinstance(self.suggested_by, Unset): + suggested_by = UNSET + else: + suggested_by = self.suggested_by + + confidence: float | None | Unset + if isinstance(self.confidence, Unset): + confidence = UNSET + else: + confidence = self.confidence + + approved_by: None | str | Unset + if isinstance(self.approved_by, Unset): + approved_by = UNSET + else: + approved_by = self.approved_by + + approved_at: None | str | Unset + if isinstance(self.approved_at, Unset): + approved_at = UNSET + elif isinstance(self.approved_at, datetime.datetime): + approved_at = self.approved_at.isoformat() + else: + approved_at = self.approved_at + + created_at: None | str | Unset + if isinstance(self.created_at, Unset): + created_at = UNSET + elif isinstance(self.created_at, datetime.datetime): + created_at = self.created_at.isoformat() + else: + created_at = self.created_at + + updated_at: None | str | Unset + if isinstance(self.updated_at, Unset): + updated_at = UNSET + elif isinstance(self.updated_at, datetime.datetime): + updated_at = self.updated_at.isoformat() + else: + updated_at = self.updated_at + + created_by: None | str | Unset + if isinstance(self.created_by, Unset): + created_by = UNSET + else: + created_by = self.created_by + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "name": name, + "event_type": event_type, + "transaction_template": transaction_template, + "priority": priority, + "is_active": is_active, + "origin": origin, + } + ) + if description is not UNSET: + field_dict["description"] = description + if event_category is not UNSET: + field_dict["event_category"] = event_category + if match_source is not UNSET: + field_dict["match_source"] = match_source + if match_agent_type is not UNSET: + field_dict["match_agent_type"] = match_agent_type + if match_resource_type is not UNSET: + field_dict["match_resource_type"] = match_resource_type + if match_metadata_expression is not UNSET: + field_dict["match_metadata_expression"] = match_metadata_expression + if suggested_by is not UNSET: + field_dict["suggested_by"] = suggested_by + if confidence is not UNSET: + field_dict["confidence"] = confidence + if approved_by is not UNSET: + field_dict["approved_by"] = approved_by + if approved_at is not UNSET: + field_dict["approved_at"] = approved_at + if created_at is not UNSET: + field_dict["created_at"] = created_at + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + if created_by is not UNSET: + field_dict["created_by"] = created_by + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.event_handler_response_match_metadata_expression_type_0 import ( + EventHandlerResponseMatchMetadataExpressionType0, + ) + from ..models.event_handler_response_transaction_template import ( + EventHandlerResponseTransactionTemplate, + ) + + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name") + + event_type = d.pop("event_type") + + transaction_template = EventHandlerResponseTransactionTemplate.from_dict( + d.pop("transaction_template") + ) + + priority = d.pop("priority") + + is_active = d.pop("is_active") + + origin = d.pop("origin") + + def _parse_description(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + description = _parse_description(d.pop("description", UNSET)) + + def _parse_event_category(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + event_category = _parse_event_category(d.pop("event_category", UNSET)) + + def _parse_match_source(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + match_source = _parse_match_source(d.pop("match_source", UNSET)) + + def _parse_match_agent_type(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + match_agent_type = _parse_match_agent_type(d.pop("match_agent_type", UNSET)) + + def _parse_match_resource_type(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + match_resource_type = _parse_match_resource_type( + d.pop("match_resource_type", UNSET) + ) + + def _parse_match_metadata_expression( + data: object, + ) -> EventHandlerResponseMatchMetadataExpressionType0 | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + match_metadata_expression_type_0 = ( + EventHandlerResponseMatchMetadataExpressionType0.from_dict(data) + ) + + return match_metadata_expression_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(EventHandlerResponseMatchMetadataExpressionType0 | None | Unset, data) + + match_metadata_expression = _parse_match_metadata_expression( + d.pop("match_metadata_expression", UNSET) + ) + + def _parse_suggested_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + suggested_by = _parse_suggested_by(d.pop("suggested_by", UNSET)) + + def _parse_confidence(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + confidence = _parse_confidence(d.pop("confidence", UNSET)) + + def _parse_approved_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + approved_by = _parse_approved_by(d.pop("approved_by", UNSET)) + + def _parse_approved_at(data: object) -> datetime.datetime | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + approved_at_type_0 = isoparse(data) + + return approved_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None | Unset, data) + + approved_at = _parse_approved_at(d.pop("approved_at", UNSET)) + + def _parse_created_at(data: object) -> datetime.datetime | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + created_at_type_0 = isoparse(data) + + return created_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None | Unset, data) + + created_at = _parse_created_at(d.pop("created_at", UNSET)) + + def _parse_updated_at(data: object) -> datetime.datetime | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + updated_at_type_0 = isoparse(data) + + return updated_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None | Unset, data) + + updated_at = _parse_updated_at(d.pop("updated_at", UNSET)) + + def _parse_created_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + created_by = _parse_created_by(d.pop("created_by", UNSET)) + + event_handler_response = cls( + id=id, + name=name, + event_type=event_type, + transaction_template=transaction_template, + priority=priority, + is_active=is_active, + origin=origin, + description=description, + event_category=event_category, + match_source=match_source, + match_agent_type=match_agent_type, + match_resource_type=match_resource_type, + match_metadata_expression=match_metadata_expression, + suggested_by=suggested_by, + confidence=confidence, + approved_by=approved_by, + approved_at=approved_at, + created_at=created_at, + updated_at=updated_at, + created_by=created_by, + ) + + event_handler_response.additional_properties = d + return event_handler_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/event_handler_response_match_metadata_expression_type_0.py b/robosystems_client/models/event_handler_response_match_metadata_expression_type_0.py new file mode 100644 index 0000000..f630fa1 --- /dev/null +++ b/robosystems_client/models/event_handler_response_match_metadata_expression_type_0.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="EventHandlerResponseMatchMetadataExpressionType0") + + +@_attrs_define +class EventHandlerResponseMatchMetadataExpressionType0: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + event_handler_response_match_metadata_expression_type_0 = cls() + + event_handler_response_match_metadata_expression_type_0.additional_properties = d + return event_handler_response_match_metadata_expression_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/event_handler_response_transaction_template.py b/robosystems_client/models/event_handler_response_transaction_template.py new file mode 100644 index 0000000..85a252c --- /dev/null +++ b/robosystems_client/models/event_handler_response_transaction_template.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="EventHandlerResponseTransactionTemplate") + + +@_attrs_define +class EventHandlerResponseTransactionTemplate: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + event_handler_response_transaction_template = cls() + + event_handler_response_transaction_template.additional_properties = d + return event_handler_response_transaction_template + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/file_report_request.py b/robosystems_client/models/file_report_request.py index 22bcaff..930cf65 100644 --- a/robosystems_client/models/file_report_request.py +++ b/robosystems_client/models/file_report_request.py @@ -17,6 +17,8 @@ class FileReportRequest: ``filed_at`` are stamped from the auth context + server clock; the request itself carries no fields today (kept as a model for OpenAPI shape consistency and to avoid breaking changes if we add fields). + Use ``transition-filing-status`` for the non-file legs of the + lifecycle (`draft ↔ under_review`, `filed → archived`). Attributes: report_id (str): The Report to file. diff --git a/robosystems_client/models/fiscal_calendar_response.py b/robosystems_client/models/fiscal_calendar_response.py new file mode 100644 index 0000000..e40ba23 --- /dev/null +++ b/robosystems_client/models/fiscal_calendar_response.py @@ -0,0 +1,274 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.fiscal_period_summary import FiscalPeriodSummary + + +T = TypeVar("T", bound="FiscalCalendarResponse") + + +@_attrs_define +class FiscalCalendarResponse: + """Current fiscal calendar state for a graph. + + Attributes: + graph_id (str): + fiscal_year_start_month (int): + closed_through (None | str | Unset): Latest closed period (YYYY-MM), or null if nothing closed + close_target (None | str | Unset): Target period the user wants closed through (YYYY-MM) + gap_periods (int | Unset): Number of periods between closed_through and close_target (inclusive of + close_target). 0 means caught up. Default: 0. + catch_up_sequence (list[str] | Unset): Ordered list of periods that a close run would process + closeable_now (bool | Unset): Whether the next period in the catch-up sequence passes all closeable gates + Default: False. + blockers (list[str] | Unset): Structured blocker codes when closeable_now is False: 'sequence_violation', + 'period_incomplete', 'sync_stale', 'calendar_not_initialized', 'period_already_closed' + last_close_at (datetime.datetime | None | Unset): + initialized_at (datetime.datetime | None | Unset): + last_sync_at (datetime.datetime | None | Unset): Most recent QB sync timestamp (if connected) + periods (list[FiscalPeriodSummary] | Unset): Fiscal period rows for this graph + """ + + graph_id: str + fiscal_year_start_month: int + closed_through: None | str | Unset = UNSET + close_target: None | str | Unset = UNSET + gap_periods: int | Unset = 0 + catch_up_sequence: list[str] | Unset = UNSET + closeable_now: bool | Unset = False + blockers: list[str] | Unset = UNSET + last_close_at: datetime.datetime | None | Unset = UNSET + initialized_at: datetime.datetime | None | Unset = UNSET + last_sync_at: datetime.datetime | None | Unset = UNSET + periods: list[FiscalPeriodSummary] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + graph_id = self.graph_id + + fiscal_year_start_month = self.fiscal_year_start_month + + closed_through: None | str | Unset + if isinstance(self.closed_through, Unset): + closed_through = UNSET + else: + closed_through = self.closed_through + + close_target: None | str | Unset + if isinstance(self.close_target, Unset): + close_target = UNSET + else: + close_target = self.close_target + + gap_periods = self.gap_periods + + catch_up_sequence: list[str] | Unset = UNSET + if not isinstance(self.catch_up_sequence, Unset): + catch_up_sequence = self.catch_up_sequence + + closeable_now = self.closeable_now + + blockers: list[str] | Unset = UNSET + if not isinstance(self.blockers, Unset): + blockers = self.blockers + + last_close_at: None | str | Unset + if isinstance(self.last_close_at, Unset): + last_close_at = UNSET + elif isinstance(self.last_close_at, datetime.datetime): + last_close_at = self.last_close_at.isoformat() + else: + last_close_at = self.last_close_at + + initialized_at: None | str | Unset + if isinstance(self.initialized_at, Unset): + initialized_at = UNSET + elif isinstance(self.initialized_at, datetime.datetime): + initialized_at = self.initialized_at.isoformat() + else: + initialized_at = self.initialized_at + + last_sync_at: None | str | Unset + if isinstance(self.last_sync_at, Unset): + last_sync_at = UNSET + elif isinstance(self.last_sync_at, datetime.datetime): + last_sync_at = self.last_sync_at.isoformat() + else: + last_sync_at = self.last_sync_at + + periods: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.periods, Unset): + periods = [] + for periods_item_data in self.periods: + periods_item = periods_item_data.to_dict() + periods.append(periods_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "graph_id": graph_id, + "fiscal_year_start_month": fiscal_year_start_month, + } + ) + if closed_through is not UNSET: + field_dict["closed_through"] = closed_through + if close_target is not UNSET: + field_dict["close_target"] = close_target + if gap_periods is not UNSET: + field_dict["gap_periods"] = gap_periods + if catch_up_sequence is not UNSET: + field_dict["catch_up_sequence"] = catch_up_sequence + if closeable_now is not UNSET: + field_dict["closeable_now"] = closeable_now + if blockers is not UNSET: + field_dict["blockers"] = blockers + if last_close_at is not UNSET: + field_dict["last_close_at"] = last_close_at + if initialized_at is not UNSET: + field_dict["initialized_at"] = initialized_at + if last_sync_at is not UNSET: + field_dict["last_sync_at"] = last_sync_at + if periods is not UNSET: + field_dict["periods"] = periods + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.fiscal_period_summary import FiscalPeriodSummary + + d = dict(src_dict) + graph_id = d.pop("graph_id") + + fiscal_year_start_month = d.pop("fiscal_year_start_month") + + def _parse_closed_through(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + closed_through = _parse_closed_through(d.pop("closed_through", UNSET)) + + def _parse_close_target(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + close_target = _parse_close_target(d.pop("close_target", UNSET)) + + gap_periods = d.pop("gap_periods", UNSET) + + catch_up_sequence = cast(list[str], d.pop("catch_up_sequence", UNSET)) + + closeable_now = d.pop("closeable_now", UNSET) + + blockers = cast(list[str], d.pop("blockers", UNSET)) + + def _parse_last_close_at(data: object) -> datetime.datetime | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + last_close_at_type_0 = isoparse(data) + + return last_close_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None | Unset, data) + + last_close_at = _parse_last_close_at(d.pop("last_close_at", UNSET)) + + def _parse_initialized_at(data: object) -> datetime.datetime | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + initialized_at_type_0 = isoparse(data) + + return initialized_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None | Unset, data) + + initialized_at = _parse_initialized_at(d.pop("initialized_at", UNSET)) + + def _parse_last_sync_at(data: object) -> datetime.datetime | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + last_sync_at_type_0 = isoparse(data) + + return last_sync_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None | Unset, data) + + last_sync_at = _parse_last_sync_at(d.pop("last_sync_at", UNSET)) + + _periods = d.pop("periods", UNSET) + periods: list[FiscalPeriodSummary] | Unset = UNSET + if _periods is not UNSET: + periods = [] + for periods_item_data in _periods: + periods_item = FiscalPeriodSummary.from_dict(periods_item_data) + + periods.append(periods_item) + + fiscal_calendar_response = cls( + graph_id=graph_id, + fiscal_year_start_month=fiscal_year_start_month, + closed_through=closed_through, + close_target=close_target, + gap_periods=gap_periods, + catch_up_sequence=catch_up_sequence, + closeable_now=closeable_now, + blockers=blockers, + last_close_at=last_close_at, + initialized_at=initialized_at, + last_sync_at=last_sync_at, + periods=periods, + ) + + fiscal_calendar_response.additional_properties = d + return fiscal_calendar_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/fiscal_period_summary.py b/robosystems_client/models/fiscal_period_summary.py new file mode 100644 index 0000000..6d3d324 --- /dev/null +++ b/robosystems_client/models/fiscal_period_summary.py @@ -0,0 +1,124 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="FiscalPeriodSummary") + + +@_attrs_define +class FiscalPeriodSummary: + """One fiscal period row — header view used in calendar listings. + + Status lifecycle: ``open`` → ``closing`` → ``closed``. ``closing`` + is the transient state during a close run; ``closed_at`` stamps when + the lock landed. + + Attributes: + name (str): Period name (YYYY-MM) + start_date (datetime.date): + end_date (datetime.date): + status (str): 'open' | 'closing' | 'closed' + closed_at (datetime.datetime | None | Unset): + """ + + name: str + start_date: datetime.date + end_date: datetime.date + status: str + closed_at: datetime.datetime | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + name = self.name + + start_date = self.start_date.isoformat() + + end_date = self.end_date.isoformat() + + status = self.status + + closed_at: None | str | Unset + if isinstance(self.closed_at, Unset): + closed_at = UNSET + elif isinstance(self.closed_at, datetime.datetime): + closed_at = self.closed_at.isoformat() + else: + closed_at = self.closed_at + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "name": name, + "start_date": start_date, + "end_date": end_date, + "status": status, + } + ) + if closed_at is not UNSET: + field_dict["closed_at"] = closed_at + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + start_date = isoparse(d.pop("start_date")).date() + + end_date = isoparse(d.pop("end_date")).date() + + status = d.pop("status") + + def _parse_closed_at(data: object) -> datetime.datetime | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + closed_at_type_0 = isoparse(data) + + return closed_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None | Unset, data) + + closed_at = _parse_closed_at(d.pop("closed_at", UNSET)) + + fiscal_period_summary = cls( + name=name, + start_date=start_date, + end_date=end_date, + status=status, + closed_at=closed_at, + ) + + fiscal_period_summary.additional_properties = d + return fiscal_period_summary + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/initialize_ledger_request.py b/robosystems_client/models/initialize_ledger_request.py index c75d38b..94da5bc 100644 --- a/robosystems_client/models/initialize_ledger_request.py +++ b/robosystems_client/models/initialize_ledger_request.py @@ -13,16 +13,30 @@ @_attrs_define class InitializeLedgerRequest: - """ - Attributes: - closed_through (None | str | Unset): YYYY-MM period. Periods ≤ this date are treated as historical (already - closed before the user joined). Set to null for a fresh business with no prior close state. - fiscal_year_start_month (int | Unset): Fiscal year start month (1-12). Defaults to calendar year. Default: 1. - auto_seed_schedules (bool | Unset): If true, run the SchedulerAgent to create schedules from historical BS - activity. NOT YET IMPLEMENTED — returns a warning in v1. Default: False. - earliest_data_period (None | str | Unset): YYYY-MM period representing the earliest month that has transaction - data. Used to create FiscalPeriod rows. Defaults to 24 months before the current month. - note (None | str | Unset): Free-form note attached to the audit event + """One-time setup for a graph's fiscal calendar. + + Creates the `FiscalCalendar` row, seeds `FiscalPeriod` rows from + ``earliest_data_period`` (or 24 months ago) through the current month, + and stamps periods on or before ``closed_through`` as already closed. + Subsequent calls return 409 — there's no re-initialize. + + The two pointers it sets up: + + - ``closed_through`` (system-maintained): the latest period whose + books are locked. Set on init for businesses with prior close + history; null for a fresh start. + - ``close_target`` (user-controlled): the goal date the user is + closing toward. Set independently via `set-close-target`. + + Attributes: + closed_through (None | str | Unset): YYYY-MM period. Periods ≤ this date are treated as historical (already + closed before the user joined). Set to null for a fresh business with no prior close state. + fiscal_year_start_month (int | Unset): Fiscal year start month (1-12). Defaults to calendar year. Default: 1. + auto_seed_schedules (bool | Unset): If true, run the SchedulerAgent to create schedules from historical BS + activity. NOT YET IMPLEMENTED — returns a warning in v1. Default: False. + earliest_data_period (None | str | Unset): YYYY-MM period representing the earliest month that has transaction + data. Used to create FiscalPeriod rows. Defaults to 24 months before the current month. + note (None | str | Unset): Free-form note attached to the audit event """ closed_through: None | str | Unset = UNSET diff --git a/robosystems_client/models/initialize_ledger_response.py b/robosystems_client/models/initialize_ledger_response.py new file mode 100644 index 0000000..4726d75 --- /dev/null +++ b/robosystems_client/models/initialize_ledger_response.py @@ -0,0 +1,89 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.fiscal_calendar_response import FiscalCalendarResponse + + +T = TypeVar("T", bound="InitializeLedgerResponse") + + +@_attrs_define +class InitializeLedgerResponse: + """ + Attributes: + fiscal_calendar (FiscalCalendarResponse): Current fiscal calendar state for a graph. + periods_created (int | Unset): Number of FiscalPeriod rows created by initialization Default: 0. + warnings (list[str] | Unset): Non-fatal warnings (e.g., auto_seed_schedules not implemented) + """ + + fiscal_calendar: FiscalCalendarResponse + periods_created: int | Unset = 0 + warnings: list[str] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + fiscal_calendar = self.fiscal_calendar.to_dict() + + periods_created = self.periods_created + + warnings: list[str] | Unset = UNSET + if not isinstance(self.warnings, Unset): + warnings = self.warnings + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "fiscal_calendar": fiscal_calendar, + } + ) + if periods_created is not UNSET: + field_dict["periods_created"] = periods_created + if warnings is not UNSET: + field_dict["warnings"] = warnings + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.fiscal_calendar_response import FiscalCalendarResponse + + d = dict(src_dict) + fiscal_calendar = FiscalCalendarResponse.from_dict(d.pop("fiscal_calendar")) + + periods_created = d.pop("periods_created", UNSET) + + warnings = cast(list[str], d.pop("warnings", UNSET)) + + initialize_ledger_response = cls( + fiscal_calendar=fiscal_calendar, + periods_created=periods_created, + warnings=warnings, + ) + + initialize_ledger_response.additional_properties = d + return initialize_ledger_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/journal_entry_line_item_input.py b/robosystems_client/models/journal_entry_line_item_input.py index d6686bc..e63951f 100644 --- a/robosystems_client/models/journal_entry_line_item_input.py +++ b/robosystems_client/models/journal_entry_line_item_input.py @@ -19,10 +19,10 @@ class JournalEntryLineItemInput: other must be zero. Amounts are in minor currency units (cents). Attributes: - element_id (str): - debit_amount (int | Unset): Default: 0. - credit_amount (int | Unset): Default: 0. - description (None | str | Unset): + element_id (str): Element ULID identifying the account to post to. + debit_amount (int | Unset): Debit amount in cents. Must be 0 if `credit_amount` > 0. Default: 0. + credit_amount (int | Unset): Credit amount in cents. Must be 0 if `debit_amount` > 0. Default: 0. + description (None | str | Unset): Per-line memo (overrides the entry-level memo on this line). """ element_id: str diff --git a/robosystems_client/models/journal_entry_line_item_response.py b/robosystems_client/models/journal_entry_line_item_response.py new file mode 100644 index 0000000..9bb4909 --- /dev/null +++ b/robosystems_client/models/journal_entry_line_item_response.py @@ -0,0 +1,116 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="JournalEntryLineItemResponse") + + +@_attrs_define +class JournalEntryLineItemResponse: + """One line in a journal entry response. + + Attributes: + id (str): + element_id (str): + debit_amount (int): + credit_amount (int): + line_order (int): + description (None | str | Unset): + """ + + id: str + element_id: str + debit_amount: int + credit_amount: int + line_order: int + description: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + element_id = self.element_id + + debit_amount = self.debit_amount + + credit_amount = self.credit_amount + + line_order = self.line_order + + description: None | str | Unset + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "element_id": element_id, + "debit_amount": debit_amount, + "credit_amount": credit_amount, + "line_order": line_order, + } + ) + if description is not UNSET: + field_dict["description"] = description + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + element_id = d.pop("element_id") + + debit_amount = d.pop("debit_amount") + + credit_amount = d.pop("credit_amount") + + line_order = d.pop("line_order") + + def _parse_description(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + description = _parse_description(d.pop("description", UNSET)) + + journal_entry_line_item_response = cls( + id=id, + element_id=element_id, + debit_amount=debit_amount, + credit_amount=credit_amount, + line_order=line_order, + description=description, + ) + + journal_entry_line_item_response.additional_properties = d + return journal_entry_line_item_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/journal_entry_response.py b/robosystems_client/models/journal_entry_response.py new file mode 100644 index 0000000..8316ce4 --- /dev/null +++ b/robosystems_client/models/journal_entry_response.py @@ -0,0 +1,238 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.journal_entry_line_item_response import JournalEntryLineItemResponse + + +T = TypeVar("T", bound="JournalEntryResponse") + + +@_attrs_define +class JournalEntryResponse: + """The common response shape for journal entry write operations. + + Attributes: + id (str): + type_ (str): + status (str): + posting_date (datetime.date): + line_items (list[JournalEntryLineItemResponse]): + total_debit (int): + total_credit (int): + transaction_id (None | str | Unset): + memo (None | str | Unset): + provenance (None | str | Unset): + reversal_of (None | str | Unset): + posted_at (datetime.datetime | None | Unset): + """ + + id: str + type_: str + status: str + posting_date: datetime.date + line_items: list[JournalEntryLineItemResponse] + total_debit: int + total_credit: int + transaction_id: None | str | Unset = UNSET + memo: None | str | Unset = UNSET + provenance: None | str | Unset = UNSET + reversal_of: None | str | Unset = UNSET + posted_at: datetime.datetime | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + type_ = self.type_ + + status = self.status + + posting_date = self.posting_date.isoformat() + + line_items = [] + for line_items_item_data in self.line_items: + line_items_item = line_items_item_data.to_dict() + line_items.append(line_items_item) + + total_debit = self.total_debit + + total_credit = self.total_credit + + transaction_id: None | str | Unset + if isinstance(self.transaction_id, Unset): + transaction_id = UNSET + else: + transaction_id = self.transaction_id + + memo: None | str | Unset + if isinstance(self.memo, Unset): + memo = UNSET + else: + memo = self.memo + + provenance: None | str | Unset + if isinstance(self.provenance, Unset): + provenance = UNSET + else: + provenance = self.provenance + + reversal_of: None | str | Unset + if isinstance(self.reversal_of, Unset): + reversal_of = UNSET + else: + reversal_of = self.reversal_of + + posted_at: None | str | Unset + if isinstance(self.posted_at, Unset): + posted_at = UNSET + elif isinstance(self.posted_at, datetime.datetime): + posted_at = self.posted_at.isoformat() + else: + posted_at = self.posted_at + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "type": type_, + "status": status, + "posting_date": posting_date, + "line_items": line_items, + "total_debit": total_debit, + "total_credit": total_credit, + } + ) + if transaction_id is not UNSET: + field_dict["transaction_id"] = transaction_id + if memo is not UNSET: + field_dict["memo"] = memo + if provenance is not UNSET: + field_dict["provenance"] = provenance + if reversal_of is not UNSET: + field_dict["reversal_of"] = reversal_of + if posted_at is not UNSET: + field_dict["posted_at"] = posted_at + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.journal_entry_line_item_response import JournalEntryLineItemResponse + + d = dict(src_dict) + id = d.pop("id") + + type_ = d.pop("type") + + status = d.pop("status") + + posting_date = isoparse(d.pop("posting_date")).date() + + line_items = [] + _line_items = d.pop("line_items") + for line_items_item_data in _line_items: + line_items_item = JournalEntryLineItemResponse.from_dict(line_items_item_data) + + line_items.append(line_items_item) + + total_debit = d.pop("total_debit") + + total_credit = d.pop("total_credit") + + def _parse_transaction_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + transaction_id = _parse_transaction_id(d.pop("transaction_id", UNSET)) + + def _parse_memo(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + memo = _parse_memo(d.pop("memo", UNSET)) + + def _parse_provenance(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + provenance = _parse_provenance(d.pop("provenance", UNSET)) + + def _parse_reversal_of(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + reversal_of = _parse_reversal_of(d.pop("reversal_of", UNSET)) + + def _parse_posted_at(data: object) -> datetime.datetime | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + posted_at_type_0 = isoparse(data) + + return posted_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None | Unset, data) + + posted_at = _parse_posted_at(d.pop("posted_at", UNSET)) + + journal_entry_response = cls( + id=id, + type_=type_, + status=status, + posting_date=posting_date, + line_items=line_items, + total_debit=total_debit, + total_credit=total_credit, + transaction_id=transaction_id, + memo=memo, + provenance=provenance, + reversal_of=reversal_of, + posted_at=posted_at, + ) + + journal_entry_response.additional_properties = d + return journal_entry_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/ledger_agent_response.py b/robosystems_client/models/ledger_agent_response.py new file mode 100644 index 0000000..bca5879 --- /dev/null +++ b/robosystems_client/models/ledger_agent_response.py @@ -0,0 +1,391 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.ledger_agent_response_address_type_0 import ( + LedgerAgentResponseAddressType0, + ) + + +T = TypeVar("T", bound="LedgerAgentResponse") + + +@_attrs_define +class LedgerAgentResponse: + """ + Attributes: + id (str): + agent_type (str): + name (str): + source (str): + is_active (bool): + is_1099_recipient (bool): + legal_name (None | str | Unset): + tax_id (None | str | Unset): + registration_number (None | str | Unset): + duns (None | str | Unset): + lei (None | str | Unset): + email (None | str | Unset): + phone (None | str | Unset): + address (LedgerAgentResponseAddressType0 | None | Unset): + external_id (None | str | Unset): + created_at (datetime.datetime | None | Unset): + updated_at (datetime.datetime | None | Unset): + created_by (None | str | Unset): + """ + + id: str + agent_type: str + name: str + source: str + is_active: bool + is_1099_recipient: bool + legal_name: None | str | Unset = UNSET + tax_id: None | str | Unset = UNSET + registration_number: None | str | Unset = UNSET + duns: None | str | Unset = UNSET + lei: None | str | Unset = UNSET + email: None | str | Unset = UNSET + phone: None | str | Unset = UNSET + address: LedgerAgentResponseAddressType0 | None | Unset = UNSET + external_id: None | str | Unset = UNSET + created_at: datetime.datetime | None | Unset = UNSET + updated_at: datetime.datetime | None | Unset = UNSET + created_by: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.ledger_agent_response_address_type_0 import ( + LedgerAgentResponseAddressType0, + ) + + id = self.id + + agent_type = self.agent_type + + name = self.name + + source = self.source + + is_active = self.is_active + + is_1099_recipient = self.is_1099_recipient + + legal_name: None | str | Unset + if isinstance(self.legal_name, Unset): + legal_name = UNSET + else: + legal_name = self.legal_name + + tax_id: None | str | Unset + if isinstance(self.tax_id, Unset): + tax_id = UNSET + else: + tax_id = self.tax_id + + registration_number: None | str | Unset + if isinstance(self.registration_number, Unset): + registration_number = UNSET + else: + registration_number = self.registration_number + + duns: None | str | Unset + if isinstance(self.duns, Unset): + duns = UNSET + else: + duns = self.duns + + lei: None | str | Unset + if isinstance(self.lei, Unset): + lei = UNSET + else: + lei = self.lei + + email: None | str | Unset + if isinstance(self.email, Unset): + email = UNSET + else: + email = self.email + + phone: None | str | Unset + if isinstance(self.phone, Unset): + phone = UNSET + else: + phone = self.phone + + address: dict[str, Any] | None | Unset + if isinstance(self.address, Unset): + address = UNSET + elif isinstance(self.address, LedgerAgentResponseAddressType0): + address = self.address.to_dict() + else: + address = self.address + + external_id: None | str | Unset + if isinstance(self.external_id, Unset): + external_id = UNSET + else: + external_id = self.external_id + + created_at: None | str | Unset + if isinstance(self.created_at, Unset): + created_at = UNSET + elif isinstance(self.created_at, datetime.datetime): + created_at = self.created_at.isoformat() + else: + created_at = self.created_at + + updated_at: None | str | Unset + if isinstance(self.updated_at, Unset): + updated_at = UNSET + elif isinstance(self.updated_at, datetime.datetime): + updated_at = self.updated_at.isoformat() + else: + updated_at = self.updated_at + + created_by: None | str | Unset + if isinstance(self.created_by, Unset): + created_by = UNSET + else: + created_by = self.created_by + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "agent_type": agent_type, + "name": name, + "source": source, + "is_active": is_active, + "is_1099_recipient": is_1099_recipient, + } + ) + if legal_name is not UNSET: + field_dict["legal_name"] = legal_name + if tax_id is not UNSET: + field_dict["tax_id"] = tax_id + if registration_number is not UNSET: + field_dict["registration_number"] = registration_number + if duns is not UNSET: + field_dict["duns"] = duns + if lei is not UNSET: + field_dict["lei"] = lei + if email is not UNSET: + field_dict["email"] = email + if phone is not UNSET: + field_dict["phone"] = phone + if address is not UNSET: + field_dict["address"] = address + if external_id is not UNSET: + field_dict["external_id"] = external_id + if created_at is not UNSET: + field_dict["created_at"] = created_at + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + if created_by is not UNSET: + field_dict["created_by"] = created_by + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.ledger_agent_response_address_type_0 import ( + LedgerAgentResponseAddressType0, + ) + + d = dict(src_dict) + id = d.pop("id") + + agent_type = d.pop("agent_type") + + name = d.pop("name") + + source = d.pop("source") + + is_active = d.pop("is_active") + + is_1099_recipient = d.pop("is_1099_recipient") + + def _parse_legal_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + legal_name = _parse_legal_name(d.pop("legal_name", UNSET)) + + def _parse_tax_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + tax_id = _parse_tax_id(d.pop("tax_id", UNSET)) + + def _parse_registration_number(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + registration_number = _parse_registration_number( + d.pop("registration_number", UNSET) + ) + + def _parse_duns(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + duns = _parse_duns(d.pop("duns", UNSET)) + + def _parse_lei(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + lei = _parse_lei(d.pop("lei", UNSET)) + + def _parse_email(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + email = _parse_email(d.pop("email", UNSET)) + + def _parse_phone(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + phone = _parse_phone(d.pop("phone", UNSET)) + + def _parse_address(data: object) -> LedgerAgentResponseAddressType0 | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + address_type_0 = LedgerAgentResponseAddressType0.from_dict(data) + + return address_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LedgerAgentResponseAddressType0 | None | Unset, data) + + address = _parse_address(d.pop("address", UNSET)) + + def _parse_external_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + external_id = _parse_external_id(d.pop("external_id", UNSET)) + + def _parse_created_at(data: object) -> datetime.datetime | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + created_at_type_0 = isoparse(data) + + return created_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None | Unset, data) + + created_at = _parse_created_at(d.pop("created_at", UNSET)) + + def _parse_updated_at(data: object) -> datetime.datetime | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + updated_at_type_0 = isoparse(data) + + return updated_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None | Unset, data) + + updated_at = _parse_updated_at(d.pop("updated_at", UNSET)) + + def _parse_created_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + created_by = _parse_created_by(d.pop("created_by", UNSET)) + + ledger_agent_response = cls( + id=id, + agent_type=agent_type, + name=name, + source=source, + is_active=is_active, + is_1099_recipient=is_1099_recipient, + legal_name=legal_name, + tax_id=tax_id, + registration_number=registration_number, + duns=duns, + lei=lei, + email=email, + phone=phone, + address=address, + external_id=external_id, + created_at=created_at, + updated_at=updated_at, + created_by=created_by, + ) + + ledger_agent_response.additional_properties = d + return ledger_agent_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/ledger_agent_response_address_type_0.py b/robosystems_client/models/ledger_agent_response_address_type_0.py new file mode 100644 index 0000000..46bb469 --- /dev/null +++ b/robosystems_client/models/ledger_agent_response_address_type_0.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="LedgerAgentResponseAddressType0") + + +@_attrs_define +class LedgerAgentResponseAddressType0: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + ledger_agent_response_address_type_0 = cls() + + ledger_agent_response_address_type_0.additional_properties = d + return ledger_agent_response_address_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/ledger_entity_response.py b/robosystems_client/models/ledger_entity_response.py new file mode 100644 index 0000000..3c2e4db --- /dev/null +++ b/robosystems_client/models/ledger_entity_response.py @@ -0,0 +1,650 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="LedgerEntityResponse") + + +@_attrs_define +class LedgerEntityResponse: + """Entity details from the extensions OLTP database. + + Returned by entity reads and `update-entity`. Identifiers + (CIK / ticker / SIC / LEI / tax_id) are present when sourced from + SEC or registry data; many are null for private companies. The + address fields are flattened (no nested object) to make them easy + to project into reporting forms. + + Attributes: + id (str): Entity identifier (ULID). + name (str): Display name shown in UI. + legal_name (None | str | Unset): Full registered legal name (when different from `name`). + uri (None | str | Unset): Canonical URL / external identifier. + cik (None | str | Unset): SEC CIK (Central Index Key). + ticker (None | str | Unset): Stock ticker symbol. + exchange (None | str | Unset): Listing exchange (e.g. 'NASDAQ', 'NYSE'). + sic (None | str | Unset): SIC industry code. + sic_description (None | str | Unset): SIC code description. + category (None | str | Unset): Filer category (e.g. 'Large Accelerated Filer'). + state_of_incorporation (None | str | Unset): US state or country of incorporation. + fiscal_year_end (None | str | Unset): Fiscal year-end as MM-DD (e.g. '12-31', '06-30'). + tax_id (None | str | Unset): Tax ID (EIN / SSN). + lei (None | str | Unset): Legal Entity Identifier (ISO 17442). + industry (None | str | Unset): Free-form industry label. + entity_type (None | str | Unset): Legal form (e.g. 'corporation', 'llc', 'lp'). + phone (None | str | Unset): + website (None | str | Unset): + status (str | Unset): Operational status: 'active' | 'inactive' | 'dissolved'. Default: 'active'. + is_parent (bool | Unset): True for top-level entities; False for subsidiaries. Default: True. + parent_entity_id (None | str | Unset): Parent entity ID for subsidiaries; null for top-level. + source (str | Unset): Provenance: 'native' | 'sec' | 'quickbooks' | 'xero' | 'plaid'. Default: 'native'. + source_id (None | str | Unset): Source-system primary key for sync reconciliation. + source_graph_id (None | str | Unset): Origin graph for received entities (cross-graph linking, e.g. RoboInvestor + portfolio holdings). + connection_id (None | str | Unset): Source connection that ingested this row. + address_line1 (None | str | Unset): + address_city (None | str | Unset): + address_state (None | str | Unset): + address_postal_code (None | str | Unset): + address_country (None | str | Unset): + created_at (None | str | Unset): + updated_at (None | str | Unset): + """ + + id: str + name: str + legal_name: None | str | Unset = UNSET + uri: None | str | Unset = UNSET + cik: None | str | Unset = UNSET + ticker: None | str | Unset = UNSET + exchange: None | str | Unset = UNSET + sic: None | str | Unset = UNSET + sic_description: None | str | Unset = UNSET + category: None | str | Unset = UNSET + state_of_incorporation: None | str | Unset = UNSET + fiscal_year_end: None | str | Unset = UNSET + tax_id: None | str | Unset = UNSET + lei: None | str | Unset = UNSET + industry: None | str | Unset = UNSET + entity_type: None | str | Unset = UNSET + phone: None | str | Unset = UNSET + website: None | str | Unset = UNSET + status: str | Unset = "active" + is_parent: bool | Unset = True + parent_entity_id: None | str | Unset = UNSET + source: str | Unset = "native" + source_id: None | str | Unset = UNSET + source_graph_id: None | str | Unset = UNSET + connection_id: None | str | Unset = UNSET + address_line1: None | str | Unset = UNSET + address_city: None | str | Unset = UNSET + address_state: None | str | Unset = UNSET + address_postal_code: None | str | Unset = UNSET + address_country: None | str | Unset = UNSET + created_at: None | str | Unset = UNSET + updated_at: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + legal_name: None | str | Unset + if isinstance(self.legal_name, Unset): + legal_name = UNSET + else: + legal_name = self.legal_name + + uri: None | str | Unset + if isinstance(self.uri, Unset): + uri = UNSET + else: + uri = self.uri + + cik: None | str | Unset + if isinstance(self.cik, Unset): + cik = UNSET + else: + cik = self.cik + + ticker: None | str | Unset + if isinstance(self.ticker, Unset): + ticker = UNSET + else: + ticker = self.ticker + + exchange: None | str | Unset + if isinstance(self.exchange, Unset): + exchange = UNSET + else: + exchange = self.exchange + + sic: None | str | Unset + if isinstance(self.sic, Unset): + sic = UNSET + else: + sic = self.sic + + sic_description: None | str | Unset + if isinstance(self.sic_description, Unset): + sic_description = UNSET + else: + sic_description = self.sic_description + + category: None | str | Unset + if isinstance(self.category, Unset): + category = UNSET + else: + category = self.category + + state_of_incorporation: None | str | Unset + if isinstance(self.state_of_incorporation, Unset): + state_of_incorporation = UNSET + else: + state_of_incorporation = self.state_of_incorporation + + fiscal_year_end: None | str | Unset + if isinstance(self.fiscal_year_end, Unset): + fiscal_year_end = UNSET + else: + fiscal_year_end = self.fiscal_year_end + + tax_id: None | str | Unset + if isinstance(self.tax_id, Unset): + tax_id = UNSET + else: + tax_id = self.tax_id + + lei: None | str | Unset + if isinstance(self.lei, Unset): + lei = UNSET + else: + lei = self.lei + + industry: None | str | Unset + if isinstance(self.industry, Unset): + industry = UNSET + else: + industry = self.industry + + entity_type: None | str | Unset + if isinstance(self.entity_type, Unset): + entity_type = UNSET + else: + entity_type = self.entity_type + + phone: None | str | Unset + if isinstance(self.phone, Unset): + phone = UNSET + else: + phone = self.phone + + website: None | str | Unset + if isinstance(self.website, Unset): + website = UNSET + else: + website = self.website + + status = self.status + + is_parent = self.is_parent + + parent_entity_id: None | str | Unset + if isinstance(self.parent_entity_id, Unset): + parent_entity_id = UNSET + else: + parent_entity_id = self.parent_entity_id + + source = self.source + + source_id: None | str | Unset + if isinstance(self.source_id, Unset): + source_id = UNSET + else: + source_id = self.source_id + + source_graph_id: None | str | Unset + if isinstance(self.source_graph_id, Unset): + source_graph_id = UNSET + else: + source_graph_id = self.source_graph_id + + connection_id: None | str | Unset + if isinstance(self.connection_id, Unset): + connection_id = UNSET + else: + connection_id = self.connection_id + + address_line1: None | str | Unset + if isinstance(self.address_line1, Unset): + address_line1 = UNSET + else: + address_line1 = self.address_line1 + + address_city: None | str | Unset + if isinstance(self.address_city, Unset): + address_city = UNSET + else: + address_city = self.address_city + + address_state: None | str | Unset + if isinstance(self.address_state, Unset): + address_state = UNSET + else: + address_state = self.address_state + + address_postal_code: None | str | Unset + if isinstance(self.address_postal_code, Unset): + address_postal_code = UNSET + else: + address_postal_code = self.address_postal_code + + address_country: None | str | Unset + if isinstance(self.address_country, Unset): + address_country = UNSET + else: + address_country = self.address_country + + created_at: None | str | Unset + if isinstance(self.created_at, Unset): + created_at = UNSET + else: + created_at = self.created_at + + updated_at: None | str | Unset + if isinstance(self.updated_at, Unset): + updated_at = UNSET + else: + updated_at = self.updated_at + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "name": name, + } + ) + if legal_name is not UNSET: + field_dict["legal_name"] = legal_name + if uri is not UNSET: + field_dict["uri"] = uri + if cik is not UNSET: + field_dict["cik"] = cik + if ticker is not UNSET: + field_dict["ticker"] = ticker + if exchange is not UNSET: + field_dict["exchange"] = exchange + if sic is not UNSET: + field_dict["sic"] = sic + if sic_description is not UNSET: + field_dict["sic_description"] = sic_description + if category is not UNSET: + field_dict["category"] = category + if state_of_incorporation is not UNSET: + field_dict["state_of_incorporation"] = state_of_incorporation + if fiscal_year_end is not UNSET: + field_dict["fiscal_year_end"] = fiscal_year_end + if tax_id is not UNSET: + field_dict["tax_id"] = tax_id + if lei is not UNSET: + field_dict["lei"] = lei + if industry is not UNSET: + field_dict["industry"] = industry + if entity_type is not UNSET: + field_dict["entity_type"] = entity_type + if phone is not UNSET: + field_dict["phone"] = phone + if website is not UNSET: + field_dict["website"] = website + if status is not UNSET: + field_dict["status"] = status + if is_parent is not UNSET: + field_dict["is_parent"] = is_parent + if parent_entity_id is not UNSET: + field_dict["parent_entity_id"] = parent_entity_id + if source is not UNSET: + field_dict["source"] = source + if source_id is not UNSET: + field_dict["source_id"] = source_id + if source_graph_id is not UNSET: + field_dict["source_graph_id"] = source_graph_id + if connection_id is not UNSET: + field_dict["connection_id"] = connection_id + if address_line1 is not UNSET: + field_dict["address_line1"] = address_line1 + if address_city is not UNSET: + field_dict["address_city"] = address_city + if address_state is not UNSET: + field_dict["address_state"] = address_state + if address_postal_code is not UNSET: + field_dict["address_postal_code"] = address_postal_code + if address_country is not UNSET: + field_dict["address_country"] = address_country + if created_at is not UNSET: + field_dict["created_at"] = created_at + if updated_at is not UNSET: + field_dict["updated_at"] = updated_at + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name") + + def _parse_legal_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + legal_name = _parse_legal_name(d.pop("legal_name", UNSET)) + + def _parse_uri(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + uri = _parse_uri(d.pop("uri", UNSET)) + + def _parse_cik(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + cik = _parse_cik(d.pop("cik", UNSET)) + + def _parse_ticker(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + ticker = _parse_ticker(d.pop("ticker", UNSET)) + + def _parse_exchange(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + exchange = _parse_exchange(d.pop("exchange", UNSET)) + + def _parse_sic(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + sic = _parse_sic(d.pop("sic", UNSET)) + + def _parse_sic_description(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + sic_description = _parse_sic_description(d.pop("sic_description", UNSET)) + + def _parse_category(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + category = _parse_category(d.pop("category", UNSET)) + + def _parse_state_of_incorporation(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + state_of_incorporation = _parse_state_of_incorporation( + d.pop("state_of_incorporation", UNSET) + ) + + def _parse_fiscal_year_end(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + fiscal_year_end = _parse_fiscal_year_end(d.pop("fiscal_year_end", UNSET)) + + def _parse_tax_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + tax_id = _parse_tax_id(d.pop("tax_id", UNSET)) + + def _parse_lei(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + lei = _parse_lei(d.pop("lei", UNSET)) + + def _parse_industry(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + industry = _parse_industry(d.pop("industry", UNSET)) + + def _parse_entity_type(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + entity_type = _parse_entity_type(d.pop("entity_type", UNSET)) + + def _parse_phone(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + phone = _parse_phone(d.pop("phone", UNSET)) + + def _parse_website(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + website = _parse_website(d.pop("website", UNSET)) + + status = d.pop("status", UNSET) + + is_parent = d.pop("is_parent", UNSET) + + def _parse_parent_entity_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + parent_entity_id = _parse_parent_entity_id(d.pop("parent_entity_id", UNSET)) + + source = d.pop("source", UNSET) + + def _parse_source_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + source_id = _parse_source_id(d.pop("source_id", UNSET)) + + def _parse_source_graph_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + source_graph_id = _parse_source_graph_id(d.pop("source_graph_id", UNSET)) + + def _parse_connection_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + connection_id = _parse_connection_id(d.pop("connection_id", UNSET)) + + def _parse_address_line1(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + address_line1 = _parse_address_line1(d.pop("address_line1", UNSET)) + + def _parse_address_city(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + address_city = _parse_address_city(d.pop("address_city", UNSET)) + + def _parse_address_state(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + address_state = _parse_address_state(d.pop("address_state", UNSET)) + + def _parse_address_postal_code(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + address_postal_code = _parse_address_postal_code( + d.pop("address_postal_code", UNSET) + ) + + def _parse_address_country(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + address_country = _parse_address_country(d.pop("address_country", UNSET)) + + def _parse_created_at(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + created_at = _parse_created_at(d.pop("created_at", UNSET)) + + def _parse_updated_at(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + updated_at = _parse_updated_at(d.pop("updated_at", UNSET)) + + ledger_entity_response = cls( + id=id, + name=name, + legal_name=legal_name, + uri=uri, + cik=cik, + ticker=ticker, + exchange=exchange, + sic=sic, + sic_description=sic_description, + category=category, + state_of_incorporation=state_of_incorporation, + fiscal_year_end=fiscal_year_end, + tax_id=tax_id, + lei=lei, + industry=industry, + entity_type=entity_type, + phone=phone, + website=website, + status=status, + is_parent=is_parent, + parent_entity_id=parent_entity_id, + source=source, + source_id=source_id, + source_graph_id=source_graph_id, + connection_id=connection_id, + address_line1=address_line1, + address_city=address_city, + address_state=address_state, + address_postal_code=address_postal_code, + address_country=address_country, + created_at=created_at, + updated_at=updated_at, + ) + + ledger_entity_response.additional_properties = d + return ledger_entity_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/link_entity_taxonomy_request.py b/robosystems_client/models/link_entity_taxonomy_request.py index a4db97b..65701b2 100644 --- a/robosystems_client/models/link_entity_taxonomy_request.py +++ b/robosystems_client/models/link_entity_taxonomy_request.py @@ -17,14 +17,23 @@ class LinkEntityTaxonomyRequest: """Link an entity to a taxonomy (creates the ENTITY_HAS_TAXONOMY edge). This is how a graph declares "this entity reports under this taxonomy." - For chart_of_accounts taxonomies, this tells the platform which CoA the - entity uses. For reporting taxonomies, which standard (us-gaap, ifrs). + For ``chart_of_accounts`` taxonomies, this tells the platform which CoA + the entity uses. For reporting taxonomies, which standard (us-gaap, + ifrs). Idempotent — re-linking returns the existing edge unchanged. + + CoA blocks auto-link at create time; use this to switch the primary + CoA, link a reporting extension, or attach a custom ontology + explicitly. Attributes: - taxonomy_id (str): - basis (LinkEntityTaxonomyRequestBasis | Unset): Default: LinkEntityTaxonomyRequestBasis.CHART_OF_ACCOUNTS. - is_primary (bool | Unset): Default: True. - adoption_context (None | str | Unset): Default: 'voluntary'. + taxonomy_id (str): The taxonomy to link to. + basis (LinkEntityTaxonomyRequestBasis | Unset): Linkage role: `chart_of_accounts` (the entity's CoA), + `reporting` (reporting standard like us-gaap), `mapping` (CoA→reporting rollup), `schedule` (schedule + structure). Default: LinkEntityTaxonomyRequestBasis.CHART_OF_ACCOUNTS. + is_primary (bool | Unset): Mark this as the primary linkage for the basis. False allows secondary attachments + (e.g. parallel reporting standards). Default: True. + adoption_context (None | str | Unset): Why the entity is reporting under this taxonomy (e.g. 'voluntary', + 'regulatory', 'lender_requirement'). Default: 'voluntary'. """ taxonomy_id: str diff --git a/robosystems_client/models/operation_envelope_association_response.py b/robosystems_client/models/operation_envelope_association_response.py new file mode 100644 index 0000000..dae207b --- /dev/null +++ b/robosystems_client/models/operation_envelope_association_response.py @@ -0,0 +1,158 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.operation_envelope_association_response_status import ( + OperationEnvelopeAssociationResponseStatus, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.association_response import AssociationResponse + + +T = TypeVar("T", bound="OperationEnvelopeAssociationResponse") + + +@_attrs_define +class OperationEnvelopeAssociationResponse: + """ + Attributes: + operation (str): Kebab-case operation name + operation_id (str): op_-prefixed ULID for audit and SSE correlation + status (OperationEnvelopeAssociationResponseStatus): Operation lifecycle state + at (str): ISO-8601 UTC timestamp + result (AssociationResponse | None | Unset): Command-specific result payload + created_by (None | str | Unset): User ID that initiated the operation (null for legacy callers) + idempotent_replay (bool | Unset): True when this envelope came from the idempotency cache — the underlying + command did not execute again. False on fresh executions. Default: False. + """ + + operation: str + operation_id: str + status: OperationEnvelopeAssociationResponseStatus + at: str + result: AssociationResponse | None | Unset = UNSET + created_by: None | str | Unset = UNSET + idempotent_replay: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.association_response import AssociationResponse + + operation = self.operation + + operation_id = self.operation_id + + status = self.status.value + + at = self.at + + result: dict[str, Any] | None | Unset + if isinstance(self.result, Unset): + result = UNSET + elif isinstance(self.result, AssociationResponse): + result = self.result.to_dict() + else: + result = self.result + + created_by: None | str | Unset + if isinstance(self.created_by, Unset): + created_by = UNSET + else: + created_by = self.created_by + + idempotent_replay = self.idempotent_replay + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "operation": operation, + "operationId": operation_id, + "status": status, + "at": at, + } + ) + if result is not UNSET: + field_dict["result"] = result + if created_by is not UNSET: + field_dict["createdBy"] = created_by + if idempotent_replay is not UNSET: + field_dict["idempotentReplay"] = idempotent_replay + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.association_response import AssociationResponse + + d = dict(src_dict) + operation = d.pop("operation") + + operation_id = d.pop("operationId") + + status = OperationEnvelopeAssociationResponseStatus(d.pop("status")) + + at = d.pop("at") + + def _parse_result(data: object) -> AssociationResponse | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + result_type_0 = AssociationResponse.from_dict(data) + + return result_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(AssociationResponse | None | Unset, data) + + result = _parse_result(d.pop("result", UNSET)) + + def _parse_created_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + created_by = _parse_created_by(d.pop("createdBy", UNSET)) + + idempotent_replay = d.pop("idempotentReplay", UNSET) + + operation_envelope_association_response = cls( + operation=operation, + operation_id=operation_id, + status=status, + at=at, + result=result, + created_by=created_by, + idempotent_replay=idempotent_replay, + ) + + operation_envelope_association_response.additional_properties = d + return operation_envelope_association_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/operation_envelope_association_response_status.py b/robosystems_client/models/operation_envelope_association_response_status.py new file mode 100644 index 0000000..7761ead --- /dev/null +++ b/robosystems_client/models/operation_envelope_association_response_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class OperationEnvelopeAssociationResponseStatus(str, Enum): + COMPLETED = "completed" + FAILED = "failed" + PENDING = "pending" + + def __str__(self) -> str: + return str(self.value) diff --git a/robosystems_client/models/operation_envelope_close_period_response.py b/robosystems_client/models/operation_envelope_close_period_response.py new file mode 100644 index 0000000..46f4030 --- /dev/null +++ b/robosystems_client/models/operation_envelope_close_period_response.py @@ -0,0 +1,158 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.operation_envelope_close_period_response_status import ( + OperationEnvelopeClosePeriodResponseStatus, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.close_period_response import ClosePeriodResponse + + +T = TypeVar("T", bound="OperationEnvelopeClosePeriodResponse") + + +@_attrs_define +class OperationEnvelopeClosePeriodResponse: + """ + Attributes: + operation (str): Kebab-case operation name + operation_id (str): op_-prefixed ULID for audit and SSE correlation + status (OperationEnvelopeClosePeriodResponseStatus): Operation lifecycle state + at (str): ISO-8601 UTC timestamp + result (ClosePeriodResponse | None | Unset): Command-specific result payload + created_by (None | str | Unset): User ID that initiated the operation (null for legacy callers) + idempotent_replay (bool | Unset): True when this envelope came from the idempotency cache — the underlying + command did not execute again. False on fresh executions. Default: False. + """ + + operation: str + operation_id: str + status: OperationEnvelopeClosePeriodResponseStatus + at: str + result: ClosePeriodResponse | None | Unset = UNSET + created_by: None | str | Unset = UNSET + idempotent_replay: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.close_period_response import ClosePeriodResponse + + operation = self.operation + + operation_id = self.operation_id + + status = self.status.value + + at = self.at + + result: dict[str, Any] | None | Unset + if isinstance(self.result, Unset): + result = UNSET + elif isinstance(self.result, ClosePeriodResponse): + result = self.result.to_dict() + else: + result = self.result + + created_by: None | str | Unset + if isinstance(self.created_by, Unset): + created_by = UNSET + else: + created_by = self.created_by + + idempotent_replay = self.idempotent_replay + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "operation": operation, + "operationId": operation_id, + "status": status, + "at": at, + } + ) + if result is not UNSET: + field_dict["result"] = result + if created_by is not UNSET: + field_dict["createdBy"] = created_by + if idempotent_replay is not UNSET: + field_dict["idempotentReplay"] = idempotent_replay + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.close_period_response import ClosePeriodResponse + + d = dict(src_dict) + operation = d.pop("operation") + + operation_id = d.pop("operationId") + + status = OperationEnvelopeClosePeriodResponseStatus(d.pop("status")) + + at = d.pop("at") + + def _parse_result(data: object) -> ClosePeriodResponse | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + result_type_0 = ClosePeriodResponse.from_dict(data) + + return result_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(ClosePeriodResponse | None | Unset, data) + + result = _parse_result(d.pop("result", UNSET)) + + def _parse_created_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + created_by = _parse_created_by(d.pop("createdBy", UNSET)) + + idempotent_replay = d.pop("idempotentReplay", UNSET) + + operation_envelope_close_period_response = cls( + operation=operation, + operation_id=operation_id, + status=status, + at=at, + result=result, + created_by=created_by, + idempotent_replay=idempotent_replay, + ) + + operation_envelope_close_period_response.additional_properties = d + return operation_envelope_close_period_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/operation_envelope_close_period_response_status.py b/robosystems_client/models/operation_envelope_close_period_response_status.py new file mode 100644 index 0000000..150e8e8 --- /dev/null +++ b/robosystems_client/models/operation_envelope_close_period_response_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class OperationEnvelopeClosePeriodResponseStatus(str, Enum): + COMPLETED = "completed" + FAILED = "failed" + PENDING = "pending" + + def __str__(self) -> str: + return str(self.value) diff --git a/robosystems_client/models/operation_envelope_delete_taxonomy_block_response.py b/robosystems_client/models/operation_envelope_delete_taxonomy_block_response.py new file mode 100644 index 0000000..980740f --- /dev/null +++ b/robosystems_client/models/operation_envelope_delete_taxonomy_block_response.py @@ -0,0 +1,158 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.operation_envelope_delete_taxonomy_block_response_status import ( + OperationEnvelopeDeleteTaxonomyBlockResponseStatus, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.delete_taxonomy_block_response import DeleteTaxonomyBlockResponse + + +T = TypeVar("T", bound="OperationEnvelopeDeleteTaxonomyBlockResponse") + + +@_attrs_define +class OperationEnvelopeDeleteTaxonomyBlockResponse: + """ + Attributes: + operation (str): Kebab-case operation name + operation_id (str): op_-prefixed ULID for audit and SSE correlation + status (OperationEnvelopeDeleteTaxonomyBlockResponseStatus): Operation lifecycle state + at (str): ISO-8601 UTC timestamp + result (DeleteTaxonomyBlockResponse | None | Unset): Command-specific result payload + created_by (None | str | Unset): User ID that initiated the operation (null for legacy callers) + idempotent_replay (bool | Unset): True when this envelope came from the idempotency cache — the underlying + command did not execute again. False on fresh executions. Default: False. + """ + + operation: str + operation_id: str + status: OperationEnvelopeDeleteTaxonomyBlockResponseStatus + at: str + result: DeleteTaxonomyBlockResponse | None | Unset = UNSET + created_by: None | str | Unset = UNSET + idempotent_replay: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.delete_taxonomy_block_response import DeleteTaxonomyBlockResponse + + operation = self.operation + + operation_id = self.operation_id + + status = self.status.value + + at = self.at + + result: dict[str, Any] | None | Unset + if isinstance(self.result, Unset): + result = UNSET + elif isinstance(self.result, DeleteTaxonomyBlockResponse): + result = self.result.to_dict() + else: + result = self.result + + created_by: None | str | Unset + if isinstance(self.created_by, Unset): + created_by = UNSET + else: + created_by = self.created_by + + idempotent_replay = self.idempotent_replay + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "operation": operation, + "operationId": operation_id, + "status": status, + "at": at, + } + ) + if result is not UNSET: + field_dict["result"] = result + if created_by is not UNSET: + field_dict["createdBy"] = created_by + if idempotent_replay is not UNSET: + field_dict["idempotentReplay"] = idempotent_replay + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.delete_taxonomy_block_response import DeleteTaxonomyBlockResponse + + d = dict(src_dict) + operation = d.pop("operation") + + operation_id = d.pop("operationId") + + status = OperationEnvelopeDeleteTaxonomyBlockResponseStatus(d.pop("status")) + + at = d.pop("at") + + def _parse_result(data: object) -> DeleteTaxonomyBlockResponse | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + result_type_0 = DeleteTaxonomyBlockResponse.from_dict(data) + + return result_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(DeleteTaxonomyBlockResponse | None | Unset, data) + + result = _parse_result(d.pop("result", UNSET)) + + def _parse_created_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + created_by = _parse_created_by(d.pop("createdBy", UNSET)) + + idempotent_replay = d.pop("idempotentReplay", UNSET) + + operation_envelope_delete_taxonomy_block_response = cls( + operation=operation, + operation_id=operation_id, + status=status, + at=at, + result=result, + created_by=created_by, + idempotent_replay=idempotent_replay, + ) + + operation_envelope_delete_taxonomy_block_response.additional_properties = d + return operation_envelope_delete_taxonomy_block_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/operation_envelope_delete_taxonomy_block_response_status.py b/robosystems_client/models/operation_envelope_delete_taxonomy_block_response_status.py new file mode 100644 index 0000000..16209a9 --- /dev/null +++ b/robosystems_client/models/operation_envelope_delete_taxonomy_block_response_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class OperationEnvelopeDeleteTaxonomyBlockResponseStatus(str, Enum): + COMPLETED = "completed" + FAILED = "failed" + PENDING = "pending" + + def __str__(self) -> str: + return str(self.value) diff --git a/robosystems_client/models/operation_envelope_entity_taxonomy_response.py b/robosystems_client/models/operation_envelope_entity_taxonomy_response.py new file mode 100644 index 0000000..c35d505 --- /dev/null +++ b/robosystems_client/models/operation_envelope_entity_taxonomy_response.py @@ -0,0 +1,158 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.operation_envelope_entity_taxonomy_response_status import ( + OperationEnvelopeEntityTaxonomyResponseStatus, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.entity_taxonomy_response import EntityTaxonomyResponse + + +T = TypeVar("T", bound="OperationEnvelopeEntityTaxonomyResponse") + + +@_attrs_define +class OperationEnvelopeEntityTaxonomyResponse: + """ + Attributes: + operation (str): Kebab-case operation name + operation_id (str): op_-prefixed ULID for audit and SSE correlation + status (OperationEnvelopeEntityTaxonomyResponseStatus): Operation lifecycle state + at (str): ISO-8601 UTC timestamp + result (EntityTaxonomyResponse | None | Unset): Command-specific result payload + created_by (None | str | Unset): User ID that initiated the operation (null for legacy callers) + idempotent_replay (bool | Unset): True when this envelope came from the idempotency cache — the underlying + command did not execute again. False on fresh executions. Default: False. + """ + + operation: str + operation_id: str + status: OperationEnvelopeEntityTaxonomyResponseStatus + at: str + result: EntityTaxonomyResponse | None | Unset = UNSET + created_by: None | str | Unset = UNSET + idempotent_replay: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.entity_taxonomy_response import EntityTaxonomyResponse + + operation = self.operation + + operation_id = self.operation_id + + status = self.status.value + + at = self.at + + result: dict[str, Any] | None | Unset + if isinstance(self.result, Unset): + result = UNSET + elif isinstance(self.result, EntityTaxonomyResponse): + result = self.result.to_dict() + else: + result = self.result + + created_by: None | str | Unset + if isinstance(self.created_by, Unset): + created_by = UNSET + else: + created_by = self.created_by + + idempotent_replay = self.idempotent_replay + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "operation": operation, + "operationId": operation_id, + "status": status, + "at": at, + } + ) + if result is not UNSET: + field_dict["result"] = result + if created_by is not UNSET: + field_dict["createdBy"] = created_by + if idempotent_replay is not UNSET: + field_dict["idempotentReplay"] = idempotent_replay + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.entity_taxonomy_response import EntityTaxonomyResponse + + d = dict(src_dict) + operation = d.pop("operation") + + operation_id = d.pop("operationId") + + status = OperationEnvelopeEntityTaxonomyResponseStatus(d.pop("status")) + + at = d.pop("at") + + def _parse_result(data: object) -> EntityTaxonomyResponse | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + result_type_0 = EntityTaxonomyResponse.from_dict(data) + + return result_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(EntityTaxonomyResponse | None | Unset, data) + + result = _parse_result(d.pop("result", UNSET)) + + def _parse_created_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + created_by = _parse_created_by(d.pop("createdBy", UNSET)) + + idempotent_replay = d.pop("idempotentReplay", UNSET) + + operation_envelope_entity_taxonomy_response = cls( + operation=operation, + operation_id=operation_id, + status=status, + at=at, + result=result, + created_by=created_by, + idempotent_replay=idempotent_replay, + ) + + operation_envelope_entity_taxonomy_response.additional_properties = d + return operation_envelope_entity_taxonomy_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/operation_envelope_entity_taxonomy_response_status.py b/robosystems_client/models/operation_envelope_entity_taxonomy_response_status.py new file mode 100644 index 0000000..76d8b7d --- /dev/null +++ b/robosystems_client/models/operation_envelope_entity_taxonomy_response_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class OperationEnvelopeEntityTaxonomyResponseStatus(str, Enum): + COMPLETED = "completed" + FAILED = "failed" + PENDING = "pending" + + def __str__(self) -> str: + return str(self.value) diff --git a/robosystems_client/models/operation_envelope_evaluate_rules_response.py b/robosystems_client/models/operation_envelope_evaluate_rules_response.py new file mode 100644 index 0000000..6bd635f --- /dev/null +++ b/robosystems_client/models/operation_envelope_evaluate_rules_response.py @@ -0,0 +1,158 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.operation_envelope_evaluate_rules_response_status import ( + OperationEnvelopeEvaluateRulesResponseStatus, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.evaluate_rules_response import EvaluateRulesResponse + + +T = TypeVar("T", bound="OperationEnvelopeEvaluateRulesResponse") + + +@_attrs_define +class OperationEnvelopeEvaluateRulesResponse: + """ + Attributes: + operation (str): Kebab-case operation name + operation_id (str): op_-prefixed ULID for audit and SSE correlation + status (OperationEnvelopeEvaluateRulesResponseStatus): Operation lifecycle state + at (str): ISO-8601 UTC timestamp + result (EvaluateRulesResponse | None | Unset): Command-specific result payload + created_by (None | str | Unset): User ID that initiated the operation (null for legacy callers) + idempotent_replay (bool | Unset): True when this envelope came from the idempotency cache — the underlying + command did not execute again. False on fresh executions. Default: False. + """ + + operation: str + operation_id: str + status: OperationEnvelopeEvaluateRulesResponseStatus + at: str + result: EvaluateRulesResponse | None | Unset = UNSET + created_by: None | str | Unset = UNSET + idempotent_replay: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.evaluate_rules_response import EvaluateRulesResponse + + operation = self.operation + + operation_id = self.operation_id + + status = self.status.value + + at = self.at + + result: dict[str, Any] | None | Unset + if isinstance(self.result, Unset): + result = UNSET + elif isinstance(self.result, EvaluateRulesResponse): + result = self.result.to_dict() + else: + result = self.result + + created_by: None | str | Unset + if isinstance(self.created_by, Unset): + created_by = UNSET + else: + created_by = self.created_by + + idempotent_replay = self.idempotent_replay + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "operation": operation, + "operationId": operation_id, + "status": status, + "at": at, + } + ) + if result is not UNSET: + field_dict["result"] = result + if created_by is not UNSET: + field_dict["createdBy"] = created_by + if idempotent_replay is not UNSET: + field_dict["idempotentReplay"] = idempotent_replay + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.evaluate_rules_response import EvaluateRulesResponse + + d = dict(src_dict) + operation = d.pop("operation") + + operation_id = d.pop("operationId") + + status = OperationEnvelopeEvaluateRulesResponseStatus(d.pop("status")) + + at = d.pop("at") + + def _parse_result(data: object) -> EvaluateRulesResponse | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + result_type_0 = EvaluateRulesResponse.from_dict(data) + + return result_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(EvaluateRulesResponse | None | Unset, data) + + result = _parse_result(d.pop("result", UNSET)) + + def _parse_created_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + created_by = _parse_created_by(d.pop("createdBy", UNSET)) + + idempotent_replay = d.pop("idempotentReplay", UNSET) + + operation_envelope_evaluate_rules_response = cls( + operation=operation, + operation_id=operation_id, + status=status, + at=at, + result=result, + created_by=created_by, + idempotent_replay=idempotent_replay, + ) + + operation_envelope_evaluate_rules_response.additional_properties = d + return operation_envelope_evaluate_rules_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/operation_envelope_evaluate_rules_response_status.py b/robosystems_client/models/operation_envelope_evaluate_rules_response_status.py new file mode 100644 index 0000000..de698a1 --- /dev/null +++ b/robosystems_client/models/operation_envelope_evaluate_rules_response_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class OperationEnvelopeEvaluateRulesResponseStatus(str, Enum): + COMPLETED = "completed" + FAILED = "failed" + PENDING = "pending" + + def __str__(self) -> str: + return str(self.value) diff --git a/robosystems_client/models/operation_envelope_event_handler_response.py b/robosystems_client/models/operation_envelope_event_handler_response.py new file mode 100644 index 0000000..8981bcc --- /dev/null +++ b/robosystems_client/models/operation_envelope_event_handler_response.py @@ -0,0 +1,158 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.operation_envelope_event_handler_response_status import ( + OperationEnvelopeEventHandlerResponseStatus, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.event_handler_response import EventHandlerResponse + + +T = TypeVar("T", bound="OperationEnvelopeEventHandlerResponse") + + +@_attrs_define +class OperationEnvelopeEventHandlerResponse: + """ + Attributes: + operation (str): Kebab-case operation name + operation_id (str): op_-prefixed ULID for audit and SSE correlation + status (OperationEnvelopeEventHandlerResponseStatus): Operation lifecycle state + at (str): ISO-8601 UTC timestamp + result (EventHandlerResponse | None | Unset): Command-specific result payload + created_by (None | str | Unset): User ID that initiated the operation (null for legacy callers) + idempotent_replay (bool | Unset): True when this envelope came from the idempotency cache — the underlying + command did not execute again. False on fresh executions. Default: False. + """ + + operation: str + operation_id: str + status: OperationEnvelopeEventHandlerResponseStatus + at: str + result: EventHandlerResponse | None | Unset = UNSET + created_by: None | str | Unset = UNSET + idempotent_replay: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.event_handler_response import EventHandlerResponse + + operation = self.operation + + operation_id = self.operation_id + + status = self.status.value + + at = self.at + + result: dict[str, Any] | None | Unset + if isinstance(self.result, Unset): + result = UNSET + elif isinstance(self.result, EventHandlerResponse): + result = self.result.to_dict() + else: + result = self.result + + created_by: None | str | Unset + if isinstance(self.created_by, Unset): + created_by = UNSET + else: + created_by = self.created_by + + idempotent_replay = self.idempotent_replay + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "operation": operation, + "operationId": operation_id, + "status": status, + "at": at, + } + ) + if result is not UNSET: + field_dict["result"] = result + if created_by is not UNSET: + field_dict["createdBy"] = created_by + if idempotent_replay is not UNSET: + field_dict["idempotentReplay"] = idempotent_replay + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.event_handler_response import EventHandlerResponse + + d = dict(src_dict) + operation = d.pop("operation") + + operation_id = d.pop("operationId") + + status = OperationEnvelopeEventHandlerResponseStatus(d.pop("status")) + + at = d.pop("at") + + def _parse_result(data: object) -> EventHandlerResponse | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + result_type_0 = EventHandlerResponse.from_dict(data) + + return result_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(EventHandlerResponse | None | Unset, data) + + result = _parse_result(d.pop("result", UNSET)) + + def _parse_created_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + created_by = _parse_created_by(d.pop("createdBy", UNSET)) + + idempotent_replay = d.pop("idempotentReplay", UNSET) + + operation_envelope_event_handler_response = cls( + operation=operation, + operation_id=operation_id, + status=status, + at=at, + result=result, + created_by=created_by, + idempotent_replay=idempotent_replay, + ) + + operation_envelope_event_handler_response.additional_properties = d + return operation_envelope_event_handler_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/operation_envelope_event_handler_response_status.py b/robosystems_client/models/operation_envelope_event_handler_response_status.py new file mode 100644 index 0000000..2e1ffe4 --- /dev/null +++ b/robosystems_client/models/operation_envelope_event_handler_response_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class OperationEnvelopeEventHandlerResponseStatus(str, Enum): + COMPLETED = "completed" + FAILED = "failed" + PENDING = "pending" + + def __str__(self) -> str: + return str(self.value) diff --git a/robosystems_client/models/operation_envelope_fiscal_calendar_response.py b/robosystems_client/models/operation_envelope_fiscal_calendar_response.py new file mode 100644 index 0000000..4b01833 --- /dev/null +++ b/robosystems_client/models/operation_envelope_fiscal_calendar_response.py @@ -0,0 +1,158 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.operation_envelope_fiscal_calendar_response_status import ( + OperationEnvelopeFiscalCalendarResponseStatus, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.fiscal_calendar_response import FiscalCalendarResponse + + +T = TypeVar("T", bound="OperationEnvelopeFiscalCalendarResponse") + + +@_attrs_define +class OperationEnvelopeFiscalCalendarResponse: + """ + Attributes: + operation (str): Kebab-case operation name + operation_id (str): op_-prefixed ULID for audit and SSE correlation + status (OperationEnvelopeFiscalCalendarResponseStatus): Operation lifecycle state + at (str): ISO-8601 UTC timestamp + result (FiscalCalendarResponse | None | Unset): Command-specific result payload + created_by (None | str | Unset): User ID that initiated the operation (null for legacy callers) + idempotent_replay (bool | Unset): True when this envelope came from the idempotency cache — the underlying + command did not execute again. False on fresh executions. Default: False. + """ + + operation: str + operation_id: str + status: OperationEnvelopeFiscalCalendarResponseStatus + at: str + result: FiscalCalendarResponse | None | Unset = UNSET + created_by: None | str | Unset = UNSET + idempotent_replay: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.fiscal_calendar_response import FiscalCalendarResponse + + operation = self.operation + + operation_id = self.operation_id + + status = self.status.value + + at = self.at + + result: dict[str, Any] | None | Unset + if isinstance(self.result, Unset): + result = UNSET + elif isinstance(self.result, FiscalCalendarResponse): + result = self.result.to_dict() + else: + result = self.result + + created_by: None | str | Unset + if isinstance(self.created_by, Unset): + created_by = UNSET + else: + created_by = self.created_by + + idempotent_replay = self.idempotent_replay + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "operation": operation, + "operationId": operation_id, + "status": status, + "at": at, + } + ) + if result is not UNSET: + field_dict["result"] = result + if created_by is not UNSET: + field_dict["createdBy"] = created_by + if idempotent_replay is not UNSET: + field_dict["idempotentReplay"] = idempotent_replay + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.fiscal_calendar_response import FiscalCalendarResponse + + d = dict(src_dict) + operation = d.pop("operation") + + operation_id = d.pop("operationId") + + status = OperationEnvelopeFiscalCalendarResponseStatus(d.pop("status")) + + at = d.pop("at") + + def _parse_result(data: object) -> FiscalCalendarResponse | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + result_type_0 = FiscalCalendarResponse.from_dict(data) + + return result_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(FiscalCalendarResponse | None | Unset, data) + + result = _parse_result(d.pop("result", UNSET)) + + def _parse_created_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + created_by = _parse_created_by(d.pop("createdBy", UNSET)) + + idempotent_replay = d.pop("idempotentReplay", UNSET) + + operation_envelope_fiscal_calendar_response = cls( + operation=operation, + operation_id=operation_id, + status=status, + at=at, + result=result, + created_by=created_by, + idempotent_replay=idempotent_replay, + ) + + operation_envelope_fiscal_calendar_response.additional_properties = d + return operation_envelope_fiscal_calendar_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/operation_envelope_fiscal_calendar_response_status.py b/robosystems_client/models/operation_envelope_fiscal_calendar_response_status.py new file mode 100644 index 0000000..aebe3b1 --- /dev/null +++ b/robosystems_client/models/operation_envelope_fiscal_calendar_response_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class OperationEnvelopeFiscalCalendarResponseStatus(str, Enum): + COMPLETED = "completed" + FAILED = "failed" + PENDING = "pending" + + def __str__(self) -> str: + return str(self.value) diff --git a/robosystems_client/models/operation_envelope_initialize_ledger_response.py b/robosystems_client/models/operation_envelope_initialize_ledger_response.py new file mode 100644 index 0000000..b38a3fb --- /dev/null +++ b/robosystems_client/models/operation_envelope_initialize_ledger_response.py @@ -0,0 +1,158 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.operation_envelope_initialize_ledger_response_status import ( + OperationEnvelopeInitializeLedgerResponseStatus, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.initialize_ledger_response import InitializeLedgerResponse + + +T = TypeVar("T", bound="OperationEnvelopeInitializeLedgerResponse") + + +@_attrs_define +class OperationEnvelopeInitializeLedgerResponse: + """ + Attributes: + operation (str): Kebab-case operation name + operation_id (str): op_-prefixed ULID for audit and SSE correlation + status (OperationEnvelopeInitializeLedgerResponseStatus): Operation lifecycle state + at (str): ISO-8601 UTC timestamp + result (InitializeLedgerResponse | None | Unset): Command-specific result payload + created_by (None | str | Unset): User ID that initiated the operation (null for legacy callers) + idempotent_replay (bool | Unset): True when this envelope came from the idempotency cache — the underlying + command did not execute again. False on fresh executions. Default: False. + """ + + operation: str + operation_id: str + status: OperationEnvelopeInitializeLedgerResponseStatus + at: str + result: InitializeLedgerResponse | None | Unset = UNSET + created_by: None | str | Unset = UNSET + idempotent_replay: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.initialize_ledger_response import InitializeLedgerResponse + + operation = self.operation + + operation_id = self.operation_id + + status = self.status.value + + at = self.at + + result: dict[str, Any] | None | Unset + if isinstance(self.result, Unset): + result = UNSET + elif isinstance(self.result, InitializeLedgerResponse): + result = self.result.to_dict() + else: + result = self.result + + created_by: None | str | Unset + if isinstance(self.created_by, Unset): + created_by = UNSET + else: + created_by = self.created_by + + idempotent_replay = self.idempotent_replay + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "operation": operation, + "operationId": operation_id, + "status": status, + "at": at, + } + ) + if result is not UNSET: + field_dict["result"] = result + if created_by is not UNSET: + field_dict["createdBy"] = created_by + if idempotent_replay is not UNSET: + field_dict["idempotentReplay"] = idempotent_replay + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.initialize_ledger_response import InitializeLedgerResponse + + d = dict(src_dict) + operation = d.pop("operation") + + operation_id = d.pop("operationId") + + status = OperationEnvelopeInitializeLedgerResponseStatus(d.pop("status")) + + at = d.pop("at") + + def _parse_result(data: object) -> InitializeLedgerResponse | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + result_type_0 = InitializeLedgerResponse.from_dict(data) + + return result_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(InitializeLedgerResponse | None | Unset, data) + + result = _parse_result(d.pop("result", UNSET)) + + def _parse_created_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + created_by = _parse_created_by(d.pop("createdBy", UNSET)) + + idempotent_replay = d.pop("idempotentReplay", UNSET) + + operation_envelope_initialize_ledger_response = cls( + operation=operation, + operation_id=operation_id, + status=status, + at=at, + result=result, + created_by=created_by, + idempotent_replay=idempotent_replay, + ) + + operation_envelope_initialize_ledger_response.additional_properties = d + return operation_envelope_initialize_ledger_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/operation_envelope_initialize_ledger_response_status.py b/robosystems_client/models/operation_envelope_initialize_ledger_response_status.py new file mode 100644 index 0000000..54f6a4a --- /dev/null +++ b/robosystems_client/models/operation_envelope_initialize_ledger_response_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class OperationEnvelopeInitializeLedgerResponseStatus(str, Enum): + COMPLETED = "completed" + FAILED = "failed" + PENDING = "pending" + + def __str__(self) -> str: + return str(self.value) diff --git a/robosystems_client/models/operation_envelope_journal_entry_response.py b/robosystems_client/models/operation_envelope_journal_entry_response.py new file mode 100644 index 0000000..5214c80 --- /dev/null +++ b/robosystems_client/models/operation_envelope_journal_entry_response.py @@ -0,0 +1,158 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.operation_envelope_journal_entry_response_status import ( + OperationEnvelopeJournalEntryResponseStatus, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.journal_entry_response import JournalEntryResponse + + +T = TypeVar("T", bound="OperationEnvelopeJournalEntryResponse") + + +@_attrs_define +class OperationEnvelopeJournalEntryResponse: + """ + Attributes: + operation (str): Kebab-case operation name + operation_id (str): op_-prefixed ULID for audit and SSE correlation + status (OperationEnvelopeJournalEntryResponseStatus): Operation lifecycle state + at (str): ISO-8601 UTC timestamp + result (JournalEntryResponse | None | Unset): Command-specific result payload + created_by (None | str | Unset): User ID that initiated the operation (null for legacy callers) + idempotent_replay (bool | Unset): True when this envelope came from the idempotency cache — the underlying + command did not execute again. False on fresh executions. Default: False. + """ + + operation: str + operation_id: str + status: OperationEnvelopeJournalEntryResponseStatus + at: str + result: JournalEntryResponse | None | Unset = UNSET + created_by: None | str | Unset = UNSET + idempotent_replay: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.journal_entry_response import JournalEntryResponse + + operation = self.operation + + operation_id = self.operation_id + + status = self.status.value + + at = self.at + + result: dict[str, Any] | None | Unset + if isinstance(self.result, Unset): + result = UNSET + elif isinstance(self.result, JournalEntryResponse): + result = self.result.to_dict() + else: + result = self.result + + created_by: None | str | Unset + if isinstance(self.created_by, Unset): + created_by = UNSET + else: + created_by = self.created_by + + idempotent_replay = self.idempotent_replay + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "operation": operation, + "operationId": operation_id, + "status": status, + "at": at, + } + ) + if result is not UNSET: + field_dict["result"] = result + if created_by is not UNSET: + field_dict["createdBy"] = created_by + if idempotent_replay is not UNSET: + field_dict["idempotentReplay"] = idempotent_replay + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.journal_entry_response import JournalEntryResponse + + d = dict(src_dict) + operation = d.pop("operation") + + operation_id = d.pop("operationId") + + status = OperationEnvelopeJournalEntryResponseStatus(d.pop("status")) + + at = d.pop("at") + + def _parse_result(data: object) -> JournalEntryResponse | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + result_type_0 = JournalEntryResponse.from_dict(data) + + return result_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(JournalEntryResponse | None | Unset, data) + + result = _parse_result(d.pop("result", UNSET)) + + def _parse_created_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + created_by = _parse_created_by(d.pop("createdBy", UNSET)) + + idempotent_replay = d.pop("idempotentReplay", UNSET) + + operation_envelope_journal_entry_response = cls( + operation=operation, + operation_id=operation_id, + status=status, + at=at, + result=result, + created_by=created_by, + idempotent_replay=idempotent_replay, + ) + + operation_envelope_journal_entry_response.additional_properties = d + return operation_envelope_journal_entry_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/operation_envelope_journal_entry_response_status.py b/robosystems_client/models/operation_envelope_journal_entry_response_status.py new file mode 100644 index 0000000..df200e8 --- /dev/null +++ b/robosystems_client/models/operation_envelope_journal_entry_response_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class OperationEnvelopeJournalEntryResponseStatus(str, Enum): + COMPLETED = "completed" + FAILED = "failed" + PENDING = "pending" + + def __str__(self) -> str: + return str(self.value) diff --git a/robosystems_client/models/operation_envelope_ledger_agent_response.py b/robosystems_client/models/operation_envelope_ledger_agent_response.py new file mode 100644 index 0000000..6da0d95 --- /dev/null +++ b/robosystems_client/models/operation_envelope_ledger_agent_response.py @@ -0,0 +1,158 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.operation_envelope_ledger_agent_response_status import ( + OperationEnvelopeLedgerAgentResponseStatus, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.ledger_agent_response import LedgerAgentResponse + + +T = TypeVar("T", bound="OperationEnvelopeLedgerAgentResponse") + + +@_attrs_define +class OperationEnvelopeLedgerAgentResponse: + """ + Attributes: + operation (str): Kebab-case operation name + operation_id (str): op_-prefixed ULID for audit and SSE correlation + status (OperationEnvelopeLedgerAgentResponseStatus): Operation lifecycle state + at (str): ISO-8601 UTC timestamp + result (LedgerAgentResponse | None | Unset): Command-specific result payload + created_by (None | str | Unset): User ID that initiated the operation (null for legacy callers) + idempotent_replay (bool | Unset): True when this envelope came from the idempotency cache — the underlying + command did not execute again. False on fresh executions. Default: False. + """ + + operation: str + operation_id: str + status: OperationEnvelopeLedgerAgentResponseStatus + at: str + result: LedgerAgentResponse | None | Unset = UNSET + created_by: None | str | Unset = UNSET + idempotent_replay: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.ledger_agent_response import LedgerAgentResponse + + operation = self.operation + + operation_id = self.operation_id + + status = self.status.value + + at = self.at + + result: dict[str, Any] | None | Unset + if isinstance(self.result, Unset): + result = UNSET + elif isinstance(self.result, LedgerAgentResponse): + result = self.result.to_dict() + else: + result = self.result + + created_by: None | str | Unset + if isinstance(self.created_by, Unset): + created_by = UNSET + else: + created_by = self.created_by + + idempotent_replay = self.idempotent_replay + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "operation": operation, + "operationId": operation_id, + "status": status, + "at": at, + } + ) + if result is not UNSET: + field_dict["result"] = result + if created_by is not UNSET: + field_dict["createdBy"] = created_by + if idempotent_replay is not UNSET: + field_dict["idempotentReplay"] = idempotent_replay + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.ledger_agent_response import LedgerAgentResponse + + d = dict(src_dict) + operation = d.pop("operation") + + operation_id = d.pop("operationId") + + status = OperationEnvelopeLedgerAgentResponseStatus(d.pop("status")) + + at = d.pop("at") + + def _parse_result(data: object) -> LedgerAgentResponse | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + result_type_0 = LedgerAgentResponse.from_dict(data) + + return result_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LedgerAgentResponse | None | Unset, data) + + result = _parse_result(d.pop("result", UNSET)) + + def _parse_created_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + created_by = _parse_created_by(d.pop("createdBy", UNSET)) + + idempotent_replay = d.pop("idempotentReplay", UNSET) + + operation_envelope_ledger_agent_response = cls( + operation=operation, + operation_id=operation_id, + status=status, + at=at, + result=result, + created_by=created_by, + idempotent_replay=idempotent_replay, + ) + + operation_envelope_ledger_agent_response.additional_properties = d + return operation_envelope_ledger_agent_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/operation_envelope_ledger_agent_response_status.py b/robosystems_client/models/operation_envelope_ledger_agent_response_status.py new file mode 100644 index 0000000..bc5c426 --- /dev/null +++ b/robosystems_client/models/operation_envelope_ledger_agent_response_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class OperationEnvelopeLedgerAgentResponseStatus(str, Enum): + COMPLETED = "completed" + FAILED = "failed" + PENDING = "pending" + + def __str__(self) -> str: + return str(self.value) diff --git a/robosystems_client/models/operation_envelope_ledger_entity_response.py b/robosystems_client/models/operation_envelope_ledger_entity_response.py new file mode 100644 index 0000000..3820ddf --- /dev/null +++ b/robosystems_client/models/operation_envelope_ledger_entity_response.py @@ -0,0 +1,158 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.operation_envelope_ledger_entity_response_status import ( + OperationEnvelopeLedgerEntityResponseStatus, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.ledger_entity_response import LedgerEntityResponse + + +T = TypeVar("T", bound="OperationEnvelopeLedgerEntityResponse") + + +@_attrs_define +class OperationEnvelopeLedgerEntityResponse: + """ + Attributes: + operation (str): Kebab-case operation name + operation_id (str): op_-prefixed ULID for audit and SSE correlation + status (OperationEnvelopeLedgerEntityResponseStatus): Operation lifecycle state + at (str): ISO-8601 UTC timestamp + result (LedgerEntityResponse | None | Unset): Command-specific result payload + created_by (None | str | Unset): User ID that initiated the operation (null for legacy callers) + idempotent_replay (bool | Unset): True when this envelope came from the idempotency cache — the underlying + command did not execute again. False on fresh executions. Default: False. + """ + + operation: str + operation_id: str + status: OperationEnvelopeLedgerEntityResponseStatus + at: str + result: LedgerEntityResponse | None | Unset = UNSET + created_by: None | str | Unset = UNSET + idempotent_replay: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.ledger_entity_response import LedgerEntityResponse + + operation = self.operation + + operation_id = self.operation_id + + status = self.status.value + + at = self.at + + result: dict[str, Any] | None | Unset + if isinstance(self.result, Unset): + result = UNSET + elif isinstance(self.result, LedgerEntityResponse): + result = self.result.to_dict() + else: + result = self.result + + created_by: None | str | Unset + if isinstance(self.created_by, Unset): + created_by = UNSET + else: + created_by = self.created_by + + idempotent_replay = self.idempotent_replay + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "operation": operation, + "operationId": operation_id, + "status": status, + "at": at, + } + ) + if result is not UNSET: + field_dict["result"] = result + if created_by is not UNSET: + field_dict["createdBy"] = created_by + if idempotent_replay is not UNSET: + field_dict["idempotentReplay"] = idempotent_replay + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.ledger_entity_response import LedgerEntityResponse + + d = dict(src_dict) + operation = d.pop("operation") + + operation_id = d.pop("operationId") + + status = OperationEnvelopeLedgerEntityResponseStatus(d.pop("status")) + + at = d.pop("at") + + def _parse_result(data: object) -> LedgerEntityResponse | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + result_type_0 = LedgerEntityResponse.from_dict(data) + + return result_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(LedgerEntityResponse | None | Unset, data) + + result = _parse_result(d.pop("result", UNSET)) + + def _parse_created_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + created_by = _parse_created_by(d.pop("createdBy", UNSET)) + + idempotent_replay = d.pop("idempotentReplay", UNSET) + + operation_envelope_ledger_entity_response = cls( + operation=operation, + operation_id=operation_id, + status=status, + at=at, + result=result, + created_by=created_by, + idempotent_replay=idempotent_replay, + ) + + operation_envelope_ledger_entity_response.additional_properties = d + return operation_envelope_ledger_entity_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/operation_envelope_ledger_entity_response_status.py b/robosystems_client/models/operation_envelope_ledger_entity_response_status.py new file mode 100644 index 0000000..b21f6d1 --- /dev/null +++ b/robosystems_client/models/operation_envelope_ledger_entity_response_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class OperationEnvelopeLedgerEntityResponseStatus(str, Enum): + COMPLETED = "completed" + FAILED = "failed" + PENDING = "pending" + + def __str__(self) -> str: + return str(self.value) diff --git a/robosystems_client/models/operation_envelope_preview_event_block_response.py b/robosystems_client/models/operation_envelope_preview_event_block_response.py new file mode 100644 index 0000000..f5166e0 --- /dev/null +++ b/robosystems_client/models/operation_envelope_preview_event_block_response.py @@ -0,0 +1,158 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.operation_envelope_preview_event_block_response_status import ( + OperationEnvelopePreviewEventBlockResponseStatus, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.preview_event_block_response import PreviewEventBlockResponse + + +T = TypeVar("T", bound="OperationEnvelopePreviewEventBlockResponse") + + +@_attrs_define +class OperationEnvelopePreviewEventBlockResponse: + """ + Attributes: + operation (str): Kebab-case operation name + operation_id (str): op_-prefixed ULID for audit and SSE correlation + status (OperationEnvelopePreviewEventBlockResponseStatus): Operation lifecycle state + at (str): ISO-8601 UTC timestamp + result (None | PreviewEventBlockResponse | Unset): Command-specific result payload + created_by (None | str | Unset): User ID that initiated the operation (null for legacy callers) + idempotent_replay (bool | Unset): True when this envelope came from the idempotency cache — the underlying + command did not execute again. False on fresh executions. Default: False. + """ + + operation: str + operation_id: str + status: OperationEnvelopePreviewEventBlockResponseStatus + at: str + result: None | PreviewEventBlockResponse | Unset = UNSET + created_by: None | str | Unset = UNSET + idempotent_replay: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.preview_event_block_response import PreviewEventBlockResponse + + operation = self.operation + + operation_id = self.operation_id + + status = self.status.value + + at = self.at + + result: dict[str, Any] | None | Unset + if isinstance(self.result, Unset): + result = UNSET + elif isinstance(self.result, PreviewEventBlockResponse): + result = self.result.to_dict() + else: + result = self.result + + created_by: None | str | Unset + if isinstance(self.created_by, Unset): + created_by = UNSET + else: + created_by = self.created_by + + idempotent_replay = self.idempotent_replay + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "operation": operation, + "operationId": operation_id, + "status": status, + "at": at, + } + ) + if result is not UNSET: + field_dict["result"] = result + if created_by is not UNSET: + field_dict["createdBy"] = created_by + if idempotent_replay is not UNSET: + field_dict["idempotentReplay"] = idempotent_replay + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.preview_event_block_response import PreviewEventBlockResponse + + d = dict(src_dict) + operation = d.pop("operation") + + operation_id = d.pop("operationId") + + status = OperationEnvelopePreviewEventBlockResponseStatus(d.pop("status")) + + at = d.pop("at") + + def _parse_result(data: object) -> None | PreviewEventBlockResponse | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + result_type_0 = PreviewEventBlockResponse.from_dict(data) + + return result_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | PreviewEventBlockResponse | Unset, data) + + result = _parse_result(d.pop("result", UNSET)) + + def _parse_created_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + created_by = _parse_created_by(d.pop("createdBy", UNSET)) + + idempotent_replay = d.pop("idempotentReplay", UNSET) + + operation_envelope_preview_event_block_response = cls( + operation=operation, + operation_id=operation_id, + status=status, + at=at, + result=result, + created_by=created_by, + idempotent_replay=idempotent_replay, + ) + + operation_envelope_preview_event_block_response.additional_properties = d + return operation_envelope_preview_event_block_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/operation_envelope_preview_event_block_response_status.py b/robosystems_client/models/operation_envelope_preview_event_block_response_status.py new file mode 100644 index 0000000..1c4b1d7 --- /dev/null +++ b/robosystems_client/models/operation_envelope_preview_event_block_response_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class OperationEnvelopePreviewEventBlockResponseStatus(str, Enum): + COMPLETED = "completed" + FAILED = "failed" + PENDING = "pending" + + def __str__(self) -> str: + return str(self.value) diff --git a/robosystems_client/models/operation_envelope_publish_list_response.py b/robosystems_client/models/operation_envelope_publish_list_response.py new file mode 100644 index 0000000..982583a --- /dev/null +++ b/robosystems_client/models/operation_envelope_publish_list_response.py @@ -0,0 +1,158 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.operation_envelope_publish_list_response_status import ( + OperationEnvelopePublishListResponseStatus, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.publish_list_response import PublishListResponse + + +T = TypeVar("T", bound="OperationEnvelopePublishListResponse") + + +@_attrs_define +class OperationEnvelopePublishListResponse: + """ + Attributes: + operation (str): Kebab-case operation name + operation_id (str): op_-prefixed ULID for audit and SSE correlation + status (OperationEnvelopePublishListResponseStatus): Operation lifecycle state + at (str): ISO-8601 UTC timestamp + result (None | PublishListResponse | Unset): Command-specific result payload + created_by (None | str | Unset): User ID that initiated the operation (null for legacy callers) + idempotent_replay (bool | Unset): True when this envelope came from the idempotency cache — the underlying + command did not execute again. False on fresh executions. Default: False. + """ + + operation: str + operation_id: str + status: OperationEnvelopePublishListResponseStatus + at: str + result: None | PublishListResponse | Unset = UNSET + created_by: None | str | Unset = UNSET + idempotent_replay: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.publish_list_response import PublishListResponse + + operation = self.operation + + operation_id = self.operation_id + + status = self.status.value + + at = self.at + + result: dict[str, Any] | None | Unset + if isinstance(self.result, Unset): + result = UNSET + elif isinstance(self.result, PublishListResponse): + result = self.result.to_dict() + else: + result = self.result + + created_by: None | str | Unset + if isinstance(self.created_by, Unset): + created_by = UNSET + else: + created_by = self.created_by + + idempotent_replay = self.idempotent_replay + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "operation": operation, + "operationId": operation_id, + "status": status, + "at": at, + } + ) + if result is not UNSET: + field_dict["result"] = result + if created_by is not UNSET: + field_dict["createdBy"] = created_by + if idempotent_replay is not UNSET: + field_dict["idempotentReplay"] = idempotent_replay + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.publish_list_response import PublishListResponse + + d = dict(src_dict) + operation = d.pop("operation") + + operation_id = d.pop("operationId") + + status = OperationEnvelopePublishListResponseStatus(d.pop("status")) + + at = d.pop("at") + + def _parse_result(data: object) -> None | PublishListResponse | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + result_type_0 = PublishListResponse.from_dict(data) + + return result_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | PublishListResponse | Unset, data) + + result = _parse_result(d.pop("result", UNSET)) + + def _parse_created_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + created_by = _parse_created_by(d.pop("createdBy", UNSET)) + + idempotent_replay = d.pop("idempotentReplay", UNSET) + + operation_envelope_publish_list_response = cls( + operation=operation, + operation_id=operation_id, + status=status, + at=at, + result=result, + created_by=created_by, + idempotent_replay=idempotent_replay, + ) + + operation_envelope_publish_list_response.additional_properties = d + return operation_envelope_publish_list_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/operation_envelope_publish_list_response_status.py b/robosystems_client/models/operation_envelope_publish_list_response_status.py new file mode 100644 index 0000000..47c15a5 --- /dev/null +++ b/robosystems_client/models/operation_envelope_publish_list_response_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class OperationEnvelopePublishListResponseStatus(str, Enum): + COMPLETED = "completed" + FAILED = "failed" + PENDING = "pending" + + def __str__(self) -> str: + return str(self.value) diff --git a/robosystems_client/models/operation_envelope_report_response.py b/robosystems_client/models/operation_envelope_report_response.py new file mode 100644 index 0000000..3febc84 --- /dev/null +++ b/robosystems_client/models/operation_envelope_report_response.py @@ -0,0 +1,158 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.operation_envelope_report_response_status import ( + OperationEnvelopeReportResponseStatus, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.report_response import ReportResponse + + +T = TypeVar("T", bound="OperationEnvelopeReportResponse") + + +@_attrs_define +class OperationEnvelopeReportResponse: + """ + Attributes: + operation (str): Kebab-case operation name + operation_id (str): op_-prefixed ULID for audit and SSE correlation + status (OperationEnvelopeReportResponseStatus): Operation lifecycle state + at (str): ISO-8601 UTC timestamp + result (None | ReportResponse | Unset): Command-specific result payload + created_by (None | str | Unset): User ID that initiated the operation (null for legacy callers) + idempotent_replay (bool | Unset): True when this envelope came from the idempotency cache — the underlying + command did not execute again. False on fresh executions. Default: False. + """ + + operation: str + operation_id: str + status: OperationEnvelopeReportResponseStatus + at: str + result: None | ReportResponse | Unset = UNSET + created_by: None | str | Unset = UNSET + idempotent_replay: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.report_response import ReportResponse + + operation = self.operation + + operation_id = self.operation_id + + status = self.status.value + + at = self.at + + result: dict[str, Any] | None | Unset + if isinstance(self.result, Unset): + result = UNSET + elif isinstance(self.result, ReportResponse): + result = self.result.to_dict() + else: + result = self.result + + created_by: None | str | Unset + if isinstance(self.created_by, Unset): + created_by = UNSET + else: + created_by = self.created_by + + idempotent_replay = self.idempotent_replay + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "operation": operation, + "operationId": operation_id, + "status": status, + "at": at, + } + ) + if result is not UNSET: + field_dict["result"] = result + if created_by is not UNSET: + field_dict["createdBy"] = created_by + if idempotent_replay is not UNSET: + field_dict["idempotentReplay"] = idempotent_replay + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.report_response import ReportResponse + + d = dict(src_dict) + operation = d.pop("operation") + + operation_id = d.pop("operationId") + + status = OperationEnvelopeReportResponseStatus(d.pop("status")) + + at = d.pop("at") + + def _parse_result(data: object) -> None | ReportResponse | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + result_type_0 = ReportResponse.from_dict(data) + + return result_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | ReportResponse | Unset, data) + + result = _parse_result(d.pop("result", UNSET)) + + def _parse_created_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + created_by = _parse_created_by(d.pop("createdBy", UNSET)) + + idempotent_replay = d.pop("idempotentReplay", UNSET) + + operation_envelope_report_response = cls( + operation=operation, + operation_id=operation_id, + status=status, + at=at, + result=result, + created_by=created_by, + idempotent_replay=idempotent_replay, + ) + + operation_envelope_report_response.additional_properties = d + return operation_envelope_report_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/operation_envelope_report_response_status.py b/robosystems_client/models/operation_envelope_report_response_status.py new file mode 100644 index 0000000..8072f78 --- /dev/null +++ b/robosystems_client/models/operation_envelope_report_response_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class OperationEnvelopeReportResponseStatus(str, Enum): + COMPLETED = "completed" + FAILED = "failed" + PENDING = "pending" + + def __str__(self) -> str: + return str(self.value) diff --git a/robosystems_client/models/operation_envelope_share_report_response.py b/robosystems_client/models/operation_envelope_share_report_response.py new file mode 100644 index 0000000..b293c52 --- /dev/null +++ b/robosystems_client/models/operation_envelope_share_report_response.py @@ -0,0 +1,158 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.operation_envelope_share_report_response_status import ( + OperationEnvelopeShareReportResponseStatus, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.share_report_response import ShareReportResponse + + +T = TypeVar("T", bound="OperationEnvelopeShareReportResponse") + + +@_attrs_define +class OperationEnvelopeShareReportResponse: + """ + Attributes: + operation (str): Kebab-case operation name + operation_id (str): op_-prefixed ULID for audit and SSE correlation + status (OperationEnvelopeShareReportResponseStatus): Operation lifecycle state + at (str): ISO-8601 UTC timestamp + result (None | ShareReportResponse | Unset): Command-specific result payload + created_by (None | str | Unset): User ID that initiated the operation (null for legacy callers) + idempotent_replay (bool | Unset): True when this envelope came from the idempotency cache — the underlying + command did not execute again. False on fresh executions. Default: False. + """ + + operation: str + operation_id: str + status: OperationEnvelopeShareReportResponseStatus + at: str + result: None | ShareReportResponse | Unset = UNSET + created_by: None | str | Unset = UNSET + idempotent_replay: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.share_report_response import ShareReportResponse + + operation = self.operation + + operation_id = self.operation_id + + status = self.status.value + + at = self.at + + result: dict[str, Any] | None | Unset + if isinstance(self.result, Unset): + result = UNSET + elif isinstance(self.result, ShareReportResponse): + result = self.result.to_dict() + else: + result = self.result + + created_by: None | str | Unset + if isinstance(self.created_by, Unset): + created_by = UNSET + else: + created_by = self.created_by + + idempotent_replay = self.idempotent_replay + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "operation": operation, + "operationId": operation_id, + "status": status, + "at": at, + } + ) + if result is not UNSET: + field_dict["result"] = result + if created_by is not UNSET: + field_dict["createdBy"] = created_by + if idempotent_replay is not UNSET: + field_dict["idempotentReplay"] = idempotent_replay + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.share_report_response import ShareReportResponse + + d = dict(src_dict) + operation = d.pop("operation") + + operation_id = d.pop("operationId") + + status = OperationEnvelopeShareReportResponseStatus(d.pop("status")) + + at = d.pop("at") + + def _parse_result(data: object) -> None | ShareReportResponse | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + result_type_0 = ShareReportResponse.from_dict(data) + + return result_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | ShareReportResponse | Unset, data) + + result = _parse_result(d.pop("result", UNSET)) + + def _parse_created_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + created_by = _parse_created_by(d.pop("createdBy", UNSET)) + + idempotent_replay = d.pop("idempotentReplay", UNSET) + + operation_envelope_share_report_response = cls( + operation=operation, + operation_id=operation_id, + status=status, + at=at, + result=result, + created_by=created_by, + idempotent_replay=idempotent_replay, + ) + + operation_envelope_share_report_response.additional_properties = d + return operation_envelope_share_report_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/operation_envelope_share_report_response_status.py b/robosystems_client/models/operation_envelope_share_report_response_status.py new file mode 100644 index 0000000..0c77d8d --- /dev/null +++ b/robosystems_client/models/operation_envelope_share_report_response_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class OperationEnvelopeShareReportResponseStatus(str, Enum): + COMPLETED = "completed" + FAILED = "failed" + PENDING = "pending" + + def __str__(self) -> str: + return str(self.value) diff --git a/robosystems_client/models/operation_envelope_taxonomy_block_envelope.py b/robosystems_client/models/operation_envelope_taxonomy_block_envelope.py new file mode 100644 index 0000000..6bea909 --- /dev/null +++ b/robosystems_client/models/operation_envelope_taxonomy_block_envelope.py @@ -0,0 +1,158 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.operation_envelope_taxonomy_block_envelope_status import ( + OperationEnvelopeTaxonomyBlockEnvelopeStatus, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.taxonomy_block_envelope import TaxonomyBlockEnvelope + + +T = TypeVar("T", bound="OperationEnvelopeTaxonomyBlockEnvelope") + + +@_attrs_define +class OperationEnvelopeTaxonomyBlockEnvelope: + """ + Attributes: + operation (str): Kebab-case operation name + operation_id (str): op_-prefixed ULID for audit and SSE correlation + status (OperationEnvelopeTaxonomyBlockEnvelopeStatus): Operation lifecycle state + at (str): ISO-8601 UTC timestamp + result (None | TaxonomyBlockEnvelope | Unset): Command-specific result payload + created_by (None | str | Unset): User ID that initiated the operation (null for legacy callers) + idempotent_replay (bool | Unset): True when this envelope came from the idempotency cache — the underlying + command did not execute again. False on fresh executions. Default: False. + """ + + operation: str + operation_id: str + status: OperationEnvelopeTaxonomyBlockEnvelopeStatus + at: str + result: None | TaxonomyBlockEnvelope | Unset = UNSET + created_by: None | str | Unset = UNSET + idempotent_replay: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.taxonomy_block_envelope import TaxonomyBlockEnvelope + + operation = self.operation + + operation_id = self.operation_id + + status = self.status.value + + at = self.at + + result: dict[str, Any] | None | Unset + if isinstance(self.result, Unset): + result = UNSET + elif isinstance(self.result, TaxonomyBlockEnvelope): + result = self.result.to_dict() + else: + result = self.result + + created_by: None | str | Unset + if isinstance(self.created_by, Unset): + created_by = UNSET + else: + created_by = self.created_by + + idempotent_replay = self.idempotent_replay + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "operation": operation, + "operationId": operation_id, + "status": status, + "at": at, + } + ) + if result is not UNSET: + field_dict["result"] = result + if created_by is not UNSET: + field_dict["createdBy"] = created_by + if idempotent_replay is not UNSET: + field_dict["idempotentReplay"] = idempotent_replay + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.taxonomy_block_envelope import TaxonomyBlockEnvelope + + d = dict(src_dict) + operation = d.pop("operation") + + operation_id = d.pop("operationId") + + status = OperationEnvelopeTaxonomyBlockEnvelopeStatus(d.pop("status")) + + at = d.pop("at") + + def _parse_result(data: object) -> None | TaxonomyBlockEnvelope | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + result_type_0 = TaxonomyBlockEnvelope.from_dict(data) + + return result_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | TaxonomyBlockEnvelope | Unset, data) + + result = _parse_result(d.pop("result", UNSET)) + + def _parse_created_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + created_by = _parse_created_by(d.pop("createdBy", UNSET)) + + idempotent_replay = d.pop("idempotentReplay", UNSET) + + operation_envelope_taxonomy_block_envelope = cls( + operation=operation, + operation_id=operation_id, + status=status, + at=at, + result=result, + created_by=created_by, + idempotent_replay=idempotent_replay, + ) + + operation_envelope_taxonomy_block_envelope.additional_properties = d + return operation_envelope_taxonomy_block_envelope + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/operation_envelope_taxonomy_block_envelope_status.py b/robosystems_client/models/operation_envelope_taxonomy_block_envelope_status.py new file mode 100644 index 0000000..3072e8e --- /dev/null +++ b/robosystems_client/models/operation_envelope_taxonomy_block_envelope_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class OperationEnvelopeTaxonomyBlockEnvelopeStatus(str, Enum): + COMPLETED = "completed" + FAILED = "failed" + PENDING = "pending" + + def __str__(self) -> str: + return str(self.value) diff --git a/robosystems_client/models/operation_envelopelist_publish_list_member_response.py b/robosystems_client/models/operation_envelopelist_publish_list_member_response.py new file mode 100644 index 0000000..e2ca242 --- /dev/null +++ b/robosystems_client/models/operation_envelopelist_publish_list_member_response.py @@ -0,0 +1,167 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.operation_envelopelist_publish_list_member_response_status import ( + OperationEnvelopelistPublishListMemberResponseStatus, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.publish_list_member_response import PublishListMemberResponse + + +T = TypeVar("T", bound="OperationEnvelopelistPublishListMemberResponse") + + +@_attrs_define +class OperationEnvelopelistPublishListMemberResponse: + """ + Attributes: + operation (str): Kebab-case operation name + operation_id (str): op_-prefixed ULID for audit and SSE correlation + status (OperationEnvelopelistPublishListMemberResponseStatus): Operation lifecycle state + at (str): ISO-8601 UTC timestamp + result (list[PublishListMemberResponse] | None | Unset): Command-specific result payload + created_by (None | str | Unset): User ID that initiated the operation (null for legacy callers) + idempotent_replay (bool | Unset): True when this envelope came from the idempotency cache — the underlying + command did not execute again. False on fresh executions. Default: False. + """ + + operation: str + operation_id: str + status: OperationEnvelopelistPublishListMemberResponseStatus + at: str + result: list[PublishListMemberResponse] | None | Unset = UNSET + created_by: None | str | Unset = UNSET + idempotent_replay: bool | Unset = False + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + operation = self.operation + + operation_id = self.operation_id + + status = self.status.value + + at = self.at + + result: list[dict[str, Any]] | None | Unset + if isinstance(self.result, Unset): + result = UNSET + elif isinstance(self.result, list): + result = [] + for result_type_0_item_data in self.result: + result_type_0_item = result_type_0_item_data.to_dict() + result.append(result_type_0_item) + + else: + result = self.result + + created_by: None | str | Unset + if isinstance(self.created_by, Unset): + created_by = UNSET + else: + created_by = self.created_by + + idempotent_replay = self.idempotent_replay + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "operation": operation, + "operationId": operation_id, + "status": status, + "at": at, + } + ) + if result is not UNSET: + field_dict["result"] = result + if created_by is not UNSET: + field_dict["createdBy"] = created_by + if idempotent_replay is not UNSET: + field_dict["idempotentReplay"] = idempotent_replay + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.publish_list_member_response import PublishListMemberResponse + + d = dict(src_dict) + operation = d.pop("operation") + + operation_id = d.pop("operationId") + + status = OperationEnvelopelistPublishListMemberResponseStatus(d.pop("status")) + + at = d.pop("at") + + def _parse_result(data: object) -> list[PublishListMemberResponse] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + result_type_0 = [] + _result_type_0 = data + for result_type_0_item_data in _result_type_0: + result_type_0_item = PublishListMemberResponse.from_dict( + result_type_0_item_data + ) + + result_type_0.append(result_type_0_item) + + return result_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[PublishListMemberResponse] | None | Unset, data) + + result = _parse_result(d.pop("result", UNSET)) + + def _parse_created_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + created_by = _parse_created_by(d.pop("createdBy", UNSET)) + + idempotent_replay = d.pop("idempotentReplay", UNSET) + + operation_envelopelist_publish_list_member_response = cls( + operation=operation, + operation_id=operation_id, + status=status, + at=at, + result=result, + created_by=created_by, + idempotent_replay=idempotent_replay, + ) + + operation_envelopelist_publish_list_member_response.additional_properties = d + return operation_envelopelist_publish_list_member_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/operation_envelopelist_publish_list_member_response_status.py b/robosystems_client/models/operation_envelopelist_publish_list_member_response_status.py new file mode 100644 index 0000000..6ab9545 --- /dev/null +++ b/robosystems_client/models/operation_envelopelist_publish_list_member_response_status.py @@ -0,0 +1,10 @@ +from enum import Enum + + +class OperationEnvelopelistPublishListMemberResponseStatus(str, Enum): + COMPLETED = "completed" + FAILED = "failed" + PENDING = "pending" + + def __str__(self) -> str: + return str(self.value) diff --git a/robosystems_client/models/period_spec.py b/robosystems_client/models/period_spec.py index 3cd0648..776a00a 100644 --- a/robosystems_client/models/period_spec.py +++ b/robosystems_client/models/period_spec.py @@ -13,12 +13,18 @@ @_attrs_define class PeriodSpec: - """A reporting period column. - - Attributes: - start (datetime.date): - end (datetime.date): - label (str): + """A single reporting period column. + + Reports render facts in N period columns side-by-side. Each + ``PeriodSpec`` is one column — its ``start``/``end`` define the + window the report's facts roll up into; ``label`` is what the renderer + prints in the column header. For year-over-year statements, supply two + PeriodSpecs (current + comparative); for YTD by quarter, supply four. + + Attributes: + start (datetime.date): Period start date (inclusive). Window the column rolls up. + end (datetime.date): Period end date (inclusive). Window the column rolls up. + label (str): Column header label (e.g. 'FY2025 Q3', '2024', 'YTD'). """ start: datetime.date diff --git a/robosystems_client/models/preview_event_block_response.py b/robosystems_client/models/preview_event_block_response.py new file mode 100644 index 0000000..a7ea713 --- /dev/null +++ b/robosystems_client/models/preview_event_block_response.py @@ -0,0 +1,164 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.event_handler_response import EventHandlerResponse + from ..models.preview_event_block_response_handler_metadata import ( + PreviewEventBlockResponseHandlerMetadata, + ) + from ..models.transaction_preview import TransactionPreview + + +T = TypeVar("T", bound="PreviewEventBlockResponse") + + +@_attrs_define +class PreviewEventBlockResponse: + """Dry-run result — what would happen if this event block were created. + + Attributes: + would_succeed (bool): + matched_handler (EventHandlerResponse | None | Unset): + planned_transactions (list[TransactionPreview] | Unset): + validation_errors (list[str] | Unset): + handler_metadata (PreviewEventBlockResponseHandlerMetadata | Unset): Handler-specific compute output. For Python + handlers like 'asset_disposed', includes NBV, gain/loss, accumulated depreciation. Empty for DSL-handler + previews. + """ + + would_succeed: bool + matched_handler: EventHandlerResponse | None | Unset = UNSET + planned_transactions: list[TransactionPreview] | Unset = UNSET + validation_errors: list[str] | Unset = UNSET + handler_metadata: PreviewEventBlockResponseHandlerMetadata | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.event_handler_response import EventHandlerResponse + + would_succeed = self.would_succeed + + matched_handler: dict[str, Any] | None | Unset + if isinstance(self.matched_handler, Unset): + matched_handler = UNSET + elif isinstance(self.matched_handler, EventHandlerResponse): + matched_handler = self.matched_handler.to_dict() + else: + matched_handler = self.matched_handler + + planned_transactions: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.planned_transactions, Unset): + planned_transactions = [] + for planned_transactions_item_data in self.planned_transactions: + planned_transactions_item = planned_transactions_item_data.to_dict() + planned_transactions.append(planned_transactions_item) + + validation_errors: list[str] | Unset = UNSET + if not isinstance(self.validation_errors, Unset): + validation_errors = self.validation_errors + + handler_metadata: dict[str, Any] | Unset = UNSET + if not isinstance(self.handler_metadata, Unset): + handler_metadata = self.handler_metadata.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "would_succeed": would_succeed, + } + ) + if matched_handler is not UNSET: + field_dict["matched_handler"] = matched_handler + if planned_transactions is not UNSET: + field_dict["planned_transactions"] = planned_transactions + if validation_errors is not UNSET: + field_dict["validation_errors"] = validation_errors + if handler_metadata is not UNSET: + field_dict["handler_metadata"] = handler_metadata + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.event_handler_response import EventHandlerResponse + from ..models.preview_event_block_response_handler_metadata import ( + PreviewEventBlockResponseHandlerMetadata, + ) + from ..models.transaction_preview import TransactionPreview + + d = dict(src_dict) + would_succeed = d.pop("would_succeed") + + def _parse_matched_handler(data: object) -> EventHandlerResponse | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + matched_handler_type_0 = EventHandlerResponse.from_dict(data) + + return matched_handler_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(EventHandlerResponse | None | Unset, data) + + matched_handler = _parse_matched_handler(d.pop("matched_handler", UNSET)) + + _planned_transactions = d.pop("planned_transactions", UNSET) + planned_transactions: list[TransactionPreview] | Unset = UNSET + if _planned_transactions is not UNSET: + planned_transactions = [] + for planned_transactions_item_data in _planned_transactions: + planned_transactions_item = TransactionPreview.from_dict( + planned_transactions_item_data + ) + + planned_transactions.append(planned_transactions_item) + + validation_errors = cast(list[str], d.pop("validation_errors", UNSET)) + + _handler_metadata = d.pop("handler_metadata", UNSET) + handler_metadata: PreviewEventBlockResponseHandlerMetadata | Unset + if isinstance(_handler_metadata, Unset): + handler_metadata = UNSET + else: + handler_metadata = PreviewEventBlockResponseHandlerMetadata.from_dict( + _handler_metadata + ) + + preview_event_block_response = cls( + would_succeed=would_succeed, + matched_handler=matched_handler, + planned_transactions=planned_transactions, + validation_errors=validation_errors, + handler_metadata=handler_metadata, + ) + + preview_event_block_response.additional_properties = d + return preview_event_block_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/preview_event_block_response_handler_metadata.py b/robosystems_client/models/preview_event_block_response_handler_metadata.py new file mode 100644 index 0000000..434c8a9 --- /dev/null +++ b/robosystems_client/models/preview_event_block_response_handler_metadata.py @@ -0,0 +1,50 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="PreviewEventBlockResponseHandlerMetadata") + + +@_attrs_define +class PreviewEventBlockResponseHandlerMetadata: + """Handler-specific compute output. For Python handlers like 'asset_disposed', includes NBV, gain/loss, accumulated + depreciation. Empty for DSL-handler previews. + + """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + preview_event_block_response_handler_metadata = cls() + + preview_event_block_response_handler_metadata.additional_properties = d + return preview_event_block_response_handler_metadata + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/publish_list_member_response.py b/robosystems_client/models/publish_list_member_response.py new file mode 100644 index 0000000..469fe3f --- /dev/null +++ b/robosystems_client/models/publish_list_member_response.py @@ -0,0 +1,130 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PublishListMemberResponse") + + +@_attrs_define +class PublishListMemberResponse: + """One recipient graph in a publish list. + + Attributes: + id (str): Membership row identifier (ULID). + target_graph_id (str): Recipient graph ID. + added_by (str): User ID that added this member. + added_at (datetime.datetime): When the member was added. + target_graph_name (None | str | Unset): Display name of the recipient graph (if known). + target_org_name (None | str | Unset): Display name of the org that owns the recipient graph. + """ + + id: str + target_graph_id: str + added_by: str + added_at: datetime.datetime + target_graph_name: None | str | Unset = UNSET + target_org_name: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + target_graph_id = self.target_graph_id + + added_by = self.added_by + + added_at = self.added_at.isoformat() + + target_graph_name: None | str | Unset + if isinstance(self.target_graph_name, Unset): + target_graph_name = UNSET + else: + target_graph_name = self.target_graph_name + + target_org_name: None | str | Unset + if isinstance(self.target_org_name, Unset): + target_org_name = UNSET + else: + target_org_name = self.target_org_name + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "target_graph_id": target_graph_id, + "added_by": added_by, + "added_at": added_at, + } + ) + if target_graph_name is not UNSET: + field_dict["target_graph_name"] = target_graph_name + if target_org_name is not UNSET: + field_dict["target_org_name"] = target_org_name + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + target_graph_id = d.pop("target_graph_id") + + added_by = d.pop("added_by") + + added_at = isoparse(d.pop("added_at")) + + def _parse_target_graph_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + target_graph_name = _parse_target_graph_name(d.pop("target_graph_name", UNSET)) + + def _parse_target_org_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + target_org_name = _parse_target_org_name(d.pop("target_org_name", UNSET)) + + publish_list_member_response = cls( + id=id, + target_graph_id=target_graph_id, + added_by=added_by, + added_at=added_at, + target_graph_name=target_graph_name, + target_org_name=target_org_name, + ) + + publish_list_member_response.additional_properties = d + return publish_list_member_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/publish_list_response.py b/robosystems_client/models/publish_list_response.py new file mode 100644 index 0000000..08146d4 --- /dev/null +++ b/robosystems_client/models/publish_list_response.py @@ -0,0 +1,127 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PublishListResponse") + + +@_attrs_define +class PublishListResponse: + """Publish list summary — header metadata, no members. + + Attributes: + id (str): List identifier (ULID). + name (str): Human-readable list name. + created_by (str): User ID that created the list. + created_at (datetime.datetime): When the list was created. + updated_at (datetime.datetime): Last metadata update (name/description). + description (None | str | Unset): Free-form description. + member_count (int | Unset): Number of recipient graphs currently on the list. Default: 0. + """ + + id: str + name: str + created_by: str + created_at: datetime.datetime + updated_at: datetime.datetime + description: None | str | Unset = UNSET + member_count: int | Unset = 0 + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + created_by = self.created_by + + created_at = self.created_at.isoformat() + + updated_at = self.updated_at.isoformat() + + description: None | str | Unset + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + member_count = self.member_count + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "name": name, + "created_by": created_by, + "created_at": created_at, + "updated_at": updated_at, + } + ) + if description is not UNSET: + field_dict["description"] = description + if member_count is not UNSET: + field_dict["member_count"] = member_count + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name") + + created_by = d.pop("created_by") + + created_at = isoparse(d.pop("created_at")) + + updated_at = isoparse(d.pop("updated_at")) + + def _parse_description(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + description = _parse_description(d.pop("description", UNSET)) + + member_count = d.pop("member_count", UNSET) + + publish_list_response = cls( + id=id, + name=name, + created_by=created_by, + created_at=created_at, + updated_at=updated_at, + description=description, + member_count=member_count, + ) + + publish_list_response.additional_properties = d + return publish_list_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/regenerate_report_operation.py b/robosystems_client/models/regenerate_report_operation.py index 8d1162c..e3ec3a4 100644 --- a/robosystems_client/models/regenerate_report_operation.py +++ b/robosystems_client/models/regenerate_report_operation.py @@ -19,12 +19,17 @@ @_attrs_define class RegenerateReportOperation: - """ - Attributes: - report_id (str): - period_start (datetime.date | None | Unset): New period start date - period_end (datetime.date | None | Unset): New period end date - periods (list[PeriodSpec] | None | Unset): New period columns. Overrides period_start/period_end. + """Regenerate facts for an existing Report. Carries `report_id` from + the path-style RPC body; period overrides are inherited from + :class:`RegenerateReportRequest`. + + Attributes: + report_id (str): The Report to regenerate. + period_start (datetime.date | None | Unset): New current-period start. Optional — omit to keep the existing + window. + period_end (datetime.date | None | Unset): New current-period end. Optional — omit to keep the existing window. + periods (list[PeriodSpec] | None | Unset): New explicit period columns. Overrides `period_start`/`period_end` + when supplied. """ report_id: str diff --git a/robosystems_client/models/remove_publish_list_member_operation.py b/robosystems_client/models/remove_publish_list_member_operation.py index b223c69..38c1ef2 100644 --- a/robosystems_client/models/remove_publish_list_member_operation.py +++ b/robosystems_client/models/remove_publish_list_member_operation.py @@ -11,10 +11,11 @@ @_attrs_define class RemovePublishListMemberOperation: - """ + """Remove a single recipient from a publish list. + Attributes: - list_id (str): - member_id (str): + list_id (str): The publish list. + member_id (str): The membership row to remove. """ list_id: str diff --git a/robosystems_client/models/reopen_period_operation.py b/robosystems_client/models/reopen_period_operation.py index 5e1154b..a4e9811 100644 --- a/robosystems_client/models/reopen_period_operation.py +++ b/robosystems_client/models/reopen_period_operation.py @@ -13,10 +13,12 @@ @_attrs_define class ReopenPeriodOperation: - """ + """Reopen the most recently closed fiscal period. + Attributes: reason (str): Required reason for the reopen (captured in audit log) - period (str): + period (str): Period to reopen, in YYYY-MM. Must equal current `closed_through` — only the most recent close can + be undone. note (None | str | Unset): Additional free-form note """ diff --git a/robosystems_client/models/report_response.py b/robosystems_client/models/report_response.py new file mode 100644 index 0000000..08d276e --- /dev/null +++ b/robosystems_client/models/report_response.py @@ -0,0 +1,544 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field +from dateutil.parser import isoparse + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.period_spec import PeriodSpec + from ..models.report_response_rule_summary_type_0 import ( + ReportResponseRuleSummaryType0, + ) + from ..models.structure_summary import StructureSummary + + +T = TypeVar("T", bound="ReportResponse") + + +@_attrs_define +class ReportResponse: + """Report definition summary — header metadata, no facts. + + Returned by ``create-report``, ``regenerate-report``, + ``file-report``, and ``transition-filing-status``. Use the package + read endpoint to retrieve a Report rehydrated with its rendered + ``InformationBlockEnvelope`` items. + + Attributes: + id (str): Report identifier (ULID). + name (str): Human-readable report name. + taxonomy_id (str): Taxonomy this report renders against. + generation_status (str): Computation lifecycle: `generating`, `published`, `failed`. Orthogonal to + `filing_status`. + period_type (str): Period cadence: `monthly`, `quarterly`, `annual`. + comparative (bool): True when an auto-generated prior-period column is included. + created_at (datetime.datetime): When the report row was created. + period_start (datetime.date | None | Unset): Current-period start. + period_end (datetime.date | None | Unset): Current-period end. + periods (list[PeriodSpec] | None | Unset): Explicit period columns when the report was created with a multi- + period layout. + mapping_id (None | str | Unset): CoA → taxonomy mapping the facts were rolled up through. + ai_generated (bool | Unset): True when the report was created by an AI agent rather than a user. Default: False. + last_generated (datetime.datetime | None | Unset): When the facts were last (re)generated. + structures (list[StructureSummary] | Unset): Structures available for this report's taxonomy — renderable + sections (BS / IS / CF / Equity / Schedules). + entity_name (None | str | Unset): Display name of the primary entity the report is tagged to. + filing_status (str | Unset): Filing lifecycle (orthogonal to `generation_status`): `draft`, `under_review`, + `filed`, `archived`. Default: 'draft'. + filed_at (datetime.datetime | None | Unset): When the report was transitioned to `filed`. + filed_by (None | str | Unset): User ID that transitioned the report to `filed`. + supersedes_id (None | str | Unset): When this report restates an earlier filing, the predecessor's report ID. + superseded_by_id (None | str | Unset): When this report has been restated, the successor's report ID. + source_graph_id (None | str | Unset): Origin graph for received (shared) reports — populated only on the + recipient's copy. + source_report_id (None | str | Unset): Origin report ID for received (shared) reports — populated only on the + recipient's copy. + shared_at (datetime.datetime | None | Unset): When the report was shared into this graph (recipient side). + rule_summary (None | ReportResponseRuleSummaryType0 | Unset): Counts by rule outcome (e.g. `{'passed': 12, + 'failed': 1}`) from the most recent evaluation. Null until rules run. + """ + + id: str + name: str + taxonomy_id: str + generation_status: str + period_type: str + comparative: bool + created_at: datetime.datetime + period_start: datetime.date | None | Unset = UNSET + period_end: datetime.date | None | Unset = UNSET + periods: list[PeriodSpec] | None | Unset = UNSET + mapping_id: None | str | Unset = UNSET + ai_generated: bool | Unset = False + last_generated: datetime.datetime | None | Unset = UNSET + structures: list[StructureSummary] | Unset = UNSET + entity_name: None | str | Unset = UNSET + filing_status: str | Unset = "draft" + filed_at: datetime.datetime | None | Unset = UNSET + filed_by: None | str | Unset = UNSET + supersedes_id: None | str | Unset = UNSET + superseded_by_id: None | str | Unset = UNSET + source_graph_id: None | str | Unset = UNSET + source_report_id: None | str | Unset = UNSET + shared_at: datetime.datetime | None | Unset = UNSET + rule_summary: None | ReportResponseRuleSummaryType0 | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.report_response_rule_summary_type_0 import ( + ReportResponseRuleSummaryType0, + ) + + id = self.id + + name = self.name + + taxonomy_id = self.taxonomy_id + + generation_status = self.generation_status + + period_type = self.period_type + + comparative = self.comparative + + created_at = self.created_at.isoformat() + + period_start: None | str | Unset + if isinstance(self.period_start, Unset): + period_start = UNSET + elif isinstance(self.period_start, datetime.date): + period_start = self.period_start.isoformat() + else: + period_start = self.period_start + + period_end: None | str | Unset + if isinstance(self.period_end, Unset): + period_end = UNSET + elif isinstance(self.period_end, datetime.date): + period_end = self.period_end.isoformat() + else: + period_end = self.period_end + + periods: list[dict[str, Any]] | None | Unset + if isinstance(self.periods, Unset): + periods = UNSET + elif isinstance(self.periods, list): + periods = [] + for periods_type_0_item_data in self.periods: + periods_type_0_item = periods_type_0_item_data.to_dict() + periods.append(periods_type_0_item) + + else: + periods = self.periods + + mapping_id: None | str | Unset + if isinstance(self.mapping_id, Unset): + mapping_id = UNSET + else: + mapping_id = self.mapping_id + + ai_generated = self.ai_generated + + last_generated: None | str | Unset + if isinstance(self.last_generated, Unset): + last_generated = UNSET + elif isinstance(self.last_generated, datetime.datetime): + last_generated = self.last_generated.isoformat() + else: + last_generated = self.last_generated + + structures: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.structures, Unset): + structures = [] + for structures_item_data in self.structures: + structures_item = structures_item_data.to_dict() + structures.append(structures_item) + + entity_name: None | str | Unset + if isinstance(self.entity_name, Unset): + entity_name = UNSET + else: + entity_name = self.entity_name + + filing_status = self.filing_status + + filed_at: None | str | Unset + if isinstance(self.filed_at, Unset): + filed_at = UNSET + elif isinstance(self.filed_at, datetime.datetime): + filed_at = self.filed_at.isoformat() + else: + filed_at = self.filed_at + + filed_by: None | str | Unset + if isinstance(self.filed_by, Unset): + filed_by = UNSET + else: + filed_by = self.filed_by + + supersedes_id: None | str | Unset + if isinstance(self.supersedes_id, Unset): + supersedes_id = UNSET + else: + supersedes_id = self.supersedes_id + + superseded_by_id: None | str | Unset + if isinstance(self.superseded_by_id, Unset): + superseded_by_id = UNSET + else: + superseded_by_id = self.superseded_by_id + + source_graph_id: None | str | Unset + if isinstance(self.source_graph_id, Unset): + source_graph_id = UNSET + else: + source_graph_id = self.source_graph_id + + source_report_id: None | str | Unset + if isinstance(self.source_report_id, Unset): + source_report_id = UNSET + else: + source_report_id = self.source_report_id + + shared_at: None | str | Unset + if isinstance(self.shared_at, Unset): + shared_at = UNSET + elif isinstance(self.shared_at, datetime.datetime): + shared_at = self.shared_at.isoformat() + else: + shared_at = self.shared_at + + rule_summary: dict[str, Any] | None | Unset + if isinstance(self.rule_summary, Unset): + rule_summary = UNSET + elif isinstance(self.rule_summary, ReportResponseRuleSummaryType0): + rule_summary = self.rule_summary.to_dict() + else: + rule_summary = self.rule_summary + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "name": name, + "taxonomy_id": taxonomy_id, + "generation_status": generation_status, + "period_type": period_type, + "comparative": comparative, + "created_at": created_at, + } + ) + if period_start is not UNSET: + field_dict["period_start"] = period_start + if period_end is not UNSET: + field_dict["period_end"] = period_end + if periods is not UNSET: + field_dict["periods"] = periods + if mapping_id is not UNSET: + field_dict["mapping_id"] = mapping_id + if ai_generated is not UNSET: + field_dict["ai_generated"] = ai_generated + if last_generated is not UNSET: + field_dict["last_generated"] = last_generated + if structures is not UNSET: + field_dict["structures"] = structures + if entity_name is not UNSET: + field_dict["entity_name"] = entity_name + if filing_status is not UNSET: + field_dict["filing_status"] = filing_status + if filed_at is not UNSET: + field_dict["filed_at"] = filed_at + if filed_by is not UNSET: + field_dict["filed_by"] = filed_by + if supersedes_id is not UNSET: + field_dict["supersedes_id"] = supersedes_id + if superseded_by_id is not UNSET: + field_dict["superseded_by_id"] = superseded_by_id + if source_graph_id is not UNSET: + field_dict["source_graph_id"] = source_graph_id + if source_report_id is not UNSET: + field_dict["source_report_id"] = source_report_id + if shared_at is not UNSET: + field_dict["shared_at"] = shared_at + if rule_summary is not UNSET: + field_dict["rule_summary"] = rule_summary + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.period_spec import PeriodSpec + from ..models.report_response_rule_summary_type_0 import ( + ReportResponseRuleSummaryType0, + ) + from ..models.structure_summary import StructureSummary + + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name") + + taxonomy_id = d.pop("taxonomy_id") + + generation_status = d.pop("generation_status") + + period_type = d.pop("period_type") + + comparative = d.pop("comparative") + + created_at = isoparse(d.pop("created_at")) + + def _parse_period_start(data: object) -> datetime.date | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + period_start_type_0 = isoparse(data).date() + + return period_start_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None | Unset, data) + + period_start = _parse_period_start(d.pop("period_start", UNSET)) + + def _parse_period_end(data: object) -> datetime.date | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + period_end_type_0 = isoparse(data).date() + + return period_end_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None | Unset, data) + + period_end = _parse_period_end(d.pop("period_end", UNSET)) + + def _parse_periods(data: object) -> list[PeriodSpec] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + periods_type_0 = [] + _periods_type_0 = data + for periods_type_0_item_data in _periods_type_0: + periods_type_0_item = PeriodSpec.from_dict(periods_type_0_item_data) + + periods_type_0.append(periods_type_0_item) + + return periods_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[PeriodSpec] | None | Unset, data) + + periods = _parse_periods(d.pop("periods", UNSET)) + + def _parse_mapping_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + mapping_id = _parse_mapping_id(d.pop("mapping_id", UNSET)) + + ai_generated = d.pop("ai_generated", UNSET) + + def _parse_last_generated(data: object) -> datetime.datetime | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + last_generated_type_0 = isoparse(data) + + return last_generated_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None | Unset, data) + + last_generated = _parse_last_generated(d.pop("last_generated", UNSET)) + + _structures = d.pop("structures", UNSET) + structures: list[StructureSummary] | Unset = UNSET + if _structures is not UNSET: + structures = [] + for structures_item_data in _structures: + structures_item = StructureSummary.from_dict(structures_item_data) + + structures.append(structures_item) + + def _parse_entity_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + entity_name = _parse_entity_name(d.pop("entity_name", UNSET)) + + filing_status = d.pop("filing_status", UNSET) + + def _parse_filed_at(data: object) -> datetime.datetime | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + filed_at_type_0 = isoparse(data) + + return filed_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None | Unset, data) + + filed_at = _parse_filed_at(d.pop("filed_at", UNSET)) + + def _parse_filed_by(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + filed_by = _parse_filed_by(d.pop("filed_by", UNSET)) + + def _parse_supersedes_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + supersedes_id = _parse_supersedes_id(d.pop("supersedes_id", UNSET)) + + def _parse_superseded_by_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + superseded_by_id = _parse_superseded_by_id(d.pop("superseded_by_id", UNSET)) + + def _parse_source_graph_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + source_graph_id = _parse_source_graph_id(d.pop("source_graph_id", UNSET)) + + def _parse_source_report_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + source_report_id = _parse_source_report_id(d.pop("source_report_id", UNSET)) + + def _parse_shared_at(data: object) -> datetime.datetime | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + shared_at_type_0 = isoparse(data) + + return shared_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None | Unset, data) + + shared_at = _parse_shared_at(d.pop("shared_at", UNSET)) + + def _parse_rule_summary( + data: object, + ) -> None | ReportResponseRuleSummaryType0 | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + rule_summary_type_0 = ReportResponseRuleSummaryType0.from_dict(data) + + return rule_summary_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | ReportResponseRuleSummaryType0 | Unset, data) + + rule_summary = _parse_rule_summary(d.pop("rule_summary", UNSET)) + + report_response = cls( + id=id, + name=name, + taxonomy_id=taxonomy_id, + generation_status=generation_status, + period_type=period_type, + comparative=comparative, + created_at=created_at, + period_start=period_start, + period_end=period_end, + periods=periods, + mapping_id=mapping_id, + ai_generated=ai_generated, + last_generated=last_generated, + structures=structures, + entity_name=entity_name, + filing_status=filing_status, + filed_at=filed_at, + filed_by=filed_by, + supersedes_id=supersedes_id, + superseded_by_id=superseded_by_id, + source_graph_id=source_graph_id, + source_report_id=source_report_id, + shared_at=shared_at, + rule_summary=rule_summary, + ) + + report_response.additional_properties = d + return report_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/report_response_rule_summary_type_0.py b/robosystems_client/models/report_response_rule_summary_type_0.py new file mode 100644 index 0000000..916fdad --- /dev/null +++ b/robosystems_client/models/report_response_rule_summary_type_0.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ReportResponseRuleSummaryType0") + + +@_attrs_define +class ReportResponseRuleSummaryType0: + """ """ + + additional_properties: dict[str, int] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + report_response_rule_summary_type_0 = cls() + + report_response_rule_summary_type_0.additional_properties = d + return report_response_rule_summary_type_0 + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> int: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: int) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/set_close_target_operation.py b/robosystems_client/models/set_close_target_operation.py index 1c4feb1..67edb5d 100644 --- a/robosystems_client/models/set_close_target_operation.py +++ b/robosystems_client/models/set_close_target_operation.py @@ -15,7 +15,7 @@ class SetCloseTargetOperation: """ Attributes: - period (str): Target period in YYYY-MM format + period (str): Target period in YYYY-MM format. Must be > current `closed_through`. note (None | str | Unset): Free-form note attached to the audit event """ diff --git a/robosystems_client/models/share_report_operation.py b/robosystems_client/models/share_report_operation.py index 97b6d06..4235544 100644 --- a/robosystems_client/models/share_report_operation.py +++ b/robosystems_client/models/share_report_operation.py @@ -11,10 +11,11 @@ @_attrs_define class ShareReportOperation: - """ + """Share a published Report to every member of a publish list. + Attributes: - publish_list_id (str): Publish list to share the report to - report_id (str): + publish_list_id (str): Publish list whose members will receive the report. Created via `create-publish-list`. + report_id (str): The published Report to share. """ publish_list_id: str diff --git a/robosystems_client/models/share_report_response.py b/robosystems_client/models/share_report_response.py new file mode 100644 index 0000000..7cd603d --- /dev/null +++ b/robosystems_client/models/share_report_response.py @@ -0,0 +1,85 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.share_result_item import ShareResultItem + + +T = TypeVar("T", bound="ShareReportResponse") + + +@_attrs_define +class ShareReportResponse: + """Result of sharing a report to a publish list — one row per target. + + Attributes: + report_id (str): The report that was shared. + results (list[ShareResultItem]): Per-recipient outcomes. Inspect to find partial failures — the share operation + does not fail-fast across targets. + """ + + report_id: str + results: list[ShareResultItem] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + report_id = self.report_id + + results = [] + for results_item_data in self.results: + results_item = results_item_data.to_dict() + results.append(results_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "report_id": report_id, + "results": results, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.share_result_item import ShareResultItem + + d = dict(src_dict) + report_id = d.pop("report_id") + + results = [] + _results = d.pop("results") + for results_item_data in _results: + results_item = ShareResultItem.from_dict(results_item_data) + + results.append(results_item) + + share_report_response = cls( + report_id=report_id, + results=results, + ) + + share_report_response.additional_properties = d + return share_report_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/share_result_item.py b/robosystems_client/models/share_result_item.py new file mode 100644 index 0000000..5894f85 --- /dev/null +++ b/robosystems_client/models/share_result_item.py @@ -0,0 +1,102 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ShareResultItem") + + +@_attrs_define +class ShareResultItem: + """Per-target outcome of a `share-report` call. + + Attributes: + target_graph_id (str): Recipient graph ID (a publish-list member). + status (str): `shared` when the copy succeeded; `error` when this target failed (other targets may still have + succeeded). + error (None | str | Unset): Error message when `status='error'`, else null. + fact_count (int | Unset): Number of facts copied into the target on success. Default: 0. + """ + + target_graph_id: str + status: str + error: None | str | Unset = UNSET + fact_count: int | Unset = 0 + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + target_graph_id = self.target_graph_id + + status = self.status + + error: None | str | Unset + if isinstance(self.error, Unset): + error = UNSET + else: + error = self.error + + fact_count = self.fact_count + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "target_graph_id": target_graph_id, + "status": status, + } + ) + if error is not UNSET: + field_dict["error"] = error + if fact_count is not UNSET: + field_dict["fact_count"] = fact_count + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + target_graph_id = d.pop("target_graph_id") + + status = d.pop("status") + + def _parse_error(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + error = _parse_error(d.pop("error", UNSET)) + + fact_count = d.pop("fact_count", UNSET) + + share_result_item = cls( + target_graph_id=target_graph_id, + status=status, + error=error, + fact_count=fact_count, + ) + + share_result_item.additional_properties = d + return share_result_item + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/structure_summary.py b/robosystems_client/models/structure_summary.py new file mode 100644 index 0000000..173f90e --- /dev/null +++ b/robosystems_client/models/structure_summary.py @@ -0,0 +1,83 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="StructureSummary") + + +@_attrs_define +class StructureSummary: + """A structure available within this report's taxonomy. + + Each structure is a renderable section (Balance Sheet, Income + Statement, Cash Flow Statement, Equity, or a Schedule). The Report + row owns the facts; structures are the lenses that project them. + + Attributes: + id (str): Structure identifier. + name (str): Human-readable structure name. + structure_type (str): Structure category: `balance_sheet`, `income_statement`, `cash_flow_statement`, + `equity_statement`, `schedule`. + """ + + id: str + name: str + structure_type: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + structure_type = self.structure_type + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "name": name, + "structure_type": structure_type, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name") + + structure_type = d.pop("structure_type") + + structure_summary = cls( + id=id, + name=name, + structure_type=structure_type, + ) + + structure_summary.additional_properties = d + return structure_summary + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/taxonomy_block_association.py b/robosystems_client/models/taxonomy_block_association.py new file mode 100644 index 0000000..fe6b148 --- /dev/null +++ b/robosystems_client/models/taxonomy_block_association.py @@ -0,0 +1,156 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="TaxonomyBlockAssociation") + + +@_attrs_define +class TaxonomyBlockAssociation: + """Association projection for the Taxonomy Block envelope. + + Attributes: + id (str): + structure_id (str): + from_element_qname (str): + to_element_qname (str): + association_type (str): + order_value (float | None | Unset): + arcrole (None | str | Unset): + weight (float | None | Unset): + """ + + id: str + structure_id: str + from_element_qname: str + to_element_qname: str + association_type: str + order_value: float | None | Unset = UNSET + arcrole: None | str | Unset = UNSET + weight: float | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + structure_id = self.structure_id + + from_element_qname = self.from_element_qname + + to_element_qname = self.to_element_qname + + association_type = self.association_type + + order_value: float | None | Unset + if isinstance(self.order_value, Unset): + order_value = UNSET + else: + order_value = self.order_value + + arcrole: None | str | Unset + if isinstance(self.arcrole, Unset): + arcrole = UNSET + else: + arcrole = self.arcrole + + weight: float | None | Unset + if isinstance(self.weight, Unset): + weight = UNSET + else: + weight = self.weight + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "structure_id": structure_id, + "from_element_qname": from_element_qname, + "to_element_qname": to_element_qname, + "association_type": association_type, + } + ) + if order_value is not UNSET: + field_dict["order_value"] = order_value + if arcrole is not UNSET: + field_dict["arcrole"] = arcrole + if weight is not UNSET: + field_dict["weight"] = weight + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + structure_id = d.pop("structure_id") + + from_element_qname = d.pop("from_element_qname") + + to_element_qname = d.pop("to_element_qname") + + association_type = d.pop("association_type") + + def _parse_order_value(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + order_value = _parse_order_value(d.pop("order_value", UNSET)) + + def _parse_arcrole(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + arcrole = _parse_arcrole(d.pop("arcrole", UNSET)) + + def _parse_weight(data: object) -> float | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(float | None | Unset, data) + + weight = _parse_weight(d.pop("weight", UNSET)) + + taxonomy_block_association = cls( + id=id, + structure_id=structure_id, + from_element_qname=from_element_qname, + to_element_qname=to_element_qname, + association_type=association_type, + order_value=order_value, + arcrole=arcrole, + weight=weight, + ) + + taxonomy_block_association.additional_properties = d + return taxonomy_block_association + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/taxonomy_block_element.py b/robosystems_client/models/taxonomy_block_element.py new file mode 100644 index 0000000..bce64ca --- /dev/null +++ b/robosystems_client/models/taxonomy_block_element.py @@ -0,0 +1,220 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.taxonomy_block_element_origin import TaxonomyBlockElementOrigin +from ..types import UNSET, Unset + +T = TypeVar("T", bound="TaxonomyBlockElement") + + +@_attrs_define +class TaxonomyBlockElement: + """Element projection for the Taxonomy Block envelope. + + Attributes: + id (str): + name (str): + origin (TaxonomyBlockElementOrigin): Provenance — 'library' if the element's taxonomy is locked + (``is_locked=true``), else 'tenant'. + qname (None | str | Unset): + trait (None | str | Unset): + balance_type (None | str | Unset): + period_type (None | str | Unset): + element_type (str | Unset): Default: 'concept'. + is_monetary (bool | Unset): Default: True. + parent_qname (None | str | Unset): + depth (int | None | Unset): + """ + + id: str + name: str + origin: TaxonomyBlockElementOrigin + qname: None | str | Unset = UNSET + trait: None | str | Unset = UNSET + balance_type: None | str | Unset = UNSET + period_type: None | str | Unset = UNSET + element_type: str | Unset = "concept" + is_monetary: bool | Unset = True + parent_qname: None | str | Unset = UNSET + depth: int | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + origin = self.origin.value + + qname: None | str | Unset + if isinstance(self.qname, Unset): + qname = UNSET + else: + qname = self.qname + + trait: None | str | Unset + if isinstance(self.trait, Unset): + trait = UNSET + else: + trait = self.trait + + balance_type: None | str | Unset + if isinstance(self.balance_type, Unset): + balance_type = UNSET + else: + balance_type = self.balance_type + + period_type: None | str | Unset + if isinstance(self.period_type, Unset): + period_type = UNSET + else: + period_type = self.period_type + + element_type = self.element_type + + is_monetary = self.is_monetary + + parent_qname: None | str | Unset + if isinstance(self.parent_qname, Unset): + parent_qname = UNSET + else: + parent_qname = self.parent_qname + + depth: int | None | Unset + if isinstance(self.depth, Unset): + depth = UNSET + else: + depth = self.depth + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "name": name, + "origin": origin, + } + ) + if qname is not UNSET: + field_dict["qname"] = qname + if trait is not UNSET: + field_dict["trait"] = trait + if balance_type is not UNSET: + field_dict["balance_type"] = balance_type + if period_type is not UNSET: + field_dict["period_type"] = period_type + if element_type is not UNSET: + field_dict["element_type"] = element_type + if is_monetary is not UNSET: + field_dict["is_monetary"] = is_monetary + if parent_qname is not UNSET: + field_dict["parent_qname"] = parent_qname + if depth is not UNSET: + field_dict["depth"] = depth + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name") + + origin = TaxonomyBlockElementOrigin(d.pop("origin")) + + def _parse_qname(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + qname = _parse_qname(d.pop("qname", UNSET)) + + def _parse_trait(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + trait = _parse_trait(d.pop("trait", UNSET)) + + def _parse_balance_type(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + balance_type = _parse_balance_type(d.pop("balance_type", UNSET)) + + def _parse_period_type(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + period_type = _parse_period_type(d.pop("period_type", UNSET)) + + element_type = d.pop("element_type", UNSET) + + is_monetary = d.pop("is_monetary", UNSET) + + def _parse_parent_qname(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + parent_qname = _parse_parent_qname(d.pop("parent_qname", UNSET)) + + def _parse_depth(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + depth = _parse_depth(d.pop("depth", UNSET)) + + taxonomy_block_element = cls( + id=id, + name=name, + origin=origin, + qname=qname, + trait=trait, + balance_type=balance_type, + period_type=period_type, + element_type=element_type, + is_monetary=is_monetary, + parent_qname=parent_qname, + depth=depth, + ) + + taxonomy_block_element.additional_properties = d + return taxonomy_block_element + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/taxonomy_block_element_origin.py b/robosystems_client/models/taxonomy_block_element_origin.py new file mode 100644 index 0000000..15545d0 --- /dev/null +++ b/robosystems_client/models/taxonomy_block_element_origin.py @@ -0,0 +1,9 @@ +from enum import Enum + + +class TaxonomyBlockElementOrigin(str, Enum): + LIBRARY = "library" + TENANT = "tenant" + + def __str__(self) -> str: + return str(self.value) diff --git a/robosystems_client/models/taxonomy_block_envelope.py b/robosystems_client/models/taxonomy_block_envelope.py new file mode 100644 index 0000000..bd78724 --- /dev/null +++ b/robosystems_client/models/taxonomy_block_envelope.py @@ -0,0 +1,371 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.taxonomy_block_association import TaxonomyBlockAssociation + from ..models.taxonomy_block_element import TaxonomyBlockElement + from ..models.taxonomy_block_envelope_verification_results_item import ( + TaxonomyBlockEnvelopeVerificationResultsItem, + ) + from ..models.taxonomy_block_rule import TaxonomyBlockRule + from ..models.taxonomy_block_structure import TaxonomyBlockStructure + + +T = TypeVar("T", bound="TaxonomyBlockEnvelope") + + +@_attrs_define +class TaxonomyBlockEnvelope: + """The Taxonomy Block exchange format. + + One envelope per taxonomy instance. Carries identity + type, + registry-sourced display metadata, the parent taxonomy pointer (for + ``reporting_extension`` blocks), and bundled atoms (elements, + structures, associations, rules, verification results). + + Attributes: + id (str): Taxonomy row id. + name (str): + taxonomy_type (str): Block-type discriminator — 'reporting_standard' | 'reporting_extension' | + 'chart_of_accounts' | 'custom_ontology'. + display_name (str): Registry-sourced display label. + category (str): Registry-sourced sidebar grouping. + parent_taxonomy_id (None | str | Unset): + parent_taxonomy_name (None | str | Unset): + version (None | str | Unset): + standard (None | str | Unset): + namespace_uri (None | str | Unset): + is_locked (bool | Unset): Default: False. + elements (list[TaxonomyBlockElement] | Unset): + structures (list[TaxonomyBlockStructure] | Unset): + associations (list[TaxonomyBlockAssociation] | Unset): + rules (list[TaxonomyBlockRule] | Unset): + verification_results (list[TaxonomyBlockEnvelopeVerificationResultsItem] | Unset): + element_count (int | Unset): Default: 0. + structure_count (int | Unset): Default: 0. + association_count (int | Unset): Default: 0. + """ + + id: str + name: str + taxonomy_type: str + display_name: str + category: str + parent_taxonomy_id: None | str | Unset = UNSET + parent_taxonomy_name: None | str | Unset = UNSET + version: None | str | Unset = UNSET + standard: None | str | Unset = UNSET + namespace_uri: None | str | Unset = UNSET + is_locked: bool | Unset = False + elements: list[TaxonomyBlockElement] | Unset = UNSET + structures: list[TaxonomyBlockStructure] | Unset = UNSET + associations: list[TaxonomyBlockAssociation] | Unset = UNSET + rules: list[TaxonomyBlockRule] | Unset = UNSET + verification_results: list[TaxonomyBlockEnvelopeVerificationResultsItem] | Unset = ( + UNSET + ) + element_count: int | Unset = 0 + structure_count: int | Unset = 0 + association_count: int | Unset = 0 + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + taxonomy_type = self.taxonomy_type + + display_name = self.display_name + + category = self.category + + parent_taxonomy_id: None | str | Unset + if isinstance(self.parent_taxonomy_id, Unset): + parent_taxonomy_id = UNSET + else: + parent_taxonomy_id = self.parent_taxonomy_id + + parent_taxonomy_name: None | str | Unset + if isinstance(self.parent_taxonomy_name, Unset): + parent_taxonomy_name = UNSET + else: + parent_taxonomy_name = self.parent_taxonomy_name + + version: None | str | Unset + if isinstance(self.version, Unset): + version = UNSET + else: + version = self.version + + standard: None | str | Unset + if isinstance(self.standard, Unset): + standard = UNSET + else: + standard = self.standard + + namespace_uri: None | str | Unset + if isinstance(self.namespace_uri, Unset): + namespace_uri = UNSET + else: + namespace_uri = self.namespace_uri + + is_locked = self.is_locked + + elements: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.elements, Unset): + elements = [] + for elements_item_data in self.elements: + elements_item = elements_item_data.to_dict() + elements.append(elements_item) + + structures: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.structures, Unset): + structures = [] + for structures_item_data in self.structures: + structures_item = structures_item_data.to_dict() + structures.append(structures_item) + + associations: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.associations, Unset): + associations = [] + for associations_item_data in self.associations: + associations_item = associations_item_data.to_dict() + associations.append(associations_item) + + rules: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.rules, Unset): + rules = [] + for rules_item_data in self.rules: + rules_item = rules_item_data.to_dict() + rules.append(rules_item) + + verification_results: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.verification_results, Unset): + verification_results = [] + for verification_results_item_data in self.verification_results: + verification_results_item = verification_results_item_data.to_dict() + verification_results.append(verification_results_item) + + element_count = self.element_count + + structure_count = self.structure_count + + association_count = self.association_count + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "name": name, + "taxonomy_type": taxonomy_type, + "display_name": display_name, + "category": category, + } + ) + if parent_taxonomy_id is not UNSET: + field_dict["parent_taxonomy_id"] = parent_taxonomy_id + if parent_taxonomy_name is not UNSET: + field_dict["parent_taxonomy_name"] = parent_taxonomy_name + if version is not UNSET: + field_dict["version"] = version + if standard is not UNSET: + field_dict["standard"] = standard + if namespace_uri is not UNSET: + field_dict["namespace_uri"] = namespace_uri + if is_locked is not UNSET: + field_dict["is_locked"] = is_locked + if elements is not UNSET: + field_dict["elements"] = elements + if structures is not UNSET: + field_dict["structures"] = structures + if associations is not UNSET: + field_dict["associations"] = associations + if rules is not UNSET: + field_dict["rules"] = rules + if verification_results is not UNSET: + field_dict["verification_results"] = verification_results + if element_count is not UNSET: + field_dict["element_count"] = element_count + if structure_count is not UNSET: + field_dict["structure_count"] = structure_count + if association_count is not UNSET: + field_dict["association_count"] = association_count + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.taxonomy_block_association import TaxonomyBlockAssociation + from ..models.taxonomy_block_element import TaxonomyBlockElement + from ..models.taxonomy_block_envelope_verification_results_item import ( + TaxonomyBlockEnvelopeVerificationResultsItem, + ) + from ..models.taxonomy_block_rule import TaxonomyBlockRule + from ..models.taxonomy_block_structure import TaxonomyBlockStructure + + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name") + + taxonomy_type = d.pop("taxonomy_type") + + display_name = d.pop("display_name") + + category = d.pop("category") + + def _parse_parent_taxonomy_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + parent_taxonomy_id = _parse_parent_taxonomy_id(d.pop("parent_taxonomy_id", UNSET)) + + def _parse_parent_taxonomy_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + parent_taxonomy_name = _parse_parent_taxonomy_name( + d.pop("parent_taxonomy_name", UNSET) + ) + + def _parse_version(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + version = _parse_version(d.pop("version", UNSET)) + + def _parse_standard(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + standard = _parse_standard(d.pop("standard", UNSET)) + + def _parse_namespace_uri(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + namespace_uri = _parse_namespace_uri(d.pop("namespace_uri", UNSET)) + + is_locked = d.pop("is_locked", UNSET) + + _elements = d.pop("elements", UNSET) + elements: list[TaxonomyBlockElement] | Unset = UNSET + if _elements is not UNSET: + elements = [] + for elements_item_data in _elements: + elements_item = TaxonomyBlockElement.from_dict(elements_item_data) + + elements.append(elements_item) + + _structures = d.pop("structures", UNSET) + structures: list[TaxonomyBlockStructure] | Unset = UNSET + if _structures is not UNSET: + structures = [] + for structures_item_data in _structures: + structures_item = TaxonomyBlockStructure.from_dict(structures_item_data) + + structures.append(structures_item) + + _associations = d.pop("associations", UNSET) + associations: list[TaxonomyBlockAssociation] | Unset = UNSET + if _associations is not UNSET: + associations = [] + for associations_item_data in _associations: + associations_item = TaxonomyBlockAssociation.from_dict(associations_item_data) + + associations.append(associations_item) + + _rules = d.pop("rules", UNSET) + rules: list[TaxonomyBlockRule] | Unset = UNSET + if _rules is not UNSET: + rules = [] + for rules_item_data in _rules: + rules_item = TaxonomyBlockRule.from_dict(rules_item_data) + + rules.append(rules_item) + + _verification_results = d.pop("verification_results", UNSET) + verification_results: list[TaxonomyBlockEnvelopeVerificationResultsItem] | Unset = ( + UNSET + ) + if _verification_results is not UNSET: + verification_results = [] + for verification_results_item_data in _verification_results: + verification_results_item = ( + TaxonomyBlockEnvelopeVerificationResultsItem.from_dict( + verification_results_item_data + ) + ) + + verification_results.append(verification_results_item) + + element_count = d.pop("element_count", UNSET) + + structure_count = d.pop("structure_count", UNSET) + + association_count = d.pop("association_count", UNSET) + + taxonomy_block_envelope = cls( + id=id, + name=name, + taxonomy_type=taxonomy_type, + display_name=display_name, + category=category, + parent_taxonomy_id=parent_taxonomy_id, + parent_taxonomy_name=parent_taxonomy_name, + version=version, + standard=standard, + namespace_uri=namespace_uri, + is_locked=is_locked, + elements=elements, + structures=structures, + associations=associations, + rules=rules, + verification_results=verification_results, + element_count=element_count, + structure_count=structure_count, + association_count=association_count, + ) + + taxonomy_block_envelope.additional_properties = d + return taxonomy_block_envelope + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/taxonomy_block_envelope_verification_results_item.py b/robosystems_client/models/taxonomy_block_envelope_verification_results_item.py new file mode 100644 index 0000000..a6d07b1 --- /dev/null +++ b/robosystems_client/models/taxonomy_block_envelope_verification_results_item.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="TaxonomyBlockEnvelopeVerificationResultsItem") + + +@_attrs_define +class TaxonomyBlockEnvelopeVerificationResultsItem: + """ """ + + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + taxonomy_block_envelope_verification_results_item = cls() + + taxonomy_block_envelope_verification_results_item.additional_properties = d + return taxonomy_block_envelope_verification_results_item + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/taxonomy_block_rule.py b/robosystems_client/models/taxonomy_block_rule.py new file mode 100644 index 0000000..7664d4b --- /dev/null +++ b/robosystems_client/models/taxonomy_block_rule.py @@ -0,0 +1,155 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="TaxonomyBlockRule") + + +@_attrs_define +class TaxonomyBlockRule: + """Rule projection for the Taxonomy Block envelope. + + Attributes: + id (str): + name (str): + rule_category (str): + rule_pattern (str): + rule_expression (str): + severity (str | Unset): Default: 'error'. + origin (str | Unset): 'forked' | 'native' | 'auto' — matches DB CHECK. Default: 'native'. + target_kind (None | str | Unset): + target_ref (None | str | Unset): Polymorphic display string — structure_id, element qname, association_id, or + taxonomy_id depending on ``target_kind``. + """ + + id: str + name: str + rule_category: str + rule_pattern: str + rule_expression: str + severity: str | Unset = "error" + origin: str | Unset = "native" + target_kind: None | str | Unset = UNSET + target_ref: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + rule_category = self.rule_category + + rule_pattern = self.rule_pattern + + rule_expression = self.rule_expression + + severity = self.severity + + origin = self.origin + + target_kind: None | str | Unset + if isinstance(self.target_kind, Unset): + target_kind = UNSET + else: + target_kind = self.target_kind + + target_ref: None | str | Unset + if isinstance(self.target_ref, Unset): + target_ref = UNSET + else: + target_ref = self.target_ref + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "name": name, + "rule_category": rule_category, + "rule_pattern": rule_pattern, + "rule_expression": rule_expression, + } + ) + if severity is not UNSET: + field_dict["severity"] = severity + if origin is not UNSET: + field_dict["origin"] = origin + if target_kind is not UNSET: + field_dict["target_kind"] = target_kind + if target_ref is not UNSET: + field_dict["target_ref"] = target_ref + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name") + + rule_category = d.pop("rule_category") + + rule_pattern = d.pop("rule_pattern") + + rule_expression = d.pop("rule_expression") + + severity = d.pop("severity", UNSET) + + origin = d.pop("origin", UNSET) + + def _parse_target_kind(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + target_kind = _parse_target_kind(d.pop("target_kind", UNSET)) + + def _parse_target_ref(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + target_ref = _parse_target_ref(d.pop("target_ref", UNSET)) + + taxonomy_block_rule = cls( + id=id, + name=name, + rule_category=rule_category, + rule_pattern=rule_pattern, + rule_expression=rule_expression, + severity=severity, + origin=origin, + target_kind=target_kind, + target_ref=target_ref, + ) + + taxonomy_block_rule.additional_properties = d + return taxonomy_block_rule + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/taxonomy_block_structure.py b/robosystems_client/models/taxonomy_block_structure.py new file mode 100644 index 0000000..dc5d065 --- /dev/null +++ b/robosystems_client/models/taxonomy_block_structure.py @@ -0,0 +1,120 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="TaxonomyBlockStructure") + + +@_attrs_define +class TaxonomyBlockStructure: + """Structure projection for the Taxonomy Block envelope. + + Attributes: + id (str): + name (str): + structure_type (str): + description (None | str | Unset): + role_uri (None | str | Unset): + """ + + id: str + name: str + structure_type: str + description: None | str | Unset = UNSET + role_uri: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + structure_type = self.structure_type + + description: None | str | Unset + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + role_uri: None | str | Unset + if isinstance(self.role_uri, Unset): + role_uri = UNSET + else: + role_uri = self.role_uri + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "id": id, + "name": name, + "structure_type": structure_type, + } + ) + if description is not UNSET: + field_dict["description"] = description + if role_uri is not UNSET: + field_dict["role_uri"] = role_uri + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + id = d.pop("id") + + name = d.pop("name") + + structure_type = d.pop("structure_type") + + def _parse_description(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + description = _parse_description(d.pop("description", UNSET)) + + def _parse_role_uri(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + role_uri = _parse_role_uri(d.pop("role_uri", UNSET)) + + taxonomy_block_structure = cls( + id=id, + name=name, + structure_type=structure_type, + description=description, + role_uri=role_uri, + ) + + taxonomy_block_structure.additional_properties = d + return taxonomy_block_structure + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/transaction_preview.py b/robosystems_client/models/transaction_preview.py new file mode 100644 index 0000000..17f54f3 --- /dev/null +++ b/robosystems_client/models/transaction_preview.py @@ -0,0 +1,102 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="TransactionPreview") + + +@_attrs_define +class TransactionPreview: + """A planned GL entry line from preview-event-block (no rows written). + + Attributes: + entry_index (int): + debit_element_id (str): + credit_element_id (str): + amount_cents (int): + interpolated_debit_amount (str): + interpolated_credit_amount (str): + """ + + entry_index: int + debit_element_id: str + credit_element_id: str + amount_cents: int + interpolated_debit_amount: str + interpolated_credit_amount: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + entry_index = self.entry_index + + debit_element_id = self.debit_element_id + + credit_element_id = self.credit_element_id + + amount_cents = self.amount_cents + + interpolated_debit_amount = self.interpolated_debit_amount + + interpolated_credit_amount = self.interpolated_credit_amount + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "entry_index": entry_index, + "debit_element_id": debit_element_id, + "credit_element_id": credit_element_id, + "amount_cents": amount_cents, + "interpolated_debit_amount": interpolated_debit_amount, + "interpolated_credit_amount": interpolated_credit_amount, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + entry_index = d.pop("entry_index") + + debit_element_id = d.pop("debit_element_id") + + credit_element_id = d.pop("credit_element_id") + + amount_cents = d.pop("amount_cents") + + interpolated_debit_amount = d.pop("interpolated_debit_amount") + + interpolated_credit_amount = d.pop("interpolated_credit_amount") + + transaction_preview = cls( + entry_index=entry_index, + debit_element_id=debit_element_id, + credit_element_id=credit_element_id, + amount_cents=amount_cents, + interpolated_debit_amount=interpolated_debit_amount, + interpolated_credit_amount=interpolated_credit_amount, + ) + + transaction_preview.additional_properties = d + return transaction_preview + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/robosystems_client/models/transition_filing_status_request.py b/robosystems_client/models/transition_filing_status_request.py index a0eaa95..72ba404 100644 --- a/robosystems_client/models/transition_filing_status_request.py +++ b/robosystems_client/models/transition_filing_status_request.py @@ -19,8 +19,9 @@ class TransitionFilingStatusRequest: audit fields land cleanly. Attributes: - report_id (str): - target_status (str): under_review | archived + report_id (str): The Report to transition. + target_status (str): Target lifecycle state: `under_review` (submit a draft for review) or `archived` (supersede + / retire a filed report). Reaching `filed` goes through `file-report` so audit fields land cleanly. """ report_id: str diff --git a/robosystems_client/models/update_agent_request.py b/robosystems_client/models/update_agent_request.py index 57cbf16..f03c038 100644 --- a/robosystems_client/models/update_agent_request.py +++ b/robosystems_client/models/update_agent_request.py @@ -22,21 +22,25 @@ @_attrs_define class UpdateAgentRequest: - """ - Attributes: - agent_id (str): - name (None | str | Unset): - legal_name (None | str | Unset): - tax_id (None | str | Unset): - registration_number (None | str | Unset): - duns (None | str | Unset): - lei (None | str | Unset): - email (None | str | Unset): - phone (None | str | Unset): - address (None | Unset | UpdateAgentRequestAddressType0): - is_active (bool | None | Unset): - is_1099_recipient (bool | None | Unset): - metadata_patch (UpdateAgentRequestMetadataPatch | Unset): + """Patch an agent. All fields except ``agent_id`` are optional — + pass only what changes. ``metadata_patch`` is deep-merged into the + existing metadata dict. + + Attributes: + agent_id (str): The agent to update. + name (None | str | Unset): + legal_name (None | str | Unset): + tax_id (None | str | Unset): + registration_number (None | str | Unset): + duns (None | str | Unset): + lei (None | str | Unset): + email (None | str | Unset): + phone (None | str | Unset): + address (None | Unset | UpdateAgentRequestAddressType0): + is_active (bool | None | Unset): Toggle activation. Inactive agents are hidden from new-transaction pickers. + is_1099_recipient (bool | None | Unset): + metadata_patch (UpdateAgentRequestMetadataPatch | Unset): Deep-merged into agent.metadata. Pass `{}` to leave + unchanged. """ agent_id: str diff --git a/robosystems_client/models/update_agent_request_metadata_patch.py b/robosystems_client/models/update_agent_request_metadata_patch.py index 9e804b1..d99c962 100644 --- a/robosystems_client/models/update_agent_request_metadata_patch.py +++ b/robosystems_client/models/update_agent_request_metadata_patch.py @@ -11,7 +11,7 @@ @_attrs_define class UpdateAgentRequestMetadataPatch: - """ """ + """Deep-merged into agent.metadata. Pass `{}` to leave unchanged.""" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) diff --git a/robosystems_client/models/update_entity_request.py b/robosystems_client/models/update_entity_request.py index 59f03ae..8abb85e 100644 --- a/robosystems_client/models/update_entity_request.py +++ b/robosystems_client/models/update_entity_request.py @@ -13,31 +13,37 @@ @_attrs_define class UpdateEntityRequest: - """Request to update entity details. Only provided fields are updated. - - Attributes: - name (None | str | Unset): - legal_name (None | str | Unset): - uri (None | str | Unset): - cik (None | str | Unset): - ticker (None | str | Unset): - exchange (None | str | Unset): - sic (None | str | Unset): - sic_description (None | str | Unset): - category (None | str | Unset): - state_of_incorporation (None | str | Unset): - fiscal_year_end (None | str | Unset): - tax_id (None | str | Unset): - lei (None | str | Unset): - industry (None | str | Unset): - entity_type (None | str | Unset): - phone (None | str | Unset): - website (None | str | Unset): - address_line1 (None | str | Unset): - address_city (None | str | Unset): - address_state (None | str | Unset): - address_postal_code (None | str | Unset): - address_country (None | str | Unset): + """Update the graph's primary entity. All fields are optional — + pass only what changes. Identifiers (CIK, LEI, tax_id) are typically + set once at onboarding; address fields are flattened to make them + easy to project into reporting forms (1099, state filings). + + The graph is implicit (URL path) — there's no `entity_id` field + because the operation always targets the graph's primary entity. + + Attributes: + name (None | str | Unset): + legal_name (None | str | Unset): + uri (None | str | Unset): + cik (None | str | Unset): + ticker (None | str | Unset): + exchange (None | str | Unset): + sic (None | str | Unset): + sic_description (None | str | Unset): + category (None | str | Unset): + state_of_incorporation (None | str | Unset): + fiscal_year_end (None | str | Unset): Fiscal year-end as MM-DD (e.g. '12-31', '06-30'). + tax_id (None | str | Unset): + lei (None | str | Unset): + industry (None | str | Unset): + entity_type (None | str | Unset): + phone (None | str | Unset): + website (None | str | Unset): + address_line1 (None | str | Unset): + address_city (None | str | Unset): + address_state (None | str | Unset): + address_postal_code (None | str | Unset): + address_country (None | str | Unset): """ name: None | str | Unset = UNSET diff --git a/robosystems_client/models/update_event_handler_request.py b/robosystems_client/models/update_event_handler_request.py index 4ed2346..0e9f702 100644 --- a/robosystems_client/models/update_event_handler_request.py +++ b/robosystems_client/models/update_event_handler_request.py @@ -23,21 +23,32 @@ @_attrs_define class UpdateEventHandlerRequest: - """ - Attributes: - event_handler_id (str): - name (None | str | Unset): - description (None | str | Unset): - event_category (None | str | Unset): - match_source (None | str | Unset): - match_agent_type (None | str | Unset): - match_resource_type (None | str | Unset): - match_metadata_expression (None | Unset | UpdateEventHandlerRequestMatchMetadataExpressionType0): - transaction_template (None | TransactionTemplate | Unset): - priority (int | None | Unset): - is_active (bool | None | Unset): - approve (bool | None | Unset): - metadata_patch (UpdateEventHandlerRequestMetadataPatch | Unset): + """Update an existing event handler. All fields except + ``event_handler_id`` are optional — pass only what changes. + + ``transaction_template`` is **fully replaced** when supplied (no + partial template patches). ``metadata_patch`` does deep-merge into + the existing metadata. ``approve=true`` sets ``approved_by`` and + ``approved_at``; ``approve=false`` clears them. + + Attributes: + event_handler_id (str): The handler to update. + name (None | str | Unset): New name. Omit to leave unchanged. + description (None | str | Unset): New description. + event_category (None | str | Unset): + match_source (None | str | Unset): + match_agent_type (None | str | Unset): + match_resource_type (None | str | Unset): + match_metadata_expression (None | Unset | UpdateEventHandlerRequestMatchMetadataExpressionType0): + transaction_template (None | TransactionTemplate | Unset): Replacement template. Whole-template replace — no + partial patch. Omit to leave unchanged. + priority (int | None | Unset): + is_active (bool | None | Unset): Toggle activation. False removes the handler from match-time consideration + without deleting it. + approve (bool | None | Unset): Approval shortcut: True stamps approved_by/approved_at to the current user; False + clears both. + metadata_patch (UpdateEventHandlerRequestMetadataPatch | Unset): Deep-merged into the existing handler.metadata. + Pass `{}` to leave metadata unchanged. """ event_handler_id: str diff --git a/robosystems_client/models/update_event_handler_request_metadata_patch.py b/robosystems_client/models/update_event_handler_request_metadata_patch.py index 7c3ffaf..7c5f108 100644 --- a/robosystems_client/models/update_event_handler_request_metadata_patch.py +++ b/robosystems_client/models/update_event_handler_request_metadata_patch.py @@ -11,7 +11,7 @@ @_attrs_define class UpdateEventHandlerRequestMetadataPatch: - """ """ + """Deep-merged into the existing handler.metadata. Pass `{}` to leave metadata unchanged.""" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) diff --git a/robosystems_client/models/update_journal_entry_request.py b/robosystems_client/models/update_journal_entry_request.py index df8b1f2..4ad1017 100644 --- a/robosystems_client/models/update_journal_entry_request.py +++ b/robosystems_client/models/update_journal_entry_request.py @@ -31,11 +31,13 @@ class UpdateJournalEntryRequest: existing line items are left untouched. Attributes: - entry_id (str): - posting_date (datetime.date | None | Unset): - memo (None | str | Unset): - type_ (None | Unset | UpdateJournalEntryRequestTypeType0): - line_items (list[JournalEntryLineItemInput] | None | Unset): + entry_id (str): The draft entry to update. + posting_date (datetime.date | None | Unset): New posting date. + memo (None | str | Unset): New entry-level memo. + type_ (None | Unset | UpdateJournalEntryRequestTypeType0): New entry type. `closing` should normally only be set + by close-period. + line_items (list[JournalEntryLineItemInput] | None | Unset): Replacement line items. Whole-list replacement (not + patch). The new set must still balance (total_debit == total_credit). Omit to leave existing lines untouched. """ entry_id: str diff --git a/robosystems_client/models/update_publish_list_operation.py b/robosystems_client/models/update_publish_list_operation.py index 7156b44..f95926b 100644 --- a/robosystems_client/models/update_publish_list_operation.py +++ b/robosystems_client/models/update_publish_list_operation.py @@ -13,11 +13,12 @@ @_attrs_define class UpdatePublishListOperation: - """ + """Update a publish list's metadata. Carries `list_id`. + Attributes: - list_id (str): - name (None | str | Unset): - description (None | str | Unset): + list_id (str): The publish list to update. + name (None | str | Unset): New list name. Omit to leave unchanged. + description (None | str | Unset): New description. Omit to leave unchanged. """ list_id: str From 99e7eaf7a51b9665621859dadb981be96f4c1ca0 Mon Sep 17 00:00:00 2001 From: "Joseph T. French" Date: Thu, 7 May 2026 14:39:37 -0500 Subject: [PATCH 4/4] feat: Update InvestorClient and LedgerClient to return typed response models --- robosystems_client/clients/investor_client.py | 68 +++-- robosystems_client/clients/ledger_client.py | 262 ++++++++++++------ 2 files changed, 224 insertions(+), 106 deletions(-) diff --git a/robosystems_client/clients/investor_client.py b/robosystems_client/clients/investor_client.py index 889eb86..3046937 100644 --- a/robosystems_client/clients/investor_client.py +++ b/robosystems_client/clients/investor_client.py @@ -9,7 +9,12 @@ `/extensions/roboinvestor/{graph_id}/operations/{operation_name}`. Every write returns an `OperationEnvelope`; the facade unwraps -`envelope.result` and returns a snake_case dict. +`envelope.result` and returns the typed SDK class advertised on the +method's return-type annotation (e.g. ``PortfolioBlockEnvelope``, +``SecurityResponse``, ``DeleteResult``). In production the result is +the SDK's generated attrs class; in unit-test contexts using dict +mocks, the result is a plain dict — both surface fields the same way +in the JSON-serialized response. """ from __future__ import annotations @@ -56,7 +61,11 @@ from ..models.create_portfolio_block_request import CreatePortfolioBlockRequest from ..models.create_security_request import CreateSecurityRequest from ..models.delete_portfolio_block_operation import DeletePortfolioBlockOperation +from ..models.delete_portfolio_block_response import DeletePortfolioBlockResponse +from ..models.delete_result import DeleteResult from ..models.delete_security_operation import DeleteSecurityOperation +from ..models.portfolio_block_envelope import PortfolioBlockEnvelope +from ..models.security_response import SecurityResponse from ..models.update_portfolio_block_operation import UpdatePortfolioBlockOperation from ..models.update_security_operation import UpdateSecurityOperation @@ -119,6 +128,14 @@ def _is_envelope(self, value: Any) -> bool: return all(hasattr(value, f) for f in self._ENVELOPE_FIELDS) def _call_op(self, label: str, response: Any) -> Any: + """Common error handling for every generated op_* REST call. + + Returns the parsed envelope unchanged. Typed-envelope ops surface + ``envelope.result`` as the SDK's typed attrs class (e.g. + ``PortfolioBlockEnvelope``); untyped ops surface it as a plain dict. + Facade methods are responsible for casting the result to the type + they advertise. + """ if response.status_code not in (HTTPStatus.OK, HTTPStatus.ACCEPTED): raise RuntimeError( f"{label} failed: {response.status_code}: {response.content!r}" @@ -126,12 +143,23 @@ def _call_op(self, label: str, response: Any) -> Any: envelope = response.parsed if not self._is_envelope(envelope): raise RuntimeError(f"{label} failed: unexpected response shape: {envelope!r}") - # Normalize result to a plain dict — typed envelopes carry the result - # as an attrs class (e.g. `PortfolioBlockEnvelope`). - if envelope.result is not None and hasattr(envelope.result, "to_dict"): - envelope.result = envelope.result.to_dict() return envelope + def _typed_result(self, label: str, envelope: Any, expected: type[Any]) -> Any: + """Return ``envelope.result`` for typed-envelope facade methods. + + See :meth:`LedgerClient._typed_result` for the contract. Briefly: in + production the SDK gives back the typed attrs class; in tests using + dict mocks the result is a plain dict; ``None``/``Unset`` is + normalized to ``{"deleted": True}`` for delete-style returns. + """ + result = envelope.result + if result is None or ( + hasattr(result, "__class__") and "Unset" in result.__class__.__name__ + ): + return {"deleted": True} + return result + # ── Portfolios ────────────────────────────────────────────────────── def list_portfolios( @@ -154,21 +182,23 @@ def get_portfolio_block( def create_portfolio_block( self, graph_id: str, body: dict[str, Any] - ) -> dict[str, Any]: + ) -> PortfolioBlockEnvelope: """Create a portfolio with optional initial positions in one atomic operation.""" request = CreatePortfolioBlockRequest.from_dict(body) response = op_create_portfolio_block( graph_id=graph_id, body=request, client=self._get_client() ) envelope = self._call_op("Create portfolio block", response) - return envelope.result or {} + return self._typed_result( + "Create portfolio block", envelope, PortfolioBlockEnvelope + ) def update_portfolio_block( self, graph_id: str, portfolio_id: str, updates: dict[str, Any], - ) -> dict[str, Any]: + ) -> PortfolioBlockEnvelope: """Update portfolio metadata and/or apply position deltas (add/update/dispose).""" body_dict = {**updates, "portfolio_id": portfolio_id} body = UpdatePortfolioBlockOperation.from_dict(body_dict) @@ -176,14 +206,16 @@ def update_portfolio_block( graph_id=graph_id, body=body, client=self._get_client() ) envelope = self._call_op("Update portfolio block", response) - return envelope.result or {} + return self._typed_result( + "Update portfolio block", envelope, PortfolioBlockEnvelope + ) def delete_portfolio_block( self, graph_id: str, portfolio_id: str, confirm_active_positions: bool = False, - ) -> dict[str, Any]: + ) -> DeletePortfolioBlockResponse: """Delete a portfolio and all its positions. Requires `confirm_active_positions=True` when active positions exist.""" body = DeletePortfolioBlockOperation( portfolio_id=portfolio_id, @@ -193,7 +225,9 @@ def delete_portfolio_block( graph_id=graph_id, body=body, client=self._get_client() ) envelope = self._call_op("Delete portfolio block", response) - return envelope.result if envelope.result is not None else {"deleted": True} + return self._typed_result( + "Delete portfolio block", envelope, DeletePortfolioBlockResponse + ) # ── Securities ────────────────────────────────────────────────────── @@ -225,21 +259,21 @@ def get_security(self, graph_id: str, security_id: str) -> dict[str, Any] | None data = self._query(graph_id, GET_SECURITY_QUERY, {"securityId": security_id}) return parse_security(data) - def create_security(self, graph_id: str, body: dict[str, Any]) -> dict[str, Any]: + def create_security(self, graph_id: str, body: dict[str, Any]) -> SecurityResponse: """Create a new security. Auto-links to an entity when `source_graph_id` is set.""" request = CreateSecurityRequest.from_dict(body) response = op_create_security( graph_id=graph_id, body=request, client=self._get_client() ) envelope = self._call_op("Create security", response) - return envelope.result or {} + return self._typed_result("Create security", envelope, SecurityResponse) def update_security( self, graph_id: str, security_id: str, updates: dict[str, Any], - ) -> dict[str, Any]: + ) -> SecurityResponse: """Update a security's metadata. Only provided fields are applied.""" body_dict = {**updates, "security_id": security_id} body = UpdateSecurityOperation.from_dict(body_dict) @@ -247,16 +281,16 @@ def update_security( graph_id=graph_id, body=body, client=self._get_client() ) envelope = self._call_op("Update security", response) - return envelope.result or {} + return self._typed_result("Update security", envelope, SecurityResponse) - def delete_security(self, graph_id: str, security_id: str) -> dict[str, Any]: + def delete_security(self, graph_id: str, security_id: str) -> DeleteResult: """Soft-delete a security (sets is_active=False).""" body = DeleteSecurityOperation(security_id=security_id) response = op_delete_security( graph_id=graph_id, body=body, client=self._get_client() ) envelope = self._call_op("Delete security", response) - return envelope.result if envelope.result is not None else {"deleted": True} + return self._typed_result("Delete security", envelope, DeleteResult) # ── Positions (read-only — writes go through portfolio block) ──────── diff --git a/robosystems_client/clients/ledger_client.py b/robosystems_client/clients/ledger_client.py index 24c4f2f..c5cb7c4 100644 --- a/robosystems_client/clients/ledger_client.py +++ b/robosystems_client/clients/ledger_client.py @@ -275,6 +275,30 @@ from ..models.delete_taxonomy_block_request import DeleteTaxonomyBlockRequest from ..models.evaluate_rules_request import EvaluateRulesRequest from ..models.update_entity_request import UpdateEntityRequest + +# Typed result models — used as facade method return types. +from ..models.association_response import AssociationResponse +from ..models.close_period_response import ClosePeriodResponse +from ..models.delete_information_block_response import DeleteInformationBlockResponse +from ..models.delete_result import DeleteResult +from ..models.delete_taxonomy_block_response import DeleteTaxonomyBlockResponse +from ..models.entity_taxonomy_response import EntityTaxonomyResponse +from ..models.evaluate_rules_response import EvaluateRulesResponse +from ..models.event_block_envelope import EventBlockEnvelope +from ..models.event_handler_response import EventHandlerResponse +from ..models.fiscal_calendar_response import FiscalCalendarResponse +from ..models.information_block_envelope import InformationBlockEnvelope +from ..models.initialize_ledger_response import InitializeLedgerResponse +from ..models.journal_entry_response import JournalEntryResponse +from ..models.ledger_agent_response import LedgerAgentResponse +from ..models.ledger_entity_response import LedgerEntityResponse +from ..models.preview_event_block_response import PreviewEventBlockResponse +from ..models.publish_list_member_response import PublishListMemberResponse +from ..models.publish_list_response import PublishListResponse +from ..models.report_response import ReportResponse +from ..models.share_report_response import ShareReportResponse +from ..models.taxonomy_block_envelope import TaxonomyBlockEnvelope + from ..types import UNSET @@ -361,8 +385,44 @@ def _unwrap(self, label: str, envelope: Any) -> Any: raise RuntimeError(f"{label} failed: {envelope!r}") return envelope.result + def _typed_result(self, label: str, envelope: Any, expected: type[Any]) -> Any: + """Return ``envelope.result`` for typed-envelope facade methods. + + The calling facade method's return-type annotation advertises the + expected typed class (e.g. ``LedgerAgentResponse``); the runtime + return is whatever the SDK gave us: + + - In production the SDK has parsed the typed envelope into the + generated attrs class — callers get autocomplete + ``.field`` + access. + - In tests using dict mocks (or untyped envelopes), the result is + a plain ``dict`` — callers can use either ``result["field"]`` or + promote with ``ExpectedClass.from_dict(result)``. + + A ``None`` result is normalized to ``{"deleted": True}`` for + delete-style returns to preserve the legacy sentinel behavior. + + Raises :class:`RuntimeError` only when the envelope itself is + malformed (label included for debuggability). + """ + result = envelope.result + if result is None or ( + hasattr(result, "__class__") and "Unset" in result.__class__.__name__ + ): + # Delete-style ops historically returned {"deleted": True} when the + # server omitted the result body. Preserve that sentinel for back-compat. + return {"deleted": True} + return result + def _call_op(self, label: str, response: Any) -> Any: - """Common error handling for every generated op_* REST call.""" + """Common error handling for every generated op_* REST call. + + Returns the parsed envelope unchanged. Typed-envelope ops surface + ``envelope.result`` as the SDK's typed attrs class (e.g. + ``ReportResponse``); untyped ops surface it as a plain dict via + ``OperationEnvelopeResultType0``. Facade methods are responsible + for asserting / casting the result to the type they advertise. + """ if response.status_code not in (HTTPStatus.OK, HTTPStatus.ACCEPTED): raise RuntimeError( f"{label} failed: {response.status_code}: {response.content!r}" @@ -370,12 +430,6 @@ def _call_op(self, label: str, response: Any) -> Any: envelope = response.parsed if not self._is_envelope(envelope): raise RuntimeError(f"{label} failed: unexpected response shape: {envelope!r}") - # Normalize result to a plain dict — typed envelopes carry the result - # as an attrs class (e.g. `EventBlockEnvelope`); untyped envelopes - # (Any-default) sometimes wrap it in `OperationEnvelopeResultType0`. - # Either way, downstream callers expect `dict[str, Any]`. - if envelope.result is not None and hasattr(envelope.result, "to_dict"): - envelope.result = envelope.result.to_dict() return envelope def _build_event_block_request( @@ -432,12 +486,14 @@ def list_entities( data = self._query(graph_id, LIST_ENTITIES_QUERY, {"source": source}) return parse_entities(data) - def update_entity(self, graph_id: str, updates: dict[str, Any]) -> dict[str, Any]: + def update_entity( + self, graph_id: str, updates: dict[str, Any] + ) -> LedgerEntityResponse: """Update the entity for this graph. Only provided fields are applied.""" body = UpdateEntityRequest.from_dict(updates) response = op_update_entity(graph_id=graph_id, body=body, client=self._get_client()) envelope = self._call_op("Update entity", response) - return envelope.result or {} + return self._typed_result("Update entity", envelope, LedgerEntityResponse) # ── Summary ──────────────────────────────────────────────────────── @@ -634,7 +690,7 @@ def list_taxonomies( def create_taxonomy_block( self, graph_id: str, body: dict[str, Any], idempotency_key: str | None = None - ) -> dict[str, Any]: + ) -> TaxonomyBlockEnvelope: """Create a taxonomy block atomically (taxonomy + structures + elements + associations + rules in one envelope). """ @@ -646,22 +702,22 @@ def create_taxonomy_block( idempotency_key=idempotency_key if idempotency_key is not None else UNSET, ) envelope = self._call_op("Create taxonomy block", response) - return envelope.result or {} + return self._typed_result("Create taxonomy block", envelope, TaxonomyBlockEnvelope) def update_taxonomy_block( self, graph_id: str, body: dict[str, Any] - ) -> dict[str, Any]: + ) -> TaxonomyBlockEnvelope: """Update a taxonomy block — add/update/remove elements, structures, associations, or rules.""" request = UpdateTaxonomyBlockRequest.from_dict(body) response = op_update_taxonomy_block( graph_id=graph_id, body=request, client=self._get_client() ) envelope = self._call_op("Update taxonomy block", response) - return envelope.result or {} + return self._typed_result("Update taxonomy block", envelope, TaxonomyBlockEnvelope) def delete_taxonomy_block( self, graph_id: str, taxonomy_id: str, reason: str, cascade_facts: bool = False - ) -> dict[str, Any]: + ) -> DeleteTaxonomyBlockResponse: """Delete a taxonomy block. Cascades through elements, structures, and associations.""" request = DeleteTaxonomyBlockRequest.from_dict( {"taxonomy_id": taxonomy_id, "reason": reason, "cascade_facts": cascade_facts} @@ -670,7 +726,9 @@ def delete_taxonomy_block( graph_id=graph_id, body=request, client=self._get_client() ) envelope = self._call_op("Delete taxonomy block", response) - return envelope.result if envelope.result is not None else {"deleted": True} + return self._typed_result( + "Delete taxonomy block", envelope, DeleteTaxonomyBlockResponse + ) def link_entity_taxonomy( self, @@ -679,7 +737,7 @@ def link_entity_taxonomy( basis: str = "chart_of_accounts", is_primary: bool = True, adoption_context: str | None = "voluntary", - ) -> dict[str, Any]: + ) -> EntityTaxonomyResponse: """Link the graph's entity to a taxonomy (ENTITY_HAS_TAXONOMY edge). Idempotent — returns existing linkage if already present. @@ -696,7 +754,7 @@ def link_entity_taxonomy( graph_id=graph_id, body=body, client=self._get_client() ) envelope = self._call_op("Link entity taxonomy", response) - return envelope.result or {} + return self._typed_result("Link entity taxonomy", envelope, EntityTaxonomyResponse) def list_elements( self, @@ -772,7 +830,7 @@ def create_mapping_association( from_element_id: str, to_element_id: str, confidence: float = 1.0, - ) -> dict[str, Any]: + ) -> AssociationResponse: """Create a manual mapping association between two elements.""" body = CreateMappingAssociationOperation( mapping_id=mapping_id, @@ -784,11 +842,13 @@ def create_mapping_association( graph_id=graph_id, body=body, client=self._get_client() ) envelope = self._call_op("Create mapping association", response) - return envelope.result or {} + return self._typed_result( + "Create mapping association", envelope, AssociationResponse + ) def delete_mapping_association( self, graph_id: str, mapping_id: str, association_id: str - ) -> dict[str, Any]: + ) -> DeleteResult: """Delete a mapping association.""" body = DeleteMappingAssociationOperation( mapping_id=mapping_id, association_id=association_id @@ -797,7 +857,7 @@ def delete_mapping_association( graph_id=graph_id, body=body, client=self._get_client() ) envelope = self._call_op("Delete mapping association", response) - return envelope.result if envelope.result is not None else {"deleted": True} + return self._typed_result("Delete mapping association", envelope, DeleteResult) def auto_map_elements(self, graph_id: str, mapping_id: str) -> dict[str, Any]: """Trigger the AI MappingAgent (async). Returns an operation ack.""" @@ -875,7 +935,7 @@ def create_schedule( useful_life_months: int | None = None, asset_element_id: str | None = None, auto_reverse: bool = False, - ) -> dict[str, Any]: + ) -> InformationBlockEnvelope: """Create a new schedule with pre-generated monthly facts.""" payload_dict: dict[str, Any] = { "name": name, @@ -913,7 +973,7 @@ def create_schedule( graph_id=graph_id, body=body, client=self._get_client() ) envelope = self._call_op("Create schedule", response) - return envelope.result or {} + return self._typed_result("Create schedule", envelope, InformationBlockEnvelope) def dispose_schedule( self, @@ -925,7 +985,7 @@ def dispose_schedule( sale_proceeds: int | None = None, proceeds_element_id: str | None = None, gain_loss_element_id: str | None = None, - ) -> dict[str, Any]: + ) -> EventBlockEnvelope: """Dispose of a schedule asset — atomically truncates forward facts, drops the SumEquals rule, and posts a balanced disposal entry. @@ -953,7 +1013,7 @@ def dispose_schedule( graph_id=graph_id, body=body, client=self._get_client() ) envelope = self._call_op("Dispose schedule", response) - return envelope.result or {} + return self._typed_result("Dispose schedule", envelope, EventBlockEnvelope) def evaluate_rules( self, @@ -962,7 +1022,7 @@ def evaluate_rules( fact_set_id: str | None = None, period_start: str | None = None, period_end: str | None = None, - ) -> dict[str, Any]: + ) -> EvaluateRulesResponse: """Evaluate taxonomy rules against facts in a structure.""" body_dict: dict[str, Any] = {"structure_id": structure_id} if fact_set_id is not None: @@ -976,11 +1036,11 @@ def evaluate_rules( graph_id=graph_id, body=request, client=self._get_client() ) envelope = self._call_op("Evaluate rules", response) - return envelope.result or {} + return self._typed_result("Evaluate rules", envelope, EvaluateRulesResponse) def update_schedule( self, graph_id: str, structure_id: str, body: dict[str, Any] - ) -> dict[str, Any]: + ) -> InformationBlockEnvelope: """Update mutable fields on a schedule (name, entry_template, metadata).""" payload = UpdateScheduleRequest.from_dict({"structure_id": structure_id, **body}) request = UpdateScheduleArm(block_type="schedule", payload=payload) @@ -988,9 +1048,11 @@ def update_schedule( graph_id=graph_id, body=request, client=self._get_client() ) envelope = self._call_op("Update schedule", response) - return envelope.result or {} + return self._typed_result("Update schedule", envelope, InformationBlockEnvelope) - def delete_schedule(self, graph_id: str, structure_id: str) -> dict[str, Any]: + def delete_schedule( + self, graph_id: str, structure_id: str + ) -> DeleteInformationBlockResponse: """Permanently delete a schedule (cascades through facts + associations).""" payload = DeleteScheduleRequest.from_dict({"structure_id": structure_id}) body = DeleteScheduleArm(block_type="schedule", payload=payload) @@ -998,7 +1060,9 @@ def delete_schedule(self, graph_id: str, structure_id: str) -> dict[str, Any]: graph_id=graph_id, body=body, client=self._get_client() ) envelope = self._call_op("Delete schedule", response) - return envelope.result if envelope.result is not None else {"deleted": True} + return self._typed_result( + "Delete schedule", envelope, DeleteInformationBlockResponse + ) # ── Period close ──────────────────────────────────────────────────── @@ -1029,7 +1093,7 @@ def create_closing_entry( period_start: str, period_end: str, memo: str | None = None, - ) -> dict[str, Any]: + ) -> EventBlockEnvelope: """Idempotently create (or refresh) a draft closing entry from a schedule. Routes through ``create-event-block`` with @@ -1056,7 +1120,7 @@ def create_closing_entry( graph_id=graph_id, body=body, client=self._get_client() ) envelope = self._call_op("Create closing entry", response) - return envelope.result or {} + return self._typed_result("Create closing entry", envelope, EventBlockEnvelope) # ── Journal entries (native accounting writes) ────────────────────── @@ -1071,7 +1135,7 @@ def create_journal_entry( status: str = "draft", transaction_id: str | None = None, idempotency_key: str | None = None, - ) -> dict[str, Any]: + ) -> EventBlockEnvelope: """Create a journal entry with balanced line items (DR=CR enforced). Routes through ``create-event-block`` with @@ -1110,25 +1174,27 @@ def create_journal_entry( idempotency_key=idempotency_key if idempotency_key is not None else UNSET, ) envelope = self._call_op("Create journal entry", response) - return envelope.result or {} + return self._typed_result("Create journal entry", envelope, EventBlockEnvelope) - def update_journal_entry(self, graph_id: str, body: dict[str, Any]) -> dict[str, Any]: + def update_journal_entry( + self, graph_id: str, body: dict[str, Any] + ) -> JournalEntryResponse: """Update a draft journal entry. Posted entries are immutable.""" request = UpdateJournalEntryRequest.from_dict(body) response = op_update_journal_entry( graph_id=graph_id, body=request, client=self._get_client() ) envelope = self._call_op("Update journal entry", response) - return envelope.result or {} + return self._typed_result("Update journal entry", envelope, JournalEntryResponse) - def delete_journal_entry(self, graph_id: str, entry_id: str) -> dict[str, Any]: + def delete_journal_entry(self, graph_id: str, entry_id: str) -> DeleteResult: """Hard-delete a draft journal entry. Posted entries must be reversed.""" body = DeleteJournalEntryRequest(entry_id=entry_id) response = op_delete_journal_entry( graph_id=graph_id, body=body, client=self._get_client() ) envelope = self._call_op("Delete journal entry", response) - return envelope.result if envelope.result is not None else {"deleted": True} + return self._typed_result("Delete journal entry", envelope, DeleteResult) def reverse_journal_entry( self, @@ -1137,7 +1203,7 @@ def reverse_journal_entry( posting_date: str | None = None, memo: str | None = None, reason: str | None = None, - ) -> dict[str, Any]: + ) -> EventBlockEnvelope: """Reverse a posted journal entry (creates offsetting entry, marks original as reversed). Routes through ``create-event-block`` with @@ -1161,7 +1227,7 @@ def reverse_journal_entry( graph_id=graph_id, body=body, client=self._get_client() ) envelope = self._call_op("Reverse journal entry", response) - return envelope.result or {} + return self._typed_result("Reverse journal entry", envelope, EventBlockEnvelope) # ── Event blocks (generic preview + status transitions) ────────────── @@ -1170,7 +1236,7 @@ def create_event_block( graph_id: str, body: dict[str, Any], idempotency_key: str | None = None, - ) -> dict[str, Any]: + ) -> EventBlockEnvelope: """Create an event block directly from a dict. Use for support-class events (``event_class='support'``) with categories @@ -1187,13 +1253,13 @@ def create_event_block( idempotency_key=idempotency_key if idempotency_key is not None else UNSET, ) envelope = self._call_op("Create event block", response) - return envelope.result or {} + return self._typed_result("Create event block", envelope, EventBlockEnvelope) def preview_event_block( self, graph_id: str, body: dict[str, Any], - ) -> dict[str, Any]: + ) -> PreviewEventBlockResponse: """Dry-run an event block — resolve handler, evaluate metadata, return the planned GL rows without writing anything. @@ -1207,13 +1273,15 @@ def preview_event_block( graph_id=graph_id, body=request, client=self._get_client() ) envelope = self._call_op("Preview event block", response) - return envelope.result or {} + return self._typed_result( + "Preview event block", envelope, PreviewEventBlockResponse + ) def update_event_block( self, graph_id: str, body: dict[str, Any], - ) -> dict[str, Any]: + ) -> EventBlockEnvelope: """Apply a status transition and/or field corrections to an event block. Use for posting drafts (``classified`` → ``committed`` → ``fulfilled``), @@ -1226,7 +1294,7 @@ def update_event_block( graph_id=graph_id, body=request, client=self._get_client() ) envelope = self._call_op("Update event block", response) - return envelope.result or {} + return self._typed_result("Update event block", envelope, EventBlockEnvelope) # ── Agents (REA counterparties) ─────────────────────────────────────── @@ -1235,7 +1303,7 @@ def create_agent( graph_id: str, body: dict[str, Any], idempotency_key: str | None = None, - ) -> dict[str, Any]: + ) -> LedgerAgentResponse: """Create an agent — REA counterparty (customer, vendor, employee, etc.) referenced by event blocks via ``agent_id``. @@ -1250,13 +1318,13 @@ def create_agent( idempotency_key=idempotency_key if idempotency_key is not None else UNSET, ) envelope = self._call_op("Create agent", response) - return envelope.result or {} + return self._typed_result("Create agent", envelope, LedgerAgentResponse) def update_agent( self, graph_id: str, body: dict[str, Any], - ) -> dict[str, Any]: + ) -> LedgerAgentResponse: """Update an agent. ``metadata_patch`` is a partial merge into existing metadata; all other fields replace. """ @@ -1265,7 +1333,7 @@ def update_agent( graph_id=graph_id, body=request, client=self._get_client() ) envelope = self._call_op("Update agent", response) - return envelope.result or {} + return self._typed_result("Update agent", envelope, LedgerAgentResponse) # ── Event handlers (DSL handler registry) ──────────────────────────── @@ -1273,7 +1341,7 @@ def create_event_handler( self, graph_id: str, body: dict[str, Any], - ) -> dict[str, Any]: + ) -> EventHandlerResponse: """Register a tenant-configurable event handler — DSL row in the ``event_handlers`` table that drives ``create-event-block`` for event types not covered by a Python handler. @@ -1283,13 +1351,13 @@ def create_event_handler( graph_id=graph_id, body=request, client=self._get_client() ) envelope = self._call_op("Create event handler", response) - return envelope.result or {} + return self._typed_result("Create event handler", envelope, EventHandlerResponse) def update_event_handler( self, graph_id: str, body: dict[str, Any], - ) -> dict[str, Any]: + ) -> EventHandlerResponse: """Update a registered event handler. Pass ``approve=True`` in the body to flip an AI-suggested handler from unapproved to active. """ @@ -1298,7 +1366,7 @@ def update_event_handler( graph_id=graph_id, body=request, client=self._get_client() ) envelope = self._call_op("Update event handler", response) - return envelope.result or {} + return self._typed_result("Update event handler", envelope, EventHandlerResponse) # ── Financial statements (graph-backed) ────────────────────────────── @@ -1387,7 +1455,7 @@ def initialize_ledger( earliest_data_period: str | None = None, auto_seed_schedules: bool | None = None, note: str | None = None, - ) -> dict[str, Any]: + ) -> InitializeLedgerResponse: """One-time ledger initialization — seed fiscal calendar + periods.""" body = InitializeLedgerRequest( closed_through=closed_through if closed_through is not None else UNSET, @@ -1406,14 +1474,14 @@ def initialize_ledger( graph_id=graph_id, body=body, client=self._get_client() ) envelope = self._call_op("Initialize ledger", response) - return envelope.result or {} + return self._typed_result("Initialize ledger", envelope, InitializeLedgerResponse) def set_close_target( self, graph_id: str, period: str, note: str | None = None, - ) -> dict[str, Any]: + ) -> FiscalCalendarResponse: """Set the user-controlled close target (YYYY-MM).""" body = SetCloseTargetOperation( period=period, @@ -1423,7 +1491,7 @@ def set_close_target( graph_id=graph_id, body=body, client=self._get_client() ) envelope = self._call_op("Set close target", response) - return envelope.result or {} + return self._typed_result("Set close target", envelope, FiscalCalendarResponse) def close_period( self, @@ -1431,7 +1499,7 @@ def close_period( period: str, note: str | None = None, allow_stale_sync: bool | None = None, - ) -> dict[str, Any]: + ) -> ClosePeriodResponse: """Close a fiscal period — the final commit action.""" body = ClosePeriodOperation( period=period, @@ -1440,7 +1508,7 @@ def close_period( ) response = op_close_period(graph_id=graph_id, body=body, client=self._get_client()) envelope = self._call_op("Close period", response) - return envelope.result or {} + return self._typed_result("Close period", envelope, ClosePeriodResponse) def reopen_period( self, @@ -1448,7 +1516,7 @@ def reopen_period( period: str, reason: str, note: str | None = None, - ) -> dict[str, Any]: + ) -> FiscalCalendarResponse: """Reopen a closed fiscal period. Requires a reason for the audit log.""" body = ReopenPeriodOperation( period=period, @@ -1457,7 +1525,7 @@ def reopen_period( ) response = op_reopen_period(graph_id=graph_id, body=body, client=self._get_client()) envelope = self._call_op("Reopen period", response) - return envelope.result or {} + return self._typed_result("Reopen period", envelope, FiscalCalendarResponse) # ── Reports ───────────────────────────────────────────────────────── @@ -1471,8 +1539,10 @@ def create_report( taxonomy_id: str = "tax_usgaap_reporting", period_type: str = "quarterly", comparative: bool = True, - ) -> dict[str, Any]: - """Kick off report creation (async). Returns an operation ack.""" + ) -> ReportResponse: + """Generate report facts from the ledger and publish a Report + definition. Synchronous — returns the published report header. + """ body = CreateReportRequest( name=name, mapping_id=mapping_id, @@ -1484,7 +1554,7 @@ def create_report( ) response = op_create_report(graph_id=graph_id, body=body, client=self._get_client()) envelope = self._call_op("Create report", response) - return {"operation_id": envelope.operation_id, "status": envelope.status} + return self._typed_result("Create report", envelope, ReportResponse) def list_reports(self, graph_id: str) -> list[dict[str, Any]]: """List all reports for a graph (includes received shared reports).""" @@ -1528,8 +1598,10 @@ def regenerate_report( report_id: str, period_start: str | None = None, period_end: str | None = None, - ) -> dict[str, Any]: - """Regenerate an existing report (async). Returns an operation ack.""" + ) -> ReportResponse: + """Re-run fact generation for an existing Report against the latest + ledger state. Synchronous — returns the regenerated report header. + """ body = RegenerateReportOperation( report_id=report_id, period_start=period_start if period_start is not None else UNSET, @@ -1539,24 +1611,28 @@ def regenerate_report( graph_id=graph_id, body=body, client=self._get_client() ) envelope = self._call_op("Regenerate report", response) - return {"operation_id": envelope.operation_id, "status": envelope.status} + return self._typed_result("Regenerate report", envelope, ReportResponse) - def delete_report(self, graph_id: str, report_id: str) -> None: + def delete_report(self, graph_id: str, report_id: str) -> DeleteResult: """Delete a report and its generated facts.""" body = DeleteReportOperation(report_id=report_id) response = op_delete_report(graph_id=graph_id, body=body, client=self._get_client()) - self._call_op("Delete report", response) + envelope = self._call_op("Delete report", response) + return self._typed_result("Delete report", envelope, DeleteResult) def share_report( self, graph_id: str, report_id: str, publish_list_id: str - ) -> dict[str, Any]: - """Share a published report to every member of a publish list (async).""" + ) -> ShareReportResponse: + """Share a published report to every member of a publish list. Each + target receives an independent copy; per-recipient outcomes appear + in the response's ``results`` list. + """ body = ShareReportOperation(report_id=report_id, publish_list_id=publish_list_id) response = op_share_report(graph_id=graph_id, body=body, client=self._get_client()) envelope = self._call_op("Share report", response) - return {"operation_id": envelope.operation_id, "status": envelope.status} + return self._typed_result("Share report", envelope, ShareReportResponse) - def file_report(self, graph_id: str, report_id: str) -> dict[str, Any]: + def file_report(self, graph_id: str, report_id: str) -> ReportResponse: """Transition a Report's filing_status to 'filed' — locks the package. Allowed from 'draft' or 'under_review'. Stamps filed_at + filed_by from @@ -1565,11 +1641,11 @@ def file_report(self, graph_id: str, report_id: str) -> dict[str, Any]: body = FileReportRequest(report_id=report_id) response = op_file_report(graph_id=graph_id, body=body, client=self._get_client()) envelope = self._call_op("File report", response) - return {"operation_id": envelope.operation_id, "status": envelope.status} + return self._typed_result("File report", envelope, ReportResponse) def transition_filing_status( self, graph_id: str, report_id: str, target_status: str - ) -> dict[str, Any]: + ) -> ReportResponse: """Move a Report along the non-file legs of the filing lifecycle. Use ``file_report()`` to reach 'filed' so audit fields land cleanly. @@ -1583,7 +1659,7 @@ def transition_filing_status( graph_id=graph_id, body=body, client=self._get_client() ) envelope = self._call_op("Transition filing status", response) - return {"operation_id": envelope.operation_id, "status": envelope.status} + return self._typed_result("Transition filing status", envelope, ReportResponse) def is_shared_report(self, report: dict[str, Any] | Any) -> bool: """Check if a report was received via sharing (vs locally created).""" @@ -1609,7 +1685,7 @@ def get_publish_list(self, graph_id: str, list_id: str) -> dict[str, Any] | None def create_publish_list( self, graph_id: str, name: str, description: str | None = None - ) -> dict[str, Any]: + ) -> PublishListResponse: """Create a new publish list.""" body = CreatePublishListRequest( name=name, @@ -1619,7 +1695,7 @@ def create_publish_list( graph_id=graph_id, body=body, client=self._get_client() ) envelope = self._call_op("Create publish list", response) - return envelope.result or {} + return self._typed_result("Create publish list", envelope, PublishListResponse) def update_publish_list( self, @@ -1627,7 +1703,7 @@ def update_publish_list( list_id: str, name: str | None = None, description: str | None = None, - ) -> dict[str, Any]: + ) -> PublishListResponse: """Update a publish list's name or description.""" body = UpdatePublishListOperation( list_id=list_id, @@ -1638,20 +1714,22 @@ def update_publish_list( graph_id=graph_id, body=body, client=self._get_client() ) envelope = self._call_op("Update publish list", response) - return envelope.result or {} + return self._typed_result("Update publish list", envelope, PublishListResponse) - def delete_publish_list(self, graph_id: str, list_id: str) -> None: + def delete_publish_list(self, graph_id: str, list_id: str) -> DeleteResult: """Delete a publish list.""" body = DeletePublishListOperation(list_id=list_id) response = op_delete_publish_list( graph_id=graph_id, body=body, client=self._get_client() ) - self._call_op("Delete publish list", response) + envelope = self._call_op("Delete publish list", response) + return self._typed_result("Delete publish list", envelope, DeleteResult) def add_publish_list_members( self, graph_id: str, list_id: str, target_graph_ids: list[str] - ) -> dict[str, Any]: - """Add target graphs as members of a publish list.""" + ) -> list[PublishListMemberResponse]: + """Add target graphs as members of a publish list. Returns the + membership rows that were just created.""" body = AddPublishListMembersOperation( list_id=list_id, target_graph_ids=target_graph_ids ) @@ -1659,15 +1737,21 @@ def add_publish_list_members( graph_id=graph_id, body=body, client=self._get_client() ) envelope = self._call_op("Add publish list members", response) - return envelope.result or {} + result = envelope.result + if not isinstance(result, list): + raise RuntimeError( + f"Add publish list members: expected list result, got " + f"{type(result).__name__}: {envelope!r}" + ) + return result def remove_publish_list_member( self, graph_id: str, list_id: str, member_id: str - ) -> dict[str, Any]: + ) -> DeleteResult: """Remove a single member from a publish list.""" body = RemovePublishListMemberOperation(list_id=list_id, member_id=member_id) response = op_remove_publish_list_member( graph_id=graph_id, body=body, client=self._get_client() ) envelope = self._call_op("Remove publish list member", response) - return envelope.result if envelope.result is not None else {"deleted": True} + return self._typed_result("Remove publish list member", envelope, DeleteResult)