google-maps-fleet_engine 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +31 -1
- data/lib/google/maps/fleet_engine/version.rb +1 -1
- data/lib/google/maps/fleet_engine.rb +72 -0
- metadata +4 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e464373c6485a92f49b37ff0f16e555524f0824e36f7e17171d0a2a9a5a2df8
|
4
|
+
data.tar.gz: 49606f06b31ed8933bbe3fa8c7147ffdd964f4211bf01484b01d2bdff074dba5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2659e6724b77a4dec33017791c2d842bd6dd5f5817eaad2980c68106e084c150a802cdea962ef74dc0d80e144a2472eb96e29eae534f9b25939845a9c1cc83b
|
7
|
+
data.tar.gz: d6c144c98b4e097be179790c11b1551031cd6fc083469bde1fa7cd875520f2c1471bbb74d957be522cf88a0f5b50bff6737f786355f55e78c99bb7fe215d9acd
|
data/README.md
CHANGED
@@ -34,9 +34,39 @@ In order to use this library, you first need to go through the following steps:
|
|
34
34
|
1. [Enable the API.](https://console.cloud.google.com/apis/library/fleetengine.googleapis.com)
|
35
35
|
1. {file:AUTHENTICATION.md Set up authentication.}
|
36
36
|
|
37
|
+
## Debug Logging
|
38
|
+
|
39
|
+
This library comes with opt-in Debug Logging that can help you troubleshoot
|
40
|
+
your application's integration with the API. When logging is activated, key
|
41
|
+
events such as requests and responses, along with data payloads and metadata
|
42
|
+
such as headers and client configuration, are logged to the standard error
|
43
|
+
stream.
|
44
|
+
|
45
|
+
**WARNING:** Client Library Debug Logging includes your data payloads in
|
46
|
+
plaintext, which could include sensitive data such as PII for yourself or your
|
47
|
+
customers, private keys, or other security data that could be compromising if
|
48
|
+
leaked. Always practice good data hygiene with your application logs, and follow
|
49
|
+
the principle of least access. Google also recommends that Client Library Debug
|
50
|
+
Logging be enabled only temporarily during active debugging, and not used
|
51
|
+
permanently in production.
|
52
|
+
|
53
|
+
To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
|
54
|
+
to the value `all`. Alternatively, you can set the value to a comma-delimited
|
55
|
+
list of client library gem names. This will select the default logging behavior,
|
56
|
+
which writes logs to the standard error stream. On a local workstation, this may
|
57
|
+
result in logs appearing on the console. When running on a Google Cloud hosting
|
58
|
+
service such as [Google Cloud Run](https://cloud.google.com/run), this generally
|
59
|
+
results in logs appearing alongside your application logs in the
|
60
|
+
[Google Cloud Logging](https://cloud.google.com/logging/) service.
|
61
|
+
|
62
|
+
Debug logging also requires that the versioned clients for this service be
|
63
|
+
sufficiently recent, released after about Dec 10, 2024. If logging is not
|
64
|
+
working, try updating the versioned clients in your bundle or installed gems:
|
65
|
+
[google-maps-fleet_engine-v1](https://rubydoc.info/gems/google-maps-fleet_engine-v1).
|
66
|
+
|
37
67
|
## Supported Ruby Versions
|
38
68
|
|
39
|
-
This library is supported on Ruby
|
69
|
+
This library is supported on Ruby 3.0+.
|
40
70
|
|
41
71
|
Google provides official support for Ruby versions that are actively supported
|
42
72
|
by Ruby Core—that is, Ruby versions that are either in normal maintenance or
|
@@ -40,6 +40,11 @@ module Google
|
|
40
40
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
41
41
|
# the `transport` parameter.
|
42
42
|
#
|
43
|
+
# Raises an exception if the currently installed versioned client gem for the
|
44
|
+
# given API version does not support the given transport of the TripService service.
|
45
|
+
# You can determine whether the method will succeed by calling
|
46
|
+
# {Google::Maps::FleetEngine.trip_service_available?}.
|
47
|
+
#
|
43
48
|
# ## About TripService
|
44
49
|
#
|
45
50
|
# Trip management service.
|
@@ -61,6 +66,37 @@ module Google
|
|
61
66
|
service_module.const_get(:Client).new(&block)
|
62
67
|
end
|
63
68
|
|
69
|
+
##
|
70
|
+
# Determines whether the TripService service is supported by the current client.
|
71
|
+
# If true, you can retrieve a client object by calling {Google::Maps::FleetEngine.trip_service}.
|
72
|
+
# If false, that method will raise an exception. This could happen if the given
|
73
|
+
# API version does not exist or does not support the TripService service,
|
74
|
+
# or if the versioned client gem needs an update to support the TripService service.
|
75
|
+
#
|
76
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
77
|
+
# Defaults to `:v1`.
|
78
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
79
|
+
# @return [boolean] Whether the service is available.
|
80
|
+
#
|
81
|
+
def self.trip_service_available? version: :v1, transport: :grpc
|
82
|
+
require "google/maps/fleet_engine/#{version.to_s.downcase}"
|
83
|
+
package_name = Google::Maps::FleetEngine
|
84
|
+
.constants
|
85
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
86
|
+
.first
|
87
|
+
return false unless package_name
|
88
|
+
service_module = Google::Maps::FleetEngine.const_get package_name
|
89
|
+
return false unless service_module.const_defined? :TripService
|
90
|
+
service_module = service_module.const_get :TripService
|
91
|
+
if transport == :rest
|
92
|
+
return false unless service_module.const_defined? :Rest
|
93
|
+
service_module = service_module.const_get :Rest
|
94
|
+
end
|
95
|
+
service_module.const_defined? :Client
|
96
|
+
rescue ::LoadError
|
97
|
+
false
|
98
|
+
end
|
99
|
+
|
64
100
|
##
|
65
101
|
# Create a new client object for VehicleService.
|
66
102
|
#
|
@@ -74,6 +110,11 @@ module Google
|
|
74
110
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
75
111
|
# the `transport` parameter.
|
76
112
|
#
|
113
|
+
# Raises an exception if the currently installed versioned client gem for the
|
114
|
+
# given API version does not support the given transport of the VehicleService service.
|
115
|
+
# You can determine whether the method will succeed by calling
|
116
|
+
# {Google::Maps::FleetEngine.vehicle_service_available?}.
|
117
|
+
#
|
77
118
|
# ## About VehicleService
|
78
119
|
#
|
79
120
|
# Vehicle management service.
|
@@ -94,6 +135,37 @@ module Google
|
|
94
135
|
service_module = service_module.const_get(:Rest) if transport == :rest
|
95
136
|
service_module.const_get(:Client).new(&block)
|
96
137
|
end
|
138
|
+
|
139
|
+
##
|
140
|
+
# Determines whether the VehicleService service is supported by the current client.
|
141
|
+
# If true, you can retrieve a client object by calling {Google::Maps::FleetEngine.vehicle_service}.
|
142
|
+
# If false, that method will raise an exception. This could happen if the given
|
143
|
+
# API version does not exist or does not support the VehicleService service,
|
144
|
+
# or if the versioned client gem needs an update to support the VehicleService service.
|
145
|
+
#
|
146
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
147
|
+
# Defaults to `:v1`.
|
148
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
149
|
+
# @return [boolean] Whether the service is available.
|
150
|
+
#
|
151
|
+
def self.vehicle_service_available? version: :v1, transport: :grpc
|
152
|
+
require "google/maps/fleet_engine/#{version.to_s.downcase}"
|
153
|
+
package_name = Google::Maps::FleetEngine
|
154
|
+
.constants
|
155
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
156
|
+
.first
|
157
|
+
return false unless package_name
|
158
|
+
service_module = Google::Maps::FleetEngine.const_get package_name
|
159
|
+
return false unless service_module.const_defined? :VehicleService
|
160
|
+
service_module = service_module.const_get :VehicleService
|
161
|
+
if transport == :rest
|
162
|
+
return false unless service_module.const_defined? :Rest
|
163
|
+
service_module = service_module.const_get :Rest
|
164
|
+
end
|
165
|
+
service_module.const_defined? :Client
|
166
|
+
rescue ::LoadError
|
167
|
+
false
|
168
|
+
end
|
97
169
|
end
|
98
170
|
end
|
99
171
|
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-maps-fleet_engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-01-29 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: google-cloud-core
|
@@ -64,7 +63,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
|
|
64
63
|
licenses:
|
65
64
|
- Apache-2.0
|
66
65
|
metadata: {}
|
67
|
-
post_install_message:
|
68
66
|
rdoc_options: []
|
69
67
|
require_paths:
|
70
68
|
- lib
|
@@ -72,15 +70,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
72
70
|
requirements:
|
73
71
|
- - ">="
|
74
72
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
73
|
+
version: '3.0'
|
76
74
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
75
|
requirements:
|
78
76
|
- - ">="
|
79
77
|
- !ruby/object:Gem::Version
|
80
78
|
version: '0'
|
81
79
|
requirements: []
|
82
|
-
rubygems_version: 3.
|
83
|
-
signing_key:
|
80
|
+
rubygems_version: 3.6.2
|
84
81
|
specification_version: 4
|
85
82
|
summary: Enables Fleet Engine for access to the On Demand Rides and Deliveries and
|
86
83
|
Last Mile Fleet Solution APIs. Customer's use of Google Maps Content in the Cloud
|