Skip to content

Commit d3c0825

Browse files
feat: [google-maps-fleetengine] add ability to specify trip attributes to Trip and deprecate Trip.remaining_waypoints_version (googleapis#14070)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 781185838 Source-Link: googleapis/googleapis@302273a Source-Link: https://github.com/googleapis/googleapis-gen/commit/dd3d22b67c589f8f6042f30a885a57728a2ed4fa Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtZmxlZXRlbmdpbmUvLk93bEJvdC55YW1sIiwiaCI6ImRkM2QyMmI2N2M1ODlmOGY2MDQyZjMwYTg4NWE1NzcyOGEyZWQ0ZmEifQ== --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent f5cd663 commit d3c0825

File tree

10 files changed

+108
-11
lines changed

10 files changed

+108
-11
lines changed

packages/google-maps-fleetengine/google/maps/fleetengine/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
PolylineFormatType,
3535
TerminalLocation,
3636
TerminalPointId,
37+
TripAttribute,
3738
TripType,
3839
TripWaypoint,
3940
VehicleAttribute,
@@ -96,6 +97,7 @@
9697
"VehicleServiceAsyncClient",
9798
"TerminalLocation",
9899
"TerminalPointId",
100+
"TripAttribute",
99101
"TripWaypoint",
100102
"VehicleAttribute",
101103
"VehicleLocation",

packages/google-maps-fleetengine/google/maps/fleetengine/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.2.10" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-maps-fleetengine/google/maps/fleetengine_v1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
PolylineFormatType,
2727
TerminalLocation,
2828
TerminalPointId,
29+
TripAttribute,
2930
TripType,
3031
TripWaypoint,
3132
VehicleAttribute,
@@ -112,6 +113,7 @@
112113
"TerminalPointId",
113114
"TrafficPolylineData",
114115
"Trip",
116+
"TripAttribute",
115117
"TripServiceClient",
116118
"TripStatus",
117119
"TripType",

packages/google-maps-fleetengine/google/maps/fleetengine_v1/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "0.2.10" # {x-release-please-version}
16+
__version__ = "0.0.0" # {x-release-please-version}

packages/google-maps-fleetengine/google/maps/fleetengine_v1/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
PolylineFormatType,
2020
TerminalLocation,
2121
TerminalPointId,
22+
TripAttribute,
2223
TripType,
2324
TripWaypoint,
2425
VehicleAttribute,
@@ -68,6 +69,7 @@
6869
__all__ = (
6970
"TerminalLocation",
7071
"TerminalPointId",
72+
"TripAttribute",
7173
"TripWaypoint",
7274
"VehicleAttribute",
7375
"VehicleLocation",

packages/google-maps-fleetengine/google/maps/fleetengine_v1/types/fleetengine.py

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"TripWaypoint",
3939
"VehicleAttribute",
4040
"VehicleLocation",
41+
"TripAttribute",
4142
},
4243
)
4344

@@ -467,6 +468,17 @@ class VehicleLocation(proto.Message):
467468
Source of the raw location. Defaults to ``GPS``.
468469
raw_location_accuracy (google.protobuf.wrappers_pb2.DoubleValue):
469470
Accuracy of ``raw_location`` as a radius, in meters.
471+
flp_location (google.type.latlng_pb2.LatLng):
472+
The location from Android's Fused Location
473+
Provider.
474+
flp_update_time (google.protobuf.timestamp_pb2.Timestamp):
475+
Update timestamp of ``flp_location``.
476+
flp_latlng_accuracy_meters (google.protobuf.wrappers_pb2.DoubleValue):
477+
Accuracy of ``flp_location`` in meters as a radius.
478+
flp_heading_degrees (google.protobuf.wrappers_pb2.Int32Value):
479+
Direction the vehicle is moving in degrees, as determined by
480+
the Fused Location Provider. 0 represents North. The valid
481+
range is [0,360).
470482
supplemental_location (google.type.latlng_pb2.LatLng):
471483
Supplemental location provided by the
472484
integrating app.
@@ -598,6 +610,26 @@ class VehicleLocation(proto.Message):
598610
number=25,
599611
message=wrappers_pb2.DoubleValue,
600612
)
613+
flp_location: latlng_pb2.LatLng = proto.Field(
614+
proto.MESSAGE,
615+
number=29,
616+
message=latlng_pb2.LatLng,
617+
)
618+
flp_update_time: timestamp_pb2.Timestamp = proto.Field(
619+
proto.MESSAGE,
620+
number=30,
621+
message=timestamp_pb2.Timestamp,
622+
)
623+
flp_latlng_accuracy_meters: wrappers_pb2.DoubleValue = proto.Field(
624+
proto.MESSAGE,
625+
number=31,
626+
message=wrappers_pb2.DoubleValue,
627+
)
628+
flp_heading_degrees: wrappers_pb2.Int32Value = proto.Field(
629+
proto.MESSAGE,
630+
number=32,
631+
message=wrappers_pb2.Int32Value,
632+
)
601633
supplemental_location: latlng_pb2.LatLng = proto.Field(
602634
proto.MESSAGE,
603635
number=18,
@@ -624,4 +656,54 @@ class VehicleLocation(proto.Message):
624656
)
625657

