aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGoogle APIs <noreply@google.com>2019-03-27 11:46:55 -0700
committerCopybara-Service <copybara-worker@google.com>2019-03-27 11:47:27 -0700
commit1119e688a00927cb02a2361929f0ca3190f88466 (patch)
tree9afb59b2cc6e586f96f52d807d2a369596e66eda
parentd4d57d766601105478c661132f2687e6984b92d5 (diff)
downloadgoogleapis-1119e688a00927cb02a2361929f0ca3190f88466.tar.gz
Synchronize new proto/yaml changes.
PiperOrigin-RevId: 240608914
-rw-r--r--google/example/library/BUILD.bazel1
-rw-r--r--google/example/library/artman_library_example_v1.yaml34
-rw-r--r--google/example/library/library.yaml7
-rw-r--r--google/example/library/library_example_v1.yaml41
-rwxr-xr-xgoogle/example/library/library_gapic.yaml188
-rw-r--r--google/example/library/v1/BUILD.bazel135
-rw-r--r--google/example/library/v1/library.proto87
-rw-r--r--google/example/library/v1/library_example_gapic.yaml260
8 files changed, 539 insertions, 214 deletions
diff --git a/google/example/library/BUILD.bazel b/google/example/library/BUILD.bazel
index e69de29bb..a87c57fec 100644
--- a/google/example/library/BUILD.bazel
+++ b/google/example/library/BUILD.bazel
@@ -0,0 +1 @@
+exports_files(glob(["*.yaml"]))
diff --git a/google/example/library/artman_library_example_v1.yaml b/google/example/library/artman_library_example_v1.yaml
new file mode 100644
index 000000000..3bc2fffb3
--- /dev/null
+++ b/google/example/library/artman_library_example_v1.yaml
@@ -0,0 +1,34 @@
+common:
+ api_name: library_example
+ api_version: v1
+ organization_name: google-cloud
+ proto_deps:
+ - name: google-common-protos
+ src_proto_paths:
+ - v1
+ service_yaml: library_example_v1.yaml
+ gapic_yaml: v1/library_example_gapic.yaml
+artifacts:
+- name: gapic_config
+ type: GAPIC_CONFIG
+- name: java_gapic
+ type: GAPIC
+ language: JAVA
+- name: python_gapic
+ type: GAPIC
+ language: PYTHON
+- name: nodejs_gapic
+ type: GAPIC
+ language: NODEJS
+- name: php_gapic
+ type: GAPIC
+ language: PHP
+- name: go_gapic
+ type: GAPIC
+ language: GO
+- name: ruby_gapic
+ type: GAPIC
+ language: RUBY
+- name: csharp_gapic
+ type: GAPIC
+ language: CSHARP
diff --git a/google/example/library/library.yaml b/google/example/library/library.yaml
deleted file mode 100644
index 56c6c021e..000000000
--- a/google/example/library/library.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
-type: google.api.Service
-config_version: 3
-name: library-example.googleapis.com
-title: Google Example Library API
-
-apis:
-- name: google.example.library.v1.LibraryService
diff --git a/google/example/library/library_example_v1.yaml b/google/example/library/library_example_v1.yaml
new file mode 100644
index 000000000..a1297cfa2
--- /dev/null
+++ b/google/example/library/library_example_v1.yaml
@@ -0,0 +1,41 @@
+type: google.api.Service
+config_version: 3
+name: library-example.googleapis.com
+title: Example Library API
+
+apis:
+- name: google.example.library.v1.LibraryService
+
+documentation:
+ summary: A simple Google Example Library API.
+ overview: |-
+ # Introduction
+
+ This is a Google example service representing a simple digital library. It
+ manages a collection of shelf resources, and each shelf owns a collection of
+ book resources.
+
+backend:
+ rules:
+ - selector: google.example.library.v1.LibraryService.CreateShelf
+ deadline: 10.0
+ - selector: google.example.library.v1.LibraryService.GetShelf
+ deadline: 10.0
+ - selector: google.example.library.v1.LibraryService.ListShelves
+ deadline: 10.0
+ - selector: google.example.library.v1.LibraryService.DeleteShelf
+ deadline: 10.0
+ - selector: google.example.library.v1.LibraryService.MergeShelves
+ deadline: 10.0
+ - selector: google.example.library.v1.LibraryService.CreateBook
+ deadline: 10.0
+ - selector: google.example.library.v1.LibraryService.GetBook
+ deadline: 10.0
+ - selector: google.example.library.v1.LibraryService.ListBooks
+ deadline: 10.0
+ - selector: google.example.library.v1.LibraryService.DeleteBook
+ deadline: 10.0
+ - selector: google.example.library.v1.LibraryService.UpdateBook
+ deadline: 10.0
+ - selector: google.example.library.v1.LibraryService.MoveBook
+ deadline: 10.0
diff --git a/google/example/library/library_gapic.yaml b/google/example/library/library_gapic.yaml
deleted file mode 100755
index 9f5aa5370..000000000
--- a/google/example/library/library_gapic.yaml
+++ /dev/null
@@ -1,188 +0,0 @@
-type: com.google.api.codegen.ConfigProto
-config_schema_version: 1.0.0
-license_header:
- copyright_file: copyright-google.txt
- license_file: license-header-apache-2.0.txt
-language_settings:
- java:
- package_name: com.google.cloud.example.library.spi.v1
- python:
- package_name: google.cloud.gapic.example.library.v1
- go:
- package_name: cloud.google.com/go/example/library/apiv1
- csharp:
- package_name: Google.Example.Library.V1
- ruby:
- package_name: Google::Cloud::Example::Library::V1
- php:
- package_name: Google\Cloud\Example\Library\V1
- nodejs:
- package_name: library.v1
-interfaces:
-- name: google.example.library.v1.LibraryService
- collections:
- - name_pattern: shelves/{shelf}
- entity_name: shelf
- - name_pattern: shelves/{shelf}/books/{book}
- entity_name: book
- retry_codes_def:
- - name: idempotent
- retry_codes:
- - UNAVAILABLE
- - DEADLINE_EXCEEDED
- - name: non_idempotent
- retry_codes: []
- retry_params_def:
- - name: default
- initial_retry_delay_millis: 100
- retry_delay_multiplier: 1.3
- max_retry_delay_millis: 60000
- initial_rpc_timeout_millis: 20000
- rpc_timeout_multiplier: 1
- max_rpc_timeout_millis: 20000
- total_timeout_millis: 600000
- methods:
- - name: CreateShelf
- flattening:
- groups:
- - parameters:
- - shelf
- required_fields:
- - shelf
- retry_codes_name: non_idempotent
- retry_params_name: default
- timeout_millis: 60000
- - name: GetShelf
- flattening:
- groups:
- - parameters:
- - name
- required_fields:
- - name
- retry_codes_name: idempotent
- retry_params_name: default
- field_name_patterns:
- name: shelf
- timeout_millis: 60000
- - name: ListShelves
- page_streaming:
- request:
- page_size_field: page_size
- token_field: page_token
- response:
- token_field: next_page_token
- resources_field: shelves
- retry_codes_name: idempotent
- retry_params_name: default
- timeout_millis: 60000
- - name: DeleteShelf
- flattening:
- groups:
- - parameters:
- - name
- required_fields:
- - name
- retry_codes_name: idempotent
- retry_params_name: default
- field_name_patterns:
- name: shelf
- timeout_millis: 60000
- - name: MergeShelves
- flattening:
- groups:
- - parameters:
- - name
- - other_shelf_name
- required_fields:
- - name
- - other_shelf_name
- retry_codes_name: non_idempotent
- retry_params_name: default
- field_name_patterns:
- name: shelf
- timeout_millis: 60000
- - name: CreateBook
- flattening:
- groups:
- - parameters:
- - name
- - book
- required_fields:
- - name
- - book
- retry_codes_name: non_idempotent
- retry_params_name: default
- field_name_patterns:
- name: shelf
- timeout_millis: 60000
- - name: GetBook
- flattening:
- groups:
- - parameters:
- - name
- required_fields:
- - name
- retry_codes_name: idempotent
- retry_params_name: default
- field_name_patterns:
- name: book
- timeout_millis: 60000
- - name: ListBooks
- flattening:
- groups:
- - parameters:
- - name
- required_fields:
- - name
- page_streaming:
- request:
- page_size_field: page_size
- token_field: page_token
- response:
- token_field: next_page_token
- resources_field: books
- retry_codes_name: idempotent
- retry_params_name: default
- field_name_patterns:
- name: shelf
- timeout_millis: 60000
- - name: DeleteBook
- flattening:
- groups:
- - parameters:
- - name
- required_fields:
- - name
- retry_codes_name: idempotent
- retry_params_name: default
- field_name_patterns:
- name: book
- timeout_millis: 60000
- - name: UpdateBook
- flattening:
- groups:
- - parameters:
- - name
- - book
- required_fields:
- - name
- - book
- retry_codes_name: idempotent
- retry_params_name: default
- field_name_patterns:
- name: book
- timeout_millis: 60000
- - name: MoveBook
- flattening:
- groups:
- - parameters:
- - name
- - other_shelf_name
- required_fields:
- - name
- - other_shelf_name
- retry_codes_name: non_idempotent
- retry_params_name: default
- field_name_patterns:
- name: book
- timeout_millis: 60000
diff --git a/google/example/library/v1/BUILD.bazel b/google/example/library/v1/BUILD.bazel
new file mode 100644
index 000000000..0850a7fd7
--- /dev/null
+++ b/google/example/library/v1/BUILD.bazel
@@ -0,0 +1,135 @@
+# This is an API workspace, having public visibility by default makes perfect sense.
+package(default_visibility = ["//visibility:public"])
+
+##############################################################################
+# Common
+##############################################################################
+load("@com_google_api_codegen//rules_gapic:gapic.bzl", "proto_library_with_info")
+
+proto_library(
+ name = "library_proto",
+ srcs = ["library.proto"],
+ deps = [
+ "//google/api:annotations_proto",
+ "//google/api:client_proto",
+ "//google/api:field_behavior_proto",
+ "//google/api:resource_proto",
+ "@com_google_protobuf//:empty_proto",
+ ],
+)
+
+proto_library_with_info(
+ name = "library_proto_with_info",
+ deps = [":library_proto"],
+)
+
+##############################################################################
+# Java
+##############################################################################
+load("@io_grpc_grpc_java//:java_grpc_library.bzl", "java_grpc_library")
+load(
+ "@com_google_api_codegen//rules_gapic/java:java_gapic.bzl",
+ "java_gapic_library",
+ "java_resource_name_proto_library",
+)
+load("@com_google_api_codegen//rules_gapic/java:java_gapic_pkg.bzl", "java_gapic_assembly_gradle_pkg")
+
+_JAVA_GRPC_DEPS = [
+ "@com_google_api_grpc_proto_google_common_protos//jar",
+]
+
+java_proto_library(
+ name = "library_java_proto",
+ deps = [":library_proto"],
+)
+
+java_grpc_library(
+ name = "library_java_grpc",
+ srcs = [":library_proto"],
+ deps = [":library_java_proto"] + _JAVA_GRPC_DEPS,
+)
+
+java_resource_name_proto_library(
+ name = "library_resource_name_java_proto",
+ gapic_yaml = "library_example_gapic.yaml",
+ deps = [":library_proto"],
+)
+
+java_gapic_library(
+ name = "library_java_gapic",
+ src = ":library_proto_with_info",
+ gapic_yaml = "library_example_gapic.yaml",
+ service_yaml = "//google/example/library:library_example_v1.yaml",
+ test_deps = [":library_java_grpc"],
+ deps = [
+ ":library_java_proto",
+ ":library_resource_name_java_proto",
+ ] + _JAVA_GRPC_DEPS,
+)
+
+[java_test(
+ name = test_name,
+ test_class = test_name,
+ runtime_deps = [":library_java_gapic_test"],
+) for test_name in [
+ "com.google.cloud.example.library.v1.LibraryServiceClientTest",
+]]
+
+# Opensource Packages
+java_gapic_assembly_gradle_pkg(
+ name = "google-cloud-library-v1-java",
+ client_deps = [":library_java_gapic"],
+ client_group = "com.google.cloud",
+ client_test_deps = [":library_java_gapic_test"],
+ grpc_deps = [":library_java_grpc"],
+ grpc_group = "com.google.api.grpc",
+ proto_deps = [
+ ":library_java_proto",
+ ":library_proto",
+ ":library_resource_name_java_proto",
+ ] + _JAVA_GRPC_DEPS,
+ version = "0.0.0-SNAPSHOT",
+)
+
+##############################################################################
+# Go
+##############################################################################
+load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
+load("@com_google_api_codegen//rules_gapic/go:go_gapic.bzl", "go_gapic_srcjar", "go_gapic_library")
+load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
+load("@com_google_api_codegen//rules_gapic/go:go_gapic_pkg.bzl", "go_gapic_assembly_pkg")
+
+go_proto_library(
+ name = "library_go_proto",
+ compilers = ["@io_bazel_rules_go//proto:go_grpc"],
+ importpath = "google.golang.org/genproto/googleapis/example/library/v1",
+ protos = [":library_proto_with_info"],
+ deps = ["//google/api:annotations_go_proto"],
+)
+
+go_gapic_library(
+ name = "library_go_gapic",
+ src = ":library_proto_with_info",
+ gapic_yaml = "library_example_gapic.yaml",
+ importpath = "cloud.google.com/go/example/library/apiv1",
+ service_yaml = "//google/example/library:library_example_v1.yaml",
+ deps = [":library_go_proto"],
+)
+
+go_test(
+ name = "library_go_gapic_test",
+ srcs = [":library_go_gapic_srcjar_test"],
+ embed = [":library_go_gapic"],
+ importpath = "cloud.google.com/go/example/library/apiv1",
+)
+
+# Opensource Packages
+go_gapic_assembly_pkg(
+ name = "gapi-cloud-library-v1-go",
+ deps = [
+ ":library_go_gapic",
+ ":library_go_gapic_srcjar-smoke-test.srcjar",
+ ":library_go_gapic_srcjar-test.srcjar",
+ ":library_go_proto",
+ ],
+)
diff --git a/google/example/library/v1/library.proto b/google/example/library/v1/library.proto
index 064efb202..fd15ccd77 100644
--- a/google/example/library/v1/library.proto
+++ b/google/example/library/v1/library.proto
@@ -1,4 +1,4 @@
-// Copyright (c) 2015, Google Inc.
+// 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.
@@ -11,12 +11,16 @@
// 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.example.library.v1;
import "google/api/annotations.proto";
+import "google/api/client.proto";
+import "google/api/field_behavior.proto";
+import "google/api/resource.proto";
import "google/protobuf/empty.proto";
option go_package = "google.golang.org/genproto/googleapis/example/library/v1;library";
@@ -40,6 +44,7 @@ service LibraryService {
post: "/v1/shelves"
body: "shelf"
};
+ option (google.api.method_signature) = "shelf";
}
// Gets a shelf. Returns NOT_FOUND if the shelf does not exist.
@@ -47,6 +52,7 @@ service LibraryService {
option (google.api.http) = {
get: "/v1/{name=shelves/*}"
};
+ option (google.api.method_signature) = "name";
}
// Lists shelves. The order is unspecified but deterministic. Newly created
@@ -62,6 +68,7 @@ service LibraryService {
option (google.api.http) = {
delete: "/v1/{name=shelves/*}"
};
+ option (google.api.method_signature) = "name";
}
// Merges two shelves by adding all books from the shelf named
@@ -76,6 +83,7 @@ service LibraryService {
post: "/v1/{name=shelves/*}:merge"
body: "*"
};
+ option (google.api.method_signature) = "name,other_shelf_name";
}
// Creates a book, and returns the new Book.
@@ -84,6 +92,7 @@ service LibraryService {
post: "/v1/{name=shelves/*}/books"
body: "book"
};
+ option (google.api.method_signature) = "name,book";
}
// Gets a book. Returns NOT_FOUND if the book does not exist.
@@ -91,6 +100,7 @@ service LibraryService {
option (google.api.http) = {
get: "/v1/{name=shelves/*/books/*}"
};
+ option (google.api.method_signature) = "name";
}
// Lists books in a shelf. The order is unspecified but deterministic. Newly
@@ -100,6 +110,7 @@ service LibraryService {
option (google.api.http) = {
get: "/v1/{name=shelves/*}/books"
};
+ option (google.api.method_signature) = "name";
}
// Deletes a book. Returns NOT_FOUND if the book does not exist.
@@ -110,12 +121,13 @@ service LibraryService {
}
// Updates a book. Returns INVALID_ARGUMENT if the name of the book
- // is non-empty and does equal the previous name.
+ // is non-empty and does not equal the existing name.
rpc UpdateBook(UpdateBookRequest) returns (Book) {
option (google.api.http) = {
- put: "/v1/{name=shelves/*/books/*}"
+ put: "/v1/{book.name=shelves/*/books/*}"
body: "book"
};
+ option (google.api.method_signature) = "book";
}
// Moves a book to another shelf, and returns the new book. The book
@@ -125,6 +137,7 @@ service LibraryService {
post: "/v1/{name=shelves/*/books/*}:move"
body: "*"
};
+ option (google.api.method_signature) = "name,other_shelf_name";
}
}
@@ -133,7 +146,10 @@ message Book {
// The resource name of the book.
// Book names have the form `shelves/{shelf_id}/books/{book_id}`.
// The name is ignored when creating a book.
- string name = 1;
+ string name = 1 [
+ (google.api.field_behavior) = REQUIRED,
+ (google.api.resource) = { pattern: "shelves/{shelf_id}/books/{book_id}" }
+ ];
// The name of the book author.
string author = 2;
@@ -150,7 +166,10 @@ message Shelf {
// The resource name of the shelf.
// Shelf names have the form `shelves/{shelf_id}`.
// The name is ignored when creating a shelf.
- string name = 1;
+ string name = 1 [
+ (google.api.field_behavior) = REQUIRED,
+ (google.api.resource) = { pattern: "shelves/{shelf_id}" }
+ ];
// The theme of the shelf
string theme = 2;
@@ -159,13 +178,16 @@ message Shelf {
// Request message for LibraryService.CreateShelf.
message CreateShelfRequest {
// The shelf to create.
- Shelf shelf = 1;
+ Shelf shelf = 1 [(google.api.field_behavior) = REQUIRED];
}
// Request message for LibraryService.GetShelf.
message GetShelfRequest {
// The name of the shelf to retrieve.
- string name = 1;
+ string name = 1 [
+ (google.api.field_behavior) = REQUIRED,
+ (google.api.resource_reference) = "Shelf"
+ ];
}
// Request message for LibraryService.ListShelves.
@@ -197,38 +219,56 @@ message ListShelvesResponse {
// Request message for LibraryService.DeleteShelf.
message DeleteShelfRequest {
// The name of the shelf to delete.
- string name = 1;
+ string name = 1 [
+ (google.api.field_behavior) = REQUIRED,
+ (google.api.resource_reference) = "Shelf"
+ ];
}
// Describes the shelf being removed (other_shelf_name) and updated
// (name) in this merge.
message MergeShelvesRequest {
// The name of the shelf we're adding books to.
- string name = 1;
+ string name = 1 [
+ (google.api.field_behavior) = REQUIRED,
+ (google.api.resource_reference) = "Shelf"
+ ];
// The name of the shelf we're removing books from and deleting.
- string other_shelf_name = 2;
+ string other_shelf_name = 2 [
+ (google.api.field_behavior) = REQUIRED,
+ (google.api.resource_reference) = "Shelf"
+ ];
}
// Request message for LibraryService.CreateBook.
message CreateBookRequest {
// The name of the shelf in which the book is created.
- string name = 1;
+ string name = 1 [
+ (google.api.field_behavior) = REQUIRED,
+ (google.api.resource_reference) = "Shelf"
+ ];
// The book to create.
- Book book = 2;
+ Book book = 2 [(google.api.field_behavior) = REQUIRED];
}
// Request message for LibraryService.GetBook.
message GetBookRequest {
// The name of the book to retrieve.
- string name = 1;
+ string name = 1 [
+ (google.api.field_behavior) = REQUIRED,
+ (google.api.resource_reference) = "Book"
+ ];
}
// Request message for LibraryService.ListBooks.
message ListBooksRequest {
// The name of the shelf whose books we'd like to list.
- string name = 1;
+ string name = 1 [
+ (google.api.field_behavior) = REQUIRED,
+ (google.api.resource_reference) = "Shelf"
+ ];
// Requested page size. Server may return fewer books than requested.
// If unspecified, server will pick an appropriate default.
@@ -257,24 +297,33 @@ message ListBooksResponse {
// Request message for LibraryService.UpdateBook.
message UpdateBookRequest {
// The name of the book to update.
- string name = 1;
+ string name = 1 [(google.api.field_behavior) = REQUIRED];
// The book to update with. The name must match or be empty.
- Book book = 2;
+ Book book = 2 [(google.api.field_behavior) = REQUIRED];
}
// Request message for LibraryService.DeleteBook.
message DeleteBookRequest {
// The name of the book to delete.
- string name = 1;
+ string name = 1 [
+ (google.api.field_behavior) = REQUIRED,
+ (google.api.resource_reference) = "Book"
+ ];
}
// Describes what book to move (name) and what shelf we're moving it
// to (other_shelf_name).
message MoveBookRequest {
// The name of the book to move.
- string name = 1;
+ string name = 1 [
+ (google.api.field_behavior) = REQUIRED,
+ (google.api.resource_reference) = "Book"
+ ];
// The name of the destination shelf.
- string other_shelf_name = 2;
+ string other_shelf_name = 2 [
+ (google.api.field_behavior) = REQUIRED,
+ (google.api.resource_reference) = "Shelf"
+ ];
}
diff --git a/google/example/library/v1/library_example_gapic.yaml b/google/example/library/v1/library_example_gapic.yaml
new file mode 100644
index 000000000..68784a50b
--- /dev/null
+++ b/google/example/library/v1/library_example_gapic.yaml
@@ -0,0 +1,260 @@
+type: com.google.api.codegen.ConfigProto
+config_schema_version: 1.0.0
+# The settings of generated code in a specific language.
+language_settings:
+ java:
+ package_name: com.google.cloud.example.library.v1
+ python:
+ package_name: google.cloud.example.library_v1.gapic
+ go:
+ package_name: cloud.google.com/go/example/library/apiv1
+ csharp:
+ package_name: Google.Example.Library.V1
+ ruby:
+ package_name: Google::Cloud::Example::Library::V1
+ php:
+ package_name: Google\Cloud\Example\Library\V1
+ nodejs:
+ package_name: library.v1
+# The configuration for the license header to put on generated files.
+license_header:
+ # The file containing the copyright line(s).
+ copyright_file: copyright-google.txt
+ # The file containing the raw license header without any copyright line(s).
+ license_file: license-header-apache-2.0.txt
+# A list of API interface configurations.
+interfaces:
+# The fully qualified name of the API interface.
+- name: google.example.library.v1.LibraryService
+ # A list of resource collection configurations.
+ # Consists of a name_pattern and an entity_name.
+ # The name_pattern is a pattern to describe the names of the resources of this
+ # collection, using the platform's conventions for URI patterns. A generator
+ # may use this to generate methods to compose and decompose such names. The
+ # pattern should use named placeholders as in `shelves/{shelf}/books/{book}`;
+ # those will be taken as hints for the parameter names of the generated
+ # methods. If empty, no name methods are generated.
+ # The entity_name is the name to be used as a basis for generated methods and
+ # classes.
+ collections:
+ - name_pattern: shelves/{shelf}
+ entity_name: shelf
+ - name_pattern: shelves/{shelf}/books/{book}
+ entity_name: book
+ # Definition for retryable codes.
+ retry_codes_def:
+ - name: idempotent
+ retry_codes:
+ - DEADLINE_EXCEEDED
+ - UNAVAILABLE
+ - name: non_idempotent
+ retry_codes: []
+ # Definition for retry/backoff parameters.
+ retry_params_def:
+ - name: default
+ initial_retry_delay_millis: 100
+ retry_delay_multiplier: 1.3
+ max_retry_delay_millis: 60000
+ initial_rpc_timeout_millis: 20000
+ rpc_timeout_multiplier: 1
+ max_rpc_timeout_millis: 20000
+ total_timeout_millis: 600000
+ # A list of method configurations.
+ # Common properties:
+ #
+ # name - The simple name of the method.
+ #
+ # flattening - Specifies the configuration for parameter flattening.
+ # Describes the parameter groups for which a generator should produce method
+ # overloads which allow a client to directly pass request message fields as
+ # method parameters. This information may or may not be used, depending on
+ # the target language.
+ # Consists of groups, which each represent a list of parameters to be
+ # flattened. Each parameter listed must be a field of the request message.
+ #
+ # required_fields - Fields that are always required for a request to be
+ # valid.
+ #
+ # resource_name_treatment - An enum that specifies how to treat the resource
+ # name formats defined in the field_name_patterns and
+ # response_field_name_patterns fields.
+ # UNSET: default value
+ # NONE: the collection configs will not be used by the generated code.
+ # VALIDATE: string fields will be validated by the client against the
+ # specified resource name formats.
+ # STATIC_TYPES: the client will use generated types for resource names.
+ #
+ # page_streaming - Specifies the configuration for paging.
+ # Describes information for generating a method which transforms a paging
+ # list RPC into a stream of resources.
+ # Consists of a request and a response.
+ # The request specifies request information of the list method. It defines
+ # which fields match the paging pattern in the request. The request consists
+ # of a page_size_field and a token_field. The page_size_field is the name of
+ # the optional field specifying the maximum number of elements to be
+ # returned in the response. The token_field is the name of the field in the
+ # request containing the page token.
+ # The response specifies response information of the list method. It defines
+ # which fields match the paging pattern in the response. The response
+ # consists of a token_field and a resources_field. The token_field is the
+ # name of the field in the response containing the next page token. The
+ # resources_field is the name of the field in the response containing the
+ # list of resources belonging to the page.
+ #
+ # retry_codes_name - Specifies the configuration for retryable codes. The
+ # name must be defined in interfaces.retry_codes_def.
+ #
+ # retry_params_name - Specifies the configuration for retry/backoff
+ # parameters. The name must be defined in interfaces.retry_params_def.
+ #
+ # field_name_patterns - Maps the field name of the request type to
+ # entity_name of interfaces.collections.
+ # Specifies the string pattern that the field must follow.
+ #
+ # timeout_millis - Specifies the default timeout for a non-retrying call. If
+ # the call is retrying, refer to retry_params_name instead.
+ methods:
+ - name: CreateShelf
+ flattening:
+ groups:
+ - parameters:
+ - shelf
+ required_fields:
+ - shelf
+ retry_codes_name: non_idempotent
+ retry_params_name: default
+ timeout_millis: 10000
+ - name: GetShelf
+ flattening:
+ groups:
+ - parameters:
+ - name
+ required_fields:
+ - name
+ retry_codes_name: idempotent
+ retry_params_name: default
+ field_name_patterns:
+ name: shelf
+ timeout_millis: 10000
+ - name: ListShelves
+ page_streaming:
+ request:
+ page_size_field: page_size
+ token_field: page_token
+ response:
+ token_field: next_page_token
+ resources_field: shelves
+ retry_codes_name: idempotent
+ retry_params_name: default
+ timeout_millis: 10000
+ - name: DeleteShelf
+ flattening:
+ groups:
+ - parameters:
+ - name
+ required_fields:
+ - name
+ retry_codes_name: idempotent
+ retry_params_name: default
+ field_name_patterns:
+ name: shelf
+ timeout_millis: 10000
+ - name: MergeShelves
+ flattening:
+ groups:
+ - parameters:
+ - name
+ - other_shelf_name
+ required_fields:
+ - name
+ - other_shelf_name
+ retry_codes_name: non_idempotent
+ retry_params_name: default
+ field_name_patterns:
+ name: shelf
+ timeout_millis: 10000
+ - name: CreateBook
+ flattening:
+ groups:
+ - parameters:
+ - name
+ - book
+ required_fields:
+ - name
+ - book
+ retry_codes_name: non_idempotent
+ retry_params_name: default
+ field_name_patterns:
+ name: shelf
+ timeout_millis: 10000
+ - name: GetBook
+ flattening:
+ groups:
+ - parameters:
+ - name
+ required_fields:
+ - name
+ retry_codes_name: idempotent
+ retry_params_name: default
+ field_name_patterns:
+ name: book
+ timeout_millis: 10000
+ - name: ListBooks
+ flattening:
+ groups:
+ - parameters:
+ - name
+ required_fields:
+ - name
+ page_streaming:
+ request:
+ page_size_field: page_size
+ token_field: page_token
+ response:
+ token_field: next_page_token
+ resources_field: books
+ retry_codes_name: idempotent
+ retry_params_name: default
+ field_name_patterns:
+ name: shelf
+ timeout_millis: 10000
+ - name: DeleteBook
+ flattening:
+ groups:
+ - parameters:
+ - name
+ required_fields:
+ - name
+ retry_codes_name: idempotent
+ retry_params_name: default
+ field_name_patterns:
+ name: book
+ timeout_millis: 10000
+ - name: UpdateBook
+ flattening:
+ groups:
+ - parameters:
+ - name
+ - book
+ required_fields:
+ - name
+ - book
+ retry_codes_name: idempotent
+ retry_params_name: default
+ field_name_patterns:
+ book.name: book
+ timeout_millis: 10000
+ - name: MoveBook
+ flattening:
+ groups:
+ - parameters:
+ - name
+ - other_shelf_name
+ required_fields:
+ - name
+ - other_shelf_name
+ retry_codes_name: non_idempotent
+ retry_params_name: default
+ field_name_patterns:
+ name: book
+ timeout_millis: 10000