Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

Commit

Permalink
fix(deps): Require google-api-core >=1.34.0, >=2.11.0 (#88)
Browse files Browse the repository at this point in the history
* chore: update to gapic-generator-python 1.5.0

feat: add support for `google.cloud.<api>.__version__`
PiperOrigin-RevId: 484665853

Source-Link: googleapis/googleapis@8eb249a

Source-Link: https://github.com/googleapis/googleapis-gen/commit/c8aa327b5f478865fc3fd91e3c2768e54e26ad44
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzhhYTMyN2I1ZjQ3ODg2NWZjM2ZkOTFlM2MyNzY4ZTU0ZTI2YWQ0NCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* add .release-please-manifest.json with correct version

* chore: Update to gapic-generator-python 1.6.0

feat(python): Add typing to proto.Message based class attributes

feat(python): Snippetgen handling of repeated enum field

PiperOrigin-RevId: 487326846

Source-Link: googleapis/googleapis@da380c7

Source-Link: https://github.com/googleapis/googleapis-gen/commit/61ef5762ee6731a0cbbfea22fd0eecee51ab1c8e
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjFlZjU3NjJlZTY3MzFhMGNiYmZlYTIyZmQwZWVjZWU1MWFiMWM4ZSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* feat: new APIs added to reflect updates to the filestore service

- Add ENTERPRISE Tier
- Add snapshot APIs: RevertInstance, ListSnapshots, CreateSnapshot, DeleteSnapshot, UpdateSnapshot
- Add multi-share APIs: ListShares, GetShare, CreateShare, DeleteShare, UpdateShare
- Add ConnectMode to NetworkConfig (for Private Service Access support)
- New status codes (SUSPENDED/SUSPENDING, REVERTING/RESUMING)
- Add SuspensionReason (for KMS related suspension)
- Add new fields to Instance information: max_capacity_gb, capacity_step_size_gb, max_share_count, capacity_gb, multi_share_enabled

PiperOrigin-RevId: 487492758

Source-Link: googleapis/googleapis@5be5981

Source-Link: https://github.com/googleapis/googleapis-gen/commit/ab0e217f560cc2c1afc11441c2eab6b6950efd2b
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWIwZTIxN2Y1NjBjYzJjMWFmYzExNDQxYzJlYWI2YjY5NTBlZmQyYiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* chore: Update gapic-generator-python to v1.6.1

PiperOrigin-RevId: 488036204

Source-Link: googleapis/googleapis@08f275f

Source-Link: https://github.com/googleapis/googleapis-gen/commit/555c0945e60649e38739ae64bc45719cdf72178f
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTU1YzA5NDVlNjA2NDllMzg3MzlhZTY0YmM0NTcxOWNkZjcyMTc4ZiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* docs: fix minor docstring formatting

PiperOrigin-RevId: 491440092

Source-Link: googleapis/googleapis@16db2fb

Source-Link: https://github.com/googleapis/googleapis-gen/commit/5ac3b73a0af5e1dccee53431e3d5124fd16e3073
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNWFjM2I3M2EwYWY1ZTFkY2NlZTUzNDMxZTNkNTEyNGZkMTZlMzA3MyJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* fix(deps): Require google-api-core >=1.34.0, >=2.11.0

fix: Drop usage of pkg_resources

fix: Fix timeout default values

docs(samples): Snippetgen should call await on the operation coroutine before calling result

PiperOrigin-RevId: 493260409

Source-Link: googleapis/googleapis@fea4387

Source-Link: https://github.com/googleapis/googleapis-gen/commit/387b7344c7529ee44be84e613b19a820508c612b
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzg3YjczNDRjNzUyOWVlNDRiZTg0ZTYxM2IxOWE4MjA1MDhjNjEyYiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* add gapic_version.py

* use templated owlbot.py and autogenerated setup.py

* workaround docs issue

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
  • Loading branch information
3 people authored Dec 15, 2022
1 parent 6bd655d commit 8df989c
Show file tree
Hide file tree
Showing 26 changed files with 677 additions and 459 deletions.
5 changes: 0 additions & 5 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,3 @@ exclude_lines =
pragma: NO COVER
# Ignore debug-only repr
def __repr__
# Ignore pkg_resources exceptions.
# This is added at the module level as a safeguard for if someone
# generates the code and tries to run it without pip installing. This
# makes it virtually impossible to test properly.
except pkg_resources.DistributionNotFound
1 change: 1 addition & 0 deletions .github/release-please.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
releaseType: python
handleGHRelease: true
manifest: true
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "1.1.3"
}
1 change: 0 additions & 1 deletion docs/optimization_v1/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ Types for Google Cloud Optimization v1 API

.. automodule:: google.cloud.optimization_v1.types
:members:
:undoc-members:
:show-inheritance:
90 changes: 90 additions & 0 deletions google/cloud/optimization/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from google.cloud.optimization import gapic_version as package_version

__version__ = package_version.__version__


from google.cloud.optimization_v1.services.fleet_routing.client import (
FleetRoutingClient,
)
from google.cloud.optimization_v1.services.fleet_routing.async_client import (
FleetRoutingAsyncClient,
)

