google-cloud-dialogflow 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.yardopts +8 -0
- data/LICENSE +201 -0
- data/README.md +32 -0
- data/lib/google/cloud/dialogflow.rb +452 -0
- data/lib/google/cloud/dialogflow/credentials.rb +30 -0
- data/lib/google/cloud/dialogflow/v2.rb +454 -0
- data/lib/google/cloud/dialogflow/v2/agent_pb.rb +87 -0
- data/lib/google/cloud/dialogflow/v2/agent_services_pb.rb +104 -0
- data/lib/google/cloud/dialogflow/v2/agents_client.rb +639 -0
- data/lib/google/cloud/dialogflow/v2/agents_client_config.json +56 -0
- data/lib/google/cloud/dialogflow/v2/context_pb.rb +59 -0
- data/lib/google/cloud/dialogflow/v2/context_services_pb.rb +71 -0
- data/lib/google/cloud/dialogflow/v2/contexts_client.rb +445 -0
- data/lib/google/cloud/dialogflow/v2/contexts_client_config.json +56 -0
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/agent.rb +223 -0
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/context.rb +115 -0
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/entity_type.rb +290 -0
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/intent.rb +714 -0
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/session.rb +451 -0
- data/lib/google/cloud/dialogflow/v2/doc/google/cloud/dialogflow/v2/session_entity_type.rb +134 -0
- data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/any.rb +124 -0
- data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/field_mask.rb +223 -0
- data/lib/google/cloud/dialogflow/v2/doc/google/protobuf/struct.rb +73 -0
- data/lib/google/cloud/dialogflow/v2/doc/google/rpc/status.rb +83 -0
- data/lib/google/cloud/dialogflow/v2/doc/google/type/latlng.rb +64 -0
- data/lib/google/cloud/dialogflow/v2/doc/overview.rb +55 -0
- data/lib/google/cloud/dialogflow/v2/entity_type_pb.rb +120 -0
- data/lib/google/cloud/dialogflow/v2/entity_type_services_pb.rb +105 -0
- data/lib/google/cloud/dialogflow/v2/entity_types_client.rb +900 -0
- data/lib/google/cloud/dialogflow/v2/entity_types_client_config.json +76 -0
- data/lib/google/cloud/dialogflow/v2/intent_pb.rb +274 -0
- data/lib/google/cloud/dialogflow/v2/intent_services_pb.rb +91 -0
- data/lib/google/cloud/dialogflow/v2/intents_client.rb +684 -0
- data/lib/google/cloud/dialogflow/v2/intents_client_config.json +61 -0
- data/lib/google/cloud/dialogflow/v2/session_entity_type_pb.rb +61 -0
- data/lib/google/cloud/dialogflow/v2/session_entity_type_services_pb.rb +64 -0
- data/lib/google/cloud/dialogflow/v2/session_entity_types_client.rb +413 -0
- data/lib/google/cloud/dialogflow/v2/session_entity_types_client_config.json +51 -0
- data/lib/google/cloud/dialogflow/v2/session_pb.rb +127 -0
- data/lib/google/cloud/dialogflow/v2/session_services_pb.rb +55 -0
- data/lib/google/cloud/dialogflow/v2/sessions_client.rb +286 -0
- data/lib/google/cloud/dialogflow/v2/sessions_client_config.json +36 -0
- data/lib/google/cloud/dialogflow/v2/webhook_pb.rb +42 -0
- metadata +142 -0
@@ -0,0 +1,124 @@
|
|
1
|
+
# Copyright 2018 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
module Google
|
16
|
+
module Protobuf
|
17
|
+
# +Any+ contains an arbitrary serialized protocol buffer message along with a
|
18
|
+
# URL that describes the type of the serialized message.
|
19
|
+
#
|
20
|
+
# Protobuf library provides support to pack/unpack Any values in the form
|
21
|
+
# of utility functions or additional generated methods of the Any type.
|
22
|
+
#
|
23
|
+
# Example 1: Pack and unpack a message in C++.
|
24
|
+
#
|
25
|
+
# Foo foo = ...;
|
26
|
+
# Any any;
|
27
|
+
# any.PackFrom(foo);
|
28
|
+
# ...
|
29
|
+
# if (any.UnpackTo(&foo)) {
|
30
|
+
# ...
|
31
|
+
# }
|
32
|
+
#
|
33
|
+
# Example 2: Pack and unpack a message in Java.
|
34
|
+
#
|
35
|
+
# Foo foo = ...;
|
36
|
+
# Any any = Any.pack(foo);
|
37
|
+
# ...
|
38
|
+
# if (any.is(Foo.class)) {
|
39
|
+
# foo = any.unpack(Foo.class);
|
40
|
+
# }
|
41
|
+
#
|
42
|
+
# Example 3: Pack and unpack a message in Python.
|
43
|
+
#
|
44
|
+
# foo = Foo(...)
|
45
|
+
# any = Any()
|
46
|
+
# any.Pack(foo)
|
47
|
+
# ...
|
48
|
+
# if any.Is(Foo.DESCRIPTOR):
|
49
|
+
# any.Unpack(foo)
|
50
|
+
# ...
|
51
|
+
#
|
52
|
+
# Example 4: Pack and unpack a message in Go
|
53
|
+
#
|
54
|
+
# foo := &pb.Foo{...}
|
55
|
+
# any, err := ptypes.MarshalAny(foo)
|
56
|
+
# ...
|
57
|
+
# foo := &pb.Foo{}
|
58
|
+
# if err := ptypes.UnmarshalAny(any, foo); err != nil {
|
59
|
+
# ...
|
60
|
+
# }
|
61
|
+
#
|
62
|
+
# The pack methods provided by protobuf library will by default use
|
63
|
+
# 'type.googleapis.com/full.type.name' as the type URL and the unpack
|
64
|
+
# methods only use the fully qualified type name after the last '/'
|
65
|
+
# in the type URL, for example "foo.bar.com/x/y.z" will yield type
|
66
|
+
# name "y.z".
|
67
|
+
#
|
68
|
+
#
|
69
|
+
# = JSON
|
70
|
+
#
|
71
|
+
# The JSON representation of an +Any+ value uses the regular
|
72
|
+
# representation of the deserialized, embedded message, with an
|
73
|
+
# additional field +@type+ which contains the type URL. Example:
|
74
|
+
#
|
75
|
+
# package google.profile;
|
76
|
+
# message Person {
|
77
|
+
# string first_name = 1;
|
78
|
+
# string last_name = 2;
|
79
|
+
# }
|
80
|
+
#
|
81
|
+
# {
|
82
|
+
# "@type": "type.googleapis.com/google.profile.Person",
|
83
|
+
# "firstName": <string>,
|
84
|
+
# "lastName": <string>
|
85
|
+
# }
|
86
|
+
#
|
87
|
+
# If the embedded message type is well-known and has a custom JSON
|
88
|
+
# representation, that representation will be embedded adding a field
|
89
|
+
# +value+ which holds the custom JSON in addition to the +@type+
|
90
|
+
# field. Example (for message {Google::Protobuf::Duration}):
|
91
|
+
#
|
92
|
+
# {
|
93
|
+
# "@type": "type.googleapis.com/google.protobuf.Duration",
|
94
|
+
# "value": "1.212s"
|
95
|
+
# }
|
96
|
+
# @!attribute [rw] type_url
|
97
|
+
# @return [String]
|
98
|
+
# A URL/resource name whose content describes the type of the
|
99
|
+
# serialized protocol buffer message.
|
100
|
+
#
|
101
|
+
# For URLs which use the scheme +http+, +https+, or no scheme, the
|
102
|
+
# following restrictions and interpretations apply:
|
103
|
+
#
|
104
|
+
# * If no scheme is provided, +https+ is assumed.
|
105
|
+
# * The last segment of the URL's path must represent the fully
|
106
|
+
# qualified name of the type (as in +path/google.protobuf.Duration+).
|
107
|
+
# The name should be in a canonical form (e.g., leading "." is
|
108
|
+
# not accepted).
|
109
|
+
# * An HTTP GET on the URL must yield a {Google::Protobuf::Type}
|
110
|
+
# value in binary format, or produce an error.
|
111
|
+
# * Applications are allowed to cache lookup results based on the
|
112
|
+
# URL, or have them precompiled into a binary to avoid any
|
113
|
+
# lookup. Therefore, binary compatibility needs to be preserved
|
114
|
+
# on changes to types. (Use versioned type names to manage
|
115
|
+
# breaking changes.)
|
116
|
+
#
|
117
|
+
# Schemes other than +http+, +https+ (or the empty scheme) might be
|
118
|
+
# used with implementation specific semantics.
|
119
|
+
# @!attribute [rw] value
|
120
|
+
# @return [String]
|
121
|
+
# Must be a valid serialized protocol buffer of the above specified type.
|
122
|
+
class Any; end
|
123
|
+
end
|
124
|
+
end
|
@@ -0,0 +1,223 @@
|
|
1
|
+
# Copyright 2018 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
module Google
|
16
|
+
module Protobuf
|
17
|
+
# +FieldMask+ represents a set of symbolic field paths, for example:
|
18
|
+
#
|
19
|
+
# paths: "f.a"
|
20
|
+
# paths: "f.b.d"
|
21
|
+
#
|
22
|
+
# Here +f+ represents a field in some root message, +a+ and +b+
|
23
|
+
# fields in the message found in +f+, and +d+ a field found in the
|
24
|
+
# message in +f.b+.
|
25
|
+
#
|
26
|
+
# Field masks are used to specify a subset of fields that should be
|
27
|
+
# returned by a get operation or modified by an update operation.
|
28
|
+
# Field masks also have a custom JSON encoding (see below).
|
29
|
+
#
|
30
|
+
# = Field Masks in Projections
|
31
|
+
#
|
32
|
+
# When used in the context of a projection, a response message or
|
33
|
+
# sub-message is filtered by the API to only contain those fields as
|
34
|
+
# specified in the mask. For example, if the mask in the previous
|
35
|
+
# example is applied to a response message as follows:
|
36
|
+
#
|
37
|
+
# f {
|
38
|
+
# a : 22
|
39
|
+
# b {
|
40
|
+
# d : 1
|
41
|
+
# x : 2
|
42
|
+
# }
|
43
|
+
# y : 13
|
44
|
+
# }
|
45
|
+
# z: 8
|
46
|
+
#
|
47
|
+
# The result will not contain specific values for fields x,y and z
|
48
|
+
# (their value will be set to the default, and omitted in proto text
|
49
|
+
# output):
|
50
|
+
#
|
51
|
+
#
|
52
|
+
# f {
|
53
|
+
# a : 22
|
54
|
+
# b {
|
55
|
+
# d : 1
|
56
|
+
# }
|
57
|
+
# }
|
58
|
+
#
|
59
|
+
# A repeated field is not allowed except at the last position of a
|
60
|
+
# paths string.
|
61
|
+
#
|
62
|
+
# If a FieldMask object is not present in a get operation, the
|
63
|
+
# operation applies to all fields (as if a FieldMask of all fields
|
64
|
+
# had been specified).
|
65
|
+
#
|
66
|
+
# Note that a field mask does not necessarily apply to the
|
67
|
+
# top-level response message. In case of a REST get operation, the
|
68
|
+
# field mask applies directly to the response, but in case of a REST
|
69
|
+
# list operation, the mask instead applies to each individual message
|
70
|
+
# in the returned resource list. In case of a REST custom method,
|
71
|
+
# other definitions may be used. Where the mask applies will be
|
72
|
+
# clearly documented together with its declaration in the API. In
|
73
|
+
# any case, the effect on the returned resource/resources is required
|
74
|
+
# behavior for APIs.
|
75
|
+
#
|
76
|
+
# = Field Masks in Update Operations
|
77
|
+
#
|
78
|
+
# A field mask in update operations specifies which fields of the
|
79
|
+
# targeted resource are going to be updated. The API is required
|
80
|
+
# to only change the values of the fields as specified in the mask
|
81
|
+
# and leave the others untouched. If a resource is passed in to
|
82
|
+
# describe the updated values, the API ignores the values of all
|
83
|
+
# fields not covered by the mask.
|
84
|
+
#
|
85
|
+
# If a repeated field is specified for an update operation, the existing
|
86
|
+
# repeated values in the target resource will be overwritten by the new values.
|
87
|
+
# Note that a repeated field is only allowed in the last position of a +paths+
|
88
|
+
# string.
|
89
|
+
#
|
90
|
+
# If a sub-message is specified in the last position of the field mask for an
|
91
|
+
# update operation, then the existing sub-message in the target resource is
|
92
|
+
# overwritten. Given the target message:
|
93
|
+
#
|
94
|
+
# f {
|
95
|
+
# b {
|
96
|
+
# d : 1
|
97
|
+
# x : 2
|
98
|
+
# }
|
99
|
+
# c : 1
|
100
|
+
# }
|
101
|
+
#
|
102
|
+
# And an update message:
|
103
|
+
#
|
104
|
+
# f {
|
105
|
+
# b {
|
106
|
+
# d : 10
|
107
|
+
# }
|
108
|
+
# }
|
109
|
+
#
|
110
|
+
# then if the field mask is:
|
111
|
+
#
|
112
|
+
# paths: "f.b"
|
113
|
+
#
|
114
|
+
# then the result will be:
|
115
|
+
#
|
116
|
+
# f {
|
117
|
+
# b {
|
118
|
+
# d : 10
|
119
|
+
# }
|
120
|
+
# c : 1
|
121
|
+
# }
|
122
|
+
#
|
123
|
+
# However, if the update mask was:
|
124
|
+
#
|
125
|
+
# paths: "f.b.d"
|
126
|
+
#
|
127
|
+
# then the result would be:
|
128
|
+
#
|
129
|
+
# f {
|
130
|
+
# b {
|
131
|
+
# d : 10
|
132
|
+
# x : 2
|
133
|
+
# }
|
134
|
+
# c : 1
|
135
|
+
# }
|
136
|
+
#
|
137
|
+
# In order to reset a field's value to the default, the field must
|
138
|
+
# be in the mask and set to the default value in the provided resource.
|
139
|
+
# Hence, in order to reset all fields of a resource, provide a default
|
140
|
+
# instance of the resource and set all fields in the mask, or do
|
141
|
+
# not provide a mask as described below.
|
142
|
+
#
|
143
|
+
# If a field mask is not present on update, the operation applies to
|
144
|
+
# all fields (as if a field mask of all fields has been specified).
|
145
|
+
# Note that in the presence of schema evolution, this may mean that
|
146
|
+
# fields the client does not know and has therefore not filled into
|
147
|
+
# the request will be reset to their default. If this is unwanted
|
148
|
+
# behavior, a specific service may require a client to always specify
|
149
|
+
# a field mask, producing an error if not.
|
150
|
+
#
|
151
|
+
# As with get operations, the location of the resource which
|
152
|
+
# describes the updated values in the request message depends on the
|
153
|
+
# operation kind. In any case, the effect of the field mask is
|
154
|
+
# required to be honored by the API.
|
155
|
+
#
|
156
|
+
# == Considerations for HTTP REST
|
157
|
+
#
|
158
|
+
# The HTTP kind of an update operation which uses a field mask must
|
159
|
+
# be set to PATCH instead of PUT in order to satisfy HTTP semantics
|
160
|
+
# (PUT must only be used for full updates).
|
161
|
+
#
|
162
|
+
# = JSON Encoding of Field Masks
|
163
|
+
#
|
164
|
+
# In JSON, a field mask is encoded as a single string where paths are
|
165
|
+
# separated by a comma. Fields name in each path are converted
|
166
|
+
# to/from lower-camel naming conventions.
|
167
|
+
#
|
168
|
+
# As an example, consider the following message declarations:
|
169
|
+
#
|
170
|
+
# message Profile {
|
171
|
+
# User user = 1;
|
172
|
+
# Photo photo = 2;
|
173
|
+
# }
|
174
|
+
# message User {
|
175
|
+
# string display_name = 1;
|
176
|
+
# string address = 2;
|
177
|
+
# }
|
178
|
+
#
|
179
|
+
# In proto a field mask for +Profile+ may look as such:
|
180
|
+
#
|
181
|
+
# mask {
|
182
|
+
# paths: "user.display_name"
|
183
|
+
# paths: "photo"
|
184
|
+
# }
|
185
|
+
#
|
186
|
+
# In JSON, the same mask is represented as below:
|
187
|
+
#
|
188
|
+
# {
|
189
|
+
# mask: "user.displayName,photo"
|
190
|
+
# }
|
191
|
+
#
|
192
|
+
# = Field Masks and Oneof Fields
|
193
|
+
#
|
194
|
+
# Field masks treat fields in oneofs just as regular fields. Consider the
|
195
|
+
# following message:
|
196
|
+
#
|
197
|
+
# message SampleMessage {
|
198
|
+
# oneof test_oneof {
|
199
|
+
# string name = 4;
|
200
|
+
# SubMessage sub_message = 9;
|
201
|
+
# }
|
202
|
+
# }
|
203
|
+
#
|
204
|
+
# The field mask can be:
|
205
|
+
#
|
206
|
+
# mask {
|
207
|
+
# paths: "name"
|
208
|
+
# }
|
209
|
+
#
|
210
|
+
# Or:
|
211
|
+
#
|
212
|
+
# mask {
|
213
|
+
# paths: "sub_message"
|
214
|
+
# }
|
215
|
+
#
|
216
|
+
# Note that oneof type names ("test_oneof" in this case) cannot be used in
|
217
|
+
# paths.
|
218
|
+
# @!attribute [rw] paths
|
219
|
+
# @return [Array<String>]
|
220
|
+
# The set of field mask paths.
|
221
|
+
class FieldMask; end
|
222
|
+
end
|
223
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# Copyright 2018 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
module Google
|
16
|
+
module Protobuf
|
17
|
+
# +Struct+ represents a structured data value, consisting of fields
|
18
|
+
# which map to dynamically typed values. In some languages, +Struct+
|
19
|
+
# might be supported by a native representation. For example, in
|
20
|
+
# scripting languages like JS a struct is represented as an
|
21
|
+
# object. The details of that representation are described together
|
22
|
+
# with the proto support for the language.
|
23
|
+
#
|
24
|
+
# The JSON representation for +Struct+ is JSON object.
|
25
|
+
# @!attribute [rw] fields
|
26
|
+
# @return [Hash{String => Google::Protobuf::Value}]
|
27
|
+
# Unordered map of dynamically typed values.
|
28
|
+
class Struct; end
|
29
|
+
|
30
|
+
# +Value+ represents a dynamically typed value which can be either
|
31
|
+
# null, a number, a string, a boolean, a recursive struct value, or a
|
32
|
+
# list of values. A producer of value is expected to set one of that
|
33
|
+
# variants, absence of any variant indicates an error.
|
34
|
+
#
|
35
|
+
# The JSON representation for +Value+ is JSON value.
|
36
|
+
# @!attribute [rw] null_value
|
37
|
+
# @return [Google::Protobuf::NullValue]
|
38
|
+
# Represents a null value.
|
39
|
+
# @!attribute [rw] number_value
|
40
|
+
# @return [Float]
|
41
|
+
# Represents a double value.
|
42
|
+
# @!attribute [rw] string_value
|
43
|
+
# @return [String]
|
44
|
+
# Represents a string value.
|
45
|
+
# @!attribute [rw] bool_value
|
46
|
+
# @return [true, false]
|
47
|
+
# Represents a boolean value.
|
48
|
+
# @!attribute [rw] struct_value
|
49
|
+
# @return [Google::Protobuf::Struct]
|
50
|
+
# Represents a structured value.
|
51
|
+
# @!attribute [rw] list_value
|
52
|
+
# @return [Google::Protobuf::ListValue]
|
53
|
+
# Represents a repeated +Value+.
|
54
|
+
class Value; end
|
55
|
+
|
56
|
+
# +ListValue+ is a wrapper around a repeated field of values.
|
57
|
+
#
|
58
|
+
# The JSON representation for +ListValue+ is JSON array.
|
59
|
+
# @!attribute [rw] values
|
60
|
+
# @return [Array<Google::Protobuf::Value>]
|
61
|
+
# Repeated field of dynamically typed values.
|
62
|
+
class ListValue; end
|
63
|
+
|
64
|
+
# +NullValue+ is a singleton enumeration to represent the null value for the
|
65
|
+
# +Value+ type union.
|
66
|
+
#
|
67
|
+
# The JSON representation for +NullValue+ is JSON +null+.
|
68
|
+
module NullValue
|
69
|
+
# Null value.
|
70
|
+
NULL_VALUE = 0
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
# Copyright 2018 Google LLC
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
module Google
|
16
|
+
module Rpc
|
17
|
+
# The +Status+ type defines a logical error model that is suitable for different
|
18
|
+
# programming environments, including REST APIs and RPC APIs. It is used by
|
19
|
+
# [gRPC](https://github.com/grpc). The error model is designed to be:
|
20
|
+
#
|
21
|
+
# * Simple to use and understand for most users
|
22
|
+
# * Flexible enough to meet unexpected needs
|
23
|
+
#
|
24
|
+
# = Overview
|
25
|
+
#
|
26
|
+
# The +Status+ message contains three pieces of data: error code, error message,
|
27
|
+
# and error details. The error code should be an enum value of
|
28
|
+
# {Google::Rpc::Code}, but it may accept additional error codes if needed. The
|
29
|
+
# error message should be a developer-facing English message that helps
|
30
|
+
# developers *understand* and *resolve* the error. If a localized user-facing
|
31
|
+
# error message is needed, put the localized message in the error details or
|
32
|
+
# localize it in the client. The optional error details may contain arbitrary
|
33
|
+
# information about the error. There is a predefined set of error detail types
|
34
|
+
# in the package +google.rpc+ that can be used for common error conditions.
|
35
|
+
#
|
36
|
+
# = Language mapping
|
37
|
+
#
|
38
|
+
# The +Status+ message is the logical representation of the error model, but it
|
39
|
+
# is not necessarily the actual wire format. When the +Status+ message is
|
40
|
+
# exposed in different client libraries and different wire protocols, it can be
|
41
|
+
# mapped differently. For example, it will likely be mapped to some exceptions
|
42
|
+
# in Java, but more likely mapped to some error codes in C.
|
43
|
+
#
|
44
|
+
# = Other uses
|
45
|
+
#
|
46
|
+
# The error model and the +Status+ message can be used in a variety of
|
47
|
+
# environments, either with or without APIs, to provide a
|
48
|
+
# consistent developer experience across different environments.
|
49
|
+
#
|
50
|
+
# Example uses of this error model include:
|
51
|
+
#
|
52
|
+
# * Partial errors. If a service needs to return partial errors to the client,
|
53
|
+
# it may embed the +Status+ in the normal response to indicate the partial
|
54
|
+
# errors.
|
55
|
+
#
|
56
|
+
# * Workflow errors. A typical workflow has multiple steps. Each step may
|
57
|
+
# have a +Status+ message for error reporting.
|
58
|
+
#
|
59
|
+
# * Batch operations. If a client uses batch request and batch response, the
|
60
|
+
# +Status+ message should be used directly inside batch response, one for
|
61
|
+
# each error sub-response.
|
62
|
+
#
|
63
|
+
# * Asynchronous operations. If an API call embeds asynchronous operation
|
64
|
+
# results in its response, the status of those operations should be
|
65
|
+
# represented directly using the +Status+ message.
|
66
|
+
#
|
67
|
+
# * Logging. If some API errors are stored in logs, the message +Status+ could
|
68
|
+
# be used directly after any stripping needed for security/privacy reasons.
|
69
|
+
# @!attribute [rw] code
|
70
|
+
# @return [Integer]
|
71
|
+
# The status code, which should be an enum value of {Google::Rpc::Code}.
|
72
|
+
# @!attribute [rw] message
|
73
|
+
# @return [String]
|
74
|
+
# A developer-facing error message, which should be in English. Any
|
75
|
+
# user-facing error message should be localized and sent in the
|
76
|
+
# {Google::Rpc::Status#details} field, or localized by the client.
|
77
|
+
# @!attribute [rw] details
|
78
|
+
# @return [Array<Google::Protobuf::Any>]
|
79
|
+
# A list of messages that carry the error details. There is a common set of
|
80
|
+
# message types for APIs to use.
|
81
|
+
class Status; end
|
82
|
+
end
|
83
|
+
end
|