626658

659+
class TripAttribute(proto.Message):
660+
r"""Describes a trip attribute as a key-value pair. The
661+
"key:value" string length cannot exceed 256 characters.
662+
663+
This message has `oneof`_ fields (mutually exclusive fields).
664+
For each oneof, at most one member field can be set at the same time.
665+
Setting any member of the oneof automatically clears all other
666+
members.
667+
668+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
669+
670+
Attributes:
671+
key (str):
672+
The attribute's key. Keys may not contain the
673+
colon character (:).
674+
string_value (str):
675+
String typed attribute value.
676+
677+
This field is a member of `oneof`_ ``trip_attribute_value``.
678+
bool_value (bool):
679+
Boolean typed attribute value.
680+
681+
This field is a member of `oneof`_ ``trip_attribute_value``.
682+
number_value (float):
683+
Double typed attribute value.
684+
685+
This field is a member of `oneof`_ ``trip_attribute_value``.
686+
"""
687+
688+
key: str = proto.Field(
689+
proto.STRING,
690+
number=1,
691+
)
692+
string_value: str = proto.Field(
693+
proto.STRING,
694+
number=2,
695+
oneof="trip_attribute_value",
696+
)
697+
bool_value: bool = proto.Field(
698+
proto.BOOL,
699+
number=3,
700+
oneof="trip_attribute_value",
701+
)
702+
number_value: float = proto.Field(
703+
proto.DOUBLE,
704+
number=4,
705+
oneof="trip_attribute_value",
706+
)
707+
708+
627709
__all__ = tuple(sorted(__protobuf__.manifest))

packages/google-maps-fleetengine/google/maps/fleetengine_v1/types/traffic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ class Speed(proto.Enum):
5454
SPEED_UNSPECIFIED (0):
5555
Default value. This value is unused.
5656
NORMAL (1):
57-
Normal speed, no slowdown is detected.
57+
Normal speed, no traffic delays.
5858
SLOW (2):
59-
Slowdown detected, but no traffic jam formed.
59+
Slowdown detected, medium amount of traffic.
6060
TRAFFIC_JAM (3):
61-
Traffic jam detected.
61+
Traffic delays.
6262
"""
6363
SPEED_UNSPECIFIED = 0
6464
NORMAL = 1

packages/google-maps-fleetengine/google/maps/fleetengine_v1/types/trip_api.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,12 @@ class GetTripRequest(proto.Message):
144144
the route field is not set in the response. If a minimum is
145145
unspecified, the route data are always retrieved.
146146
remaining_waypoints_version (google.protobuf.timestamp_pb2.Timestamp):
147-
Indicates the minimum timestamp (exclusive) for which
148-
``Trip.remaining_waypoints`` are retrieved. If they are
149-
unchanged since this timestamp, the ``remaining_waypoints``
150-
are not set in the response. If this field is unspecified,
151-
``remaining_waypoints`` is always retrieved.
147+
Deprecated: ``Trip.remaining_waypoints`` are always
148+
retrieved. Use ``remaining_waypoints_route_version`` to
149+
control when
150+
``Trip.remaining_waypoints.traffic_to_waypoint`` and
151+
``Trip.remaining_waypoints.path_to_waypoint`` data are
152+
retrieved.
152153
route_format_type (google.maps.fleetengine_v1.types.PolylineFormatType):
153154
The returned current route format, ``LAT_LNG_LIST_TYPE`` (in
154155
``Trip.route``), or ``ENCODED_POLYLINE_TYPE`` (in

packages/google-maps-fleetengine/google/maps/fleetengine_v1/types/trips.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,9 @@ class Trip(proto.Message):
292292
view (google.maps.fleetengine_v1.types.TripView):
293293
The subset of Trip fields that are populated
294294
and how they should be interpreted.
295+
attributes (MutableSequence[google.maps.fleetengine_v1.types.TripAttribute]):
296+
A list of custom Trip attributes. Each
297+
attribute must have a unique key.
295298
"""
296299

297300
name: str = proto.Field(
@@ -461,6 +464,11 @@ class Trip(proto.Message):
461464
number=31,
462465
enum="TripView",
463466
)
467+
attributes: MutableSequence[fleetengine.TripAttribute] = proto.RepeatedField(
468+
proto.MESSAGE,
469+
number=35,
470+
message=fleetengine.TripAttribute,
471+
)
464472

465473

466474
class StopLocation(proto.Message):

packages/google-maps-fleetengine/samples/generated_samples/snippet_metadata_maps.fleetengine.v1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
],
99
"language": "PYTHON",
1010
"name": "google-maps-fleetengine",
11-
"version": "0.2.10"
11+
"version": "0.1.0"
1212
},
1313
"snippets": [
1414
{

0 commit comments

Comments
 (0)