@@ -1358,13 +1358,17 @@ def list_structures(
13581358 page = ListLedgerStructures .model_validate (data ).structures
13591359 return page .structures if page else []
13601360
1361- def list_mappings (self , graph_id : str ) -> list [ListLedgerMappingsMappingsStructures ]:
1361+ def list_mappings (
1362+ self , graph_id : str , * , entity_id : str | None = None
1363+ ) -> list [ListLedgerMappingsMappingsStructures ]:
13621364 """List active CoA→reporting mapping structures, the book mapping first.
13631365
13641366 Each carries ``framework``: the reporting framework it maps the chart
1365- into. A chart holds one mapping per framework.
1367+ into (a chart holds one mapping per framework), and ``entity_id``: the
1368+ entity whose chart it maps from, so whose reports it can produce.
1369+ ``entity_id`` keeps that entity's mappings only.
13661370 """
1367- data = self ._query (graph_id , LIST_LEDGER_MAPPINGS_GQL )
1371+ data = self ._query (graph_id , LIST_LEDGER_MAPPINGS_GQL , { "entityId" : entity_id } )
13681372 page = ListLedgerMappings .model_validate (data ).mappings
13691373 return page .structures if page else []
13701374
@@ -1383,16 +1387,19 @@ def get_mapping_coverage(
13831387 return GetLedgerMappingCoverage .model_validate (data ).mapping_coverage
13841388
13851389 def get_mapping_candidates (
1386- self , graph_id : str , classification : str
1390+ self , graph_id : str , classification : str , * , entity_id : str | None = None
13871391 ) -> list [MappingCandidatesMappingCandidates ]:
13881392 """rs-gaap concepts a CoA element of the given EFS ``classification``
13891393 (asset / liability / equity / revenue / expense) may map to — limited
1390- to concepts that render under the graph's active Reporting Style,
1391- with statement-level subtotals excluded. Use this to populate the
1392- mapping picker so it never offers an unreachable target.
1394+ to concepts that render under the Reporting Style of the entity whose
1395+ chart is being mapped (``entity_id``, default the group parent), with
1396+ statement-level subtotals excluded. Use this to populate the mapping
1397+ picker so it never offers an unreachable target.
13931398 """
13941399 data = self ._query (
1395- graph_id , MAPPING_CANDIDATES_GQL , {"classification" : classification }
1400+ graph_id ,
1401+ MAPPING_CANDIDATES_GQL ,
1402+ {"classification" : classification , "entityId" : entity_id },
13961403 )
13971404 return MappingCandidates .model_validate (data ).mapping_candidates
13981405
@@ -1454,6 +1461,7 @@ def get_information_block(
14541461 series : bool | None = None ,
14551462 series_history : int | None = None ,
14561463 series_forecast : int | None = None ,
1464+ entity_id : str | None = None ,
14571465 ) -> InformationBlock | None :
14581466 """Fetch an Information Block envelope by id — the cross-block-type read.
14591467
@@ -1474,6 +1482,12 @@ def get_information_block(
14741482 ``series_history`` / ``series_forecast`` window the series to its
14751483 seam-adjacent columns — the last N actual columns and the first N
14761484 forecast columns; ``None`` = unbounded.
1485+
1486+ ``entity_id`` picks whose books a block shared by the group reads
1487+ (statements, metrics, disclosures); ``None`` = the scenario's entity,
1488+ else the group parent. A schedule, reconciliation or forecast always
1489+ reads its own entity's. The envelope's ``entity_id`` names the entity
1490+ it read.
14771491 """
14781492 data = self ._query (
14791493 graph_id ,
@@ -1484,6 +1498,7 @@ def get_information_block(
14841498 "series" : series ,
14851499 "seriesHistory" : series_history ,
14861500 "seriesForecast" : series_forecast ,
1501+ "entityId" : entity_id ,
14871502 },
14881503 )
14891504 return GetInformationBlock .model_validate (data ).information_block
@@ -1497,13 +1512,19 @@ def list_information_blocks(
14971512 limit : int | None = None ,
14981513 offset : int | None = None ,
14991514 scenario_id : str | None = None ,
1515+ entity_id : str | None = None ,
15001516 ) -> list [ListInformationBlocksInformationBlocks ]:
15011517 """List Information Block envelopes, optionally filtered.
15021518
15031519 Replaces the old ``list_schedules`` method — use
15041520 ``block_type='schedule'`` for the same set of blocks.
15051521 ``scenario_id`` (a forecast block's structure id) threads into each
15061522 envelope's FactSet binding.
1523+
1524+ ``entity_id`` (``None`` = the scenario's entity, else the group
1525+ parent) lists the blocks shared by the group plus that entity's own
1526+ schedules, reconciliations and forecasts, never another entity's;
1527+ shared blocks read its books.
15071528 """
15081529 data = self ._query (
15091530 graph_id ,
@@ -1514,6 +1535,7 @@ def list_information_blocks(
15141535 "limit" : limit ,
15151536 "offset" : offset ,
15161537 "scenarioId" : scenario_id ,
1538+ "entityId" : entity_id ,
15171539 },
15181540 )
15191541 return ListInformationBlocks .model_validate (data ).information_blocks
@@ -1604,12 +1626,16 @@ def create_schedule(
16041626 asset_element_id : str | None = None ,
16051627 auto_reverse : bool = False ,
16061628 booked_on : str | None = None ,
1629+ entity_id : str | None = None ,
16071630 ) -> InformationBlockEnvelope :
16081631 """Create a new schedule with pre-generated monthly facts.
16091632
16101633 ``booked_on`` (``YYYY-MM-DD``) is the day the schedule's cost went on
16111634 the books, when that is before its first period. The schedule
16121635 reconciliation carries the cost from that day.
1636+
1637+ ``entity_id`` is the entity whose books the schedule belongs to;
1638+ ``None`` = the group parent.
16131639 """
16141640 payload_dict : dict [str , Any ] = {
16151641 "name" : name ,
@@ -1627,6 +1653,8 @@ def create_schedule(
16271653 }
16281654 if taxonomy_id :
16291655 payload_dict ["taxonomy_id" ] = taxonomy_id
1656+ if entity_id :
1657+ payload_dict ["entity_id" ] = entity_id
16301658 schedule_metadata : dict [str , Any ] = {}
16311659 if method :
16321660 schedule_metadata ["method" ] = method
@@ -2636,6 +2664,7 @@ def create_report(
26362664 period_type : str = "quarterly" ,
26372665 comparative : bool = True ,
26382666 periods : list [PeriodSpec | dict [str , Any ]] | None = None ,
2667+ entity_id : str | None = None ,
26392668 ) -> ReportResponse :
26402669 """Generate report facts from the ledger and publish a Report
26412670 definition. Synchronous — returns the published report header.
@@ -2647,6 +2676,10 @@ def create_report(
26472676 ``{"start", "end", "label"}`` dicts — for multi-period layouts
26482677 (YTD-by-quarter, multi-year). When given, the server ignores
26492678 ``period_start`` / ``period_end`` / ``comparative``.
2679+
2680+ ``entity_id`` is the entity the report is for; ``None`` = the entity
2681+ whose chart ``mapping_id`` maps from. Named alongside another entity's
2682+ mapping, the server refuses it.
26502683 """
26512684 body = CreateReportRequest (
26522685 name = name ,
@@ -2661,6 +2694,8 @@ def create_report(
26612694 body .periods = [
26622695 p if isinstance (p , PeriodSpec ) else PeriodSpec .from_dict (p ) for p in periods
26632696 ]
2697+ if entity_id :
2698+ body .entity_id = entity_id
26642699 response = op_create_report (graph_id = graph_id , body = body , client = self ._get_client ())
26652700 envelope = self ._call_op ("Create report" , response )
26662701 return self ._typed_result ("Create report" , envelope , ReportResponse )
0 commit comments