Skip to content

Commit eed185a

Browse files
docs: improve examples
1 parent 9099ed6 commit eed185a

8 files changed

Lines changed: 126 additions & 476 deletions

File tree

tests/api_resources/test_coupons.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def test_method_create_with_all_params(self, client: Stripe) -> None:
3535
duration_in_months=0,
3636
expand=["string"],
3737
max_redemptions=0,
38-
metadata={"foo": "string"},
38+
metadata="",
3939
name="name",
4040
percent_off=0,
4141
redeem_by=0,
@@ -126,7 +126,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncStripe) ->
126126
duration_in_months=0,
127127
expand=["string"],
128128
max_redemptions=0,
129-
metadata={"foo": "string"},
129+
metadata="",
130130
name="name",
131131
percent_off=0,
132132
redeem_by=0,

tests/api_resources/test_customers.py

Lines changed: 16 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -26,57 +26,31 @@ def test_method_create(self, client: Stripe) -> None:
2626
@parametrize
2727
def test_method_create_with_all_params(self, client: Stripe) -> None:
2828
customer = client.customers.create(
29-
address={
30-
"city": "city",
31-
"country": "country",
32-
"line1": "line1",
33-
"line2": "line2",
34-
"postal_code": "postal_code",
35-
"state": "state",
36-
},
29+
address="",
3730
balance=0,
38-
business_name="string",
31+
business_name="",
3932
cash_balance={"settings": {"reconciliation_mode": "automatic"}},
4033
description="description",
4134
email="email",
4235
expand=["string"],
43-
individual_name="string",
36+
individual_name="",
4437
invoice_prefix="invoice_prefix",
4538
invoice_settings={
46-
"custom_fields": [
47-
{
48-
"name": "name",
49-
"value": "value",
50-
}
51-
],
39+
"custom_fields": "",
5240
"default_payment_method": "default_payment_method",
5341
"footer": "footer",
54-
"rendering_options": {
55-
"amount_tax_display": "",
56-
"template": "template",
57-
},
42+
"rendering_options": "",
5843
},
59-
metadata={"foo": "string"},
44+
metadata="",
6045
name="name",
6146
next_invoice_sequence=0,
6247
payment_method="payment_method",
6348
phone="phone",
6449
preferred_locales=["string"],
65-
shipping={
66-
"address": {
67-
"city": "city",
68-
"country": "country",
69-
"line1": "line1",
70-
"line2": "line2",
71-
"postal_code": "postal_code",
72-
"state": "state",
73-
},
74-
"name": "name",
75-
"phone": "phone",
76-
},
50+
shipping="",
7751
source="source",
7852
tax={
79-
"ip_address": "string",
53+
"ip_address": "",
8054
"validate_location": "deferred",
8155
},
8256
tax_exempt="",
@@ -167,57 +141,31 @@ async def test_method_create(self, async_client: AsyncStripe) -> None:
167141
@parametrize
168142
async def test_method_create_with_all_params(self, async_client: AsyncStripe) -> None:
169143
customer = await async_client.customers.create(
170-
address={
171-
"city": "city",
172-
"country": "country",
173-
"line1": "line1",
174-
"line2": "line2",
175-
"postal_code": "postal_code",
176-
"state": "state",
177-
},
144+
address="",
178145
balance=0,
179-
business_name="string",
146+
business_name="",
180147
cash_balance={"settings": {"reconciliation_mode": "automatic"}},
181148
description="description",
182149
email="email",
183150
expand=["string"],
184-
individual_name="string",
151+
individual_name="",
185152
invoice_prefix="invoice_prefix",
186153
invoice_settings={
187-
"custom_fields": [
188-
{
189-
"name": "name",
190-
"value": "value",
191-
}
192-
],
154+
"custom_fields": "",
193155
"default_payment_method": "default_payment_method",
194156
"footer": "footer",
195-
"rendering_options": {
196-
"amount_tax_display": "",
197-
"template": "template",
198-
},
157+
"rendering_options": "",
199158
},
200-
metadata={"foo": "string"},
159+
metadata="",
201160
name="name",
202161
next_invoice_sequence=0,
203162
payment_method="payment_method",
204163
phone="phone",
205164
preferred_locales=["string"],
206-
shipping={
207-
"address": {
208-
"city": "city",
209-
"country": "country",
210-
"line1": "line1",
211-
"line2": "line2",
212-
"postal_code": "postal_code",
213-
"state": "state",
214-
},
215-
"name": "name",
216-
"phone": "phone",
217-
},
165+
shipping="",
218166
source="source",
219167
tax={
220-
"ip_address": "string",
168+
"ip_address": "",
221169
"validate_location": "deferred",
222170
},
223171
tax_exempt="",

tests/api_resources/test_disputes.py

Lines changed: 4 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -43,47 +43,7 @@ def test_method_update_with_all_params(self, client: Stripe) -> None:
4343
"duplicate_charge_documentation": "duplicate_charge_documentation",
4444
"duplicate_charge_explanation": "duplicate_charge_explanation",
4545
"duplicate_charge_id": "duplicate_charge_id",
46-
"enhanced_evidence": {
47-
"visa_compelling_evidence_3": {
48-
"disputed_transaction": {
49-
"customer_account_id": "string",
50-
"customer_device_fingerprint": "string",
51-
"customer_device_id": "string",
52-
"customer_email_address": "string",
53-
"customer_purchase_ip": "string",
54-
"merchandise_or_services": "merchandise",
55-
"product_description": "string",
56-
"shipping_address": {
57-
"city": "string",
58-
"country": "string",
59-
"line1": "string",
60-
"line2": "string",
61-
"postal_code": "string",
62-
"state": "string",
63-
},
64-
},
65-
"prior_undisputed_transactions": [
66-
{
67-
"charge": "charge",
68-
"customer_account_id": "string",
69-
"customer_device_fingerprint": "string",
70-
"customer_device_id": "string",
71-
"customer_email_address": "string",
72-
"customer_purchase_ip": "string",
73-
"product_description": "string",
74-
"shipping_address": {
75-
"city": "string",
76-
"country": "string",
77-
"line1": "string",
78-
"line2": "string",
79-
"postal_code": "string",
80-
"state": "string",
81-
},
82-
}
83-
],
84-
},
85-
"visa_compliance": {"fee_acknowledged": True},
86-
},
46+
"enhanced_evidence": "",
8747
"product_description": "product_description",
8848
"receipt": "receipt",
8949
"refund_policy": "refund_policy",
@@ -100,7 +60,7 @@ def test_method_update_with_all_params(self, client: Stripe) -> None:
10060
"uncategorized_text": "uncategorized_text",
10161
},
10262
expand=["string"],
103-
metadata={"foo": "string"},
63+
metadata="",
10464
submit=True,
10565
)
10666
assert_matches_type(Dispute, dispute, path=["response"])
@@ -210,47 +170,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncStripe) ->
210170
"duplicate_charge_documentation": "duplicate_charge_documentation",
211171
"duplicate_charge_explanation": "duplicate_charge_explanation",
212172
"duplicate_charge_id": "duplicate_charge_id",
213-
"enhanced_evidence": {
214-
"visa_compelling_evidence_3": {
215-
"disputed_transaction": {
216-
"customer_account_id": "string",
217-
"customer_device_fingerprint": "string",
218-
"customer_device_id": "string",
219-
"customer_email_address": "string",
220-
"customer_purchase_ip": "string",
221-
"merchandise_or_services": "merchandise",
222-
"product_description": "string",
223-
"shipping_address": {
224-
"city": "string",
225-
"country": "string",
226-
"line1": "string",
227-
"line2": "string",
228-
"postal_code": "string",
229-
"state": "string",
230-
},
231-
},
232-
"prior_undisputed_transactions": [
233-
{
234-
"charge": "charge",
235-
"customer_account_id": "string",
236-
"customer_device_fingerprint": "string",
237-
"customer_device_id": "string",
238-
"customer_email_address": "string",
239-
"customer_purchase_ip": "string",
240-
"product_description": "string",
241-
"shipping_address": {
242-
"city": "string",
243-
"country": "string",
244-
"line1": "string",
245-
"line2": "string",
246-
"postal_code": "string",
247-
"state": "string",
248-
},
249-
}
250-
],
251-
},
252-
"visa_compliance": {"fee_acknowledged": True},
253-
},
173+
"enhanced_evidence": "",
254174
"product_description": "product_description",
255175
"receipt": "receipt",
256176
"refund_policy": "refund_policy",
@@ -267,7 +187,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncStripe) ->
267187
"uncategorized_text": "uncategorized_text",
268188
},
269189
expand=["string"],
270-
metadata={"foo": "string"},
190+
metadata="",
271191
submit=True,
272192
)
273193
assert_matches_type(Dispute, dispute, path=["response"])

