Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .librarian/state.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:160860d189ff1c2f7515638478823712fa5b243e27ccc33a2728669fa1e2ed0c
image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:701bd1403bebb772cbc1835dc7a88aea5a07638222363534f0282bb1275b93c6
libraries:
- id: bigquery-magics
version: 0.12.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,15 @@ class AdBreakServiceClient(metaclass=AdBreakServiceClientMeta):
"""Provides methods for handling ``AdBreak`` objects."""

@staticmethod
def _get_default_mtls_endpoint(api_endpoint):
def _get_default_mtls_endpoint(api_endpoint) -> Optional[str]:
"""Converts api endpoint to mTLS endpoint.

Convert "*.sandbox.googleapis.com" and "*.googleapis.com" to
"*.mtls.sandbox.googleapis.com" and "*.mtls.googleapis.com" respectively.
Args:
api_endpoint (Optional[str]): the api endpoint to convert.
Returns:
str: converted mTLS api endpoint.
Optional[str]: converted mTLS api endpoint.
"""
if not api_endpoint:
return api_endpoint
Expand All @@ -132,6 +132,10 @@ def _get_default_mtls_endpoint(api_endpoint):
)

m = mtls_endpoint_re.match(api_endpoint)
if m is None:
# Could not parse api_endpoint; return as-is.
return api_endpoint

name, mtls, sandbox, googledomain = m.groups()
if mtls or not googledomain:
return api_endpoint
Expand Down Expand Up @@ -459,7 +463,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag):
@staticmethod
def _get_api_endpoint(
api_override, client_cert_source, universe_domain, use_mtls_endpoint
):
) -> str:
"""Return the API endpoint used by the client.

Args:
Expand Down Expand Up @@ -556,7 +560,7 @@ def _add_cred_info_for_auth_errors(
error._details.append(json.dumps(cred_info))

@property
def api_endpoint(self):
def api_endpoint(self) -> str:
"""Return the API endpoint used by the client instance.

