:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(warehouse-sources): add folk custom objects, group members and custom fields tables (#120226)
Tom Owers0d0e8669530d
diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md b/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.mdindex e07daa40099b..60e1e4f0846c 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/COVERAGE_GAPS_APPENDIX.md@@ -4876,10 +4876,10 @@ Today (7): `companies`, `groups`, `notes`, `people`, `reminders`, `tasks`, `userDiffed against: <https://developer.folk.app/schemas/2025-06-09.json>-- [ ] `List deals and custom objects (GET /v1/groups/{groupId}/{objectType})` — resolve custom object IDs referenced by contacts and report sales pipeline records (high)+- [x] `List deals and custom objects (GET /v1/groups/{groupId}/{objectType})` — resolve custom object IDs referenced by contacts and report sales pipeline records (high)- [ ] `List interactions (GET /v1/interactions)` — measure relationship engagement from email, meetings, calls, and logged contact activity (high)-- [ ] `List group custom fields (GET /v1/groups/{groupId}/custom-fields/{entityType})` — interpret custom field values with field types and select-option definitions (medium)-- [ ] `List group members (GET /v1/groups/{groupId}/members)` — join workspace users to their groups and membership roles (medium)+- [x] `List group custom fields (GET /v1/groups/{groupId}/custom-fields/{entityType})` — interpret custom field values with field types and select-option definitions (medium)+- [x] `List group members (GET /v1/groups/{groupId}/members)` — join workspace users to their groups and membership roles (medium)Note: Diffed collection GET operations in the official OpenAPI schema and checked the current custom-object documentation. Deals and other objects share one route and need group and object-type discovery. Interactions require entity fan-out and timeframe selection; this endpoint is in beta. Reminders are deprecated in favor of the synced tasks endpoint; writes and webhooks are excluded.diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/folk/canonical_descriptions.py b/products/warehouse_sources/backend/temporal/data_imports/sources/folk/canonical_descriptions.pyindex f0b50c3c6bc0..6cc7f0d7f8cf 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/folk/canonical_descriptions.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/folk/canonical_descriptions.py@@ -122,4 +122,42 @@ CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {"created_at": "The date and time the reminder was created, in ISO format.",},},+ "group_members": {+ "description": "Workspace users who are members of each Folk group, with their role in that group. Every workspace user is a member of a public group.",+ "docs_url": "https://developer.folk.app/api-reference/group-members/list-group-members",+ "columns": {+ "id": "Unique identifier for the workspace user.",+ "full_name": "The full name of the user.",+ "email": "The email address of the user.",+ "role": "The role of the user in the group: owner, admin, contributor, or reader.",+ "group_id": "The group the user is a member of.",+ },+ },+ "group_custom_fields": {+ "description": "Custom field definitions of each Folk group, per entity type (person, company, or custom object type), with their field types and select options.",+ "docs_url": "https://developer.folk.app/api-reference/group-custom-fields/list-group-custom-fields",+ "columns": {+ "name": "The name of the custom field. Custom field values on people, companies, and objects are keyed by this name.",+ "type": "The type of the custom field, such as textField, numericField, dateField, singleSelect, multipleSelect, contactField, userField, or objectField.",+ "options": "The options of a single or multiple select field.",+ "config": "Display settings of a numeric field, such as its format, currency, and decimals.",+ "group_id": "The group the custom field belongs to.",+ "entity_type": "The entity type the custom field belongs to: person, company, or a custom object type name.",+ },+ },+ "custom_objects": {+ "description": "Custom objects of each Folk group, such as deals, with the people and companies they link and their custom field values.",+ "docs_url": "https://developer.folk.app/api-reference/custom-objects/list-objects",+ "columns": {+ "id": "Unique identifier for the object.",+ "name": "The name of the object.",+ "companies": "The companies linked to the object.",+ "people": "The people linked to the object.",+ "created_at": "The date and time the object was created, in ISO format.",+ "created_by": "The workspace user who created the object.",+ "custom_field_values": "The custom field values of the object, keyed by custom field name.",+ "group_id": "The group the object belongs to.",+ "object_type": "The name of the object type, such as Deals.",+ },+ },}diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/folk/folk.py b/products/warehouse_sources/backend/temporal/data_imports/sources/folk/folk.pyindex 7bbef769b95e..dda083c2243e 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/folk/folk.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/folk/folk.py@@ -1,22 +1,31 @@import dataclasses+from collections.abc import Callable, Iterator+from functools import partialfrom typing import Any, Optional-from urllib.parse import urlsplit+from urllib.parse import quote, urlsplit-from requests import Response+from requests import HTTPError, Responsefrom products.warehouse_sources.backend.temporal.data_imports.sources.common.http import make_tracked_sessionfrom products.warehouse_sources.backend.temporal.data_imports.sources.common.rest_source import (RESTAPIConfig,rest_api_resource,)+from products.warehouse_sources.backend.temporal.data_imports.sources.common.rest_source.auth import BearerTokenAuthfrom products.warehouse_sources.backend.temporal.data_imports.sources.common.rest_source.paginators import (JSONResponsePaginator,)+from products.warehouse_sources.backend.temporal.data_imports.sources.common.rest_source.rest_client import RESTClientfrom products.warehouse_sources.backend.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom products.warehouse_sources.backend.temporal.data_imports.sources.common.schema import schema_for_resourcefrom products.warehouse_sources.backend.temporal.data_imports.sources.common.source_helpers import validate_via_probefrom products.warehouse_sources.backend.temporal.data_imports.sources.common.typings import SourceResponse-from products.warehouse_sources.backend.temporal.data_imports.sources.folk.settings import FOLK_BASE_URL, FOLK_ENDPOINTS+from products.warehouse_sources.backend.temporal.data_imports.sources.folk.settings import (+ FOLK_BASE_URL,+ FOLK_BUILTIN_ENTITY_TYPES,+ FOLK_ENDPOINTS,+ FolkEndpointConfig,+)# Documented maximum on every list endpoint (the default is 20).FOLK_PAGE_SIZE = 100@@ -66,6 +75,10 @@ class FolkResumeConfig:# Full next-page URL from the response's `data.pagination.nextLink` field (omitted on the last# page). It carries the opaque cursor and the limit, so following it resumes the walk exactly.next_url: str | None = None+ # Group fan-out position: the groups still to sync and, within the head group, the children+ # (custom field entity types or object types) still to sync. The head of each list is in progress.+ remaining_group_ids: list[str] | None = None+ remaining_child_keys: list[str] | None = Nonedef probe_credentials(api_key: str, endpoint: str | None = None) -> int | None:@@ -74,7 +87,12 @@ def probe_credentials(api_key: str, endpoint: str | None = None) -> int | None:Probes the given endpoint's own path when set (one row, to confirm access to that resource),else `/v1/users/me`, the cheapest call that confirms the key is genuine."""config = FOLK_ENDPOINTS.get(endpoint) if endpoint else None- url = f"{FOLK_BASE_URL}{config.path}?limit=1" if config else f"{FOLK_BASE_URL}/v1/users/me"+ if config is None:+ url = f"{FOLK_BASE_URL}/v1/users/me"+ else:+ # Group-scoped endpoints have no listing without a group id, so probe the groups they fan out over.+ path = "/v1/groups" if config.group_fanout else config.path+ url = f"{FOLK_BASE_URL}{path}?limit=1"_ok, status = validate_via_probe(lambda: make_tracked_session(redact_values=(api_key,)),url,@@ -94,6 +112,15 @@ def folk_source() -> SourceResponse:config = schema_for_resource(FOLK_ENDPOINTS, endpoint)+ if config.group_fanout:+ client = RESTClient(+ base_url=FOLK_BASE_URL,+ auth=BearerTokenAuth(token=api_key),+ paginator=FolkPaginator(),+ capture=False,+ )+ return _source_response(config, lambda: _iter_group_fanout(client, config, resumable_source_manager))+rest_config: RESTAPIConfig = {"client": {"base_url": FOLK_BASE_URL,@@ -144,9 +171,13 @@ def folk_source(initial_paginator_state=initial_paginator_state,)+ return _source_response(config, lambda: resource)+++def _source_response(config: FolkEndpointConfig, items: Callable[[], Any]) -> SourceResponse:return SourceResponse(name=config.name,- items=lambda: resource,+ items=items,primary_keys=config.primary_keys,partition_count=1,partition_size=1,@@ -154,3 +185,150 @@ def folk_source(partition_format="month" if config.partition_key else None,partition_keys=[config.partition_key] if config.partition_key else None,)++[email protected](frozen=True)+class _GroupChild:+ # Resume key of the child within its group; "" when the group has a single child listing.+ key: str+ path: str+ # Columns added to every row, since the child rows do not name the group or type they belong to.+ row_fields: dict[str, str]+++def _paginate(+ client: RESTClient,+ path: str,+ next_url: str | None = None,+ page_state_hook: Optional[Callable[[Optional[dict[str, Any]], bool], None]] = None,+) -> Iterator[list[dict[str, Any]]]:+ return client.paginate(+ path=path,+ params={"limit": FOLK_PAGE_SIZE},+ data_selector="data.items",+ data_selector_required=True,+ initial_paginator_state={"next_url": next_url} if next_url else None,+ page_state_hook=page_state_hook,+ )+++def _object_type_names(+ client: RESTClient, manager: ResumableSourceManager[FolkResumeConfig], group_id: str+) -> list[str]:+ """Folk documents the group's person custom fields of type `objectField` as the way to list its+ object types (Deals and any other custom object type)."""+ names: list[str] = []+ for page in _paginate(client, f"/v1/groups/{group_id}/custom-fields/person"):+ names.extend(field["name"] for field in page if field.get("type") == "objectField")+ manager.safe_point()+ return names+++def _group_children(+ client: RESTClient,+ manager: ResumableSourceManager[FolkResumeConfig],+ config: FolkEndpointConfig,+ group_id: str,+) -> list[_GroupChild]:+ path = config.path.replace("{groupId}", group_id)+ if config.group_fanout == "members":+ return [_GroupChild(key="", path=path, row_fields={"groupId": group_id})]+ if config.group_fanout == "custom_fields":+ entity_types = [*FOLK_BUILTIN_ENTITY_TYPES, *_object_type_names(client, manager, group_id)]+ return [+ _GroupChild(+ key=entity_type,+ path=path.replace("{entityType}", quote(entity_type, safe="")),+ row_fields={"groupId": group_id, "entityType": entity_type},+ )+ for entity_type in entity_types+ ]+ return [+ _GroupChild(+ key=object_type,+ path=path.replace("{objectType}", quote(object_type, safe="")),+ row_fields={"groupId": group_id, "objectType": object_type},+ )+ for object_type in _object_type_names(client, manager, group_id)+ ]+++def _raise_unless_not_found(error: HTTPError) -> None:+ # A 404 means the group or object type was deleted after it was listed.+ if error.response is None or error.response.status_code != 404:+ raise error+++def _stage_position(+ manager: ResumableSourceManager[FolkResumeConfig],+ group_ids: list[str],+ keys: list[str],+ index: int,+ state: Optional[dict[str, Any]],+ has_next: bool,+) -> None:+ """Stage the position of the page after the one about to be yielded."""+ if has_next and state:+ position = FolkResumeConfig(+ next_url=state["next_url"], remaining_group_ids=group_ids, remaining_child_keys=keys[index:]+ )+ elif index + 1 < len(keys):+ position = FolkResumeConfig(remaining_group_ids=group_ids, remaining_child_keys=keys[index + 1 :])+ else:+ position = FolkResumeConfig(remaining_group_ids=group_ids[1:])+ manager.save_state(position)+++def _iter_group_fanout(+ client: RESTClient,+ config: FolkEndpointConfig,+ manager: ResumableSourceManager[FolkResumeConfig],+) -> Iterator[list[dict[str, Any]]]:+ resume = manager.load_state() if manager.can_resume() else None+ if resume is not None and resume.remaining_group_ids is not None:+ group_ids = list(resume.remaining_group_ids)+ child_keys, next_url = resume.remaining_child_keys, resume.next_url+ else:+ group_ids = []+ for page in _paginate(client, "/v1/groups"):+ group_ids.extend(group["id"] for group in page)+ manager.safe_point()+ child_keys, next_url = None, None++ while group_ids:+ # Every row before this position is already yielded, so the run can hand off here.+ manager.save_state(+ FolkResumeConfig(next_url=next_url, remaining_group_ids=group_ids, remaining_child_keys=child_keys)+ )+ manager.safe_point()+ try:+ children = _group_children(client, manager, config, group_ids[0])+ except HTTPError as error:+ _raise_unless_not_found(error)+ children = []+ if child_keys is not None:+ # Keep only the children the saved position had left, and skip any deleted since.+ by_key = {child.key: child for child in children}+ if not child_keys or child_keys[0] not in by_key:+ next_url = None+ children = [by_key[key] for key in child_keys if key in by_key]+ keys = [child.key for child in children]++ for index, child in enumerate(children):+ try:+ for page in _paginate(+ client,+ child.path,+ next_url=next_url,+ page_state_hook=partial(_stage_position, manager, group_ids, keys, index),+ ):+ if page:+ yield [{**row, **child.row_fields} for row in page]+ else:+ manager.safe_point()+ except HTTPError as error:+ _raise_unless_not_found(error)+ next_url = None++ group_ids = group_ids[1:]+ child_keys = Nonediff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/folk/settings.py b/products/warehouse_sources/backend/temporal/data_imports/sources/folk/settings.pyindex b4055ad1dd56..13ae5b3f0b84 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/folk/settings.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/folk/settings.py@@ -1,5 +1,5 @@from dataclasses import dataclass, field-from typing import Optional+from typing import Literal, Optional# Folk's public API (developer.folk.app). All list endpoints share one shape: bearer auth, a# `{"data": {"items": [...], "pagination": {"nextLink": ...}}}` envelope, and cursor pagination@@ -13,8 +13,11 @@ class FolkEndpointConfig:path: strprimary_keys: list[str] = field(default_factory=lambda: ["id"])# Stable creation timestamp to partition by; None where the resource carries no timestamp- # (groups and users).+ # (groups, users, group members, and custom fields).partition_key: Optional[str] = None+ # Set on endpoints scoped to one group: the sync walks every group from `/v1/groups` and lists+ # this child resource per group. "objects" and "custom_fields" also fan out per object type.+ group_fanout: Optional[Literal["members", "custom_fields", "objects"]] = None# Every endpoint is full refresh: Folk exposes no updatedAt filter on any list endpoint, its@@ -54,6 +57,29 @@ FOLK_ENDPOINTS: dict[str, FolkEndpointConfig] = {path="/v1/reminders",partition_key="createdAt",),+ "group_members": FolkEndpointConfig(+ name="group_members",+ path="/v1/groups/{groupId}/members",+ primary_keys=["groupId", "id"],+ group_fanout="members",+ ),+ "group_custom_fields": FolkEndpointConfig(+ name="group_custom_fields",+ path="/v1/groups/{groupId}/custom-fields/{entityType}",+ primary_keys=["groupId", "entityType", "name"],+ group_fanout="custom_fields",+ ),+ # Deals and every other custom object type share one route per group and object type.+ "custom_objects": FolkEndpointConfig(+ name="custom_objects",+ path="/v1/groups/{groupId}/{objectType}",+ primary_keys=["groupId", "objectType", "id"],+ partition_key="createdAt",+ group_fanout="objects",+ ),}+# Custom field entity types every group has; custom object type names are added per group.+FOLK_BUILTIN_ENTITY_TYPES = ("person", "company")+ENDPOINTS = tuple(FOLK_ENDPOINTS.keys())diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/folk/source.py b/products/warehouse_sources/backend/temporal/data_imports/sources/folk/source.pyindex e8e975c05b7e..f0243249ee6b 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/folk/source.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/folk/source.py@@ -50,7 +50,7 @@ class FolkSource(ResumableSource[FolkSourceConfig, FolkResumeConfig]):category=DataWarehouseSourceCategory.CRM,label="Folk",releaseStatus=ReleaseStatus.ALPHA,- caption="""Enter your Folk API key to pull your CRM contacts, companies, groups, notes, tasks, and reminders into the PostHog Data warehouse.+ caption="""Enter your Folk API key to pull your CRM contacts, companies, groups, deals and other custom objects, notes, tasks, and reminders into the PostHog Data warehouse.You can create an API key in your [Folk workspace settings](https://app.folk.app/apps/contacts/network/settings/api-keys) under the "API" section. The key syncs the data its creating user can access, so create it as a user who can see the groups you want to sync.""",iconPath="/static/services/folk.png",diff --git a/products/warehouse_sources/backend/temporal/data_imports/sources/folk/tests/test_folk.py b/products/warehouse_sources/backend/temporal/data_imports/sources/folk/tests/test_folk.pyindex 6f8269f29f8a..f2bf036fd34f 100644--- a/products/warehouse_sources/backend/temporal/data_imports/sources/folk/tests/test_folk.py+++ b/products/warehouse_sources/backend/temporal/data_imports/sources/folk/tests/test_folk.py@@ -8,6 +8,7 @@ from products.warehouse_sources.backend.temporal.data_imports.sources.common.schfrom products.warehouse_sources.backend.temporal.data_imports.sources.common.testing import (ScriptedResponse,SourceDriver,+ route,scripted_network,)from products.warehouse_sources.backend.temporal.data_imports.sources.folk.folk import (@@ -97,6 +98,125 @@ class TestPagination:assert result.requests == []+_GROUPS = _page([{"id": "grp_1", "name": "Sales"}, {"id": "grp_2", "name": "Hiring"}])+++class TestGroupFanout:+ def test_group_members_walk_every_group_and_carry_the_group_id(self) -> None:+ second = "https://api.folk.app/v1/groups/grp_1/members?limit=100&cursor=m2"+ result = _driver().run(+ "group_members",+ [+ _GROUPS,+ _page([{"id": "usr_1", "role": "owner"}], next_url=second),+ _page([{"id": "usr_2", "role": "reader"}]),+ _page([{"id": "usr_1", "role": "admin"}]),+ ],+ )++ assert result.raised is None+ assert result.paths == [+ "/v1/groups",+ "/v1/groups/grp_1/members",+ "/v1/groups/grp_1/members",+ "/v1/groups/grp_2/members",+ ]+ assert result.rows == [+ {"id": "usr_1", "role": "owner", "groupId": "grp_1"},+ {"id": "usr_2", "role": "reader", "groupId": "grp_1"},+ {"id": "usr_1", "role": "admin", "groupId": "grp_2"},+ ]+ assert result.saved_states == [+ FolkResumeConfig(remaining_group_ids=["grp_1", "grp_2"]),+ FolkResumeConfig(next_url=second, remaining_group_ids=["grp_1", "grp_2"], remaining_child_keys=[""]),+ FolkResumeConfig(remaining_group_ids=["grp_2"]),+ FolkResumeConfig(remaining_group_ids=["grp_2"]),+ FolkResumeConfig(remaining_group_ids=[]),+ ]++ def test_custom_objects_list_each_object_type_and_skip_one_deleted_since_discovery(self) -> None:+ person_fields = [+ {"name": "Deals", "type": "objectField"},+ {"name": "Job Applications", "type": "objectField"},+ {"name": "Stage", "type": "singleSelect"},+ ]+ result = _driver().run(+ "custom_objects",+ route(+ {+ "/v1/groups": [_GROUPS],+ "/custom-fields/person": [_page(person_fields), _page([])],+ "/grp_1/Deals": [_page([{"id": "obj_1", "createdAt": "2025-01-01T00:00:00Z"}])],+ "/grp_1/Job%20Applications": [ScriptedResponse(status=404)],+ }+ ),+ )++ assert result.raised is None+ assert result.paths == [+ "/v1/groups",+ "/v1/groups/grp_1/custom-fields/person",+ "/v1/groups/grp_1/Deals",+ "/v1/groups/grp_1/Job%20Applications",+ "/v1/groups/grp_2/custom-fields/person",+ ]+ assert result.rows == [+ {"id": "obj_1", "createdAt": "2025-01-01T00:00:00Z", "groupId": "grp_1", "objectType": "Deals"}+ ]++ def test_custom_fields_cover_people_companies_and_each_object_type(self) -> None:+ result = _driver().run(+ "group_custom_fields",+ [+ _page([{"id": "grp_1", "name": "Sales"}]),+ _page([{"name": "Deals", "type": "objectField"}]),+ _page([{"name": "Deals", "type": "objectField"}]),+ _page([{"name": "Industry", "type": "textField"}]),+ _page([{"name": "Amount", "type": "numericField"}]),+ ],+ )++ assert result.raised is None+ assert result.paths == [+ "/v1/groups",+ "/v1/groups/grp_1/custom-fields/person",+ "/v1/groups/grp_1/custom-fields/person",+ "/v1/groups/grp_1/custom-fields/company",+ "/v1/groups/grp_1/custom-fields/Deals",+ ]+ assert [(row["entityType"], row["name"]) for row in result.rows] == [+ ("person", "Deals"),+ ("company", "Industry"),+ ("Deals", "Amount"),+ ]++ @parameterized.expand(+ [+ # The resumed type still exists: continue its walk at the saved page.+ ("continues_saved_page", ["Deals"], "Deals", "o3"),+ # The resumed type was deleted: skip it, and do not re-read types finished before it.+ ("skips_deleted_type", ["Gone", "Projects"], "Projects", None),+ ]+ )+ def test_resumes_inside_a_group_without_relisting_groups(+ self, _name: str, child_keys: list[str], expected_type: str, expected_cursor: str | None+ ) -> None:+ resume_url = f"https://api.folk.app/v1/groups/grp_2/{child_keys[0]}?limit=100&cursor=o3"+ object_types = [{"name": "Deals", "type": "objectField"}, {"name": "Projects", "type": "objectField"}]+ result = _driver().run(+ "custom_objects",+ [_page(object_types), _page([{"id": "obj_9"}])],+ resume_state=FolkResumeConfig(+ next_url=resume_url, remaining_group_ids=["grp_2"], remaining_child_keys=child_keys+ ),+ )++ assert result.raised is None+ assert result.paths == ["/v1/groups/grp_2/custom-fields/person", f"/v1/groups/grp_2/{expected_type}"]+ assert result.params("cursor")[1] == expected_cursor+ assert result.rows == [{"id": "obj_9", "groupId": "grp_2", "objectType": expected_type}]++class TestUnknownEndpoint:def test_unknown_endpoint_raises_a_retryable_unknown_resource_error(self) -> None:# A web pod can offer a table this worker's catalog doesn't know yet; the named error is@@ -108,6 +228,15 @@ class TestUnknownEndpoint:class TestProbeCredentials:+ @parameterized.expand(+ [("top_level", "people", "/v1/people"), ("group_scoped_probes_groups", "group_members", "/v1/groups")]+ )+ def test_schema_probe_path(self, _name: str, endpoint: str, expected_path: str) -> None:+ with scripted_network([ScriptedResponse(status=200)]) as network:+ probe_credentials("folk_test", endpoint)++ assert [request.path for request in network.requests_log] == [expected_path]+@parameterized.expand([("ok", 200), ("unauthorized", 401), ("forbidden", 403)])def test_returns_status_code(self, _name: str, status_code: int) -> None:with scripted_network([ScriptedResponse(status=status_code)]) as network: