8000 fix!: [google-maps-places] An existing field `description` is removed… · googleapis/google-cloud-python@657feee · GitHub
[go: up one dir, main page]

Skip to content

Commit 657feee

Browse files
fix!: [google-maps-places] An existing field description is removed from message .google.maps.places.v1.Place (#13895)
BEGIN_COMMIT_OVERRIDE fix!: An existing field `description` is removed from message `.google.maps.places.v1.Place` fix!: An existing field `references` is removed from message `.google.maps.places.v1.Place` fix!: An existing message `AreaSummary` is removed fix!: An existing field `area_summary` is removed from message `.google.maps.places.v1.Place` docs: change comments for some fields in Places API feat: add address descriptor proto feat: add new photo fields feat: update GenerativeSummary fields feat: add new GoogleMapsLinks fields feat: add new NeighborhoodSummary fields feat: add new ReviewSummary fields feat: add new review fields END_COMMIT_OVERRIDE - [ ] Regenerate this pull request now. fix!: An existing field `references` is removed from message `.google.maps.places.v1.Place` fix!: An existing message `AreaSummary` is removed fix!: An existing field `area_summary` is removed from message `.google.maps.places.v1.Place` docs: change comments for some fields in Places API feat: add address descriptor proto feat: add new photo fields feat: update GenerativeSummary fields feat: add new GoogleMapsLinks fields feat: add new NeighborhoodSummary fields feat: add new ReviewSummary fields feat: add new review fields PiperOrigin-RevId: 757991647 Source-Link: googleapis/googleapis@6942862 Source-Link: googleapis/googleapis-gen@b9ccfd2 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtcGxhY2VzLy5Pd2xCb3QueWFtbCIsImgiOiJiOWNjZmQyNzM1MDUxOGFkY2QzOTg4MDEzNDE5OTc5NWM3OTViMWQ4In0= --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 673b3a2 commit 657feee

File tree

10 files changed

+458
-64
lines changed

10 files changed

+458
-64
lines changed

packages/google-maps-places/google/maps/places/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
from google.maps.places_v1.services.places.async_client import PlacesAsyncClient
2222
from google.maps.places_v1.services.places.client import PlacesClient
23+
from google.maps.places_v1.types.address_descriptor import AddressDescriptor
2324
from google.maps.places_v1.types.attribution import AuthorAttribution
2425
from google.maps.places_v1.types.content_block import ContentBlock
2526
from google.maps.places_v1.types.contextual_content import ContextualContent
@@ -52,6 +53,7 @@
5253
__all__ = (
5354
"PlacesClient",
5455
"PlacesAsyncClient",
56+
"AddressDescriptor",
5557
"AuthorAttribution",
5658
"ContentBlock",
5759
"ContextualContent",

packages/google-maps-places/google/maps/places_v1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020

2121
from .services.places import PlacesAsyncClient, PlacesClient
22+
from .types.address_descriptor import AddressDescriptor
2223
from .types.attribution import AuthorAttribution
2324
from .types.content_block import ContentBlock
2425
from .types.contextual_content import ContextualContent
@@ -50,6 +51,7 @@
5051

5152
__all__ = (
5253
"PlacesAsyncClient",
54+
"AddressDescriptor",
5355
"AuthorAttribution",
5456
"AutocompletePlacesRequest",
5557
"AutocompletePlacesResponse",

packages/google-maps-places/google/maps/places_v1/services/places/async_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
from google.type import postal_address_pb2 # type: ignore
5252

5353
from google.maps.places_v1.types import (
54+
address_descriptor,
5455
contextual_content,
5556
ev_charging,
5657
fuel_options,

packages/google-maps-places/google/maps/places_v1/services/places/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
from google.type import postal_address_pb2 # type: ignore
6969

7070
from google.maps.places_v1.types import (
71+
address_descriptor,
7172
contextual_content,
7273
ev_charging,
7374
fuel_options,

packages/google-maps-places/google/maps/places_v1/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16+
from .address_descriptor import AddressDescriptor
1617
from .attribution import AuthorAttribution
1718
from .content_block import ContentBlock
1819
from .contextual_content import ContextualContent
@@ -43,6 +44,7 @@
4344
from .travel_mode import TravelMode
4445

4546
__all__ = (
47+
"AddressDescriptor",
4648
"AuthorAttribution",
4749
"ContentBlock",
4850
"ContextualContent",
Lines changed: 226 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,226 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2025 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
from __future__ import annotations
17+
18+
from typing import MutableMapping, MutableSequence
19+
20+
from google.type import localized_text_pb2 # type: ignore
21+
import proto # type: ignore
22+
23+
__protobuf__ = proto.module(
24+
package="google.maps.places.v1",
25+
manifest={
26+
"AddressDescriptor",
27+
},
28+
)
29+
30+
31+
class AddressDescriptor(proto.Message):
32+
r"""A relational description of a location. Includes a ranked set
33+
of nearby landmarks and precise containing areas and their
34+
relationship to the target location.
35+
36+
Attributes:
37+
landmarks (MutableSequence[google.maps.places_v1.types.AddressDescriptor.Landmark]):
38+
A ranked list of nearby landmarks. The most
39+
recognizable and nearby landmarks are ranked
40+
first.
41+
areas (MutableSequence[google.maps.places_v1.types.AddressDescriptor.Area]):
42+
A ranked list of containing or adjacent
43+
areas. The most recognizable and precise areas
44+
are ranked first.
45+
"""
46+
47+
class Landmark(proto.Message):
48+
r"""Basic landmark information and the landmark's relationship
49+
with the target location.
50+
51+
Landmarks are prominent places that can be used to describe a
52+
location.
53+
54+
55+
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
56+
57+
Attributes:
58+
name (str):
59+
The landmark's resource name.
60+
place_id (str):
61+
The landmark's place id.
62+
display_name (google.type.localized_text_pb2.LocalizedText):
63+
The landmark's display name.
64+
types (MutableSequence[str]):
65+
A set of type tags for this landmark. For a
66+
complete list of possible values, see
67+
https://developers.google.com/maps/documentation/places/web-service/place-types.
68+
spatial_relationship (google.maps.places_v1.types.AddressDescriptor.Landmark.SpatialRelationship):
69+
Defines the spatial relationship between the
70+
target location and the landmark.
71+
straight_line_distance_meters (float):
72+
The straight line distance, in meters, between the center
73+
point of the target and the center point of the landmark. In
74+
some situations, this value can be longer than
75+
``travel_distance_meters``.
76+
travel_distance_meters (float):
77+
The travel distance, in meters, along the
78+
road network from the target to the landmark, if
79+
known. This value does not take into account the
80+
mode of transportation, such as walking,
81+
driving, or biking.
82+
83+
This field is a member of `oneof`_ ``_travel_distance_meters``.
84+
"""
85+
86+
class SpatialRelationship(proto.Enum):
87+
r"""Defines the spatial relationship between the target location
88+
and the landmark.
89+
90+
Values:
91+
NEAR (0):
92+
This is the default relationship when nothing
93+
more specific below applies.
94+
WITHIN (1):
95+
The landmark has a spatial geometry and the
96+
target is within its bounds.
97+
BESIDE (2):
98+
The target is directly adjacent to the
99+
landmark.
100+
ACROSS_THE_ROAD (3):
101+
The target is directly opposite the landmark
102+
on the other side of the road.
103+
DOWN_THE_ROAD (4):
104+
On the same route as the landmark but not
105+
besides or across.
106+
AROUND_THE_CORNER (5):
107+
Not on the same route as the landmark but a
108+
single turn away.
109+
BEHIND (6):
110+
Close to the landmark's structure but further
111+
away from its street entrances.
112+
"""
113+
NEAR = 0
114+
WITHIN = 1
115+
BESIDE = 2
116+
ACROSS_THE_ROAD = 3
117+
DOWN_THE_ROAD = 4
118+
AROUND_THE_CORNER = 5
119+
BEHIND = 6
120+
121+
name: str = proto.Field(
122+
proto.STRING,
123+
number=1,
124+
)
125+
place_id: str = proto.Field(
126+
proto.STRING,
127+
number=2,
128+
)
129+
display_name: localized_text_pb2.LocalizedText = proto.Field(
130+
proto.MESSAGE,
131+
number=3,
132+
message=localized_text_pb2.LocalizedText,
133+
)
134+
types: MutableSequence[str] = proto.RepeatedField(
135+
proto.STRING,
136+
number=4,
137+
)
138+
spatial_relationship: "AddressDescriptor.Landmark.SpatialRelationship" = (
139+
proto.Field(
140+
proto.ENUM,
141+
number=5,
142+
enum="AddressDescriptor.Landmark.SpatialRelationship",
143+
)
144+
)
145+
straight_line_distance_meters: float = proto.Field(
146+
proto.FLOAT,
147+
number=6,
148+
)
149+
travel_distance_meters: float = proto.Field(
150+
proto.FLOAT,
151+
number=7,
152+
optional=True,
153+
)
154+
155+
class Area(proto.Message):
156+
r"""Area information and the area's relationship with the target
157+
location.
158+
Areas includes precise sublocality, neighborhoods, and large
159+
compounds that are useful for describing a location.
160+
161+
Attributes:
162+
name (str):
163+
The area's resource name.
164+
place_id (str):
165+
The area's place id.
166+
display_name (google.type.localized_text_pb2.LocalizedText):
167+
The area's display name.
168+
containment (google.maps.places_v1.types.AddressDescriptor.Area.Containment):
169+
Defines the spatial relationship between the
170+
target location and the area.
171+
"""
172+
173+
class Containment(proto.Enum):
174+
r"""Defines the spatial relationship between the target location
175+
and the area.
176+
177+
Values:
178+
CONTAINMENT_UNSPECIFIED (0):
179+
The containment is unspecified.
180+
WITHIN (1):
181+
The target location is within the area
182+
region, close to the center.
183+
OUTSKIRTS (2):
184+
The target location is within the area
185+
region, close to the edge.
186+
NEAR (3):
187+
The target location is outside the area
188+
region, but close by.
189+
"""
190+
CONTAINMENT_UNSPECIFIED = 0
191+
WITHIN = 1
192+
OUTSKIRTS = 2
193+
NEAR = 3
194+
195+
name: str = proto.Field(
196+
proto.STRING,
197+
number=1,
198+
)
199+
place_id: str = proto.Field(
200+
proto.STRING,
201+
number=2,
202+
)
203+
display_name: localized_text_pb2.LocalizedText = proto.Field(
204+
proto.MESSAGE,
205+
number=3,
206+
message=localized_text_pb2.LocalizedText,
207+
)
208+
containment: "AddressDescriptor.Area.Containment" = proto.Field(
209+
proto.ENUM,
210+
number=4,
211+
enum="AddressDescriptor.Area.Containment",
212+
)
213+
214+
landmarks: MutableSequence[Landmark] = proto.RepeatedField(
215+
proto.MESSAGE,
216+
number=1,
217+
message=Landmark,
218+
)
219+
areas: MutableSequence[Area] = proto.RepeatedField(
220+
proto.MESSAGE,
221+
number=2,
222+
message=Area,
223+
)
224+
225+
226+
__all__ = tuple(sorted(__protobuf__.manifest))

packages/google-maps-places/google/maps/places_v1/types/photo.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ class Photo(proto.Message):
4444
The maximum available height, in pixels.
4545
author_attributions (MutableSequence[google.maps.places_v1.types.AuthorAttribution]):
4646
This photo's authors.
47+
flag_content_uri (str):
48+
A link where users can flag a problem with
49+
the photo.
50+
google_maps_uri (str):
51+
A link to show the photo on Google Maps.
4752
"""
4853

4954
name: str = proto.Field(
@@ -65,6 +70,14 @@ class Photo(proto.Message):
6570
number=4,
6671
message=attribution.AuthorAttribution,
6772
)
73+
flag_content_uri: str = proto.Field(
74+
proto.STRING,
75+
number=5,
76+
)
77+
google_maps_uri: str = proto.Field(
78+
proto.STRING,
79+
number=6,
80+
)
6881

6982

7083
__all__ = tuple(sorted(__protobuf__.manifest))

0 commit comments

Comments
 (0)
0