google-cloud-recaptcha_enterprise-v1beta1 0.4.3 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -41,12 +41,24 @@ module Google
41
41
  # "projects/\\{project_number}/assessments/\\{assessment_id}".
42
42
  # @!attribute [rw] annotation
43
43
  # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest::Annotation]
44
- # Required. The annotation that will be assigned to the Event.
44
+ # Optional. The annotation that will be assigned to the Event. This field can be left
45
+ # empty to provide reasons that apply to an event without concluding whether
46
+ # the event is legitimate or fraudulent.
47
+ # @!attribute [rw] reasons
48
+ # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest::Reason>]
49
+ # Optional. Optional reasons for the annotation that will be assigned to the Event.
50
+ # @!attribute [rw] hashed_account_id
51
+ # @return [::String]
52
+ # Optional. Optional unique stable hashed user identifier to apply to the assessment.
53
+ # This is an alternative to setting the hashed_account_id in
54
+ # CreateAssessment, for example when the account identifier is not yet known
55
+ # in the initial request. It is recommended that the identifier is hashed
56
+ # using hmac-sha256 with stable secret.
45
57
  class AnnotateAssessmentRequest
46
58
  include ::Google::Protobuf::MessageExts
47
59
  extend ::Google::Protobuf::MessageExts::ClassMethods
48
60
 
49
- # Enum that reprensents the types of annotations.
61
+ # Enum that represents the types of annotations.
50
62
  module Annotation
51
63
  # Default unspecified type.
52
64
  ANNOTATION_UNSPECIFIED = 0
@@ -56,6 +68,60 @@ module Google
56
68
 
57
69
  # Provides information that the event turned out to be fraudulent.
58
70
  FRAUDULENT = 2
71
+
72
+ # Provides information that the event was related to a login event in which
73
+ # the user typed the correct password. Deprecated, prefer indicating
74
+ # CORRECT_PASSWORD through the reasons field instead.
75
+ PASSWORD_CORRECT = 3
76
+
77
+ # Provides information that the event was related to a login event in which
78
+ # the user typed the incorrect password. Deprecated, prefer indicating
79
+ # INCORRECT_PASSWORD through the reasons field instead.
80
+ PASSWORD_INCORRECT = 4
81
+ end
82
+
83
+ # Enum that represents potential reasons for annotating an assessment.
84
+ module Reason
85
+ # Default unspecified reason.
86
+ REASON_UNSPECIFIED = 0
87
+
88
+ # Indicates a chargeback issued for the transaction with no other details.
89
+ # When possible, specify the type by using CHARGEBACK_FRAUD or
90
+ # CHARGEBACK_DISPUTE instead.
91
+ CHARGEBACK = 1
92
+
93
+ # Indicates a chargeback related to an alleged unauthorized transaction
94
+ # from the cardholder's perspective (for example, the card number was
95
+ # stolen).
96
+ CHARGEBACK_FRAUD = 8
97
+
98
+ # Indicates a chargeback related to the cardholder having provided their
99
+ # card details but allegedly not being satisfied with the purchase
100
+ # (for example, misrepresentation, attempted cancellation).
101
+ CHARGEBACK_DISPUTE = 9
102
+
103
+ # Indicates the transaction associated with the assessment is suspected of
104
+ # being fraudulent based on the payment method, billing details, shipping
105
+ # address or other transaction information.
106
+ PAYMENT_HEURISTICS = 2
107
+
108
+ # Indicates that the user was served a 2FA challenge. An old assessment
109
+ # with `ENUM_VALUES.INITIATED_TWO_FACTOR` reason that has not been
110
+ # overwritten with `PASSED_TWO_FACTOR` is treated as an abandoned 2FA flow.
111
+ # This is equivalent to `FAILED_TWO_FACTOR`.
112
+ INITIATED_TWO_FACTOR = 7
113
+
114
+ # Indicates that the user passed a 2FA challenge.
115
+ PASSED_TWO_FACTOR = 3
116
+
117
+ # Indicates that the user failed a 2FA challenge.
118
+ FAILED_TWO_FACTOR = 4
119
+
120
+ # Indicates the user provided the correct password.
121
+ CORRECT_PASSWORD = 5
122
+
123
+ # Indicates the user provided an incorrect password.
124
+ INCORRECT_PASSWORD = 6
59
125
  end
60
126
  end
61
127
 
