Skip to content

Commit 5930892

Browse files
feat: Fall back to aliases after network token enrollment failures
Stainless-Generated-From: d3a9e9fb937da5113420fae10c752748efc6bbf2
1 parent bfcfa9a commit 5930892

15 files changed

Lines changed: 303 additions & 15 deletions

‎api.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,8 @@ from kernel.types.vaults import (
602602
KernelCredentialVaultItemState,
603603
KernelWalletState,
604604
KernelWalletVaultItemSpec,
605+
LinkShippingAddress,
606+
LinkUserInfo,
605607
ManagedAuthCredentialVaultField,
606608
ManagedAuthCredentialVaultItemSpec,
607609
ManagedAuthCredentialVaultItemSpecInput,

‎src/kernel/resources/vaults/items.py‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def retrieve(
6666
key: str,
6767
*,
6868
id_or_name: str,
69-
expand: List[Literal["payment_methods"]] | Omit = omit,
69+
expand: List[Literal["payment_methods", "link_user_info", "link_shipping_addresses"]] | Omit = omit,
7070
wait: int | Omit = omit,
7171
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
7272
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -746,7 +746,8 @@ def perform_operation(
746746
prefix or glob matching. When an item allows omitting it, the browser must have
747747
exactly one open page.
748748
749-
timeout_ms: Total operation deadline in milliseconds, not a per-field timeout.
749+
timeout_ms: Ignored. Fill sets no operation deadline; typing pace adapts to the length of
750+
the values instead. Accepted for compatibility.
750751
751752
extra_headers: Send extra headers
752753
@@ -1447,7 +1448,7 @@ async def retrieve(
14471448
key: str,
14481449
*,
14491450
id_or_name: str,
1450-
expand: List[Literal["payment_methods"]] | Omit = omit,
1451+
expand: List[Literal["payment_methods", "link_user_info", "link_shipping_addresses"]] | Omit = omit,
14511452
wait: int | Omit = omit,
14521453
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
14531454
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -2127,7 +2128,8 @@ async def perform_operation(
21272128
prefix or glob matching. When an item allows omitting it, the browser must have
21282129
exactly one open page.
21292130
2130-
timeout_ms: Total operation deadline in milliseconds, not a per-field timeout.
2131+
timeout_ms: Ignored. Fill sets no operation deadline; typing pace adapts to the length of
2132+
the values instead. Accepted for compatibility.
21312133
21322134
extra_headers: Send extra headers
21332135

‎src/kernel/types/vaults/__init__.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import annotations
44

55
from .vault_item import VaultItem as VaultItem
6+
from .link_user_info import LinkUserInfo as LinkUserInfo
67
from .vault_item_event import VaultItemEvent as VaultItemEvent
78
from .kernel_card_state import KernelCardState as KernelCardState
89
from .vault_item_action import VaultItemAction as VaultItemAction
@@ -18,6 +19,7 @@
1819
from .vault_payment_method import VaultPaymentMethod as VaultPaymentMethod
1920
from .card_vault_item_state import CardVaultItemState as CardVaultItemState
2021
from .credential_vault_item import CredentialVaultItem as CredentialVaultItem
22+
from .link_shipping_address import LinkShippingAddress as LinkShippingAddress
2123
from .vault_fill_field_param import VaultFillFieldParam as VaultFillFieldParam
2224
from .wallet_vault_item_spec import WalletVaultItemSpec as WalletVaultItemSpec
2325
from .vault_fill_field_result import VaultFillFieldResult as VaultFillFieldResult

‎src/kernel/types/vaults/card_vault_item_spec.py‎

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"LinkCardVaultItemSpec",
1313
"LinkCardVaultItemSpecLineItem",
1414
"LinkCardVaultItemSpecLineItemTotal",
15+
"LinkCardVaultItemSpecRecurring",
1516
"LinkCardVaultItemSpecTotal",
1617
"AgentCardCardVaultItemSpec",
1718
]
@@ -47,6 +48,18 @@ class LinkCardVaultItemSpecLineItem(BaseModel):
4748
url: Optional[str] = None
4849

4950

51+
class LinkCardVaultItemSpecRecurring(BaseModel):
52+
"""Recurring terms for a subscription or other repeated purchase.
53+
54+
The amount becomes the spending limit for each period of interval_count intervals, for example every 2 weeks. The merchant schedules charges. The card stays ready after each charge until it expires or is deleted; do not create a new card each period. Deleting the card, its wallet or its vault first cancels the credential with Link, so later charges decline; if Link cannot be reached, deletion returns 409 provider_revocation_pending and should be retried. Deletion does not cancel the subscription with the merchant. Recurring terms cannot be changed once the card is authorized.
55+
"""
56+
57+
interval: Literal["day", "week", "month", "year"]
58+
59+
interval_count: Optional[int] = None
60+
"""Number of intervals per period. Link defaults it to 1."""
61+
62+
5063
class LinkCardVaultItemSpecTotal(BaseModel):
5164
amount: int
5265
"""Total amount in minor currency units."""
@@ -63,7 +76,10 @@ class LinkCardVaultItemSpec(BaseModel):
6376
"""
6477

6578
amount: int
66-
"""Integer amount in minor currency units, at most 50000."""
79+
"""Integer amount in minor currency units, at most 50000.
80+
81+
With recurring, the spending limit per period, not a lifetime total.
82+
"""
6783

6884
context: str
6985

@@ -89,6 +105,19 @@ class LinkCardVaultItemSpec(BaseModel):
89105

90106
metadata: Optional[Dict[str, str]] = None
91107

108+
recurring: Optional[LinkCardVaultItemSpecRecurring] = None
109+
"""Recurring terms for a subscription or other repeated purchase.
110+
111+
The amount becomes the spending limit for each period of interval_count
112+
intervals, for example every 2 weeks. The merchant schedules charges. The card
113+
stays ready after each charge until it expires or is deleted; do not create a
114+
new card each period. Deleting the card, its wallet or its vault first cancels
115+
the credential with Link, so later charges decline; if Link cannot be reached,
116+
deletion returns 409 provider_revocation_pending and should be retried. Deletion
117+
does not cancel the subscription with the merchant. Recurring terms cannot be
118+
changed once the card is authorized.
119+
"""
120+
92121
totals: Optional[List[LinkCardVaultItemSpecTotal]] = None
93122

94123

‎src/kernel/types/vaults/card_vault_item_spec_param.py‎

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"LinkCardVaultItemSpec",
1313
"LinkCardVaultItemSpecLineItem",
1414
"LinkCardVaultItemSpecLineItemTotal",
15+
"LinkCardVaultItemSpecRecurring",
1516
"LinkCardVaultItemSpecTotal",
1617
"AgentCardCardVaultItemSpec",
1718
]
@@ -47,6 +48,18 @@ class LinkCardVaultItemSpecLineItem(TypedDict, total=False):
4748
url: str
4849

4950

51+
class LinkCardVaultItemSpecRecurring(TypedDict, total=False):
52+
"""Recurring terms for a subscription or other repeated purchase.
53+
54+
The amount becomes the spending limit for each period of interval_count intervals, for example every 2 weeks. The merchant schedules charges. The card stays ready after each charge until it expires or is deleted; do not create a new card each period. Deleting the card, its wallet or its vault first cancels the credential with Link, so later charges decline; if Link cannot be reached, deletion returns 409 provider_revocation_pending and should be retried. Deletion does not cancel the subscription with the merchant. Recurring terms cannot be changed once the card is authorized.
55+
"""
56+
57+
interval: Required[Literal["day", "week", "month", "year"]]
58+
59+
interval_count: int
60+
"""Number of intervals per period. Link defaults it to 1."""
61+
62+
5063
class LinkCardVaultItemSpecTotal(TypedDict, total=False):
5164
amount: Required[int]
5265
"""Total amount in minor currency units."""
@@ -63,7 +76,10 @@ class LinkCardVaultItemSpec(TypedDict, total=False):
6376
"""
6477

6578
amount: Required[int]
66-
"""Integer amount in minor currency units, at most 50000."""
79+
"""Integer amount in minor currency units, at most 50000.
80+
81+
With recurring, the spending limit per period, not a lifetime total.
82+
"""
6783

6884
context: Required[str]
6985

@@ -89,6 +105,19 @@ class LinkCardVaultItemSpec(TypedDict, total=False):
89105

90106
metadata: Dict[str, str]
91107

108+
recurring: LinkCardVaultItemSpecRecurring
109+
"""Recurring terms for a subscription or other repeated purchase.
110+
111+
The amount becomes the spending limit for each period of interval_count
112+
intervals, for example every 2 weeks. The merchant schedules charges. The card
113+
stays ready after each charge until it expires or is deleted; do not create a
114+
new card each period. Deleting the card, its wallet or its vault first cancels
115+
the credential with Link, so later charges decline; if Link cannot be reached,
116+
deletion returns 409 provider_revocation_pending and should be retried. Deletion
117+
does not cancel the subscription with the merchant. Recurring terms cannot be
118+
changed once the card is authorized.
119+
"""
120+
92121
totals: Iterable[LinkCardVaultItemSpecTotal]
93122

94123

‎src/kernel/types/vaults/credential_account_vault_item.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class AvailableExpansion(BaseModel):
1919

2020
description: str
2121

22-
type: Literal["payment_methods"]
22+
type: Literal["payment_methods", "link_user_info", "link_shipping_addresses"]
2323

2424

2525
class AvailableOperation(BaseModel):

‎src/kernel/types/vaults/credential_vault_item.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class AvailableExpansion(BaseModel):
2626

2727
description: str
2828

29-
type: Literal["payment_methods"]
29+
type: Literal["payment_methods", "link_user_info", "link_shipping_addresses"]
3030

3131

3232
class AvailableOperation(BaseModel):

‎src/kernel/types/vaults/fill_vault_item_operation_request_param.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,8 @@ class FillVaultItemOperationRequestParam(TypedDict, total=False):
5757
"""
5858

5959
timeout_ms: int
60-
"""Total operation deadline in milliseconds, not a per-field timeout."""
60+
"""Ignored.
61+
62+
Fill sets no operation deadline; typing pace adapts to the length of the values
63+
instead. Accepted for compatibility.
64+
"""

‎src/kernel/types/vaults/item_perform_operation_params.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,11 @@ class FillVaultItemOperationRequest(TypedDict, total=False):
121121
"""
122122

123123
timeout_ms: int
124-
"""Total operation deadline in milliseconds, not a per-field timeout."""
124+
"""Ignored.
125+
126+
Fill sets no operation deadline; typing pace adapts to the length of the values
127+
instead. Accepted for compatibility.
128+
"""
125129

126130

127131
class OnePasswordRequestAccessVaultItemOperationRequest(TypedDict, total=False):

‎src/kernel/types/vaults/item_retrieve_params.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class ItemRetrieveParams(TypedDict, total=False):
1212
id_or_name: Required[str]
1313

14-
expand: List[Literal["payment_methods"]]
14+
expand: List[Literal["payment_methods", "link_user_info", "link_shipping_addresses"]]
1515
"""Live fields advertised by `available_expansions` to include in `expanded`."""
1616

1717
wait: int

0 commit comments

Comments
 (0)