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 //
0055 // New usages of this message as an alternative to ServiceDescriptorProto are
0056 // strongly discouraged. This message does not reliability preserve all
0057 // information necessary to model the schema and preserve semantics. Instead
0058 // make use of FileDescriptorSet which preserves the necessary information.
0059 message Api {
0060 // The fully qualified name of this interface, including package name
0061 // followed by the interface's simple name.
0062 string name = 1;
0063
0064 // The methods of this interface, in unspecified order.
0065 repeated Method methods = 2;
0066
0067 // Any metadata attached to the interface.
0068 repeated Option options = 3;
0069
0070 // A version string for this interface. If specified, must have the form
0071 // `major-version.minor-version`, as in `1.10`. If the minor version is
0072 // omitted, it defaults to zero. If the entire version field is empty, the
0073 // major version is derived from the package name, as outlined below. If the
0074 // field is not empty, the version in the package name will be verified to be
0075 // consistent with what is provided here.
0076 //
0077 // The versioning schema uses [semantic
0078 // versioning](http://semver.org) where the major version number
0079 // indicates a breaking change and the minor version an additive,
0080 // non-breaking change. Both version numbers are signals to users
0081 // what to expect from different versions, and should be carefully
0082 // chosen based on the product plan.
0083 //
0084 // The major version is also reflected in the package name of the
0085 // interface, which must end in `v<major-version>`, as in
0086 // `google.feature.v1`. For major versions 0 and 1, the suffix can
0087 // be omitted. Zero major versions must only be used for
0088 // experimental, non-GA interfaces.
0089 //
0090 string version = 4;
0091
0092 // Source context for the protocol buffer service represented by this
0093 // message.
0094 SourceContext source_context = 5;
0095
0096 // Included interfaces. See [Mixin][].
0097 repeated Mixin mixins = 6;
0098
0099 // The source syntax of the service.
0100 Syntax syntax = 7;
0101
0102 // The source edition string, only valid when syntax is SYNTAX_EDITIONS.
0103 string edition = 8;
0104 }
0105
0106 // Method represents a method of an API interface.
0107 //
0108 // New usages of this message as an alternative to MethodDescriptorProto are
0109 // strongly discouraged. This message does not reliability preserve all
0110 // information necessary to model the schema and preserve semantics. Instead
0111 // make use of FileDescriptorSet which preserves the necessary information.
0112 message Method {
0113 // The simple name of this method.
0114 string name = 1;
0115
0116 // A URL of the input message type.
0117 string request_type_url = 2;
0118
0119 // If true, the request is streamed.
0120 bool request_streaming = 3;
0121
0122 // The URL of the output message type.
0123 string response_type_url = 4;
0124
0125 // If true, the response is streamed.
0126 bool response_streaming = 5;
0127
0128 // Any metadata attached to the method.
0129 repeated Option options = 6;
0130
0131 // The source syntax of this method.
0132 //
0133 // This field should be ignored, instead the syntax should be inherited from
0134 // Api. This is similar to Field and EnumValue.
0135 Syntax syntax = 7 [deprecated = true];
0136
0137 // The source edition string, only valid when syntax is SYNTAX_EDITIONS.
0138 //
0139 // This field should be ignored, instead the edition should be inherited from
0140 // Api. This is similar to Field and EnumValue.
0141 string edition = 8 [deprecated = true];
0142 }
0143
0144 // Declares an API Interface to be included in this interface. The including
0145 // interface must redeclare all the methods from the included interface, but
0146 // documentation and options are inherited as follows:
0147 //
0148 // - If after comment and whitespace stripping, the documentation
0149 // string of the redeclared method is empty, it will be inherited
0150 // from the original method.
0151 //
0152 // - Each annotation belonging to the service config (http,
0153 // visibility) which is not set in the redeclared method will be
0154 // inherited.
0155 //
0156 // - If an http annotation is inherited, the path pattern will be
0157 // modified as follows. Any version prefix will be replaced by the
0158 // version of the including interface plus the [root][] path if
0159 // specified.
0160 //
0161 // Example of a simple mixin:
0162 //
0163 // package google.acl.v1;
0164 // service AccessControl {
0165 // // Get the underlying ACL object.
0166 // rpc GetAcl(GetAclRequest) returns (Acl) {
0167 // option (google.api.http).get = "/v1/{resource=**}:getAcl";
0168 // }
0169 // }
0170 //
0171 // package google.storage.v2;
0172 // service Storage {
0173 // rpc GetAcl(GetAclRequest) returns (Acl);
0174 //
0175 // // Get a data record.
0176 // rpc GetData(GetDataRequest) returns (Data) {
0177 // option (google.api.http).get = "/v2/{resource=**}";
0178 // }
0179 // }
0180 //
0181 // Example of a mixin configuration:
0182 //
0183 // apis:
0184 // - name: google.storage.v2.Storage
0185 // mixins:
0186 // - name: google.acl.v1.AccessControl
0187 //
0188 // The mixin construct implies that all methods in `AccessControl` are
0189 // also declared with same name and request/response types in
0190 // `Storage`. A documentation generator or annotation processor will
0191 // see the effective `Storage.GetAcl` method after inheriting
0192 // documentation and annotations as follows:
0193 //
0194 // service Storage {
0195 // // Get the underlying ACL object.
0196 // rpc GetAcl(GetAclRequest) returns (Acl) {
0197 // option (google.api.http).get = "/v2/{resource=**}:getAcl";
0198 // }
0199 // ...
0200 // }
0201 //
0202 // Note how the version in the path pattern changed from `v1` to `v2`.
0203 //
0204 // If the `root` field in the mixin is specified, it should be a
0205 // relative path under which inherited HTTP paths are placed. Example:
0206 //
0207 // apis:
0208 // - name: google.storage.v2.Storage
0209 // mixins:
0210 // - name: google.acl.v1.AccessControl
0211 // root: acls
0212 //
0213 // This implies the following inherited HTTP annotation:
0214 //
0215 // service Storage {
0216 // // Get the underlying ACL object.
0217 // rpc GetAcl(GetAclRequest) returns (Acl) {
0218 // option (google.api.http).get = "/v2/acls/{resource=**}:getAcl";
0219 // }
0220 // ...
0221 // }
0222 message Mixin {
0223 // The fully qualified name of the interface which is included.
0224 string name = 1;
0225
0226 // If non-empty specifies a path under which inherited HTTP paths
0227 // are rooted.
0228 string root = 2;
0229 }