from google.cloud.optimization_v1.types.async_model import AsyncModelMetadata
from google.cloud.optimization_v1.types.async_model import GcsDestination
from google.cloud.optimization_v1.types.async_model import GcsSource
from google.cloud.optimization_v1.types.async_model import InputConfig
from google.cloud.optimization_v1.types.async_model import OutputConfig
from google.cloud.optimization_v1.types.async_model import DataFormat
from google.cloud.optimization_v1.types.fleet_routing import AggregatedMetrics
from google.cloud.optimization_v1.types.fleet_routing import BatchOptimizeToursRequest
from google.cloud.optimization_v1.types.fleet_routing import BatchOptimizeToursResponse
from google.cloud.optimization_v1.types.fleet_routing import BreakRule
from google.cloud.optimization_v1.types.fleet_routing import CapacityQuantity
from google.cloud.optimization_v1.types.fleet_routing import CapacityQuantityInterval
from google.cloud.optimization_v1.types.fleet_routing import DistanceLimit
from google.cloud.optimization_v1.types.fleet_routing import InjectedSolutionConstraint
from google.cloud.optimization_v1.types.fleet_routing import Location
from google.cloud.optimization_v1.types.fleet_routing import OptimizeToursRequest
from google.cloud.optimization_v1.types.fleet_routing import OptimizeToursResponse
from google.cloud.optimization_v1.types.fleet_routing import (
OptimizeToursValidationError,
)
from google.cloud.optimization_v1.types.fleet_routing import Shipment
from google.cloud.optimization_v1.types.fleet_routing import ShipmentModel
from google.cloud.optimization_v1.types.fleet_routing import ShipmentRoute
from google.cloud.optimization_v1.types.fleet_routing import ShipmentTypeIncompatibility
from google.cloud.optimization_v1.types.fleet_routing import ShipmentTypeRequirement
from google.cloud.optimization_v1.types.fleet_routing import SkippedShipment
from google.cloud.optimization_v1.types.fleet_routing import TimeWindow
from google.cloud.optimization_v1.types.fleet_routing import TransitionAttributes
from google.cloud.optimization_v1.types.fleet_routing import Vehicle
from google.cloud.optimization_v1.types.fleet_routing import Waypoint

__all__ = (
"FleetRoutingClient",
"FleetRoutingAsyncClient",
"AsyncModelMetadata",
"GcsDestination",
"GcsSource",
"InputConfig",
"OutputConfig",
"DataFormat",
"AggregatedMetrics",
"BatchOptimizeToursRequest",
"BatchOptimizeToursResponse",
"BreakRule",
"CapacityQuantity",
"CapacityQuantityInterval",
"DistanceLimit",
"InjectedSolutionConstraint",
"Location",
"OptimizeToursRequest",
"OptimizeToursResponse",
"OptimizeToursValidationError",
"Shipment",
"ShipmentModel",
"ShipmentRoute",
"ShipmentTypeIncompatibility",
"ShipmentTypeRequirement",
"SkippedShipment",
"TimeWindow",
"TransitionAttributes",
"Vehicle",
"Waypoint",
)
16 changes: 16 additions & 0 deletions google/cloud/optimization/gapic_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.1.3" # {x-release-please-version}
2 changes: 2 additions & 0 deletions google/cloud/optimization/py.typed
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Marker file for PEP 561.
# The google-cloud-optimization package uses inline types.
4 changes: 4 additions & 0 deletions google/cloud/optimization_v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from google.cloud.optimization import gapic_version as package_version

__version__ = package_version.__version__


from .services.fleet_routing import FleetRoutingClient
from .services.fleet_routing import FleetRoutingAsyncClient
Expand Down
16 changes: 16 additions & 0 deletions google/cloud/optimization_v1/gapic_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "1.1.3" # {x-release-please-version}
44 changes: 25 additions & 19 deletions google/cloud/optimization_v1/services/fleet_routing/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,19 @@
from collections import OrderedDict
import functools
import re
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
import pkg_resources
from typing import (
Dict,
Mapping,
MutableMapping,
MutableSequence,
Optional,
Sequence,
Tuple,
Type,
Union,
)

from google.cloud.optimization_v1 import gapic_version as package_version

