Skip to content

Commit

Permalink
feat: new features for Places GA
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 575913105
  • Loading branch information
Google APIs authored and Copybara-Service committed Oct 23, 2023
1 parent 3501865 commit 0d6992f
Show file tree
Hide file tree
Showing 10 changed files with 1,104 additions and 298 deletions.
113 changes: 101 additions & 12 deletions google/maps/places/v1/BUILD.bazel
Expand Up @@ -9,10 +9,14 @@
# * extra_protoc_file_parameters
# The complete list of preserved parameters can be found in the source code.

# This is an API workspace, having public visibility by default makes perfect sense.
package(default_visibility = ["//visibility:public"])

##############################################################################
# Common
##############################################################################
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
load(
"@com_google_googleapis_imports//:imports.bzl",
"cc_grpc_library",
Expand Down Expand Up @@ -45,24 +49,28 @@ load(
"ruby_proto_library",
)

# This is an API workspace, having public visibility by default makes perfect sense.
package(default_visibility = ["//visibility:public"])

proto_library(
name = "places_proto",
srcs = [
"attribution.proto",
"ev_charging.proto",
"fuel_options.proto",
"geometry.proto",
"photo.proto",
"place.proto",
"places_service.proto",
"review.proto",
],
deps = [
"//google/api:annotations_proto",
"//google/api:client_proto",
"//google/api:field_behavior_proto",
"//google/api:resource_proto",
"//google/geo/type:viewport_proto",
"//google/type:date_proto",
"//google/type:latlng_proto",
"//google/type:localized_text_proto",
"//google/type:money_proto",
"@com_google_protobuf//:timestamp_proto",
],
)
Expand All @@ -82,6 +90,18 @@ py_import(
],
)

##############################################################################
# Java
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"java_gapic_assembly_gradle_pkg",
"java_gapic_library",
"java_gapic_test",
"java_grpc_library",
"java_proto_library",
)

java_proto_library(
name = "places_java_proto",
deps = [":places_proto"],
Expand Down Expand Up @@ -132,6 +152,16 @@ java_gapic_assembly_gradle_pkg(
],
)

##############################################################################
# Go
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"go_gapic_assembly_pkg",
"go_gapic_library",
"go_proto_library",
)

go_proto_library(
name = "places_go_proto",
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
Expand All @@ -143,6 +173,7 @@ go_proto_library(
"//google/type:date_go_proto",
"//google/type:latlng_go_proto",
"//google/type:localized_text_go_proto",
"//google/type:money_go_proto",
],
)

Expand Down Expand Up @@ -173,18 +204,26 @@ go_gapic_assembly_pkg(
],
)

##############################################################################
# Python
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"py_gapic_assembly_pkg",
"py_gapic_library",
"py_test",
)

py_gapic_library(
name = "places_py_gapic",
srcs = [":places_proto"],
grpc_service_config = "places_grpc_service_config.json",
opt_args = [
"proto-plus-deps=google.geo.type",
],
opt_args = ["proto-plus-deps=google.geo.type"],
rest_numeric_enums = True,
service_yaml = "places_v1.yaml",
transport = "grpc+rest",
deps = [
":viewport",
":viewport"
],
)

Expand All @@ -195,9 +234,7 @@ py_test(
"places_py_gapic_test.py",
],
legacy_create_init = False,
deps = [
":places_py_gapic",
],
deps = [":places_py_gapic"],
)

# Open Source Packages
Expand All @@ -208,6 +245,16 @@ py_gapic_assembly_pkg(
],
)

##############################################################################
# PHP
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"php_gapic_assembly_pkg",
"php_gapic_library",
"php_proto_library",
)

php_proto_library(
name = "places_php_proto",
deps = [":places_proto"],
Expand All @@ -221,7 +268,9 @@ php_gapic_library(
rest_numeric_enums = True,
service_yaml = "places_v1.yaml",
transport = "grpc+rest",
deps = [":places_php_proto"],
deps = [
":places_php_proto",
],
)

# Open Source Packages
Expand All @@ -233,6 +282,15 @@ php_gapic_assembly_pkg(
],
)

##############################################################################
# Node.js
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"nodejs_gapic_assembly_pkg",
"nodejs_gapic_library",
)

nodejs_gapic_library(
name = "places_nodejs_gapic",
package_name = "@googlemaps/places",
Expand All @@ -251,10 +309,20 @@ nodejs_gapic_assembly_pkg(
deps = [
":places_nodejs_gapic",
":places_proto",
"//google/geo/type:viewport_proto",
],
)

##############################################################################
# Ruby
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"ruby_cloud_gapic_library",
"ruby_gapic_assembly_pkg",
"ruby_grpc_library",
"ruby_proto_library",
)

ruby_proto_library(
name = "places_ruby_proto",
deps = [":places_proto"],
Expand Down Expand Up @@ -290,8 +358,20 @@ ruby_gapic_assembly_pkg(
],
)