Returns:
Expand Down Expand Up @@ -652,7 +656,7 @@ def __init__(
self._universe_domain = AdBreakServiceClient._get_universe_domain(
universe_domain_opt, self._universe_domain_env
)
self._api_endpoint = None # updated below, depending on `transport`
self._api_endpoint: str = "" # updated below, depending on `transport`

# Initialize the universe domain validation.
self._is_universe_domain_valid = False
Expand Down Expand Up @@ -1376,7 +1380,7 @@ def __exit__(self, type, value, traceback):

def get_operation(
self,
request: Optional[operations_pb2.GetOperationRequest] = None,
request: Optional[Union[operations_pb2.GetOperationRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
Expand All @@ -1402,8 +1406,12 @@ def get_operation(
# Create or coerce a protobuf request object.
# The request isn't a proto-plus wrapped type,
# so it must be constructed via keyword expansion.
if isinstance(request, dict):
request = operations_pb2.GetOperationRequest(**request)
if request is None:
request_pb = operations_pb2.GetOperationRequest()
elif isinstance(request, dict):
request_pb = operations_pb2.GetOperationRequest(**request)
else:
request_pb = request

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
Expand All @@ -1412,7 +1420,7 @@ def get_operation(
# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
gapic_v1.routing_header.to_grpc_metadata((("name", request_pb.name),)),
)

# Validate the universe domain.
Expand All @@ -1421,7 +1429,7 @@ def get_operation(
try:
# Send the request.
response = rpc(
request,
request_pb,
retry=retry,
timeout=timeout,
metadata=metadata,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ def __init__(
your own client library.
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
be used for service account credentials.
api_audience (Optional[str]): The intended audience for the API calls
to the service that will be set when using certain 3rd party
authentication flows. Audience is typically a resource identifier.
If not set, the host value will be used as a default.
"""

# Save the scopes.
Expand Down Expand Up @@ -131,6 +135,8 @@ def __init__(
host += ":443"
self._host = host

self._wrapped_methods: Dict[Callable, Callable] = {}

@property
def host(self):
return self._host
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,12 @@ def __init__(
url_scheme: the protocol scheme for the API endpoint. Normally
"https", but for testing or local servers,
"http" can be specified.
interceptor (Optional[AdBreakServiceRestInterceptor]): Interceptor used
to manipulate requests, request metadata, and responses.
api_audience (Optional[str]): The intended audience for the API calls
to the service that will be set when using certain 3rd party
authentication flows. Audience is typically a resource identifier.
If not set, the host value will be used as a default.
"""
# Run the base constructor
# TODO(yon-mg): resolve other ctor params i.e. scopes, quota, etc.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@ class AdReviewCenterAdServiceClient(metaclass=AdReviewCenterAdServiceClientMeta)
"""Provides methods for handling AdReviewCenterAd objects."""

@staticmethod
def _get_default_mtls_endpoint(api_endpoint):
def _get_default_mtls_endpoint(api_endpoint) -> Optional[str]:
"""Converts api endpoint to mTLS endpoint.

Convert "*.sandbox.googleapis.com" and "*.googleapis.com" to
"*.mtls.sandbox.googleapis.com" and "*.mtls.googleapis.com" respectively.
Args:
api_endpoint (Optional[str]): the api endpoint to convert.
Returns:
str: converted mTLS api endpoint.
Optional[str]: converted mTLS api endpoint.
"""
if not api_endpoint:
return api_endpoint
Expand All @@ -130,6 +130,10 @@ def _get_default_mtls_endpoint(api_endpoint):
)

m = mtls_endpoint_re.match(api_endpoint)
if m is None:
# Could not parse api_endpoint; return as-is.
return api_endpoint

name, mtls, sandbox, googledomain = m.groups()
if mtls or not googledomain:
return api_endpoint
Expand Down Expand Up @@ -457,7 +461,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag):
@staticmethod
def _get_api_endpoint(
api_override, client_cert_source, universe_domain, use_mtls_endpoint
):
) -> str:
"""Return the API endpoint used by the client.

Args:
Expand Down Expand Up @@ -556,7 +560,7 @@ def _add_cred_info_for_auth_errors(
error._details.append(json.dumps(cred_info))

@property
def api_endpoint(self):
def api_endpoint(self) -> str:
"""Return the API endpoint used by the client instance.

Returns:
Expand Down Expand Up @@ -658,7 +662,7 @@ def __init__(
self._universe_domain = AdReviewCenterAdServiceClient._get_universe_domain(
universe_domain_opt, self._universe_domain_env
)
self._api_endpoint = None # updated below, depending on `transport`
self._api_endpoint: str = "" # updated below, depending on `transport`

# Initialize the universe domain validation.
self._is_universe_domain_valid = False
Expand Down Expand Up @@ -1213,7 +1217,7 @@ def __exit__(self, type, value, traceback):

def get_operation(
self,
request: Optional[operations_pb2.GetOperationRequest] = None,
request: Optional[Union[operations_pb2.GetOperationRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
Expand All @@ -1239,8 +1243,12 @@ def get_operation(
# Create or coerce a protobuf request object.
# The request isn't a proto-plus wrapped type,
# so it must be constructed via keyword expansion.
if isinstance(request, dict):
request = operations_pb2.GetOperationRequest(**request)
if request is None:
request_pb = operations_pb2.GetOperationRequest()
elif isinstance(request, dict):
request_pb = operations_pb2.GetOperationRequest(**request)
else:
request_pb = request

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
Expand All @@ -1249,7 +1257,7 @@ def get_operation(
# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
gapic_v1.routing_header.to_grpc_metadata((("name", request_pb.name),)),
)

# Validate the universe domain.
Expand All @@ -1258,7 +1266,7 @@ def get_operation(
try:
# Send the request.
response = rpc(
request,
request_pb,
retry=retry,
timeout=timeout,
metadata=metadata,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ def __init__(
your own client library.
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
be used for service account credentials.
api_audience (Optional[str]): The intended audience for the API calls
to the service that will be set when using certain 3rd party
authentication flows. Audience is typically a resource identifier.
If not set, the host value will be used as a default.
"""

# Save the scopes.
Expand Down Expand Up @@ -130,6 +134,8 @@ def __init__(
host += ":443"
self._host = host

self._wrapped_methods: Dict[Callable, Callable] = {}

@property
def host(self):
return self._host
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,12 @@ def __init__(
url_scheme: the protocol scheme for the API endpoint. Normally
"https", but for testing or local servers,
"http" can be specified.
interceptor (Optional[AdReviewCenterAdServiceRestInterceptor]): Interceptor used
to manipulate requests, request metadata, and responses.
api_audience (Optional[str]): The intended audience for the API calls
to the service that will be set when using certain 3rd party
authentication flows. Audience is typically a resource identifier.
If not set, the host value will be used as a default.
"""
# Run the base constructor
# TODO(yon-mg): resolve other ctor params i.e. scopes, quota, etc.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ class AdUnitServiceClient(metaclass=AdUnitServiceClientMeta):
"""Provides methods for handling AdUnit objects."""

@staticmethod
def _get_default_mtls_endpoint(api_endpoint):
def _get_default_mtls_endpoint(api_endpoint) -> Optional[str]:
"""Converts api endpoint to mTLS endpoint.

Convert "*.sandbox.googleapis.com" and "*.googleapis.com" to
"*.mtls.sandbox.googleapis.com" and "*.mtls.googleapis.com" respectively.
Args:
api_endpoint (Optional[str]): the api endpoint to convert.
Returns:
str: converted mTLS api endpoint.
Optional[str]: converted mTLS api endpoint.
"""
if not api_endpoint:
return api_endpoint
Expand All @@ -133,6 +133,10 @@ def _get_default_mtls_endpoint(api_endpoint):
)

m = mtls_endpoint_re.match(api_endpoint)
if m is None:
# Could not parse api_endpoint; return as-is.
return api_endpoint

name, mtls, sandbox, googledomain = m.groups()
if mtls or not googledomain:
return api_endpoint
Expand Down Expand Up @@ -484,7 +488,7 @@ def _get_client_cert_source(provided_cert_source, use_cert_flag):
@staticmethod
def _get_api_endpoint(
api_override, client_cert_source, universe_domain, use_mtls_endpoint
):
) -> str:
"""Return the API endpoint used by the client.

Args:
Expand Down Expand Up @@ -581,7 +585,7 @@ def _add_cred_info_for_auth_errors(
error._details.append(json.dumps(cred_info))

@property
def api_endpoint(self):
def api_endpoint(self) -> str:
"""Return the API endpoint used by the client instance.

Returns:
Expand Down Expand Up @@ -677,7 +681,7 @@ def __init__(
self._universe_domain = AdUnitServiceClient._get_universe_domain(
universe_domain_opt, self._universe_domain_env
)
self._api_endpoint = None # updated below, depending on `transport`
self._api_endpoint: str = "" # updated below, depending on `transport`

# Initialize the universe domain validation.
self._is_universe_domain_valid = False
Expand Down Expand Up @@ -1964,7 +1968,7 @@ def __exit__(self, type, value, traceback):

def get_operation(
self,
request: Optional[operations_pb2.GetOperationRequest] = None,
request: Optional[Union[operations_pb2.GetOperationRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
Expand All @@ -1990,8 +1994,12 @@ def get_operation(
# Create or coerce a protobuf request object.
# The request isn't a proto-plus wrapped type,
# so it must be constructed via keyword expansion.
if isinstance(request, dict):
request = operations_pb2.GetOperationRequest(**request)
if request is None:
request_pb = operations_pb2.GetOperationRequest()
elif isinstance(request, dict):
request_pb = operations_pb2.GetOperationRequest(**request)
else:
request_pb = request

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
Expand All @@ -2000,7 +2008,7 @@ def get_operation(
# Certain fields should be provided within the metadata header;
# add these here.
metadata = tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
gapic_v1.routing_header.to_grpc_metadata((("name", request_pb.name),)),
)

# Validate the universe domain.
Expand All @@ -2009,7 +2017,7 @@ def get_operation(
try:
# Send the request.
response = rpc(
request,
request_pb,
retry=retry,
timeout=timeout,
metadata=metadata,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ def __init__(
your own client library.
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
be used for service account credentials.
api_audience (Optional[str]): The intended audience for the API calls
to the service that will be set when using certain 3rd party
authentication flows. Audience is typically a resource identifier.
If not set, the host value will be used as a default.
"""

# Save the scopes.
Expand Down Expand Up @@ -130,6 +134,8 @@ def __init__(
host += ":443"
self._host = host

self._wrapped_methods: Dict[Callable, Callable] = {}

@property
def host(self):
return self._host
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,12 @@ def __init__(
url_scheme: the protocol scheme for the API endpoint. Normally
"https", but for testing or local servers,
"http" can be specified.
interceptor (Optional[AdUnitServiceRestInterceptor]): Interceptor used
to manipulate requests, request metadata, and responses.
api_audience (Optional[str]): The intended audience for the API calls
to the service that will be set when using certain 3rd party
authentication flows. Audience is typically a resource identifier.
If not set, the host value will be used as a default.
"""
# Run the base constructor
# TODO(yon-mg): resolve other ctor params i.e. scopes, quota, etc.
Expand Down
Loading