Skip to content

Commit

Permalink
fix(locations): add service yaml, BUILD.bazel, and update proto
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 354631133
  • Loading branch information
Google APIs authored and Copybara-Service committed Jan 30, 2021
1 parent c71a9c4 commit aa23780
Show file tree
Hide file tree
Showing 3 changed files with 206 additions and 9 deletions.
166 changes: 166 additions & 0 deletions google/cloud/location/BUILD.bazel
@@ -0,0 +1,166 @@
# This file was automatically generated by BuildFileGenerator

# 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")

proto_library(
name = "location_proto",
srcs = [
"locations.proto",
],
deps = [
"//google/api:annotations_proto",
"//google/api:client_proto",
"@com_google_protobuf//:any_proto",
],
)

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

java_proto_library(
name = "location_java_proto",
deps = [":location_proto"],
)

java_grpc_library(
name = "location_java_grpc",
srcs = [":location_proto"],
deps = [":location_java_proto"],
)

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

go_proto_library(
name = "location_go_proto",
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
importpath = "google.golang.org/genproto/googleapis/cloud/location",
protos = [":location_proto"],
deps = [
"//google/api:annotations_go_proto",
],
)

##############################################################################
# Python
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"moved_proto_library",
"py_grpc_library",
"py_proto_library",
)

moved_proto_library(
name = "location_moved_proto",
srcs = [":location_proto"],
deps = [
"//google/api:annotations_proto",
"//google/api:client_proto",
"@com_google_protobuf//:any_proto",
],
)

py_proto_library(
name = "location_py_proto",
plugin = "@protoc_docs_plugin//:docs_plugin",
deps = [":location_moved_proto"],
)

py_grpc_library(
name = "location_py_grpc",
srcs = [":location_moved_proto"],
deps = [":location_py_proto"],
)

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

php_proto_library(
name = "location_php_proto",
deps = [":location_proto"],
)

php_grpc_library(
name = "location_php_grpc",
srcs = [":location_proto"],
deps = [":location_php_proto"],
)

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


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

ruby_proto_library(
name = "location_ruby_proto",
deps = [":location_proto"],
)

ruby_grpc_library(
name = "location_ruby_grpc",
srcs = [":location_proto"],
deps = [":location_ruby_proto"],
)

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

csharp_proto_library(
name = "location_csharp_proto",
deps = [":location_proto"],
)

csharp_grpc_library(
name = "location_csharp_grpc",
srcs = [":location_proto"],
deps = [":location_csharp_proto"],
)

##############################################################################
# C++
##############################################################################
# Put your C++ code here
24 changes: 24 additions & 0 deletions google/cloud/location/cloud.yaml
@@ -0,0 +1,24 @@
type: google.api.Service
config_version: 3
name: cloud.googleapis.com
title: Cloud Metadata API

apis:
- name: google.cloud.location.Locations

documentation:
summary: |-
This API provides static metadata about Google Cloud Platform. Currently,
it only provides basic information about Google Cloud locations, such as
zones, regions, and countries.
authentication:
rules:
- selector: google.cloud.location.Locations.GetLocation
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
- selector: google.cloud.location.Locations.ListLocations
oauth:
canonical_scopes: |-
https://www.googleapis.com/auth/cloud-platform
25 changes: 16 additions & 9 deletions google/cloud/location/locations.proto
@@ -1,4 +1,4 @@
// Copyright 2018 Google Inc.
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -18,6 +18,7 @@ package google.cloud.location;

import "google/api/annotations.proto";
import "google/protobuf/any.proto";
import "google/api/client.proto";

option cc_enable_arenas = true;
option go_package = "google.golang.org/genproto/googleapis/cloud/location;location";
Expand All @@ -29,23 +30,31 @@ option java_package = "com.google.cloud.location";
// a service. Service-specific metadata is provided through the
// [Location.metadata][google.cloud.location.Location.metadata] field.
service Locations {
option (google.api.default_host) = "cloud.googleapis.com";
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";

// Lists information about the supported locations for this service.
rpc ListLocations(ListLocationsRequest) returns (ListLocationsResponse) {
option (google.api.http) = {
get: "/v1/{name=projects/*}/locations"
get: "/v1/{name=locations}"
additional_bindings {
get: "/v1/{name=projects/*}/locations"
}
};
}

// Gets information about a location.
rpc GetLocation(GetLocationRequest) returns (Location) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*}"
get: "/v1/{name=locations/*}"
additional_bindings {
get: "/v1/{name=projects/*/locations/*}"
}
};
}
}

// The request message for
// [Locations.ListLocations][google.cloud.location.Locations.ListLocations].
// The request message for [Locations.ListLocations][google.cloud.location.Locations.ListLocations].
message ListLocationsRequest {
// The resource that owns the locations collection, if applicable.
string name = 1;
Expand All @@ -60,8 +69,7 @@ message ListLocationsRequest {
string page_token = 4;
}

// The response message for
// [Locations.ListLocations][google.cloud.location.Locations.ListLocations].
// The response message for [Locations.ListLocations][google.cloud.location.Locations.ListLocations].
message ListLocationsResponse {
// A list of locations that matches the specified filter in the request.
repeated Location locations = 1;
Expand All @@ -70,8 +78,7 @@ message ListLocationsResponse {
string next_page_token = 2;
}

// The request message for
// [Locations.GetLocation][google.cloud.location.Locations.GetLocation].
// The request message for [Locations.GetLocation][google.cloud.location.Locations.GetLocation].
message GetLocationRequest {
// Resource name for the location.
string name = 1;
Expand Down

0 comments on commit aa23780

Please sign in to comment.