Skip to content

Commit e94610e

Browse files
committed
use client.batch on samples
1 parent 993b80d commit e94610e

6 files changed

+6
-6
lines changed

samples/batch_requests/batch_get_response_body_as_stream.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414

1515
async def main():
16-
batch_response_content = await batch_request_builder.post(batch_request_content=batch_content)
16+
batch_response_content = await client.batch.post(batch_request_content=batch_content)
1717

1818
try:
1919
stream_response = batch_response_content.get_response_stream_by_id(batch_request_item1.id)

samples/batch_requests/batch_request_with_collection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
# post a collection
8787
async def main():
8888

89-
batch_response_content = await batch_request_builder.post(batch_request_content=collection)
89+
batch_response_content = await client.batch.post(batch_request_content=collection)
9090
responses = batch_response_content.get_responses()
9191
for item in responses:
9292
for item_body in item.responses:

samples/batch_requests/batch_request_with_content.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656

5757
async def main():
58-
batch_response_content = await batch_request_builder.post(batch_request_content=batch_content)
58+
batch_response_content = await client.batch.post(batch_request_content=batch_content)
5959

6060
# Print the batch response content
6161
print(f"Batch Response Content: {batch_response_content.responses}")

samples/batch_requests/batch_request_with_custom_error_class.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def not_found() -> 'CustomError':
8686
async def main():
8787
error_map = {"400": CustomError, "404": CustomError.not_found}
8888

89-
batch_response_content = await batch_request_builder.post(
89+
batch_response_content = await client.batch.post(
9090
batch_request_content=batch_content, error_map=error_map
9191
)
9292

samples/batch_requests/batch_request_with_parsable_as_response_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959

6060
# Function to demonstrate the usage of BatchRequestBuilder
6161
async def main():
62-
batch_response_content = await batch_request_builder.post(batch_request_content=batch_content)
62+
batch_response_content = await client.batch.post(batch_request_content=batch_content)
6363
# response_type=User
6464

6565
try:

samples/batch_requests/batch_response_get_status_codes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414

1515
async def main():
16-
batch_response_content = await batch_request_builder.post(batch_request_content=batch_content)
16+
batch_response_content = await client.batch.post(batch_request_content=batch_content)
1717

1818
try:
1919
status_codes = batch_response_content.get_response_status_codes()

0 commit comments

Comments
 (0)