Skip to content

Commit

Permalink
fix: update create_async_connector args (#1232)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackwotherspoon authored Feb 4, 2025
1 parent 4fe1320 commit b4f8f52
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions google/cloud/sql/connector/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,8 @@ async def create_async_connector(
sqladmin_api_endpoint: Optional[str] = None,
user_agent: Optional[str] = None,
universe_domain: Optional[str] = None,
refresh_strategy: str | RefreshStrategy = RefreshStrategy.BACKGROUND,
resolver: type[DefaultResolver] | type[DnsResolver] = DefaultResolver,
) -> Connector:
"""Helper function to create Connector object for asyncio connections.
Expand Down Expand Up @@ -486,6 +488,21 @@ async def create_async_connector(
Admin API endpoint. Defaults to "https://sqladmin.googleapis.com",
this argument should only be used in development.
universe_domain (str): The universe domain for Cloud SQL API calls.
Default: "googleapis.com".
refresh_strategy (str | RefreshStrategy): The default refresh strategy
used to refresh SSL/TLS cert and instance metadata. Can be one
of the following: RefreshStrategy.LAZY ("LAZY") or
RefreshStrategy.BACKGROUND ("BACKGROUND").
Default: RefreshStrategy.BACKGROUND
resolver (DefaultResolver | DnsResolver): The class name of the
resolver to use for resolving the Cloud SQL instance connection
name. To resolve a DNS record to an instance connection name, use
DnsResolver.
Default: DefaultResolver
Returns:
A Connector instance configured with running event loop.
"""
Expand All @@ -501,4 +518,7 @@ async def create_async_connector(
quota_project=quota_project,
sqladmin_api_endpoint=sqladmin_api_endpoint,
user_agent=user_agent,
universe_domain=universe_domain,
refresh_strategy=refresh_strategy,
resolver=resolver,
)

0 comments on commit b4f8f52

Please sign in to comment.