@@ -65,6 +131,24 @@ module Google
65
131
  extend ::Google::Protobuf::MessageExts::ClassMethods
66
132
  end
67
133
 
134
+ # Password leak verification info.
135
+ # @!attribute [rw] hashed_user_credentials
136
+ # @return [::String]
137
+ # Optional. Scrypt hash of the username+password that the customer wants to verify
138
+ # against a known password leak.
139
+ # @!attribute [r] credentials_leaked
140
+ # @return [::Boolean]
141
+ # Output only. Whether or not the user's credentials are present in a known leak.
142
+ # @!attribute [rw] canonicalized_username
143
+ # @return [::String]
144
+ # Optional. The username part of the user credentials for which we want to trigger a
145
+ # leak check in canonicalized form. This is the same data used to create the
146
+ # hashed_user_credentials on the customer side.
147
+ class PasswordLeakVerification
148
+ include ::Google::Protobuf::MessageExts
149
+ extend ::Google::Protobuf::MessageExts::ClassMethods
150
+ end
151
+
68
152
  # A recaptcha assessment resource.
69
153
  # @!attribute [r] name
70
154
  # @return [::String]
@@ -84,11 +168,20 @@ module Google
84
168
  # @!attribute [r] reasons
85
169
  # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment::ClassificationReason>]
86
170
  # Output only. Reasons contributing to the risk analysis verdict.
171
+ # @!attribute [rw] password_leak_verification
172
+ # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::PasswordLeakVerification]
173
+ # Information about the user's credentials used to check for leaks.
174
+ # This feature is part of the Early Access Program (EAP). Exercise caution,
175
+ # and do not deploy integrations based on this feature in a production
176
+ # environment.
177
+ # @!attribute [rw] account_defender_assessment
178
+ # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::AccountDefenderAssessment]
179
+ # Assessment returned by Account Defender when a hashed_account_id is
180
+ # provided.
87
181
  class Assessment
88
182
  include ::Google::Protobuf::MessageExts
89
183
  extend ::Google::Protobuf::MessageExts::ClassMethods
90
184
 
91
- # LINT.IfChange(classification_reason)
92
185
  # Reasons contributing to the risk analysis verdict.
93
186
  module ClassificationReason
94
187
  # Default unspecified type.
@@ -133,6 +226,10 @@ module Google
133
226
  # Optional. The expected action for this type of event. This should be the same action
134
227
  # provided at token generation time on client-side platforms already
135
228
  # integrated with recaptcha enterprise.
229
+ # @!attribute [rw] hashed_account_id
230
+ # @return [::String]
231
+ # Optional. Optional unique stable hashed user identifier for the request. The
232
+ # identifier should ideally be hashed using sha256 with stable secret.
136
233
  class Event
137
234
  include ::Google::Protobuf::MessageExts
138
235
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -140,7 +237,11 @@ module Google
140
237
 
141
238
  # @!attribute [rw] valid
142
239
  # @return [::Boolean]
143
- # Whether the provided user response token is valid.
240
+ # Whether the provided user response token is valid. When valid = false, the
241
+ # reason could be specified in invalid_reason or it could also be due to
242
+ # a user failing to solve a challenge or a sitekey mismatch (i.e the sitekey
243
+ # used to generate the token was different than the one specified in the
244
+ # assessment).
144
245
  # @!attribute [rw] invalid_reason
145
246
  # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::TokenProperties::InvalidReason]
146
247
  # Reason associated with the response when valid = false.
@@ -157,7 +258,6 @@ module Google
157
258
  include ::Google::Protobuf::MessageExts
158
259
  extend ::Google::Protobuf::MessageExts::ClassMethods
159
260
 
160
- # LINT.IfChange
161
261
  # Enum that represents the types of invalid token reasons.
162
262
  module InvalidReason
163
263
  # Default unspecified type.
@@ -183,190 +283,43 @@ module Google
183
283
 
184
284
  # The user verification token was not present. It is a required input.
185
285
  MISSING = 6
186
- end
187
- end
188
-
189
- # The create key request message.
190
- # @!attribute [rw] parent
191
- # @return [::String]
192
- # Required. The name of the project in which the key will be created, in the
193
- # format "projects/\\{project_number}".
194
- # @!attribute [rw] key
195
- # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::Key]
196
- # Required. Information to create a reCAPTCHA Enterprise key.
197
- class CreateKeyRequest
198
- include ::Google::Protobuf::MessageExts
199
- extend ::Google::Protobuf::MessageExts::ClassMethods
200
- end
201
286
 