tests/api_resources/test_invoiceitems.py

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,10 @@ def test_method_create_with_all_params(self, client: Stripe) -> None:
3131
customer_account="customer_account",
3232
description="description",
3333
discountable=True,
34-
discounts=[
35-
{
36-
"coupon": "coupon",
37-
"discount": "discount",
38-
"promotion_code": "promotion_code",
39-
}
40-
],
34+
discounts="",
4135
expand=["string"],
4236
invoice="invoice",
43-
metadata={"foo": "string"},
37+
metadata="",
4438
period={
4539
"end": 0,
4640
"start": 0,
@@ -56,7 +50,7 @@ def test_method_create_with_all_params(self, client: Stripe) -> None:
5650
quantity=0,
5751
subscription="subscription",
5852
tax_behavior="exclusive",
59-
tax_code="string",
53+
tax_code="",
6054
tax_rates=["string"],
6155
unit_amount_decimal="unit_amount_decimal",
6256
)
@@ -102,16 +96,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncStripe) ->
10296
customer_account="customer_account",
10397
description="description",
10498
discountable=True,
105-
discounts=[
106-
{
107-
"coupon": "coupon",
108-
"discount": "discount",
109-
"promotion_code": "promotion_code",
110-
}
111-
],
99+
discounts="",
112100
expand=["string"],
113101
invoice="invoice",
114-
metadata={"foo": "string"},
102+
metadata="",
115103
period={
116104
"end": 0,
117105
"start": 0,
@@ -127,7 +115,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncStripe) ->
127115
quantity=0,
128116
subscription="subscription",
129117
tax_behavior="exclusive",
130-
tax_code="string",
118+
tax_code="",
131119
tax_rates=["string"],
132120
unit_amount_decimal="unit_amount_decimal",
133121
)

0 commit comments

Comments
 (0)