Skip to content

Commit 33da0f1

Browse files
feat: Automated regeneration of Places client (googleapis#12182)
Auto-created at 2024-09-20 13:14:45 +0000 using the toys pull request generator.
1 parent 538b966 commit 33da0f1

13 files changed

+341
-6
lines changed

clients/places/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Install this package from [Hex](https://hex.pm) by adding
1111

1212
```elixir
1313
def deps do
14-
[{:google_api_places, "~> 0.5"}]
14+
[{:google_api_places, "~> 0.6"}]
1515
end
1616
```
1717

clients/places/lib/google_api/places/v1/metadata.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ defmodule GoogleApi.Places.V1 do
2020
API client metadata for GoogleApi.Places.V1.
2121
"""
2222

23-
@discovery_revision "20240825"
23+
@discovery_revision "20240918"
2424

2525
def discovery_revision(), do: @discovery_revision
2626
end
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Copyright 2019 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# NOTE: This file is auto generated by the elixir code generator program.
16+
# Do not edit this file manually.
17+
18+
defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Polyline do
19+
@moduledoc """
20+
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.
21+
22+
## Attributes
23+
24+
* `encodedPolyline` (*type:* `String.t`, *default:* `nil`) - 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.
25+
"""
26+
27+
use GoogleApi.Gax.ModelBase
28+
29+
@type t :: %__MODULE__{
30+
:encodedPolyline => String.t() | nil
31+
}
32+
33+
field(:encodedPolyline)
34+
end
35+
36+
defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Polyline do
37+
def decode(value, options) do
38+
GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Polyline.decode(value, options)
39+
end
40+
end
41+
42+
defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Polyline do
43+
def encode(value, options) do
44+
GoogleApi.Gax.ModelBase.encode(value, options)
45+
end
46+
end
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Copyright 2019 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# NOTE: This file is auto generated by the elixir code generator program.
16+
# Do not edit this file manually.
17+
18+
defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RouteModifiers do
19+
@moduledoc """
20+
Encapsulates a set of optional conditions to satisfy when calculating the routes.
21+
22+
## Attributes
23+
24+
* `avoidFerries` (*type:* `boolean()`, *default:* `nil`) - 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`.
25+
* `avoidHighways` (*type:* `boolean()`, *default:* `nil`) - 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`.
26+
* `avoidIndoor` (*type:* `boolean()`, *default:* `nil`) - Optional. When set to true, avoids navigating indoors where reasonable, giving preference to routes not containing indoor navigation. Applies only to the `WALK` `TravelMode`.
27+
* `avoidTolls` (*type:* `boolean()`, *default:* `nil`) - 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`.
28+
"""
29+
30+
use GoogleApi.Gax.ModelBase
31+
32+
@type t :: %__MODULE__{
33+
:avoidFerries => boolean() | nil,
34+
:avoidHighways => boolean() | nil,
35+
:avoidIndoor => boolean() | nil,
36+
:avoidTolls => boolean() | nil
37+
}
38+
39+
field(:avoidFerries)
40+
field(:avoidHighways)
41+
field(:avoidIndoor)
42+
field(:avoidTolls)
43+
end
44+
45+
defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RouteModifiers do
46+
def decode(value, options) do
47+
GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RouteModifiers.decode(value, options)
48+
end
49+
end
50+
51+
defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RouteModifiers do
52+
def encode(value, options) do
53+
GoogleApi.Gax.ModelBase.encode(value, options)
54+
end
55+
end
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Copyright 2019 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# NOTE: This file is auto generated by the elixir code generator program.
16+
# Do not edit this file manually.
17+
18+
defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingParameters do
19+
@moduledoc """
20+
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.
21+
22+
## Attributes
23+
24+
* `origin` (*type:* `GoogleApi.Places.V1.Model.GoogleTypeLatLng.t`, *default:* `nil`) - Optional. An explicit routing origin that overrides the origin defined in the polyline. By default, the polyline origin is used.
25+
* `routeModifiers` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RouteModifiers.t`, *default:* `nil`) - Optional. The route modifiers.
26+
* `routingPreference` (*type:* `String.t`, *default:* `nil`) - 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`.
27+
* `travelMode` (*type:* `String.t`, *default:* `nil`) - Optional. The travel mode.
28+
"""
29+
30+
use GoogleApi.Gax.ModelBase
31+
32+
@type t :: %__MODULE__{
33+
:origin => GoogleApi.Places.V1.Model.GoogleTypeLatLng.t() | nil,
34+
:routeModifiers => GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RouteModifiers.t() | nil,
35+
:routingPreference => String.t() | nil,
36+
:travelMode => String.t() | nil
37+
}
38+
39+
field(:origin, as: GoogleApi.Places.V1.Model.GoogleTypeLatLng)
40+
field(:routeModifiers, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RouteModifiers)
41+
field(:routingPreference)
42+
field(:travelMode)
43+
end
44+
45+
defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingParameters do
46+
def decode(value, options) do
47+
GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingParameters.decode(value, options)
48+
end
49+
end
50+
51+
defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingParameters do
52+
def encode(value, options) do
53+
GoogleApi.Gax.ModelBase.encode(value, options)
54+
end
55+
end
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Copyright 2019 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# NOTE: This file is auto generated by the elixir code generator program.
16+
# Do not edit this file manually.
17+
18+
defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingSummary do
19+
@moduledoc """
20+
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.
21+
22+
## Attributes
23+
24+
* `legs` (*type:* `list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingSummaryLeg.t)`, *default:* `nil`) - 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.
25+
"""
26+
27+
use GoogleApi.Gax.ModelBase
28+
29+
@type t :: %__MODULE__{
30+
:legs => list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingSummaryLeg.t()) | nil
31+
}
32+
33+
field(:legs, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingSummaryLeg, type: :list)
34+
end
35+
36+
defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingSummary do
37+
def decode(value, options) do
38+
GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingSummary.decode(value, options)
39+
end
40+
end
41+
42+
defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingSummary do
43+
def encode(value, options) do
44+
GoogleApi.Gax.ModelBase.encode(value, options)
45+
end
46+
end
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright 2019 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# NOTE: This file is auto generated by the elixir code generator program.
16+
# Do not edit this file manually.
17+
18+
defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingSummaryLeg do
19+
@moduledoc """
20+
A leg is a single portion of a journey from one location to another.
21+
22+
## Attributes
23+
24+
* `distanceMeters` (*type:* `integer()`, *default:* `nil`) - The distance of this leg of the trip.
25+
* `duration` (*type:* `String.t`, *default:* `nil`) - The time it takes to complete this leg of the trip.
26+
"""
27+
28+
use GoogleApi.Gax.ModelBase
29+
30+
@type t :: %__MODULE__{
31+
:distanceMeters => integer() | nil,
32+
:duration => String.t() | nil
33+
}
34+
35+
field(:distanceMeters)
36+
field(:duration)
37+
end
38+
39+
defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingSummaryLeg do
40+
def decode(value, options) do
41+
GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingSummaryLeg.decode(value, options)
42+
end
43+
end
44+
45+
defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingSummaryLeg do
46+
def encode(value, options) do
47+
GoogleApi.Gax.ModelBase.encode(value, options)
48+
end
49+
end

clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_nearby_request.ex

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchNearbyRequest do
3030
* `maxResultCount` (*type:* `integer()`, *default:* `nil`) - Maximum number of results to return. It must be between 1 and 20 (default), inclusively. If the number is unset, it falls back to the upper limit. If the number is set to negative or exceeds the upper limit, an INVALID_ARGUMENT error is returned.
3131
* `rankPreference` (*type:* `String.t`, *default:* `nil`) - How results will be ranked in the response.
3232
* `regionCode` (*type:* `String.t`, *default:* `nil`) - The Unicode country/region code (CLDR) of the location where the request is coming from. This parameter is used to display the place details, like region-specific place name, if available. The parameter can affect results based on applicable law. For more information, see https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html. Note that 3-digit region codes are not currently supported.
33+
* `routingParameters` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingParameters.t`, *default:* `nil`) - Optional. Parameters that affect the routing to the search results.
3334
"""
3435

3536
use GoogleApi.Gax.ModelBase
@@ -45,7 +46,9 @@ defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchNearbyRequest do
4546
| nil,
4647
:maxResultCount => integer() | nil,
4748
:rankPreference => String.t() | nil,
48-
:regionCode => String.t() | nil
49+
:regionCode => String.t() | nil,
50+
:routingParameters =>
51+
GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingParameters.t() | nil
4952
}
5053

5154
field(:excludedPrimaryTypes, type: :list)
@@ -61,6 +64,7 @@ defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchNearbyRequest do
6164
field(:maxResultCount)
6265
field(:rankPreference)
6366
field(:regionCode)
67+
field(:routingParameters, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingParameters)
6468
end
6569

6670
defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchNearbyRequest do

clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_nearby_response.ex

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,23 @@ defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchNearbyResponse do
2222
## Attributes
2323
2424
* `places` (*type:* `list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Place.t)`, *default:* `nil`) - A list of places that meets user's requirements like places types, number of places and specific location restriction.
25+
* `routingSummaries` (*type:* `list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingSummary.t)`, *default:* `nil`) - 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.
2526
"""
2627