202
- # The list keys request message.
203
- # @!attribute [rw] parent
204
- # @return [::String]
205
- # Required. The name of the project that contains the keys that will be
206
- # listed, in the format "projects/\\{project_number}".
207
- # @!attribute [rw] page_size
208
- # @return [::Integer]
209
- # Optional. The maximum number of keys to return. Default is 10. Max limit is
210
- # 1000.
211
- # @!attribute [rw] page_token
212
- # @return [::String]
213
- # Optional. The next_page_token value returned from a previous.
214
- # ListKeysRequest, if any.
215
- class ListKeysRequest
216
- include ::Google::Protobuf::MessageExts
217
- extend ::Google::Protobuf::MessageExts::ClassMethods
218
- end
219
-
220
- # Response to request to list keys in a project.
221
- # @!attribute [rw] keys
222
- # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1beta1::Key>]
223
- # Key details.
224
- # @!attribute [rw] next_page_token
225
- # @return [::String]
226
- # Token to retrieve the next page of results. It is set to empty if no keys
227
- # remain in results.
228
- class ListKeysResponse
229
- include ::Google::Protobuf::MessageExts
230
- extend ::Google::Protobuf::MessageExts::ClassMethods
231
- end
232
-
233
- # The get key request message.
234
- # @!attribute [rw] name
235
- # @return [::String]
236
- # Required. The name of the requested key, in the format
237
- # "projects/\\{project_number}/keys/\\{key_id}".
238
- class GetKeyRequest
239
- include ::Google::Protobuf::MessageExts
240
- extend ::Google::Protobuf::MessageExts::ClassMethods
241
- end
242
-
243
- # The update key request message.
244
- # @!attribute [rw] key
245
- # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::Key]
246
- # Required. The key to update.
247
- # @!attribute [rw] update_mask
248
- # @return [::Google::Protobuf::FieldMask]
249
- # Optional. The mask to control which field of the key get updated. If the mask is not
250
- # present, all fields will be updated.
251
- class UpdateKeyRequest
252
- include ::Google::Protobuf::MessageExts
253
- extend ::Google::Protobuf::MessageExts::ClassMethods
254
- end
255
-
256
- # The delete key request message.
257
- # @!attribute [rw] name
258
- # @return [::String]
259
- # Required. The name of the key to be deleted, in the format
260
- # "projects/\\{project_number}/keys/\\{key_id}".
261
- class DeleteKeyRequest
262
- include ::Google::Protobuf::MessageExts
263
- extend ::Google::Protobuf::MessageExts::ClassMethods
264
- end
265
-
266
- # A key used to identify and configure applications (web and/or mobile) that
267
- # use reCAPTCHA Enterprise.
268
- # @!attribute [rw] name
269
- # @return [::String]
270
- # The resource name for the Key in the format
271
- # "projects/\\{project_number}/keys/\\{key_id}".
272
- # @!attribute [rw] display_name
273
- # @return [::String]
274
- # Human-readable display name of this key. Modifiable by user.
275
- # @!attribute [rw] web_settings
276
- # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::WebKeySettings]
277
- # Settings for keys that can be used by websites.
278
- # @!attribute [rw] android_settings
279
- # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::AndroidKeySettings]
280
- # Settings for keys that can be used by Android apps.
281
- # @!attribute [rw] ios_settings
282
- # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::IOSKeySettings]
283
- # Settings for keys that can be used by iOS apps.
284
- class Key
285
- include ::Google::Protobuf::MessageExts
286
- extend ::Google::Protobuf::MessageExts::ClassMethods
287
+ # A retriable error (such as network failure) occurred on the browser.
288
+ # Could easily be simulated by an attacker.
289
+ BROWSER_ERROR = 7
290
+ end
287
291
  end
288
292
 
