diff --git a/packages/google-maps-places/protos/google/maps/places/v1/place.proto b/packages/google-maps-places/protos/google/maps/places/v1/place.proto index 47e8206acce..0509e6bec3f 100644 --- a/packages/google-maps-places/protos/google/maps/places/v1/place.proto +++ b/packages/google-maps-places/protos/google/maps/places/v1/place.proto @@ -167,8 +167,10 @@ message Place { google.type.Date date = 1; } - // Is this place open right now? Always present unless we lack time-of-day - // or timezone data for these opening hours. + // Whether the opening hours period is currently active. For regular opening + // hours and current opening hours, this field means whether the place is + // open. For secondary opening hours and current secondary opening hours, + // this field means whether the secondary hours of this place is active. optional bool open_now = 1; // The periods that this place is open during the week. The periods are in diff --git a/packages/google-maps-places/protos/google/maps/places/v1/places_service.proto b/packages/google-maps-places/protos/google/maps/places/v1/places_service.proto index ea9f82aa2e0..18256c6b32d 100644 --- a/packages/google-maps-places/protos/google/maps/places/v1/places_service.proto +++ b/packages/google-maps-places/protos/google/maps/places/v1/places_service.proto @@ -25,6 +25,11 @@ import "google/maps/places/v1/contextual_content.proto"; import "google/maps/places/v1/ev_charging.proto"; import "google/maps/places/v1/geometry.proto"; import "google/maps/places/v1/place.proto"; +import "google/maps/places/v1/polyline.proto"; +import "google/maps/places/v1/route_modifiers.proto"; +import "google/maps/places/v1/routing_preference.proto"; +import "google/maps/places/v1/routing_summary.proto"; +import "google/maps/places/v1/travel_mode.proto"; import "google/type/latlng.proto"; option cc_enable_arenas = true; @@ -87,6 +92,28 @@ service Places { } } +// Parameters to configure the routing calculations to the places in the +// response, both along a route (where result ranking will be influenced) and +// for calculating travel times on results. +message RoutingParameters { + // Optional. An explicit routing origin that overrides the origin defined in + // the polyline. By default, the polyline origin is used. + google.type.LatLng origin = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The travel mode. + TravelMode travel_mode = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The route modifiers. + RouteModifiers route_modifiers = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies how to compute the routing summaries. The server + // attempts to use the selected routing preference to compute the route. The + // traffic aware routing preference is only available for the `DRIVE` or + // `TWO_WHEELER` `travelMode`. + RoutingPreference routing_preference = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + // Request proto for Search Nearby. // // @@ -222,6 +249,10 @@ message SearchNearbyRequest { // How results will be ranked in the response. RankPreference rank_preference = 9; + + // Optional. Parameters that affect the routing to the search results. + RoutingParameters routing_parameters = 10 + [(google.api.field_behavior) = OPTIONAL]; } // Response proto for Search Nearby. @@ -230,6 +261,13 @@ message SearchNearbyResponse { // A list of places that meets user's requirements like places // types, number of places and specific location restriction. repeated Place places = 1; + + // A list of routing summaries where each entry associates to the + // corresponding place in the same index in the places field. If the routing + // summary is not available for one of the places, it will contain an empty + // entry. This list should have as many entries as the list of places if + // requested. + repeated RoutingSummary routing_summaries = 2; } // Request proto for SearchText. @@ -295,6 +333,25 @@ message SearchTextRequest { [(google.api.field_behavior) = OPTIONAL]; } + // Specifies a precalculated polyline from the [Routes + // API](https://developers.google.com/maps/documentation/routes) defining the + // route to search. Searching along a route is similar to using the + // `locationBias` or `locationRestriction` request option to bias the search + // results. However, while the `locationBias` and `locationRestriction` + // options let you specify a region to bias the search results, this option + // lets you bias the results along a trip route. + // + // Results are not guaranteed to be along the route provided, but rather are + // ranked within the search area defined by the polyline and, optionally, by + // the `locationBias` or `locationRestriction` based on minimal detour times + // from origin to destination. The results might be along an alternate route, + // especially if the provided polyline does not define an optimal route from + // origin to destination. + message SearchAlongRouteParameters { + // Required. The route polyline. + Polyline polyline = 1 [(google.api.field_behavior) = REQUIRED]; + } + // Required. The text query for textual search. string text_query = 1 [(google.api.field_behavior) = REQUIRED]; @@ -365,6 +422,14 @@ message SearchTextRequest { // Optional. Set the searchable EV options of a place search request. EVOptions ev_options = 15 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Additional parameters for routing to results. + RoutingParameters routing_parameters = 16 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Additional parameters proto for searching along a route. + SearchAlongRouteParameters search_along_route_parameters = 17 + [(google.api.field_behavior) = OPTIONAL]; } // Response proto for SearchText. @@ -373,6 +438,13 @@ message SearchTextResponse { // A list of places that meet the user's text search criteria. repeated Place places = 1; + // A list of routing summaries where each entry associates to the + // corresponding place in the same index in the places field. If the routing + // summary is not available for one of the places, it will contain an empty + // entry. This list will have as many entries as the list of places if + // requested. + repeated RoutingSummary routing_summaries = 2; + // Experimental: See // https://developers.google.com/maps/documentation/places/web-service/experimental/places-generative // for more details. @@ -382,7 +454,7 @@ message SearchTextResponse { // that are relevant to the `text_query` in the request are preferred. If the // contextual content is not available for one of the places, it will return // non-contextual content. It will be empty only when the content is - // unavailable for this place. This list should have as many entries as the + // unavailable for this place. This list will have as many entries as the // list of places if requested. repeated ContextualContent contextual_contents = 3; } diff --git a/packages/google-maps-places/protos/google/maps/places/v1/polyline.proto b/packages/google-maps-places/protos/google/maps/places/v1/polyline.proto new file mode 100644 index 00000000000..80967b85033 --- /dev/null +++ b/packages/google-maps-places/protos/google/maps/places/v1/polyline.proto @@ -0,0 +1,47 @@ +// Copyright 2024 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. + +syntax = "proto3"; + +package google.maps.places.v1; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Places.V1"; +option go_package = "cloud.google.com/go/maps/places/apiv1/placespb;placespb"; +option java_multiple_files = true; +option java_outer_classname = "PolylineProto"; +option java_package = "com.google.maps.places.v1"; +option objc_class_prefix = "GMPSV1"; +option php_namespace = "Google\\Maps\\Places\\V1"; + +// A route polyline. Only supports an [encoded +// polyline](https://developers.google.com/maps/documentation/utilities/polylinealgorithm), +// which can be passed as a string and includes compression with minimal +// lossiness. This is the Routes API default output. +message Polyline { + // Encapsulates the type of polyline. Routes API output defaults to + // `encoded_polyline`. + oneof polyline_type { + // An [encoded + // polyline](https://developers.google.com/maps/documentation/utilities/polylinealgorithm), + // as returned by the [Routes API by + // default](https://developers.google.com/maps/documentation/routes/reference/rest/v2/TopLevel/computeRoutes#polylineencoding). + // See the + // [encoder](https://developers.google.com/maps/documentation/utilities/polylineutility) + // and + // [decoder](https://developers.google.com/maps/documentation/routes/polylinedecoder) + // tools. + string encoded_polyline = 1; + } +} diff --git a/packages/google-maps-places/protos/google/maps/places/v1/route_modifiers.proto b/packages/google-maps-places/protos/google/maps/places/v1/route_modifiers.proto new file mode 100644 index 00000000000..1dfd44a9c5c --- /dev/null +++ b/packages/google-maps-places/protos/google/maps/places/v1/route_modifiers.proto @@ -0,0 +1,52 @@ +// Copyright 2024 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. + +syntax = "proto3"; + +package google.maps.places.v1; + +import "google/api/field_behavior.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Places.V1"; +option go_package = "cloud.google.com/go/maps/places/apiv1/placespb;placespb"; +option java_multiple_files = true; +option java_outer_classname = "RouteModifiersProto"; +option java_package = "com.google.maps.places.v1"; +option objc_class_prefix = "GMPSV1"; +option php_namespace = "Google\\Maps\\Places\\V1"; + +// Encapsulates a set of optional conditions to satisfy when calculating the +// routes. +message RouteModifiers { + // Optional. When set to true, avoids toll roads where reasonable, giving + // preference to routes not containing toll roads. Applies only to the `DRIVE` + // and `TWO_WHEELER` [`TravelMode`][google.maps.places.v1.TravelMode]. + bool avoid_tolls = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When set to true, avoids highways where reasonable, giving + // preference to routes not containing highways. Applies only to the `DRIVE` + // and `TWO_WHEELER` [`TravelMode`][google.maps.places.v1.TravelMode]. + bool avoid_highways = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When set to true, avoids ferries where reasonable, giving + // preference to routes not containing ferries. Applies only to the `DRIVE` + // and `TWO_WHEELER` [`TravelMode`][google.maps.places.v1.TravelMode]. + bool avoid_ferries = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. When set to true, avoids navigating indoors where reasonable, + // giving preference to routes not containing indoor navigation. Applies only + // to the `WALK` [`TravelMode`][google.maps.places.v1.TravelMode]. + bool avoid_indoor = 4 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-maps-places/protos/google/maps/places/v1/routing_preference.proto b/packages/google-maps-places/protos/google/maps/places/v1/routing_preference.proto new file mode 100644 index 00000000000..31bf0fb7e64 --- /dev/null +++ b/packages/google-maps-places/protos/google/maps/places/v1/routing_preference.proto @@ -0,0 +1,57 @@ +// Copyright 2024 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. + +syntax = "proto3"; + +package google.maps.places.v1; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Places.V1"; +option go_package = "cloud.google.com/go/maps/places/apiv1/placespb;placespb"; +option java_multiple_files = true; +option java_outer_classname = "RoutingPreferenceProto"; +option java_package = "com.google.maps.places.v1"; +option objc_class_prefix = "GMPSV1"; +option php_namespace = "Google\\Maps\\Places\\V1"; + +// A set of values that specify factors to take into consideration when +// calculating the route. +enum RoutingPreference { + // No routing preference specified. Default to `TRAFFIC_UNAWARE`. + ROUTING_PREFERENCE_UNSPECIFIED = 0; + + // Computes routes without taking live traffic conditions into consideration. + // Suitable when traffic conditions don't matter or are not applicable. + // Using this value produces the lowest latency. + // Note: For [`TravelMode`][google.maps.places.v1.TravelMode] + // `DRIVE` and `TWO_WHEELER`, the route and duration chosen are based on road + // network and average time-independent traffic conditions, not current road + // conditions. Consequently, routes may include roads that are temporarily + // closed. Results for a given + // request may vary over time due to changes in the road network, updated + // average traffic conditions, and the distributed nature of the service. + // Results may also vary between nearly-equivalent routes at any time or + // frequency. + TRAFFIC_UNAWARE = 1; + + // Calculates routes taking live traffic conditions into consideration. + // In contrast to `TRAFFIC_AWARE_OPTIMAL`, some optimizations are applied to + // significantly reduce latency. + TRAFFIC_AWARE = 2; + + // Calculates the routes taking live traffic conditions into consideration, + // without applying most performance optimizations. Using this value produces + // the highest latency. + TRAFFIC_AWARE_OPTIMAL = 3; +} diff --git a/packages/google-maps-places/protos/google/maps/places/v1/routing_summary.proto b/packages/google-maps-places/protos/google/maps/places/v1/routing_summary.proto new file mode 100644 index 00000000000..621b92ad808 --- /dev/null +++ b/packages/google-maps-places/protos/google/maps/places/v1/routing_summary.proto @@ -0,0 +1,54 @@ +// Copyright 2024 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. + +syntax = "proto3"; + +package google.maps.places.v1; + +import "google/protobuf/duration.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Places.V1"; +option go_package = "cloud.google.com/go/maps/places/apiv1/placespb;placespb"; +option java_multiple_files = true; +option java_outer_classname = "RoutingSummaryProto"; +option java_package = "com.google.maps.places.v1"; +option objc_class_prefix = "GMPSV1"; +option php_namespace = "Google\\Maps\\Places\\V1"; + +// The duration and distance from the routing origin to a place in the +// response, and a second leg from that place to the destination, if requested. +// Note: Adding `routingSummaries` in the field mask without also including +// either the `routingParameters.origin` parameter or the +// `searchAlongRouteParameters.polyline.encodedPolyline` parameter in the +// request causes an error. +message RoutingSummary { + // A leg is a single portion of a journey from one location to another. + message Leg { + // The time it takes to complete this leg of the trip. + google.protobuf.Duration duration = 1; + + // The distance of this leg of the trip. + int32 distance_meters = 2; + } + + // The legs of the trip. + // + // When you calculate travel duration and distance from a set origin, `legs` + // contains a single leg containing the duration and distance from the origin + // to the destination. When you do a search along route, `legs` contains two + // legs: one from the origin to place, and one from the place to the + // destination. + repeated Leg legs = 1; +} diff --git a/packages/google-maps-places/protos/google/maps/places/v1/travel_mode.proto b/packages/google-maps-places/protos/google/maps/places/v1/travel_mode.proto new file mode 100644 index 00000000000..d361c42fd93 --- /dev/null +++ b/packages/google-maps-places/protos/google/maps/places/v1/travel_mode.proto @@ -0,0 +1,51 @@ +// Copyright 2024 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. + +syntax = "proto3"; + +package google.maps.places.v1; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Maps.Places.V1"; +option go_package = "cloud.google.com/go/maps/places/apiv1/placespb;placespb"; +option java_multiple_files = true; +option java_outer_classname = "TravelModeProto"; +option java_package = "com.google.maps.places.v1"; +option objc_class_prefix = "GMPSV1"; +option php_namespace = "Google\\Maps\\Places\\V1"; + +// Travel mode options. +// These options map to what [Routes API +// offers](https://developers.google.com/maps/documentation/routes/reference/rest/v2/RouteTravelMode). +enum TravelMode { + // No travel mode specified. Defaults to `DRIVE`. + TRAVEL_MODE_UNSPECIFIED = 0; + + // Travel by passenger car. + DRIVE = 1; + + // Travel by bicycle. Not supported with `search_along_route_parameters`. + BICYCLE = 2; + + // Travel by walking. Not supported with `search_along_route_parameters`. + WALK = 3; + + // Motorized two wheeled vehicles of all kinds such as scooters and + // motorcycles. Note that this is distinct from the `BICYCLE` travel mode + // which covers human-powered transport. Not supported with + // `search_along_route_parameters`. Only supported in those countries listed + // at [Countries and regions supported for two-wheeled + // vehicles](https://developers.google.com/maps/documentation/routes/coverage-two-wheeled). + TWO_WHEELER = 4; +} diff --git a/packages/google-maps-places/protos/protos.d.ts b/packages/google-maps-places/protos/protos.d.ts index 2d874e7ab03..e82cd4a16d0 100644 --- a/packages/google-maps-places/protos/protos.d.ts +++ b/packages/google-maps-places/protos/protos.d.ts @@ -4583,6 +4583,121 @@ export namespace google { type AutocompletePlacesCallback = (error: (Error|null), response?: google.maps.places.v1.AutocompletePlacesResponse) => void; } + /** Properties of a RoutingParameters. */ + interface IRoutingParameters { + + /** RoutingParameters origin */ + origin?: (google.type.ILatLng|null); + + /** RoutingParameters travelMode */ + travelMode?: (google.maps.places.v1.TravelMode|keyof typeof google.maps.places.v1.TravelMode|null); + + /** RoutingParameters routeModifiers */ + routeModifiers?: (google.maps.places.v1.IRouteModifiers|null); + + /** RoutingParameters routingPreference */ + routingPreference?: (google.maps.places.v1.RoutingPreference|keyof typeof google.maps.places.v1.RoutingPreference|null); + } + + /** Represents a RoutingParameters. */ + class RoutingParameters implements IRoutingParameters { + + /** + * Constructs a new RoutingParameters. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.places.v1.IRoutingParameters); + + /** RoutingParameters origin. */ + public origin?: (google.type.ILatLng|null); + + /** RoutingParameters travelMode. */ + public travelMode: (google.maps.places.v1.TravelMode|keyof typeof google.maps.places.v1.TravelMode); + + /** RoutingParameters routeModifiers. */ + public routeModifiers?: (google.maps.places.v1.IRouteModifiers|null); + + /** RoutingParameters routingPreference. */ + public routingPreference: (google.maps.places.v1.RoutingPreference|keyof typeof google.maps.places.v1.RoutingPreference); + + /** + * Creates a new RoutingParameters instance using the specified properties. + * @param [properties] Properties to set + * @returns RoutingParameters instance + */ + public static create(properties?: google.maps.places.v1.IRoutingParameters): google.maps.places.v1.RoutingParameters; + + /** + * Encodes the specified RoutingParameters message. Does not implicitly {@link google.maps.places.v1.RoutingParameters.verify|verify} messages. + * @param message RoutingParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.places.v1.IRoutingParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RoutingParameters message, length delimited. Does not implicitly {@link google.maps.places.v1.RoutingParameters.verify|verify} messages. + * @param message RoutingParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.places.v1.IRoutingParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoutingParameters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RoutingParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.places.v1.RoutingParameters; + + /** + * Decodes a RoutingParameters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RoutingParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.places.v1.RoutingParameters; + + /** + * Verifies a RoutingParameters message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RoutingParameters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RoutingParameters + */ + public static fromObject(object: { [k: string]: any }): google.maps.places.v1.RoutingParameters; + + /** + * Creates a plain object from a RoutingParameters message. Also converts values to other types if specified. + * @param message RoutingParameters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.places.v1.RoutingParameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RoutingParameters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RoutingParameters + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a SearchNearbyRequest. */ interface ISearchNearbyRequest { @@ -4612,6 +4727,9 @@ export namespace google { /** SearchNearbyRequest rankPreference */ rankPreference?: (google.maps.places.v1.SearchNearbyRequest.RankPreference|keyof typeof google.maps.places.v1.SearchNearbyRequest.RankPreference|null); + + /** SearchNearbyRequest routingParameters */ + routingParameters?: (google.maps.places.v1.IRoutingParameters|null); } /** Represents a SearchNearbyRequest. */ @@ -4650,6 +4768,9 @@ export namespace google { /** SearchNearbyRequest rankPreference. */ public rankPreference: (google.maps.places.v1.SearchNearbyRequest.RankPreference|keyof typeof google.maps.places.v1.SearchNearbyRequest.RankPreference); + /** SearchNearbyRequest routingParameters. */ + public routingParameters?: (google.maps.places.v1.IRoutingParameters|null); + /** * Creates a new SearchNearbyRequest instance using the specified properties. * @param [properties] Properties to set @@ -4843,6 +4964,9 @@ export namespace google { /** SearchNearbyResponse places */ places?: (google.maps.places.v1.IPlace[]|null); + + /** SearchNearbyResponse routingSummaries */ + routingSummaries?: (google.maps.places.v1.IRoutingSummary[]|null); } /** Represents a SearchNearbyResponse. */ @@ -4857,6 +4981,9 @@ export namespace google { /** SearchNearbyResponse places. */ public places: google.maps.places.v1.IPlace[]; + /** SearchNearbyResponse routingSummaries. */ + public routingSummaries: google.maps.places.v1.IRoutingSummary[]; + /** * Creates a new SearchNearbyResponse instance using the specified properties. * @param [properties] Properties to set @@ -4976,6 +5103,12 @@ export namespace google { /** SearchTextRequest evOptions */ evOptions?: (google.maps.places.v1.SearchTextRequest.IEVOptions|null); + + /** SearchTextRequest routingParameters */ + routingParameters?: (google.maps.places.v1.IRoutingParameters|null); + + /** SearchTextRequest searchAlongRouteParameters */ + searchAlongRouteParameters?: (google.maps.places.v1.SearchTextRequest.ISearchAlongRouteParameters|null); } /** Represents a SearchTextRequest. */ @@ -5026,6 +5159,12 @@ export namespace google { /** SearchTextRequest evOptions. */ public evOptions?: (google.maps.places.v1.SearchTextRequest.IEVOptions|null); + /** SearchTextRequest routingParameters. */ + public routingParameters?: (google.maps.places.v1.IRoutingParameters|null); + + /** SearchTextRequest searchAlongRouteParameters. */ + public searchAlongRouteParameters?: (google.maps.places.v1.SearchTextRequest.ISearchAlongRouteParameters|null); + /** * Creates a new SearchTextRequest instance using the specified properties. * @param [properties] Properties to set @@ -5421,6 +5560,103 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a SearchAlongRouteParameters. */ + interface ISearchAlongRouteParameters { + + /** SearchAlongRouteParameters polyline */ + polyline?: (google.maps.places.v1.IPolyline|null); + } + + /** Represents a SearchAlongRouteParameters. */ + class SearchAlongRouteParameters implements ISearchAlongRouteParameters { + + /** + * Constructs a new SearchAlongRouteParameters. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.places.v1.SearchTextRequest.ISearchAlongRouteParameters); + + /** SearchAlongRouteParameters polyline. */ + public polyline?: (google.maps.places.v1.IPolyline|null); + + /** + * Creates a new SearchAlongRouteParameters instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchAlongRouteParameters instance + */ + public static create(properties?: google.maps.places.v1.SearchTextRequest.ISearchAlongRouteParameters): google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters; + + /** + * Encodes the specified SearchAlongRouteParameters message. Does not implicitly {@link google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters.verify|verify} messages. + * @param message SearchAlongRouteParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.places.v1.SearchTextRequest.ISearchAlongRouteParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchAlongRouteParameters message, length delimited. Does not implicitly {@link google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters.verify|verify} messages. + * @param message SearchAlongRouteParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.places.v1.SearchTextRequest.ISearchAlongRouteParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchAlongRouteParameters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchAlongRouteParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters; + + /** + * Decodes a SearchAlongRouteParameters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchAlongRouteParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters; + + /** + * Verifies a SearchAlongRouteParameters message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchAlongRouteParameters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchAlongRouteParameters + */ + public static fromObject(object: { [k: string]: any }): google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters; + + /** + * Creates a plain object from a SearchAlongRouteParameters message. Also converts values to other types if specified. + * @param message SearchAlongRouteParameters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchAlongRouteParameters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SearchAlongRouteParameters + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } /** Properties of a SearchTextResponse. */ @@ -5429,6 +5665,9 @@ export namespace google { /** SearchTextResponse places */ places?: (google.maps.places.v1.IPlace[]|null); + /** SearchTextResponse routingSummaries */ + routingSummaries?: (google.maps.places.v1.IRoutingSummary[]|null); + /** SearchTextResponse contextualContents */ contextualContents?: (google.maps.places.v1.IContextualContent[]|null); } @@ -5445,6 +5684,9 @@ export namespace google { /** SearchTextResponse places. */ public places: google.maps.places.v1.IPlace[]; + /** SearchTextResponse routingSummaries. */ + public routingSummaries: google.maps.places.v1.IRoutingSummary[]; + /** SearchTextResponse contextualContents. */ public contextualContents: google.maps.places.v1.IContextualContent[]; @@ -6978,6 +7220,441 @@ export namespace google { } } } + + /** Properties of a Polyline. */ + interface IPolyline { + + /** Polyline encodedPolyline */ + encodedPolyline?: (string|null); + } + + /** Represents a Polyline. */ + class Polyline implements IPolyline { + + /** + * Constructs a new Polyline. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.places.v1.IPolyline); + + /** Polyline encodedPolyline. */ + public encodedPolyline?: (string|null); + + /** Polyline polylineType. */ + public polylineType?: "encodedPolyline"; + + /** + * Creates a new Polyline instance using the specified properties. + * @param [properties] Properties to set + * @returns Polyline instance + */ + public static create(properties?: google.maps.places.v1.IPolyline): google.maps.places.v1.Polyline; + + /** + * Encodes the specified Polyline message. Does not implicitly {@link google.maps.places.v1.Polyline.verify|verify} messages. + * @param message Polyline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.places.v1.IPolyline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Polyline message, length delimited. Does not implicitly {@link google.maps.places.v1.Polyline.verify|verify} messages. + * @param message Polyline message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.places.v1.IPolyline, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Polyline message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Polyline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.places.v1.Polyline; + + /** + * Decodes a Polyline message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Polyline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.places.v1.Polyline; + + /** + * Verifies a Polyline message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Polyline message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Polyline + */ + public static fromObject(object: { [k: string]: any }): google.maps.places.v1.Polyline; + + /** + * Creates a plain object from a Polyline message. Also converts values to other types if specified. + * @param message Polyline + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.places.v1.Polyline, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Polyline to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Polyline + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RouteModifiers. */ + interface IRouteModifiers { + + /** RouteModifiers avoidTolls */ + avoidTolls?: (boolean|null); + + /** RouteModifiers avoidHighways */ + avoidHighways?: (boolean|null); + + /** RouteModifiers avoidFerries */ + avoidFerries?: (boolean|null); + + /** RouteModifiers avoidIndoor */ + avoidIndoor?: (boolean|null); + } + + /** Represents a RouteModifiers. */ + class RouteModifiers implements IRouteModifiers { + + /** + * Constructs a new RouteModifiers. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.places.v1.IRouteModifiers); + + /** RouteModifiers avoidTolls. */ + public avoidTolls: boolean; + + /** RouteModifiers avoidHighways. */ + public avoidHighways: boolean; + + /** RouteModifiers avoidFerries. */ + public avoidFerries: boolean; + + /** RouteModifiers avoidIndoor. */ + public avoidIndoor: boolean; + + /** + * Creates a new RouteModifiers instance using the specified properties. + * @param [properties] Properties to set + * @returns RouteModifiers instance + */ + public static create(properties?: google.maps.places.v1.IRouteModifiers): google.maps.places.v1.RouteModifiers; + + /** + * Encodes the specified RouteModifiers message. Does not implicitly {@link google.maps.places.v1.RouteModifiers.verify|verify} messages. + * @param message RouteModifiers message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.places.v1.IRouteModifiers, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouteModifiers message, length delimited. Does not implicitly {@link google.maps.places.v1.RouteModifiers.verify|verify} messages. + * @param message RouteModifiers message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.places.v1.IRouteModifiers, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouteModifiers message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouteModifiers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.places.v1.RouteModifiers; + + /** + * Decodes a RouteModifiers message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouteModifiers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.places.v1.RouteModifiers; + + /** + * Verifies a RouteModifiers message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RouteModifiers message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouteModifiers + */ + public static fromObject(object: { [k: string]: any }): google.maps.places.v1.RouteModifiers; + + /** + * Creates a plain object from a RouteModifiers message. Also converts values to other types if specified. + * @param message RouteModifiers + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.places.v1.RouteModifiers, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouteModifiers to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouteModifiers + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** RoutingPreference enum. */ + enum RoutingPreference { + ROUTING_PREFERENCE_UNSPECIFIED = 0, + TRAFFIC_UNAWARE = 1, + TRAFFIC_AWARE = 2, + TRAFFIC_AWARE_OPTIMAL = 3 + } + + /** Properties of a RoutingSummary. */ + interface IRoutingSummary { + + /** RoutingSummary legs */ + legs?: (google.maps.places.v1.RoutingSummary.ILeg[]|null); + } + + /** Represents a RoutingSummary. */ + class RoutingSummary implements IRoutingSummary { + + /** + * Constructs a new RoutingSummary. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.places.v1.IRoutingSummary); + + /** RoutingSummary legs. */ + public legs: google.maps.places.v1.RoutingSummary.ILeg[]; + + /** + * Creates a new RoutingSummary instance using the specified properties. + * @param [properties] Properties to set + * @returns RoutingSummary instance + */ + public static create(properties?: google.maps.places.v1.IRoutingSummary): google.maps.places.v1.RoutingSummary; + + /** + * Encodes the specified RoutingSummary message. Does not implicitly {@link google.maps.places.v1.RoutingSummary.verify|verify} messages. + * @param message RoutingSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.places.v1.IRoutingSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RoutingSummary message, length delimited. Does not implicitly {@link google.maps.places.v1.RoutingSummary.verify|verify} messages. + * @param message RoutingSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.places.v1.IRoutingSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RoutingSummary message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RoutingSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.places.v1.RoutingSummary; + + /** + * Decodes a RoutingSummary message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RoutingSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.places.v1.RoutingSummary; + + /** + * Verifies a RoutingSummary message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RoutingSummary message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RoutingSummary + */ + public static fromObject(object: { [k: string]: any }): google.maps.places.v1.RoutingSummary; + + /** + * Creates a plain object from a RoutingSummary message. Also converts values to other types if specified. + * @param message RoutingSummary + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.places.v1.RoutingSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RoutingSummary to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RoutingSummary + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RoutingSummary { + + /** Properties of a Leg. */ + interface ILeg { + + /** Leg duration */ + duration?: (google.protobuf.IDuration|null); + + /** Leg distanceMeters */ + distanceMeters?: (number|null); + } + + /** Represents a Leg. */ + class Leg implements ILeg { + + /** + * Constructs a new Leg. + * @param [properties] Properties to set + */ + constructor(properties?: google.maps.places.v1.RoutingSummary.ILeg); + + /** Leg duration. */ + public duration?: (google.protobuf.IDuration|null); + + /** Leg distanceMeters. */ + public distanceMeters: number; + + /** + * Creates a new Leg instance using the specified properties. + * @param [properties] Properties to set + * @returns Leg instance + */ + public static create(properties?: google.maps.places.v1.RoutingSummary.ILeg): google.maps.places.v1.RoutingSummary.Leg; + + /** + * Encodes the specified Leg message. Does not implicitly {@link google.maps.places.v1.RoutingSummary.Leg.verify|verify} messages. + * @param message Leg message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.maps.places.v1.RoutingSummary.ILeg, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Leg message, length delimited. Does not implicitly {@link google.maps.places.v1.RoutingSummary.Leg.verify|verify} messages. + * @param message Leg message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.maps.places.v1.RoutingSummary.ILeg, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Leg message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Leg + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.maps.places.v1.RoutingSummary.Leg; + + /** + * Decodes a Leg message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Leg + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.maps.places.v1.RoutingSummary.Leg; + + /** + * Verifies a Leg message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Leg message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Leg + */ + public static fromObject(object: { [k: string]: any }): google.maps.places.v1.RoutingSummary.Leg; + + /** + * Creates a plain object from a Leg message. Also converts values to other types if specified. + * @param message Leg + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.maps.places.v1.RoutingSummary.Leg, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Leg to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Leg + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** TravelMode enum. */ + enum TravelMode { + TRAVEL_MODE_UNSPECIFIED = 0, + DRIVE = 1, + BICYCLE = 2, + WALK = 3, + TWO_WHEELER = 4 + } } } } diff --git a/packages/google-maps-places/protos/protos.js b/packages/google-maps-places/protos/protos.js index 74fd039fb63..c9efd97b5cc 100644 --- a/packages/google-maps-places/protos/protos.js +++ b/packages/google-maps-places/protos/protos.js @@ -12276,6 +12276,352 @@ return Places; })(); + v1.RoutingParameters = (function() { + + /** + * Properties of a RoutingParameters. + * @memberof google.maps.places.v1 + * @interface IRoutingParameters + * @property {google.type.ILatLng|null} [origin] RoutingParameters origin + * @property {google.maps.places.v1.TravelMode|null} [travelMode] RoutingParameters travelMode + * @property {google.maps.places.v1.IRouteModifiers|null} [routeModifiers] RoutingParameters routeModifiers + * @property {google.maps.places.v1.RoutingPreference|null} [routingPreference] RoutingParameters routingPreference + */ + + /** + * Constructs a new RoutingParameters. + * @memberof google.maps.places.v1 + * @classdesc Represents a RoutingParameters. + * @implements IRoutingParameters + * @constructor + * @param {google.maps.places.v1.IRoutingParameters=} [properties] Properties to set + */ + function RoutingParameters(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RoutingParameters origin. + * @member {google.type.ILatLng|null|undefined} origin + * @memberof google.maps.places.v1.RoutingParameters + * @instance + */ + RoutingParameters.prototype.origin = null; + + /** + * RoutingParameters travelMode. + * @member {google.maps.places.v1.TravelMode} travelMode + * @memberof google.maps.places.v1.RoutingParameters + * @instance + */ + RoutingParameters.prototype.travelMode = 0; + + /** + * RoutingParameters routeModifiers. + * @member {google.maps.places.v1.IRouteModifiers|null|undefined} routeModifiers + * @memberof google.maps.places.v1.RoutingParameters + * @instance + */ + RoutingParameters.prototype.routeModifiers = null; + + /** + * RoutingParameters routingPreference. + * @member {google.maps.places.v1.RoutingPreference} routingPreference + * @memberof google.maps.places.v1.RoutingParameters + * @instance + */ + RoutingParameters.prototype.routingPreference = 0; + + /** + * Creates a new RoutingParameters instance using the specified properties. + * @function create + * @memberof google.maps.places.v1.RoutingParameters + * @static + * @param {google.maps.places.v1.IRoutingParameters=} [properties] Properties to set + * @returns {google.maps.places.v1.RoutingParameters} RoutingParameters instance + */ + RoutingParameters.create = function create(properties) { + return new RoutingParameters(properties); + }; + + /** + * Encodes the specified RoutingParameters message. Does not implicitly {@link google.maps.places.v1.RoutingParameters.verify|verify} messages. + * @function encode + * @memberof google.maps.places.v1.RoutingParameters + * @static + * @param {google.maps.places.v1.IRoutingParameters} message RoutingParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingParameters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.origin != null && Object.hasOwnProperty.call(message, "origin")) + $root.google.type.LatLng.encode(message.origin, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.travelMode != null && Object.hasOwnProperty.call(message, "travelMode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.travelMode); + if (message.routeModifiers != null && Object.hasOwnProperty.call(message, "routeModifiers")) + $root.google.maps.places.v1.RouteModifiers.encode(message.routeModifiers, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.routingPreference != null && Object.hasOwnProperty.call(message, "routingPreference")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.routingPreference); + return writer; + }; + + /** + * Encodes the specified RoutingParameters message, length delimited. Does not implicitly {@link google.maps.places.v1.RoutingParameters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.places.v1.RoutingParameters + * @static + * @param {google.maps.places.v1.IRoutingParameters} message RoutingParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingParameters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RoutingParameters message from the specified reader or buffer. + * @function decode + * @memberof google.maps.places.v1.RoutingParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.places.v1.RoutingParameters} RoutingParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingParameters.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.places.v1.RoutingParameters(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.origin = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + } + case 2: { + message.travelMode = reader.int32(); + break; + } + case 3: { + message.routeModifiers = $root.google.maps.places.v1.RouteModifiers.decode(reader, reader.uint32()); + break; + } + case 4: { + message.routingPreference = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RoutingParameters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.places.v1.RoutingParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.places.v1.RoutingParameters} RoutingParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingParameters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RoutingParameters message. + * @function verify + * @memberof google.maps.places.v1.RoutingParameters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RoutingParameters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.origin != null && message.hasOwnProperty("origin")) { + var error = $root.google.type.LatLng.verify(message.origin); + if (error) + return "origin." + error; + } + if (message.travelMode != null && message.hasOwnProperty("travelMode")) + switch (message.travelMode) { + default: + return "travelMode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.routeModifiers != null && message.hasOwnProperty("routeModifiers")) { + var error = $root.google.maps.places.v1.RouteModifiers.verify(message.routeModifiers); + if (error) + return "routeModifiers." + error; + } + if (message.routingPreference != null && message.hasOwnProperty("routingPreference")) + switch (message.routingPreference) { + default: + return "routingPreference: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a RoutingParameters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.places.v1.RoutingParameters + * @static + * @param {Object.} object Plain object + * @returns {google.maps.places.v1.RoutingParameters} RoutingParameters + */ + RoutingParameters.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.places.v1.RoutingParameters) + return object; + var message = new $root.google.maps.places.v1.RoutingParameters(); + if (object.origin != null) { + if (typeof object.origin !== "object") + throw TypeError(".google.maps.places.v1.RoutingParameters.origin: object expected"); + message.origin = $root.google.type.LatLng.fromObject(object.origin); + } + switch (object.travelMode) { + default: + if (typeof object.travelMode === "number") { + message.travelMode = object.travelMode; + break; + } + break; + case "TRAVEL_MODE_UNSPECIFIED": + case 0: + message.travelMode = 0; + break; + case "DRIVE": + case 1: + message.travelMode = 1; + break; + case "BICYCLE": + case 2: + message.travelMode = 2; + break; + case "WALK": + case 3: + message.travelMode = 3; + break; + case "TWO_WHEELER": + case 4: + message.travelMode = 4; + break; + } + if (object.routeModifiers != null) { + if (typeof object.routeModifiers !== "object") + throw TypeError(".google.maps.places.v1.RoutingParameters.routeModifiers: object expected"); + message.routeModifiers = $root.google.maps.places.v1.RouteModifiers.fromObject(object.routeModifiers); + } + switch (object.routingPreference) { + default: + if (typeof object.routingPreference === "number") { + message.routingPreference = object.routingPreference; + break; + } + break; + case "ROUTING_PREFERENCE_UNSPECIFIED": + case 0: + message.routingPreference = 0; + break; + case "TRAFFIC_UNAWARE": + case 1: + message.routingPreference = 1; + break; + case "TRAFFIC_AWARE": + case 2: + message.routingPreference = 2; + break; + case "TRAFFIC_AWARE_OPTIMAL": + case 3: + message.routingPreference = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a RoutingParameters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.places.v1.RoutingParameters + * @static + * @param {google.maps.places.v1.RoutingParameters} message RoutingParameters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RoutingParameters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.origin = null; + object.travelMode = options.enums === String ? "TRAVEL_MODE_UNSPECIFIED" : 0; + object.routeModifiers = null; + object.routingPreference = options.enums === String ? "ROUTING_PREFERENCE_UNSPECIFIED" : 0; + } + if (message.origin != null && message.hasOwnProperty("origin")) + object.origin = $root.google.type.LatLng.toObject(message.origin, options); + if (message.travelMode != null && message.hasOwnProperty("travelMode")) + object.travelMode = options.enums === String ? $root.google.maps.places.v1.TravelMode[message.travelMode] === undefined ? message.travelMode : $root.google.maps.places.v1.TravelMode[message.travelMode] : message.travelMode; + if (message.routeModifiers != null && message.hasOwnProperty("routeModifiers")) + object.routeModifiers = $root.google.maps.places.v1.RouteModifiers.toObject(message.routeModifiers, options); + if (message.routingPreference != null && message.hasOwnProperty("routingPreference")) + object.routingPreference = options.enums === String ? $root.google.maps.places.v1.RoutingPreference[message.routingPreference] === undefined ? message.routingPreference : $root.google.maps.places.v1.RoutingPreference[message.routingPreference] : message.routingPreference; + return object; + }; + + /** + * Converts this RoutingParameters to JSON. + * @function toJSON + * @memberof google.maps.places.v1.RoutingParameters + * @instance + * @returns {Object.} JSON object + */ + RoutingParameters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RoutingParameters + * @function getTypeUrl + * @memberof google.maps.places.v1.RoutingParameters + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoutingParameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.places.v1.RoutingParameters"; + }; + + return RoutingParameters; + })(); + v1.SearchNearbyRequest = (function() { /** @@ -12291,6 +12637,7 @@ * @property {number|null} [maxResultCount] SearchNearbyRequest maxResultCount * @property {google.maps.places.v1.SearchNearbyRequest.ILocationRestriction|null} [locationRestriction] SearchNearbyRequest locationRestriction * @property {google.maps.places.v1.SearchNearbyRequest.RankPreference|null} [rankPreference] SearchNearbyRequest rankPreference + * @property {google.maps.places.v1.IRoutingParameters|null} [routingParameters] SearchNearbyRequest routingParameters */ /** @@ -12384,6 +12731,14 @@ */ SearchNearbyRequest.prototype.rankPreference = 0; + /** + * SearchNearbyRequest routingParameters. + * @member {google.maps.places.v1.IRoutingParameters|null|undefined} routingParameters + * @memberof google.maps.places.v1.SearchNearbyRequest + * @instance + */ + SearchNearbyRequest.prototype.routingParameters = null; + /** * Creates a new SearchNearbyRequest instance using the specified properties. * @function create @@ -12430,6 +12785,8 @@ $root.google.maps.places.v1.SearchNearbyRequest.LocationRestriction.encode(message.locationRestriction, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); if (message.rankPreference != null && Object.hasOwnProperty.call(message, "rankPreference")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.rankPreference); + if (message.routingParameters != null && Object.hasOwnProperty.call(message, "routingParameters")) + $root.google.maps.places.v1.RoutingParameters.encode(message.routingParameters, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; @@ -12508,6 +12865,10 @@ message.rankPreference = reader.int32(); break; } + case 10: { + message.routingParameters = $root.google.maps.places.v1.RoutingParameters.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -12594,6 +12955,11 @@ case 2: break; } + if (message.routingParameters != null && message.hasOwnProperty("routingParameters")) { + var error = $root.google.maps.places.v1.RoutingParameters.verify(message.routingParameters); + if (error) + return "routingParameters." + error; + } return null; }; @@ -12668,6 +13034,11 @@ message.rankPreference = 2; break; } + if (object.routingParameters != null) { + if (typeof object.routingParameters !== "object") + throw TypeError(".google.maps.places.v1.SearchNearbyRequest.routingParameters: object expected"); + message.routingParameters = $root.google.maps.places.v1.RoutingParameters.fromObject(object.routingParameters); + } return message; }; @@ -12696,6 +13067,7 @@ object.maxResultCount = 0; object.locationRestriction = null; object.rankPreference = options.enums === String ? "RANK_PREFERENCE_UNSPECIFIED" : 0; + object.routingParameters = null; } if (message.languageCode != null && message.hasOwnProperty("languageCode")) object.languageCode = message.languageCode; @@ -12727,6 +13099,8 @@ object.locationRestriction = $root.google.maps.places.v1.SearchNearbyRequest.LocationRestriction.toObject(message.locationRestriction, options); if (message.rankPreference != null && message.hasOwnProperty("rankPreference")) object.rankPreference = options.enums === String ? $root.google.maps.places.v1.SearchNearbyRequest.RankPreference[message.rankPreference] === undefined ? message.rankPreference : $root.google.maps.places.v1.SearchNearbyRequest.RankPreference[message.rankPreference] : message.rankPreference; + if (message.routingParameters != null && message.hasOwnProperty("routingParameters")) + object.routingParameters = $root.google.maps.places.v1.RoutingParameters.toObject(message.routingParameters, options); return object; }; @@ -13009,6 +13383,7 @@ * @memberof google.maps.places.v1 * @interface ISearchNearbyResponse * @property {Array.|null} [places] SearchNearbyResponse places + * @property {Array.|null} [routingSummaries] SearchNearbyResponse routingSummaries */ /** @@ -13021,6 +13396,7 @@ */ function SearchNearbyResponse(properties) { this.places = []; + this.routingSummaries = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -13035,6 +13411,14 @@ */ SearchNearbyResponse.prototype.places = $util.emptyArray; + /** + * SearchNearbyResponse routingSummaries. + * @member {Array.} routingSummaries + * @memberof google.maps.places.v1.SearchNearbyResponse + * @instance + */ + SearchNearbyResponse.prototype.routingSummaries = $util.emptyArray; + /** * Creates a new SearchNearbyResponse instance using the specified properties. * @function create @@ -13062,6 +13446,9 @@ if (message.places != null && message.places.length) for (var i = 0; i < message.places.length; ++i) $root.google.maps.places.v1.Place.encode(message.places[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.routingSummaries != null && message.routingSummaries.length) + for (var i = 0; i < message.routingSummaries.length; ++i) + $root.google.maps.places.v1.RoutingSummary.encode(message.routingSummaries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; @@ -13102,6 +13489,12 @@ message.places.push($root.google.maps.places.v1.Place.decode(reader, reader.uint32())); break; } + case 2: { + if (!(message.routingSummaries && message.routingSummaries.length)) + message.routingSummaries = []; + message.routingSummaries.push($root.google.maps.places.v1.RoutingSummary.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -13146,6 +13539,15 @@ return "places." + error; } } + if (message.routingSummaries != null && message.hasOwnProperty("routingSummaries")) { + if (!Array.isArray(message.routingSummaries)) + return "routingSummaries: array expected"; + for (var i = 0; i < message.routingSummaries.length; ++i) { + var error = $root.google.maps.places.v1.RoutingSummary.verify(message.routingSummaries[i]); + if (error) + return "routingSummaries." + error; + } + } return null; }; @@ -13171,6 +13573,16 @@ message.places[i] = $root.google.maps.places.v1.Place.fromObject(object.places[i]); } } + if (object.routingSummaries) { + if (!Array.isArray(object.routingSummaries)) + throw TypeError(".google.maps.places.v1.SearchNearbyResponse.routingSummaries: array expected"); + message.routingSummaries = []; + for (var i = 0; i < object.routingSummaries.length; ++i) { + if (typeof object.routingSummaries[i] !== "object") + throw TypeError(".google.maps.places.v1.SearchNearbyResponse.routingSummaries: object expected"); + message.routingSummaries[i] = $root.google.maps.places.v1.RoutingSummary.fromObject(object.routingSummaries[i]); + } + } return message; }; @@ -13187,13 +13599,20 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.places = []; + object.routingSummaries = []; + } if (message.places && message.places.length) { object.places = []; for (var j = 0; j < message.places.length; ++j) object.places[j] = $root.google.maps.places.v1.Place.toObject(message.places[j], options); } + if (message.routingSummaries && message.routingSummaries.length) { + object.routingSummaries = []; + for (var j = 0; j < message.routingSummaries.length; ++j) + object.routingSummaries[j] = $root.google.maps.places.v1.RoutingSummary.toObject(message.routingSummaries[j], options); + } return object; }; @@ -13245,6 +13664,8 @@ * @property {google.maps.places.v1.SearchTextRequest.ILocationBias|null} [locationBias] SearchTextRequest locationBias * @property {google.maps.places.v1.SearchTextRequest.ILocationRestriction|null} [locationRestriction] SearchTextRequest locationRestriction * @property {google.maps.places.v1.SearchTextRequest.IEVOptions|null} [evOptions] SearchTextRequest evOptions + * @property {google.maps.places.v1.IRoutingParameters|null} [routingParameters] SearchTextRequest routingParameters + * @property {google.maps.places.v1.SearchTextRequest.ISearchAlongRouteParameters|null} [searchAlongRouteParameters] SearchTextRequest searchAlongRouteParameters */ /** @@ -13367,6 +13788,22 @@ */ SearchTextRequest.prototype.evOptions = null; + /** + * SearchTextRequest routingParameters. + * @member {google.maps.places.v1.IRoutingParameters|null|undefined} routingParameters + * @memberof google.maps.places.v1.SearchTextRequest + * @instance + */ + SearchTextRequest.prototype.routingParameters = null; + + /** + * SearchTextRequest searchAlongRouteParameters. + * @member {google.maps.places.v1.SearchTextRequest.ISearchAlongRouteParameters|null|undefined} searchAlongRouteParameters + * @memberof google.maps.places.v1.SearchTextRequest + * @instance + */ + SearchTextRequest.prototype.searchAlongRouteParameters = null; + /** * Creates a new SearchTextRequest instance using the specified properties. * @function create @@ -13421,6 +13858,10 @@ $root.google.maps.places.v1.SearchTextRequest.LocationRestriction.encode(message.locationRestriction, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); if (message.evOptions != null && Object.hasOwnProperty.call(message, "evOptions")) $root.google.maps.places.v1.SearchTextRequest.EVOptions.encode(message.evOptions, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.routingParameters != null && Object.hasOwnProperty.call(message, "routingParameters")) + $root.google.maps.places.v1.RoutingParameters.encode(message.routingParameters, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.searchAlongRouteParameters != null && Object.hasOwnProperty.call(message, "searchAlongRouteParameters")) + $root.google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters.encode(message.searchAlongRouteParameters, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); return writer; }; @@ -13514,6 +13955,14 @@ message.evOptions = $root.google.maps.places.v1.SearchTextRequest.EVOptions.decode(reader, reader.uint32()); break; } + case 16: { + message.routingParameters = $root.google.maps.places.v1.RoutingParameters.decode(reader, reader.uint32()); + break; + } + case 17: { + message.searchAlongRouteParameters = $root.google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -13613,6 +14062,16 @@ if (error) return "evOptions." + error; } + if (message.routingParameters != null && message.hasOwnProperty("routingParameters")) { + var error = $root.google.maps.places.v1.RoutingParameters.verify(message.routingParameters); + if (error) + return "routingParameters." + error; + } + if (message.searchAlongRouteParameters != null && message.hasOwnProperty("searchAlongRouteParameters")) { + var error = $root.google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters.verify(message.searchAlongRouteParameters); + if (error) + return "searchAlongRouteParameters." + error; + } return null; }; @@ -13716,6 +14175,16 @@ throw TypeError(".google.maps.places.v1.SearchTextRequest.evOptions: object expected"); message.evOptions = $root.google.maps.places.v1.SearchTextRequest.EVOptions.fromObject(object.evOptions); } + if (object.routingParameters != null) { + if (typeof object.routingParameters !== "object") + throw TypeError(".google.maps.places.v1.SearchTextRequest.routingParameters: object expected"); + message.routingParameters = $root.google.maps.places.v1.RoutingParameters.fromObject(object.routingParameters); + } + if (object.searchAlongRouteParameters != null) { + if (typeof object.searchAlongRouteParameters !== "object") + throw TypeError(".google.maps.places.v1.SearchTextRequest.searchAlongRouteParameters: object expected"); + message.searchAlongRouteParameters = $root.google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters.fromObject(object.searchAlongRouteParameters); + } return message; }; @@ -13747,6 +14216,8 @@ object.locationBias = null; object.locationRestriction = null; object.evOptions = null; + object.routingParameters = null; + object.searchAlongRouteParameters = null; } if (message.textQuery != null && message.hasOwnProperty("textQuery")) object.textQuery = message.textQuery; @@ -13777,6 +14248,10 @@ object.locationRestriction = $root.google.maps.places.v1.SearchTextRequest.LocationRestriction.toObject(message.locationRestriction, options); if (message.evOptions != null && message.hasOwnProperty("evOptions")) object.evOptions = $root.google.maps.places.v1.SearchTextRequest.EVOptions.toObject(message.evOptions, options); + if (message.routingParameters != null && message.hasOwnProperty("routingParameters")) + object.routingParameters = $root.google.maps.places.v1.RoutingParameters.toObject(message.routingParameters, options); + if (message.searchAlongRouteParameters != null && message.hasOwnProperty("searchAlongRouteParameters")) + object.searchAlongRouteParameters = $root.google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters.toObject(message.searchAlongRouteParameters, options); return object; }; @@ -14621,6 +15096,214 @@ return EVOptions; })(); + SearchTextRequest.SearchAlongRouteParameters = (function() { + + /** + * Properties of a SearchAlongRouteParameters. + * @memberof google.maps.places.v1.SearchTextRequest + * @interface ISearchAlongRouteParameters + * @property {google.maps.places.v1.IPolyline|null} [polyline] SearchAlongRouteParameters polyline + */ + + /** + * Constructs a new SearchAlongRouteParameters. + * @memberof google.maps.places.v1.SearchTextRequest + * @classdesc Represents a SearchAlongRouteParameters. + * @implements ISearchAlongRouteParameters + * @constructor + * @param {google.maps.places.v1.SearchTextRequest.ISearchAlongRouteParameters=} [properties] Properties to set + */ + function SearchAlongRouteParameters(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchAlongRouteParameters polyline. + * @member {google.maps.places.v1.IPolyline|null|undefined} polyline + * @memberof google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters + * @instance + */ + SearchAlongRouteParameters.prototype.polyline = null; + + /** + * Creates a new SearchAlongRouteParameters instance using the specified properties. + * @function create + * @memberof google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters + * @static + * @param {google.maps.places.v1.SearchTextRequest.ISearchAlongRouteParameters=} [properties] Properties to set + * @returns {google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters} SearchAlongRouteParameters instance + */ + SearchAlongRouteParameters.create = function create(properties) { + return new SearchAlongRouteParameters(properties); + }; + + /** + * Encodes the specified SearchAlongRouteParameters message. Does not implicitly {@link google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters.verify|verify} messages. + * @function encode + * @memberof google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters + * @static + * @param {google.maps.places.v1.SearchTextRequest.ISearchAlongRouteParameters} message SearchAlongRouteParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAlongRouteParameters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.polyline != null && Object.hasOwnProperty.call(message, "polyline")) + $root.google.maps.places.v1.Polyline.encode(message.polyline, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SearchAlongRouteParameters message, length delimited. Does not implicitly {@link google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters + * @static + * @param {google.maps.places.v1.SearchTextRequest.ISearchAlongRouteParameters} message SearchAlongRouteParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAlongRouteParameters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchAlongRouteParameters message from the specified reader or buffer. + * @function decode + * @memberof google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters} SearchAlongRouteParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAlongRouteParameters.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.polyline = $root.google.maps.places.v1.Polyline.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchAlongRouteParameters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters} SearchAlongRouteParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAlongRouteParameters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchAlongRouteParameters message. + * @function verify + * @memberof google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchAlongRouteParameters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.polyline != null && message.hasOwnProperty("polyline")) { + var error = $root.google.maps.places.v1.Polyline.verify(message.polyline); + if (error) + return "polyline." + error; + } + return null; + }; + + /** + * Creates a SearchAlongRouteParameters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters + * @static + * @param {Object.} object Plain object + * @returns {google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters} SearchAlongRouteParameters + */ + SearchAlongRouteParameters.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters) + return object; + var message = new $root.google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters(); + if (object.polyline != null) { + if (typeof object.polyline !== "object") + throw TypeError(".google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters.polyline: object expected"); + message.polyline = $root.google.maps.places.v1.Polyline.fromObject(object.polyline); + } + return message; + }; + + /** + * Creates a plain object from a SearchAlongRouteParameters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters + * @static + * @param {google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters} message SearchAlongRouteParameters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchAlongRouteParameters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.polyline = null; + if (message.polyline != null && message.hasOwnProperty("polyline")) + object.polyline = $root.google.maps.places.v1.Polyline.toObject(message.polyline, options); + return object; + }; + + /** + * Converts this SearchAlongRouteParameters to JSON. + * @function toJSON + * @memberof google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters + * @instance + * @returns {Object.} JSON object + */ + SearchAlongRouteParameters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SearchAlongRouteParameters + * @function getTypeUrl + * @memberof google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SearchAlongRouteParameters.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters"; + }; + + return SearchAlongRouteParameters; + })(); + return SearchTextRequest; })(); @@ -14631,6 +15314,7 @@ * @memberof google.maps.places.v1 * @interface ISearchTextResponse * @property {Array.|null} [places] SearchTextResponse places + * @property {Array.|null} [routingSummaries] SearchTextResponse routingSummaries * @property {Array.|null} [contextualContents] SearchTextResponse contextualContents */ @@ -14644,6 +15328,7 @@ */ function SearchTextResponse(properties) { this.places = []; + this.routingSummaries = []; this.contextualContents = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) @@ -14659,6 +15344,14 @@ */ SearchTextResponse.prototype.places = $util.emptyArray; + /** + * SearchTextResponse routingSummaries. + * @member {Array.} routingSummaries + * @memberof google.maps.places.v1.SearchTextResponse + * @instance + */ + SearchTextResponse.prototype.routingSummaries = $util.emptyArray; + /** * SearchTextResponse contextualContents. * @member {Array.} contextualContents @@ -14694,6 +15387,9 @@ if (message.places != null && message.places.length) for (var i = 0; i < message.places.length; ++i) $root.google.maps.places.v1.Place.encode(message.places[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.routingSummaries != null && message.routingSummaries.length) + for (var i = 0; i < message.routingSummaries.length; ++i) + $root.google.maps.places.v1.RoutingSummary.encode(message.routingSummaries[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.contextualContents != null && message.contextualContents.length) for (var i = 0; i < message.contextualContents.length; ++i) $root.google.maps.places.v1.ContextualContent.encode(message.contextualContents[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); @@ -14737,6 +15433,12 @@ message.places.push($root.google.maps.places.v1.Place.decode(reader, reader.uint32())); break; } + case 2: { + if (!(message.routingSummaries && message.routingSummaries.length)) + message.routingSummaries = []; + message.routingSummaries.push($root.google.maps.places.v1.RoutingSummary.decode(reader, reader.uint32())); + break; + } case 3: { if (!(message.contextualContents && message.contextualContents.length)) message.contextualContents = []; @@ -14787,6 +15489,15 @@ return "places." + error; } } + if (message.routingSummaries != null && message.hasOwnProperty("routingSummaries")) { + if (!Array.isArray(message.routingSummaries)) + return "routingSummaries: array expected"; + for (var i = 0; i < message.routingSummaries.length; ++i) { + var error = $root.google.maps.places.v1.RoutingSummary.verify(message.routingSummaries[i]); + if (error) + return "routingSummaries." + error; + } + } if (message.contextualContents != null && message.hasOwnProperty("contextualContents")) { if (!Array.isArray(message.contextualContents)) return "contextualContents: array expected"; @@ -14821,6 +15532,16 @@ message.places[i] = $root.google.maps.places.v1.Place.fromObject(object.places[i]); } } + if (object.routingSummaries) { + if (!Array.isArray(object.routingSummaries)) + throw TypeError(".google.maps.places.v1.SearchTextResponse.routingSummaries: array expected"); + message.routingSummaries = []; + for (var i = 0; i < object.routingSummaries.length; ++i) { + if (typeof object.routingSummaries[i] !== "object") + throw TypeError(".google.maps.places.v1.SearchTextResponse.routingSummaries: object expected"); + message.routingSummaries[i] = $root.google.maps.places.v1.RoutingSummary.fromObject(object.routingSummaries[i]); + } + } if (object.contextualContents) { if (!Array.isArray(object.contextualContents)) throw TypeError(".google.maps.places.v1.SearchTextResponse.contextualContents: array expected"); @@ -14849,6 +15570,7 @@ var object = {}; if (options.arrays || options.defaults) { object.places = []; + object.routingSummaries = []; object.contextualContents = []; } if (message.places && message.places.length) { @@ -14856,6 +15578,11 @@ for (var j = 0; j < message.places.length; ++j) object.places[j] = $root.google.maps.places.v1.Place.toObject(message.places[j], options); } + if (message.routingSummaries && message.routingSummaries.length) { + object.routingSummaries = []; + for (var j = 0; j < message.routingSummaries.length; ++j) + object.routingSummaries[j] = $root.google.maps.places.v1.RoutingSummary.toObject(message.routingSummaries[j], options); + } if (message.contextualContents && message.contextualContents.length) { object.contextualContents = []; for (var j = 0; j < message.contextualContents.length; ++j) @@ -18454,6 +19181,994 @@ return AutocompletePlacesResponse; })(); + v1.Polyline = (function() { + + /** + * Properties of a Polyline. + * @memberof google.maps.places.v1 + * @interface IPolyline + * @property {string|null} [encodedPolyline] Polyline encodedPolyline + */ + + /** + * Constructs a new Polyline. + * @memberof google.maps.places.v1 + * @classdesc Represents a Polyline. + * @implements IPolyline + * @constructor + * @param {google.maps.places.v1.IPolyline=} [properties] Properties to set + */ + function Polyline(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Polyline encodedPolyline. + * @member {string|null|undefined} encodedPolyline + * @memberof google.maps.places.v1.Polyline + * @instance + */ + Polyline.prototype.encodedPolyline = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Polyline polylineType. + * @member {"encodedPolyline"|undefined} polylineType + * @memberof google.maps.places.v1.Polyline + * @instance + */ + Object.defineProperty(Polyline.prototype, "polylineType", { + get: $util.oneOfGetter($oneOfFields = ["encodedPolyline"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Polyline instance using the specified properties. + * @function create + * @memberof google.maps.places.v1.Polyline + * @static + * @param {google.maps.places.v1.IPolyline=} [properties] Properties to set + * @returns {google.maps.places.v1.Polyline} Polyline instance + */ + Polyline.create = function create(properties) { + return new Polyline(properties); + }; + + /** + * Encodes the specified Polyline message. Does not implicitly {@link google.maps.places.v1.Polyline.verify|verify} messages. + * @function encode + * @memberof google.maps.places.v1.Polyline + * @static + * @param {google.maps.places.v1.IPolyline} message Polyline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Polyline.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.encodedPolyline != null && Object.hasOwnProperty.call(message, "encodedPolyline")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.encodedPolyline); + return writer; + }; + + /** + * Encodes the specified Polyline message, length delimited. Does not implicitly {@link google.maps.places.v1.Polyline.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.places.v1.Polyline + * @static + * @param {google.maps.places.v1.IPolyline} message Polyline message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Polyline.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Polyline message from the specified reader or buffer. + * @function decode + * @memberof google.maps.places.v1.Polyline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.places.v1.Polyline} Polyline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Polyline.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.places.v1.Polyline(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.encodedPolyline = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Polyline message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.places.v1.Polyline + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.places.v1.Polyline} Polyline + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Polyline.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Polyline message. + * @function verify + * @memberof google.maps.places.v1.Polyline + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Polyline.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.encodedPolyline != null && message.hasOwnProperty("encodedPolyline")) { + properties.polylineType = 1; + if (!$util.isString(message.encodedPolyline)) + return "encodedPolyline: string expected"; + } + return null; + }; + + /** + * Creates a Polyline message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.places.v1.Polyline + * @static + * @param {Object.} object Plain object + * @returns {google.maps.places.v1.Polyline} Polyline + */ + Polyline.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.places.v1.Polyline) + return object; + var message = new $root.google.maps.places.v1.Polyline(); + if (object.encodedPolyline != null) + message.encodedPolyline = String(object.encodedPolyline); + return message; + }; + + /** + * Creates a plain object from a Polyline message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.places.v1.Polyline + * @static + * @param {google.maps.places.v1.Polyline} message Polyline + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Polyline.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.encodedPolyline != null && message.hasOwnProperty("encodedPolyline")) { + object.encodedPolyline = message.encodedPolyline; + if (options.oneofs) + object.polylineType = "encodedPolyline"; + } + return object; + }; + + /** + * Converts this Polyline to JSON. + * @function toJSON + * @memberof google.maps.places.v1.Polyline + * @instance + * @returns {Object.} JSON object + */ + Polyline.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Polyline + * @function getTypeUrl + * @memberof google.maps.places.v1.Polyline + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Polyline.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.places.v1.Polyline"; + }; + + return Polyline; + })(); + + v1.RouteModifiers = (function() { + + /** + * Properties of a RouteModifiers. + * @memberof google.maps.places.v1 + * @interface IRouteModifiers + * @property {boolean|null} [avoidTolls] RouteModifiers avoidTolls + * @property {boolean|null} [avoidHighways] RouteModifiers avoidHighways + * @property {boolean|null} [avoidFerries] RouteModifiers avoidFerries + * @property {boolean|null} [avoidIndoor] RouteModifiers avoidIndoor + */ + + /** + * Constructs a new RouteModifiers. + * @memberof google.maps.places.v1 + * @classdesc Represents a RouteModifiers. + * @implements IRouteModifiers + * @constructor + * @param {google.maps.places.v1.IRouteModifiers=} [properties] Properties to set + */ + function RouteModifiers(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RouteModifiers avoidTolls. + * @member {boolean} avoidTolls + * @memberof google.maps.places.v1.RouteModifiers + * @instance + */ + RouteModifiers.prototype.avoidTolls = false; + + /** + * RouteModifiers avoidHighways. + * @member {boolean} avoidHighways + * @memberof google.maps.places.v1.RouteModifiers + * @instance + */ + RouteModifiers.prototype.avoidHighways = false; + + /** + * RouteModifiers avoidFerries. + * @member {boolean} avoidFerries + * @memberof google.maps.places.v1.RouteModifiers + * @instance + */ + RouteModifiers.prototype.avoidFerries = false; + + /** + * RouteModifiers avoidIndoor. + * @member {boolean} avoidIndoor + * @memberof google.maps.places.v1.RouteModifiers + * @instance + */ + RouteModifiers.prototype.avoidIndoor = false; + + /** + * Creates a new RouteModifiers instance using the specified properties. + * @function create + * @memberof google.maps.places.v1.RouteModifiers + * @static + * @param {google.maps.places.v1.IRouteModifiers=} [properties] Properties to set + * @returns {google.maps.places.v1.RouteModifiers} RouteModifiers instance + */ + RouteModifiers.create = function create(properties) { + return new RouteModifiers(properties); + }; + + /** + * Encodes the specified RouteModifiers message. Does not implicitly {@link google.maps.places.v1.RouteModifiers.verify|verify} messages. + * @function encode + * @memberof google.maps.places.v1.RouteModifiers + * @static + * @param {google.maps.places.v1.IRouteModifiers} message RouteModifiers message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteModifiers.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.avoidTolls != null && Object.hasOwnProperty.call(message, "avoidTolls")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.avoidTolls); + if (message.avoidHighways != null && Object.hasOwnProperty.call(message, "avoidHighways")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.avoidHighways); + if (message.avoidFerries != null && Object.hasOwnProperty.call(message, "avoidFerries")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.avoidFerries); + if (message.avoidIndoor != null && Object.hasOwnProperty.call(message, "avoidIndoor")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.avoidIndoor); + return writer; + }; + + /** + * Encodes the specified RouteModifiers message, length delimited. Does not implicitly {@link google.maps.places.v1.RouteModifiers.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.places.v1.RouteModifiers + * @static + * @param {google.maps.places.v1.IRouteModifiers} message RouteModifiers message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouteModifiers.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouteModifiers message from the specified reader or buffer. + * @function decode + * @memberof google.maps.places.v1.RouteModifiers + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.places.v1.RouteModifiers} RouteModifiers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteModifiers.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.places.v1.RouteModifiers(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.avoidTolls = reader.bool(); + break; + } + case 2: { + message.avoidHighways = reader.bool(); + break; + } + case 3: { + message.avoidFerries = reader.bool(); + break; + } + case 4: { + message.avoidIndoor = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouteModifiers message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.places.v1.RouteModifiers + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.places.v1.RouteModifiers} RouteModifiers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouteModifiers.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouteModifiers message. + * @function verify + * @memberof google.maps.places.v1.RouteModifiers + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouteModifiers.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.avoidTolls != null && message.hasOwnProperty("avoidTolls")) + if (typeof message.avoidTolls !== "boolean") + return "avoidTolls: boolean expected"; + if (message.avoidHighways != null && message.hasOwnProperty("avoidHighways")) + if (typeof message.avoidHighways !== "boolean") + return "avoidHighways: boolean expected"; + if (message.avoidFerries != null && message.hasOwnProperty("avoidFerries")) + if (typeof message.avoidFerries !== "boolean") + return "avoidFerries: boolean expected"; + if (message.avoidIndoor != null && message.hasOwnProperty("avoidIndoor")) + if (typeof message.avoidIndoor !== "boolean") + return "avoidIndoor: boolean expected"; + return null; + }; + + /** + * Creates a RouteModifiers message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.places.v1.RouteModifiers + * @static + * @param {Object.} object Plain object + * @returns {google.maps.places.v1.RouteModifiers} RouteModifiers + */ + RouteModifiers.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.places.v1.RouteModifiers) + return object; + var message = new $root.google.maps.places.v1.RouteModifiers(); + if (object.avoidTolls != null) + message.avoidTolls = Boolean(object.avoidTolls); + if (object.avoidHighways != null) + message.avoidHighways = Boolean(object.avoidHighways); + if (object.avoidFerries != null) + message.avoidFerries = Boolean(object.avoidFerries); + if (object.avoidIndoor != null) + message.avoidIndoor = Boolean(object.avoidIndoor); + return message; + }; + + /** + * Creates a plain object from a RouteModifiers message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.places.v1.RouteModifiers + * @static + * @param {google.maps.places.v1.RouteModifiers} message RouteModifiers + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouteModifiers.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.avoidTolls = false; + object.avoidHighways = false; + object.avoidFerries = false; + object.avoidIndoor = false; + } + if (message.avoidTolls != null && message.hasOwnProperty("avoidTolls")) + object.avoidTolls = message.avoidTolls; + if (message.avoidHighways != null && message.hasOwnProperty("avoidHighways")) + object.avoidHighways = message.avoidHighways; + if (message.avoidFerries != null && message.hasOwnProperty("avoidFerries")) + object.avoidFerries = message.avoidFerries; + if (message.avoidIndoor != null && message.hasOwnProperty("avoidIndoor")) + object.avoidIndoor = message.avoidIndoor; + return object; + }; + + /** + * Converts this RouteModifiers to JSON. + * @function toJSON + * @memberof google.maps.places.v1.RouteModifiers + * @instance + * @returns {Object.} JSON object + */ + RouteModifiers.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouteModifiers + * @function getTypeUrl + * @memberof google.maps.places.v1.RouteModifiers + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouteModifiers.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.places.v1.RouteModifiers"; + }; + + return RouteModifiers; + })(); + + /** + * RoutingPreference enum. + * @name google.maps.places.v1.RoutingPreference + * @enum {number} + * @property {number} ROUTING_PREFERENCE_UNSPECIFIED=0 ROUTING_PREFERENCE_UNSPECIFIED value + * @property {number} TRAFFIC_UNAWARE=1 TRAFFIC_UNAWARE value + * @property {number} TRAFFIC_AWARE=2 TRAFFIC_AWARE value + * @property {number} TRAFFIC_AWARE_OPTIMAL=3 TRAFFIC_AWARE_OPTIMAL value + */ + v1.RoutingPreference = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROUTING_PREFERENCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TRAFFIC_UNAWARE"] = 1; + values[valuesById[2] = "TRAFFIC_AWARE"] = 2; + values[valuesById[3] = "TRAFFIC_AWARE_OPTIMAL"] = 3; + return values; + })(); + + v1.RoutingSummary = (function() { + + /** + * Properties of a RoutingSummary. + * @memberof google.maps.places.v1 + * @interface IRoutingSummary + * @property {Array.|null} [legs] RoutingSummary legs + */ + + /** + * Constructs a new RoutingSummary. + * @memberof google.maps.places.v1 + * @classdesc Represents a RoutingSummary. + * @implements IRoutingSummary + * @constructor + * @param {google.maps.places.v1.IRoutingSummary=} [properties] Properties to set + */ + function RoutingSummary(properties) { + this.legs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RoutingSummary legs. + * @member {Array.} legs + * @memberof google.maps.places.v1.RoutingSummary + * @instance + */ + RoutingSummary.prototype.legs = $util.emptyArray; + + /** + * Creates a new RoutingSummary instance using the specified properties. + * @function create + * @memberof google.maps.places.v1.RoutingSummary + * @static + * @param {google.maps.places.v1.IRoutingSummary=} [properties] Properties to set + * @returns {google.maps.places.v1.RoutingSummary} RoutingSummary instance + */ + RoutingSummary.create = function create(properties) { + return new RoutingSummary(properties); + }; + + /** + * Encodes the specified RoutingSummary message. Does not implicitly {@link google.maps.places.v1.RoutingSummary.verify|verify} messages. + * @function encode + * @memberof google.maps.places.v1.RoutingSummary + * @static + * @param {google.maps.places.v1.IRoutingSummary} message RoutingSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingSummary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.legs != null && message.legs.length) + for (var i = 0; i < message.legs.length; ++i) + $root.google.maps.places.v1.RoutingSummary.Leg.encode(message.legs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RoutingSummary message, length delimited. Does not implicitly {@link google.maps.places.v1.RoutingSummary.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.places.v1.RoutingSummary + * @static + * @param {google.maps.places.v1.IRoutingSummary} message RoutingSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RoutingSummary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RoutingSummary message from the specified reader or buffer. + * @function decode + * @memberof google.maps.places.v1.RoutingSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.places.v1.RoutingSummary} RoutingSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingSummary.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.places.v1.RoutingSummary(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.legs && message.legs.length)) + message.legs = []; + message.legs.push($root.google.maps.places.v1.RoutingSummary.Leg.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RoutingSummary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.places.v1.RoutingSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.places.v1.RoutingSummary} RoutingSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RoutingSummary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RoutingSummary message. + * @function verify + * @memberof google.maps.places.v1.RoutingSummary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RoutingSummary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.legs != null && message.hasOwnProperty("legs")) { + if (!Array.isArray(message.legs)) + return "legs: array expected"; + for (var i = 0; i < message.legs.length; ++i) { + var error = $root.google.maps.places.v1.RoutingSummary.Leg.verify(message.legs[i]); + if (error) + return "legs." + error; + } + } + return null; + }; + + /** + * Creates a RoutingSummary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.places.v1.RoutingSummary + * @static + * @param {Object.} object Plain object + * @returns {google.maps.places.v1.RoutingSummary} RoutingSummary + */ + RoutingSummary.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.places.v1.RoutingSummary) + return object; + var message = new $root.google.maps.places.v1.RoutingSummary(); + if (object.legs) { + if (!Array.isArray(object.legs)) + throw TypeError(".google.maps.places.v1.RoutingSummary.legs: array expected"); + message.legs = []; + for (var i = 0; i < object.legs.length; ++i) { + if (typeof object.legs[i] !== "object") + throw TypeError(".google.maps.places.v1.RoutingSummary.legs: object expected"); + message.legs[i] = $root.google.maps.places.v1.RoutingSummary.Leg.fromObject(object.legs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RoutingSummary message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.places.v1.RoutingSummary + * @static + * @param {google.maps.places.v1.RoutingSummary} message RoutingSummary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RoutingSummary.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.legs = []; + if (message.legs && message.legs.length) { + object.legs = []; + for (var j = 0; j < message.legs.length; ++j) + object.legs[j] = $root.google.maps.places.v1.RoutingSummary.Leg.toObject(message.legs[j], options); + } + return object; + }; + + /** + * Converts this RoutingSummary to JSON. + * @function toJSON + * @memberof google.maps.places.v1.RoutingSummary + * @instance + * @returns {Object.} JSON object + */ + RoutingSummary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RoutingSummary + * @function getTypeUrl + * @memberof google.maps.places.v1.RoutingSummary + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RoutingSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.places.v1.RoutingSummary"; + }; + + RoutingSummary.Leg = (function() { + + /** + * Properties of a Leg. + * @memberof google.maps.places.v1.RoutingSummary + * @interface ILeg + * @property {google.protobuf.IDuration|null} [duration] Leg duration + * @property {number|null} [distanceMeters] Leg distanceMeters + */ + + /** + * Constructs a new Leg. + * @memberof google.maps.places.v1.RoutingSummary + * @classdesc Represents a Leg. + * @implements ILeg + * @constructor + * @param {google.maps.places.v1.RoutingSummary.ILeg=} [properties] Properties to set + */ + function Leg(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Leg duration. + * @member {google.protobuf.IDuration|null|undefined} duration + * @memberof google.maps.places.v1.RoutingSummary.Leg + * @instance + */ + Leg.prototype.duration = null; + + /** + * Leg distanceMeters. + * @member {number} distanceMeters + * @memberof google.maps.places.v1.RoutingSummary.Leg + * @instance + */ + Leg.prototype.distanceMeters = 0; + + /** + * Creates a new Leg instance using the specified properties. + * @function create + * @memberof google.maps.places.v1.RoutingSummary.Leg + * @static + * @param {google.maps.places.v1.RoutingSummary.ILeg=} [properties] Properties to set + * @returns {google.maps.places.v1.RoutingSummary.Leg} Leg instance + */ + Leg.create = function create(properties) { + return new Leg(properties); + }; + + /** + * Encodes the specified Leg message. Does not implicitly {@link google.maps.places.v1.RoutingSummary.Leg.verify|verify} messages. + * @function encode + * @memberof google.maps.places.v1.RoutingSummary.Leg + * @static + * @param {google.maps.places.v1.RoutingSummary.ILeg} message Leg message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Leg.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.duration != null && Object.hasOwnProperty.call(message, "duration")) + $root.google.protobuf.Duration.encode(message.duration, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.distanceMeters != null && Object.hasOwnProperty.call(message, "distanceMeters")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.distanceMeters); + return writer; + }; + + /** + * Encodes the specified Leg message, length delimited. Does not implicitly {@link google.maps.places.v1.RoutingSummary.Leg.verify|verify} messages. + * @function encodeDelimited + * @memberof google.maps.places.v1.RoutingSummary.Leg + * @static + * @param {google.maps.places.v1.RoutingSummary.ILeg} message Leg message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Leg.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Leg message from the specified reader or buffer. + * @function decode + * @memberof google.maps.places.v1.RoutingSummary.Leg + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.maps.places.v1.RoutingSummary.Leg} Leg + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Leg.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.maps.places.v1.RoutingSummary.Leg(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.duration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 2: { + message.distanceMeters = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Leg message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.maps.places.v1.RoutingSummary.Leg + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.maps.places.v1.RoutingSummary.Leg} Leg + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Leg.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Leg message. + * @function verify + * @memberof google.maps.places.v1.RoutingSummary.Leg + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Leg.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.duration != null && message.hasOwnProperty("duration")) { + var error = $root.google.protobuf.Duration.verify(message.duration); + if (error) + return "duration." + error; + } + if (message.distanceMeters != null && message.hasOwnProperty("distanceMeters")) + if (!$util.isInteger(message.distanceMeters)) + return "distanceMeters: integer expected"; + return null; + }; + + /** + * Creates a Leg message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.maps.places.v1.RoutingSummary.Leg + * @static + * @param {Object.} object Plain object + * @returns {google.maps.places.v1.RoutingSummary.Leg} Leg + */ + Leg.fromObject = function fromObject(object) { + if (object instanceof $root.google.maps.places.v1.RoutingSummary.Leg) + return object; + var message = new $root.google.maps.places.v1.RoutingSummary.Leg(); + if (object.duration != null) { + if (typeof object.duration !== "object") + throw TypeError(".google.maps.places.v1.RoutingSummary.Leg.duration: object expected"); + message.duration = $root.google.protobuf.Duration.fromObject(object.duration); + } + if (object.distanceMeters != null) + message.distanceMeters = object.distanceMeters | 0; + return message; + }; + + /** + * Creates a plain object from a Leg message. Also converts values to other types if specified. + * @function toObject + * @memberof google.maps.places.v1.RoutingSummary.Leg + * @static + * @param {google.maps.places.v1.RoutingSummary.Leg} message Leg + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Leg.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.duration = null; + object.distanceMeters = 0; + } + if (message.duration != null && message.hasOwnProperty("duration")) + object.duration = $root.google.protobuf.Duration.toObject(message.duration, options); + if (message.distanceMeters != null && message.hasOwnProperty("distanceMeters")) + object.distanceMeters = message.distanceMeters; + return object; + }; + + /** + * Converts this Leg to JSON. + * @function toJSON + * @memberof google.maps.places.v1.RoutingSummary.Leg + * @instance + * @returns {Object.} JSON object + */ + Leg.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Leg + * @function getTypeUrl + * @memberof google.maps.places.v1.RoutingSummary.Leg + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Leg.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.maps.places.v1.RoutingSummary.Leg"; + }; + + return Leg; + })(); + + return RoutingSummary; + })(); + + /** + * TravelMode enum. + * @name google.maps.places.v1.TravelMode + * @enum {number} + * @property {number} TRAVEL_MODE_UNSPECIFIED=0 TRAVEL_MODE_UNSPECIFIED value + * @property {number} DRIVE=1 DRIVE value + * @property {number} BICYCLE=2 BICYCLE value + * @property {number} WALK=3 WALK value + * @property {number} TWO_WHEELER=4 TWO_WHEELER value + */ + v1.TravelMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TRAVEL_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DRIVE"] = 1; + values[valuesById[2] = "BICYCLE"] = 2; + values[valuesById[3] = "WALK"] = 3; + values[valuesById[4] = "TWO_WHEELER"] = 4; + return values; + })(); + return v1; })(); diff --git a/packages/google-maps-places/protos/protos.json b/packages/google-maps-places/protos/protos.json index b06808841e9..2dd238fa8b2 100644 --- a/packages/google-maps-places/protos/protos.json +++ b/packages/google-maps-places/protos/protos.json @@ -107,7 +107,7 @@ "csharp_namespace": "Google.Maps.Places.V1", "go_package": "cloud.google.com/go/maps/places/apiv1/placespb;placespb", "java_multiple_files": true, - "java_outer_classname": "PlacesServiceProto", + "java_outer_classname": "TravelModeProto", "java_package": "com.google.maps.places.v1", "objc_class_prefix": "GMPSV1", "php_namespace": "Google\\Maps\\Places\\V1" @@ -1478,6 +1478,38 @@ } } }, + "RoutingParameters": { + "fields": { + "origin": { + "type": "google.type.LatLng", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "travelMode": { + "type": "TravelMode", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "routeModifiers": { + "type": "RouteModifiers", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "routingPreference": { + "type": "RoutingPreference", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, "SearchNearbyRequest": { "fields": { "languageCode": { @@ -1522,6 +1554,13 @@ "rankPreference": { "type": "RankPreference", "id": 9 + }, + "routingParameters": { + "type": "RoutingParameters", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -1555,6 +1594,11 @@ "rule": "repeated", "type": "Place", "id": 1 + }, + "routingSummaries": { + "rule": "repeated", + "type": "RoutingSummary", + "id": 2 } } }, @@ -1618,6 +1662,20 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "routingParameters": { + "type": "RoutingParameters", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "searchAlongRouteParameters": { + "type": "SearchAlongRouteParameters", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { @@ -1681,6 +1739,17 @@ } } } + }, + "SearchAlongRouteParameters": { + "fields": { + "polyline": { + "type": "Polyline", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } } } }, @@ -1691,6 +1760,11 @@ "type": "Place", "id": 1 }, + "routingSummaries": { + "rule": "repeated", + "type": "RoutingSummary", + "id": 2 + }, "contextualContents": { "rule": "repeated", "type": "ContextualContent", @@ -2020,6 +2094,93 @@ } } } + }, + "Polyline": { + "oneofs": { + "polylineType": { + "oneof": [ + "encodedPolyline" + ] + } + }, + "fields": { + "encodedPolyline": { + "type": "string", + "id": 1 + } + } + }, + "RouteModifiers": { + "fields": { + "avoidTolls": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "avoidHighways": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "avoidFerries": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "avoidIndoor": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RoutingPreference": { + "values": { + "ROUTING_PREFERENCE_UNSPECIFIED": 0, + "TRAFFIC_UNAWARE": 1, + "TRAFFIC_AWARE": 2, + "TRAFFIC_AWARE_OPTIMAL": 3 + } + }, + "RoutingSummary": { + "fields": { + "legs": { + "rule": "repeated", + "type": "Leg", + "id": 1 + } + }, + "nested": { + "Leg": { + "fields": { + "duration": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "distanceMeters": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "TravelMode": { + "values": { + "TRAVEL_MODE_UNSPECIFIED": 0, + "DRIVE": 1, + "BICYCLE": 2, + "WALK": 3, + "TWO_WHEELER": 4 + } } } } diff --git a/packages/google-maps-places/samples/generated/v1/places.search_nearby.js b/packages/google-maps-places/samples/generated/v1/places.search_nearby.js index cb9c6a6f247..92f490100d6 100644 --- a/packages/google-maps-places/samples/generated/v1/places.search_nearby.js +++ b/packages/google-maps-places/samples/generated/v1/places.search_nearby.js @@ -131,6 +131,10 @@ function main(locationRestriction) { * How results will be ranked in the response. */ // const rankPreference = {} + /** + * Optional. Parameters that affect the routing to the search results. + */ + // const routingParameters = {} // Imports the Places library const {PlacesClient} = require('@googlemaps/places').v1; diff --git a/packages/google-maps-places/samples/generated/v1/places.search_text.js b/packages/google-maps-places/samples/generated/v1/places.search_text.js index c219bf23c12..a9b3d35bd9b 100644 --- a/packages/google-maps-places/samples/generated/v1/places.search_text.js +++ b/packages/google-maps-places/samples/generated/v1/places.search_text.js @@ -108,6 +108,14 @@ function main(textQuery) { * Optional. Set the searchable EV options of a place search request. */ // const evOptions = {} + /** + * Optional. Additional parameters for routing to results. + */ + // const routingParameters = {} + /** + * Optional. Additional parameters proto for searching along a route. + */ + // const searchAlongRouteParameters = {} // Imports the Places library const {PlacesClient} = require('@googlemaps/places').v1; diff --git a/packages/google-maps-places/samples/generated/v1/snippet_metadata_google.maps.places.v1.json b/packages/google-maps-places/samples/generated/v1/snippet_metadata_google.maps.places.v1.json index e9509fa94d0..1d9ebd2bc7e 100644 --- a/packages/google-maps-places/samples/generated/v1/snippet_metadata_google.maps.places.v1.json +++ b/packages/google-maps-places/samples/generated/v1/snippet_metadata_google.maps.places.v1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 152, + "end": 156, "type": "FULL" } ], @@ -66,6 +66,10 @@ { "name": "rank_preference", "type": ".google.maps.places.v1.SearchNearbyRequest.RankPreference" + }, + { + "name": "routing_parameters", + "type": ".google.maps.places.v1.RoutingParameters" } ], "resultType": ".google.maps.places.v1.SearchNearbyResponse", @@ -94,7 +98,7 @@ "segments": [ { "start": 25, - "end": 129, + "end": 137, "type": "FULL" } ], @@ -154,6 +158,14 @@ { "name": "ev_options", "type": ".google.maps.places.v1.SearchTextRequest.EVOptions" + }, + { + "name": "routing_parameters", + "type": ".google.maps.places.v1.RoutingParameters" + }, + { + "name": "search_along_route_parameters", + "type": ".google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters" } ], "resultType": ".google.maps.places.v1.SearchTextResponse", diff --git a/packages/google-maps-places/src/v1/places_client.ts b/packages/google-maps-places/src/v1/places_client.ts index 0b1d9c22c4d..d8607754f4b 100644 --- a/packages/google-maps-places/src/v1/places_client.ts +++ b/packages/google-maps-places/src/v1/places_client.ts @@ -489,6 +489,8 @@ export class PlacesClient { * Required. The region to search. * @param {google.maps.places.v1.SearchNearbyRequest.RankPreference} request.rankPreference * How results will be ranked in the response. + * @param {google.maps.places.v1.RoutingParameters} [request.routingParameters] + * Optional. Parameters that affect the routing to the search results. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -623,6 +625,10 @@ export class PlacesClient { * with location_bias. * @param {google.maps.places.v1.SearchTextRequest.EVOptions} [request.evOptions] * Optional. Set the searchable EV options of a place search request. + * @param {google.maps.places.v1.RoutingParameters} [request.routingParameters] + * Optional. Additional parameters for routing to results. + * @param {google.maps.places.v1.SearchTextRequest.SearchAlongRouteParameters} [request.searchAlongRouteParameters] + * Optional. Additional parameters proto for searching along a route. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. diff --git a/packages/google-maps-places/src/v1/places_proto_list.json b/packages/google-maps-places/src/v1/places_proto_list.json index 241d296eaac..2b82d156d36 100644 --- a/packages/google-maps-places/src/v1/places_proto_list.json +++ b/packages/google-maps-places/src/v1/places_proto_list.json @@ -9,6 +9,11 @@ "../../protos/google/maps/places/v1/photo.proto", "../../protos/google/maps/places/v1/place.proto", "../../protos/google/maps/places/v1/places_service.proto", + "../../protos/google/maps/places/v1/polyline.proto", "../../protos/google/maps/places/v1/reference.proto", - "../../protos/google/maps/places/v1/review.proto" + "../../protos/google/maps/places/v1/review.proto", + "../../protos/google/maps/places/v1/route_modifiers.proto", + "../../protos/google/maps/places/v1/routing_preference.proto", + "../../protos/google/maps/places/v1/routing_summary.proto", + "../../protos/google/maps/places/v1/travel_mode.proto" ]