Skip to content

Commit 8d8b565

Browse files
authored
Annotate braintree's Address and AddressGateway classes (#14927)
1 parent 0c2725c commit 8d8b565

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

stubs/braintree/braintree/address.pyi

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
from _typeshed import Incomplete
22
from typing import Final
33

4+
from braintree.error_result import ErrorResult
45
from braintree.resource import Resource
6+
from braintree.successful_result import SuccessfulResult
57

68
class Address(Resource):
79
class ShippingMethod:
@@ -14,13 +16,15 @@ class Address(Resource):
1416
PickupInStore: Final = "pickup_in_store"
1517

1618
@staticmethod
17-
def create(params: dict[str, Incomplete] | None = None): ...
19+
def create(params: dict[str, Incomplete] | None = None) -> SuccessfulResult | ErrorResult | None: ...
1820
@staticmethod
19-
def delete(customer_id: str, address_id: str): ...
21+
def delete(customer_id: str, address_id: str) -> SuccessfulResult: ...
2022
@staticmethod
21-
def find(customer_id: str, address_id: str): ...
23+
def find(customer_id: str, address_id: str) -> Address: ...
2224
@staticmethod
23-
def update(customer_id: str, address_id: str, params: dict[str, Incomplete] | None = None): ...
25+
def update(
26+
customer_id: str, address_id: str, params: dict[str, Incomplete] | None = None
27+
) -> SuccessfulResult | ErrorResult | None: ...
2428
@staticmethod
2529
def create_signature() -> list[str | dict[str, list[str]]]: ...
2630
@staticmethod

stubs/braintree/braintree/address_gateway.pyi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
from _typeshed import Incomplete
22

33
from braintree.address import Address
4+
from braintree.braintree_gateway import BraintreeGateway
45
from braintree.error_result import ErrorResult
56
from braintree.successful_result import SuccessfulResult
67

78
class AddressGateway:
8-
gateway: Incomplete
9+
gateway: BraintreeGateway
910
config: Incomplete
10-
def __init__(self, gateway) -> None: ...
11+
def __init__(self, gateway: BraintreeGateway) -> None: ...
1112
def create(self, params: dict[str, Incomplete] | None = None) -> SuccessfulResult | ErrorResult | None: ...
1213
def delete(self, customer_id: str, address_id: str) -> SuccessfulResult: ...
1314
def find(self, customer_id: str, address_id: str) -> Address: ...

0 commit comments

Comments
 (0)