Skip to content

Commit

Permalink
feat: Automated regeneration of Places client
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation committed Oct 30, 2024
1 parent db6044d commit 6dd4f81
Show file tree
Hide file tree
Showing 11 changed files with 96 additions and 6 deletions.
2 changes: 1 addition & 1 deletion clients/places/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Install this package from [Hex](https://hex.pm) by adding

```elixir
def deps do
[{:google_api_places, "~> 0.8"}]
[{:google_api_places, "~> 0.9"}]
end
```

Expand Down
2 changes: 1 addition & 1 deletion clients/places/lib/google_api/places/v1/metadata.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GoogleApi.Places.V1 do
API client metadata for GoogleApi.Places.V1.
"""

@discovery_revision "20241022"
@discovery_revision "20241028"

def discovery_revision(), do: @discovery_revision
end
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Photo do
## Attributes
* `authorAttributions` (*type:* `list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AuthorAttribution.t)`, *default:* `nil`) - This photo's authors.
* `flagContentUri` (*type:* `String.t`, *default:* `nil`) - A link where users can flag a problem with the photo.
* `googleMapsUri` (*type:* `String.t`, *default:* `nil`) - A link to show the photo on Google Maps.
* `heightPx` (*type:* `integer()`, *default:* `nil`) - The maximum available height, in pixels.
* `name` (*type:* `String.t`, *default:* `nil`) - Identifier. A reference representing this place photo which may be used to look up this place photo again (also called the API "resource" name: `places/{place_id}/photos/{photo}`).
* `widthPx` (*type:* `integer()`, *default:* `nil`) - The maximum available width, in pixels.
Expand All @@ -32,6 +34,8 @@ defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Photo do
@type t :: %__MODULE__{
:authorAttributions =>
list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AuthorAttribution.t()) | nil,
:flagContentUri => String.t() | nil,
:googleMapsUri => String.t() | nil,
:heightPx => integer() | nil,
:name => String.t() | nil,
:widthPx => integer() | nil
Expand All @@ -42,6 +46,8 @@ defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Photo do
type: :list
)

field(:flagContentUri)
field(:googleMapsUri)
field(:heightPx)
field(:name)
field(:widthPx)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Place do
* `parkingOptions` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceParkingOptions.t`, *default:* `nil`) - Options of parking provided by the place.
* `adrFormatAddress` (*type:* `String.t`, *default:* `nil`) - The place's address in adr microformat: http://microformats.org/wiki/adr.
* `id` (*type:* `String.t`, *default:* `nil`) - The unique identifier of a place.
* `googleMapsLinks` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceGoogleMapsLinks.t`, *default:* `nil`) - Links to trigger different Google Maps actions.
"""

use GoogleApi.Gax.ModelBase
Expand Down Expand Up @@ -166,7 +167,9 @@ defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Place do
:parkingOptions =>
GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceParkingOptions.t() | nil,
:adrFormatAddress => String.t() | nil,
:id => String.t() | nil
:id => String.t() | nil,
:googleMapsLinks =>
GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceGoogleMapsLinks.t() | nil
}

field(:liveMusic)
Expand Down Expand Up @@ -264,6 +267,7 @@ defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Place do
field(:parkingOptions, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceParkingOptions)
field(:adrFormatAddress)
field(:id)
field(:googleMapsLinks, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceGoogleMapsLinks)
end

defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Place do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,19 @@ defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceAreaSummary do
## Attributes
* `contentBlocks` (*type:* `list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1ContentBlock.t)`, *default:* `nil`) - Content blocks that compose the area summary. Each block has a separate topic about the area.
* `flagContentUri` (*type:* `String.t`, *default:* `nil`) - A link where users can flag a problem with the summary.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:contentBlocks =>
list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1ContentBlock.t()) | nil
list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1ContentBlock.t()) | nil,
:flagContentUri => String.t() | nil
}

field(:contentBlocks, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1ContentBlock, type: :list)
field(:flagContentUri)
end

defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceAreaSummary do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,26 @@ defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceGenerativeSummary do
## Attributes
* `description` (*type:* `GoogleApi.Places.V1.Model.GoogleTypeLocalizedText.t`, *default:* `nil`) - The detailed description of the place.
* `descriptionFlagContentUri` (*type:* `String.t`, *default:* `nil`) - A link where users can flag a problem with the description summary.
* `overview` (*type:* `GoogleApi.Places.V1.Model.GoogleTypeLocalizedText.t`, *default:* `nil`) - The overview of the place.
* `overviewFlagContentUri` (*type:* `String.t`, *default:* `nil`) - A link where users can flag a problem with the overview summary.
* `references` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1References.t`, *default:* `nil`) - References that are used to generate the summary description.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:description => GoogleApi.Places.V1.Model.GoogleTypeLocalizedText.t() | nil,
:descriptionFlagContentUri => String.t() | nil,
:overview => GoogleApi.Places.V1.Model.GoogleTypeLocalizedText.t() | nil,
:overviewFlagContentUri => String.t() | nil,
:references => GoogleApi.Places.V1.Model.GoogleMapsPlacesV1References.t() | nil
}

field(:description, as: GoogleApi.Places.V1.Model.GoogleTypeLocalizedText)
field(:descriptionFlagContentUri)
field(:overview, as: GoogleApi.Places.V1.Model.GoogleTypeLocalizedText)
field(:overviewFlagContentUri)
field(:references, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1References)
end

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Copyright 2019 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.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceGoogleMapsLinks do
@moduledoc """
Links to trigger different Google Maps actions.
## Attributes
* `directionsUri` (*type:* `String.t`, *default:* `nil`) - A link to show the directions to the place. The link only populates the destination location and uses the default travel mode `DRIVE`.
* `photosUri` (*type:* `String.t`, *default:* `nil`) - A link to show photos of this place. This link is currently not supported on Google Maps Mobile and only works on the web version of Google Maps.
* `placeUri` (*type:* `String.t`, *default:* `nil`) - A link to show this place.
* `reviewsUri` (*type:* `String.t`, *default:* `nil`) - A link to show reviews of this place. This link is currently not supported on Google Maps Mobile and only works on the web version of Google Maps.
* `writeAReviewUri` (*type:* `String.t`, *default:* `nil`) - A link to write a review for this place. This link is currently not supported on Google Maps Mobile and only works on the web version of Google Maps.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:directionsUri => String.t() | nil,
:photosUri => String.t() | nil,
:placeUri => String.t() | nil,
:reviewsUri => String.t() | nil,
:writeAReviewUri => String.t() | nil
}

field(:directionsUri)
field(:photosUri)
field(:placeUri)
field(:reviewsUri)
field(:writeAReviewUri)
end

defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceGoogleMapsLinks do
def decode(value, options) do
GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceGoogleMapsLinks.decode(value, options)
end
end

defimpl Poison.Encoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1PlaceGoogleMapsLinks do
def encode(value, options) do
GoogleApi.Gax.ModelBase.encode(value, options)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Review do
## Attributes
* `authorAttribution` (*type:* `GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AuthorAttribution.t`, *default:* `nil`) - This review's author.
* `flagContentUri` (*type:* `String.t`, *default:* `nil`) - A link where users can flag a problem with the review.
* `googleMapsUri` (*type:* `String.t`, *default:* `nil`) - A link to show the review on Google Maps.
* `name` (*type:* `String.t`, *default:* `nil`) - A reference representing this place review which may be used to look up this place review again (also called the API "resource" name: `places/{place_id}/reviews/{review}`).
* `originalText` (*type:* `GoogleApi.Places.V1.Model.GoogleTypeLocalizedText.t`, *default:* `nil`) - The review text in its original language.
* `publishTime` (*type:* `DateTime.t`, *default:* `nil`) - Timestamp for the review.
Expand All @@ -35,6 +37,8 @@ defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Review do
@type t :: %__MODULE__{
:authorAttribution =>
GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AuthorAttribution.t() | nil,
:flagContentUri => String.t() | nil,
:googleMapsUri => String.t() | nil,
:name => String.t() | nil,
:originalText => GoogleApi.Places.V1.Model.GoogleTypeLocalizedText.t() | nil,
:publishTime => DateTime.t() | nil,
Expand All @@ -44,6 +48,8 @@ defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Review do
}

field(:authorAttribution, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1AuthorAttribution)
field(:flagContentUri)
field(:googleMapsUri)
field(:name)
field(:originalText, as: GoogleApi.Places.V1.Model.GoogleTypeLocalizedText)
field(:publishTime, as: DateTime)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,18 @@ defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingSummary do
## Attributes
* `directionsUri` (*type:* `String.t`, *default:* `nil`) - A link to show directions on Google Maps using the waypoints from the given routing summary. The route generated by this link is not guaranteed to be the same as the route used to generate the routing summary. The link uses information provided in the request, from fields including `routingParameters` and `searchAlongRouteParameters` when applicable, to generate the directions link.
* `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.
"""

use GoogleApi.Gax.ModelBase

@type t :: %__MODULE__{
:directionsUri => String.t() | nil,
:legs => list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingSummaryLeg.t()) | nil
}

field(:directionsUri)
field(:legs, as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingSummaryLeg, type: :list)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextResponse do
* `nextPageToken` (*type:* `String.t`, *default:* `nil`) - A token that can be sent as `page_token` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages.
* `places` (*type:* `list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Place.t)`, *default:* `nil`) - A list of places that meet the user's text search criteria.
* `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 will have as many entries as the list of places if requested.
* `searchUri` (*type:* `String.t`, *default:* `nil`) - A link allows the user to search with the same text query as specified in the request on Google Maps.
"""

use GoogleApi.Gax.ModelBase
Expand All @@ -35,7 +36,8 @@ defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextResponse do
:nextPageToken => String.t() | nil,
:places => list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1Place.t()) | nil,
:routingSummaries =>
list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingSummary.t()) | nil
list(GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingSummary.t()) | nil,
:searchUri => String.t() | nil
}

field(:contextualContents,
Expand All @@ -50,6 +52,8 @@ defmodule GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextResponse do
as: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1RoutingSummary,
type: :list
)

field(:searchUri)
end

defimpl Poison.Decoder, for: GoogleApi.Places.V1.Model.GoogleMapsPlacesV1SearchTextResponse do
Expand Down
2 changes: 1 addition & 1 deletion clients/places/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
defmodule GoogleApi.Places.Mixfile do
use Mix.Project

@version "0.8.2"
@version "0.9.0"

def project() do
[
Expand Down

0 comments on commit 6dd4f81

Please sign in to comment.