2728
use GoogleApi.Gax.ModelBase
2829

2930
@type t :: %__MODULE__{
30-
:places => list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Place.t()) | nil
31+
:places => list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Place.t()) | nil,
32+
:routingSummaries =>
33+
list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingSummary.t()) | nil
3134
}
3235

3336
field(:places, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Place, type: :list)
37+
38+
field(:routingSummaries,
39+
as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingSummary,
40+
type: :list
41+
)
3442
end
3543

3644
defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchNearbyResponse do

clients/places/lib/google_api/places/v1/model/google_maps_places_v1_search_text_request.ex

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequest do
3434
* `priceLevels` (*type:* `list(String.t)`, *default:* `nil`) - Used to restrict the search to places that are marked as certain price levels. Users can choose any combinations of price levels. Default to select all price levels.
3535
* `rankPreference` (*type:* `String.t`, *default:* `nil`) - How results will be ranked in the response.
3636
* `regionCode` (*type:* `String.t`, *default:* `nil`) - The Unicode country/region code (CLDR) of the location where the request is coming from. This parameter is used to display the place details, like region-specific place name, if available. The parameter can affect results based on applicable law. For more information, see https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html. Note that 3-digit region codes are not currently supported.
37+
* `routingParameters` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingParameters.t`, *default:* `nil`) - Optional. Additional parameters for routing to results.
38+
* `searchAlongRouteParameters` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequestSearchAlongRouteParameters.t`, *default:* `nil`) - Optional. Additional parameters proto for searching along a route.
3739
* `strictTypeFiltering` (*type:* `boolean()`, *default:* `nil`) - Used to set strict type filtering for included_type. If set to true, only results of the same type will be returned. Default to false.
3840
* `textQuery` (*type:* `String.t`, *default:* `nil`) - Required. The text query for textual search.
3941
"""
@@ -58,6 +60,11 @@ defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequest do
5860
:priceLevels => list(String.t()) | nil,
5961
:rankPreference => String.t() | nil,
6062
:regionCode => String.t() | nil,
63+
:routingParameters =>
64+
GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingParameters.t() | nil,
65+
:searchAlongRouteParameters =>
66+
GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequestSearchAlongRouteParameters.t()
67+
| nil,
6168
:strictTypeFiltering => boolean() | nil,
6269
:textQuery => String.t() | nil
6370
}
@@ -82,6 +89,12 @@ defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequest do
8289
field(:priceLevels, type: :list)
8390
field(:rankPreference)
8491
field(:regionCode)
92+
field(:routingParameters, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingParameters)
93+
94+
field(:searchAlongRouteParameters,
95+
as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextRequestSearchAlongRouteParameters
96+
)
97+
8598
field(:strictTypeFiltering)
8699
field(:textQuery)
87100
end

0 commit comments

Comments
 (0)