Annotate braintree's Address and AddressGateway classes (#14927)

This commit is contained in:
Pēteris Caune
2025-10-30 22:15:20 +02:00
committed by GitHub
parent 0c2725c14d
commit 8d8b5655d9
2 changed files with 11 additions and 6 deletions
+8 -4
View File
@@ -1,7 +1,9 @@
from _typeshed import Incomplete
from typing import Final
from braintree.error_result import ErrorResult
from braintree.resource import Resource
from braintree.successful_result import SuccessfulResult
class Address(Resource):
class ShippingMethod:
@@ -14,13 +16,15 @@ class Address(Resource):
PickupInStore: Final = "pickup_in_store"
@staticmethod
def create(params: dict[str, Incomplete] | None = None): ...
def create(params: dict[str, Incomplete] | None = None) -> SuccessfulResult | ErrorResult | None: ...
@staticmethod
def delete(customer_id: str, address_id: str): ...
def delete(customer_id: str, address_id: str) -> SuccessfulResult: ...
@staticmethod
def find(customer_id: str, address_id: str): ...
def find(customer_id: str, address_id: str) -> Address: ...
@staticmethod
def update(customer_id: str, address_id: str, params: dict[str, Incomplete] | None = None): ...
def update(
customer_id: str, address_id: str, params: dict[str, Incomplete] | None = None
) -> SuccessfulResult | ErrorResult | None: ...
@staticmethod
def create_signature() -> list[str | dict[str, list[str]]]: ...
@staticmethod
@@ -1,13 +1,14 @@
from _typeshed import Incomplete
from braintree.address import Address
from braintree.braintree_gateway import BraintreeGateway
from braintree.error_result import ErrorResult
from braintree.successful_result import SuccessfulResult
class AddressGateway:
gateway: Incomplete
gateway: BraintreeGateway
config: Incomplete
def __init__(self, gateway) -> None: ...
def __init__(self, gateway: BraintreeGateway) -> None: ...
def create(self, params: dict[str, Incomplete] | None = None) -> SuccessfulResult | ErrorResult | None: ...
def delete(self, customer_id: str, address_id: str) -> SuccessfulResult: ...
def find(self, customer_id: str, address_id: str) -> Address: ...