From 99d851577f0ed2f7ba78849172f8fdddb0a9ce31 Mon Sep 17 00:00:00 2001 From: "kernel-internal[bot]" <260533166+kernel-internal[bot]@users.noreply.github.com> Date: Tue, 27 Oct 2026 14:22:35 +0000 Subject: [PATCH 1/4] feat: Support multiple Kernel wallet payment methods and payment requests Stainless-Generated-From: d8f3e64609f69a8484f189c430cc0dc307ee82a2 --- api.md | 8 + src/kernel/resources/vaults/items.py | 709 ++++++++++- src/kernel/types/vaults/__init__.py | 22 + ...thod_vault_item_operation_request_param.py | 15 + ...ment_method_vault_item_operation_result.py | 19 + .../vaults/credential_account_vault_item.py | 2 + .../types/vaults/credential_vault_item.py | 2 + .../credential_vault_item_request_param.py | 10 +- .../vaults/item_perform_operation_params.py | 19 + src/kernel/types/vaults/item_update_params.py | 28 +- src/kernel/types/vaults/item_upsert_params.py | 32 +- src/kernel/types/vaults/kernel_card_state.py | 17 + .../vaults/kernel_card_vault_item_spec.py | 9 + .../kernel_card_vault_item_spec_param.py | 9 + ..._credential_vault_item_spec_input_param.py | 2 +- .../kernel_payment_request_vault_item_spec.py | 56 + ...l_payment_request_vault_item_spec_param.py | 55 + .../types/vaults/kernel_wallet_state.py | 21 +- .../vaults/kernel_wallet_vault_item_spec.py | 5 +- .../kernel_wallet_vault_item_spec_param.py | 5 +- .../vaults/payment_request_vault_item.py | 93 ++ .../vaults/payment_request_vault_item_spec.py | 125 ++ .../payment_request_vault_item_spec_param.py | 123 ++ .../payment_request_vault_item_state.py | 65 + ...thod_vault_item_operation_request_param.py | 18 + ...ment_method_vault_item_operation_result.py | 15 + src/kernel/types/vaults/vault_item.py | 7 +- .../vaults/vault_item_operation_response.py | 10 + .../types/vaults/vault_payment_method.py | 41 +- tests/api_resources/vaults/test_items.py | 1078 +++++++++++++++-- 30 files changed, 2454 insertions(+), 166 deletions(-) create mode 100644 src/kernel/types/vaults/add_payment_method_vault_item_operation_request_param.py create mode 100644 src/kernel/types/vaults/add_payment_method_vault_item_operation_result.py create mode 100644 src/kernel/types/vaults/kernel_payment_request_vault_item_spec.py create mode 100644 src/kernel/types/vaults/kernel_payment_request_vault_item_spec_param.py create mode 100644 src/kernel/types/vaults/payment_request_vault_item.py create mode 100644 src/kernel/types/vaults/payment_request_vault_item_spec.py create mode 100644 src/kernel/types/vaults/payment_request_vault_item_spec_param.py create mode 100644 src/kernel/types/vaults/payment_request_vault_item_state.py create mode 100644 src/kernel/types/vaults/remove_payment_method_vault_item_operation_request_param.py create mode 100644 src/kernel/types/vaults/remove_payment_method_vault_item_operation_result.py diff --git a/api.md b/api.md index ae4bb2bb..a2995e3a 100644 --- a/api.md +++ b/api.md @@ -569,6 +569,8 @@ Types: ```python from kernel.types.vaults import ( + AddPaymentMethodVaultItemOperationRequest, + AddPaymentMethodVaultItemOperationResult, AgentcardCheckoutAuthorization, AgentcardCheckoutPreparation, AgentcardPreparedProcessor, @@ -602,6 +604,7 @@ from kernel.types.vaults import ( KernelCredentialVaultItemSpec, KernelCredentialVaultItemSpecInput, KernelCredentialVaultItemState, + KernelPaymentRequestVaultItemSpec, KernelWalletState, KernelWalletVaultItemSpec, LinkShippingAddress, @@ -621,8 +624,13 @@ from kernel.types.vaults import ( OnePasswordRecoverVaultItemOperationRequest, OnePasswordRequestAccessVaultItemOperationRequest, PasskeyVaultItemOperationResult, + PaymentRequestVaultItem, + PaymentRequestVaultItemSpec, + PaymentRequestVaultItemState, PrepareCheckoutVaultItemOperationRequest, RegisterPasskeyVaultItemOperationRequest, + RemovePaymentMethodVaultItemOperationRequest, + RemovePaymentMethodVaultItemOperationResult, RestartVerificationVaultItemOperationRequest, VaultCardAliases, VaultCardFillField, diff --git a/src/kernel/resources/vaults/items.py b/src/kernel/resources/vaults/items.py index 0347d455..ad0db16c 100644 --- a/src/kernel/resources/vaults/items.py +++ b/src/kernel/resources/vaults/items.py @@ -34,6 +34,7 @@ from ...types.vaults.vault_webmcp_binding_param import VaultWebmcpBindingParam from ...types.vaults.vault_checkout_context_param import VaultCheckoutContextParam from ...types.vaults.vault_item_operation_response import VaultItemOperationResponse +from ...types.vaults.payment_request_vault_item_spec_param import PaymentRequestVaultItemSpecParam from ...types.vaults.credential_vault_item_spec_input_param import CredentialVaultItemSpecInputParam from ...types.vaults.credential_vault_item_spec_update_param import CredentialVaultItemSpecUpdateParam from ...types.vaults.one_password_credential_account_spec_param import OnePasswordCredentialAccountSpecParam @@ -177,6 +178,55 @@ def update( """ ... + @overload + def update( + self, + key: str, + *, + id_or_name: str, + spec: PaymentRequestVaultItemSpecParam, + type: Literal["payment_request"], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> VaultItem: + """ + Credential updates require type credential and the current version, and change + only values or description; omitted values are preserved, nonempty strings + replace, and null or empty strings clear supported fields. Clearing required + text/email/password values returns pending_collection; browser forms still + require nonempty required inputs. Card updates may omit type for compatibility + with legacy requests. Requested cards accept a replacement specification. + Pending issuance requests may update provider-supported fields on their existing + request, subject to atomic provider approval checks; omitted optional fields + remain unchanged and explicit empty lists clear them. Wallet/provider binding + and unsupported fields cannot change after authorization starts. An uncertain + update enters recovery_required; delete the card and create a new one rather + than retrying the update. Checkout cards may be edited between authorizations. A + Link card authorized with browser_id and page_url cannot be changed; delete it + and create a new card with the updated details. + + Args: + spec: Live Link card request. Test-mode card creation is not supported. The spec can + be changed with PATCH until the card is authorized at a checkout. Authorize it + with the browser at final checkout: Kernel inspects the checkout through WebMCP + and internally chooses a merchant-bound Link Pay Token when supported or a + virtual card otherwise. Callers never receive or choose how the credential is + delivered. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + @overload def update( self, @@ -228,14 +278,14 @@ def update( """ ... - @required_args(["id_or_name", "spec"], ["id_or_name", "spec", "type", "version"]) + @required_args(["id_or_name", "spec"], ["id_or_name", "spec", "type"], ["id_or_name", "spec", "type", "version"]) def update( self, key: str, *, id_or_name: str, - spec: CardVaultItemSpecParam | CredentialVaultItemSpecUpdateParam, - type: Literal["card"] | Literal["credential"] | Omit = omit, + spec: CardVaultItemSpecParam | PaymentRequestVaultItemSpecParam | CredentialVaultItemSpecUpdateParam, + type: Literal["card"] | Literal["payment_request"] | Literal["credential"] | Omit = omit, version: int | Omit = omit, expected_item_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -445,6 +495,12 @@ def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: browser_id: Browser session ID, not a reusable browser name. The browser must have this vault attached. @@ -501,6 +557,12 @@ def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: extra_headers: Send extra headers @@ -559,6 +621,12 @@ def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: amount: Actual transaction amount in minor units, no greater than the approved limit. @@ -616,6 +684,12 @@ def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: extra_headers: Send extra headers @@ -668,6 +742,12 @@ def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: checkout: Required when preparing an unused AgentCard card for a supported checkout processor. Consent is bound to this browser and declared merchant origin, not a @@ -729,6 +809,12 @@ def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: browser_id: Browser session ID, not a reusable browser name. @@ -801,6 +887,12 @@ def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: browser_id: Browser session ID, not a reusable browser name. @@ -858,6 +950,12 @@ def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: browser_id: Browser session ID, not a reusable browser name. @@ -916,6 +1014,12 @@ def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: browser_id: Browser session ID, not a reusable browser name. @@ -975,6 +1079,12 @@ def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: extra_headers: Send extra headers @@ -1027,6 +1137,12 @@ def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: extra_headers: Send extra headers @@ -1082,6 +1198,12 @@ def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: browser_id: Browser session ID, not a reusable browser name. @@ -1141,6 +1263,12 @@ def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: extra_headers: Send extra headers @@ -1194,6 +1322,12 @@ def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: access_token_expires_at: Optional supplied expiry. Omit to clear the old expiry. @@ -1253,6 +1387,12 @@ def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: browser_id: Browser session ID, not a reusable browser name. @@ -1278,6 +1418,123 @@ def perform_operation( """ ... + @overload + def perform_operation( + self, + key: str, + *, + id_or_name: str, + type: Literal["add_payment_method"], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> VaultItemOperationResponse: + """ + Retrieve the item first and invoke only an operation listed in + `available_operations`, following its natural-language description. Availability + is rechecked at execution time; unavailable operations return 409. Authorization + and preparation may call an external provider and return updated state. Link + cards advertise authorize; pass browser_id and page_url from the final checkout + page so Kernel can inspect the checkout. Eligible unused AgentCard cards + advertise prepare_checkout, which requires checkout context and obtains device + approval before native Square Pay. Keep the returned approval page open, poll + until ready_to_submit, then submit before preparation.expires_at. Unused + preparations expire automatically and cannot be reused. If spend-request + creation is rejected with a non-retryable provider error, the card item is + deleted and the provider's error code and message are returned. Rate limits + return HTTP 429 and retain the card item; stop, back off, and retry the same + authorize operation. + + Ready Kernel cards advertise fill. Fill delivers card details for a few minutes; + submit checkout promptly after filling. A repeated fill is safe. + + Fill returns a value-free execution result. Validation failures before writing + return 400 (invalid request or targets), 403 (access or destination denied), 404 + (resource not found), or 409 (item or browser not ready). Once writing starts, + known partial failures and indeterminate field outcomes return 200 with status + `failed` or `unknown`. Fill never submits the page, so it is safe to retry after + a failure, an `unknown` outcome, or a transport error. + + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def perform_operation( + self, + key: str, + *, + id_or_name: str, + payment_method_id: str, + type: Literal["remove_payment_method"], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> VaultItemOperationResponse: + """ + Retrieve the item first and invoke only an operation listed in + `available_operations`, following its natural-language description. Availability + is rechecked at execution time; unavailable operations return 409. Authorization + and preparation may call an external provider and return updated state. Link + cards advertise authorize; pass browser_id and page_url from the final checkout + page so Kernel can inspect the checkout. Eligible unused AgentCard cards + advertise prepare_checkout, which requires checkout context and obtains device + approval before native Square Pay. Keep the returned approval page open, poll + until ready_to_submit, then submit before preparation.expires_at. Unused + preparations expire automatically and cannot be reused. If spend-request + creation is rejected with a non-retryable provider error, the card item is + deleted and the provider's error code and message are returned. Rate limits + return HTTP 429 and retain the card item; stop, back off, and retry the same + authorize operation. + + Ready Kernel cards advertise fill. Fill delivers card details for a few minutes; + submit checkout promptly after filling. A repeated fill is safe. + + Fill returns a value-free execution result. Validation failures before writing + return 400 (invalid request or targets), 403 (access or destination denied), 404 + (resource not found), or 409 (item or browser not ready). Once writing starts, + known partial failures and indeterminate field outcomes return 200 with status + `failed` or `unknown`. Fill never submits the page, so it is safe to retry after + a failure, an `unknown` outcome, or a transport error. + + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + + Args: + payment_method_id: ID from the wallet's payment_methods expansion. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + @required_args( ["id_or_name", "type"], ["id_or_name", "amount", "currency", "occurred_at", "status", "transaction_type", "type"], @@ -1286,6 +1543,7 @@ def perform_operation( ["id_or_name", "browser_id", "page_url", "type"], ["id_or_name", "access_token", "type"], ["id_or_name", "bindings", "browser_id", "input", "page_url", "tool_ref", "type"], + ["id_or_name", "payment_method_id", "type"], ) def perform_operation( self, @@ -1306,7 +1564,9 @@ def perform_operation( | Literal["1pw_fill"] | Literal["1pw_recover"] | Literal["1pw_update_access_token"] - | Literal["webmcp_invoke"], + | Literal["webmcp_invoke"] + | Literal["add_payment_method"] + | Literal["remove_payment_method"], browser_id: str | Omit = omit, page_url: str | Omit = omit, amount: int | Omit = omit, @@ -1332,6 +1592,7 @@ def perform_operation( input: Dict[str, object] | Omit = omit, tool_ref: str | Omit = omit, timeout_sec: int | Omit = omit, + payment_method_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1372,6 +1633,7 @@ def perform_operation( "input": input, "tool_ref": tool_ref, "timeout_sec": timeout_sec, + "payment_method_id": payment_method_id, }, item_perform_operation_params.ItemPerformOperationParams, ), @@ -1407,8 +1669,10 @@ def upsert( Provider-specific authorization requirements and retry behavior are described in the item's request schema. Do not use credential items to store, collect, or fill credit card data, including card numbers (PANs), security codes (CVV/CVC), - or expiration dates. Use wallet and card item types for credit cards and payment - checkout instead. + or expiration dates. Use wallet, payment_request and card item types for credit + cards and payment checkout instead. Where enabled, Link and Kernel purchases can + be payment_request items parented by their wallet; card items remain supported + for them and for AgentCard reusable cards. Args: spec: AgentCard wallet. Omit provider_config to use Kernel-managed credentials, or @@ -1459,8 +1723,56 @@ def upsert( Provider-specific authorization requirements and retry behavior are described in the item's request schema. Do not use credential items to store, collect, or fill credit card data, including card numbers (PANs), security codes (CVV/CVC), - or expiration dates. Use wallet and card item types for credit cards and payment - checkout instead. + or expiration dates. Use wallet, payment_request and card item types for credit + cards and payment checkout instead. Where enabled, Link and Kernel purchases can + be payment_request items parented by their wallet; card items remain supported + for them and for AgentCard reusable cards. + + Args: + spec: Live Link card request. Test-mode card creation is not supported. The spec can + be changed with PATCH until the card is authorized at a checkout. Authorize it + with the browser at final checkout: Kernel inspects the checkout through WebMCP + and internally chooses a merchant-bound Link Pay Token when supported or a + virtual card otherwise. Callers never receive or choose how the credential is + delivered. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + def upsert( + self, + key: str, + *, + id_or_name: str, + spec: PaymentRequestVaultItemSpecParam, + type: Literal["payment_request"], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> VaultItem: + """ + Create an item under a key unique within its vault, or retrieve the existing + item when its specification matches. An identical card PUT returns the existing + card in any lifecycle state without polling the provider, reauthorizing, + replacing aliases, or resetting recovery. Conflicting specifications return 409. + Provider-specific authorization requirements and retry behavior are described in + the item's request schema. Do not use credential items to store, collect, or + fill credit card data, including card numbers (PANs), security codes (CVV/CVC), + or expiration dates. Use wallet, payment_request and card item types for credit + cards and payment checkout instead. Where enabled, Link and Kernel purchases can + be payment_request items parented by their wallet; card items remain supported + for them and for AgentCard reusable cards. Args: spec: Live Link card request. Test-mode card creation is not supported. The spec can @@ -1503,8 +1815,10 @@ def upsert( Provider-specific authorization requirements and retry behavior are described in the item's request schema. Do not use credential items to store, collect, or fill credit card data, including card numbers (PANs), security codes (CVV/CVC), - or expiration dates. Use wallet and card item types for credit cards and payment - checkout instead. + or expiration dates. Use wallet, payment_request and card item types for credit + cards and payment checkout instead. Where enabled, Link and Kernel purchases can + be payment_request items parented by their wallet; card items remain supported + for them and for AgentCard reusable cards. Args: extra_headers: Send extra headers @@ -1540,15 +1854,17 @@ def upsert( Provider-specific authorization requirements and retry behavior are described in the item's request schema. Do not use credential items to store, collect, or fill credit card data, including card numbers (PANs), security codes (CVV/CVC), - or expiration dates. Use wallet and card item types for credit cards and payment - checkout instead. + or expiration dates. Use wallet, payment_request and card item types for credit + cards and payment checkout instead. Where enabled, Link and Kernel purchases can + be payment_request items parented by their wallet; card items remain supported + for them and for AgentCard reusable cards. Args: spec: Credential fields are for login and other non-payment credentials. Do not store, - collect, or fill credit card data in credential items. Use wallet and card item - types for credit cards and payment checkout instead. Field order is preserved in - the user-facing collection form, so list fields in the same top-to-bottom order - as the website. + collect, or fill credit card data in credential items. Use wallet, + payment_request and card item types for credit cards and payment checkout + instead. Field order is preserved in the user-facing collection form, so list + fields in the same top-to-bottom order as the website. extra_headers: Send extra headers @@ -1568,9 +1884,14 @@ def upsert( id_or_name: str, spec: item_upsert_params.WalletVaultItemRequestSpec | CardVaultItemSpecParam + | PaymentRequestVaultItemSpecParam | OnePasswordCredentialAccountSpecParam | CredentialVaultItemSpecInputParam, - type: Literal["wallet"] | Literal["card"] | Literal["credential_account"] | Literal["credential"], + type: Literal["wallet"] + | Literal["card"] + | Literal["payment_request"] + | Literal["credential_account"] + | Literal["credential"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -1737,6 +2058,55 @@ async def update( """ ... + @overload + async def update( + self, + key: str, + *, + id_or_name: str, + spec: PaymentRequestVaultItemSpecParam, + type: Literal["payment_request"], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> VaultItem: + """ + Credential updates require type credential and the current version, and change + only values or description; omitted values are preserved, nonempty strings + replace, and null or empty strings clear supported fields. Clearing required + text/email/password values returns pending_collection; browser forms still + require nonempty required inputs. Card updates may omit type for compatibility + with legacy requests. Requested cards accept a replacement specification. + Pending issuance requests may update provider-supported fields on their existing + request, subject to atomic provider approval checks; omitted optional fields + remain unchanged and explicit empty lists clear them. Wallet/provider binding + and unsupported fields cannot change after authorization starts. An uncertain + update enters recovery_required; delete the card and create a new one rather + than retrying the update. Checkout cards may be edited between authorizations. A + Link card authorized with browser_id and page_url cannot be changed; delete it + and create a new card with the updated details. + + Args: + spec: Live Link card request. Test-mode card creation is not supported. The spec can + be changed with PATCH until the card is authorized at a checkout. Authorize it + with the browser at final checkout: Kernel inspects the checkout through WebMCP + and internally chooses a merchant-bound Link Pay Token when supported or a + virtual card otherwise. Callers never receive or choose how the credential is + delivered. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + @overload async def update( self, @@ -1788,14 +2158,14 @@ async def update( """ ... - @required_args(["id_or_name", "spec"], ["id_or_name", "spec", "type", "version"]) + @required_args(["id_or_name", "spec"], ["id_or_name", "spec", "type"], ["id_or_name", "spec", "type", "version"]) async def update( self, key: str, *, id_or_name: str, - spec: CardVaultItemSpecParam | CredentialVaultItemSpecUpdateParam, - type: Literal["card"] | Literal["credential"] | Omit = omit, + spec: CardVaultItemSpecParam | PaymentRequestVaultItemSpecParam | CredentialVaultItemSpecUpdateParam, + type: Literal["card"] | Literal["payment_request"] | Literal["credential"] | Omit = omit, version: int | Omit = omit, expected_item_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -2005,6 +2375,12 @@ async def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: browser_id: Browser session ID, not a reusable browser name. The browser must have this vault attached. @@ -2061,6 +2437,12 @@ async def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: extra_headers: Send extra headers @@ -2119,6 +2501,12 @@ async def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: amount: Actual transaction amount in minor units, no greater than the approved limit. @@ -2176,6 +2564,12 @@ async def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: extra_headers: Send extra headers @@ -2228,6 +2622,12 @@ async def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: checkout: Required when preparing an unused AgentCard card for a supported checkout processor. Consent is bound to this browser and declared merchant origin, not a @@ -2289,6 +2689,12 @@ async def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: browser_id: Browser session ID, not a reusable browser name. @@ -2361,6 +2767,12 @@ async def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: browser_id: Browser session ID, not a reusable browser name. @@ -2418,6 +2830,12 @@ async def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: browser_id: Browser session ID, not a reusable browser name. @@ -2476,6 +2894,12 @@ async def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: browser_id: Browser session ID, not a reusable browser name. @@ -2535,6 +2959,12 @@ async def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: extra_headers: Send extra headers @@ -2587,6 +3017,12 @@ async def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: extra_headers: Send extra headers @@ -2642,6 +3078,12 @@ async def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: browser_id: Browser session ID, not a reusable browser name. @@ -2701,6 +3143,12 @@ async def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: extra_headers: Send extra headers @@ -2754,6 +3202,12 @@ async def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: access_token_expires_at: Optional supplied expiry. Omit to clear the old expiry. @@ -2813,6 +3267,12 @@ async def perform_operation( `failed` or `unknown`. Fill never submits the page, so it is safe to retry after a failure, an `unknown` outcome, or a transport error. + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + Args: browser_id: Browser session ID, not a reusable browser name. @@ -2838,6 +3298,123 @@ async def perform_operation( """ ... + @overload + async def perform_operation( + self, + key: str, + *, + id_or_name: str, + type: Literal["add_payment_method"], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> VaultItemOperationResponse: + """ + Retrieve the item first and invoke only an operation listed in + `available_operations`, following its natural-language description. Availability + is rechecked at execution time; unavailable operations return 409. Authorization + and preparation may call an external provider and return updated state. Link + cards advertise authorize; pass browser_id and page_url from the final checkout + page so Kernel can inspect the checkout. Eligible unused AgentCard cards + advertise prepare_checkout, which requires checkout context and obtains device + approval before native Square Pay. Keep the returned approval page open, poll + until ready_to_submit, then submit before preparation.expires_at. Unused + preparations expire automatically and cannot be reused. If spend-request + creation is rejected with a non-retryable provider error, the card item is + deleted and the provider's error code and message are returned. Rate limits + return HTTP 429 and retain the card item; stop, back off, and retry the same + authorize operation. + + Ready Kernel cards advertise fill. Fill delivers card details for a few minutes; + submit checkout promptly after filling. A repeated fill is safe. + + Fill returns a value-free execution result. Validation failures before writing + return 400 (invalid request or targets), 403 (access or destination denied), 404 + (resource not found), or 409 (item or browser not ready). Once writing starts, + known partial failures and indeterminate field outcomes return 200 with status + `failed` or `unknown`. Fill never submits the page, so it is safe to retry after + a failure, an `unknown` outcome, or a transport error. + + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def perform_operation( + self, + key: str, + *, + id_or_name: str, + payment_method_id: str, + type: Literal["remove_payment_method"], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> VaultItemOperationResponse: + """ + Retrieve the item first and invoke only an operation listed in + `available_operations`, following its natural-language description. Availability + is rechecked at execution time; unavailable operations return 409. Authorization + and preparation may call an external provider and return updated state. Link + cards advertise authorize; pass browser_id and page_url from the final checkout + page so Kernel can inspect the checkout. Eligible unused AgentCard cards + advertise prepare_checkout, which requires checkout context and obtains device + approval before native Square Pay. Keep the returned approval page open, poll + until ready_to_submit, then submit before preparation.expires_at. Unused + preparations expire automatically and cannot be reused. If spend-request + creation is rejected with a non-retryable provider error, the card item is + deleted and the provider's error code and message are returned. Rate limits + return HTTP 429 and retain the card item; stop, back off, and retry the same + authorize operation. + + Ready Kernel cards advertise fill. Fill delivers card details for a few minutes; + submit checkout promptly after filling. A repeated fill is safe. + + Fill returns a value-free execution result. Validation failures before writing + return 400 (invalid request or targets), 403 (access or destination denied), 404 + (resource not found), or 409 (item or browser not ready). Once writing starts, + known partial failures and indeterminate field outcomes return 200 with status + `failed` or `unknown`. Fill never submits the page, so it is safe to retry after + a failure, an `unknown` outcome, or a transport error. + + Connected Kernel wallets may advertise add_payment_method, which returns a + single-use hosted card_enrollment link for a card, and remove_payment_method, + which removes one card without affecting the others. Both operations require + vaults:write in addition to vaults:use on the vault for scoped API keys, and + return 403 without both permissions. + + Args: + payment_method_id: ID from the wallet's payment_methods expansion. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + @required_args( ["id_or_name", "type"], ["id_or_name", "amount", "currency", "occurred_at", "status", "transaction_type", "type"], @@ -2846,6 +3423,7 @@ async def perform_operation( ["id_or_name", "browser_id", "page_url", "type"], ["id_or_name", "access_token", "type"], ["id_or_name", "bindings", "browser_id", "input", "page_url", "tool_ref", "type"], + ["id_or_name", "payment_method_id", "type"], ) async def perform_operation( self, @@ -2866,7 +3444,9 @@ async def perform_operation( | Literal["1pw_fill"] | Literal["1pw_recover"] | Literal["1pw_update_access_token"] - | Literal["webmcp_invoke"], + | Literal["webmcp_invoke"] + | Literal["add_payment_method"] + | Literal["remove_payment_method"], browser_id: str | Omit = omit, page_url: str | Omit = omit, amount: int | Omit = omit, @@ -2892,6 +3472,7 @@ async def perform_operation( input: Dict[str, object] | Omit = omit, tool_ref: str | Omit = omit, timeout_sec: int | Omit = omit, + payment_method_id: str | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -2932,6 +3513,7 @@ async def perform_operation( "input": input, "tool_ref": tool_ref, "timeout_sec": timeout_sec, + "payment_method_id": payment_method_id, }, item_perform_operation_params.ItemPerformOperationParams, ), @@ -2967,8 +3549,10 @@ async def upsert( Provider-specific authorization requirements and retry behavior are described in the item's request schema. Do not use credential items to store, collect, or fill credit card data, including card numbers (PANs), security codes (CVV/CVC), - or expiration dates. Use wallet and card item types for credit cards and payment - checkout instead. + or expiration dates. Use wallet, payment_request and card item types for credit + cards and payment checkout instead. Where enabled, Link and Kernel purchases can + be payment_request items parented by their wallet; card items remain supported + for them and for AgentCard reusable cards. Args: spec: AgentCard wallet. Omit provider_config to use Kernel-managed credentials, or @@ -3019,8 +3603,56 @@ async def upsert( Provider-specific authorization requirements and retry behavior are described in the item's request schema. Do not use credential items to store, collect, or fill credit card data, including card numbers (PANs), security codes (CVV/CVC), - or expiration dates. Use wallet and card item types for credit cards and payment - checkout instead. + or expiration dates. Use wallet, payment_request and card item types for credit + cards and payment checkout instead. Where enabled, Link and Kernel purchases can + be payment_request items parented by their wallet; card items remain supported + for them and for AgentCard reusable cards. + + Args: + spec: Live Link card request. Test-mode card creation is not supported. The spec can + be changed with PATCH until the card is authorized at a checkout. Authorize it + with the browser at final checkout: Kernel inspects the checkout through WebMCP + and internally chooses a merchant-bound Link Pay Token when supported or a + virtual card otherwise. Callers never receive or choose how the credential is + delivered. + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + ... + + @overload + async def upsert( + self, + key: str, + *, + id_or_name: str, + spec: PaymentRequestVaultItemSpecParam, + type: Literal["payment_request"], + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> VaultItem: + """ + Create an item under a key unique within its vault, or retrieve the existing + item when its specification matches. An identical card PUT returns the existing + card in any lifecycle state without polling the provider, reauthorizing, + replacing aliases, or resetting recovery. Conflicting specifications return 409. + Provider-specific authorization requirements and retry behavior are described in + the item's request schema. Do not use credential items to store, collect, or + fill credit card data, including card numbers (PANs), security codes (CVV/CVC), + or expiration dates. Use wallet, payment_request and card item types for credit + cards and payment checkout instead. Where enabled, Link and Kernel purchases can + be payment_request items parented by their wallet; card items remain supported + for them and for AgentCard reusable cards. Args: spec: Live Link card request. Test-mode card creation is not supported. The spec can @@ -3063,8 +3695,10 @@ async def upsert( Provider-specific authorization requirements and retry behavior are described in the item's request schema. Do not use credential items to store, collect, or fill credit card data, including card numbers (PANs), security codes (CVV/CVC), - or expiration dates. Use wallet and card item types for credit cards and payment - checkout instead. + or expiration dates. Use wallet, payment_request and card item types for credit + cards and payment checkout instead. Where enabled, Link and Kernel purchases can + be payment_request items parented by their wallet; card items remain supported + for them and for AgentCard reusable cards. Args: extra_headers: Send extra headers @@ -3100,15 +3734,17 @@ async def upsert( Provider-specific authorization requirements and retry behavior are described in the item's request schema. Do not use credential items to store, collect, or fill credit card data, including card numbers (PANs), security codes (CVV/CVC), - or expiration dates. Use wallet and card item types for credit cards and payment - checkout instead. + or expiration dates. Use wallet, payment_request and card item types for credit + cards and payment checkout instead. Where enabled, Link and Kernel purchases can + be payment_request items parented by their wallet; card items remain supported + for them and for AgentCard reusable cards. Args: spec: Credential fields are for login and other non-payment credentials. Do not store, - collect, or fill credit card data in credential items. Use wallet and card item - types for credit cards and payment checkout instead. Field order is preserved in - the user-facing collection form, so list fields in the same top-to-bottom order - as the website. + collect, or fill credit card data in credential items. Use wallet, + payment_request and card item types for credit cards and payment checkout + instead. Field order is preserved in the user-facing collection form, so list + fields in the same top-to-bottom order as the website. extra_headers: Send extra headers @@ -3128,9 +3764,14 @@ async def upsert( id_or_name: str, spec: item_upsert_params.WalletVaultItemRequestSpec | CardVaultItemSpecParam + | PaymentRequestVaultItemSpecParam | OnePasswordCredentialAccountSpecParam | CredentialVaultItemSpecInputParam, - type: Literal["wallet"] | Literal["card"] | Literal["credential_account"] | Literal["credential"], + type: Literal["wallet"] + | Literal["card"] + | Literal["payment_request"] + | Literal["credential_account"] + | Literal["credential"], # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/kernel/types/vaults/__init__.py b/src/kernel/types/vaults/__init__.py index 0b6acf2c..439d7d3b 100644 --- a/src/kernel/types/vaults/__init__.py +++ b/src/kernel/types/vaults/__init__.py @@ -27,6 +27,7 @@ from .one_password_oauth_action import OnePasswordOAuthAction as OnePasswordOAuthAction from .card_vault_item_spec_param import CardVaultItemSpecParam as CardVaultItemSpecParam from .credential_vault_item_spec import CredentialVaultItemSpec as CredentialVaultItemSpec +from .payment_request_vault_item import PaymentRequestVaultItem as PaymentRequestVaultItem from .vault_webmcp_binding_param import VaultWebmcpBindingParam as VaultWebmcpBindingParam from .credential_vault_field_type import CredentialVaultFieldType as CredentialVaultFieldType from .credential_vault_item_state import CredentialVaultItemState as CredentialVaultItemState @@ -40,8 +41,10 @@ from .kernel_wallet_vault_item_spec import KernelWalletVaultItemSpec as KernelWalletVaultItemSpec from .vault_item_operation_response import VaultItemOperationResponse as VaultItemOperationResponse from .agentcard_checkout_preparation import AgentcardCheckoutPreparation as AgentcardCheckoutPreparation +from .payment_request_vault_item_spec import PaymentRequestVaultItemSpec as PaymentRequestVaultItemSpec from .agentcard_checkout_authorization import AgentcardCheckoutAuthorization as AgentcardCheckoutAuthorization from .fill_vault_item_operation_result import FillVaultItemOperationResult as FillVaultItemOperationResult +from .payment_request_vault_item_state import PaymentRequestVaultItemState as PaymentRequestVaultItemState from .credential_vault_field_definition import CredentialVaultFieldDefinition as CredentialVaultFieldDefinition from .kernel_card_vault_item_spec_param import KernelCardVaultItemSpecParam as KernelCardVaultItemSpecParam from .kernel_credential_vault_item_spec import KernelCredentialVaultItemSpec as KernelCredentialVaultItemSpec @@ -56,9 +59,13 @@ from .one_password_credential_account_state import ( OnePasswordCredentialAccountState as OnePasswordCredentialAccountState, ) +from .payment_request_vault_item_spec_param import PaymentRequestVaultItemSpecParam as PaymentRequestVaultItemSpecParam from .credential_vault_item_spec_input_param import ( CredentialVaultItemSpecInputParam as CredentialVaultItemSpecInputParam, ) +from .kernel_payment_request_vault_item_spec import ( + KernelPaymentRequestVaultItemSpec as KernelPaymentRequestVaultItemSpec, +) from .credential_vault_item_spec_update_param import ( CredentialVaultItemSpecUpdateParam as CredentialVaultItemSpecUpdateParam, ) @@ -95,6 +102,9 @@ from .authorize_vault_item_operation_request_param import ( AuthorizeVaultItemOperationRequestParam as AuthorizeVaultItemOperationRequestParam, ) +from .kernel_payment_request_vault_item_spec_param import ( + KernelPaymentRequestVaultItemSpecParam as KernelPaymentRequestVaultItemSpecParam, +) from .credential_vault_field_definition_input_param import ( CredentialVaultFieldDefinitionInputParam as CredentialVaultFieldDefinitionInputParam, ) @@ -104,6 +114,9 @@ from .one_password_fill_vault_item_operation_result import ( OnePasswordFillVaultItemOperationResult as OnePasswordFillVaultItemOperationResult, ) +from .add_payment_method_vault_item_operation_result import ( + AddPaymentMethodVaultItemOperationResult as AddPaymentMethodVaultItemOperationResult, +) from .arm_passkey_vault_item_operation_request_param import ( ArmPasskeyVaultItemOperationRequestParam as ArmPasskeyVaultItemOperationRequestParam, ) @@ -113,6 +126,9 @@ from .disarm_passkey_vault_item_operation_request_param import ( DisarmPasskeyVaultItemOperationRequestParam as DisarmPasskeyVaultItemOperationRequestParam, ) +from .remove_payment_method_vault_item_operation_result import ( + RemovePaymentMethodVaultItemOperationResult as RemovePaymentMethodVaultItemOperationResult, +) from .managed_auth_credential_vault_item_spec_input_param import ( ManagedAuthCredentialVaultItemSpecInputParam as ManagedAuthCredentialVaultItemSpecInputParam, ) @@ -128,6 +144,9 @@ from .one_password_fill_vault_item_operation_request_param import ( OnePasswordFillVaultItemOperationRequestParam as OnePasswordFillVaultItemOperationRequestParam, ) +from .add_payment_method_vault_item_operation_request_param import ( + AddPaymentMethodVaultItemOperationRequestParam as AddPaymentMethodVaultItemOperationRequestParam, +) from .confirm_transaction_vault_item_operation_request_param import ( ConfirmTransactionVaultItemOperationRequestParam as ConfirmTransactionVaultItemOperationRequestParam, ) @@ -137,6 +156,9 @@ from .restart_verification_vault_item_operation_request_param import ( RestartVerificationVaultItemOperationRequestParam as RestartVerificationVaultItemOperationRequestParam, ) +from .remove_payment_method_vault_item_operation_request_param import ( + RemovePaymentMethodVaultItemOperationRequestParam as RemovePaymentMethodVaultItemOperationRequestParam, +) from .one_password_request_access_vault_item_operation_request_param import ( OnePasswordRequestAccessVaultItemOperationRequestParam as OnePasswordRequestAccessVaultItemOperationRequestParam, ) diff --git a/src/kernel/types/vaults/add_payment_method_vault_item_operation_request_param.py b/src/kernel/types/vaults/add_payment_method_vault_item_operation_request_param.py new file mode 100644 index 00000000..ad7bde5d --- /dev/null +++ b/src/kernel/types/vaults/add_payment_method_vault_item_operation_request_param.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["AddPaymentMethodVaultItemOperationRequestParam"] + + +class AddPaymentMethodVaultItemOperationRequestParam(TypedDict, total=False): + """ + Start hosted enrollment of a card in a connected Kernel wallet, including its first card, only when the wallet advertises add_payment_method. Returns a new payment method in pending_enrollment with a single-use card_enrollment URL for the cardholder. Card details go directly to the card vault and are never accepted by this API. Each call creates a separate link that expires after 30 minutes; a failed or expired enrollment does not affect the wallet's other payment methods. Scoped API keys require vaults:write in addition to vaults:use on this vault; otherwise the operation returns 403. + """ + + type: Required[Literal["add_payment_method"]] diff --git a/src/kernel/types/vaults/add_payment_method_vault_item_operation_result.py b/src/kernel/types/vaults/add_payment_method_vault_item_operation_result.py new file mode 100644 index 00000000..a858ed3d --- /dev/null +++ b/src/kernel/types/vaults/add_payment_method_vault_item_operation_result.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel +from .vault_payment_method import VaultPaymentMethod + +__all__ = ["AddPaymentMethodVaultItemOperationResult"] + + +class AddPaymentMethodVaultItemOperationResult(BaseModel): + """The payment method created in pending_enrollment. + + Deliver action.url to the cardholder; it is a single-use capability and must not be logged. Observe completion through the wallet's payment_methods expansion. + """ + + payment_method: VaultPaymentMethod + + type: Literal["add_payment_method"] diff --git a/src/kernel/types/vaults/credential_account_vault_item.py b/src/kernel/types/vaults/credential_account_vault_item.py index b2f818f6..f33ee788 100644 --- a/src/kernel/types/vaults/credential_account_vault_item.py +++ b/src/kernel/types/vaults/credential_account_vault_item.py @@ -46,6 +46,8 @@ class AvailableOperation(BaseModel): "1pw_recover", "1pw_update_access_token", "webmcp_invoke", + "add_payment_method", + "remove_payment_method", ] diff --git a/src/kernel/types/vaults/credential_vault_item.py b/src/kernel/types/vaults/credential_vault_item.py index b7da27d3..6b6a1f69 100644 --- a/src/kernel/types/vaults/credential_vault_item.py +++ b/src/kernel/types/vaults/credential_vault_item.py @@ -53,6 +53,8 @@ class AvailableOperation(BaseModel): "1pw_recover", "1pw_update_access_token", "webmcp_invoke", + "add_payment_method", + "remove_payment_method", ] diff --git a/src/kernel/types/vaults/credential_vault_item_request_param.py b/src/kernel/types/vaults/credential_vault_item_request_param.py index 4034d9c5..61337f3b 100644 --- a/src/kernel/types/vaults/credential_vault_item_request_param.py +++ b/src/kernel/types/vaults/credential_vault_item_request_param.py @@ -17,7 +17,7 @@ class CredentialVaultItemRequestParam(TypedDict, total=False): or that path fails, collect a Kernel-hosted credential item instead. Never automatically retry an uncertain 1Password request. After an uncertain fill, inspect the page to see the result of the fill. - Do not use credential items for credit card data. Use wallet and card item types instead. + Do not use credential items for credit card data. Use wallet, payment_request and card item types instead. Kernel credentials declare fields and may enter pending_collection. 1Password credentials either reference a connected credential_account or store a supplied access token and integration key encrypted on the item. @@ -32,10 +32,10 @@ class CredentialVaultItemRequestParam(TypedDict, total=False): spec: Required[CredentialVaultItemSpecInputParam] """Credential fields are for login and other non-payment credentials. - Do not store, collect, or fill credit card data in credential items. Use wallet - and card item types for credit cards and payment checkout instead. Field order - is preserved in the user-facing collection form, so list fields in the same - top-to-bottom order as the website. + Do not store, collect, or fill credit card data in credential items. Use wallet, + payment_request and card item types for credit cards and payment checkout + instead. Field order is preserved in the user-facing collection form, so list + fields in the same top-to-bottom order as the website. """ type: Required[Literal["credential"]] diff --git a/src/kernel/types/vaults/item_perform_operation_params.py b/src/kernel/types/vaults/item_perform_operation_params.py index 83729ceb..60fe34c5 100644 --- a/src/kernel/types/vaults/item_perform_operation_params.py +++ b/src/kernel/types/vaults/item_perform_operation_params.py @@ -29,6 +29,8 @@ "OnePasswordRecoverVaultItemOperationRequest", "OnePasswordUpdateAccessTokenVaultItemOperationRequest", "WebmcpInvokeVaultItemOperationRequest", + "AddPaymentMethodVaultItemOperationRequest", + "RemovePaymentMethodVaultItemOperationRequest", ] @@ -269,6 +271,21 @@ class WebmcpInvokeVaultItemOperationRequest(TypedDict, total=False): """ +class AddPaymentMethodVaultItemOperationRequest(TypedDict, total=False): + id_or_name: Required[str] + + type: Required[Literal["add_payment_method"]] + + +class RemovePaymentMethodVaultItemOperationRequest(TypedDict, total=False): + id_or_name: Required[str] + + payment_method_id: Required[str] + """ID from the wallet's payment_methods expansion.""" + + type: Required[Literal["remove_payment_method"]] + + ItemPerformOperationParams: TypeAlias = Union[ AuthorizeVaultItemOperationRequest, RestartVerificationVaultItemOperationRequest, @@ -285,4 +302,6 @@ class WebmcpInvokeVaultItemOperationRequest(TypedDict, total=False): OnePasswordRecoverVaultItemOperationRequest, OnePasswordUpdateAccessTokenVaultItemOperationRequest, WebmcpInvokeVaultItemOperationRequest, + AddPaymentMethodVaultItemOperationRequest, + RemovePaymentMethodVaultItemOperationRequest, ] diff --git a/src/kernel/types/vaults/item_update_params.py b/src/kernel/types/vaults/item_update_params.py index 33e3ad08..6a8b4e7a 100644 --- a/src/kernel/types/vaults/item_update_params.py +++ b/src/kernel/types/vaults/item_update_params.py @@ -6,9 +6,15 @@ from typing_extensions import Literal, Required, TypeAlias, TypedDict from .card_vault_item_spec_param import CardVaultItemSpecParam +from .payment_request_vault_item_spec_param import PaymentRequestVaultItemSpecParam from .credential_vault_item_spec_update_param import CredentialVaultItemSpecUpdateParam -__all__ = ["ItemUpdateParams", "CardVaultItemUpdateRequest", "CredentialVaultItemUpdateRequest"] +__all__ = [ + "ItemUpdateParams", + "CardVaultItemUpdateRequest", + "PaymentRequestVaultItemUpdateRequest", + "CredentialVaultItemUpdateRequest", +] class CardVaultItemUpdateRequest(TypedDict, total=False): @@ -27,6 +33,22 @@ class CardVaultItemUpdateRequest(TypedDict, total=False): type: Literal["card"] +class PaymentRequestVaultItemUpdateRequest(TypedDict, total=False): + id_or_name: Required[str] + + spec: Required[PaymentRequestVaultItemSpecParam] + """Live Link card request. + + Test-mode card creation is not supported. The spec can be changed with PATCH + until the card is authorized at a checkout. Authorize it with the browser at + final checkout: Kernel inspects the checkout through WebMCP and internally + chooses a merchant-bound Link Pay Token when supported or a virtual card + otherwise. Callers never receive or choose how the credential is delivered. + """ + + type: Required[Literal["payment_request"]] + + class CredentialVaultItemUpdateRequest(TypedDict, total=False): id_or_name: Required[str] @@ -46,4 +68,6 @@ class CredentialVaultItemUpdateRequest(TypedDict, total=False): """ -ItemUpdateParams: TypeAlias = Union[CardVaultItemUpdateRequest, CredentialVaultItemUpdateRequest] +ItemUpdateParams: TypeAlias = Union[ + CardVaultItemUpdateRequest, PaymentRequestVaultItemUpdateRequest, CredentialVaultItemUpdateRequest +] diff --git a/src/kernel/types/vaults/item_upsert_params.py b/src/kernel/types/vaults/item_upsert_params.py index 04bd3f11..1930e04e 100644 --- a/src/kernel/types/vaults/item_upsert_params.py +++ b/src/kernel/types/vaults/item_upsert_params.py @@ -7,6 +7,7 @@ from .card_vault_item_spec_param import CardVaultItemSpecParam from .kernel_wallet_vault_item_spec_param import KernelWalletVaultItemSpecParam +from .payment_request_vault_item_spec_param import PaymentRequestVaultItemSpecParam from .credential_vault_item_spec_input_param import CredentialVaultItemSpecInputParam from .one_password_credential_account_spec_param import OnePasswordCredentialAccountSpecParam @@ -25,6 +26,7 @@ "WalletVaultItemRequestSpecAgentCardWalletVaultItemSpec", "WalletVaultItemRequestSpecAgentCardWalletVaultItemSpecProviderConfig", "CardVaultItemRequest", + "PaymentRequestVaultItemRequest", "CredentialAccountVaultItemRequest", "CredentialVaultItemRequest", ] @@ -207,6 +209,22 @@ class CardVaultItemRequest(TypedDict, total=False): type: Required[Literal["card"]] +class PaymentRequestVaultItemRequest(TypedDict, total=False): + id_or_name: Required[str] + + spec: Required[PaymentRequestVaultItemSpecParam] + """Live Link card request. + + Test-mode card creation is not supported. The spec can be changed with PATCH + until the card is authorized at a checkout. Authorize it with the browser at + final checkout: Kernel inspects the checkout through WebMCP and internally + chooses a merchant-bound Link Pay Token when supported or a virtual card + otherwise. Callers never receive or choose how the credential is delivered. + """ + + type: Required[Literal["payment_request"]] + + class CredentialAccountVaultItemRequest(TypedDict, total=False): id_or_name: Required[str] @@ -221,15 +239,19 @@ class CredentialVaultItemRequest(TypedDict, total=False): spec: Required[CredentialVaultItemSpecInputParam] """Credential fields are for login and other non-payment credentials. - Do not store, collect, or fill credit card data in credential items. Use wallet - and card item types for credit cards and payment checkout instead. Field order - is preserved in the user-facing collection form, so list fields in the same - top-to-bottom order as the website. + Do not store, collect, or fill credit card data in credential items. Use wallet, + payment_request and card item types for credit cards and payment checkout + instead. Field order is preserved in the user-facing collection form, so list + fields in the same top-to-bottom order as the website. """ type: Required[Literal["credential"]] ItemUpsertParams: TypeAlias = Union[ - WalletVaultItemRequest, CardVaultItemRequest, CredentialAccountVaultItemRequest, CredentialVaultItemRequest + WalletVaultItemRequest, + CardVaultItemRequest, + PaymentRequestVaultItemRequest, + CredentialAccountVaultItemRequest, + CredentialVaultItemRequest, ] diff --git a/src/kernel/types/vaults/kernel_card_state.py b/src/kernel/types/vaults/kernel_card_state.py index e4732f2a..0838182c 100644 --- a/src/kernel/types/vaults/kernel_card_state.py +++ b/src/kernel/types/vaults/kernel_card_state.py @@ -68,6 +68,23 @@ class KernelCardState(BaseModel): Fill is locked to merchant_url's exact origin. """ + funding_status: Optional[Literal["available", "unavailable", "removed"]] = None + """Whether payment_method_id can still fund this purchase. + + unavailable means the method is being removed or awaits recovery, so + authorization, fill and confirmation are refused until it recovers. removed + means the method was removed from its wallet, so this purchase can no longer be + paid; create a new purchase with another method. Neither changes status, which + still reports what already happened to this purchase. + """ + masks: Optional[Masks] = None + payment_method_id: Optional[str] = None + """Wallet-scoped ID of the payment method funding this purchase. + + It is bound when the purchase is created and never changes; purchases created + before payment methods could be selected report the wallet's default card, card. + """ + status_reason: Optional[str] = None diff --git a/src/kernel/types/vaults/kernel_card_vault_item_spec.py b/src/kernel/types/vaults/kernel_card_vault_item_spec.py index d6c2c93c..525321d6 100644 --- a/src/kernel/types/vaults/kernel_card_vault_item_spec.py +++ b/src/kernel/types/vaults/kernel_card_vault_item_spec.py @@ -52,3 +52,12 @@ class KernelCardVaultItemSpec(BaseModel): Required for Visa cards, whose one-time code is issued for the merchant's country. """ + + payment_method_id: Optional[str] = None + """Wallet-scoped payment method ID from the wallet's payment_methods expansion. + + Omission selects the wallet's default card, ID card, for compatibility with + existing requests; it never falls back to another method, and a wallet without a + default card requires the ID. The purchase is bound to the method's enrolled + card and network token, so later operations cannot switch funding. + """ diff --git a/src/kernel/types/vaults/kernel_card_vault_item_spec_param.py b/src/kernel/types/vaults/kernel_card_vault_item_spec_param.py index e836f734..a540a547 100644 --- a/src/kernel/types/vaults/kernel_card_vault_item_spec_param.py +++ b/src/kernel/types/vaults/kernel_card_vault_item_spec_param.py @@ -51,3 +51,12 @@ class KernelCardVaultItemSpecParam(TypedDict, total=False): Required for Visa cards, whose one-time code is issued for the merchant's country. """ + + payment_method_id: str + """Wallet-scoped payment method ID from the wallet's payment_methods expansion. + + Omission selects the wallet's default card, ID card, for compatibility with + existing requests; it never falls back to another method, and a wallet without a + default card requires the ID. The purchase is bound to the method's enrolled + card and network token, so later operations cannot switch funding. + """ diff --git a/src/kernel/types/vaults/kernel_credential_vault_item_spec_input_param.py b/src/kernel/types/vaults/kernel_credential_vault_item_spec_input_param.py index d8ae9257..653eec3c 100644 --- a/src/kernel/types/vaults/kernel_credential_vault_item_spec_input_param.py +++ b/src/kernel/types/vaults/kernel_credential_vault_item_spec_input_param.py @@ -13,7 +13,7 @@ class KernelCredentialVaultItemSpecInputParam(TypedDict, total=False): """Credential fields are for login and other non-payment credentials. - Do not store, collect, or fill credit card data in credential items. Use wallet and card item types for credit cards and payment checkout instead. Field order is preserved in the user-facing collection form, so list fields in the same top-to-bottom order as the website. + Do not store, collect, or fill credit card data in credential items. Use wallet, payment_request and card item types for credit cards and payment checkout instead. Field order is preserved in the user-facing collection form, so list fields in the same top-to-bottom order as the website. """ fields: Required[Iterable[CredentialVaultFieldInputParam]] diff --git a/src/kernel/types/vaults/kernel_payment_request_vault_item_spec.py b/src/kernel/types/vaults/kernel_payment_request_vault_item_spec.py new file mode 100644 index 00000000..c9657a0a --- /dev/null +++ b/src/kernel/types/vaults/kernel_payment_request_vault_item_spec.py @@ -0,0 +1,56 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["KernelPaymentRequestVaultItemSpec"] + + +class KernelPaymentRequestVaultItemSpec(BaseModel): + """ + One live purchase funded by the Kernel wallet payment method named by payment_method_id. The method must be active and eligible when the request is created. The purchase is bound to that method; later operations cannot switch funding, and removing the method makes the purchase unusable rather than moving it to another card. Approval, issuance, fill and the alias fallback behave as described for KernelCardVaultItemSpec. + """ + + amount: int + """ + Integer amount in minor currency units (at most 1000000), bound to the one-time + code. + """ + + currency: str + """ISO 4217 code. + + Supported: aud, brl, cad, chf, czk, dkk, eur, gbp, hkd, inr, jpy, krw, mxn, nok, + nzd, pln, sek, sgd, usd, zar. + """ + + merchant_name: str + + merchant_url: str + """Merchant checkout URL. Fill is allowed only on this URL's origin.""" + + payment_method_id: str + """Payment method ID from the wallet's payment_methods expansion.""" + + provider: Literal["kernel"] + + wallet: str + """Key of the Kernel wallet item that owns the payment method.""" + + merchant_category: Optional[str] = None + """Actual merchant category when known. Omit rather than invent a category.""" + + merchant_category_code: Optional[str] = None + """Actual merchant MCC when known. + + Omit rather than invent a code. 0000 is not accepted. + """ + + merchant_country: Optional[str] = None + """The merchant's ISO 3166-1 alpha-2 country code. + + Required for Visa cards, whose one-time code is issued for the merchant's + country. + """ diff --git a/src/kernel/types/vaults/kernel_payment_request_vault_item_spec_param.py b/src/kernel/types/vaults/kernel_payment_request_vault_item_spec_param.py new file mode 100644 index 00000000..87cbaeb0 --- /dev/null +++ b/src/kernel/types/vaults/kernel_payment_request_vault_item_spec_param.py @@ -0,0 +1,55 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["KernelPaymentRequestVaultItemSpecParam"] + + +class KernelPaymentRequestVaultItemSpecParam(TypedDict, total=False): + """ + One live purchase funded by the Kernel wallet payment method named by payment_method_id. The method must be active and eligible when the request is created. The purchase is bound to that method; later operations cannot switch funding, and removing the method makes the purchase unusable rather than moving it to another card. Approval, issuance, fill and the alias fallback behave as described for KernelCardVaultItemSpec. + """ + + amount: Required[int] + """ + Integer amount in minor currency units (at most 1000000), bound to the one-time + code. + """ + + currency: Required[str] + """ISO 4217 code. + + Supported: aud, brl, cad, chf, czk, dkk, eur, gbp, hkd, inr, jpy, krw, mxn, nok, + nzd, pln, sek, sgd, usd, zar. + """ + + merchant_name: Required[str] + + merchant_url: Required[str] + """Merchant checkout URL. Fill is allowed only on this URL's origin.""" + + payment_method_id: Required[str] + """Payment method ID from the wallet's payment_methods expansion.""" + + provider: Required[Literal["kernel"]] + + wallet: Required[str] + """Key of the Kernel wallet item that owns the payment method.""" + + merchant_category: str + """Actual merchant category when known. Omit rather than invent a category.""" + + merchant_category_code: str + """Actual merchant MCC when known. + + Omit rather than invent a code. 0000 is not accepted. + """ + + merchant_country: str + """The merchant's ISO 3166-1 alpha-2 country code. + + Required for Visa cards, whose one-time code is issued for the merchant's + country. + """ diff --git a/src/kernel/types/vaults/kernel_wallet_state.py b/src/kernel/types/vaults/kernel_wallet_state.py index a35239d7..0953b867 100644 --- a/src/kernel/types/vaults/kernel_wallet_state.py +++ b/src/kernel/types/vaults/kernel_wallet_state.py @@ -12,13 +12,20 @@ class KernelWalletState(BaseModel): provider: Literal["kernel"] status: Literal["pending_authorization", "connected", "reconnect_required", "degraded"] - """pending_authorization asks the cardholder to use the card_enrollment action. - - connected means the card is stored; it can pay once payment_methods reports - capabilities.single_use_card.eligible. reconnect_required asks the cardholder to - use a new card_enrollment action after an uncertain enrollment was safely - removed. degraded means the enrollment outcome is unknown and the wallet must be - deleted before adding another card. + """connected means the wallet is usable. + + It holds zero or more cards as payment methods, listed by the payment_methods + expansion, and each can pay once it reports + capabilities.single_use_card.eligible. A wallet with no cards, before its first + card or after its last is removed, is still connected. Where the wallet + advertises add_payment_method and remove_payment_method, use them to manage + cards. Otherwise the wallet enrolls one default card when created; until that + card is enrolled the wallet reports pending_authorization with the card's + card_enrollment action, or degraded when the card's enrollment outcome is + unknown and the wallet must be deleted before adding another card. + reconnect_required appears only on a wallet created before cards were payment + methods and not yet upgraded. Reads preserve its stored state until the operator + upgrade; payment and deletion requests are refused until then. """ status_reason: Optional[str] = None diff --git a/src/kernel/types/vaults/kernel_wallet_vault_item_spec.py b/src/kernel/types/vaults/kernel_wallet_vault_item_spec.py index fb2f039e..3cbd225c 100644 --- a/src/kernel/types/vaults/kernel_wallet_vault_item_spec.py +++ b/src/kernel/types/vaults/kernel_wallet_vault_item_spec.py @@ -8,9 +8,8 @@ class KernelWalletVaultItemSpec(BaseModel): - """One card stored with Kernel-managed credentials. - - Creation returns a card_enrollment action: the cardholder enters the card and their email on a Kernel-hosted page, and the wallet connects once the card is stored. Kernel then enrolls it for an agentic network token when the issuer supports it. The card number never reaches Kernel. The connected wallet's payment_methods expansion lists the card; capabilities.single_use_card.eligible is false, with a network_token_* reason, until the card has a network token, and authorize returns 400 for such a card unless Kernel supports checkout delivery without a network token for that card. In that case, fill types the checkout details. Visa purchases require the cardholder to complete a spend_approval action before Kernel issues a one-time code; Mastercard purchases need no hosted approval. + """ + Cards stored with Kernel-managed credentials, each a payment method of the wallet. Each card is enrolled through a card_enrollment action: the cardholder enters the card and their email on a Kernel-hosted page. Where the wallet advertises add_payment_method, creation returns an empty connected wallet and each card is enrolled with that operation. Otherwise creation returns the wallet's default card's card_enrollment action, and the wallet connects once that card is stored. Kernel then enrolls each card for an agentic network token when the issuer supports it. The card number never reaches Kernel. The connected wallet's payment_methods expansion lists the cards; capabilities.single_use_card.eligible is false, with a network_token_* reason, until the card has a network token, and authorize returns 400 for such a card unless Kernel supports checkout delivery without a network token for that card. In that case, fill types the checkout details. Visa purchases require the cardholder to complete a spend_approval action before Kernel issues a one-time code; Mastercard purchases need no hosted approval. """ provider: Literal["kernel"] diff --git a/src/kernel/types/vaults/kernel_wallet_vault_item_spec_param.py b/src/kernel/types/vaults/kernel_wallet_vault_item_spec_param.py index b0e87117..e560f119 100644 --- a/src/kernel/types/vaults/kernel_wallet_vault_item_spec_param.py +++ b/src/kernel/types/vaults/kernel_wallet_vault_item_spec_param.py @@ -8,9 +8,8 @@ class KernelWalletVaultItemSpecParam(TypedDict, total=False): - """One card stored with Kernel-managed credentials. - - Creation returns a card_enrollment action: the cardholder enters the card and their email on a Kernel-hosted page, and the wallet connects once the card is stored. Kernel then enrolls it for an agentic network token when the issuer supports it. The card number never reaches Kernel. The connected wallet's payment_methods expansion lists the card; capabilities.single_use_card.eligible is false, with a network_token_* reason, until the card has a network token, and authorize returns 400 for such a card unless Kernel supports checkout delivery without a network token for that card. In that case, fill types the checkout details. Visa purchases require the cardholder to complete a spend_approval action before Kernel issues a one-time code; Mastercard purchases need no hosted approval. + """ + Cards stored with Kernel-managed credentials, each a payment method of the wallet. Each card is enrolled through a card_enrollment action: the cardholder enters the card and their email on a Kernel-hosted page. Where the wallet advertises add_payment_method, creation returns an empty connected wallet and each card is enrolled with that operation. Otherwise creation returns the wallet's default card's card_enrollment action, and the wallet connects once that card is stored. Kernel then enrolls each card for an agentic network token when the issuer supports it. The card number never reaches Kernel. The connected wallet's payment_methods expansion lists the cards; capabilities.single_use_card.eligible is false, with a network_token_* reason, until the card has a network token, and authorize returns 400 for such a card unless Kernel supports checkout delivery without a network token for that card. In that case, fill types the checkout details. Visa purchases require the cardholder to complete a spend_approval action before Kernel issues a one-time code; Mastercard purchases need no hosted approval. """ provider: Required[Literal["kernel"]] diff --git a/src/kernel/types/vaults/payment_request_vault_item.py b/src/kernel/types/vaults/payment_request_vault_item.py new file mode 100644 index 00000000..48ef3809 --- /dev/null +++ b/src/kernel/types/vaults/payment_request_vault_item.py @@ -0,0 +1,93 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal + +from ..._models import BaseModel +from .vault_item_action import VaultItemAction +from .payment_request_vault_item_spec import PaymentRequestVaultItemSpec +from .payment_request_vault_item_state import PaymentRequestVaultItemState + +__all__ = ["PaymentRequestVaultItem", "AvailableExpansion", "AvailableOperation"] + + +class AvailableExpansion(BaseModel): + """ + Live data that can currently be requested by passing its type to the item GET expand parameter. + """ + + description: str + + type: Literal["payment_methods", "link_user_info", "link_shipping_addresses"] + + +class AvailableOperation(BaseModel): + """An operation that is currently valid for this item. + + Read the description before invoking it through the item operations endpoint. + """ + + description: str + + type: Literal[ + "authorize", + "restart_verification", + "confirm_transaction", + "collect", + "prepare_checkout", + "fill", + "arm_passkey", + "register_passkey", + "disarm_passkey", + "1pw_create_access_request", + "1pw_access_request_status", + "1pw_fill", + "1pw_recover", + "1pw_update_access_token", + "webmcp_invoke", + "add_payment_method", + "remove_payment_method", + ] + + +class PaymentRequestVaultItem(BaseModel): + """One purchase from a Link or Kernel wallet, parented by that wallet. + + It has the same lifecycle, operations and fill behavior as a Link or Kernel card item. AgentCard reusable cards remain card items. + """ + + id: str + + available_expansions: List[AvailableExpansion] + + available_operations: List[AvailableOperation] + + created_at: datetime + + key: str + """Immutable item key assigned when the item is created.""" + + spec: PaymentRequestVaultItemSpec + """Live Link card request. + + Test-mode card creation is not supported. The spec can be changed with PATCH + until the card is authorized at a checkout. Authorize it with the browser at + final checkout: Kernel inspects the checkout through WebMCP and internally + chooses a merchant-bound Link Pay Token when supported or a virtual card + otherwise. Callers never receive or choose how the credential is delivered. + """ + + state: PaymentRequestVaultItemState + """Issued Link cards retain encrypted card material for the fill operation. + + Link cards do not expose aliases or support egress substitution. + """ + + type: Literal["payment_request"] + + updated_at: datetime + + action: Optional[VaultItemAction] = None + + expires_at: Optional[datetime] = None diff --git a/src/kernel/types/vaults/payment_request_vault_item_spec.py b/src/kernel/types/vaults/payment_request_vault_item_spec.py new file mode 100644 index 00000000..a06517ad --- /dev/null +++ b/src/kernel/types/vaults/payment_request_vault_item_spec.py @@ -0,0 +1,125 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Dict, List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ..._utils import PropertyInfo +from ..._models import BaseModel +from .kernel_payment_request_vault_item_spec import KernelPaymentRequestVaultItemSpec + +__all__ = [ + "PaymentRequestVaultItemSpec", + "LinkCardVaultItemSpec", + "LinkCardVaultItemSpecLineItem", + "LinkCardVaultItemSpecLineItemTotal", + "LinkCardVaultItemSpecRecurring", + "LinkCardVaultItemSpecTotal", +] + + +class LinkCardVaultItemSpecLineItemTotal(BaseModel): + amount: int + """Total amount in minor currency units.""" + + display_text: str + + type: str + + +class LinkCardVaultItemSpecLineItem(BaseModel): + name: str + + description: Optional[str] = None + + image_url: Optional[str] = None + + product_url: Optional[str] = None + + quantity: Optional[int] = None + + sku: Optional[str] = None + + totals: Optional[List[LinkCardVaultItemSpecLineItemTotal]] = None + + unit_amount: Optional[int] = None + """Unit amount in minor currency units.""" + + url: Optional[str] = None + + +class LinkCardVaultItemSpecRecurring(BaseModel): + """Recurring terms for a subscription or other repeated purchase. + + 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. + """ + + interval: Literal["day", "week", "month", "year"] + + interval_count: Optional[int] = None + """Number of intervals per period. Link defaults it to 1.""" + + +class LinkCardVaultItemSpecTotal(BaseModel): + amount: int + """Total amount in minor currency units.""" + + display_text: str + + type: str + + +class LinkCardVaultItemSpec(BaseModel): + """Live Link card request. + + Test-mode card creation is not supported. The spec can be changed with PATCH until the card is authorized at a checkout. Authorize it with the browser at final checkout: Kernel inspects the checkout through WebMCP and internally chooses a merchant-bound Link Pay Token when supported or a virtual card otherwise. Callers never receive or choose how the credential is delivered. + """ + + amount: int + """Integer amount in minor currency units, at most 50000. + + With recurring, the spending limit per period, not a lifetime total. + """ + + context: str + + currency: str + + merchant_name: str + + merchant_url: str + + payment_method_id: str + """Payment-method ID returned by the referenced wallet's payment-method listing. + + The provider decides whether the selected funding method can satisfy the card + request. + """ + + provider: Literal["link"] + + wallet: str + """Connected Link wallet item key.""" + + line_items: Optional[List[LinkCardVaultItemSpecLineItem]] = None + + metadata: Optional[Dict[str, str]] = None + + recurring: Optional[LinkCardVaultItemSpecRecurring] = None + """Recurring terms for a subscription or other repeated purchase. + + 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. + """ + + totals: Optional[List[LinkCardVaultItemSpecTotal]] = None + + +PaymentRequestVaultItemSpec: TypeAlias = Annotated[ + Union[LinkCardVaultItemSpec, KernelPaymentRequestVaultItemSpec], PropertyInfo(discriminator="provider") +] diff --git a/src/kernel/types/vaults/payment_request_vault_item_spec_param.py b/src/kernel/types/vaults/payment_request_vault_item_spec_param.py new file mode 100644 index 00000000..9fa58699 --- /dev/null +++ b/src/kernel/types/vaults/payment_request_vault_item_spec_param.py @@ -0,0 +1,123 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Dict, Union, Iterable +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from .kernel_payment_request_vault_item_spec_param import KernelPaymentRequestVaultItemSpecParam + +__all__ = [ + "PaymentRequestVaultItemSpecParam", + "LinkCardVaultItemSpec", + "LinkCardVaultItemSpecLineItem", + "LinkCardVaultItemSpecLineItemTotal", + "LinkCardVaultItemSpecRecurring", + "LinkCardVaultItemSpecTotal", +] + + +class LinkCardVaultItemSpecLineItemTotal(TypedDict, total=False): + amount: Required[int] + """Total amount in minor currency units.""" + + display_text: Required[str] + + type: Required[str] + + +class LinkCardVaultItemSpecLineItem(TypedDict, total=False): + name: Required[str] + + description: str + + image_url: str + + product_url: str + + quantity: int + + sku: str + + totals: Iterable[LinkCardVaultItemSpecLineItemTotal] + + unit_amount: int + """Unit amount in minor currency units.""" + + url: str + + +class LinkCardVaultItemSpecRecurring(TypedDict, total=False): + """Recurring terms for a subscription or other repeated purchase. + + 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. + """ + + interval: Required[Literal["day", "week", "month", "year"]] + + interval_count: int + """Number of intervals per period. Link defaults it to 1.""" + + +class LinkCardVaultItemSpecTotal(TypedDict, total=False): + amount: Required[int] + """Total amount in minor currency units.""" + + display_text: Required[str] + + type: Required[str] + + +class LinkCardVaultItemSpec(TypedDict, total=False): + """Live Link card request. + + Test-mode card creation is not supported. The spec can be changed with PATCH until the card is authorized at a checkout. Authorize it with the browser at final checkout: Kernel inspects the checkout through WebMCP and internally chooses a merchant-bound Link Pay Token when supported or a virtual card otherwise. Callers never receive or choose how the credential is delivered. + """ + + amount: Required[int] + """Integer amount in minor currency units, at most 50000. + + With recurring, the spending limit per period, not a lifetime total. + """ + + context: Required[str] + + currency: Required[str] + + merchant_name: Required[str] + + merchant_url: Required[str] + + payment_method_id: Required[str] + """Payment-method ID returned by the referenced wallet's payment-method listing. + + The provider decides whether the selected funding method can satisfy the card + request. + """ + + provider: Required[Literal["link"]] + + wallet: Required[str] + """Connected Link wallet item key.""" + + line_items: Iterable[LinkCardVaultItemSpecLineItem] + + metadata: Dict[str, str] + + recurring: LinkCardVaultItemSpecRecurring + """Recurring terms for a subscription or other repeated purchase. + + 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. + """ + + totals: Iterable[LinkCardVaultItemSpecTotal] + + +PaymentRequestVaultItemSpecParam: TypeAlias = Union[LinkCardVaultItemSpec, KernelPaymentRequestVaultItemSpecParam] diff --git a/src/kernel/types/vaults/payment_request_vault_item_state.py b/src/kernel/types/vaults/payment_request_vault_item_state.py new file mode 100644 index 00000000..016a547b --- /dev/null +++ b/src/kernel/types/vaults/payment_request_vault_item_state.py @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import TYPE_CHECKING, Dict, List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from pydantic import Field as FieldInfo + +from ..._utils import PropertyInfo +from ..._models import BaseModel +from .kernel_card_state import KernelCardState + +__all__ = ["PaymentRequestVaultItemState", "LinkCardState", "LinkCardStateMasks"] + + +class LinkCardStateMasks(BaseModel): + brand: Optional[str] = None + + last4: Optional[str] = None + + token_last4: Optional[str] = None + """Last four digits of the network token presented to the merchant.""" + + if TYPE_CHECKING: + # Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a + # value to this field, so for compatibility we avoid doing it at runtime. + __pydantic_extra__: Dict[str, str] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride] + + # Stub to indicate that arbitrary properties are accepted. + # To access properties that are not valid identifiers you can use `getattr`, e.g. + # `getattr(obj, '$type')` + def __getattr__(self, attr: str) -> str: ... + else: + __pydantic_extra__: Dict[str, str] + + +class LinkCardState(BaseModel): + """Issued Link cards retain encrypted card material for the fill operation. + + Link cards do not expose aliases or support egress substitution. + """ + + provider: Literal["link"] + + status: Literal[ + "requested", "pending_authorization", "ready", "consumed", "expired", "declined", "recovery_required" + ] + """ + recovery_required means an original provider operation has an unresolved outcome + and the card cannot be used. Reads keep observing a known provider request and + may clear the recovery. To continue, delete this card and create a new one; + deleting cancels the original request when its ID is known and keeps the + recovery evidence. The user may see an approval request for the original card + and should approve only the new one. + """ + + domains: Optional[List[str]] = None + + masks: Optional[LinkCardStateMasks] = None + + status_reason: Optional[str] = None + + +PaymentRequestVaultItemState: TypeAlias = Annotated[ + Union[LinkCardState, KernelCardState], PropertyInfo(discriminator="provider") +] diff --git a/src/kernel/types/vaults/remove_payment_method_vault_item_operation_request_param.py b/src/kernel/types/vaults/remove_payment_method_vault_item_operation_request_param.py new file mode 100644 index 00000000..66cdf81e --- /dev/null +++ b/src/kernel/types/vaults/remove_payment_method_vault_item_operation_request_param.py @@ -0,0 +1,18 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["RemovePaymentMethodVaultItemOperationRequestParam"] + + +class RemovePaymentMethodVaultItemOperationRequestParam(TypedDict, total=False): + """ + Remove one payment method from a Kernel wallet, only when the wallet advertises remove_payment_method. Removal deletes the stored card and blocks new purchases, fills and confirmations funded by it without affecting the wallet's other payment methods; the wallet stays connected even with no payment methods left. A purchase funded by the method with an unresolved outcome blocks removal with 409 purchase_unresolved. If the provider outcome is uncertain the method stays in removal_pending and keeps refusing payments; retry the removal later. Removal is not proof that a payment did not occur. Scoped API keys require vaults:write in addition to vaults:use on this vault; otherwise the operation returns 403. + """ + + payment_method_id: Required[str] + """ID from the wallet's payment_methods expansion.""" + + type: Required[Literal["remove_payment_method"]] diff --git a/src/kernel/types/vaults/remove_payment_method_vault_item_operation_result.py b/src/kernel/types/vaults/remove_payment_method_vault_item_operation_result.py new file mode 100644 index 00000000..0ee0040b --- /dev/null +++ b/src/kernel/types/vaults/remove_payment_method_vault_item_operation_result.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ..._models import BaseModel + +__all__ = ["RemovePaymentMethodVaultItemOperationResult"] + + +class RemovePaymentMethodVaultItemOperationResult(BaseModel): + payment_method_id: str + + status: Literal["removed"] + + type: Literal["remove_payment_method"] diff --git a/src/kernel/types/vaults/vault_item.py b/src/kernel/types/vaults/vault_item.py index 165165fa..f91ece5e 100644 --- a/src/kernel/types/vaults/vault_item.py +++ b/src/kernel/types/vaults/vault_item.py @@ -15,6 +15,7 @@ from .link_shipping_address import LinkShippingAddress from .wallet_vault_item_spec import WalletVaultItemSpec from .wallet_vault_item_state import WalletVaultItemState +from .payment_request_vault_item import PaymentRequestVaultItem from .credential_account_vault_item import CredentialAccountVaultItem __all__ = [ @@ -63,6 +64,8 @@ class WalletVaultItemAvailableOperation(BaseModel): "1pw_recover", "1pw_update_access_token", "webmcp_invoke", + "add_payment_method", + "remove_payment_method", ] @@ -168,6 +171,8 @@ class CardVaultItemAvailableOperation(BaseModel): "1pw_recover", "1pw_update_access_token", "webmcp_invoke", + "add_payment_method", + "remove_payment_method", ] @@ -209,6 +214,6 @@ class CardVaultItem(BaseModel): VaultItem: TypeAlias = Annotated[ - Union[WalletVaultItem, CardVaultItem, CredentialAccountVaultItem, CredentialVaultItem], + Union[WalletVaultItem, CardVaultItem, PaymentRequestVaultItem, CredentialAccountVaultItem, CredentialVaultItem], PropertyInfo(discriminator="type"), ] diff --git a/src/kernel/types/vaults/vault_item_operation_response.py b/src/kernel/types/vaults/vault_item_operation_response.py index dc8c4134..023cc83c 100644 --- a/src/kernel/types/vaults/vault_item_operation_response.py +++ b/src/kernel/types/vaults/vault_item_operation_response.py @@ -14,11 +14,14 @@ from .link_shipping_address import LinkShippingAddress from .wallet_vault_item_spec import WalletVaultItemSpec from .wallet_vault_item_state import WalletVaultItemState +from .payment_request_vault_item import PaymentRequestVaultItem from .credential_account_vault_item import CredentialAccountVaultItem from .fill_vault_item_operation_result import FillVaultItemOperationResult from .passkey_vault_item_operation_result import PasskeyVaultItemOperationResult from .webmcp_invoke_vault_item_operation_result import WebmcpInvokeVaultItemOperationResult from .one_password_fill_vault_item_operation_result import OnePasswordFillVaultItemOperationResult +from .add_payment_method_vault_item_operation_result import AddPaymentMethodVaultItemOperationResult +from .remove_payment_method_vault_item_operation_result import RemovePaymentMethodVaultItemOperationResult __all__ = [ "VaultItemOperationResponse", @@ -66,6 +69,8 @@ class WalletVaultItemAvailableOperation(BaseModel): "1pw_recover", "1pw_update_access_token", "webmcp_invoke", + "add_payment_method", + "remove_payment_method", ] @@ -171,6 +176,8 @@ class CardVaultItemAvailableOperation(BaseModel): "1pw_recover", "1pw_update_access_token", "webmcp_invoke", + "add_payment_method", + "remove_payment_method", ] @@ -214,10 +221,13 @@ class CardVaultItem(BaseModel): VaultItemOperationResponse: TypeAlias = Union[ WalletVaultItem, CardVaultItem, + PaymentRequestVaultItem, CredentialAccountVaultItem, CredentialVaultItem, FillVaultItemOperationResult, PasskeyVaultItemOperationResult, OnePasswordFillVaultItemOperationResult, WebmcpInvokeVaultItemOperationResult, + AddPaymentMethodVaultItemOperationResult, + RemovePaymentMethodVaultItemOperationResult, ] diff --git a/src/kernel/types/vaults/vault_payment_method.py b/src/kernel/types/vaults/vault_payment_method.py index 27f87ad1..6b0d6dc1 100644 --- a/src/kernel/types/vaults/vault_payment_method.py +++ b/src/kernel/types/vaults/vault_payment_method.py @@ -1,10 +1,12 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional +from datetime import datetime +from typing_extensions import Literal from ..._models import BaseModel -__all__ = ["VaultPaymentMethod", "Capabilities", "CapabilitiesSingleUseCard", "Display"] +__all__ = ["VaultPaymentMethod", "Capabilities", "CapabilitiesSingleUseCard", "Display", "Action"] class CapabilitiesSingleUseCard(BaseModel): @@ -30,6 +32,19 @@ class Display(BaseModel): last4: Optional[str] = None +class Action(BaseModel): + name: Literal["card_enrollment"] + + url: str + + capture_token: Optional[str] = None + """Secret bearer capability for embedded card capture with @onkernel/vault-react. + + Present only for Kernel wallets; never for AgentCard. Treat it like the + enrollment URL and do not log or persist it in browser storage. + """ + + class VaultPaymentMethod(BaseModel): id: str @@ -43,9 +58,33 @@ class VaultPaymentMethod(BaseModel): display: Display is_default: bool + """ + For Kernel wallets, true for the default card, ID card, which a Kernel card item + that omits payment_method_id selects. Wallets created with payment methods + enabled have no default card. + """ provider: str """Provider that issued this payment-method ID.""" type: str """Provider-neutral payment-method type normalized to lowercase.""" + + action: Optional[Action] = None + + expires_at: Optional[datetime] = None + """Expiry of a pending enrollment link.""" + + status: Optional[Literal["pending_enrollment", "active", "removal_pending", "recovery_required"]] = None + """Kernel wallets only. + + pending_enrollment means a card_enrollment link is open; active means the card + is stored and can pay when capabilities.single_use_card.eligible is true; + removal_pending means removal started but the provider outcome is unknown, so + retry remove_payment_method; recovery_required means either an enrollment + outcome is unknown (remove the method), or the stored card cannot be read + (contact support; removal is refused with 409). Consult status_reason to + distinguish these cases. Absent for other providers. + """ + + status_reason: Optional[str] = None diff --git a/tests/api_resources/vaults/test_items.py b/tests/api_resources/vaults/test_items.py index 92fa760e..c588ce4c 100644 --- a/tests/api_resources/vaults/test_items.py +++ b/tests/api_resources/vaults/test_items.py @@ -242,6 +242,164 @@ def test_path_params_update_overload_1(self, client: Kernel) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_update_overload_2(self, client: Kernel) -> None: + item = client.vaults.items.update( + key="x", + id_or_name="id_or_name", + spec={ + "amount": 1, + "context": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "currency": "bFx", + "merchant_name": "x", + "merchant_url": "https://example.com", + "payment_method_id": "x", + "provider": "link", + "wallet": "wallet", + }, + type="payment_request", + ) + assert_matches_type(VaultItem, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_update_with_all_params_overload_2(self, client: Kernel) -> None: + item = client.vaults.items.update( + key="x", + id_or_name="id_or_name", + spec={ + "amount": 1, + "context": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "currency": "bFx", + "merchant_name": "x", + "merchant_url": "https://example.com", + "payment_method_id": "x", + "provider": "link", + "wallet": "wallet", + "line_items": [ + { + "name": "name", + "description": "description", + "image_url": "image_url", + "product_url": "product_url", + "quantity": 1, + "sku": "sku", + "totals": [ + { + "amount": 0, + "display_text": "display_text", + "type": "type", + } + ], + "unit_amount": 0, + "url": "url", + } + ], + "metadata": {"foo": "string"}, + "recurring": { + "interval": "day", + "interval_count": 1, + }, + "totals": [ + { + "amount": 0, + "display_text": "display_text", + "type": "type", + } + ], + }, + type="payment_request", + ) + assert_matches_type(VaultItem, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_update_overload_2(self, client: Kernel) -> None: + response = client.vaults.items.with_raw_response.update( + key="x", + id_or_name="id_or_name", + spec={ + "amount": 1, + "context": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "currency": "bFx", + "merchant_name": "x", + "merchant_url": "https://example.com", + "payment_method_id": "x", + "provider": "link", + "wallet": "wallet", + }, + type="payment_request", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + item = response.parse() + assert_matches_type(VaultItem, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_update_overload_2(self, client: Kernel) -> None: + with client.vaults.items.with_streaming_response.update( + key="x", + id_or_name="id_or_name", + spec={ + "amount": 1, + "context": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "currency": "bFx", + "merchant_name": "x", + "merchant_url": "https://example.com", + "payment_method_id": "x", + "provider": "link", + "wallet": "wallet", + }, + type="payment_request", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + item = response.parse() + assert_matches_type(VaultItem, item, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_path_params_update_overload_2(self, client: Kernel) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id_or_name` but received ''"): + client.vaults.items.with_raw_response.update( + key="x", + id_or_name="", + spec={ + "amount": 1, + "context": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "currency": "bFx", + "merchant_name": "x", + "merchant_url": "https://example.com", + "payment_method_id": "x", + "provider": "link", + "wallet": "wallet", + }, + type="payment_request", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): + client.vaults.items.with_raw_response.update( + key="", + id_or_name="id_or_name", + spec={ + "amount": 1, + "context": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "currency": "bFx", + "merchant_name": "x", + "merchant_url": "https://example.com", + "payment_method_id": "x", + "provider": "link", + "wallet": "wallet", + }, + type="payment_request", + ) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_update_overload_3(self, client: Kernel) -> None: item = client.vaults.items.update( key="x", id_or_name="id_or_name", @@ -253,7 +411,7 @@ def test_method_update_overload_2(self, client: Kernel) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - def test_method_update_with_all_params_overload_2(self, client: Kernel) -> None: + def test_method_update_with_all_params_overload_3(self, client: Kernel) -> None: item = client.vaults.items.update( key="x", id_or_name="id_or_name", @@ -284,7 +442,7 @@ def test_method_update_with_all_params_overload_2(self, client: Kernel) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - def test_raw_response_update_overload_2(self, client: Kernel) -> None: + def test_raw_response_update_overload_3(self, client: Kernel) -> None: response = client.vaults.items.with_raw_response.update( key="x", id_or_name="id_or_name", @@ -300,7 +458,7 @@ def test_raw_response_update_overload_2(self, client: Kernel) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - def test_streaming_response_update_overload_2(self, client: Kernel) -> None: + def test_streaming_response_update_overload_3(self, client: Kernel) -> None: with client.vaults.items.with_streaming_response.update( key="x", id_or_name="id_or_name", @@ -318,7 +476,7 @@ def test_streaming_response_update_overload_2(self, client: Kernel) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - def test_path_params_update_overload_2(self, client: Kernel) -> None: + def test_path_params_update_overload_3(self, client: Kernel) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id_or_name` but received ''"): client.vaults.items.with_raw_response.update( key="x", @@ -1698,6 +1856,125 @@ def test_path_params_perform_operation_overload_15(self, client: Kernel) -> None type="webmcp_invoke", ) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_perform_operation_overload_16(self, client: Kernel) -> None: + item = client.vaults.items.perform_operation( + key="key", + id_or_name="id_or_name", + type="add_payment_method", + ) + assert_matches_type(VaultItemOperationResponse, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_perform_operation_overload_16(self, client: Kernel) -> None: + response = client.vaults.items.with_raw_response.perform_operation( + key="key", + id_or_name="id_or_name", + type="add_payment_method", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + item = response.parse() + assert_matches_type(VaultItemOperationResponse, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_perform_operation_overload_16(self, client: Kernel) -> None: + with client.vaults.items.with_streaming_response.perform_operation( + key="key", + id_or_name="id_or_name", + type="add_payment_method", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + item = response.parse() + assert_matches_type(VaultItemOperationResponse, item, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_path_params_perform_operation_overload_16(self, client: Kernel) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id_or_name` but received ''"): + client.vaults.items.with_raw_response.perform_operation( + key="key", + id_or_name="", + type="add_payment_method", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): + client.vaults.items.with_raw_response.perform_operation( + key="", + id_or_name="id_or_name", + type="add_payment_method", + ) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_perform_operation_overload_17(self, client: Kernel) -> None: + item = client.vaults.items.perform_operation( + key="key", + id_or_name="id_or_name", + payment_method_id="x", + type="remove_payment_method", + ) + assert_matches_type(VaultItemOperationResponse, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_perform_operation_overload_17(self, client: Kernel) -> None: + response = client.vaults.items.with_raw_response.perform_operation( + key="key", + id_or_name="id_or_name", + payment_method_id="x", + type="remove_payment_method", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + item = response.parse() + assert_matches_type(VaultItemOperationResponse, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_perform_operation_overload_17(self, client: Kernel) -> None: + with client.vaults.items.with_streaming_response.perform_operation( + key="key", + id_or_name="id_or_name", + payment_method_id="x", + type="remove_payment_method", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + item = response.parse() + assert_matches_type(VaultItemOperationResponse, item, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_path_params_perform_operation_overload_17(self, client: Kernel) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id_or_name` but received ''"): + client.vaults.items.with_raw_response.perform_operation( + key="key", + id_or_name="", + payment_method_id="x", + type="remove_payment_method", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): + client.vaults.items.with_raw_response.perform_operation( + key="", + id_or_name="id_or_name", + payment_method_id="x", + type="remove_payment_method", + ) + @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_upsert_overload_1(self, client: Kernel) -> None: @@ -1972,19 +2249,177 @@ def test_method_upsert_overload_3(self, client: Kernel) -> None: key="x", id_or_name="id_or_name", spec={ - "authorization": { - "client": {"type": "kernel_managed"}, - "method": "oauth", - }, - "provider": "1password", + "amount": 1, + "context": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "currency": "bFx", + "merchant_name": "x", + "merchant_url": "https://example.com", + "payment_method_id": "x", + "provider": "link", + "wallet": "wallet", }, - type="credential_account", + type="payment_request", + ) + assert_matches_type(VaultItem, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_upsert_with_all_params_overload_3(self, client: Kernel) -> None: + item = client.vaults.items.upsert( + key="x", + id_or_name="id_or_name", + spec={ + "amount": 1, + "context": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "currency": "bFx", + "merchant_name": "x", + "merchant_url": "https://example.com", + "payment_method_id": "x", + "provider": "link", + "wallet": "wallet", + "line_items": [ + { + "name": "name", + "description": "description", + "image_url": "image_url", + "product_url": "product_url", + "quantity": 1, + "sku": "sku", + "totals": [ + { + "amount": 0, + "display_text": "display_text", + "type": "type", + } + ], + "unit_amount": 0, + "url": "url", + } + ], + "metadata": {"foo": "string"}, + "recurring": { + "interval": "day", + "interval_count": 1, + }, + "totals": [ + { + "amount": 0, + "display_text": "display_text", + "type": "type", + } + ], + }, + type="payment_request", ) assert_matches_type(VaultItem, item, path=["response"]) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_raw_response_upsert_overload_3(self, client: Kernel) -> None: + response = client.vaults.items.with_raw_response.upsert( + key="x", + id_or_name="id_or_name", + spec={ + "amount": 1, + "context": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "currency": "bFx", + "merchant_name": "x", + "merchant_url": "https://example.com", + "payment_method_id": "x", + "provider": "link", + "wallet": "wallet", + }, + type="payment_request", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + item = response.parse() + assert_matches_type(VaultItem, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_upsert_overload_3(self, client: Kernel) -> None: + with client.vaults.items.with_streaming_response.upsert( + key="x", + id_or_name="id_or_name", + spec={ + "amount": 1, + "context": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "currency": "bFx", + "merchant_name": "x", + "merchant_url": "https://example.com", + "payment_method_id": "x", + "provider": "link", + "wallet": "wallet", + }, + type="payment_request", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + item = response.parse() + assert_matches_type(VaultItem, item, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_path_params_upsert_overload_3(self, client: Kernel) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id_or_name` but received ''"): + client.vaults.items.with_raw_response.upsert( + key="x", + id_or_name="", + spec={ + "amount": 1, + "context": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "currency": "bFx", + "merchant_name": "x", + "merchant_url": "https://example.com", + "payment_method_id": "x", + "provider": "link", + "wallet": "wallet", + }, + type="payment_request", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): + client.vaults.items.with_raw_response.upsert( + key="", + id_or_name="id_or_name", + spec={ + "amount": 1, + "context": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "currency": "bFx", + "merchant_name": "x", + "merchant_url": "https://example.com", + "payment_method_id": "x", + "provider": "link", + "wallet": "wallet", + }, + type="payment_request", + ) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_upsert_overload_4(self, client: Kernel) -> None: + item = client.vaults.items.upsert( + key="x", + id_or_name="id_or_name", + spec={ + "authorization": { + "client": {"type": "kernel_managed"}, + "method": "oauth", + }, + "provider": "1password", + }, + type="credential_account", + ) + assert_matches_type(VaultItem, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_upsert_overload_4(self, client: Kernel) -> None: response = client.vaults.items.with_raw_response.upsert( key="x", id_or_name="id_or_name", @@ -2005,7 +2440,7 @@ def test_raw_response_upsert_overload_3(self, client: Kernel) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - def test_streaming_response_upsert_overload_3(self, client: Kernel) -> None: + def test_streaming_response_upsert_overload_4(self, client: Kernel) -> None: with client.vaults.items.with_streaming_response.upsert( key="x", id_or_name="id_or_name", @@ -2028,7 +2463,7 @@ def test_streaming_response_upsert_overload_3(self, client: Kernel) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - def test_path_params_upsert_overload_3(self, client: Kernel) -> None: + def test_path_params_upsert_overload_4(self, client: Kernel) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id_or_name` but received ''"): client.vaults.items.with_raw_response.upsert( key="x", @@ -2059,7 +2494,7 @@ def test_path_params_upsert_overload_3(self, client: Kernel) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - def test_method_upsert_overload_4(self, client: Kernel) -> None: + def test_method_upsert_overload_5(self, client: Kernel) -> None: item = client.vaults.items.upsert( key="x", id_or_name="id_or_name", @@ -2078,7 +2513,7 @@ def test_method_upsert_overload_4(self, client: Kernel) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - def test_method_upsert_with_all_params_overload_4(self, client: Kernel) -> None: + def test_method_upsert_with_all_params_overload_5(self, client: Kernel) -> None: item = client.vaults.items.upsert( key="x", id_or_name="id_or_name", @@ -2103,7 +2538,7 @@ def test_method_upsert_with_all_params_overload_4(self, client: Kernel) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - def test_raw_response_upsert_overload_4(self, client: Kernel) -> None: + def test_raw_response_upsert_overload_5(self, client: Kernel) -> None: response = client.vaults.items.with_raw_response.upsert( key="x", id_or_name="id_or_name", @@ -2126,7 +2561,7 @@ def test_raw_response_upsert_overload_4(self, client: Kernel) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - def test_streaming_response_upsert_overload_4(self, client: Kernel) -> None: + def test_streaming_response_upsert_overload_5(self, client: Kernel) -> None: with client.vaults.items.with_streaming_response.upsert( key="x", id_or_name="id_or_name", @@ -2151,7 +2586,7 @@ def test_streaming_response_upsert_overload_4(self, client: Kernel) -> None: @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - def test_path_params_upsert_overload_4(self, client: Kernel) -> None: + def test_path_params_upsert_overload_5(self, client: Kernel) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id_or_name` but received ''"): client.vaults.items.with_raw_response.upsert( key="x", @@ -2409,6 +2844,164 @@ async def test_path_params_update_overload_1(self, async_client: AsyncKernel) -> @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_update_overload_2(self, async_client: AsyncKernel) -> None: + item = await async_client.vaults.items.update( + key="x", + id_or_name="id_or_name", + spec={ + "amount": 1, + "context": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "currency": "bFx", + "merchant_name": "x", + "merchant_url": "https://example.com", + "payment_method_id": "x", + "provider": "link", + "wallet": "wallet", + }, + type="payment_request", + ) + assert_matches_type(VaultItem, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_update_with_all_params_overload_2(self, async_client: AsyncKernel) -> None: + item = await async_client.vaults.items.update( + key="x", + id_or_name="id_or_name", + spec={ + "amount": 1, + "context": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "currency": "bFx", + "merchant_name": "x", + "merchant_url": "https://example.com", + "payment_method_id": "x", + "provider": "link", + "wallet": "wallet", + "line_items": [ + { + "name": "name", + "description": "description", + "image_url": "image_url", + "product_url": "product_url", + "quantity": 1, + "sku": "sku", + "totals": [ + { + "amount": 0, + "display_text": "display_text", + "type": "type", + } + ], + "unit_amount": 0, + "url": "url", + } + ], + "metadata": {"foo": "string"}, + "recurring": { + "interval": "day", + "interval_count": 1, + }, + "totals": [ + { + "amount": 0, + "display_text": "display_text", + "type": "type", + } + ], + }, + type="payment_request", + ) + assert_matches_type(VaultItem, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_update_overload_2(self, async_client: AsyncKernel) -> None: + response = await async_client.vaults.items.with_raw_response.update( + key="x", + id_or_name="id_or_name", + spec={ + "amount": 1, + "context": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "currency": "bFx", + "merchant_name": "x", + "merchant_url": "https://example.com", + "payment_method_id": "x", + "provider": "link", + "wallet": "wallet", + }, + type="payment_request", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + item = await response.parse() + assert_matches_type(VaultItem, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_update_overload_2(self, async_client: AsyncKernel) -> None: + async with async_client.vaults.items.with_streaming_response.update( + key="x", + id_or_name="id_or_name", + spec={ + "amount": 1, + "context": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "currency": "bFx", + "merchant_name": "x", + "merchant_url": "https://example.com", + "payment_method_id": "x", + "provider": "link", + "wallet": "wallet", + }, + type="payment_request", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + item = await response.parse() + assert_matches_type(VaultItem, item, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_path_params_update_overload_2(self, async_client: AsyncKernel) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id_or_name` but received ''"): + await async_client.vaults.items.with_raw_response.update( + key="x", + id_or_name="", + spec={ + "amount": 1, + "context": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "currency": "bFx", + "merchant_name": "x", + "merchant_url": "https://example.com", + "payment_method_id": "x", + "provider": "link", + "wallet": "wallet", + }, + type="payment_request", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): + await async_client.vaults.items.with_raw_response.update( + key="", + id_or_name="id_or_name", + spec={ + "amount": 1, + "context": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "currency": "bFx", + "merchant_name": "x", + "merchant_url": "https://example.com", + "payment_method_id": "x", + "provider": "link", + "wallet": "wallet", + }, + type="payment_request", + ) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_update_overload_3(self, async_client: AsyncKernel) -> None: item = await async_client.vaults.items.update( key="x", id_or_name="id_or_name", @@ -2420,7 +3013,7 @@ async def test_method_update_overload_2(self, async_client: AsyncKernel) -> None @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - async def test_method_update_with_all_params_overload_2(self, async_client: AsyncKernel) -> None: + async def test_method_update_with_all_params_overload_3(self, async_client: AsyncKernel) -> None: item = await async_client.vaults.items.update( key="x", id_or_name="id_or_name", @@ -2451,7 +3044,7 @@ async def test_method_update_with_all_params_overload_2(self, async_client: Asyn @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - async def test_raw_response_update_overload_2(self, async_client: AsyncKernel) -> None: + async def test_raw_response_update_overload_3(self, async_client: AsyncKernel) -> None: response = await async_client.vaults.items.with_raw_response.update( key="x", id_or_name="id_or_name", @@ -2467,7 +3060,7 @@ async def test_raw_response_update_overload_2(self, async_client: AsyncKernel) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - async def test_streaming_response_update_overload_2(self, async_client: AsyncKernel) -> None: + async def test_streaming_response_update_overload_3(self, async_client: AsyncKernel) -> None: async with async_client.vaults.items.with_streaming_response.update( key="x", id_or_name="id_or_name", @@ -2485,7 +3078,7 @@ async def test_streaming_response_update_overload_2(self, async_client: AsyncKer @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - async def test_path_params_update_overload_2(self, async_client: AsyncKernel) -> None: + async def test_path_params_update_overload_3(self, async_client: AsyncKernel) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id_or_name` but received ''"): await async_client.vaults.items.with_raw_response.update( key="x", @@ -3752,28 +4345,195 @@ async def test_method_perform_operation_with_all_params_overload_15(self, async_ @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - async def test_raw_response_perform_operation_overload_15(self, async_client: AsyncKernel) -> None: + async def test_raw_response_perform_operation_overload_15(self, async_client: AsyncKernel) -> None: + response = await async_client.vaults.items.with_raw_response.perform_operation( + key="key", + id_or_name="id_or_name", + bindings=[ + { + "field": "email", + "input_path": "/email", + }, + { + "field": "password", + "input_path": "/password", + }, + ], + browser_id="browser-session-id", + input={ + "email": "bar", + "password": "bar", + }, + page_url="https://accounts.example.com/signin", + tool_ref="opaque-live-tool-ref", + type="webmcp_invoke", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + item = await response.parse() + assert_matches_type(VaultItemOperationResponse, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_perform_operation_overload_15(self, async_client: AsyncKernel) -> None: + async with async_client.vaults.items.with_streaming_response.perform_operation( + key="key", + id_or_name="id_or_name", + bindings=[ + { + "field": "email", + "input_path": "/email", + }, + { + "field": "password", + "input_path": "/password", + }, + ], + browser_id="browser-session-id", + input={ + "email": "bar", + "password": "bar", + }, + page_url="https://accounts.example.com/signin", + tool_ref="opaque-live-tool-ref", + type="webmcp_invoke", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + item = await response.parse() + assert_matches_type(VaultItemOperationResponse, item, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_path_params_perform_operation_overload_15(self, async_client: AsyncKernel) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id_or_name` but received ''"): + await async_client.vaults.items.with_raw_response.perform_operation( + key="key", + id_or_name="", + bindings=[ + { + "field": "email", + "input_path": "/email", + }, + { + "field": "password", + "input_path": "/password", + }, + ], + browser_id="browser-session-id", + input={ + "email": "bar", + "password": "bar", + }, + page_url="https://accounts.example.com/signin", + tool_ref="opaque-live-tool-ref", + type="webmcp_invoke", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): + await async_client.vaults.items.with_raw_response.perform_operation( + key="", + id_or_name="id_or_name", + bindings=[ + { + "field": "email", + "input_path": "/email", + }, + { + "field": "password", + "input_path": "/password", + }, + ], + browser_id="browser-session-id", + input={ + "email": "bar", + "password": "bar", + }, + page_url="https://accounts.example.com/signin", + tool_ref="opaque-live-tool-ref", + type="webmcp_invoke", + ) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_perform_operation_overload_16(self, async_client: AsyncKernel) -> None: + item = await async_client.vaults.items.perform_operation( + key="key", + id_or_name="id_or_name", + type="add_payment_method", + ) + assert_matches_type(VaultItemOperationResponse, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_perform_operation_overload_16(self, async_client: AsyncKernel) -> None: + response = await async_client.vaults.items.with_raw_response.perform_operation( + key="key", + id_or_name="id_or_name", + type="add_payment_method", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + item = await response.parse() + assert_matches_type(VaultItemOperationResponse, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_perform_operation_overload_16(self, async_client: AsyncKernel) -> None: + async with async_client.vaults.items.with_streaming_response.perform_operation( + key="key", + id_or_name="id_or_name", + type="add_payment_method", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + item = await response.parse() + assert_matches_type(VaultItemOperationResponse, item, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_path_params_perform_operation_overload_16(self, async_client: AsyncKernel) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id_or_name` but received ''"): + await async_client.vaults.items.with_raw_response.perform_operation( + key="key", + id_or_name="", + type="add_payment_method", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): + await async_client.vaults.items.with_raw_response.perform_operation( + key="", + id_or_name="id_or_name", + type="add_payment_method", + ) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_perform_operation_overload_17(self, async_client: AsyncKernel) -> None: + item = await async_client.vaults.items.perform_operation( + key="key", + id_or_name="id_or_name", + payment_method_id="x", + type="remove_payment_method", + ) + assert_matches_type(VaultItemOperationResponse, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_perform_operation_overload_17(self, async_client: AsyncKernel) -> None: response = await async_client.vaults.items.with_raw_response.perform_operation( key="key", id_or_name="id_or_name", - bindings=[ - { - "field": "email", - "input_path": "/email", - }, - { - "field": "password", - "input_path": "/password", - }, - ], - browser_id="browser-session-id", - input={ - "email": "bar", - "password": "bar", - }, - page_url="https://accounts.example.com/signin", - tool_ref="opaque-live-tool-ref", - type="webmcp_invoke", + payment_method_id="x", + type="remove_payment_method", ) assert response.is_closed is True @@ -3783,28 +4543,12 @@ async def test_raw_response_perform_operation_overload_15(self, async_client: As @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - async def test_streaming_response_perform_operation_overload_15(self, async_client: AsyncKernel) -> None: + async def test_streaming_response_perform_operation_overload_17(self, async_client: AsyncKernel) -> None: async with async_client.vaults.items.with_streaming_response.perform_operation( key="key", id_or_name="id_or_name", - bindings=[ - { - "field": "email", - "input_path": "/email", - }, - { - "field": "password", - "input_path": "/password", - }, - ], - browser_id="browser-session-id", - input={ - "email": "bar", - "password": "bar", - }, - page_url="https://accounts.example.com/signin", - tool_ref="opaque-live-tool-ref", - type="webmcp_invoke", + payment_method_id="x", + type="remove_payment_method", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -3816,53 +4560,21 @@ async def test_streaming_response_perform_operation_overload_15(self, async_clie @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - async def test_path_params_perform_operation_overload_15(self, async_client: AsyncKernel) -> None: + async def test_path_params_perform_operation_overload_17(self, async_client: AsyncKernel) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id_or_name` but received ''"): await async_client.vaults.items.with_raw_response.perform_operation( key="key", id_or_name="", - bindings=[ - { - "field": "email", - "input_path": "/email", - }, - { - "field": "password", - "input_path": "/password", - }, - ], - browser_id="browser-session-id", - input={ - "email": "bar", - "password": "bar", - }, - page_url="https://accounts.example.com/signin", - tool_ref="opaque-live-tool-ref", - type="webmcp_invoke", + payment_method_id="x", + type="remove_payment_method", ) with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): await async_client.vaults.items.with_raw_response.perform_operation( key="", id_or_name="id_or_name", - bindings=[ - { - "field": "email", - "input_path": "/email", - }, - { - "field": "password", - "input_path": "/password", - }, - ], - browser_id="browser-session-id", - input={ - "email": "bar", - "password": "bar", - }, - page_url="https://accounts.example.com/signin", - tool_ref="opaque-live-tool-ref", - type="webmcp_invoke", + payment_method_id="x", + type="remove_payment_method", ) @pytest.mark.skip(reason="Mock server tests are disabled") @@ -4135,6 +4847,164 @@ async def test_path_params_upsert_overload_2(self, async_client: AsyncKernel) -> @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize async def test_method_upsert_overload_3(self, async_client: AsyncKernel) -> None: + item = await async_client.vaults.items.upsert( + key="x", + id_or_name="id_or_name", + spec={ + "amount": 1, + "context": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "currency": "bFx", + "merchant_name": "x", + "merchant_url": "https://example.com", + "payment_method_id": "x", + "provider": "link", + "wallet": "wallet", + }, + type="payment_request", + ) + assert_matches_type(VaultItem, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_upsert_with_all_params_overload_3(self, async_client: AsyncKernel) -> None: + item = await async_client.vaults.items.upsert( + key="x", + id_or_name="id_or_name", + spec={ + "amount": 1, + "context": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "currency": "bFx", + "merchant_name": "x", + "merchant_url": "https://example.com", + "payment_method_id": "x", + "provider": "link", + "wallet": "wallet", + "line_items": [ + { + "name": "name", + "description": "description", + "image_url": "image_url", + "product_url": "product_url", + "quantity": 1, + "sku": "sku", + "totals": [ + { + "amount": 0, + "display_text": "display_text", + "type": "type", + } + ], + "unit_amount": 0, + "url": "url", + } + ], + "metadata": {"foo": "string"}, + "recurring": { + "interval": "day", + "interval_count": 1, + }, + "totals": [ + { + "amount": 0, + "display_text": "display_text", + "type": "type", + } + ], + }, + type="payment_request", + ) + assert_matches_type(VaultItem, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_upsert_overload_3(self, async_client: AsyncKernel) -> None: + response = await async_client.vaults.items.with_raw_response.upsert( + key="x", + id_or_name="id_or_name", + spec={ + "amount": 1, + "context": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "currency": "bFx", + "merchant_name": "x", + "merchant_url": "https://example.com", + "payment_method_id": "x", + "provider": "link", + "wallet": "wallet", + }, + type="payment_request", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + item = await response.parse() + assert_matches_type(VaultItem, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_upsert_overload_3(self, async_client: AsyncKernel) -> None: + async with async_client.vaults.items.with_streaming_response.upsert( + key="x", + id_or_name="id_or_name", + spec={ + "amount": 1, + "context": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "currency": "bFx", + "merchant_name": "x", + "merchant_url": "https://example.com", + "payment_method_id": "x", + "provider": "link", + "wallet": "wallet", + }, + type="payment_request", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + item = await response.parse() + assert_matches_type(VaultItem, item, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_path_params_upsert_overload_3(self, async_client: AsyncKernel) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id_or_name` but received ''"): + await async_client.vaults.items.with_raw_response.upsert( + key="x", + id_or_name="", + spec={ + "amount": 1, + "context": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "currency": "bFx", + "merchant_name": "x", + "merchant_url": "https://example.com", + "payment_method_id": "x", + "provider": "link", + "wallet": "wallet", + }, + type="payment_request", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): + await async_client.vaults.items.with_raw_response.upsert( + key="", + id_or_name="id_or_name", + spec={ + "amount": 1, + "context": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "currency": "bFx", + "merchant_name": "x", + "merchant_url": "https://example.com", + "payment_method_id": "x", + "provider": "link", + "wallet": "wallet", + }, + type="payment_request", + ) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_upsert_overload_4(self, async_client: AsyncKernel) -> None: item = await async_client.vaults.items.upsert( key="x", id_or_name="id_or_name", @@ -4151,7 +5021,7 @@ async def test_method_upsert_overload_3(self, async_client: AsyncKernel) -> None @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - async def test_raw_response_upsert_overload_3(self, async_client: AsyncKernel) -> None: + async def test_raw_response_upsert_overload_4(self, async_client: AsyncKernel) -> None: response = await async_client.vaults.items.with_raw_response.upsert( key="x", id_or_name="id_or_name", @@ -4172,7 +5042,7 @@ async def test_raw_response_upsert_overload_3(self, async_client: AsyncKernel) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - async def test_streaming_response_upsert_overload_3(self, async_client: AsyncKernel) -> None: + async def test_streaming_response_upsert_overload_4(self, async_client: AsyncKernel) -> None: async with async_client.vaults.items.with_streaming_response.upsert( key="x", id_or_name="id_or_name", @@ -4195,7 +5065,7 @@ async def test_streaming_response_upsert_overload_3(self, async_client: AsyncKer @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - async def test_path_params_upsert_overload_3(self, async_client: AsyncKernel) -> None: + async def test_path_params_upsert_overload_4(self, async_client: AsyncKernel) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id_or_name` but received ''"): await async_client.vaults.items.with_raw_response.upsert( key="x", @@ -4226,7 +5096,7 @@ async def test_path_params_upsert_overload_3(self, async_client: AsyncKernel) -> @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - async def test_method_upsert_overload_4(self, async_client: AsyncKernel) -> None: + async def test_method_upsert_overload_5(self, async_client: AsyncKernel) -> None: item = await async_client.vaults.items.upsert( key="x", id_or_name="id_or_name", @@ -4245,7 +5115,7 @@ async def test_method_upsert_overload_4(self, async_client: AsyncKernel) -> None @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - async def test_method_upsert_with_all_params_overload_4(self, async_client: AsyncKernel) -> None: + async def test_method_upsert_with_all_params_overload_5(self, async_client: AsyncKernel) -> None: item = await async_client.vaults.items.upsert( key="x", id_or_name="id_or_name", @@ -4270,7 +5140,7 @@ async def test_method_upsert_with_all_params_overload_4(self, async_client: Asyn @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - async def test_raw_response_upsert_overload_4(self, async_client: AsyncKernel) -> None: + async def test_raw_response_upsert_overload_5(self, async_client: AsyncKernel) -> None: response = await async_client.vaults.items.with_raw_response.upsert( key="x", id_or_name="id_or_name", @@ -4293,7 +5163,7 @@ async def test_raw_response_upsert_overload_4(self, async_client: AsyncKernel) - @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - async def test_streaming_response_upsert_overload_4(self, async_client: AsyncKernel) -> None: + async def test_streaming_response_upsert_overload_5(self, async_client: AsyncKernel) -> None: async with async_client.vaults.items.with_streaming_response.upsert( key="x", id_or_name="id_or_name", @@ -4318,7 +5188,7 @@ async def test_streaming_response_upsert_overload_4(self, async_client: AsyncKer @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize - async def test_path_params_upsert_overload_4(self, async_client: AsyncKernel) -> None: + async def test_path_params_upsert_overload_5(self, async_client: AsyncKernel) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id_or_name` but received ''"): await async_client.vaults.items.with_raw_response.upsert( key="x", From 8f51b1697a10524a5e40191bd17e0f2c451a4f91 Mon Sep 17 00:00:00 2001 From: "kernel-internal[bot]" <260533166+kernel-internal[bot]@users.noreply.github.com> Date: Wed, 28 Oct 2026 15:27:24 +0000 Subject: [PATCH 2/4] feat: Forward Idempotency-Key on playwright and REPL execution Stainless-Generated-From: 7349f54745cd756eb539fbed93b972348a67507e --- src/kernel/_client.py | 4 + src/kernel/resources/api_keys.py | 72 +++++- .../audit_logs/export_destinations.py | 72 +++++- src/kernel/resources/auth/connections.py | 90 +++++++- src/kernel/resources/browser_pools.py | 108 ++++++++- src/kernel/resources/browsers/browsers.py | 108 ++++++++- src/kernel/resources/browsers/computer.py | 216 ++++++++++++++++-- src/kernel/resources/browsers/fs/fs.py | 134 +++++++++-- src/kernel/resources/browsers/fs/watch.py | 36 ++- .../browsers/playwright/executors.py | 8 + .../browsers/playwright/playwright.py | 18 +- src/kernel/resources/browsers/process.py | 90 +++++++- src/kernel/resources/browsers/replays.py | 36 ++- .../resources/browsers/webmcp/custom_tools.py | 36 ++- .../resources/browsers/webmcp/webmcp.py | 18 +- .../resources/config_registry/analyses.py | 18 +- .../config_registry/config_registry.py | 36 ++- src/kernel/resources/credential_providers.py | 72 +++++- src/kernel/resources/credentials.py | 54 ++++- src/kernel/resources/deployments.py | 36 ++- src/kernel/resources/extensions.py | 36 ++- src/kernel/resources/invocations.py | 54 ++++- src/kernel/resources/organization/limits.py | 18 +- src/kernel/resources/profiles.py | 54 ++++- src/kernel/resources/projects/limits.py | 18 +- src/kernel/resources/projects/projects.py | 54 ++++- src/kernel/resources/proxies.py | 72 +++++- src/kernel/resources/search/contents.py | 18 +- src/kernel/resources/search/search.py | 18 +- .../resources/telemetry/destinations.py | 54 ++++- .../resources/vault_provider_configs.py | 62 ++++- src/kernel/resources/vaults/items.py | 210 ++++++++++++++++- src/kernel/resources/vaults/vaults.py | 36 ++- tests/test_client.py | 62 +++++ 34 files changed, 1828 insertions(+), 200 deletions(-) diff --git a/src/kernel/_client.py b/src/kernel/_client.py index 4ffa9faf..4a06456d 100644 --- a/src/kernel/_client.py +++ b/src/kernel/_client.py @@ -219,6 +219,8 @@ def __init__( install_direct_vm_auth_stripping(self._client) install_stale_direct_vm_auth_eviction(self._client) + self._idempotency_header = "Idempotency-Key" + @cached_property def deployments(self) -> DeploymentsResource: """Create and manage app deployments and stream deployment events.""" @@ -630,6 +632,8 @@ def __init__( install_async_direct_vm_auth_stripping(self._client) install_async_stale_direct_vm_auth_eviction(self._client) + self._idempotency_header = "Idempotency-Key" + @cached_property def deployments(self) -> AsyncDeploymentsResource: """Create and manage app deployments and stream deployment events.""" diff --git a/src/kernel/resources/api_keys.py b/src/kernel/resources/api_keys.py index 52e6e6f9..09c7f22a 100644 --- a/src/kernel/resources/api_keys.py +++ b/src/kernel/resources/api_keys.py @@ -69,6 +69,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> CreatedAPIKey: """Create a new API key. @@ -96,6 +97,8 @@ def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return self._post( "/org/api_keys", @@ -110,7 +113,11 @@ def create( api_key_create_params.APIKeyCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=CreatedAPIKey, ) @@ -171,6 +178,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> APIKey: """ Update an API key's name. @@ -185,6 +193,8 @@ def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -192,7 +202,11 @@ def update( path_template("/org/api_keys/{id}", id=id), body=maybe_transform({"name": name}, api_key_update_params.APIKeyUpdateParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=APIKey, ) @@ -286,6 +300,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """Delete an API key. @@ -300,6 +315,8 @@ def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -307,7 +324,11 @@ def delete( return self._delete( path_template("/org/api_keys/{id}", id=id), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -324,6 +345,7 @@ def rotate( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> CreatedAPIKey: """Rotate an API key. @@ -345,6 +367,8 @@ def rotate( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -358,7 +382,11 @@ def rotate( api_key_rotate_params.APIKeyRotateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=CreatedAPIKey, ) @@ -400,6 +428,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> CreatedAPIKey: """Create a new API key. @@ -427,6 +456,8 @@ async def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return await self._post( "/org/api_keys", @@ -441,7 +472,11 @@ async def create( api_key_create_params.APIKeyCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=CreatedAPIKey, ) @@ -502,6 +537,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> APIKey: """ Update an API key's name. @@ -516,6 +552,8 @@ async def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -523,7 +561,11 @@ async def update( path_template("/org/api_keys/{id}", id=id), body=await async_maybe_transform({"name": name}, api_key_update_params.APIKeyUpdateParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=APIKey, ) @@ -617,6 +659,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """Delete an API key. @@ -631,6 +674,8 @@ async def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -638,7 +683,11 @@ async def delete( return await self._delete( path_template("/org/api_keys/{id}", id=id), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -655,6 +704,7 @@ async def rotate( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> CreatedAPIKey: """Rotate an API key. @@ -676,6 +726,8 @@ async def rotate( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -689,7 +741,11 @@ async def rotate( api_key_rotate_params.APIKeyRotateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=CreatedAPIKey, ) diff --git a/src/kernel/resources/audit_logs/export_destinations.py b/src/kernel/resources/audit_logs/export_destinations.py index c5d79624..4f2842ae 100644 --- a/src/kernel/resources/audit_logs/export_destinations.py +++ b/src/kernel/resources/audit_logs/export_destinations.py @@ -67,6 +67,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> AuditLogExportDestination: """Create a paused destination. @@ -81,6 +82,8 @@ def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return self._post( "/audit-logs/export/destinations", @@ -97,7 +100,11 @@ def create( export_destination_create_params.ExportDestinationCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=AuditLogExportDestination, ) @@ -151,6 +158,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> AuditLogExportDestination: """Apply a partial update to a destination. @@ -171,6 +179,8 @@ def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -188,7 +198,11 @@ def update( export_destination_update_params.ExportDestinationUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=AuditLogExportDestination, ) @@ -250,6 +264,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """Soft delete the destination and prevent new delivery attempts. @@ -264,6 +279,8 @@ def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -271,7 +288,11 @@ def delete( return self._delete( path_template("/audit-logs/export/destinations/{id}", id=id), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -286,6 +307,7 @@ def test( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> AuditLogExportDestinationTestResult: """ Verify the destination is writable by assuming the configured role and uploading @@ -300,13 +322,19 @@ def test( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( path_template("/audit-logs/export/destinations/{id}/test", id=id), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=AuditLogExportDestinationTestResult, ) @@ -350,6 +378,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> AuditLogExportDestination: """Create a paused destination. @@ -364,6 +393,8 @@ async def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return await self._post( "/audit-logs/export/destinations", @@ -380,7 +411,11 @@ async def create( export_destination_create_params.ExportDestinationCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=AuditLogExportDestination, ) @@ -434,6 +469,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> AuditLogExportDestination: """Apply a partial update to a destination. @@ -454,6 +490,8 @@ async def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -471,7 +509,11 @@ async def update( export_destination_update_params.ExportDestinationUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=AuditLogExportDestination, ) @@ -533,6 +575,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """Soft delete the destination and prevent new delivery attempts. @@ -547,6 +590,8 @@ async def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -554,7 +599,11 @@ async def delete( return await self._delete( path_template("/audit-logs/export/destinations/{id}", id=id), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -569,6 +618,7 @@ async def test( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> AuditLogExportDestinationTestResult: """ Verify the destination is writable by assuming the configured role and uploading @@ -583,13 +633,19 @@ async def test( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._post( path_template("/audit-logs/export/destinations/{id}/test", id=id), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=AuditLogExportDestinationTestResult, ) diff --git a/src/kernel/resources/auth/connections.py b/src/kernel/resources/auth/connections.py index fae767b7..909dd27d 100644 --- a/src/kernel/resources/auth/connections.py +++ b/src/kernel/resources/auth/connections.py @@ -82,6 +82,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ManagedAuth: """Creates an auth connection for a profile and domain combination. @@ -166,6 +167,8 @@ def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return self._post( "/auth/connections", @@ -188,7 +191,11 @@ def create( connection_create_params.ConnectionCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ManagedAuth, ) @@ -249,6 +256,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ManagedAuth: """Update an auth connection's configuration. @@ -304,6 +312,8 @@ def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -326,7 +336,11 @@ def update( connection_update_params.ConnectionUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ManagedAuth, ) @@ -400,6 +414,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """Deletes an auth connection and terminates its workflow. @@ -417,6 +432,8 @@ def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -424,7 +441,11 @@ def delete( return self._delete( path_template("/auth/connections/{id}", id=id), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -484,6 +505,7 @@ def login( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> LoginResponse: """Starts a login flow for the auth connection. @@ -514,6 +536,8 @@ def login( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -530,7 +554,11 @@ def login( connection_login_params.ConnectionLoginParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=LoginResponse, ) @@ -553,6 +581,7 @@ def submit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> SubmitFieldsResponse: """Submits field values for the login form. @@ -586,6 +615,8 @@ def submit( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -605,7 +636,11 @@ def submit( connection_submit_params.ConnectionSubmitParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=SubmitFieldsResponse, ) @@ -711,6 +746,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ManagedAuth: """Creates an auth connection for a profile and domain combination. @@ -795,6 +831,8 @@ async def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return await self._post( "/auth/connections", @@ -817,7 +855,11 @@ async def create( connection_create_params.ConnectionCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ManagedAuth, ) @@ -878,6 +920,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ManagedAuth: """Update an auth connection's configuration. @@ -933,6 +976,8 @@ async def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -955,7 +1000,11 @@ async def update( connection_update_params.ConnectionUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ManagedAuth, ) @@ -1029,6 +1078,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """Deletes an auth connection and terminates its workflow. @@ -1046,6 +1096,8 @@ async def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -1053,7 +1105,11 @@ async def delete( return await self._delete( path_template("/auth/connections/{id}", id=id), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -1113,6 +1169,7 @@ async def login( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> LoginResponse: """Starts a login flow for the auth connection. @@ -1143,6 +1200,8 @@ async def login( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -1159,7 +1218,11 @@ async def login( connection_login_params.ConnectionLoginParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=LoginResponse, ) @@ -1182,6 +1245,7 @@ async def submit( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> SubmitFieldsResponse: """Submits field values for the login form. @@ -1215,6 +1279,8 @@ async def submit( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -1234,7 +1300,11 @@ async def submit( connection_submit_params.ConnectionSubmitParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=SubmitFieldsResponse, ) diff --git a/src/kernel/resources/browser_pools.py b/src/kernel/resources/browser_pools.py index 61ad0977..afe64616 100644 --- a/src/kernel/resources/browser_pools.py +++ b/src/kernel/resources/browser_pools.py @@ -89,6 +89,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> BrowserPool: """Create a new browser pool with the specified configuration and size. @@ -184,6 +185,8 @@ def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return self._post( "/browser_pools", @@ -211,7 +214,11 @@ def create( browser_pool_create_params.BrowserPoolCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=BrowserPool, ) @@ -278,6 +285,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> BrowserPool: """Updates the configuration used to create browsers in the pool. @@ -397,6 +405,8 @@ def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -427,7 +437,11 @@ def update( browser_pool_update_params.BrowserPoolUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=BrowserPool, ) @@ -506,6 +520,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """Delete a browser pool and all browsers in it. @@ -523,6 +538,8 @@ def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -531,7 +548,11 @@ def delete( path_template("/browser_pools/{id_or_name}", id_or_name=id_or_name), body=maybe_transform({"force": force}, browser_pool_delete_params.BrowserPoolDeleteParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -552,6 +573,7 @@ def acquire( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> Optional[BrowserPoolAcquireResponse]: """Long-polling endpoint to acquire a browser from the pool. @@ -598,6 +620,8 @@ def acquire( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -615,7 +639,11 @@ def acquire( browser_pool_acquire_params.BrowserPoolAcquireParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=BrowserPoolAcquireResponse, ) @@ -630,6 +658,7 @@ def flush( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Destroys all idle browsers in the pool; leased browsers are not affected. @@ -642,6 +671,8 @@ def flush( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -649,7 +680,11 @@ def flush( return self._post( path_template("/browser_pools/{id_or_name}/flush", id_or_name=id_or_name), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -666,6 +701,7 @@ def release( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Release a browser back to the pool, optionally recreating the browser instance. @@ -687,6 +723,8 @@ def release( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -701,7 +739,11 @@ def release( browser_pool_release_params.BrowserPoolReleaseParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -756,6 +798,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> BrowserPool: """Create a new browser pool with the specified configuration and size. @@ -851,6 +894,8 @@ async def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return await self._post( "/browser_pools", @@ -878,7 +923,11 @@ async def create( browser_pool_create_params.BrowserPoolCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=BrowserPool, ) @@ -945,6 +994,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> BrowserPool: """Updates the configuration used to create browsers in the pool. @@ -1064,6 +1114,8 @@ async def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -1094,7 +1146,11 @@ async def update( browser_pool_update_params.BrowserPoolUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=BrowserPool, ) @@ -1173,6 +1229,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """Delete a browser pool and all browsers in it. @@ -1190,6 +1247,8 @@ async def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -1198,7 +1257,11 @@ async def delete( path_template("/browser_pools/{id_or_name}", id_or_name=id_or_name), body=await async_maybe_transform({"force": force}, browser_pool_delete_params.BrowserPoolDeleteParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -1219,6 +1282,7 @@ async def acquire( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> Optional[BrowserPoolAcquireResponse]: """Long-polling endpoint to acquire a browser from the pool. @@ -1265,6 +1329,8 @@ async def acquire( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -1282,7 +1348,11 @@ async def acquire( browser_pool_acquire_params.BrowserPoolAcquireParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=BrowserPoolAcquireResponse, ) @@ -1297,6 +1367,7 @@ async def flush( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Destroys all idle browsers in the pool; leased browsers are not affected. @@ -1309,6 +1380,8 @@ async def flush( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -1316,7 +1389,11 @@ async def flush( return await self._post( path_template("/browser_pools/{id_or_name}/flush", id_or_name=id_or_name), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -1333,6 +1410,7 @@ async def release( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Release a browser back to the pool, optionally recreating the browser instance. @@ -1354,6 +1432,8 @@ async def release( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -1368,7 +1448,11 @@ async def release( browser_pool_release_params.BrowserPoolReleaseParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) diff --git a/src/kernel/resources/browsers/browsers.py b/src/kernel/resources/browsers/browsers.py index 885c7709..ec9b5176 100644 --- a/src/kernel/resources/browsers/browsers.py +++ b/src/kernel/resources/browsers/browsers.py @@ -219,6 +219,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> BrowserCreateResponse: """ Create a new browser session from within an action. @@ -328,6 +329,8 @@ def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return self._post( "/browsers", @@ -359,7 +362,11 @@ def create( browser_create_params.BrowserCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=BrowserCreateResponse, ) @@ -427,6 +434,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> BrowserUpdateResponse: """ Update a browser session. @@ -486,6 +494,8 @@ def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -508,7 +518,11 @@ def update( browser_update_params.BrowserUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=BrowserUpdateResponse, ) @@ -602,6 +616,7 @@ def curl( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> BrowserCurlResponse: """ Sends an HTTP request through Chrome's HTTP request stack, inheriting the @@ -628,6 +643,8 @@ def curl( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -645,7 +662,11 @@ def curl( browser_curl_params.BrowserCurlParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=BrowserCurlResponse, ) @@ -718,6 +739,7 @@ def delete_by_id( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Delete a browser session by ID or name @@ -730,6 +752,8 @@ def delete_by_id( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -737,7 +761,11 @@ def delete_by_id( return self._delete( path_template("/browsers/{id_or_name}", id_or_name=id_or_name), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -753,6 +781,7 @@ def load_extensions( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Loads one or more unpacked extensions using live CDP activation when eligible. @@ -768,6 +797,8 @@ def load_extensions( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -783,7 +814,11 @@ def load_extensions( body=maybe_transform(body, browser_load_extensions_params.BrowserLoadExtensionsParams), files=files, options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -801,6 +836,7 @@ def repl( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> BrowserReplResult: """ Execute JavaScript in a persistent Node.js runtime inside the browser VM. @@ -836,6 +872,8 @@ def repl( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -850,7 +888,11 @@ def repl( browser_repl_params.BrowserReplParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=BrowserReplResult, ) @@ -951,6 +993,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> BrowserCreateResponse: """ Create a new browser session from within an action. @@ -1060,6 +1103,8 @@ async def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return await self._post( "/browsers", @@ -1091,7 +1136,11 @@ async def create( browser_create_params.BrowserCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=BrowserCreateResponse, ) @@ -1159,6 +1208,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> BrowserUpdateResponse: """ Update a browser session. @@ -1218,6 +1268,8 @@ async def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -1240,7 +1292,11 @@ async def update( browser_update_params.BrowserUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=BrowserUpdateResponse, ) @@ -1334,6 +1390,7 @@ async def curl( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> BrowserCurlResponse: """ Sends an HTTP request through Chrome's HTTP request stack, inheriting the @@ -1360,6 +1417,8 @@ async def curl( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -1377,7 +1436,11 @@ async def curl( browser_curl_params.BrowserCurlParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=BrowserCurlResponse, ) @@ -1450,6 +1513,7 @@ async def delete_by_id( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Delete a browser session by ID or name @@ -1462,6 +1526,8 @@ async def delete_by_id( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -1469,7 +1535,11 @@ async def delete_by_id( return await self._delete( path_template("/browsers/{id_or_name}", id_or_name=id_or_name), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -1485,6 +1555,7 @@ async def load_extensions( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Loads one or more unpacked extensions using live CDP activation when eligible. @@ -1500,6 +1571,8 @@ async def load_extensions( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -1515,7 +1588,11 @@ async def load_extensions( body=await async_maybe_transform(body, browser_load_extensions_params.BrowserLoadExtensionsParams), files=files, options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -1533,6 +1610,7 @@ async def repl( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> BrowserReplResult: """ Execute JavaScript in a persistent Node.js runtime inside the browser VM. @@ -1568,6 +1646,8 @@ async def repl( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -1582,7 +1662,11 @@ async def repl( browser_repl_params.BrowserReplParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=BrowserReplResult, ) diff --git a/src/kernel/resources/browsers/computer.py b/src/kernel/resources/browsers/computer.py index b40ac897..ba0c9121 100644 --- a/src/kernel/resources/browsers/computer.py +++ b/src/kernel/resources/browsers/computer.py @@ -78,6 +78,7 @@ def batch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Send an array of computer actions to execute in order on the browser instance. @@ -94,6 +95,8 @@ def batch( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -102,7 +105,11 @@ def batch( path_template("/browsers/{id_or_name}/computer/batch", id_or_name=id_or_name), body=maybe_transform({"actions": actions}, computer_batch_params.ComputerBatchParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -118,6 +125,7 @@ def capture_screenshot( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> BinaryAPIResponse: """ Capture a screenshot of the browser instance @@ -130,6 +138,8 @@ def capture_screenshot( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -140,7 +150,11 @@ def capture_screenshot( {"region": region}, computer_capture_screenshot_params.ComputerCaptureScreenshotParams ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=BinaryAPIResponse, ) @@ -161,6 +175,7 @@ def click_mouse( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Simulate a mouse click action on the browser instance @@ -185,6 +200,8 @@ def click_mouse( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -203,7 +220,11 @@ def click_mouse( computer_click_mouse_params.ComputerClickMouseParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -226,6 +247,7 @@ def drag_mouse( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Drag the mouse along a path @@ -258,6 +280,8 @@ def drag_mouse( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -278,7 +302,11 @@ def drag_mouse( computer_drag_mouse_params.ComputerDragMouseParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -293,6 +321,7 @@ def get_mouse_position( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ComputerGetMousePositionResponse: """ Get the current mouse cursor position on the browser instance @@ -305,13 +334,19 @@ def get_mouse_position( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") return self._post( path_template("/browsers/{id_or_name}/computer/get_mouse_position", id_or_name=id_or_name), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ComputerGetMousePositionResponse, ) @@ -331,6 +366,7 @@ def move_mouse( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Move the mouse cursor to the specified coordinates on the browser instance @@ -354,6 +390,8 @@ def move_mouse( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -371,7 +409,11 @@ def move_mouse( computer_move_mouse_params.ComputerMoveMouseParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -389,6 +431,7 @@ def press_key( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Press one or more keys on the host computer @@ -413,6 +456,8 @@ def press_key( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -428,7 +473,11 @@ def press_key( computer_press_key_params.ComputerPressKeyParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -443,6 +492,7 @@ def read_clipboard( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ComputerReadClipboardResponse: """ Read text from the clipboard on the browser instance @@ -455,13 +505,19 @@ def read_clipboard( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") return self._post( path_template("/browsers/{id_or_name}/computer/clipboard/read", id_or_name=id_or_name), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ComputerReadClipboardResponse, ) @@ -481,6 +537,7 @@ def scroll( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Scroll the mouse wheel at a position on the host computer @@ -505,6 +562,8 @@ def scroll( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -522,7 +581,11 @@ def scroll( computer_scroll_params.ComputerScrollParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -538,6 +601,7 @@ def set_cursor_visibility( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ComputerSetCursorVisibilityResponse: """ Set cursor visibility @@ -552,6 +616,8 @@ def set_cursor_visibility( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -561,7 +627,11 @@ def set_cursor_visibility( {"hidden": hidden}, computer_set_cursor_visibility_params.ComputerSetCursorVisibilityParams ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ComputerSetCursorVisibilityResponse, ) @@ -578,6 +648,7 @@ def type_text( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Type text on the browser instance @@ -594,6 +665,8 @@ def type_text( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -608,7 +681,11 @@ def type_text( computer_type_text_params.ComputerTypeTextParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -624,6 +701,7 @@ def write_clipboard( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Write text to the clipboard on the browser instance @@ -638,6 +716,8 @@ def write_clipboard( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -646,7 +726,11 @@ def write_clipboard( path_template("/browsers/{id_or_name}/computer/clipboard/write", id_or_name=id_or_name), body=maybe_transform({"text": text}, computer_write_clipboard_params.ComputerWriteClipboardParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -685,6 +769,7 @@ async def batch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Send an array of computer actions to execute in order on the browser instance. @@ -701,6 +786,8 @@ async def batch( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -709,7 +796,11 @@ async def batch( path_template("/browsers/{id_or_name}/computer/batch", id_or_name=id_or_name), body=await async_maybe_transform({"actions": actions}, computer_batch_params.ComputerBatchParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -725,6 +816,7 @@ async def capture_screenshot( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> AsyncBinaryAPIResponse: """ Capture a screenshot of the browser instance @@ -737,6 +829,8 @@ async def capture_screenshot( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -747,7 +841,11 @@ async def capture_screenshot( {"region": region}, computer_capture_screenshot_params.ComputerCaptureScreenshotParams ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=AsyncBinaryAPIResponse, ) @@ -768,6 +866,7 @@ async def click_mouse( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Simulate a mouse click action on the browser instance @@ -792,6 +891,8 @@ async def click_mouse( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -810,7 +911,11 @@ async def click_mouse( computer_click_mouse_params.ComputerClickMouseParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -833,6 +938,7 @@ async def drag_mouse( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Drag the mouse along a path @@ -865,6 +971,8 @@ async def drag_mouse( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -885,7 +993,11 @@ async def drag_mouse( computer_drag_mouse_params.ComputerDragMouseParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -900,6 +1012,7 @@ async def get_mouse_position( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ComputerGetMousePositionResponse: """ Get the current mouse cursor position on the browser instance @@ -912,13 +1025,19 @@ async def get_mouse_position( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") return await self._post( path_template("/browsers/{id_or_name}/computer/get_mouse_position", id_or_name=id_or_name), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ComputerGetMousePositionResponse, ) @@ -938,6 +1057,7 @@ async def move_mouse( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Move the mouse cursor to the specified coordinates on the browser instance @@ -961,6 +1081,8 @@ async def move_mouse( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -978,7 +1100,11 @@ async def move_mouse( computer_move_mouse_params.ComputerMoveMouseParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -996,6 +1122,7 @@ async def press_key( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Press one or more keys on the host computer @@ -1020,6 +1147,8 @@ async def press_key( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -1035,7 +1164,11 @@ async def press_key( computer_press_key_params.ComputerPressKeyParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -1050,6 +1183,7 @@ async def read_clipboard( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ComputerReadClipboardResponse: """ Read text from the clipboard on the browser instance @@ -1062,13 +1196,19 @@ async def read_clipboard( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") return await self._post( path_template("/browsers/{id_or_name}/computer/clipboard/read", id_or_name=id_or_name), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ComputerReadClipboardResponse, ) @@ -1088,6 +1228,7 @@ async def scroll( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Scroll the mouse wheel at a position on the host computer @@ -1112,6 +1253,8 @@ async def scroll( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -1129,7 +1272,11 @@ async def scroll( computer_scroll_params.ComputerScrollParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -1145,6 +1292,7 @@ async def set_cursor_visibility( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ComputerSetCursorVisibilityResponse: """ Set cursor visibility @@ -1159,6 +1307,8 @@ async def set_cursor_visibility( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -1168,7 +1318,11 @@ async def set_cursor_visibility( {"hidden": hidden}, computer_set_cursor_visibility_params.ComputerSetCursorVisibilityParams ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ComputerSetCursorVisibilityResponse, ) @@ -1185,6 +1339,7 @@ async def type_text( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Type text on the browser instance @@ -1201,6 +1356,8 @@ async def type_text( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -1215,7 +1372,11 @@ async def type_text( computer_type_text_params.ComputerTypeTextParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -1231,6 +1392,7 @@ async def write_clipboard( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Write text to the clipboard on the browser instance @@ -1245,6 +1407,8 @@ async def write_clipboard( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -1255,7 +1419,11 @@ async def write_clipboard( {"text": text}, computer_write_clipboard_params.ComputerWriteClipboardParams ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) diff --git a/src/kernel/resources/browsers/fs/fs.py b/src/kernel/resources/browsers/fs/fs.py index 7496287d..d92e7241 100644 --- a/src/kernel/resources/browsers/fs/fs.py +++ b/src/kernel/resources/browsers/fs/fs.py @@ -108,6 +108,7 @@ def create_directory( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Create a new directory @@ -124,6 +125,8 @@ def create_directory( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -138,7 +141,11 @@ def create_directory( f_create_directory_params.FCreateDirectoryParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -154,6 +161,7 @@ def delete_directory( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Delete a directory @@ -168,6 +176,8 @@ def delete_directory( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -176,7 +186,11 @@ def delete_directory( path_template("/browsers/{id_or_name}/fs/delete_directory", id_or_name=id_or_name), body=maybe_transform({"path": path}, f_delete_directory_params.FDeleteDirectoryParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -192,6 +206,7 @@ def delete_file( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Delete a file @@ -206,6 +221,8 @@ def delete_file( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -214,7 +231,11 @@ def delete_file( path_template("/browsers/{id_or_name}/fs/delete_file", id_or_name=id_or_name), body=maybe_transform({"path": path}, f_delete_file_params.FDeleteFileParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -352,6 +373,7 @@ def move( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Move or rename a file or directory @@ -368,6 +390,8 @@ def move( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -382,7 +406,11 @@ def move( f_move_params.FMoveParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -442,6 +470,7 @@ def set_file_permissions( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Set file or directory permissions/ownership @@ -462,6 +491,8 @@ def set_file_permissions( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -478,7 +509,11 @@ def set_file_permissions( f_set_file_permissions_params.FSetFilePermissionsParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -494,6 +529,7 @@ def upload( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Allows uploading single or multiple files to the remote filesystem. @@ -506,6 +542,8 @@ def upload( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -526,7 +564,11 @@ def upload( body=indexed_multipart_body(maybe_transform(body, f_upload_params.FUploadParams)), files=extracted_files, options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -543,6 +585,7 @@ def upload_zip( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Upload a zip file and extract its contents to the specified destination path. @@ -557,6 +600,8 @@ def upload_zip( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -578,7 +623,11 @@ def upload_zip( body=maybe_transform(body, f_upload_zip_params.FUploadZipParams), files=files, options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -596,6 +645,7 @@ def write_file( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Write or create a file @@ -612,6 +662,8 @@ def write_file( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -625,6 +677,7 @@ def write_file( extra_query=extra_query, extra_body=extra_body, timeout=timeout, + idempotency_key=idempotency_key, query=maybe_transform( { "path": path, @@ -676,6 +729,7 @@ async def create_directory( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Create a new directory @@ -692,6 +746,8 @@ async def create_directory( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -706,7 +762,11 @@ async def create_directory( f_create_directory_params.FCreateDirectoryParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -722,6 +782,7 @@ async def delete_directory( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Delete a directory @@ -736,6 +797,8 @@ async def delete_directory( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -744,7 +807,11 @@ async def delete_directory( path_template("/browsers/{id_or_name}/fs/delete_directory", id_or_name=id_or_name), body=await async_maybe_transform({"path": path}, f_delete_directory_params.FDeleteDirectoryParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -760,6 +827,7 @@ async def delete_file( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Delete a file @@ -774,6 +842,8 @@ async def delete_file( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -782,7 +852,11 @@ async def delete_file( path_template("/browsers/{id_or_name}/fs/delete_file", id_or_name=id_or_name), body=await async_maybe_transform({"path": path}, f_delete_file_params.FDeleteFileParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -920,6 +994,7 @@ async def move( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Move or rename a file or directory @@ -936,6 +1011,8 @@ async def move( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -950,7 +1027,11 @@ async def move( f_move_params.FMoveParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -1010,6 +1091,7 @@ async def set_file_permissions( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Set file or directory permissions/ownership @@ -1030,6 +1112,8 @@ async def set_file_permissions( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -1046,7 +1130,11 @@ async def set_file_permissions( f_set_file_permissions_params.FSetFilePermissionsParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -1062,6 +1150,7 @@ async def upload( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Allows uploading single or multiple files to the remote filesystem. @@ -1074,6 +1163,8 @@ async def upload( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -1094,7 +1185,11 @@ async def upload( body=indexed_multipart_body(await async_maybe_transform(body, f_upload_params.FUploadParams)), files=extracted_files, options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -1111,6 +1206,7 @@ async def upload_zip( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Upload a zip file and extract its contents to the specified destination path. @@ -1125,6 +1221,8 @@ async def upload_zip( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -1146,7 +1244,11 @@ async def upload_zip( body=await async_maybe_transform(body, f_upload_zip_params.FUploadZipParams), files=files, options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -1164,6 +1266,7 @@ async def write_file( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Write or create a file @@ -1180,6 +1283,8 @@ async def write_file( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -1193,6 +1298,7 @@ async def write_file( extra_query=extra_query, extra_body=extra_body, timeout=timeout, + idempotency_key=idempotency_key, query=await async_maybe_transform( { "path": path, diff --git a/src/kernel/resources/browsers/fs/watch.py b/src/kernel/resources/browsers/fs/watch.py index 06ba75ef..894b6086 100644 --- a/src/kernel/resources/browsers/fs/watch.py +++ b/src/kernel/resources/browsers/fs/watch.py @@ -98,6 +98,7 @@ def start( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> WatchStartResponse: """ Watch a directory for changes @@ -114,6 +115,8 @@ def start( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -127,7 +130,11 @@ def start( watch_start_params.WatchStartParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=WatchStartResponse, ) @@ -143,6 +150,7 @@ def stop( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Stop watching a directory @@ -155,6 +163,8 @@ def stop( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -164,7 +174,11 @@ def stop( return self._delete( path_template("/browsers/{id_or_name}/fs/watch/{watch_id}", id_or_name=id_or_name, watch_id=watch_id), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -245,6 +259,7 @@ async def start( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> WatchStartResponse: """ Watch a directory for changes @@ -261,6 +276,8 @@ async def start( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -274,7 +291,11 @@ async def start( watch_start_params.WatchStartParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=WatchStartResponse, ) @@ -290,6 +311,7 @@ async def stop( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Stop watching a directory @@ -302,6 +324,8 @@ async def stop( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -311,7 +335,11 @@ async def stop( return await self._delete( path_template("/browsers/{id_or_name}/fs/watch/{watch_id}", id_or_name=id_or_name, watch_id=watch_id), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) diff --git a/src/kernel/resources/browsers/playwright/executors.py b/src/kernel/resources/browsers/playwright/executors.py index 11d78f10..d072fc5e 100644 --- a/src/kernel/resources/browsers/playwright/executors.py +++ b/src/kernel/resources/browsers/playwright/executors.py @@ -93,6 +93,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """Stops the executor's process. @@ -120,6 +121,8 @@ def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -133,6 +136,7 @@ def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, + idempotency_key=idempotency_key, query=maybe_transform({"close_tab": close_tab}, executor_delete_params.ExecutorDeleteParams), ), cast_to=NoneType, @@ -211,6 +215,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """Stops the executor's process. @@ -238,6 +243,8 @@ async def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -251,6 +258,7 @@ async def delete( extra_query=extra_query, extra_body=extra_body, timeout=timeout, + idempotency_key=idempotency_key, query=await async_maybe_transform( {"close_tab": close_tab}, executor_delete_params.ExecutorDeleteParams ), diff --git a/src/kernel/resources/browsers/playwright/playwright.py b/src/kernel/resources/browsers/playwright/playwright.py index 00f5f10e..f2220b5a 100644 --- a/src/kernel/resources/browsers/playwright/playwright.py +++ b/src/kernel/resources/browsers/playwright/playwright.py @@ -73,6 +73,7 @@ def execute( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> PlaywrightExecuteResponse: """ Execute arbitrary Playwright code in a fresh execution context against the @@ -135,6 +136,8 @@ def execute( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -149,7 +152,11 @@ def execute( playwright_execute_params.PlaywrightExecuteParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=PlaywrightExecuteResponse, ) @@ -199,6 +206,7 @@ async def execute( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> PlaywrightExecuteResponse: """ Execute arbitrary Playwright code in a fresh execution context against the @@ -261,6 +269,8 @@ async def execute( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -275,7 +285,11 @@ async def execute( playwright_execute_params.PlaywrightExecuteParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=PlaywrightExecuteResponse, ) diff --git a/src/kernel/resources/browsers/process.py b/src/kernel/resources/browsers/process.py index c792148d..bd7d1665 100644 --- a/src/kernel/resources/browsers/process.py +++ b/src/kernel/resources/browsers/process.py @@ -76,6 +76,7 @@ def exec( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ProcessExecResponse: """ Execute a command synchronously @@ -102,6 +103,8 @@ def exec( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -120,7 +123,11 @@ def exec( process_exec_params.ProcessExecParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ProcessExecResponse, ) @@ -137,6 +144,7 @@ def kill( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ProcessKillResponse: """ Send signal to process @@ -151,6 +159,8 @@ def kill( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -162,7 +172,11 @@ def kill( ), body=maybe_transform({"signal": signal}, process_kill_params.ProcessKillParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ProcessKillResponse, ) @@ -180,6 +194,7 @@ def resize( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ProcessResizeResponse: """ Resize a PTY-backed process terminal @@ -196,6 +211,8 @@ def resize( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -213,7 +230,11 @@ def resize( process_resize_params.ProcessResizeParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ProcessResizeResponse, ) @@ -238,6 +259,7 @@ def spawn( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ProcessSpawnResponse: """ Execute a command asynchronously @@ -270,6 +292,8 @@ def spawn( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -291,7 +315,11 @@ def spawn( process_spawn_params.ProcessSpawnParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ProcessSpawnResponse, ) @@ -346,6 +374,7 @@ def stdin( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ProcessStdinResponse: """ Write to process stdin @@ -360,6 +389,8 @@ def stdin( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -371,7 +402,11 @@ def stdin( ), body=maybe_transform({"data_b64": data_b64}, process_stdin_params.ProcessStdinParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ProcessStdinResponse, ) @@ -459,6 +494,7 @@ async def exec( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ProcessExecResponse: """ Execute a command synchronously @@ -485,6 +521,8 @@ async def exec( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -503,7 +541,11 @@ async def exec( process_exec_params.ProcessExecParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ProcessExecResponse, ) @@ -520,6 +562,7 @@ async def kill( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ProcessKillResponse: """ Send signal to process @@ -534,6 +577,8 @@ async def kill( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -545,7 +590,11 @@ async def kill( ), body=await async_maybe_transform({"signal": signal}, process_kill_params.ProcessKillParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ProcessKillResponse, ) @@ -563,6 +612,7 @@ async def resize( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ProcessResizeResponse: """ Resize a PTY-backed process terminal @@ -579,6 +629,8 @@ async def resize( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -596,7 +648,11 @@ async def resize( process_resize_params.ProcessResizeParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ProcessResizeResponse, ) @@ -621,6 +677,7 @@ async def spawn( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ProcessSpawnResponse: """ Execute a command asynchronously @@ -653,6 +710,8 @@ async def spawn( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -674,7 +733,11 @@ async def spawn( process_spawn_params.ProcessSpawnParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ProcessSpawnResponse, ) @@ -729,6 +792,7 @@ async def stdin( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ProcessStdinResponse: """ Write to process stdin @@ -743,6 +807,8 @@ async def stdin( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -754,7 +820,11 @@ async def stdin( ), body=await async_maybe_transform({"data_b64": data_b64}, process_stdin_params.ProcessStdinParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ProcessStdinResponse, ) diff --git a/src/kernel/resources/browsers/replays.py b/src/kernel/resources/browsers/replays.py index d74ce81c..ad2bc803 100644 --- a/src/kernel/resources/browsers/replays.py +++ b/src/kernel/resources/browsers/replays.py @@ -135,6 +135,7 @@ def start( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ReplayStartResponse: """ Start recording the browser session and return a replay ID. @@ -155,6 +156,8 @@ def start( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -169,7 +172,11 @@ def start( replay_start_params.ReplayStartParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ReplayStartResponse, ) @@ -185,6 +192,7 @@ def stop( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Stop the specified replay recording and persist the video. @@ -197,6 +205,8 @@ def stop( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -208,7 +218,11 @@ def stop( "/browsers/{id_or_name}/replays/{replay_id}/stop", id_or_name=id_or_name, replay_id=replay_id ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -319,6 +333,7 @@ async def start( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ReplayStartResponse: """ Start recording the browser session and return a replay ID. @@ -339,6 +354,8 @@ async def start( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -353,7 +370,11 @@ async def start( replay_start_params.ReplayStartParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ReplayStartResponse, ) @@ -369,6 +390,7 @@ async def stop( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Stop the specified replay recording and persist the video. @@ -381,6 +403,8 @@ async def stop( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -392,7 +416,11 @@ async def stop( "/browsers/{id_or_name}/replays/{replay_id}/stop", id_or_name=id_or_name, replay_id=replay_id ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) diff --git a/src/kernel/resources/browsers/webmcp/custom_tools.py b/src/kernel/resources/browsers/webmcp/custom_tools.py index e5126306..a7ecc9a3 100644 --- a/src/kernel/resources/browsers/webmcp/custom_tools.py +++ b/src/kernel/resources/browsers/webmcp/custom_tools.py @@ -90,6 +90,7 @@ def add( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> CustomToolsResponse: """Add a namespaced batch of custom tools. @@ -122,6 +123,8 @@ def add( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -136,7 +139,11 @@ def add( custom_tool_add_params.CustomToolAddParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=CustomToolsResponse, ) @@ -152,6 +159,7 @@ def remove( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """Removes one custom tool by generated ID. @@ -166,6 +174,8 @@ def remove( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -175,7 +185,11 @@ def remove( return self._delete( path_template("/browsers/{id_or_name}/webmcp/custom-tools/{id}", id_or_name=id_or_name, id=id), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -250,6 +264,7 @@ async def add( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> CustomToolsResponse: """Add a namespaced batch of custom tools. @@ -282,6 +297,8 @@ async def add( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -296,7 +313,11 @@ async def add( custom_tool_add_params.CustomToolAddParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=CustomToolsResponse, ) @@ -312,6 +333,7 @@ async def remove( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """Removes one custom tool by generated ID. @@ -326,6 +348,8 @@ async def remove( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -335,7 +359,11 @@ async def remove( return await self._delete( path_template("/browsers/{id_or_name}/webmcp/custom-tools/{id}", id_or_name=id_or_name, id=id), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) diff --git a/src/kernel/resources/browsers/webmcp/webmcp.py b/src/kernel/resources/browsers/webmcp/webmcp.py index dc030e34..5cab5b8f 100644 --- a/src/kernel/resources/browsers/webmcp/webmcp.py +++ b/src/kernel/resources/browsers/webmcp/webmcp.py @@ -72,6 +72,7 @@ def invoke_tool( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> InvocationResult: """Invokes the exact live registration identified by tool_ref. @@ -95,6 +96,8 @@ def invoke_tool( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -109,7 +112,11 @@ def invoke_tool( webmcp_invoke_tool_params.WebmcpInvokeToolParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=InvocationResult, ) @@ -202,6 +209,7 @@ async def invoke_tool( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> InvocationResult: """Invokes the exact live registration identified by tool_ref. @@ -225,6 +233,8 @@ async def invoke_tool( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -239,7 +249,11 @@ async def invoke_tool( webmcp_invoke_tool_params.WebmcpInvokeToolParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=InvocationResult, ) diff --git a/src/kernel/resources/config_registry/analyses.py b/src/kernel/resources/config_registry/analyses.py index bbaeff64..cb81b211 100644 --- a/src/kernel/resources/config_registry/analyses.py +++ b/src/kernel/resources/config_registry/analyses.py @@ -194,6 +194,7 @@ def cancel( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ConfigRegistryResponse: """Requests cancellation of a running project-scoped analysis. @@ -210,13 +211,19 @@ def cancel( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( path_template("/config-registry/analyses/{id}/cancel", id=id), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ConfigRegistryResponse, ) @@ -384,6 +391,7 @@ async def cancel( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ConfigRegistryResponse: """Requests cancellation of a running project-scoped analysis. @@ -400,13 +408,19 @@ async def cancel( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._post( path_template("/config-registry/analyses/{id}/cancel", id=id), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ConfigRegistryResponse, ) diff --git a/src/kernel/resources/config_registry/config_registry.py b/src/kernel/resources/config_registry/config_registry.py index 39faa9f5..3318c826 100644 --- a/src/kernel/resources/config_registry/config_registry.py +++ b/src/kernel/resources/config_registry/config_registry.py @@ -126,6 +126,7 @@ def lookup( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> LookupResponse: """ Returns current global knowledge without resolving DNS, creating an analysis, or @@ -144,6 +145,8 @@ def lookup( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return self._post( "/config-registry/lookup", @@ -155,7 +158,11 @@ def lookup( config_registry_lookup_params.ConfigRegistryLookupParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=LookupResponse, ) @@ -172,6 +179,7 @@ def resolve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ConfigRegistryResponse: """ Explicitly starts or retries a project-scoped background analysis while @@ -201,6 +209,8 @@ def resolve( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return self._post( "/config-registry/resolve", @@ -213,7 +223,11 @@ def resolve( config_registry_resolve_params.ConfigRegistryResolveParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ConfigRegistryResponse, ) @@ -311,6 +325,7 @@ async def lookup( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> LookupResponse: """ Returns current global knowledge without resolving DNS, creating an analysis, or @@ -329,6 +344,8 @@ async def lookup( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return await self._post( "/config-registry/lookup", @@ -340,7 +357,11 @@ async def lookup( config_registry_lookup_params.ConfigRegistryLookupParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=LookupResponse, ) @@ -357,6 +378,7 @@ async def resolve( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ConfigRegistryResponse: """ Explicitly starts or retries a project-scoped background analysis while @@ -386,6 +408,8 @@ async def resolve( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return await self._post( "/config-registry/resolve", @@ -398,7 +422,11 @@ async def resolve( config_registry_resolve_params.ConfigRegistryResolveParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ConfigRegistryResponse, ) diff --git a/src/kernel/resources/credential_providers.py b/src/kernel/resources/credential_providers.py index 6a003f99..4f307a3e 100644 --- a/src/kernel/resources/credential_providers.py +++ b/src/kernel/resources/credential_providers.py @@ -65,6 +65,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> CredentialProvider: """ Configure an external credential provider (e.g., 1Password) for automatic @@ -87,6 +88,8 @@ def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return self._post( "/org/credential_providers", @@ -100,7 +103,11 @@ def create( credential_provider_create_params.CredentialProviderCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=CredentialProvider, ) @@ -153,6 +160,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> CredentialProvider: """ Update a credential provider's configuration. @@ -176,6 +184,8 @@ def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -192,7 +202,11 @@ def update( credential_provider_update_params.CredentialProviderUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=CredentialProvider, ) @@ -259,6 +273,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Delete a credential provider by its ID. @@ -271,6 +286,8 @@ def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -278,7 +295,11 @@ def delete( return self._delete( path_template("/org/credential_providers/{id}", id=id), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -327,6 +348,7 @@ def test( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> CredentialProviderTestResult: """ Validate the credential provider's token and list accessible vaults. @@ -339,13 +361,19 @@ def test( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._post( path_template("/org/credential_providers/{id}/test", id=id), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=CredentialProviderTestResult, ) @@ -386,6 +414,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> CredentialProvider: """ Configure an external credential provider (e.g., 1Password) for automatic @@ -408,6 +437,8 @@ async def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return await self._post( "/org/credential_providers", @@ -421,7 +452,11 @@ async def create( credential_provider_create_params.CredentialProviderCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=CredentialProvider, ) @@ -474,6 +509,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> CredentialProvider: """ Update a credential provider's configuration. @@ -497,6 +533,8 @@ async def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -513,7 +551,11 @@ async def update( credential_provider_update_params.CredentialProviderUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=CredentialProvider, ) @@ -580,6 +622,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Delete a credential provider by its ID. @@ -592,6 +635,8 @@ async def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -599,7 +644,11 @@ async def delete( return await self._delete( path_template("/org/credential_providers/{id}", id=id), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -648,6 +697,7 @@ async def test( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> CredentialProviderTestResult: """ Validate the credential provider's token and list accessible vaults. @@ -660,13 +710,19 @@ async def test( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._post( path_template("/org/credential_providers/{id}/test", id=id), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=CredentialProviderTestResult, ) diff --git a/src/kernel/resources/credentials.py b/src/kernel/resources/credentials.py index 47eb0aad..ff0fa864 100644 --- a/src/kernel/resources/credentials.py +++ b/src/kernel/resources/credentials.py @@ -65,6 +65,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> Credential: """ Create a new credential for storing login information. @@ -103,6 +104,8 @@ def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return self._post( "/credentials", @@ -120,7 +123,11 @@ def create( credential_create_params.CredentialCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=Credential, ) @@ -177,6 +184,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> Credential: """Update a credential's name or values. @@ -217,6 +225,8 @@ def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -236,7 +246,11 @@ def update( credential_update_params.CredentialUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=Credential, ) @@ -308,6 +322,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Delete a credential by its ID or name. @@ -320,6 +335,8 @@ def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -327,7 +344,11 @@ def delete( return self._delete( path_template("/credentials/{id_or_name}", id_or_name=id_or_name), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -407,6 +428,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> Credential: """ Create a new credential for storing login information. @@ -445,6 +467,8 @@ async def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return await self._post( "/credentials", @@ -462,7 +486,11 @@ async def create( credential_create_params.CredentialCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=Credential, ) @@ -519,6 +547,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> Credential: """Update a credential's name or values. @@ -559,6 +588,8 @@ async def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -578,7 +609,11 @@ async def update( credential_update_params.CredentialUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=Credential, ) @@ -650,6 +685,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Delete a credential by its ID or name. @@ -662,6 +698,8 @@ async def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -669,7 +707,11 @@ async def delete( return await self._delete( path_template("/credentials/{id_or_name}", id_or_name=id_or_name), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) diff --git a/src/kernel/resources/deployments.py b/src/kernel/resources/deployments.py index c6de9212..5c2668a1 100644 --- a/src/kernel/resources/deployments.py +++ b/src/kernel/resources/deployments.py @@ -68,6 +68,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> DeploymentCreateResponse: """ Create a new deployment. @@ -95,6 +96,8 @@ def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ body = deepcopy_with_paths( { @@ -118,7 +121,11 @@ def create( body=maybe_transform(body, deployment_create_params.DeploymentCreateParams), files=files, options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=DeploymentCreateResponse, ) @@ -226,6 +233,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """Stops a running deployment and marks it for deletion. @@ -240,6 +248,8 @@ def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -247,7 +257,11 @@ def delete( return self._delete( path_template("/deployments/{id}", id=id), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -338,6 +352,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> DeploymentCreateResponse: """ Create a new deployment. @@ -365,6 +380,8 @@ async def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ body = deepcopy_with_paths( { @@ -388,7 +405,11 @@ async def create( body=await async_maybe_transform(body, deployment_create_params.DeploymentCreateParams), files=files, options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=DeploymentCreateResponse, ) @@ -496,6 +517,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """Stops a running deployment and marks it for deletion. @@ -510,6 +532,8 @@ async def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -517,7 +541,11 @@ async def delete( return await self._delete( path_template("/deployments/{id}", id=id), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) diff --git a/src/kernel/resources/extensions.py b/src/kernel/resources/extensions.py index 81a1ff9a..8fb6128d 100644 --- a/src/kernel/resources/extensions.py +++ b/src/kernel/resources/extensions.py @@ -127,6 +127,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Delete an extension by its ID or by its name. @@ -139,6 +140,8 @@ def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -146,7 +149,11 @@ def delete( return self._delete( path_template("/extensions/{id_or_name}", id_or_name=id_or_name), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -278,6 +285,7 @@ def upload( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ExtensionUploadResponse: """Upload a zip file containing an unpacked browser extension. @@ -296,6 +304,8 @@ def upload( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ body = deepcopy_with_paths( { @@ -314,7 +324,11 @@ def upload( body=maybe_transform(body, extension_upload_params.ExtensionUploadParams), files=files, options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ExtensionUploadResponse, ) @@ -411,6 +425,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Delete an extension by its ID or by its name. @@ -423,6 +438,8 @@ async def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -430,7 +447,11 @@ async def delete( return await self._delete( path_template("/extensions/{id_or_name}", id_or_name=id_or_name), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -562,6 +583,7 @@ async def upload( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ExtensionUploadResponse: """Upload a zip file containing an unpacked browser extension. @@ -580,6 +602,8 @@ async def upload( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ body = deepcopy_with_paths( { @@ -598,7 +622,11 @@ async def upload( body=await async_maybe_transform(body, extension_upload_params.ExtensionUploadParams), files=files, options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ExtensionUploadResponse, ) diff --git a/src/kernel/resources/invocations.py b/src/kernel/resources/invocations.py index 30db7dac..bfdf9cff 100644 --- a/src/kernel/resources/invocations.py +++ b/src/kernel/resources/invocations.py @@ -68,6 +68,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> InvocationCreateResponse: """ Invoke an action. @@ -94,6 +95,8 @@ def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return self._post( "/invocations", @@ -109,7 +112,11 @@ def create( invocation_create_params.InvocationCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=InvocationCreateResponse, ) @@ -159,6 +166,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> InvocationUpdateResponse: """Update an invocation's status or output. @@ -177,6 +185,8 @@ def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -190,7 +200,11 @@ def update( invocation_update_params.InvocationUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=InvocationUpdateResponse, ) @@ -283,6 +297,7 @@ def delete_browsers( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Delete all browser sessions created within the specified invocation. @@ -295,6 +310,8 @@ def delete_browsers( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -302,7 +319,11 @@ def delete_browsers( return self._delete( path_template("/invocations/{id}/browsers", id=id), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -425,6 +446,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> InvocationCreateResponse: """ Invoke an action. @@ -451,6 +473,8 @@ async def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return await self._post( "/invocations", @@ -466,7 +490,11 @@ async def create( invocation_create_params.InvocationCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=InvocationCreateResponse, ) @@ -516,6 +544,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> InvocationUpdateResponse: """Update an invocation's status or output. @@ -534,6 +563,8 @@ async def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -547,7 +578,11 @@ async def update( invocation_update_params.InvocationUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=InvocationUpdateResponse, ) @@ -640,6 +675,7 @@ async def delete_browsers( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Delete all browser sessions created within the specified invocation. @@ -652,6 +688,8 @@ async def delete_browsers( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -659,7 +697,11 @@ async def delete_browsers( return await self._delete( path_template("/invocations/{id}/browsers", id=id), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) diff --git a/src/kernel/resources/organization/limits.py b/src/kernel/resources/organization/limits.py index 5654164b..1b85d3f2 100644 --- a/src/kernel/resources/organization/limits.py +++ b/src/kernel/resources/organization/limits.py @@ -77,6 +77,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> OrgLimits: """ Set the default per-project concurrency cap applied to projects without an @@ -95,6 +96,8 @@ def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return self._patch( "/org/limits", @@ -103,7 +106,11 @@ def update( limit_update_params.LimitUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=OrgLimits, ) @@ -163,6 +170,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> OrgLimits: """ Set the default per-project concurrency cap applied to projects without an @@ -181,6 +189,8 @@ async def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return await self._patch( "/org/limits", @@ -189,7 +199,11 @@ async def update( limit_update_params.LimitUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=OrgLimits, ) diff --git a/src/kernel/resources/profiles.py b/src/kernel/resources/profiles.py index 8642940c..da8689e6 100644 --- a/src/kernel/resources/profiles.py +++ b/src/kernel/resources/profiles.py @@ -64,6 +64,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> Profile: """ Create a browser profile that can be used to load state into future browser @@ -81,12 +82,18 @@ def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return self._post( "/profiles", body=maybe_transform({"name": name}, profile_create_params.ProfileCreateParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=Profile, ) @@ -135,6 +142,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> Profile: """Update a profile's name. @@ -158,6 +166,8 @@ def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -165,7 +175,11 @@ def update( path_template("/profiles/{id_or_name}", id_or_name=id_or_name), body=maybe_transform({"name": name}, profile_update_params.ProfileUpdateParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=Profile, ) @@ -238,6 +252,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Delete a profile by its ID or by its name. @@ -250,6 +265,8 @@ def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -257,7 +274,11 @@ def delete( return self._delete( path_template("/profiles/{id_or_name}", id_or_name=id_or_name), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -341,6 +362,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> Profile: """ Create a browser profile that can be used to load state into future browser @@ -358,12 +380,18 @@ async def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return await self._post( "/profiles", body=await async_maybe_transform({"name": name}, profile_create_params.ProfileCreateParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=Profile, ) @@ -412,6 +440,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> Profile: """Update a profile's name. @@ -435,6 +464,8 @@ async def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -442,7 +473,11 @@ async def update( path_template("/profiles/{id_or_name}", id_or_name=id_or_name), body=await async_maybe_transform({"name": name}, profile_update_params.ProfileUpdateParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=Profile, ) @@ -515,6 +550,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Delete a profile by its ID or by its name. @@ -527,6 +563,8 @@ async def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -534,7 +572,11 @@ async def delete( return await self._delete( path_template("/profiles/{id_or_name}", id_or_name=id_or_name), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) diff --git a/src/kernel/resources/projects/limits.py b/src/kernel/resources/projects/limits.py index ef95b4d0..502c98fa 100644 --- a/src/kernel/resources/projects/limits.py +++ b/src/kernel/resources/projects/limits.py @@ -97,6 +97,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ProjectLimits: """Update resource limit overrides for a project. @@ -122,6 +123,8 @@ def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -136,7 +139,11 @@ def update( limit_update_params.LimitUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ProjectLimits, ) @@ -216,6 +223,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ProjectLimits: """Update resource limit overrides for a project. @@ -241,6 +249,8 @@ async def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -255,7 +265,11 @@ async def update( limit_update_params.LimitUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ProjectLimits, ) diff --git a/src/kernel/resources/projects/projects.py b/src/kernel/resources/projects/projects.py index ca519a75..42b54d3d 100644 --- a/src/kernel/resources/projects/projects.py +++ b/src/kernel/resources/projects/projects.py @@ -77,6 +77,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> Project: """ Create a new project within the authenticated organization. @@ -91,12 +92,18 @@ def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return self._post( "/org/projects", body=maybe_transform({"name": name}, project_create_params.ProjectCreateParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=Project, ) @@ -147,6 +154,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> Project: """ Update a project's name or status. @@ -163,6 +171,8 @@ def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -176,7 +186,11 @@ def update( project_update_params.ProjectUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=Project, ) @@ -247,6 +261,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """Soft-delete a project. @@ -260,6 +275,8 @@ def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -267,7 +284,11 @@ def delete( return self._delete( path_template("/org/projects/{id_or_name}", id_or_name=id_or_name), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -318,6 +339,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> Project: """ Create a new project within the authenticated organization. @@ -332,12 +354,18 @@ async def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return await self._post( "/org/projects", body=await async_maybe_transform({"name": name}, project_create_params.ProjectCreateParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=Project, ) @@ -388,6 +416,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> Project: """ Update a project's name or status. @@ -404,6 +433,8 @@ async def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -417,7 +448,11 @@ async def update( project_update_params.ProjectUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=Project, ) @@ -488,6 +523,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """Soft-delete a project. @@ -501,6 +537,8 @@ async def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -508,7 +546,11 @@ async def delete( return await self._delete( path_template("/org/projects/{id_or_name}", id_or_name=id_or_name), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) diff --git a/src/kernel/resources/proxies.py b/src/kernel/resources/proxies.py index 4b0d3458..d135b3b8 100644 --- a/src/kernel/resources/proxies.py +++ b/src/kernel/resources/proxies.py @@ -64,6 +64,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ProxyCreateResponse: """ Create a new proxy configuration in the resolved project. @@ -84,6 +85,8 @@ def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return self._post( "/proxies", @@ -98,7 +101,11 @@ def create( proxy_create_params.ProxyCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ProxyCreateResponse, ) @@ -150,6 +157,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ProxyUpdateResponse: """Update a proxy's name. @@ -167,6 +175,8 @@ def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -174,7 +184,11 @@ def update( path_template("/proxies/{id_or_name}", id_or_name=id_or_name), body=maybe_transform({"name": name}, proxy_update_params.ProxyUpdateParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ProxyUpdateResponse, ) @@ -247,6 +261,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """Soft delete a proxy. @@ -263,6 +278,8 @@ def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -270,7 +287,11 @@ def delete( return self._delete( path_template("/proxies/{id_or_name}", id_or_name=id_or_name), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -286,6 +307,7 @@ def check( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ProxyCheckResponse: """Run a health check on the proxy to verify it's working. @@ -317,6 +339,8 @@ def check( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -324,7 +348,11 @@ def check( path_template("/proxies/{id_or_name}/check", id_or_name=id_or_name), body=maybe_transform({"url": url}, proxy_check_params.ProxyCheckParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ProxyCheckResponse, ) @@ -366,6 +394,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ProxyCreateResponse: """ Create a new proxy configuration in the resolved project. @@ -386,6 +415,8 @@ async def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return await self._post( "/proxies", @@ -400,7 +431,11 @@ async def create( proxy_create_params.ProxyCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ProxyCreateResponse, ) @@ -452,6 +487,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ProxyUpdateResponse: """Update a proxy's name. @@ -469,6 +505,8 @@ async def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -476,7 +514,11 @@ async def update( path_template("/proxies/{id_or_name}", id_or_name=id_or_name), body=await async_maybe_transform({"name": name}, proxy_update_params.ProxyUpdateParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ProxyUpdateResponse, ) @@ -549,6 +591,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """Soft delete a proxy. @@ -565,6 +608,8 @@ async def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -572,7 +617,11 @@ async def delete( return await self._delete( path_template("/proxies/{id_or_name}", id_or_name=id_or_name), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -588,6 +637,7 @@ async def check( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> ProxyCheckResponse: """Run a health check on the proxy to verify it's working. @@ -619,6 +669,8 @@ async def check( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -626,7 +678,11 @@ async def check( path_template("/proxies/{id_or_name}/check", id_or_name=id_or_name), body=await async_maybe_transform({"url": url}, proxy_check_params.ProxyCheckParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=ProxyCheckResponse, ) diff --git a/src/kernel/resources/search/contents.py b/src/kernel/resources/search/contents.py index 4704eabd..9e8a0659 100644 --- a/src/kernel/resources/search/contents.py +++ b/src/kernel/resources/search/contents.py @@ -57,6 +57,7 @@ def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> Response: """Retrieves selected results from a retained search. @@ -88,6 +89,8 @@ def fetch( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -103,7 +106,11 @@ def fetch( content_fetch_params.ContentFetchParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=Response, ) @@ -145,6 +152,7 @@ async def fetch( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> Response: """Retrieves selected results from a retained search. @@ -176,6 +184,8 @@ async def fetch( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") @@ -191,7 +201,11 @@ async def fetch( content_fetch_params.ContentFetchParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=Response, ) diff --git a/src/kernel/resources/search/search.py b/src/kernel/resources/search/search.py index 850363c6..0753d16f 100644 --- a/src/kernel/resources/search/search.py +++ b/src/kernel/resources/search/search.py @@ -98,6 +98,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> Search: """Returns ranked results from one serving provider. @@ -176,6 +177,8 @@ def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return self._post( "/search", @@ -200,7 +203,11 @@ def create( search_create_params.SearchCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=Search, ) @@ -301,6 +308,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> Search: """Returns ranked results from one serving provider. @@ -379,6 +387,8 @@ async def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return await self._post( "/search", @@ -403,7 +413,11 @@ async def create( search_create_params.SearchCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=Search, ) diff --git a/src/kernel/resources/telemetry/destinations.py b/src/kernel/resources/telemetry/destinations.py index 4d6592fc..e2833e9b 100644 --- a/src/kernel/resources/telemetry/destinations.py +++ b/src/kernel/resources/telemetry/destinations.py @@ -61,6 +61,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> OtlpDestination: """Create an OTLP export destination in the authenticated organization. @@ -96,6 +97,8 @@ def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return self._post( "/telemetry/destinations", @@ -109,7 +112,11 @@ def create( destination_create_params.DestinationCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=OtlpDestination, ) @@ -164,6 +171,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> OtlpDestination: """Update an OTLP destination. @@ -196,6 +204,8 @@ def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -211,7 +221,11 @@ def update( destination_update_params.DestinationUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=OtlpDestination, ) @@ -287,6 +301,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """Delete an OTLP destination. @@ -306,6 +321,8 @@ def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -313,7 +330,11 @@ def delete( return self._delete( path_template("/telemetry/destinations/{id_or_name}", id_or_name=id_or_name), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -356,6 +377,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> OtlpDestination: """Create an OTLP export destination in the authenticated organization. @@ -391,6 +413,8 @@ async def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return await self._post( "/telemetry/destinations", @@ -404,7 +428,11 @@ async def create( destination_create_params.DestinationCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=OtlpDestination, ) @@ -459,6 +487,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> OtlpDestination: """Update an OTLP destination. @@ -491,6 +520,8 @@ async def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -506,7 +537,11 @@ async def update( destination_update_params.DestinationUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=OtlpDestination, ) @@ -582,6 +617,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """Delete an OTLP destination. @@ -601,6 +637,8 @@ async def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -608,7 +646,11 @@ async def delete( return await self._delete( path_template("/telemetry/destinations/{id_or_name}", id_or_name=id_or_name), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) diff --git a/src/kernel/resources/vault_provider_configs.py b/src/kernel/resources/vault_provider_configs.py index 69f29d3d..7ee07185 100644 --- a/src/kernel/resources/vault_provider_configs.py +++ b/src/kernel/resources/vault_provider_configs.py @@ -62,6 +62,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultProviderConfig: """Register a configuration shared across the organization's projects. @@ -81,6 +82,8 @@ def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -97,6 +100,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultProviderConfig: """Register a configuration shared across the organization's projects. @@ -116,6 +120,8 @@ def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -133,6 +139,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultProviderConfig: return cast( VaultProviderConfig, @@ -147,7 +154,11 @@ def create( vault_provider_config_create_params.VaultProviderConfigCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=cast( Any, VaultProviderConfig @@ -207,6 +218,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultProviderConfig: """Update the supplied fields; omitted fields remain unchanged. @@ -227,6 +239,8 @@ def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -242,7 +256,11 @@ def update( vault_provider_config_update_params.VaultProviderConfigUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=cast( Any, VaultProviderConfig @@ -303,6 +321,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """Delete a configuration in the organization. @@ -320,6 +339,8 @@ def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -327,7 +348,11 @@ def delete( return self._delete( path_template("/vault-provider-configs/{id_or_name}", id_or_name=id_or_name), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -366,6 +391,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultProviderConfig: """Register a configuration shared across the organization's projects. @@ -385,6 +411,8 @@ async def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -401,6 +429,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultProviderConfig: """Register a configuration shared across the organization's projects. @@ -420,6 +449,8 @@ async def create( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -437,6 +468,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultProviderConfig: return cast( VaultProviderConfig, @@ -451,7 +483,11 @@ async def create( vault_provider_config_create_params.VaultProviderConfigCreateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=cast( Any, VaultProviderConfig @@ -511,6 +547,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultProviderConfig: """Update the supplied fields; omitted fields remain unchanged. @@ -531,6 +568,8 @@ async def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -546,7 +585,11 @@ async def update( vault_provider_config_update_params.VaultProviderConfigUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=cast( Any, VaultProviderConfig @@ -607,6 +650,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """Delete a configuration in the organization. @@ -624,6 +668,8 @@ async def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -631,7 +677,11 @@ async def delete( return await self._delete( path_template("/vault-provider-configs/{id_or_name}", id_or_name=id_or_name), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) diff --git a/src/kernel/resources/vaults/items.py b/src/kernel/resources/vaults/items.py index ad0db16c..b115b27d 100644 --- a/src/kernel/resources/vaults/items.py +++ b/src/kernel/resources/vaults/items.py @@ -143,6 +143,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItem: """ Credential updates require type credential and the current version, and change @@ -175,6 +176,8 @@ def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -192,6 +195,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItem: """ Credential updates require type credential and the current version, and change @@ -224,6 +228,8 @@ def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -243,6 +249,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItem: """ Credential updates require type credential and the current version, and change @@ -275,6 +282,8 @@ def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -294,6 +303,7 @@ def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItem: if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -313,7 +323,11 @@ def update( item_update_params.ItemUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=cast(Any, VaultItem), # Union types cannot be passed in as arguments in the type system ), @@ -366,6 +380,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Unresolved payment operations normally block deletion, including operations on @@ -387,6 +402,8 @@ def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -396,7 +413,11 @@ def delete( return self._delete( path_template("/vaults/{id_or_name}/items/{key}", id_or_name=id_or_name, key=key), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -468,6 +489,7 @@ def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -514,6 +536,8 @@ def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -530,6 +554,7 @@ def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -571,6 +596,8 @@ def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -594,6 +621,7 @@ def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -641,6 +669,8 @@ def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -657,6 +687,7 @@ def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -698,6 +729,8 @@ def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -715,6 +748,7 @@ def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -762,6 +796,8 @@ def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -782,6 +818,7 @@ def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -842,6 +879,8 @@ def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -860,6 +899,7 @@ def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -905,6 +945,8 @@ def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -923,6 +965,7 @@ def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -969,6 +1012,8 @@ def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -987,6 +1032,7 @@ def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -1033,6 +1079,8 @@ def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -1052,6 +1100,7 @@ def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -1093,6 +1142,8 @@ def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -1110,6 +1161,7 @@ def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -1151,6 +1203,8 @@ def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -1171,6 +1225,7 @@ def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -1220,6 +1275,8 @@ def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -1236,6 +1293,7 @@ def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -1277,6 +1335,8 @@ def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -1295,6 +1355,7 @@ def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -1338,6 +1399,8 @@ def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -1360,6 +1423,7 @@ def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -1415,6 +1479,8 @@ def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -1431,6 +1497,7 @@ def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -1472,6 +1539,8 @@ def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -1489,6 +1558,7 @@ def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -1532,6 +1602,8 @@ def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -1599,6 +1671,7 @@ def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -1638,7 +1711,11 @@ def perform_operation( item_perform_operation_params.ItemPerformOperationParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=cast( Any, VaultItemOperationResponse @@ -1660,6 +1737,7 @@ def upsert( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItem: """ Create an item under a key unique within its vault, or retrieve the existing @@ -1697,6 +1775,8 @@ def upsert( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -1714,6 +1794,7 @@ def upsert( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItem: """ Create an item under a key unique within its vault, or retrieve the existing @@ -1743,6 +1824,8 @@ def upsert( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -1760,6 +1843,7 @@ def upsert( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItem: """ Create an item under a key unique within its vault, or retrieve the existing @@ -1789,6 +1873,8 @@ def upsert( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -1806,6 +1892,7 @@ def upsert( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItem: """ Create an item under a key unique within its vault, or retrieve the existing @@ -1828,6 +1915,8 @@ def upsert( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -1845,6 +1934,7 @@ def upsert( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItem: """ Create an item under a key unique within its vault, or retrieve the existing @@ -1873,6 +1963,8 @@ def upsert( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -1898,6 +1990,7 @@ def upsert( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItem: if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -1915,7 +2008,11 @@ def upsert( item_upsert_params.ItemUpsertParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=cast(Any, VaultItem), # Union types cannot be passed in as arguments in the type system ), @@ -2023,6 +2120,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItem: """ Credential updates require type credential and the current version, and change @@ -2055,6 +2153,8 @@ async def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -2072,6 +2172,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItem: """ Credential updates require type credential and the current version, and change @@ -2104,6 +2205,8 @@ async def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -2123,6 +2226,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItem: """ Credential updates require type credential and the current version, and change @@ -2155,6 +2259,8 @@ async def update( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -2174,6 +2280,7 @@ async def update( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItem: if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -2193,7 +2300,11 @@ async def update( item_update_params.ItemUpdateParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=cast(Any, VaultItem), # Union types cannot be passed in as arguments in the type system ), @@ -2246,6 +2357,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """ Unresolved payment operations normally block deletion, including operations on @@ -2267,6 +2379,8 @@ async def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -2276,7 +2390,11 @@ async def delete( return await self._delete( path_template("/vaults/{id_or_name}/items/{key}", id_or_name=id_or_name, key=key), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -2348,6 +2466,7 @@ async def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -2394,6 +2513,8 @@ async def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -2410,6 +2531,7 @@ async def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -2451,6 +2573,8 @@ async def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -2474,6 +2598,7 @@ async def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -2521,6 +2646,8 @@ async def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -2537,6 +2664,7 @@ async def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -2578,6 +2706,8 @@ async def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -2595,6 +2725,7 @@ async def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -2642,6 +2773,8 @@ async def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -2662,6 +2795,7 @@ async def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -2722,6 +2856,8 @@ async def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -2740,6 +2876,7 @@ async def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -2785,6 +2922,8 @@ async def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -2803,6 +2942,7 @@ async def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -2849,6 +2989,8 @@ async def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -2867,6 +3009,7 @@ async def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -2913,6 +3056,8 @@ async def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -2932,6 +3077,7 @@ async def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -2973,6 +3119,8 @@ async def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -2990,6 +3138,7 @@ async def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -3031,6 +3180,8 @@ async def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -3051,6 +3202,7 @@ async def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -3100,6 +3252,8 @@ async def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -3116,6 +3270,7 @@ async def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -3157,6 +3312,8 @@ async def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -3175,6 +3332,7 @@ async def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -3218,6 +3376,8 @@ async def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -3240,6 +3400,7 @@ async def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -3295,6 +3456,8 @@ async def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -3311,6 +3474,7 @@ async def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -3352,6 +3516,8 @@ async def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -3369,6 +3535,7 @@ async def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: """ Retrieve the item first and invoke only an operation listed in @@ -3412,6 +3579,8 @@ async def perform_operation( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -3479,6 +3648,7 @@ async def perform_operation( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItemOperationResponse: if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -3518,7 +3688,11 @@ async def perform_operation( item_perform_operation_params.ItemPerformOperationParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=cast( Any, VaultItemOperationResponse @@ -3540,6 +3714,7 @@ async def upsert( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItem: """ Create an item under a key unique within its vault, or retrieve the existing @@ -3577,6 +3752,8 @@ async def upsert( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -3594,6 +3771,7 @@ async def upsert( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItem: """ Create an item under a key unique within its vault, or retrieve the existing @@ -3623,6 +3801,8 @@ async def upsert( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -3640,6 +3820,7 @@ async def upsert( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItem: """ Create an item under a key unique within its vault, or retrieve the existing @@ -3669,6 +3850,8 @@ async def upsert( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -3686,6 +3869,7 @@ async def upsert( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItem: """ Create an item under a key unique within its vault, or retrieve the existing @@ -3708,6 +3892,8 @@ async def upsert( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -3725,6 +3911,7 @@ async def upsert( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItem: """ Create an item under a key unique within its vault, or retrieve the existing @@ -3753,6 +3940,8 @@ async def upsert( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ ... @@ -3778,6 +3967,7 @@ async def upsert( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> VaultItem: if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -3795,7 +3985,11 @@ async def upsert( item_upsert_params.ItemUpsertParams, ), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=cast(Any, VaultItem), # Union types cannot be passed in as arguments in the type system ), diff --git a/src/kernel/resources/vaults/vaults.py b/src/kernel/resources/vaults/vaults.py index ee237487..0ef60754 100644 --- a/src/kernel/resources/vaults/vaults.py +++ b/src/kernel/resources/vaults/vaults.py @@ -145,6 +145,7 @@ def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """Unresolved payment operations block deletion. @@ -162,6 +163,8 @@ def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -169,7 +172,11 @@ def delete( return self._delete( path_template("/vaults/{id_or_name}", id_or_name=id_or_name), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -224,6 +231,7 @@ def upsert( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> Vault: """ Free organizations can store up to 3 non-deleted vaults across all projects. @@ -240,12 +248,18 @@ def upsert( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return self._post( "/vaults", body=maybe_transform({"name": name}, vault_upsert_params.VaultUpsertParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=Vault, ) @@ -365,6 +379,7 @@ async def delete( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> None: """Unresolved payment operations block deletion. @@ -382,6 +397,8 @@ async def delete( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ if not id_or_name: raise ValueError(f"Expected a non-empty value for `id_or_name` but received {id_or_name!r}") @@ -389,7 +406,11 @@ async def delete( return await self._delete( path_template("/vaults/{id_or_name}", id_or_name=id_or_name), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=NoneType, ) @@ -444,6 +465,7 @@ async def upsert( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, + idempotency_key: str | None = None, ) -> Vault: """ Free organizations can store up to 3 non-deleted vaults across all projects. @@ -460,12 +482,18 @@ async def upsert( extra_body: Add additional JSON properties to the request timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request """ return await self._post( "/vaults", body=await async_maybe_transform({"name": name}, vault_upsert_params.VaultUpsertParams), options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, ), cast_to=Vault, ) diff --git a/tests/test_client.py b/tests/test_client.py index c3a1186c..fc56fbf5 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -698,6 +698,37 @@ class Model(BaseModel): assert isinstance(response, Model) assert response.foo == 2 + @pytest.mark.respx(base_url=base_url) + def test_idempotency_header_options(self, respx_mock: MockRouter, client: Kernel) -> None: + respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={})) + + response = client.post("/foo", cast_to=httpx.Response) + + header = response.request.headers.get("Idempotency-Key") + assert header is not None + assert header.startswith("stainless-python-retry") + + # explicit header + response = client.post( + "/foo", + cast_to=httpx.Response, + options=make_request_options(extra_headers={"Idempotency-Key": "custom-key"}), + ) + assert response.request.headers.get("Idempotency-Key") == "custom-key" + + response = client.post( + "/foo", + cast_to=httpx.Response, + options=make_request_options(extra_headers={"idempotency-key": "custom-key"}), + ) + assert response.request.headers.get("Idempotency-Key") == "custom-key" + + # custom argument + response = client.post( + "/foo", cast_to=httpx.Response, options=make_request_options(idempotency_key="custom-key") + ) + assert response.request.headers.get("Idempotency-Key") == "custom-key" + def test_base_url_setter(self) -> None: client = Kernel(base_url="https://example.com/from_init", api_key=api_key, _strict_response_validation=True) assert client.base_url == "https://example.com/from_init/" @@ -1629,6 +1660,37 @@ class Model(BaseModel): assert isinstance(response, Model) assert response.foo == 2 + @pytest.mark.respx(base_url=base_url) + async def test_idempotency_header_options(self, respx_mock: MockRouter, async_client: AsyncKernel) -> None: + respx_mock.post("/foo").mock(return_value=httpx.Response(200, json={})) + + response = await async_client.post("/foo", cast_to=httpx.Response) + + header = response.request.headers.get("Idempotency-Key") + assert header is not None + assert header.startswith("stainless-python-retry") + + # explicit header + response = await async_client.post( + "/foo", + cast_to=httpx.Response, + options=make_request_options(extra_headers={"Idempotency-Key": "custom-key"}), + ) + assert response.request.headers.get("Idempotency-Key") == "custom-key" + + response = await async_client.post( + "/foo", + cast_to=httpx.Response, + options=make_request_options(extra_headers={"idempotency-key": "custom-key"}), + ) + assert response.request.headers.get("Idempotency-Key") == "custom-key" + + # custom argument + response = await async_client.post( + "/foo", cast_to=httpx.Response, options=make_request_options(idempotency_key="custom-key") + ) + assert response.request.headers.get("Idempotency-Key") == "custom-key" + async def test_base_url_setter(self) -> None: client = AsyncKernel( base_url="https://example.com/from_init", api_key=api_key, _strict_response_validation=True From ae52da0436bae8888304311fb921c8ca463f82b6 Mon Sep 17 00:00:00 2001 From: "kernel-internal[bot]" <260533166+kernel-internal[bot]@users.noreply.github.com> Date: Wed, 28 Oct 2026 15:34:46 +0000 Subject: [PATCH 3/4] feat: Select 1Password fill pages by target and return stored-token grants Stainless-Generated-From: d4635fa160b38160e0eee5c369943c9509877c89 --- src/kernel/resources/vaults/items.py | 20 +++++++++++-- .../vaults/item_perform_operation_params.py | 10 ++++++- ...ne_password_credential_vault_item_state.py | 28 +++++++++++++++++-- ...fill_vault_item_operation_request_param.py | 12 ++++++-- tests/api_resources/vaults/test_items.py | 2 ++ 5 files changed, 64 insertions(+), 8 deletions(-) diff --git a/src/kernel/resources/vaults/items.py b/src/kernel/resources/vaults/items.py index b115b27d..75c72d17 100644 --- a/src/kernel/resources/vaults/items.py +++ b/src/kernel/resources/vaults/items.py @@ -1218,6 +1218,7 @@ def perform_operation( page_url: str, type: Literal["1pw_fill"], entry_id: str | Omit = omit, + target_id: str | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1263,11 +1264,16 @@ def perform_operation( browser_id: Browser session ID, not a reusable browser name. page_url: Exact current top-level page URL. Must match exactly one open page in the - browser. + browser unless target_id is supplied. entry_id: ID of an approved request entry. Required when several approved entries have the page's origin. + target_id: CDP target ID of the page to fill, such as tab.target_id from + playwright.execute. Use it when several open pages have page_url. The page's + current URL must equal page_url. Kernel brings the page to the front of its + window before filling. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -1658,6 +1664,7 @@ def perform_operation( reason: str | Omit = omit, timeout_seconds: int | Omit = omit, entry_id: str | Omit = omit, + target_id: str | Omit = omit, access_token: str | Omit = omit, access_token_expires_at: Union[str, datetime] | Omit = omit, bindings: Iterable[VaultWebmcpBindingParam] | Omit = omit, @@ -1700,6 +1707,7 @@ def perform_operation( "reason": reason, "timeout_seconds": timeout_seconds, "entry_id": entry_id, + "target_id": target_id, "access_token": access_token, "access_token_expires_at": access_token_expires_at, "bindings": bindings, @@ -3195,6 +3203,7 @@ async def perform_operation( page_url: str, type: Literal["1pw_fill"], entry_id: str | Omit = omit, + target_id: str | Omit = omit, timeout_ms: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -3240,11 +3249,16 @@ async def perform_operation( browser_id: Browser session ID, not a reusable browser name. page_url: Exact current top-level page URL. Must match exactly one open page in the - browser. + browser unless target_id is supplied. entry_id: ID of an approved request entry. Required when several approved entries have the page's origin. + target_id: CDP target ID of the page to fill, such as tab.target_id from + playwright.execute. Use it when several open pages have page_url. The page's + current URL must equal page_url. Kernel brings the page to the front of its + window before filling. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -3635,6 +3649,7 @@ async def perform_operation( reason: str | Omit = omit, timeout_seconds: int | Omit = omit, entry_id: str | Omit = omit, + target_id: str | Omit = omit, access_token: str | Omit = omit, access_token_expires_at: Union[str, datetime] | Omit = omit, bindings: Iterable[VaultWebmcpBindingParam] | Omit = omit, @@ -3677,6 +3692,7 @@ async def perform_operation( "reason": reason, "timeout_seconds": timeout_seconds, "entry_id": entry_id, + "target_id": target_id, "access_token": access_token, "access_token_expires_at": access_token_expires_at, "bindings": bindings, diff --git a/src/kernel/types/vaults/item_perform_operation_params.py b/src/kernel/types/vaults/item_perform_operation_params.py index 60fe34c5..c458957c 100644 --- a/src/kernel/types/vaults/item_perform_operation_params.py +++ b/src/kernel/types/vaults/item_perform_operation_params.py @@ -207,7 +207,7 @@ class OnePasswordFillVaultItemOperationRequest(TypedDict, total=False): page_url: Required[str] """Exact current top-level page URL. - Must match exactly one open page in the browser. + Must match exactly one open page in the browser unless target_id is supplied. """ type: Required[Literal["1pw_fill"]] @@ -218,6 +218,14 @@ class OnePasswordFillVaultItemOperationRequest(TypedDict, total=False): Required when several approved entries have the page's origin. """ + target_id: str + """CDP target ID of the page to fill, such as tab.target_id from + playwright.execute. + + Use it when several open pages have page_url. The page's current URL must equal + page_url. Kernel brings the page to the front of its window before filling. + """ + timeout_ms: int diff --git a/src/kernel/types/vaults/one_password_credential_vault_item_state.py b/src/kernel/types/vaults/one_password_credential_vault_item_state.py index 5cf9b390..36f9fb1e 100644 --- a/src/kernel/types/vaults/one_password_credential_vault_item_state.py +++ b/src/kernel/types/vaults/one_password_credential_vault_item_state.py @@ -15,6 +15,7 @@ "AccessRequestRequest", "AccessRequestRequestEntry", "AccessRequestRequestEntryParameters", + "AccessRequestResolved", ] @@ -63,10 +64,22 @@ class AccessRequestRequest(BaseModel): version: Optional[int] = None +class AccessRequestResolved(BaseModel): + reference: str + """1Password credential reference. + + Pass it unchanged as resourcePath to the extension's fillCredential or to the + 1Password SDK. + """ + + entry_id: Optional[str] = FieldInfo(alias="entryId", default=None) + """The requested entry this login satisfies, when known.""" + + class AccessRequest(BaseModel): """Non-secret broker state. - Granted credential references stay encrypted server-side and can only be used by the fill operation. + Granted credential references are returned in resolved only for credentials with a customer-supplied access token; otherwise they stay encrypted server-side and can only be used by the fill operation. """ id: str @@ -103,6 +116,14 @@ class AccessRequest(BaseModel): The observed create response may omit entries; no entry IDs are invented. """ + resolved: Optional[List[AccessRequestResolved]] = None + """Granted logins in the shape 1Password's getAccessRequestStatus returns. + + Present only for ready credentials with a customer-supplied access token, on + single-item responses to callers that can use the vault. Each reference works + only with that credential's access token and integration key. + """ + class OnePasswordCredentialVaultItemState(BaseModel): provider: Literal["1password"] @@ -112,8 +133,9 @@ class OnePasswordCredentialVaultItemState(BaseModel): access_request: Optional[AccessRequest] = None """Non-secret broker state. - Granted credential references stay encrypted server-side and can only be used by - the fill operation. + Granted credential references are returned in resolved only for credentials with + a customer-supplied access token; otherwise they stay encrypted server-side and + can only be used by the fill operation. """ access_request_id: Optional[str] = None diff --git a/src/kernel/types/vaults/one_password_fill_vault_item_operation_request_param.py b/src/kernel/types/vaults/one_password_fill_vault_item_operation_request_param.py index f36a456c..a66cce42 100644 --- a/src/kernel/types/vaults/one_password_fill_vault_item_operation_request_param.py +++ b/src/kernel/types/vaults/one_password_fill_vault_item_operation_request_param.py @@ -10,7 +10,7 @@ class OnePasswordFillVaultItemOperationRequestParam(TypedDict, total=False): """Fill and submit an approved 1Password login in the selected browser page. - The page must share the selected entry's login origin. Supply entry_id when more than one approved entry matches the page origin. The extension selects fields; callers cannot supply selectors or secret values. Submission does not confirm website authentication. + The page must share the selected entry's login origin. Supply entry_id when more than one approved entry matches the page origin, and target_id when more than one open page has page_url. The extension selects fields; callers cannot supply selectors or secret values. Submission does not confirm website authentication. """ browser_id: Required[str] @@ -19,7 +19,7 @@ class OnePasswordFillVaultItemOperationRequestParam(TypedDict, total=False): page_url: Required[str] """Exact current top-level page URL. - Must match exactly one open page in the browser. + Must match exactly one open page in the browser unless target_id is supplied. """ type: Required[Literal["1pw_fill"]] @@ -30,4 +30,12 @@ class OnePasswordFillVaultItemOperationRequestParam(TypedDict, total=False): Required when several approved entries have the page's origin. """ + target_id: str + """CDP target ID of the page to fill, such as tab.target_id from + playwright.execute. + + Use it when several open pages have page_url. The page's current URL must equal + page_url. Kernel brings the page to the front of its window before filling. + """ + timeout_ms: int diff --git a/tests/api_resources/vaults/test_items.py b/tests/api_resources/vaults/test_items.py index c588ce4c..e24c9f65 100644 --- a/tests/api_resources/vaults/test_items.py +++ b/tests/api_resources/vaults/test_items.py @@ -1494,6 +1494,7 @@ def test_method_perform_operation_with_all_params_overload_12(self, client: Kern page_url="https://example.com", type="1pw_fill", entry_id="x", + target_id="x", timeout_ms=1, ) assert_matches_type(VaultItemOperationResponse, item, path=["response"]) @@ -4096,6 +4097,7 @@ async def test_method_perform_operation_with_all_params_overload_12(self, async_ page_url="https://example.com", type="1pw_fill", entry_id="x", + target_id="x", timeout_ms=1, ) assert_matches_type(VaultItemOperationResponse, item, path=["response"]) From eb0c1f26f20323794ce85b71875e8dfffbb0aa9e Mon Sep 17 00:00:00 2001 From: "kernel-internal[bot]" <260533166+kernel-internal[bot]@users.noreply.github.com> Date: Wed, 28 Oct 2026 15:39:08 +0000 Subject: [PATCH 4/4] release: 0.133.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 9 +++++++++ pyproject.toml | 2 +- src/kernel/_version.py | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b4da64f2..4a1242df 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.132.0" + ".": "0.133.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index bd749034..471f5980 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [0.133.0](https://github.com/kernel/kernel-python-sdk/compare/v0.132.0...v0.133.0) (2026-10-28) + + +### Features + +* Forward Idempotency-Key on playwright and REPL execution ([8f51b16](https://github.com/kernel/kernel-python-sdk/commit/8f51b1697a10524a5e40191bd17e0f2c451a4f91)) +* Select 1Password fill pages by target and return stored-token grants ([ae52da0](https://github.com/kernel/kernel-python-sdk/commit/ae52da0436bae8888304311fb921c8ca463f82b6)) +* Support multiple Kernel wallet payment methods and payment requests ([99d8515](https://github.com/kernel/kernel-python-sdk/commit/99d851577f0ed2f7ba78849172f8fdddb0a9ce31)) + ## [0.132.0](https://github.com/kernel/kernel-python-sdk/compare/v0.131.0...v0.132.0) (2026-10-26) diff --git a/pyproject.toml b/pyproject.toml index 2b17777b..bba5860d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "kernel" -version = "0.132.0" +version = "0.133.0" description = "The official Python library for the kernel API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/kernel/_version.py b/src/kernel/_version.py index 2913ee42..720e7ab3 100644 --- a/src/kernel/_version.py +++ b/src/kernel/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "kernel" -__version__ = "0.132.0" # x-release-please-version +__version__ = "0.133.0" # x-release-please-version