google-maps-fleet_engine-v1 0.a → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +12 -0
- data/AUTHENTICATION.md +122 -0
- data/README.md +144 -8
- data/lib/google/maps/fleet_engine/v1/rest.rb +38 -0
- data/lib/google/maps/fleet_engine/v1/trip_service/client.rb +996 -0
- data/lib/google/maps/fleet_engine/v1/trip_service/credentials.rb +47 -0
- data/lib/google/maps/fleet_engine/v1/trip_service/paths.rb +50 -0
- data/lib/google/maps/fleet_engine/v1/trip_service/rest/client.rb +930 -0
- data/lib/google/maps/fleet_engine/v1/trip_service/rest/service_stub.rb +368 -0
- data/lib/google/maps/fleet_engine/v1/trip_service/rest.rb +52 -0
- data/lib/google/maps/fleet_engine/v1/trip_service.rb +55 -0
- data/lib/google/maps/fleet_engine/v1/vehicle_service/client.rb +1639 -0
- data/lib/google/maps/fleet_engine/v1/vehicle_service/credentials.rb +47 -0
- data/lib/google/maps/fleet_engine/v1/vehicle_service/paths.rb +50 -0
- data/lib/google/maps/fleet_engine/v1/vehicle_service/rest/client.rb +1545 -0
- data/lib/google/maps/fleet_engine/v1/vehicle_service/rest/service_stub.rb +547 -0
- data/lib/google/maps/fleet_engine/v1/vehicle_service/rest.rb +52 -0
- data/lib/google/maps/fleet_engine/v1/vehicle_service.rb +55 -0
- data/lib/google/maps/fleet_engine/v1/version.rb +8 -3
- data/lib/google/maps/fleet_engine/v1.rb +46 -0
- data/lib/google/maps/fleetengine/v1/fleetengine_pb.rb +63 -0
- data/lib/google/maps/fleetengine/v1/header_pb.rb +46 -0
- data/lib/google/maps/fleetengine/v1/traffic_pb.rb +44 -0
- data/lib/google/maps/fleetengine/v1/trip_api_pb.rb +66 -0
- data/lib/google/maps/fleetengine/v1/trip_api_services_pb.rb +53 -0
- data/lib/google/maps/fleetengine/v1/trips_pb.rb +61 -0
- data/lib/google/maps/fleetengine/v1/vehicle_api_pb.rb +81 -0
- data/lib/google/maps/fleetengine/v1/vehicle_api_services_pb.rb +108 -0
- data/lib/google/maps/fleetengine/v1/vehicles_pb.rb +64 -0
- data/lib/google-maps-fleet_engine-v1.rb +21 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/client.rb +399 -0
- data/proto_docs/google/api/field_behavior.rb +85 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/api/resource.rb +222 -0
- data/proto_docs/google/api/routing.rb +459 -0
- data/proto_docs/google/geo/type/viewport.rb +70 -0
- data/proto_docs/google/maps/fleetengine/v1/fleetengine.rb +342 -0
- data/proto_docs/google/maps/fleetengine/v1/header.rb +111 -0
- data/proto_docs/google/maps/fleetengine/v1/traffic.rb +76 -0
- data/proto_docs/google/maps/fleetengine/v1/trip_api.rb +296 -0
- data/proto_docs/google/maps/fleetengine/v1/trips.rb +286 -0
- data/proto_docs/google/maps/fleetengine/v1/vehicle_api.rb +684 -0
- data/proto_docs/google/maps/fleetengine/v1/vehicles.rb +358 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +34 -0
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/timestamp.rb +127 -0
- data/proto_docs/google/protobuf/wrappers.rb +121 -0
- data/proto_docs/google/type/latlng.rb +38 -0
- metadata +119 -13
@@ -0,0 +1,358 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2024 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Maps
|
22
|
+
module FleetEngine
|
23
|
+
module V1
|
24
|
+
# Vehicle metadata.
|
25
|
+
# @!attribute [r] name
|
26
|
+
# @return [::String]
|
27
|
+
# Output only. The unique name for this vehicle.
|
28
|
+
# The format is `providers/{provider}/vehicles/{vehicle}`.
|
29
|
+
# @!attribute [rw] vehicle_state
|
30
|
+
# @return [::Google::Maps::FleetEngine::V1::VehicleState]
|
31
|
+
# The vehicle state.
|
32
|
+
# @!attribute [rw] supported_trip_types
|
33
|
+
# @return [::Array<::Google::Maps::FleetEngine::V1::TripType>]
|
34
|
+
# Trip types supported by this vehicle.
|
35
|
+
# @!attribute [r] current_trips
|
36
|
+
# @return [::Array<::String>]
|
37
|
+
# Output only. List of `trip_id`'s for trips currently assigned to this
|
38
|
+
# vehicle.
|
39
|
+
# @!attribute [rw] last_location
|
40
|
+
# @return [::Google::Maps::FleetEngine::V1::VehicleLocation]
|
41
|
+
# Last reported location of the vehicle.
|
42
|
+
# @!attribute [rw] maximum_capacity
|
43
|
+
# @return [::Integer]
|
44
|
+
# The total numbers of riders this vehicle can carry. The driver is not
|
45
|
+
# considered in this value. This value must be greater than or equal to one.
|
46
|
+
# @!attribute [rw] attributes
|
47
|
+
# @return [::Array<::Google::Maps::FleetEngine::V1::VehicleAttribute>]
|
48
|
+
# List of vehicle attributes. A vehicle can have at most 100
|
49
|
+
# attributes, and each attribute must have a unique key.
|
50
|
+
# @!attribute [rw] vehicle_type
|
51
|
+
# @return [::Google::Maps::FleetEngine::V1::Vehicle::VehicleType]
|
52
|
+
# Required. The type of this vehicle. Can be used to filter vehicles in
|
53
|
+
# `SearchVehicles` results. Also influences ETA and route calculations.
|
54
|
+
# @!attribute [rw] license_plate
|
55
|
+
# @return [::Google::Maps::FleetEngine::V1::LicensePlate]
|
56
|
+
# License plate information for the vehicle.
|
57
|
+
# @!attribute [rw] route
|
58
|
+
# @deprecated This field is deprecated and may be removed in the next major version update.
|
59
|
+
# @return [::Array<::Google::Maps::FleetEngine::V1::TerminalLocation>]
|
60
|
+
# Deprecated: Use `Vehicle.waypoints` instead.
|
61
|
+
# @!attribute [rw] current_route_segment
|
62
|
+
# @return [::String]
|
63
|
+
# The polyline specifying the route the driver app intends to take to
|
64
|
+
# the next waypoint. This list is also returned in
|
65
|
+
# `Trip.current_route_segment` for all active trips assigned to the vehicle.
|
66
|
+
#
|
67
|
+
# Note: This field is intended only for use by the Driver SDK. Decoding is
|
68
|
+
# not yet supported.
|
69
|
+
# @!attribute [rw] current_route_segment_traffic
|
70
|
+
# @return [::Google::Maps::FleetEngine::V1::TrafficPolylineData]
|
71
|
+
# Input only. Fleet Engine uses this information to improve journey sharing.
|
72
|
+
# Note: This field is intended only for use by the Driver SDK.
|
73
|
+
# @!attribute [r] current_route_segment_version
|
74
|
+
# @return [::Google::Protobuf::Timestamp]
|
75
|
+
# Output only. Time when `current_route_segment` was set. It can be stored by
|
76
|
+
# the client and passed in future `GetVehicle` requests to prevent returning
|
77
|
+
# routes that haven't changed.
|
78
|
+
# @!attribute [rw] current_route_segment_end_point
|
79
|
+
# @return [::Google::Maps::FleetEngine::V1::TripWaypoint]
|
80
|
+
# The waypoint where `current_route_segment` ends. This can be supplied by
|
81
|
+
# drivers on `UpdateVehicle` calls either as a full trip waypoint, a waypoint
|
82
|
+
# `LatLng`, or as the last `LatLng` of the `current_route_segment`. Fleet
|
83
|
+
# Engine will then do its best to interpolate to an actual waypoint if it is
|
84
|
+
# not fully specified. This field is ignored in `UpdateVehicle` calls unless
|
85
|
+
# `current_route_segment` is also specified.
|
86
|
+
# @!attribute [rw] remaining_distance_meters
|
87
|
+
# @return [::Google::Protobuf::Int32Value]
|
88
|
+
# The remaining driving distance for the `current_route_segment`.
|
89
|
+
# This value is also returned in `Trip.remaining_distance_meters` for all
|
90
|
+
# active trips assigned to the vehicle. The value is unspecified if the
|
91
|
+
# `current_route_segment` field is empty.
|
92
|
+
# @!attribute [rw] eta_to_first_waypoint
|
93
|
+
# @return [::Google::Protobuf::Timestamp]
|
94
|
+
# The ETA to the first entry in the `waypoints` field. The value is
|
95
|
+
# unspecified if the `waypoints` field is empty or the
|
96
|
+
# `Vehicle.current_route_segment` field is empty.
|
97
|
+
#
|
98
|
+
# When updating a vehicle, `remaining_time_seconds` takes precedence over
|
99
|
+
# `eta_to_first_waypoint` in the same request.
|
100
|
+
# @!attribute [rw] remaining_time_seconds
|
101
|
+
# @return [::Google::Protobuf::Int32Value]
|
102
|
+
# Input only. The remaining driving time for the `current_route_segment`. The
|
103
|
+
# value is unspecified if the `waypoints` field is empty or the
|
104
|
+
# `Vehicle.current_route_segment` field is empty. This value should match
|
105
|
+
# `eta_to_first_waypoint` - `current_time` if all parties are using the same
|
106
|
+
# clock.
|
107
|
+
#
|
108
|
+
# When updating a vehicle, `remaining_time_seconds` takes precedence over
|
109
|
+
# `eta_to_first_waypoint` in the same request.
|
110
|
+
# @!attribute [rw] waypoints
|
111
|
+
# @return [::Array<::Google::Maps::FleetEngine::V1::TripWaypoint>]
|
112
|
+
# The remaining waypoints assigned to this Vehicle.
|
113
|
+
# @!attribute [r] waypoints_version
|
114
|
+
# @return [::Google::Protobuf::Timestamp]
|
115
|
+
# Output only. Last time the `waypoints` field was updated. Clients should
|
116
|
+
# cache this value and pass it in `GetVehicleRequest` to ensure the
|
117
|
+
# `waypoints` field is only returned if it is updated.
|
118
|
+
# @!attribute [rw] back_to_back_enabled
|
119
|
+
# @return [::Boolean]
|
120
|
+
# Indicates if the driver accepts back-to-back trips. If `true`,
|
121
|
+
# `SearchVehicles` may include the vehicle even if it is currently assigned
|
122
|
+
# to a trip. The default value is `false`.
|
123
|
+
# @!attribute [rw] navigation_status
|
124
|
+
# @return [::Google::Maps::FleetEngine::V1::NavigationStatus]
|
125
|
+
# The vehicle's navigation status.
|
126
|
+
# @!attribute [rw] device_settings
|
127
|
+
# @return [::Google::Maps::FleetEngine::V1::DeviceSettings]
|
128
|
+
# Input only. Information about settings in the mobile device being used by
|
129
|
+
# the driver.
|
130
|
+
class Vehicle
|
131
|
+
include ::Google::Protobuf::MessageExts
|
132
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
133
|
+
|
134
|
+
# The type of vehicle.
|
135
|
+
# @!attribute [rw] category
|
136
|
+
# @return [::Google::Maps::FleetEngine::V1::Vehicle::VehicleType::Category]
|
137
|
+
# Vehicle type category
|
138
|
+
class VehicleType
|
139
|
+
include ::Google::Protobuf::MessageExts
|
140
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
141
|
+
|
142
|
+
# Vehicle type categories
|
143
|
+
module Category
|
144
|
+
# Default, used for unspecified or unrecognized vehicle categories.
|
145
|
+
UNKNOWN = 0
|
146
|
+
|
147
|
+
# An automobile.
|
148
|
+
AUTO = 1
|
149
|
+
|
150
|
+
# Any vehicle that acts as a taxi (typically licensed or regulated).
|
151
|
+
TAXI = 2
|
152
|
+
|
153
|
+
# Generally, a vehicle with a large storage capacity.
|
154
|
+
TRUCK = 3
|
155
|
+
|
156
|
+
# A motorcycle, moped, or other two-wheeled vehicle
|
157
|
+
TWO_WHEELER = 4
|
158
|
+
|
159
|
+
# Human-powered transport.
|
160
|
+
BICYCLE = 5
|
161
|
+
|
162
|
+
# A human transporter, typically walking or running, traveling along
|
163
|
+
# pedestrian pathways.
|
164
|
+
PEDESTRIAN = 6
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
# Information about the device's battery.
|
170
|
+
# @!attribute [rw] battery_status
|
171
|
+
# @return [::Google::Maps::FleetEngine::V1::BatteryStatus]
|
172
|
+
# Status of the battery, whether full or charging etc.
|
173
|
+
# @!attribute [rw] power_source
|
174
|
+
# @return [::Google::Maps::FleetEngine::V1::PowerSource]
|
175
|
+
# Status of battery power source.
|
176
|
+
# @!attribute [rw] battery_percentage
|
177
|
+
# @return [::Float]
|
178
|
+
# Current battery percentage [0-100].
|
179
|
+
class BatteryInfo
|
180
|
+
include ::Google::Protobuf::MessageExts
|
181
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
182
|
+
end
|
183
|
+
|
184
|
+
# Information about various settings on the mobile device.
|
185
|
+
# @!attribute [rw] location_power_save_mode
|
186
|
+
# @return [::Google::Maps::FleetEngine::V1::LocationPowerSaveMode]
|
187
|
+
# How location features are set to behave on the device when battery saver is
|
188
|
+
# on.
|
189
|
+
# @!attribute [rw] is_power_save_mode
|
190
|
+
# @return [::Boolean]
|
191
|
+
# Whether the device is currently in power save mode.
|
192
|
+
# @!attribute [rw] is_interactive
|
193
|
+
# @return [::Boolean]
|
194
|
+
# Whether the device is in an interactive state.
|
195
|
+
# @!attribute [rw] battery_info
|
196
|
+
# @return [::Google::Maps::FleetEngine::V1::BatteryInfo]
|
197
|
+
# Information about the battery state.
|
198
|
+
class DeviceSettings
|
199
|
+
include ::Google::Protobuf::MessageExts
|
200
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
201
|
+
end
|
202
|
+
|
203
|
+
# The license plate information of the Vehicle. To avoid storing
|
204
|
+
# personally-identifiable information, only the minimum information
|
205
|
+
# about the license plate is stored as part of the entity.
|
206
|
+
# @!attribute [rw] country_code
|
207
|
+
# @return [::String]
|
208
|
+
# Required. CLDR Country/Region Code. For example, `US` for United States,
|
209
|
+
# or `IN` for India.
|
210
|
+
# @!attribute [rw] last_character
|
211
|
+
# @return [::String]
|
212
|
+
# The last digit of the license plate or "-1" to denote no numeric value
|
213
|
+
# is present in the license plate.
|
214
|
+
#
|
215
|
+
# * "ABC 1234" -> "4"
|
216
|
+
# * "AB 123 CD" -> "3"
|
217
|
+
# * "ABCDEF" -> "-1"
|
218
|
+
class LicensePlate
|
219
|
+
include ::Google::Protobuf::MessageExts
|
220
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
221
|
+
end
|
222
|
+
|
223
|
+
# Describes how clients should color one portion of the polyline along the
|
224
|
+
# route.
|
225
|
+
# @!attribute [rw] road_stretch
|
226
|
+
# @return [::Array<::Google::Maps::FleetEngine::V1::VisualTrafficReportPolylineRendering::RoadStretch>]
|
227
|
+
# Optional. Road stretches that should be rendered along the polyline.
|
228
|
+
# Stretches are guaranteed to not overlap, and do not necessarily span the
|
229
|
+
# full route.
|
230
|
+
#
|
231
|
+
# In the absence of a road stretch to style, the client should apply the
|
232
|
+
# default for the route.
|
233
|
+
class VisualTrafficReportPolylineRendering
|
234
|
+
include ::Google::Protobuf::MessageExts
|
235
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
236
|
+
|
237
|
+
# One road stretch that should be rendered.
|
238
|
+
# @!attribute [rw] style
|
239
|
+
# @return [::Google::Maps::FleetEngine::V1::VisualTrafficReportPolylineRendering::RoadStretch::Style]
|
240
|
+
# Required. The style to apply.
|
241
|
+
# @!attribute [rw] offset_meters
|
242
|
+
# @return [::Integer]
|
243
|
+
# Required. The style should be applied between `[offset_meters,
|
244
|
+
# offset_meters + length_meters)`.
|
245
|
+
# @!attribute [rw] length_meters
|
246
|
+
# @return [::Integer]
|
247
|
+
# Required. The length of the path where to apply the style.
|
248
|
+
class RoadStretch
|
249
|
+
include ::Google::Protobuf::MessageExts
|
250
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
251
|
+
|
252
|
+
# The traffic style, indicating traffic speed.
|
253
|
+
module Style
|
254
|
+
# No style selected.
|
255
|
+
STYLE_UNSPECIFIED = 0
|
256
|
+
|
257
|
+
# Traffic is slowing down.
|
258
|
+
SLOWER_TRAFFIC = 1
|
259
|
+
|
260
|
+
# There is a traffic jam.
|
261
|
+
TRAFFIC_JAM = 2
|
262
|
+
end
|
263
|
+
end
|
264
|
+
end
|
265
|
+
|
266
|
+
# Traffic conditions along the expected vehicle route.
|
267
|
+
# @!attribute [rw] traffic_rendering
|
268
|
+
# @return [::Google::Maps::FleetEngine::V1::VisualTrafficReportPolylineRendering]
|
269
|
+
# A polyline rendering of how fast traffic is for all regions along
|
270
|
+
# one stretch of a customer ride.
|
271
|
+
class TrafficPolylineData
|
272
|
+
include ::Google::Protobuf::MessageExts
|
273
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
274
|
+
end
|
275
|
+
|
276
|
+
# The state of a `Vehicle`.
|
277
|
+
module VehicleState
|
278
|
+
# Default, used for unspecified or unrecognized vehicle states.
|
279
|
+
UNKNOWN_VEHICLE_STATE = 0
|
280
|
+
|
281
|
+
# The vehicle is not accepting new trips. Note: the vehicle may continue to
|
282
|
+
# operate in this state while completing a trip assigned to it.
|
283
|
+
OFFLINE = 1
|
284
|
+
|
285
|
+
# The vehicle is accepting new trips.
|
286
|
+
ONLINE = 2
|
287
|
+
end
|
288
|
+
|
289
|
+
# How location features are configured to behave on the mobile device when the
|
290
|
+
# devices "battery saver" feature is on.
|
291
|
+
# (https://developer.android.com/reference/android/os/PowerManager#getLocationPowerSaveMode())
|
292
|
+
module LocationPowerSaveMode
|
293
|
+
# Undefined LocationPowerSaveMode
|
294
|
+
UNKNOWN_LOCATION_POWER_SAVE_MODE = 0
|
295
|
+
|
296
|
+
# Either the location providers shouldn't be affected by battery saver, or
|
297
|
+
# battery saver is off.
|
298
|
+
LOCATION_MODE_NO_CHANGE = 1
|
299
|
+
|
300
|
+
# The GPS based location provider should be disabled when battery saver is on
|
301
|
+
# and the device is non-interactive.
|
302
|
+
LOCATION_MODE_GPS_DISABLED_WHEN_SCREEN_OFF = 2
|
303
|
+
|
304
|
+
# All location providers should be disabled when battery saver is on and the
|
305
|
+
# device is non-interactive.
|
306
|
+
LOCATION_MODE_ALL_DISABLED_WHEN_SCREEN_OFF = 3
|
307
|
+
|
308
|
+
# All the location providers will be kept available, but location fixes
|
309
|
+
# should only be provided to foreground apps.
|
310
|
+
LOCATION_MODE_FOREGROUND_ONLY = 4
|
311
|
+
|
312
|
+
# Location will not be turned off, but LocationManager will throttle all
|
313
|
+
# requests to providers when the device is non-interactive.
|
314
|
+
LOCATION_MODE_THROTTLE_REQUESTS_WHEN_SCREEN_OFF = 5
|
315
|
+
end
|
316
|
+
|
317
|
+
# Status of the battery, whether full or charging etc.
|
318
|
+
module BatteryStatus
|
319
|
+
# Battery status unknown.
|
320
|
+
UNKNOWN_BATTERY_STATUS = 0
|
321
|
+
|
322
|
+
# Battery is being charged.
|
323
|
+
BATTERY_STATUS_CHARGING = 1
|
324
|
+
|
325
|
+
# Battery is discharging.
|
326
|
+
BATTERY_STATUS_DISCHARGING = 2
|
327
|
+
|
328
|
+
# Battery is full.
|
329
|
+
BATTERY_STATUS_FULL = 3
|
330
|
+
|
331
|
+
# Battery is not charging.
|
332
|
+
BATTERY_STATUS_NOT_CHARGING = 4
|
333
|
+
|
334
|
+
# Battery is low on power.
|
335
|
+
BATTERY_STATUS_POWER_LOW = 5
|
336
|
+
end
|
337
|
+
|
338
|
+
# Type of the charger being used to charge the battery.
|
339
|
+
module PowerSource
|
340
|
+
# Power source unknown.
|
341
|
+
UNKNOWN_POWER_SOURCE = 0
|
342
|
+
|
343
|
+
# Power source is an AC charger.
|
344
|
+
POWER_SOURCE_AC = 1
|
345
|
+
|
346
|
+
# Power source is a USB port.
|
347
|
+
POWER_SOURCE_USB = 2
|
348
|
+
|
349
|
+
# Power source is wireless.
|
350
|
+
POWER_SOURCE_WIRELESS = 3
|
351
|
+
|
352
|
+
# Battery is unplugged.
|
353
|
+
POWER_SOURCE_UNPLUGGED = 4
|
354
|
+
end
|
355
|
+
end
|
356
|
+
end
|
357
|
+
end
|
358
|
+
end
|
@@ -0,0 +1,98 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2024 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Protobuf
|
22
|
+
# A Duration represents a signed, fixed-length span of time represented
|
23
|
+
# as a count of seconds and fractions of seconds at nanosecond
|
24
|
+
# resolution. It is independent of any calendar and concepts like "day"
|
25
|
+
# or "month". It is related to Timestamp in that the difference between
|
26
|
+
# two Timestamp values is a Duration and it can be added or subtracted
|
27
|
+
# from a Timestamp. Range is approximately +-10,000 years.
|
28
|
+
#
|
29
|
+
# # Examples
|
30
|
+
#
|
31
|
+
# Example 1: Compute Duration from two Timestamps in pseudo code.
|
32
|
+
#
|
33
|
+
# Timestamp start = ...;
|
34
|
+
# Timestamp end = ...;
|
35
|
+
# Duration duration = ...;
|
36
|
+
#
|
37
|
+
# duration.seconds = end.seconds - start.seconds;
|
38
|
+
# duration.nanos = end.nanos - start.nanos;
|
39
|
+
#
|
40
|
+
# if (duration.seconds < 0 && duration.nanos > 0) {
|
41
|
+
# duration.seconds += 1;
|
42
|
+
# duration.nanos -= 1000000000;
|
43
|
+
# } else if (duration.seconds > 0 && duration.nanos < 0) {
|
44
|
+
# duration.seconds -= 1;
|
45
|
+
# duration.nanos += 1000000000;
|
46
|
+
# }
|
47
|
+
#
|
48
|
+
# Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
|
49
|
+
#
|
50
|
+
# Timestamp start = ...;
|
51
|
+
# Duration duration = ...;
|
52
|
+
# Timestamp end = ...;
|
53
|
+
#
|
54
|
+
# end.seconds = start.seconds + duration.seconds;
|
55
|
+
# end.nanos = start.nanos + duration.nanos;
|
56
|
+
#
|
57
|
+
# if (end.nanos < 0) {
|
58
|
+
# end.seconds -= 1;
|
59
|
+
# end.nanos += 1000000000;
|
60
|
+
# } else if (end.nanos >= 1000000000) {
|
61
|
+
# end.seconds += 1;
|
62
|
+
# end.nanos -= 1000000000;
|
63
|
+
# }
|
64
|
+
#
|
65
|
+
# Example 3: Compute Duration from datetime.timedelta in Python.
|
66
|
+
#
|
67
|
+
# td = datetime.timedelta(days=3, minutes=10)
|
68
|
+
# duration = Duration()
|
69
|
+
# duration.FromTimedelta(td)
|
70
|
+
#
|
71
|
+
# # JSON Mapping
|
72
|
+
#
|
73
|
+
# In JSON format, the Duration type is encoded as a string rather than an
|
74
|
+
# object, where the string ends in the suffix "s" (indicating seconds) and
|
75
|
+
# is preceded by the number of seconds, with nanoseconds expressed as
|
76
|
+
# fractional seconds. For example, 3 seconds with 0 nanoseconds should be
|
77
|
+
# encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
|
78
|
+
# be expressed in JSON format as "3.000000001s", and 3 seconds and 1
|
79
|
+
# microsecond should be expressed in JSON format as "3.000001s".
|
80
|
+
# @!attribute [rw] seconds
|
81
|
+
# @return [::Integer]
|
82
|
+
# Signed seconds of the span of time. Must be from -315,576,000,000
|
83
|
+
# to +315,576,000,000 inclusive. Note: these bounds are computed from:
|
84
|
+
# 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
|
85
|
+
# @!attribute [rw] nanos
|
86
|
+
# @return [::Integer]
|
87
|
+
# Signed fractions of a second at nanosecond resolution of the span
|
88
|
+
# of time. Durations less than one second are represented with a 0
|
89
|
+
# `seconds` field and a positive or negative `nanos` field. For durations
|
90
|
+
# of one second or more, a non-zero value for the `nanos` field must be
|
91
|
+
# of the same sign as the `seconds` field. Must be from -999,999,999
|
92
|
+
# to +999,999,999 inclusive.
|
93
|
+
class Duration
|
94
|
+
include ::Google::Protobuf::MessageExts
|
95
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2024 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Protobuf
|
22
|
+
# A generic empty message that you can re-use to avoid defining duplicated
|
23
|
+
# empty messages in your APIs. A typical example is to use it as the request
|
24
|
+
# or the response type of an API method. For instance:
|
25
|
+
#
|
26
|
+
# service Foo {
|
27
|
+
# rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
|
28
|
+
# }
|
29
|
+
class Empty
|
30
|
+
include ::Google::Protobuf::MessageExts
|
31
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|