289
- # Settings specific to keys that can be used by websites.
290
- # @!attribute [rw] enforce_allowed_domains
291
- # @return [::Boolean]
292
- # Whether allowed_domains is enforced or not.
293
- # @!attribute [rw] allowed_domains
294
- # @return [::Array<::String>]
295
- # Domains or subdomains of websites allowed to use the key. All subdomains
296
- # of an allowed domain are automatically allowed. A valid domain requires a
297
- # host and must not include any path, port, query or fragment.
298
- # Examples: 'example.com' or 'subdomain.example.com'
299
- # @!attribute [rw] allow_amp_traffic
300
- # @return [::Boolean]
301
- # Whether this key can be used on AMP (Accelerated Mobile Pages) websites.
302
- # @!attribute [rw] integration_type
303
- # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::WebKeySettings::IntegrationType]
304
- # Required. Describes how this key is integrated with the website.
305
- # @!attribute [rw] challenge_security_preference
306
- # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::WebKeySettings::ChallengeSecurityPreference]
307
- # Settings for the frequency and difficulty at which this key triggers
308
- # captcha challenges. This should only be specified for IntegrationTypes
309
- # CHECKBOX_CHALLENGE and INVISIBLE_CHALLENGE.
310
- class WebKeySettings
293
+ # Account Defender risk assessment.
294
+ # @!attribute [rw] labels
295
+ # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1beta1::AccountDefenderAssessment::AccountDefenderLabel>]
296
+ # Labels for this request.
297
+ class AccountDefenderAssessment
311
298
  include ::Google::Protobuf::MessageExts
312
299
  extend ::Google::Protobuf::MessageExts::ClassMethods
313
300
 
314
- # Enum that represents the integration types for web keys.
315
- module IntegrationType
316
- # Default type that indicates this enum hasn't been specified. This is not
317
- # a valid IntegrationType, one of the other types must be specified
318
- # instead.
319
- INTEGRATION_TYPE_UNSPECIFIED = 0
320
-
321
- # Only used to produce scores. It doesn't display the "I'm not a robot"
322
- # checkbox and never shows captcha challenges.
323
- SCORE_ONLY = 1
324
-
325
- # Displays the "I'm not a robot" checkbox and may show captcha challenges
326
- # after it is checked.
327
- CHECKBOX_CHALLENGE = 2
328
-
329
- # Doesn't display the "I'm not a robot" checkbox, but may show captcha
330
- # challenges after risk analysis.
331
- INVISIBLE_CHALLENGE = 3
332
- end
301
+ # Labels returned by Account Defender for this request.
302
+ module AccountDefenderLabel
303
+ # Default unspecified type.
304
+ ACCOUNT_DEFENDER_LABEL_UNSPECIFIED = 0
333
305
 
334
- # Enum that represents the possible challenge frequency and difficulty
335
- # configurations for a web key.
336
- module ChallengeSecurityPreference
337
- # Default type that indicates this enum hasn't been specified.
338
- CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED = 0
306
+ # The request matches a known good profile for the user.
307
+ PROFILE_MATCH = 1
339
308
 
340
- # Key tends to show fewer and easier challenges.
341
- USABILITY = 1
309
+ # The request is potentially a suspicious login event and should be further
310
+ # verified either via multi-factor authentication or another system.
311
+ SUSPICIOUS_LOGIN_ACTIVITY = 2
342
312
 
343
- # Key tends to show balanced (in amount and difficulty) challenges.
344
- BALANCED = 2
313
+ # The request matched a profile that previously had suspicious account
314
+ # creation behavior. This could mean this is a fake account.
315
+ SUSPICIOUS_ACCOUNT_CREATION = 3
345
316
 
346
- # Key tends to show more and harder challenges.
347
- SECURITY = 3
317
+ # The account in the request has a high number of related accounts. It does
318
+ # not necessarily imply that the account is bad but could require
319
+ # investigating.
320
+ RELATED_ACCOUNTS_NUMBER_HIGH = 4
348
321
  end
349
322
  end
350
-
351
- # Settings specific to keys that can be used by Android apps.
352
- # @!attribute [rw] allowed_package_names
353
- # @return [::Array<::String>]
354
- # Android package names of apps allowed to use the key.
355
- # Example: 'com.companyname.appname'
356
- class AndroidKeySettings
357
- include ::Google::Protobuf::MessageExts
358
- extend ::Google::Protobuf::MessageExts::ClassMethods
359
- end
360
-
361
- # Settings specific to keys that can be used by iOS apps.
362
- # @!attribute [rw] allowed_bundle_ids
363
- # @return [::Array<::String>]
364
- # iOS bundle ids of apps allowed to use the key.
365
- # Example: 'com.companyname.productname.appname'
366
- class IOSKeySettings
367
- include ::Google::Protobuf::MessageExts
368
- extend ::Google::Protobuf::MessageExts::ClassMethods
369
- end
370
323
  end