from google.api_core.client_options import ClientOptions
from google.api_core import exceptions as core_exceptions
Expand Down Expand Up @@ -177,9 +188,9 @@ def transport(self) -> FleetRoutingTransport:
def __init__(
self,
*,
credentials: ga_credentials.Credentials = None,
credentials: Optional[ga_credentials.Credentials] = None,
transport: Union[str, FleetRoutingTransport] = "grpc_asyncio",
client_options: ClientOptions = None,
client_options: Optional[ClientOptions] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
"""Instantiates the fleet routing client.
Expand Down Expand Up @@ -223,10 +234,10 @@ def __init__(

async def optimize_tours(
self,
request: Union[fleet_routing.OptimizeToursRequest, dict] = None,
request: Optional[Union[fleet_routing.OptimizeToursRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> fleet_routing.OptimizeToursResponse:
r"""Sends an ``OptimizeToursRequest`` containing a ``ShipmentModel``
Expand Down Expand Up @@ -273,7 +284,7 @@ async def sample_optimize_tours():
print(response)
Args:
request (Union[google.cloud.optimization_v1.types.OptimizeToursRequest, dict]):
request (Optional[Union[google.cloud.optimization_v1.types.OptimizeToursRequest, dict]]):
The request object. Request to be given to a tour
optimization solver which defines the shipment model to
solve as well as optimization parameters.
Expand Down Expand Up @@ -331,10 +342,10 @@ async def sample_optimize_tours():

async def batch_optimize_tours(
self,
request: Union[fleet_routing.BatchOptimizeToursRequest, dict] = None,
request: Optional[Union[fleet_routing.BatchOptimizeToursRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation_async.AsyncOperation:
r"""Optimizes vehicle tours for one or more ``OptimizeToursRequest``
Expand Down Expand Up @@ -379,13 +390,13 @@ async def sample_batch_optimize_tours():
print("Waiting for operation to complete...")
response = await operation.result()
response = (await operation).result()
# Handle the response
print(response)
Args:
request (Union[google.cloud.optimization_v1.types.BatchOptimizeToursRequest, dict]):
request (Optional[Union[google.cloud.optimization_v1.types.BatchOptimizeToursRequest, dict]]):
The request object. Request to batch optimize tours as
an asynchronous operation. Each input file should
contain one `OptimizeToursRequest`, and each output file
Expand Down Expand Up @@ -459,14 +470,9 @@ async def __aexit__(self, exc_type, exc, tb):
await self.transport.close()


try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution(
"google-cloud-optimization",
).version,
)
except pkg_resources.DistributionNotFound:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=package_version.__version__
)


__all__ = ("FleetRoutingAsyncClient",)
44 changes: 26 additions & 18 deletions google/cloud/optimization_v1/services/fleet_routing/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,20 @@
from collections import OrderedDict
import os
import re
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
import pkg_resources
from typing import (
Dict,
Mapping,
MutableMapping,
MutableSequence,
Optional,
Sequence,
Tuple,
Type,
Union,
cast,
)

from google.cloud.optimization_v1 import gapic_version as package_version

from google.api_core import client_options as client_options_lib
from google.api_core import exceptions as core_exceptions
Expand Down Expand Up @@ -57,7 +69,7 @@ class FleetRoutingClientMeta(type):

def get_transport_class(
cls,
label: str = None,
label: Optional[str] = None,
) -> Type[FleetRoutingTransport]:
"""Returns an appropriate transport class.
Expand Down Expand Up @@ -333,8 +345,8 @@ def __init__(
self,
*,
credentials: Optional[ga_credentials.Credentials] = None,
transport: Union[str, FleetRoutingTransport, None] = None,
client_options: Optional[client_options_lib.ClientOptions] = None,
transport: Optional[Union[str, FleetRoutingTransport]] = None,
client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
"""Instantiates the fleet routing client.
Expand All @@ -348,7 +360,7 @@ def __init__(
transport (Union[str, FleetRoutingTransport]): The
transport to use. If set to None, a transport is chosen
automatically.
client_options (google.api_core.client_options.ClientOptions): Custom options for the
client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the
client. It won't take effect if a ``transport`` instance is provided.
(1) The ``api_endpoint`` property can be used to override the
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
Expand Down Expand Up @@ -378,6 +390,7 @@ def __init__(
client_options = client_options_lib.from_dict(client_options)
if client_options is None:
client_options = client_options_lib.ClientOptions()
client_options = cast(client_options_lib.ClientOptions, client_options)

api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source(
client_options
Expand Down Expand Up @@ -430,10 +443,10 @@ def __init__(

def optimize_tours(
self,
request: Union[fleet_routing.OptimizeToursRequest, dict] = None,
request: Optional[Union[fleet_routing.OptimizeToursRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> fleet_routing.OptimizeToursResponse:
r"""Sends an ``OptimizeToursRequest`` containing a ``ShipmentModel``
Expand Down Expand Up @@ -530,10 +543,10 @@ def sample_optimize_tours():

def batch_optimize_tours(
self,
request: Union[fleet_routing.BatchOptimizeToursRequest, dict] = None,
request: Optional[Union[fleet_routing.BatchOptimizeToursRequest, dict]] = None,
*,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
metadata: Sequence[Tuple[str, str]] = (),
) -> operation.Operation:
r"""Optimizes vehicle tours for one or more ``OptimizeToursRequest``
Expand Down Expand Up @@ -657,14 +670,9 @@ def __exit__(self, type, value, traceback):
self.transport.close()


try:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=pkg_resources.get_distribution(
"google-cloud-optimization",
).version,
)
except pkg_resources.DistributionNotFound:
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo()
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
gapic_version=package_version.__version__
)


__all__ = ("FleetRoutingClient",)
Loading

0 comments on commit 8df989c

Please sign in to comment.