google-cloud-redis 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,93 @@
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
+
16
+ module Google
17
+ module Longrunning
18
+ # This resource represents a long-running operation that is the result of a
19
+ # network API call.
20
+ # @!attribute [rw] name
21
+ # @return [String]
22
+ # The server-assigned name, which is only unique within the same service that
23
+ # originally returns it. If you use the default HTTP mapping, the
24
+ # +name+ should have the format of +operations/some/unique/name+.
25
+ # @!attribute [rw] metadata
26
+ # @return [Google::Protobuf::Any]
27
+ # Service-specific metadata associated with the operation. It typically
28
+ # contains progress information and common metadata such as create time.
29
+ # Some services might not provide such metadata. Any method that returns a
30
+ # long-running operation should document the metadata type, if any.
31
+ # @!attribute [rw] done
32
+ # @return [true, false]
33
+ # If the value is +false+, it means the operation is still in progress.
34
+ # If true, the operation is completed, and either +error+ or +response+ is
35
+ # available.
36
+ # @!attribute [rw] error
37
+ # @return [Google::Rpc::Status]
38
+ # The error result of the operation in case of failure or cancellation.
39
+ # @!attribute [rw] response
40
+ # @return [Google::Protobuf::Any]
41
+ # The normal response of the operation in case of success. If the original
42
+ # method returns no data on success, such as +Delete+, the response is
43
+ # +google.protobuf.Empty+. If the original method is standard
44
+ # +Get+/+Create+/+Update+, the response should be the resource. For other
45
+ # methods, the response should have the type +XxxResponse+, where +Xxx+
46
+ # is the original method name. For example, if the original method name
47
+ # is +TakeSnapshot()+, the inferred response type is
48
+ # +TakeSnapshotResponse+.
49
+ class Operation; end
50
+
51
+ # The request message for {Google::Longrunning::Operations::GetOperation Operations::GetOperation}.
52
+ # @!attribute [rw] name
53
+ # @return [String]
54
+ # The name of the operation resource.
55
+ class GetOperationRequest; end
56
+
57
+ # The request message for {Google::Longrunning::Operations::ListOperations Operations::ListOperations}.
58
+ # @!attribute [rw] name
59
+ # @return [String]
60
+ # The name of the operation collection.
61
+ # @!attribute [rw] filter
62
+ # @return [String]
63
+ # The standard list filter.
64
+ # @!attribute [rw] page_size
65
+ # @return [Integer]
66
+ # The standard list page size.
67
+ # @!attribute [rw] page_token
68
+ # @return [String]
69
+ # The standard list page token.
70
+ class ListOperationsRequest; end
71
+
72
+ # The response message for {Google::Longrunning::Operations::ListOperations Operations::ListOperations}.
73
+ # @!attribute [rw] operations
74
+ # @return [Array<Google::Longrunning::Operation>]
75
+ # A list of operations that matches the specified filter in the request.
76
+ # @!attribute [rw] next_page_token
77
+ # @return [String]
78
+ # The standard List next-page token.
79
+ class ListOperationsResponse; end
80
+
81
+ # The request message for {Google::Longrunning::Operations::CancelOperation Operations::CancelOperation}.
82
+ # @!attribute [rw] name
83
+ # @return [String]
84
+ # The name of the operation resource to be cancelled.
85
+ class CancelOperationRequest; end
86
+
87
+ # The request message for {Google::Longrunning::Operations::DeleteOperation Operations::DeleteOperation}.
88
+ # @!attribute [rw] name
89
+ # @return [String]
90
+ # The name of the operation resource to be deleted.
91
+ class DeleteOperationRequest; end
92
+ end
93
+ end
@@ -0,0 +1,130 @@
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
+
16
+ module Google
17
+ module Protobuf
18
+ # +Any+ contains an arbitrary serialized protocol buffer message along with a
19
+ # URL that describes the type of the serialized message.
20
+ #
21
+ # Protobuf library provides support to pack/unpack Any values in the form
22
+ # of utility functions or additional generated methods of the Any type.
23
+ #
24
+ # Example 1: Pack and unpack a message in C++.
25
+ #
26
+ # Foo foo = ...;
27
+ # Any any;
28
+ # any.PackFrom(foo);
29
+ # ...
30
+ # if (any.UnpackTo(&foo)) {
31
+ # ...
32
+ # }
33
+ #
34
+ # Example 2: Pack and unpack a message in Java.
35
+ #
36
+ # Foo foo = ...;
37
+ # Any any = Any.pack(foo);
38
+ # ...
39
+ # if (any.is(Foo.class)) {
40
+ # foo = any.unpack(Foo.class);
41
+ # }
42
+ #
43
+ # Example 3: Pack and unpack a message in Python.
44
+ #
45
+ # foo = Foo(...)
46
+ # any = Any()
47
+ # any.Pack(foo)
48
+ # ...
49
+ # if any.Is(Foo.DESCRIPTOR):
50
+ # any.Unpack(foo)
51
+ # ...
52
+ #
53
+ # Example 4: Pack and unpack a message in Go
54
+ #
55
+ # foo := &pb.Foo{...}
56
+ # any, err := ptypes.MarshalAny(foo)
57
+ # ...
58
+ # foo := &pb.Foo{}
59
+ # if err := ptypes.UnmarshalAny(any, foo); err != nil {
60
+ # ...
61
+ # }
62
+ #
63
+ # The pack methods provided by protobuf library will by default use
64
+ # 'type.googleapis.com/full.type.name' as the type URL and the unpack
65
+ # methods only use the fully qualified type name after the last '/'
66
+ # in the type URL, for example "foo.bar.com/x/y.z" will yield type
67
+ # name "y.z".
68
+ #
69
+ #
70
+ # = JSON
71
+ #
72
+ # The JSON representation of an +Any+ value uses the regular
73
+ # representation of the deserialized, embedded message, with an
74
+ # additional field +@type+ which contains the type URL. Example:
75
+ #
76
+ # package google.profile;
77
+ # message Person {
78
+ # string first_name = 1;
79
+ # string last_name = 2;
80
+ # }
81
+ #
82
+ # {
83
+ # "@type": "type.googleapis.com/google.profile.Person",
84
+ # "firstName": <string>,
85
+ # "lastName": <string>
86
+ # }
87
+ #
88
+ # If the embedded message type is well-known and has a custom JSON
89
+ # representation, that representation will be embedded adding a field
90
+ # +value+ which holds the custom JSON in addition to the +@type+
91
+ # field. Example (for message {Google::Protobuf::Duration}):
92
+ #
93
+ # {
94
+ # "@type": "type.googleapis.com/google.protobuf.Duration",
95
+ # "value": "1.212s"
96
+ # }
97
+ # @!attribute [rw] type_url
98
+ # @return [String]
99
+ # A URL/resource name that uniquely identifies the type of the serialized
100
+ # protocol buffer message. The last segment of the URL's path must represent
101
+ # the fully qualified name of the type (as in
102
+ # +path/google.protobuf.Duration+). The name should be in a canonical form
103
+ # (e.g., leading "." is not accepted).
104
+ #
105
+ # In practice, teams usually precompile into the binary all types that they
106
+ # expect it to use in the context of Any. However, for URLs which use the
107
+ # scheme +http+, +https+, or no scheme, one can optionally set up a type
108
+ # server that maps type URLs to message definitions as follows:
109
+ #
110
+ # * If no scheme is provided, +https+ is assumed.
111
+ # * An HTTP GET on the URL must yield a {Google::Protobuf::Type}
112
+ # value in binary format, or produce an error.
113
+ # * Applications are allowed to cache lookup results based on the
114
+ # URL, or have them precompiled into a binary to avoid any
115
+ # lookup. Therefore, binary compatibility needs to be preserved
116
+ # on changes to types. (Use versioned type names to manage
117
+ # breaking changes.)
118
+ #
119
+ # Note: this functionality is not currently available in the official
120
+ # protobuf release, and it is not used for type URLs beginning with
121
+ # type.googleapis.com.
122
+ #
123
+ # Schemes other than +http+, +https+ (or the empty scheme) might be
124
+ # used with implementation specific semantics.
125
+ # @!attribute [rw] value
126
+ # @return [String]
127
+ # Must be a valid serialized protocol buffer of the above specified type.
128
+ class Any; end
129
+ end
130
+ end
@@ -0,0 +1,230 @@
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
+
16
+ module Google
17
+ module Protobuf
18
+ # +FieldMask+ represents a set of symbolic field paths, for example:
19
+ #
20
+ # paths: "f.a"
21
+ # paths: "f.b.d"
22
+ #
23
+ # Here +f+ represents a field in some root message, +a+ and +b+
24
+ # fields in the message found in +f+, and +d+ a field found in the
25
+ # message in +f.b+.
26
+ #
27
+ # Field masks are used to specify a subset of fields that should be
28
+ # returned by a get operation or modified by an update operation.
29
+ # Field masks also have a custom JSON encoding (see below).
30
+ #
31
+ # = Field Masks in Projections
32
+ #
33
+ # When used in the context of a projection, a response message or
34
+ # sub-message is filtered by the API to only contain those fields as
35
+ # specified in the mask. For example, if the mask in the previous
36
+ # example is applied to a response message as follows:
37
+ #
38
+ # f {
39
+ # a : 22
40
+ # b {
41
+ # d : 1
42
+ # x : 2
43
+ # }
44
+ # y : 13
45
+ # }
46
+ # z: 8
47
+ #
48
+ # The result will not contain specific values for fields x,y and z
49
+ # (their value will be set to the default, and omitted in proto text
50
+ # output):
51
+ #
52
+ #
53
+ # f {
54
+ # a : 22
55
+ # b {
56
+ # d : 1
57
+ # }
58
+ # }
59
+ #
60
+ # A repeated field is not allowed except at the last position of a
61
+ # paths string.
62
+ #
63
+ # If a FieldMask object is not present in a get operation, the
64
+ # operation applies to all fields (as if a FieldMask of all fields
65
+ # had been specified).
66
+ #
67
+ # Note that a field mask does not necessarily apply to the
68
+ # top-level response message. In case of a REST get operation, the
69
+ # field mask applies directly to the response, but in case of a REST
70
+ # list operation, the mask instead applies to each individual message
71
+ # in the returned resource list. In case of a REST custom method,
72
+ # other definitions may be used. Where the mask applies will be
73
+ # clearly documented together with its declaration in the API. In
74
+ # any case, the effect on the returned resource/resources is required
75
+ # behavior for APIs.
76
+ #
77
+ # = Field Masks in Update Operations
78
+ #
79
+ # A field mask in update operations specifies which fields of the
80
+ # targeted resource are going to be updated. The API is required
81
+ # to only change the values of the fields as specified in the mask
82
+ # and leave the others untouched. If a resource is passed in to
83
+ # describe the updated values, the API ignores the values of all
84
+ # fields not covered by the mask.
85
+ #
86
+ # If a repeated field is specified for an update operation, the existing
87
+ # repeated values in the target resource will be overwritten by the new values.
88
+ # Note that a repeated field is only allowed in the last position of a +paths+
89
+ # string.
90
+ #
91
+ # If a sub-message is specified in the last position of the field mask for an
92
+ # update operation, then the existing sub-message in the target resource is
93
+ # overwritten. Given the target message:
94
+ #
95
+ # f {
96
+ # b {
97
+ # d : 1
98
+ # x : 2
99
+ # }
100
+ # c : 1
101
+ # }
102
+ #
103
+ # And an update message:
104
+ #
105
+ # f {
106
+ # b {
107
+ # d : 10
108
+ # }
109
+ # }
110
+ #
111
+ # then if the field mask is:
112
+ #
113
+ # paths: "f.b"
114
+ #
115
+ # then the result will be:
116
+ #
117
+ # f {
118
+ # b {
119
+ # d : 10
120
+ # }
121
+ # c : 1
122
+ # }
123
+ #
124
+ # However, if the update mask was:
125
+ #
126
+ # paths: "f.b.d"
127
+ #
128
+ # then the result would be:
129
+ #
130
+ # f {
131
+ # b {
132
+ # d : 10
133
+ # x : 2
134
+ # }
135
+ # c : 1
136
+ # }
137
+ #
138
+ # In order to reset a field's value to the default, the field must
139
+ # be in the mask and set to the default value in the provided resource.
140
+ # Hence, in order to reset all fields of a resource, provide a default
141
+ # instance of the resource and set all fields in the mask, or do
142
+ # not provide a mask as described below.
143
+ #
144
+ # If a field mask is not present on update, the operation applies to
145
+ # all fields (as if a field mask of all fields has been specified).
146
+ # Note that in the presence of schema evolution, this may mean that
147
+ # fields the client does not know and has therefore not filled into
148
+ # the request will be reset to their default. If this is unwanted
149
+ # behavior, a specific service may require a client to always specify
150
+ # a field mask, producing an error if not.
151
+ #
152
+ # As with get operations, the location of the resource which
153
+ # describes the updated values in the request message depends on the
154
+ # operation kind. In any case, the effect of the field mask is
155
+ # required to be honored by the API.
156
+ #
157
+ # == Considerations for HTTP REST
158
+ #
159
+ # The HTTP kind of an update operation which uses a field mask must
160
+ # be set to PATCH instead of PUT in order to satisfy HTTP semantics
161
+ # (PUT must only be used for full updates).
162
+ #
163
+ # = JSON Encoding of Field Masks
164
+ #
165
+ # In JSON, a field mask is encoded as a single string where paths are
166
+ # separated by a comma. Fields name in each path are converted
167
+ # to/from lower-camel naming conventions.
168
+ #
169
+ # As an example, consider the following message declarations:
170
+ #
171
+ # message Profile {
172
+ # User user = 1;
173
+ # Photo photo = 2;
174
+ # }
175
+ # message User {
176
+ # string display_name = 1;
177
+ # string address = 2;
178
+ # }
179
+ #
180
+ # In proto a field mask for +Profile+ may look as such:
181
+ #
182
+ # mask {
183
+ # paths: "user.display_name"
184
+ # paths: "photo"
185
+ # }
186
+ #
187
+ # In JSON, the same mask is represented as below:
188
+ #
189
+ # {
190
+ # mask: "user.displayName,photo"
191
+ # }
192
+ #
193
+ # = Field Masks and Oneof Fields
194
+ #
195
+ # Field masks treat fields in oneofs just as regular fields. Consider the
196
+ # following message:
197
+ #
198
+ # message SampleMessage {
199
+ # oneof test_oneof {
200
+ # string name = 4;
201
+ # SubMessage sub_message = 9;
202
+ # }
203
+ # }
204
+ #
205
+ # The field mask can be:
206
+ #
207
+ # mask {
208
+ # paths: "name"
209
+ # }
210
+ #
211
+ # Or:
212
+ #
213
+ # mask {
214
+ # paths: "sub_message"
215
+ # }
216
+ #
217
+ # Note that oneof type names ("test_oneof" in this case) cannot be used in
218
+ # paths.
219
+ #
220
+ # == Field Mask Verification
221
+ #
222
+ # The implementation of any API method which has a FieldMask type field in the
223
+ # request should verify the included field paths, and return an
224
+ # +INVALID_ARGUMENT+ error if any path is duplicated or unmappable.
225
+ # @!attribute [rw] paths
226
+ # @return [Array<String>]
227
+ # The set of field mask paths.
228
+ class FieldMask; end
229
+ end
230
+ end