371
324
  end
372
325
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-recaptcha_enterprise-v1beta1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-11 00:00:00.000000000 Z
11
+ date: 2022-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -182,8 +182,6 @@ files:
182
182
  - proto_docs/google/api/field_behavior.rb
183
183
  - proto_docs/google/api/resource.rb
184
184
  - proto_docs/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.rb
185
- - proto_docs/google/protobuf/empty.rb
186
- - proto_docs/google/protobuf/field_mask.rb
187
185
  - proto_docs/google/protobuf/timestamp.rb
188
186
  homepage: https://github.com/googleapis/google-cloud-ruby
189
187
  licenses:
@@ -204,7 +202,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
204
202
  - !ruby/object:Gem::Version
205
203
  version: '0'
206
204
  requirements: []
207
- rubygems_version: 3.2.17
205
+ rubygems_version: 3.3.5
208
206
  signing_key:
209
207
  specification_version: 4
210
208
  summary: API Client library for the reCAPTCHA Enterprise V1beta1 API
@@ -1,36 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Copyright 2020 Google LLC
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # https://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
-
19
-
20
- module Google
21
- module Protobuf
22
- # A generic empty message that you can re-use to avoid defining duplicated
23
- # empty messages in your APIs. A typical example is to use it as the request
24
- # or the response type of an API method. For instance:
25
- #
26
- # service Foo {
27
- # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
28
- # }
29
- #
30
- # The JSON representation for `Empty` is empty JSON object `{}`.
31
- class Empty
32
- include ::Google::Protobuf::MessageExts
33
- extend ::Google::Protobuf::MessageExts::ClassMethods
34
- end
35
- end
36
- end
@@ -1,229 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Copyright 2020 Google LLC
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # https://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
-
19
-
20
- module Google
21
- module Protobuf
22
- # `FieldMask` represents a set of symbolic field paths, for example:
23
- #
24
- # paths: "f.a"
25
- # paths: "f.b.d"
26
- #
27
- # Here `f` represents a field in some root message, `a` and `b`
28
- # fields in the message found in `f`, and `d` a field found in the
29
- # message in `f.b`.
30
- #
31
- # Field masks are used to specify a subset of fields that should be
32
- # returned by a get operation or modified by an update operation.
33
- # Field masks also have a custom JSON encoding (see below).
34
- #
35
- # # Field Masks in Projections
36
- #
37
- # When used in the context of a projection, a response message or
38
- # sub-message is filtered by the API to only contain those fields as
39
- # specified in the mask. For example, if the mask in the previous
40
- # example is applied to a response message as follows:
41
- #
42
- # f {
43
- # a : 22
44
- # b {
45
- # d : 1
46
- # x : 2
47
- # }
48
- # y : 13
49
- # }
50
- # z: 8
51
- #
52
- # The result will not contain specific values for fields x,y and z
53
- # (their value will be set to the default, and omitted in proto text
54
- # output):
55
- #
56
- #
57
- # f {
58
- # a : 22
59
- # b {
60
- # d : 1
61
- # }
62
- # }
63
- #
64
- # A repeated field is not allowed except at the last position of a
65
- # paths string.
66
- #
67
- # If a FieldMask object is not present in a get operation, the
68
- # operation applies to all fields (as if a FieldMask of all fields
69
- # had been specified).
70
- #
71
- # Note that a field mask does not necessarily apply to the
72
- # top-level response message. In case of a REST get operation, the
73
- # field mask applies directly to the response, but in case of a REST
74
- # list operation, the mask instead applies to each individual message
75
- # in the returned resource list. In case of a REST custom method,
76
- # other definitions may be used. Where the mask applies will be
77
- # clearly documented together with its declaration in the API. In
78
- # any case, the effect on the returned resource/resources is required
79
- # behavior for APIs.
80
- #
81
- # # Field Masks in Update Operations
82
- #
83
- # A field mask in update operations specifies which fields of the
84
- # targeted resource are going to be updated. The API is required
85
- # to only change the values of the fields as specified in the mask
86
- # and leave the others untouched. If a resource is passed in to
87
- # describe the updated values, the API ignores the values of all
88
- # fields not covered by the mask.
89
- #
90
- # If a repeated field is specified for an update operation, new values will
91
- # be appended to the existing repeated field in the target resource. Note that
92
- # a repeated field is only allowed in the last position of a `paths` string.
93
- #
94
- # If a sub-message is specified in the last position of the field mask for an
95
- # update operation, then new value will be merged into the existing sub-message
96
- # in the target resource.
97
- #
98
- # For example, given the target message:
99
- #
100
- # f {
101
- # b {
102
- # d: 1
103
- # x: 2
104
- # }
105
- # c: [1]
106
- # }
107
- #
108
- # And an update message:
109
- #
110
- # f {
111
- # b {
112
- # d: 10
113
- # }
114
- # c: [2]
115
- # }
116
- #
117
- # then if the field mask is:
118
- #
119
- # paths: ["f.b", "f.c"]
120
- #
121
- # then the result will be:
122
- #
123
- # f {
124
- # b {
125
- # d: 10
126
- # x: 2
127
- # }
128
- # c: [1, 2]
129
- # }
130
- #
131
- # An implementation may provide options to override this default behavior for
132
- # repeated and message fields.
133
- #
134
- # In order to reset a field's value to the default, the field must
135
- # be in the mask and set to the default value in the provided resource.
136
- # Hence, in order to reset all fields of a resource, provide a default
137
- # instance of the resource and set all fields in the mask, or do
138
- # not provide a mask as described below.
139
- #
140
- # If a field mask is not present on update, the operation applies to
141
- # all fields (as if a field mask of all fields has been specified).
142
- # Note that in the presence of schema evolution, this may mean that
143
- # fields the client does not know and has therefore not filled into
144
- # the request will be reset to their default. If this is unwanted
145
- # behavior, a specific service may require a client to always specify
146
- # a field mask, producing an error if not.
147
- #
148
- # As with get operations, the location of the resource which
149
- # describes the updated values in the request message depends on the
150
- # operation kind. In any case, the effect of the field mask is
151
- # required to be honored by the API.
152
- #
153
- # ## Considerations for HTTP REST
154
- #
155
- # The HTTP kind of an update operation which uses a field mask must
156
- # be set to PATCH instead of PUT in order to satisfy HTTP semantics
157
- # (PUT must only be used for full updates).
158
- #
159
- # # JSON Encoding of Field Masks
160
- #
161
- # In JSON, a field mask is encoded as a single string where paths are
162
- # separated by a comma. Fields name in each path are converted
163
- # to/from lower-camel naming conventions.
164
- #
165
- # As an example, consider the following message declarations:
166
- #
167
- # message Profile {
168
- # User user = 1;
169
- # Photo photo = 2;
170
- # }
171
- # message User {
172
- # string display_name = 1;
173
- # string address = 2;
174
- # }
175
- #
176
- # In proto a field mask for `Profile` may look as such:
177
- #
178
- # mask {
179
- # paths: "user.display_name"
180
- # paths: "photo"
181
- # }
182
- #
183
- # In JSON, the same mask is represented as below:
184
- #
185
- # {
186
- # mask: "user.displayName,photo"
187
- # }
188
- #
189
- # # Field Masks and Oneof Fields
190
- #
191
- # Field masks treat fields in oneofs just as regular fields. Consider the
192
- # following message:
193
- #
194
- # message SampleMessage {
195
- # oneof test_oneof {
196
- # string name = 4;
197
- # SubMessage sub_message = 9;
198
- # }
199
- # }
200
- #
201
- # The field mask can be:
202
- #
203
- # mask {
204
- # paths: "name"
205
- # }
206
- #
207
- # Or:
208
- #
209
- # mask {
210
- # paths: "sub_message"
211
- # }
212
- #
213
- # Note that oneof type names ("test_oneof" in this case) cannot be used in
214
- # paths.
215
- #
216
- # ## Field Mask Verification
217
- #
218
- # The implementation of any API method which has a FieldMask type field in the
219
- # request should verify the included field paths, and return an
220
- # `INVALID_ARGUMENT` error if any path is unmappable.
221
- # @!attribute [rw] paths
222
- # @return [::Array<::String>]
223
- # The set of field mask paths.
224
- class FieldMask
225
- include ::Google::Protobuf::MessageExts
226
- extend ::Google::Protobuf::MessageExts::ClassMethods
227
- end
228
- end
229
- end