##############################################################################
# C#
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"csharp_gapic_assembly_pkg",
"csharp_gapic_library",
"csharp_grpc_library",
"csharp_proto_library",
)

csharp_proto_library(
name = "places_csharp_proto",
extra_opts = [],
deps = [":places_proto"],
)

Expand Down Expand Up @@ -324,6 +404,15 @@ csharp_gapic_assembly_pkg(
],
)

##############################################################################
# C++
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"cc_grpc_library",
"cc_proto_library",
)

cc_proto_library(
name = "places_cc_proto",
deps = [":places_proto"],
Expand Down
46 changes: 46 additions & 0 deletions google/maps/places/v1/attribution.proto
@@ -0,0 +1,46 @@
// Copyright 2023 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 = "AttributionProto";
option java_package = "com.google.maps.places.v1";
option objc_class_prefix = "GMPSV1";
option php_namespace = "Google\\Maps\\Places\\V1";

// Information about the author of the UGC data. Used in
// [Photo][google.maps.places.v1.Photo], and
// [Review][google.maps.places.v1.Review].
message AuthorAttribution {
// Output only. Name of the author of the [Photo][google.maps.places.v1.Photo]
// or [Review][google.maps.places.v1.Review].
string display_name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. URI of the author of the [Photo][google.maps.places.v1.Photo]
// or [Review][google.maps.places.v1.Review].
string uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Profile photo URI of the author of the
// [Photo][google.maps.places.v1.Photo] or
// [Review][google.maps.places.v1.Review].
string photo_uri = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
}
111 changes: 111 additions & 0 deletions google/maps/places/v1/ev_charging.proto
@@ -0,0 +1,111 @@
// Copyright 2023 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/timestamp.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 = "EvChargingProto";
option java_package = "com.google.maps.places.v1";
option objc_class_prefix = "GMPSV1";
option php_namespace = "Google\\Maps\\Places\\V1";

// Information about the EV Charge Station hosted in Place.
// Terminology follows
// https://afdc.energy.gov/fuels/electricity_infrastructure.html One port
// could charge one car at a time. One port has one or more connectors. One
// station has one or more ports.
message EVChargeOptions {
// EV charging information grouped by [type, max_charge_rate_kw].
// Shows EV charge aggregation of connectors that have the same type and max
// charge rate in kw.
message ConnectorAggregation {
// The connector type of this aggregation.
EVConnectorType type = 1;

// The static max charging rate in kw of each connector in the aggregation.
double max_charge_rate_kw = 2;

// Number of connectors in this aggregation.
int32 count = 3;

// Number of connectors in this aggregation that are currently available.
optional int32 available_count = 4;

// Number of connectors in this aggregation that are currently out of
// service.
optional int32 out_of_service_count = 5;

// The timestamp when the connector availability information in this
// aggregation was last updated.
google.protobuf.Timestamp availability_last_update_time = 6;
}

// Number of connectors at this station. However, because some ports can have
// multiple connectors but only be able to charge one car at a time (e.g.) the
// number of connectors may be greater than the total number of cars which can
// charge simultaneously.
int32 connector_count = 1;

// A list of EV charging connector aggregations that contain connectors of the
// same type and same charge rate.
repeated ConnectorAggregation connector_aggregation = 2;
}

// See http://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=6872107 for
// additional information/context on EV charging connector types.
enum EVConnectorType {
// Unspecified connector.
EV_CONNECTOR_TYPE_UNSPECIFIED = 0;

// Other connector types.
EV_CONNECTOR_TYPE_OTHER = 1;

// J1772 type 1 connector.
EV_CONNECTOR_TYPE_J1772 = 2;

// IEC 62196 type 2 connector. Often referred to as MENNEKES.
EV_CONNECTOR_TYPE_TYPE_2 = 3;

// CHAdeMO type connector.
EV_CONNECTOR_TYPE_CHADEMO = 4;

// Combined Charging System (AC and DC). Based on SAE.
// Type-1 J-1772 connector
EV_CONNECTOR_TYPE_CCS_COMBO_1 = 5;

// Combined Charging System (AC and DC). Based on Type-2
// Mennekes connector
EV_CONNECTOR_TYPE_CCS_COMBO_2 = 6;

// The generic TESLA connector. This is NACS in the North America but can be
// non-NACS in other parts of the world (e.g. CCS Combo 2 (CCS2) or GB/T).
// This value is less representative of an actual connector type, and more
// represents the ability to charge a Tesla brand vehicle at a Tesla owned
// charging station.
EV_CONNECTOR_TYPE_TESLA = 7;

// GB/T type corresponds to the GB/T standard in China. This type covers all
// GB_T types.
EV_CONNECTOR_TYPE_UNSPECIFIED_GB_T = 8;

// Unspecified wall outlet.
EV_CONNECTOR_TYPE_UNSPECIFIED_WALL_OUTLET = 9;
}

0 comments on commit 0d6992f

Please sign in to comment.