googleapis / gapic-generator-python

Generate Python API client libraries from Protocol Buffers.
Apache License 2.0
122 stars 69 forks source link

await client.list_contacts(request=request) #1597

Open tundragon opened 1 year ago

tundragon commented 1 year ago

Environment details

Code example

Here is my working code example:

from google.cloud import essential_contacts_v1
import asyncio

async def sample_list_contacts():
    # Create a client
    client = essential_contacts_v1.EssentialContactsServiceAsyncClient()

    # Initialize request argument(s)
    request = essential_contacts_v1.ListContactsRequest(
        parent="projects/GCP_PROJECT_ID",
    )

    # Make the request
    page_result = await client.list_contacts(request=request)
    async for response in page_result:
        print(response)

async def main():
    await sample_list_contacts()

asyncio.run(main())

Stack trace

# example

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

parthea commented 1 year ago

Thanks for reporting this issue. I'm going to transfer this issue to the repository for the code generator that produces the sample code: https://github.com/googleapis/python-essential-contacts/blob/main/samples/generated_samples/essentialcontacts_v1_generated_essential_contacts_service_list_contacts_async.py#L47

page_result = client.list_contacts(request=request)

should be

page_result = await client.list_contacts(request=request)