Warning, /include/google/protobuf/api.proto is written in an unsupported language. File is not indexed.
0001 // Protocol Buffers - Google's data interchange format
0002 // Copyright 2008 Google Inc. All rights reserved.
0003 // https://developers.google.com/protocol-buffers/
0004 //
0005 // Redistribution and use in source and binary forms, with or without
0006 // modification, are permitted provided that the following conditions are
0007 // met:
0008 //
0009 // * Redistributions of source code must retain the above copyright
0010 // notice, this list of conditions and the following disclaimer.
0011 // * Redistributions in binary form must reproduce the above
0012 // copyright notice, this list of conditions and the following disclaimer
0013 // in the documentation and/or other materials provided with the
0014 // distribution.
0015 // * Neither the name of Google Inc. nor the names of its
0016 // contributors may be used to endorse or promote products derived from
0017 // this software without specific prior written permission.
0018 //
0019 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0020 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0021 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
0022 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
0023 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
0024 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
0025 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
0026 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
0027 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0028 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0029 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0030
0031 syntax = "proto3";
0032
0033 package google.protobuf;
0034
0035 import "google/protobuf/source_context.proto";
0036 import "google/protobuf/type.proto";
0037
0038 option java_package = "com.google.protobuf";
0039 option java_outer_classname = "ApiProto";
0040 option java_multiple_files = true;
0041 option objc_class_prefix = "GPB";
0042 option csharp_namespace = "Google.Protobuf.WellKnownTypes";
0043 option go_package = "google.golang.org/protobuf/types/known/apipb";
0044
0045 // Api is a light-weight descriptor for an API Interface.
0046 //
0047 // Interfaces are also described as "protocol buffer services" in some contexts,
0048 // such as by the "service" keyword in a .proto file, but they are different
0049 // from API Services, which represent a concrete implementation of an interface
0050 // as opposed to simply a description of methods and bindings. They are also
0051 // sometimes simply referred to as "APIs" in other contexts, such as the name of
0052 // this message itself. See https://cloud.google.com/apis/design/glossary for
0053 // detailed terminology.
0054 message Api {
0055 // The fully qualified name of this interface, including package name
0056 // followed by the interface's simple name.
0057 string name = 1;
0058
0059 // The methods of this interface, in unspecified order.
0060 repeated Method methods = 2;
0061
0062 // Any metadata attached to the interface.
0063 repeated Option options = 3;
0064
0065 // A version string for this interface. If specified, must have the form
0066 // `major-version.minor-version`, as in `1.10`. If the minor version is
0067 // omitted, it defaults to zero. If the entire version field is empty, the
0068 // major version is derived from the package name, as outlined below. If the
0069 // field is not empty, the version in the package name will be verified to be
0070 // consistent with what is provided here.
0071 //
0072 // The versioning schema uses [semantic
0073 // versioning](http://semver.org) where the major version number
0074 // indicates a breaking change and the minor version an additive,
0075 // non-breaking change. Both version numbers are signals to users
0076 // what to expect from different versions, and should be carefully
0077 // chosen based on the product plan.
0078 //
0079 // The major version is also reflected in the package name of the
0080 // interface, which must end in `v<major-version>`, as in
0081 // `google.feature.v1`. For major versions 0 and 1, the suffix can
0082 // be omitted. Zero major versions must only be used for
0083 // experimental, non-GA interfaces.
0084 //
0085 string version = 4;
0086
0087 // Source context for the protocol buffer service represented by this
0088 // message.
0089 SourceContext source_context = 5;
0090
0091 // Included interfaces. See [Mixin][].
0092 repeated Mixin mixins = 6;
0093
0094 // The source syntax of the service.
0095 Syntax syntax = 7;
0096 }
0097
0098 // Method represents a method of an API interface.
0099 message Method {
0100 // The simple name of this method.
0101 string name = 1;
0102
0103 // A URL of the input message type.
0104 string request_type_url = 2;
0105
0106 // If true, the request is streamed.
0107 bool request_streaming = 3;
0108
0109 // The URL of the output message type.
0110 string response_type_url = 4;
0111
0112 // If true, the response is streamed.
0113 bool response_streaming = 5;
0114
0115 // Any metadata attached to the method.
0116 repeated Option options = 6;
0117
0118 // The source syntax of this method.
0119 Syntax syntax = 7;
0120 }
0121
0122 // Declares an API Interface to be included in this interface. The including
0123 // interface must redeclare all the methods from the included interface, but
0124 // documentation and options are inherited as follows:
0125 //
0126 // - If after comment and whitespace stripping, the documentation
0127 // string of the redeclared method is empty, it will be inherited
0128 // from the original method.
0129 //
0130 // - Each annotation belonging to the service config (http,
0131 // visibility) which is not set in the redeclared method will be
0132 // inherited.
0133 //
0134 // - If an http annotation is inherited, the path pattern will be
0135 // modified as follows. Any version prefix will be replaced by the
0136 // version of the including interface plus the [root][] path if
0137 // specified.
0138 //
0139 // Example of a simple mixin:
0140 //
0141 // package google.acl.v1;
0142 // service AccessControl {
0143 // // Get the underlying ACL object.
0144 // rpc GetAcl(GetAclRequest) returns (Acl) {
0145 // option (google.api.http).get = "/v1/{resource=**}:getAcl";
0146 // }
0147 // }
0148 //
0149 // package google.storage.v2;
0150 // service Storage {
0151 // rpc GetAcl(GetAclRequest) returns (Acl);
0152 //
0153 // // Get a data record.
0154 // rpc GetData(GetDataRequest) returns (Data) {
0155 // option (google.api.http).get = "/v2/{resource=**}";
0156 // }
0157 // }
0158 //
0159 // Example of a mixin configuration:
0160 //
0161 // apis:
0162 // - name: google.storage.v2.Storage
0163 // mixins:
0164 // - name: google.acl.v1.AccessControl
0165 //
0166 // The mixin construct implies that all methods in `AccessControl` are
0167 // also declared with same name and request/response types in
0168 // `Storage`. A documentation generator or annotation processor will
0169 // see the effective `Storage.GetAcl` method after inherting
0170 // documentation and annotations as follows:
0171 //
0172 // service Storage {
0173 // // Get the underlying ACL object.
0174 // rpc GetAcl(GetAclRequest) returns (Acl) {
0175 // option (google.api.http).get = "/v2/{resource=**}:getAcl";
0176 // }
0177 // ...
0178 // }
0179 //
0180 // Note how the version in the path pattern changed from `v1` to `v2`.
0181 //
0182 // If the `root` field in the mixin is specified, it should be a
0183 // relative path under which inherited HTTP paths are placed. Example:
0184 //
0185 // apis:
0186 // - name: google.storage.v2.Storage
0187 // mixins:
0188 // - name: google.acl.v1.AccessControl
0189 // root: acls
0190 //
0191 // This implies the following inherited HTTP annotation:
0192 //
0193 // service Storage {
0194 // // Get the underlying ACL object.
0195 // rpc GetAcl(GetAclRequest) returns (Acl) {
0196 // option (google.api.http).get = "/v2/acls/{resource=**}:getAcl";
0197 // }
0198 // ...
0199 // }
0200 message Mixin {
0201 // The fully qualified name of the interface which is included.
0202 string name = 1;
0203
0204 // If non-empty specifies a path under which inherited HTTP paths
0205 // are rooted.
0206 string root = 2;
0207 }