Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: [google-cloud-batch] Update description on allowed_locations in LocationPolicy field #12650

Merged
merged 3 commits into from
May 7, 2024
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.17.18" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "0.17.18" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import functools
import re
from typing import (
Callable,
Dict,
Mapping,
MutableMapping,
Expand Down Expand Up @@ -207,7 +208,9 @@ def __init__(
self,
*,
credentials: Optional[ga_credentials.Credentials] = None,
transport: Union[str, BatchServiceTransport] = "grpc_asyncio",
transport: Optional[
Union[str, BatchServiceTransport, Callable[..., BatchServiceTransport]]
] = "grpc_asyncio",
client_options: Optional[ClientOptions] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
Expand All @@ -219,9 +222,11 @@ def __init__(
credentials identify the application to the service; if none
are specified, the client will attempt to ascertain the
credentials from the environment.
transport (Union[str, ~.BatchServiceTransport]): The
transport to use. If set to None, a transport is chosen
automatically.
transport (Optional[Union[str,BatchServiceTransport,Callable[..., BatchServiceTransport]]]):
The transport to use, or a Callable that constructs and returns a new transport to use.
If a Callable is given, it will be called with the same set of initialization
arguments as used in the BatchServiceTransport constructor.
If set to None, a transport is chosen automatically.
client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]):
Custom options for the client.

Expand Down Expand Up @@ -346,16 +351,19 @@ async def sample_create_job():
The Cloud Batch Job description.
"""
# Create or coerce a protobuf request object.
# Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
# - Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([parent, job, job_id])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
)

request = batch.CreateJobRequest(request)
# - Use the request object if provided (there's no risk of modifying the input as
# there are no flattened fields), or create one.
if not isinstance(request, batch.CreateJobRequest):
request = batch.CreateJobRequest(request)

# If we have keyword arguments corresponding to fields on the
# request, apply these.
Expand All @@ -368,11 +376,9 @@ async def sample_create_job():

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.create_job,
default_timeout=60.0,
client_info=DEFAULT_CLIENT_INFO,
)
rpc = self._client._transport._wrapped_methods[
self._client._transport.create_job
]

# Certain fields should be provided within the metadata header;
# add these here.
Expand Down Expand Up @@ -450,16 +456,19 @@ async def sample_get_job():
The Cloud Batch Job description.
"""
# Create or coerce a protobuf request object.
# Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
# - Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([name])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
)

request = batch.GetJobRequest(request)
# - Use the request object if provided (there's no risk of modifying the input as
# there are no flattened fields), or create one.
if not isinstance(request, batch.GetJobRequest):
request = batch.GetJobRequest(request)

# If we have keyword arguments corresponding to fields on the
# request, apply these.
Expand All @@ -468,20 +477,7 @@ async def sample_get_job():

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.get_job,
default_retry=retries.AsyncRetry(
initial=1.0,
maximum=10.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.ServiceUnavailable,
),
deadline=60.0,
),
default_timeout=60.0,
client_info=DEFAULT_CLIENT_INFO,
)
rpc = self._client._transport._wrapped_methods[self._client._transport.get_job]

# Certain fields should be provided within the metadata header;
# add these here.
Expand Down Expand Up @@ -574,16 +570,19 @@ async def sample_delete_job():

"""
# Create or coerce a protobuf request object.
# Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
# - Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([name])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
)

request = batch.DeleteJobRequest(request)
# - Use the request object if provided (there's no risk of modifying the input as
# there are no flattened fields), or create one.
if not isinstance(request, batch.DeleteJobRequest):
request = batch.DeleteJobRequest(request)

# If we have keyword arguments corresponding to fields on the
# request, apply these.
Expand All @@ -592,11 +591,9 @@ async def sample_delete_job():

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.delete_job,
default_timeout=60.0,
client_info=DEFAULT_CLIENT_INFO,
)
rpc = self._client._transport._wrapped_methods[
self._client._transport.delete_job
]

# Certain fields should be provided within the metadata header;
# add these here.
Expand Down Expand Up @@ -687,16 +684,19 @@ async def sample_list_jobs():

"""
# Create or coerce a protobuf request object.
# Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
# - Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([parent])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
)

request = batch.ListJobsRequest(request)
# - Use the request object if provided (there's no risk of modifying the input as
# there are no flattened fields), or create one.
if not isinstance(request, batch.ListJobsRequest):
request = batch.ListJobsRequest(request)

# If we have keyword arguments corresponding to fields on the
# request, apply these.
Expand All @@ -705,20 +705,9 @@ async def sample_list_jobs():

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.list_jobs,
default_retry=retries.AsyncRetry(
initial=1.0,
maximum=10.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.ServiceUnavailable,
),
deadline=60.0,
),
default_timeout=60.0,
client_info=DEFAULT_CLIENT_INFO,
)
rpc = self._client._transport._wrapped_methods[
self._client._transport.list_jobs
]

# Certain fields should be provided within the metadata header;
# add these here.
Expand Down Expand Up @@ -805,16 +794,19 @@ async def sample_get_task():
A Cloud Batch task.
"""
# Create or coerce a protobuf request object.
# Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
# - Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([name])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
)

request = batch.GetTaskRequest(request)
# - Use the request object if provided (there's no risk of modifying the input as
# there are no flattened fields), or create one.
if not isinstance(request, batch.GetTaskRequest):
request = batch.GetTaskRequest(request)

# If we have keyword arguments corresponding to fields on the
# request, apply these.
Expand All @@ -823,20 +815,7 @@ async def sample_get_task():

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.get_task,
default_retry=retries.AsyncRetry(
initial=1.0,
maximum=10.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.ServiceUnavailable,
),
deadline=60.0,
),
default_timeout=60.0,
client_info=DEFAULT_CLIENT_INFO,
)
rpc = self._client._transport._wrapped_methods[self._client._transport.get_task]

# Certain fields should be provided within the metadata header;
# add these here.
Expand Down Expand Up @@ -923,16 +902,19 @@ async def sample_list_tasks():

"""
# Create or coerce a protobuf request object.
# Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
# - Quick check: If we got a request object, we should *not* have
# gotten any keyword arguments that map to the request.
has_flattened_params = any([parent])
if request is not None and has_flattened_params:
raise ValueError(
"If the `request` argument is set, then none of "
"the individual field arguments should be set."
)

request = batch.ListTasksRequest(request)
# - Use the request object if provided (there's no risk of modifying the input as
# there are no flattened fields), or create one.
if not isinstance(request, batch.ListTasksRequest):
request = batch.ListTasksRequest(request)

# If we have keyword arguments corresponding to fields on the
# request, apply these.
Expand All @@ -941,20 +923,9 @@ async def sample_list_tasks():

# Wrap the RPC method; this adds retry and timeout information,
# and friendly error handling.
rpc = gapic_v1.method_async.wrap_method(
self._client._transport.list_tasks,
default_retry=retries.AsyncRetry(
initial=1.0,
maximum=10.0,
multiplier=1.3,
predicate=retries.if_exception_type(
core_exceptions.ServiceUnavailable,
),
deadline=60.0,
),
default_timeout=60.0,
client_info=DEFAULT_CLIENT_INFO,
)
rpc = self._client._transport._wrapped_methods[
self._client._transport.list_tasks
]

# Certain fields should be provided within the metadata header;
# add these here.
Expand Down
Loading
Loading