google-cloud-talent 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.yardopts +9 -0
- data/LICENSE +201 -0
- data/README.md +69 -0
- data/lib/google/cloud/talent.rb +456 -0
- data/lib/google/cloud/talent/v4beta1.rb +484 -0
- data/lib/google/cloud/talent/v4beta1/batch_pb.rb +21 -0
- data/lib/google/cloud/talent/v4beta1/common_pb.rb +264 -0
- data/lib/google/cloud/talent/v4beta1/company_pb.rb +39 -0
- data/lib/google/cloud/talent/v4beta1/company_service_client.rb +479 -0
- data/lib/google/cloud/talent/v4beta1/company_service_client_config.json +51 -0
- data/lib/google/cloud/talent/v4beta1/company_service_pb.rb +53 -0
- data/lib/google/cloud/talent/v4beta1/company_service_services_pb.rb +56 -0
- data/lib/google/cloud/talent/v4beta1/completion_client.rb +303 -0
- data/lib/google/cloud/talent/v4beta1/completion_client_config.json +31 -0
- data/lib/google/cloud/talent/v4beta1/completion_service_pb.rb +53 -0
- data/lib/google/cloud/talent/v4beta1/completion_service_services_pb.rb +48 -0
- data/lib/google/cloud/talent/v4beta1/credentials.rb +42 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/common.rb +890 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/company.rb +125 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/company_service.rb +130 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/completion_service.rb +153 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/event.rb +252 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/event_service.rb +34 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/filters.rb +853 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/histogram.rb +56 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/job.rb +409 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/job_service.rb +732 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/profile.rb +1125 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/profile_service.rb +392 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/resume_service.rb +98 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/tenant.rb +68 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/tenant_service.rb +119 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/duration.rb +91 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/empty.rb +29 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/field_mask.rb +230 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/timestamp.rb +109 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/wrappers.rb +34 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/type/date.rb +39 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/type/latlng.rb +65 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/type/money.rb +36 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/type/postal_address.rb +126 -0
- data/lib/google/cloud/talent/v4beta1/doc/google/type/timeofday.rb +38 -0
- data/lib/google/cloud/talent/v4beta1/event_pb.rb +75 -0
- data/lib/google/cloud/talent/v4beta1/event_service_client.rb +239 -0
- data/lib/google/cloud/talent/v4beta1/event_service_client_config.json +31 -0
- data/lib/google/cloud/talent/v4beta1/event_service_pb.rb +24 -0
- data/lib/google/cloud/talent/v4beta1/event_service_services_pb.rb +53 -0
- data/lib/google/cloud/talent/v4beta1/filters_pb.rb +182 -0
- data/lib/google/cloud/talent/v4beta1/helpers.rb +90 -0
- data/lib/google/cloud/talent/v4beta1/histogram_pb.rb +28 -0
- data/lib/google/cloud/talent/v4beta1/job_pb.rb +69 -0
- data/lib/google/cloud/talent/v4beta1/job_service_client.rb +1295 -0
- data/lib/google/cloud/talent/v4beta1/job_service_client_config.json +66 -0
- data/lib/google/cloud/talent/v4beta1/job_service_pb.rb +142 -0
- data/lib/google/cloud/talent/v4beta1/job_service_services_pb.rb +88 -0
- data/lib/google/cloud/talent/v4beta1/profile_pb.rb +249 -0
- data/lib/google/cloud/talent/v4beta1/profile_service_client.rb +757 -0
- data/lib/google/cloud/talent/v4beta1/profile_service_client_config.json +56 -0
- data/lib/google/cloud/talent/v4beta1/profile_service_pb.rb +81 -0
- data/lib/google/cloud/talent/v4beta1/profile_service_services_pb.rb +65 -0
- data/lib/google/cloud/talent/v4beta1/resume_service_client.rb +296 -0
- data/lib/google/cloud/talent/v4beta1/resume_service_client_config.json +31 -0
- data/lib/google/cloud/talent/v4beta1/resume_service_pb.rb +37 -0
- data/lib/google/cloud/talent/v4beta1/resume_service_services_pb.rb +75 -0
- data/lib/google/cloud/talent/v4beta1/tenant_pb.rb +31 -0
- data/lib/google/cloud/talent/v4beta1/tenant_service_client.rb +466 -0
- data/lib/google/cloud/talent/v4beta1/tenant_service_client_config.json +51 -0
- data/lib/google/cloud/talent/v4beta1/tenant_service_pb.rb +52 -0
- data/lib/google/cloud/talent/v4beta1/tenant_service_services_pb.rb +55 -0
- metadata +197 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Copyright 2019 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 Cloud
|
|
18
|
+
module Talent
|
|
19
|
+
module V4beta1
|
|
20
|
+
# A Tenant resource represents a tenant in the service. A tenant is a group or
|
|
21
|
+
# entity that shares common access with specific privileges for resources like
|
|
22
|
+
# profiles. Customer may create multiple tenants to provide data isolation for
|
|
23
|
+
# different groups.
|
|
24
|
+
# @!attribute [rw] name
|
|
25
|
+
# @return [String]
|
|
26
|
+
# Required during tenant update.
|
|
27
|
+
#
|
|
28
|
+
# The resource name for a tenant. This is generated by the service when a
|
|
29
|
+
# tenant is created.
|
|
30
|
+
#
|
|
31
|
+
# The format is "projects/{project_id}/tenants/{tenant_id}", for example,
|
|
32
|
+
# "projects/api-test-project/tenants/foo".
|
|
33
|
+
# @!attribute [rw] external_id
|
|
34
|
+
# @return [String]
|
|
35
|
+
# Required.
|
|
36
|
+
#
|
|
37
|
+
# Client side tenant identifier, used to uniquely identify the tenant.
|
|
38
|
+
#
|
|
39
|
+
# The maximum number of allowed characters is 255.
|
|
40
|
+
# @!attribute [rw] usage_type
|
|
41
|
+
# @return [Google::Cloud::Talent::V4beta1::Tenant::DataUsageType]
|
|
42
|
+
# Optional.
|
|
43
|
+
#
|
|
44
|
+
# Indicates whether data owned by this tenant may be used to provide product
|
|
45
|
+
# improvements across other tenants.
|
|
46
|
+
#
|
|
47
|
+
# Defaults behavior is
|
|
48
|
+
# {Google::Cloud::Talent::V4beta1::Tenant::DataUsageType::ISOLATED DataUsageType::ISOLATED}
|
|
49
|
+
# if it's unset.
|
|
50
|
+
class Tenant
|
|
51
|
+
# Enum that represents how user data owned by the tenant is used.
|
|
52
|
+
module DataUsageType
|
|
53
|
+
# Default value.
|
|
54
|
+
DATA_USAGE_TYPE_UNSPECIFIED = 0
|
|
55
|
+
|
|
56
|
+
# Data owned by this tenant is used to improve search/recommendation
|
|
57
|
+
# quality across tenants.
|
|
58
|
+
AGGREGATED = 1
|
|
59
|
+
|
|
60
|
+
# Data owned by this tenant is used to improve search/recommendation
|
|
61
|
+
# quality for this tenant only.
|
|
62
|
+
ISOLATED = 2
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Copyright 2019 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 Cloud
|
|
18
|
+
module Talent
|
|
19
|
+
module V4beta1
|
|
20
|
+
# The Request of the CreateTenant method.
|
|
21
|
+
# @!attribute [rw] parent
|
|
22
|
+
# @return [String]
|
|
23
|
+
# Required.
|
|
24
|
+
#
|
|
25
|
+
# Resource name of the project under which the tenant is created.
|
|
26
|
+
#
|
|
27
|
+
# The format is "projects/{project_id}", for example,
|
|
28
|
+
# "projects/api-test-project".
|
|
29
|
+
# @!attribute [rw] tenant
|
|
30
|
+
# @return [Google::Cloud::Talent::V4beta1::Tenant]
|
|
31
|
+
# Required.
|
|
32
|
+
#
|
|
33
|
+
# The tenant to be created.
|
|
34
|
+
class CreateTenantRequest; end
|
|
35
|
+
|
|
36
|
+
# Request for getting a tenant by name.
|
|
37
|
+
# @!attribute [rw] name
|
|
38
|
+
# @return [String]
|
|
39
|
+
# Required.
|
|
40
|
+
#
|
|
41
|
+
# The resource name of the tenant to be retrieved.
|
|
42
|
+
#
|
|
43
|
+
# The format is "projects/{project_id}/tenants/{tenant_id}", for example,
|
|
44
|
+
# "projects/api-test-project/tenants/foo".
|
|
45
|
+
class GetTenantRequest; end
|
|
46
|
+
|
|
47
|
+
# Request for updating a specified tenant.
|
|
48
|
+
# @!attribute [rw] tenant
|
|
49
|
+
# @return [Google::Cloud::Talent::V4beta1::Tenant]
|
|
50
|
+
# Required.
|
|
51
|
+
#
|
|
52
|
+
# The tenant resource to replace the current resource in the system.
|
|
53
|
+
# @!attribute [rw] update_mask
|
|
54
|
+
# @return [Google::Protobuf::FieldMask]
|
|
55
|
+
# Optional but strongly recommended for the best service
|
|
56
|
+
# experience.
|
|
57
|
+
#
|
|
58
|
+
# If
|
|
59
|
+
# {Google::Cloud::Talent::V4beta1::UpdateTenantRequest#update_mask update_mask}
|
|
60
|
+
# is provided, only the specified fields in
|
|
61
|
+
# {Google::Cloud::Talent::V4beta1::UpdateTenantRequest#tenant tenant} are
|
|
62
|
+
# updated. Otherwise all the fields are updated.
|
|
63
|
+
#
|
|
64
|
+
# A field mask to specify the tenant fields to be updated. Only
|
|
65
|
+
# top level fields of {Google::Cloud::Talent::V4beta1::Tenant Tenant} are
|
|
66
|
+
# supported.
|
|
67
|
+
class UpdateTenantRequest; end
|
|
68
|
+
|
|
69
|
+
# Request to delete a tenant.
|
|
70
|
+
# @!attribute [rw] name
|
|
71
|
+
# @return [String]
|
|
72
|
+
# Required.
|
|
73
|
+
#
|
|
74
|
+
# The resource name of the tenant to be deleted.
|
|
75
|
+
#
|
|
76
|
+
# The format is "projects/{project_id}/tenants/{tenant_id}", for example,
|
|
77
|
+
# "projects/api-test-project/tenants/foo".
|
|
78
|
+
class DeleteTenantRequest; end
|
|
79
|
+
|
|
80
|
+
# List tenants for which the client has ACL visibility.
|
|
81
|
+
# @!attribute [rw] parent
|
|
82
|
+
# @return [String]
|
|
83
|
+
# Required.
|
|
84
|
+
#
|
|
85
|
+
# Resource name of the project under which the tenant is created.
|
|
86
|
+
#
|
|
87
|
+
# The format is "projects/{project_id}", for example,
|
|
88
|
+
# "projects/api-test-project".
|
|
89
|
+
# @!attribute [rw] page_token
|
|
90
|
+
# @return [String]
|
|
91
|
+
# Optional.
|
|
92
|
+
#
|
|
93
|
+
# The starting indicator from which to return results.
|
|
94
|
+
# @!attribute [rw] page_size
|
|
95
|
+
# @return [Integer]
|
|
96
|
+
# Optional.
|
|
97
|
+
#
|
|
98
|
+
# The maximum number of tenants to be returned, at most 100.
|
|
99
|
+
# Default is 100 if a non-positive number is provided.
|
|
100
|
+
class ListTenantsRequest; end
|
|
101
|
+
|
|
102
|
+
# Output only.
|
|
103
|
+
#
|
|
104
|
+
# The List tenants response object.
|
|
105
|
+
# @!attribute [rw] tenants
|
|
106
|
+
# @return [Array<Google::Cloud::Talent::V4beta1::Tenant>]
|
|
107
|
+
# Tenants for the current client.
|
|
108
|
+
# @!attribute [rw] next_page_token
|
|
109
|
+
# @return [String]
|
|
110
|
+
# A token to retrieve the next page of results.
|
|
111
|
+
# @!attribute [rw] metadata
|
|
112
|
+
# @return [Google::Cloud::Talent::V4beta1::ResponseMetadata]
|
|
113
|
+
# Additional information for the API invocation, such as the request
|
|
114
|
+
# tracking id.
|
|
115
|
+
class ListTenantsResponse; end
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
end
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Copyright 2019 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
|
+
# A Duration represents a signed, fixed-length span of time represented
|
|
19
|
+
# as a count of seconds and fractions of seconds at nanosecond
|
|
20
|
+
# resolution. It is independent of any calendar and concepts like "day"
|
|
21
|
+
# or "month". It is related to Timestamp in that the difference between
|
|
22
|
+
# two Timestamp values is a Duration and it can be added or subtracted
|
|
23
|
+
# from a Timestamp. Range is approximately +-10,000 years.
|
|
24
|
+
#
|
|
25
|
+
# = Examples
|
|
26
|
+
#
|
|
27
|
+
# Example 1: Compute Duration from two Timestamps in pseudo code.
|
|
28
|
+
#
|
|
29
|
+
# Timestamp start = ...;
|
|
30
|
+
# Timestamp end = ...;
|
|
31
|
+
# Duration duration = ...;
|
|
32
|
+
#
|
|
33
|
+
# duration.seconds = end.seconds - start.seconds;
|
|
34
|
+
# duration.nanos = end.nanos - start.nanos;
|
|
35
|
+
#
|
|
36
|
+
# if (duration.seconds < 0 && duration.nanos > 0) {
|
|
37
|
+
# duration.seconds += 1;
|
|
38
|
+
# duration.nanos -= 1000000000;
|
|
39
|
+
# } else if (durations.seconds > 0 && duration.nanos < 0) {
|
|
40
|
+
# duration.seconds -= 1;
|
|
41
|
+
# duration.nanos += 1000000000;
|
|
42
|
+
# }
|
|
43
|
+
#
|
|
44
|
+
# Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
|
|
45
|
+
#
|
|
46
|
+
# Timestamp start = ...;
|
|
47
|
+
# Duration duration = ...;
|
|
48
|
+
# Timestamp end = ...;
|
|
49
|
+
#
|
|
50
|
+
# end.seconds = start.seconds + duration.seconds;
|
|
51
|
+
# end.nanos = start.nanos + duration.nanos;
|
|
52
|
+
#
|
|
53
|
+
# if (end.nanos < 0) {
|
|
54
|
+
# end.seconds -= 1;
|
|
55
|
+
# end.nanos += 1000000000;
|
|
56
|
+
# } else if (end.nanos >= 1000000000) {
|
|
57
|
+
# end.seconds += 1;
|
|
58
|
+
# end.nanos -= 1000000000;
|
|
59
|
+
# }
|
|
60
|
+
#
|
|
61
|
+
# Example 3: Compute Duration from datetime.timedelta in Python.
|
|
62
|
+
#
|
|
63
|
+
# td = datetime.timedelta(days=3, minutes=10)
|
|
64
|
+
# duration = Duration()
|
|
65
|
+
# duration.FromTimedelta(td)
|
|
66
|
+
#
|
|
67
|
+
# = JSON Mapping
|
|
68
|
+
#
|
|
69
|
+
# In JSON format, the Duration type is encoded as a string rather than an
|
|
70
|
+
# object, where the string ends in the suffix "s" (indicating seconds) and
|
|
71
|
+
# is preceded by the number of seconds, with nanoseconds expressed as
|
|
72
|
+
# fractional seconds. For example, 3 seconds with 0 nanoseconds should be
|
|
73
|
+
# encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
|
|
74
|
+
# be expressed in JSON format as "3.000000001s", and 3 seconds and 1
|
|
75
|
+
# microsecond should be expressed in JSON format as "3.000001s".
|
|
76
|
+
# @!attribute [rw] seconds
|
|
77
|
+
# @return [Integer]
|
|
78
|
+
# Signed seconds of the span of time. Must be from -315,576,000,000
|
|
79
|
+
# to +315,576,000,000 inclusive. Note: these bounds are computed from:
|
|
80
|
+
# 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
|
|
81
|
+
# @!attribute [rw] nanos
|
|
82
|
+
# @return [Integer]
|
|
83
|
+
# Signed fractions of a second at nanosecond resolution of the span
|
|
84
|
+
# of time. Durations less than one second are represented with a 0
|
|
85
|
+
# `seconds` field and a positive or negative `nanos` field. For durations
|
|
86
|
+
# of one second or more, a non-zero value for the `nanos` field must be
|
|
87
|
+
# of the same sign as the `seconds` field. Must be from -999,999,999
|
|
88
|
+
# to +999,999,999 inclusive.
|
|
89
|
+
class Duration; end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Copyright 2019 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
|
+
# A generic empty message that you can re-use to avoid defining duplicated
|
|
19
|
+
# empty messages in your APIs. A typical example is to use it as the request
|
|
20
|
+
# or the response type of an API method. For instance:
|
|
21
|
+
#
|
|
22
|
+
# service Foo {
|
|
23
|
+
# rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
|
|
24
|
+
# }
|
|
25
|
+
#
|
|
26
|
+
# The JSON representation for `Empty` is empty JSON object `{}`.
|
|
27
|
+
class Empty; end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
# Copyright 2019 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
|