Skip to content
This repository was archived by the owner on Nov 14, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/.OwlBot.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
# 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
# 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.

docker:
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
digest: sha256:f848855a87932612125b7b7be24ae0a58c41ce32cba8239e0748edd50a64f71e
digest: sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe
5 changes: 4 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,10 @@
intersphinx_mapping = {
"python": ("https://python.readthedocs.org/en/latest/", None),
"google-auth": ("https://googleapis.dev/python/google-auth/latest/", None),
"google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None,),
"google.api_core": (
"https://googleapis.dev/python/google-api-core/latest/",
None,
),
"grpc": ("https://grpc.github.io/grpc/python/", None),
"proto-plus": ("https://proto-plus-python.readthedocs.io/en/latest/", None),
"protobuf": ("https://googleapis.dev/python/protobuf/latest/", None),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,12 @@ def sample_optimize_tours():
)

# Send the request.
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
response = await rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Done; return the response.
return response
Expand Down Expand Up @@ -417,7 +422,12 @@ def sample_batch_optimize_tours():
)

# Send the request.
response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
response = await rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Wrap the response in an operation future.
response = operation_async.from_gapic(
Expand Down
55 changes: 43 additions & 12 deletions google/cloud/optimization_v1/services/fleet_routing/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ class FleetRoutingClientMeta(type):
_transport_registry["grpc"] = FleetRoutingGrpcTransport
_transport_registry["grpc_asyncio"] = FleetRoutingGrpcAsyncIOTransport

def get_transport_class(cls, label: str = None,) -> Type[FleetRoutingTransport]:
def get_transport_class(
cls,
label: str = None,
) -> Type[FleetRoutingTransport]:
"""Returns an appropriate transport class.

Args:
Expand Down Expand Up @@ -183,7 +186,9 @@ def transport(self) -> FleetRoutingTransport:
return self._transport

@staticmethod
def common_billing_account_path(billing_account: str,) -> str:
def common_billing_account_path(
billing_account: str,
) -> str:
"""Returns a fully-qualified billing_account string."""
return "billingAccounts/{billing_account}".format(
billing_account=billing_account,
Expand All @@ -196,9 +201,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}

@staticmethod
def common_folder_path(folder: str,) -> str:
def common_folder_path(
folder: str,
) -> str:
"""Returns a fully-qualified folder string."""
return "folders/{folder}".format(folder=folder,)
return "folders/{folder}".format(
folder=folder,
)

@staticmethod
def parse_common_folder_path(path: str) -> Dict[str, str]:
Expand All @@ -207,9 +216,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}

@staticmethod
def common_organization_path(organization: str,) -> str:
def common_organization_path(
organization: str,
) -> str:
"""Returns a fully-qualified organization string."""
return "organizations/{organization}".format(organization=organization,)
return "organizations/{organization}".format(
organization=organization,
)

@staticmethod
def parse_common_organization_path(path: str) -> Dict[str, str]:
Expand All @@ -218,9 +231,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}

@staticmethod
def common_project_path(project: str,) -> str:
def common_project_path(
project: str,
) -> str:
"""Returns a fully-qualified project string."""
return "projects/{project}".format(project=project,)
return "projects/{project}".format(
project=project,
)

@staticmethod
def parse_common_project_path(path: str) -> Dict[str, str]:
Expand All @@ -229,10 +246,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]:
return m.groupdict() if m else {}

@staticmethod
def common_location_path(project: str, location: str,) -> str:
def common_location_path(
project: str,
location: str,
) -> str:
"""Returns a fully-qualified location string."""
return "projects/{project}/locations/{location}".format(
project=project, location=location,
project=project,
location=location,
)

@staticmethod
Expand Down Expand Up @@ -490,7 +511,12 @@ def sample_optimize_tours():
)

# Send the request.
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
response = rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Done; return the response.
return response
Expand Down Expand Up @@ -586,7 +612,12 @@ def sample_batch_optimize_tours():
)

# Send the request.
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
response = rpc(
request,
retry=retry,
timeout=timeout,
metadata=metadata,
)

# Wrap the response in an operation future.
response = operation.from_gapic(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ def _prep_wrapped_messages(self, client_info):
def close(self):
"""Closes resources associated with the transport.

.. warning::
Only call this method if the transport is NOT shared
with other clients - this may cause errors in other clients!
.. warning::
Only call this method if the transport is NOT shared
with other clients - this may cause errors in other clients!
"""
raise NotImplementedError()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,7 @@ def create_channel(

@property
def grpc_channel(self) -> grpc.Channel:
"""Return the channel designed to connect to this service.
"""
"""Return the channel designed to connect to this service."""
return self._grpc_channel

@property
Expand Down
55 changes: 45 additions & 10 deletions google/cloud/optimization_v1/types/async_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,16 @@ class InputConfig(proto.Message):
"""

gcs_source = proto.Field(
proto.MESSAGE, number=1, oneof="source", message="GcsSource",
proto.MESSAGE,
number=1,
oneof="source",
message="GcsSource",
)
data_format = proto.Field(
proto.ENUM,
number=2,
enum="DataFormat",
)
data_format = proto.Field(proto.ENUM, number=2, enum="DataFormat",)


class OutputConfig(proto.Message):
Expand All @@ -77,9 +84,16 @@ class OutputConfig(proto.Message):
"""

gcs_destination = proto.Field(
proto.MESSAGE, number=1, oneof="destination", message="GcsDestination",
proto.MESSAGE,
number=1,
oneof="destination",
message="GcsDestination",
)
data_format = proto.Field(
proto.ENUM,
number=2,
enum="DataFormat",
)
data_format = proto.Field(proto.ENUM, number=2, enum="DataFormat",)


class GcsSource(proto.Message):
Expand All @@ -92,7 +106,10 @@ class GcsSource(proto.Message):
location.
"""

uri = proto.Field(proto.STRING, number=1,)
uri = proto.Field(
proto.STRING,
number=1,
)


class GcsDestination(proto.Message):
Expand All @@ -105,7 +122,10 @@ class GcsDestination(proto.Message):
location.
"""

uri = proto.Field(proto.STRING, number=1,)
uri = proto.Field(
proto.STRING,
number=1,
)


class AsyncModelMetadata(proto.Message):
Expand Down Expand Up @@ -133,10 +153,25 @@ class State(proto.Enum):
CANCELLED = 3
FAILED = 4

state = proto.Field(proto.ENUM, number=1, enum=State,)
state_message = proto.Field(proto.STRING, number=2,)
create_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,)
update_time = proto.Field(proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp,)
state = proto.Field(
proto.ENUM,
number=1,
enum=State,
)
state_message = proto.Field(
proto.STRING,
number=2,
)
create_time = proto.Field(
proto.MESSAGE,
number=3,
message=timestamp_pb2.Timestamp,
)
update_time = proto.Field(
proto.MESSAGE,
number=4,
message=timestamp_pb2.Timestamp,
)


__all__ = tuple(sorted(__protobuf__.manifest))
Loading