google-cloud-talent-v4 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 +12 -0
- data/AUTHENTICATION.md +169 -0
- data/LICENSE.md +203 -0
- data/README.md +75 -0
- data/lib/google-cloud-talent-v4.rb +21 -0
- data/lib/google/cloud/talent/v4.rb +39 -0
- data/lib/google/cloud/talent/v4/common_pb.rb +280 -0
- data/lib/google/cloud/talent/v4/company_pb.rb +42 -0
- data/lib/google/cloud/talent/v4/company_service.rb +49 -0
- data/lib/google/cloud/talent/v4/company_service/client.rb +732 -0
- data/lib/google/cloud/talent/v4/company_service/credentials.rb +52 -0
- data/lib/google/cloud/talent/v4/company_service/paths.rb +69 -0
- data/lib/google/cloud/talent/v4/company_service_pb.rb +57 -0
- data/lib/google/cloud/talent/v4/company_service_services_pb.rb +54 -0
- data/lib/google/cloud/talent/v4/completion.rb +49 -0
- data/lib/google/cloud/talent/v4/completion/client.rb +408 -0
- data/lib/google/cloud/talent/v4/completion/credentials.rb +52 -0
- data/lib/google/cloud/talent/v4/completion/paths.rb +69 -0
- data/lib/google/cloud/talent/v4/completion_service_pb.rb +57 -0
- data/lib/google/cloud/talent/v4/completion_service_services_pb.rb +46 -0
- data/lib/google/cloud/talent/v4/event_pb.rb +55 -0
- data/lib/google/cloud/talent/v4/event_service.rb +49 -0
- data/lib/google/cloud/talent/v4/event_service/client.rb +383 -0
- data/lib/google/cloud/talent/v4/event_service/credentials.rb +52 -0
- data/lib/google/cloud/talent/v4/event_service/paths.rb +50 -0
- data/lib/google/cloud/talent/v4/event_service_pb.rb +28 -0
- data/lib/google/cloud/talent/v4/event_service_services_pb.rb +51 -0
- data/lib/google/cloud/talent/v4/filters_pb.rb +87 -0
- data/lib/google/cloud/talent/v4/histogram_pb.rb +28 -0
- data/lib/google/cloud/talent/v4/job_pb.rb +72 -0
- data/lib/google/cloud/talent/v4/job_service.rb +50 -0
- data/lib/google/cloud/talent/v4/job_service/client.rb +1632 -0
- data/lib/google/cloud/talent/v4/job_service/credentials.rb +52 -0
- data/lib/google/cloud/talent/v4/job_service/operations.rb +570 -0
- data/lib/google/cloud/talent/v4/job_service/paths.rb +88 -0
- data/lib/google/cloud/talent/v4/job_service_pb.rb +173 -0
- data/lib/google/cloud/talent/v4/job_service_services_pb.rb +86 -0
- data/lib/google/cloud/talent/v4/tenant_pb.rb +26 -0
- data/lib/google/cloud/talent/v4/tenant_service.rb +49 -0
- data/lib/google/cloud/talent/v4/tenant_service/client.rb +720 -0
- data/lib/google/cloud/talent/v4/tenant_service/credentials.rb +52 -0
- data/lib/google/cloud/talent/v4/tenant_service/paths.rb +64 -0
- data/lib/google/cloud/talent/v4/tenant_service_pb.rb +56 -0
- data/lib/google/cloud/talent/v4/tenant_service_services_pb.rb +53 -0
- data/lib/google/cloud/talent/v4/version.rb +28 -0
- data/proto_docs/README.md +4 -0
- data/proto_docs/google/api/field_behavior.rb +59 -0
- data/proto_docs/google/api/resource.rb +283 -0
- data/proto_docs/google/cloud/talent/v4/common.rb +949 -0
- data/proto_docs/google/cloud/talent/v4/company.rb +117 -0
- data/proto_docs/google/cloud/talent/v4/company_service.rb +133 -0
- data/proto_docs/google/cloud/talent/v4/completion_service.rb +148 -0
- data/proto_docs/google/cloud/talent/v4/event.rb +179 -0
- data/proto_docs/google/cloud/talent/v4/event_service.rb +42 -0
- data/proto_docs/google/cloud/talent/v4/filters.rb +360 -0
- data/proto_docs/google/cloud/talent/v4/histogram.rb +72 -0
- data/proto_docs/google/cloud/talent/v4/job.rb +378 -0
- data/proto_docs/google/cloud/talent/v4/job_service.rb +737 -0
- data/proto_docs/google/cloud/talent/v4/tenant.rb +50 -0
- data/proto_docs/google/cloud/talent/v4/tenant_service.rb +121 -0
- data/proto_docs/google/longrunning/operations.rb +150 -0
- data/proto_docs/google/protobuf/any.rb +138 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +36 -0
- data/proto_docs/google/protobuf/field_mask.rb +229 -0
- data/proto_docs/google/protobuf/timestamp.rb +120 -0
- data/proto_docs/google/protobuf/wrappers.rb +121 -0
- data/proto_docs/google/rpc/status.rb +46 -0
- data/proto_docs/google/type/latlng.rb +38 -0
- data/proto_docs/google/type/money.rb +43 -0
- data/proto_docs/google/type/postal_address.rb +135 -0
- data/proto_docs/google/type/timeofday.rb +44 -0
- metadata +258 -0
@@ -0,0 +1,52 @@
|
|
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
|
+
require "googleauth"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Cloud
|
23
|
+
module Talent
|
24
|
+
module V4
|
25
|
+
module Completion
|
26
|
+
# Credentials for the Completion API.
|
27
|
+
class Credentials < ::Google::Auth::Credentials
|
28
|
+
self.scope = [
|
29
|
+
"https://www.googleapis.com/auth/cloud-platform",
|
30
|
+
"https://www.googleapis.com/auth/jobs"
|
31
|
+
]
|
32
|
+
self.env_vars = [
|
33
|
+
"TALENT_CREDENTIALS",
|
34
|
+
"TALENT_KEYFILE",
|
35
|
+
"GOOGLE_CLOUD_CREDENTIALS",
|
36
|
+
"GOOGLE_CLOUD_KEYFILE",
|
37
|
+
"GCLOUD_KEYFILE",
|
38
|
+
"TALENT_CREDENTIALS_JSON",
|
39
|
+
"TALENT_KEYFILE_JSON",
|
40
|
+
"GOOGLE_CLOUD_CREDENTIALS_JSON",
|
41
|
+
"GOOGLE_CLOUD_KEYFILE_JSON",
|
42
|
+
"GCLOUD_KEYFILE_JSON"
|
43
|
+
]
|
44
|
+
self.paths = [
|
45
|
+
"~/.config/google_cloud/application_default_credentials.json"
|
46
|
+
]
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,69 @@
|
|
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 Cloud
|
22
|
+
module Talent
|
23
|
+
module V4
|
24
|
+
module Completion
|
25
|
+
# Path helper methods for the Completion API.
|
26
|
+
module Paths
|
27
|
+
##
|
28
|
+
# Create a fully-qualified Company resource string.
|
29
|
+
#
|
30
|
+
# The resource will be in the following format:
|
31
|
+
#
|
32
|
+
# `projects/{project}/tenants/{tenant}/companies/{company}`
|
33
|
+
#
|
34
|
+
# @param project [String]
|
35
|
+
# @param tenant [String]
|
36
|
+
# @param company [String]
|
37
|
+
#
|
38
|
+
# @return [::String]
|
39
|
+
def company_path project:, tenant:, company:
|
40
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
41
|
+
raise ::ArgumentError, "tenant cannot contain /" if tenant.to_s.include? "/"
|
42
|
+
|
43
|
+
"projects/#{project}/tenants/#{tenant}/companies/#{company}"
|
44
|
+
end
|
45
|
+
|
46
|
+
##
|
47
|
+
# Create a fully-qualified Tenant resource string.
|
48
|
+
#
|
49
|
+
# The resource will be in the following format:
|
50
|
+
#
|
51
|
+
# `projects/{project}/tenants/{tenant}`
|
52
|
+
#
|
53
|
+
# @param project [String]
|
54
|
+
# @param tenant [String]
|
55
|
+
#
|
56
|
+
# @return [::String]
|
57
|
+
def tenant_path project:, tenant:
|
58
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
59
|
+
|
60
|
+
"projects/#{project}/tenants/#{tenant}"
|
61
|
+
end
|
62
|
+
|
63
|
+
extend self
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: google/cloud/talent/v4/completion_service.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
require 'google/api/annotations_pb'
|
7
|
+
require 'google/api/client_pb'
|
8
|
+
require 'google/api/field_behavior_pb'
|
9
|
+
require 'google/api/resource_pb'
|
10
|
+
require 'google/cloud/talent/v4/common_pb'
|
11
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
12
|
+
add_file("google/cloud/talent/v4/completion_service.proto", :syntax => :proto3) do
|
13
|
+
add_message "google.cloud.talent.v4.CompleteQueryRequest" do
|
14
|
+
optional :tenant, :string, 1
|
15
|
+
optional :query, :string, 2
|
16
|
+
repeated :language_codes, :string, 3
|
17
|
+
optional :page_size, :int32, 4
|
18
|
+
optional :company, :string, 5
|
19
|
+
optional :scope, :enum, 6, "google.cloud.talent.v4.CompleteQueryRequest.CompletionScope"
|
20
|
+
optional :type, :enum, 7, "google.cloud.talent.v4.CompleteQueryRequest.CompletionType"
|
21
|
+
end
|
22
|
+
add_enum "google.cloud.talent.v4.CompleteQueryRequest.CompletionScope" do
|
23
|
+
value :COMPLETION_SCOPE_UNSPECIFIED, 0
|
24
|
+
value :TENANT, 1
|
25
|
+
value :PUBLIC, 2
|
26
|
+
end
|
27
|
+
add_enum "google.cloud.talent.v4.CompleteQueryRequest.CompletionType" do
|
28
|
+
value :COMPLETION_TYPE_UNSPECIFIED, 0
|
29
|
+
value :JOB_TITLE, 1
|
30
|
+
value :COMPANY_NAME, 2
|
31
|
+
value :COMBINED, 3
|
32
|
+
end
|
33
|
+
add_message "google.cloud.talent.v4.CompleteQueryResponse" do
|
34
|
+
repeated :completion_results, :message, 1, "google.cloud.talent.v4.CompleteQueryResponse.CompletionResult"
|
35
|
+
optional :metadata, :message, 2, "google.cloud.talent.v4.ResponseMetadata"
|
36
|
+
end
|
37
|
+
add_message "google.cloud.talent.v4.CompleteQueryResponse.CompletionResult" do
|
38
|
+
optional :suggestion, :string, 1
|
39
|
+
optional :type, :enum, 2, "google.cloud.talent.v4.CompleteQueryRequest.CompletionType"
|
40
|
+
optional :image_uri, :string, 3
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
module Google
|
46
|
+
module Cloud
|
47
|
+
module Talent
|
48
|
+
module V4
|
49
|
+
CompleteQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompleteQueryRequest").msgclass
|
50
|
+
CompleteQueryRequest::CompletionScope = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompleteQueryRequest.CompletionScope").enummodule
|
51
|
+
CompleteQueryRequest::CompletionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompleteQueryRequest.CompletionType").enummodule
|
52
|
+
CompleteQueryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompleteQueryResponse").msgclass
|
53
|
+
CompleteQueryResponse::CompletionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.CompleteQueryResponse.CompletionResult").msgclass
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# Source: google/cloud/talent/v4/completion_service.proto for package 'google.cloud.talent.v4'
|
3
|
+
# Original file comments:
|
4
|
+
# Copyright 2020 Google LLC
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
|
19
|
+
require 'grpc'
|
20
|
+
require 'google/cloud/talent/v4/completion_service_pb'
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module Talent
|
25
|
+
module V4
|
26
|
+
module Completion
|
27
|
+
# A service handles auto completion.
|
28
|
+
class Service
|
29
|
+
|
30
|
+
include GRPC::GenericService
|
31
|
+
|
32
|
+
self.marshal_class_method = :encode
|
33
|
+
self.unmarshal_class_method = :decode
|
34
|
+
self.service_name = 'google.cloud.talent.v4.Completion'
|
35
|
+
|
36
|
+
# Completes the specified prefix with keyword suggestions.
|
37
|
+
# Intended for use by a job search auto-complete search box.
|
38
|
+
rpc :CompleteQuery, ::Google::Cloud::Talent::V4::CompleteQueryRequest, ::Google::Cloud::Talent::V4::CompleteQueryResponse
|
39
|
+
end
|
40
|
+
|
41
|
+
Stub = Service.rpc_stub_class
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: google/cloud/talent/v4/event.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
require 'google/api/annotations_pb'
|
7
|
+
require 'google/api/field_behavior_pb'
|
8
|
+
require 'google/protobuf/timestamp_pb'
|
9
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
10
|
+
add_file("google/cloud/talent/v4/event.proto", :syntax => :proto3) do
|
11
|
+
add_message "google.cloud.talent.v4.ClientEvent" do
|
12
|
+
optional :request_id, :string, 1
|
13
|
+
optional :event_id, :string, 2
|
14
|
+
optional :create_time, :message, 4, "google.protobuf.Timestamp"
|
15
|
+
optional :event_notes, :string, 9
|
16
|
+
oneof :event do
|
17
|
+
optional :job_event, :message, 5, "google.cloud.talent.v4.JobEvent"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
add_message "google.cloud.talent.v4.JobEvent" do
|
21
|
+
optional :type, :enum, 1, "google.cloud.talent.v4.JobEvent.JobEventType"
|
22
|
+
repeated :jobs, :string, 2
|
23
|
+
end
|
24
|
+
add_enum "google.cloud.talent.v4.JobEvent.JobEventType" do
|
25
|
+
value :JOB_EVENT_TYPE_UNSPECIFIED, 0
|
26
|
+
value :IMPRESSION, 1
|
27
|
+
value :VIEW, 2
|
28
|
+
value :VIEW_REDIRECT, 3
|
29
|
+
value :APPLICATION_START, 4
|
30
|
+
value :APPLICATION_FINISH, 5
|
31
|
+
value :APPLICATION_QUICK_SUBMISSION, 6
|
32
|
+
value :APPLICATION_REDIRECT, 7
|
33
|
+
value :APPLICATION_START_FROM_SEARCH, 8
|
34
|
+
value :APPLICATION_REDIRECT_FROM_SEARCH, 9
|
35
|
+
value :APPLICATION_COMPANY_SUBMIT, 10
|
36
|
+
value :BOOKMARK, 11
|
37
|
+
value :NOTIFICATION, 12
|
38
|
+
value :HIRED, 13
|
39
|
+
value :SENT_CV, 14
|
40
|
+
value :INTERVIEW_GRANTED, 15
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
module Google
|
46
|
+
module Cloud
|
47
|
+
module Talent
|
48
|
+
module V4
|
49
|
+
ClientEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.ClientEvent").msgclass
|
50
|
+
JobEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobEvent").msgclass
|
51
|
+
JobEvent::JobEventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4.JobEvent.JobEventType").enummodule
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,49 @@
|
|
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
|
+
require "gapic/common"
|
20
|
+
require "gapic/config"
|
21
|
+
require "gapic/config/method"
|
22
|
+
|
23
|
+
require "google/cloud/talent/v4/version"
|
24
|
+
|
25
|
+
require "google/cloud/talent/v4/event_service/credentials"
|
26
|
+
require "google/cloud/talent/v4/event_service/paths"
|
27
|
+
require "google/cloud/talent/v4/event_service/client"
|
28
|
+
|
29
|
+
module Google
|
30
|
+
module Cloud
|
31
|
+
module Talent
|
32
|
+
module V4
|
33
|
+
##
|
34
|
+
# A service handles client event report.
|
35
|
+
#
|
36
|
+
# To load this service and instantiate a client:
|
37
|
+
#
|
38
|
+
# require "google/cloud/talent/v4/event_service"
|
39
|
+
# client = ::Google::Cloud::Talent::V4::EventService::Client.new
|
40
|
+
#
|
41
|
+
module EventService
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
helper_path = ::File.join __dir__, "event_service", "helpers.rb"
|
49
|
+
require "google/cloud/talent/v4/event_service/helpers" if ::File.file? helper_path
|
@@ -0,0 +1,383 @@
|
|
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
|
+
require "google/cloud/errors"
|
20
|
+
require "google/cloud/talent/v4/event_service_pb"
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module Talent
|
25
|
+
module V4
|
26
|
+
module EventService
|
27
|
+
##
|
28
|
+
# Client for the EventService service.
|
29
|
+
#
|
30
|
+
# A service handles client event report.
|
31
|
+
#
|
32
|
+
class Client
|
33
|
+
include Paths
|
34
|
+
|
35
|
+
# @private
|
36
|
+
attr_reader :event_service_stub
|
37
|
+
|
38
|
+
##
|
39
|
+
# Configure the EventService Client class.
|
40
|
+
#
|
41
|
+
# See {::Google::Cloud::Talent::V4::EventService::Client::Configuration}
|
42
|
+
# for a description of the configuration fields.
|
43
|
+
#
|
44
|
+
# ## Example
|
45
|
+
#
|
46
|
+
# To modify the configuration for all EventService clients:
|
47
|
+
#
|
48
|
+
# ::Google::Cloud::Talent::V4::EventService::Client.configure do |config|
|
49
|
+
# config.timeout = 10.0
|
50
|
+
# end
|
51
|
+
#
|
52
|
+
# @yield [config] Configure the Client client.
|
53
|
+
# @yieldparam config [Client::Configuration]
|
54
|
+
#
|
55
|
+
# @return [Client::Configuration]
|
56
|
+
#
|
57
|
+
def self.configure
|
58
|
+
@configure ||= begin
|
59
|
+
namespace = ["Google", "Cloud", "Talent", "V4"]
|
60
|
+
parent_config = while namespace.any?
|
61
|
+
parent_name = namespace.join "::"
|
62
|
+
parent_const = const_get parent_name
|
63
|
+
break parent_const.configure if parent_const&.respond_to? :configure
|
64
|
+
namespace.pop
|
65
|
+
end
|
66
|
+
default_config = Client::Configuration.new parent_config
|
67
|
+
|
68
|
+
default_config.rpcs.create_client_event.timeout = 30.0
|
69
|
+
|
70
|
+
default_config
|
71
|
+
end
|
72
|
+
yield @configure if block_given?
|
73
|
+
@configure
|
74
|
+
end
|
75
|
+
|
76
|
+
##
|
77
|
+
# Configure the EventService Client instance.
|
78
|
+
#
|
79
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
80
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
81
|
+
# should be made on {Client.configure}.
|
82
|
+
#
|
83
|
+
# See {::Google::Cloud::Talent::V4::EventService::Client::Configuration}
|
84
|
+
# for a description of the configuration fields.
|
85
|
+
#
|
86
|
+
# @yield [config] Configure the Client client.
|
87
|
+
# @yieldparam config [Client::Configuration]
|
88
|
+
#
|
89
|
+
# @return [Client::Configuration]
|
90
|
+
#
|
91
|
+
def configure
|
92
|
+
yield @config if block_given?
|
93
|
+
@config
|
94
|
+
end
|
95
|
+
|
96
|
+
##
|
97
|
+
# Create a new EventService client object.
|
98
|
+
#
|
99
|
+
# ## Examples
|
100
|
+
#
|
101
|
+
# To create a new EventService client with the default
|
102
|
+
# configuration:
|
103
|
+
#
|
104
|
+
# client = ::Google::Cloud::Talent::V4::EventService::Client.new
|
105
|
+
#
|
106
|
+
# To create a new EventService client with a custom
|
107
|
+
# configuration:
|
108
|
+
#
|
109
|
+
# client = ::Google::Cloud::Talent::V4::EventService::Client.new do |config|
|
110
|
+
# config.timeout = 10.0
|
111
|
+
# end
|
112
|
+
#
|
113
|
+
# @yield [config] Configure the EventService client.
|
114
|
+
# @yieldparam config [Client::Configuration]
|
115
|
+
#
|
116
|
+
def initialize
|
117
|
+
# These require statements are intentionally placed here to initialize
|
118
|
+
# the gRPC module only when it's required.
|
119
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
120
|
+
require "gapic/grpc"
|
121
|
+
require "google/cloud/talent/v4/event_service_services_pb"
|
122
|
+
|
123
|
+
# Create the configuration object
|
124
|
+
@config = Configuration.new Client.configure
|
125
|
+
|
126
|
+
# Yield the configuration if needed
|
127
|
+
yield @config if block_given?
|
128
|
+
|
129
|
+
# Create credentials
|
130
|
+
credentials = @config.credentials
|
131
|
+
credentials ||= Credentials.default scope: @config.scope
|
132
|
+
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
133
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
134
|
+
end
|
135
|
+
@quota_project_id = @config.quota_project
|
136
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
137
|
+
|
138
|
+
@event_service_stub = ::Gapic::ServiceStub.new(
|
139
|
+
::Google::Cloud::Talent::V4::EventService::Stub,
|
140
|
+
credentials: credentials,
|
141
|
+
endpoint: @config.endpoint,
|
142
|
+
channel_args: @config.channel_args,
|
143
|
+
interceptors: @config.interceptors
|
144
|
+
)
|
145
|
+
end
|
146
|
+
|
147
|
+
# Service calls
|
148
|
+
|
149
|
+
##
|
150
|
+
# Report events issued when end user interacts with customer's application
|
151
|
+
# that uses Cloud Talent Solution. You may inspect the created events in
|
152
|
+
# [self service
|
153
|
+
# tools](https://console.cloud.google.com/talent-solution/overview).
|
154
|
+
# [Learn
|
155
|
+
# more](https://cloud.google.com/talent-solution/docs/management-tools)
|
156
|
+
# about self service tools.
|
157
|
+
#
|
158
|
+
# @overload create_client_event(request, options = nil)
|
159
|
+
# Pass arguments to `create_client_event` via a request object, either of type
|
160
|
+
# {::Google::Cloud::Talent::V4::CreateClientEventRequest} or an equivalent Hash.
|
161
|
+
#
|
162
|
+
# @param request [::Google::Cloud::Talent::V4::CreateClientEventRequest, ::Hash]
|
163
|
+
# A request object representing the call parameters. Required. To specify no
|
164
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
165
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
166
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
167
|
+
#
|
168
|
+
# @overload create_client_event(parent: nil, client_event: nil)
|
169
|
+
# Pass arguments to `create_client_event` via keyword arguments. Note that at
|
170
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
171
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
172
|
+
#
|
173
|
+
# @param parent [::String]
|
174
|
+
# Required. Resource name of the tenant under which the event is created.
|
175
|
+
#
|
176
|
+
# The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example,
|
177
|
+
# "projects/foo/tenants/bar".
|
178
|
+
# @param client_event [::Google::Cloud::Talent::V4::ClientEvent, ::Hash]
|
179
|
+
# Required. Events issued when end user interacts with customer's application
|
180
|
+
# that uses Cloud Talent Solution.
|
181
|
+
#
|
182
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
183
|
+
# @yieldparam response [::Google::Cloud::Talent::V4::ClientEvent]
|
184
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
185
|
+
#
|
186
|
+
# @return [::Google::Cloud::Talent::V4::ClientEvent]
|
187
|
+
#
|
188
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
189
|
+
#
|
190
|
+
def create_client_event request, options = nil
|
191
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
192
|
+
|
193
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Talent::V4::CreateClientEventRequest
|
194
|
+
|
195
|
+
# Converts hash and nil to an options object
|
196
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
197
|
+
|
198
|
+
# Customize the options with defaults
|
199
|
+
metadata = @config.rpcs.create_client_event.metadata.to_h
|
200
|
+
|
201
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
202
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
203
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
204
|
+
gapic_version: ::Google::Cloud::Talent::V4::VERSION
|
205
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
206
|
+
|
207
|
+
header_params = {
|
208
|
+
"parent" => request.parent
|
209
|
+
}
|
210
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
211
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
212
|
+
|
213
|
+
options.apply_defaults timeout: @config.rpcs.create_client_event.timeout,
|
214
|
+
metadata: metadata,
|
215
|
+
retry_policy: @config.rpcs.create_client_event.retry_policy
|
216
|
+
options.apply_defaults metadata: @config.metadata,
|
217
|
+
retry_policy: @config.retry_policy
|
218
|
+
|
219
|
+
@event_service_stub.call_rpc :create_client_event, request, options: options do |response, operation|
|
220
|
+
yield response, operation if block_given?
|
221
|
+
return response
|
222
|
+
end
|
223
|
+
rescue ::GRPC::BadStatus => e
|
224
|
+
raise ::Google::Cloud::Error.from_error(e)
|
225
|
+
end
|
226
|
+
|
227
|
+
##
|
228
|
+
# Configuration class for the EventService API.
|
229
|
+
#
|
230
|
+
# This class represents the configuration for EventService,
|
231
|
+
# providing control over timeouts, retry behavior, logging, transport
|
232
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
233
|
+
# applied individually to specific RPCs. See
|
234
|
+
# {::Google::Cloud::Talent::V4::EventService::Client::Configuration::Rpcs}
|
235
|
+
# for a list of RPCs that can be configured independently.
|
236
|
+
#
|
237
|
+
# Configuration can be applied globally to all clients, or to a single client
|
238
|
+
# on construction.
|
239
|
+
#
|
240
|
+
# # Examples
|
241
|
+
#
|
242
|
+
# To modify the global config, setting the timeout for create_client_event
|
243
|
+
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
244
|
+
#
|
245
|
+
# ::Google::Cloud::Talent::V4::EventService::Client.configure do |config|
|
246
|
+
# config.timeout = 10.0
|
247
|
+
# config.rpcs.create_client_event.timeout = 20.0
|
248
|
+
# end
|
249
|
+
#
|
250
|
+
# To apply the above configuration only to a new client:
|
251
|
+
#
|
252
|
+
# client = ::Google::Cloud::Talent::V4::EventService::Client.new do |config|
|
253
|
+
# config.timeout = 10.0
|
254
|
+
# config.rpcs.create_client_event.timeout = 20.0
|
255
|
+
# end
|
256
|
+
#
|
257
|
+
# @!attribute [rw] endpoint
|
258
|
+
# The hostname or hostname:port of the service endpoint.
|
259
|
+
# Defaults to `"jobs.googleapis.com"`.
|
260
|
+
# @return [::String]
|
261
|
+
# @!attribute [rw] credentials
|
262
|
+
# Credentials to send with calls. You may provide any of the following types:
|
263
|
+
# * (`String`) The path to a service account key file in JSON format
|
264
|
+
# * (`Hash`) A service account key as a Hash
|
265
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
266
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
267
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
268
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
269
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
270
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
271
|
+
# * (`nil`) indicating no credentials
|
272
|
+
# @return [::Object]
|
273
|
+
# @!attribute [rw] scope
|
274
|
+
# The OAuth scopes
|
275
|
+
# @return [::Array<::String>]
|
276
|
+
# @!attribute [rw] lib_name
|
277
|
+
# The library name as recorded in instrumentation and logging
|
278
|
+
# @return [::String]
|
279
|
+
# @!attribute [rw] lib_version
|
280
|
+
# The library version as recorded in instrumentation and logging
|
281
|
+
# @return [::String]
|
282
|
+
# @!attribute [rw] channel_args
|
283
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
284
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
285
|
+
# @return [::Hash]
|
286
|
+
# @!attribute [rw] interceptors
|
287
|
+
# An array of interceptors that are run before calls are executed.
|
288
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
289
|
+
# @!attribute [rw] timeout
|
290
|
+
# The call timeout in seconds.
|
291
|
+
# @return [::Numeric]
|
292
|
+
# @!attribute [rw] metadata
|
293
|
+
# Additional gRPC headers to be sent with the call.
|
294
|
+
# @return [::Hash{::Symbol=>::String}]
|
295
|
+
# @!attribute [rw] retry_policy
|
296
|
+
# The retry policy. The value is a hash with the following keys:
|
297
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
298
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
299
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
300
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
301
|
+
# trigger a retry.
|
302
|
+
# @return [::Hash]
|
303
|
+
# @!attribute [rw] quota_project
|
304
|
+
# A separate project against which to charge quota.
|
305
|
+
# @return [::String]
|
306
|
+
#
|
307
|
+
class Configuration
|
308
|
+
extend ::Gapic::Config
|
309
|
+
|
310
|
+
config_attr :endpoint, "jobs.googleapis.com", ::String
|
311
|
+
config_attr :credentials, nil do |value|
|
312
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
313
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
314
|
+
allowed.any? { |klass| klass === value }
|
315
|
+
end
|
316
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
317
|
+
config_attr :lib_name, nil, ::String, nil
|
318
|
+
config_attr :lib_version, nil, ::String, nil
|
319
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
|
320
|
+
config_attr :interceptors, nil, ::Array, nil
|
321
|
+
config_attr :timeout, nil, ::Numeric, nil
|
322
|
+
config_attr :metadata, nil, ::Hash, nil
|
323
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
324
|
+
config_attr :quota_project, nil, ::String, nil
|
325
|
+
|
326
|
+
# @private
|
327
|
+
def initialize parent_config = nil
|
328
|
+
@parent_config = parent_config unless parent_config.nil?
|
329
|
+
|
330
|
+
yield self if block_given?
|
331
|
+
end
|
332
|
+
|
333
|
+
##
|
334
|
+
# Configurations for individual RPCs
|
335
|
+
# @return [Rpcs]
|
336
|
+
#
|
337
|
+
def rpcs
|
338
|
+
@rpcs ||= begin
|
339
|
+
parent_rpcs = nil
|
340
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
|
341
|
+
Rpcs.new parent_rpcs
|
342
|
+
end
|
343
|
+
end
|
344
|
+
|
345
|
+
##
|
346
|
+
# Configuration RPC class for the EventService API.
|
347
|
+
#
|
348
|
+
# Includes fields providing the configuration for each RPC in this service.
|
349
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
350
|
+
# the following configuration fields:
|
351
|
+
#
|
352
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
|
353
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
354
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
355
|
+
# include the following keys:
|
356
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
357
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
358
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
359
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
360
|
+
# trigger a retry.
|
361
|
+
#
|
362
|
+
class Rpcs
|
363
|
+
##
|
364
|
+
# RPC-specific configuration for `create_client_event`
|
365
|
+
# @return [::Gapic::Config::Method]
|
366
|
+
#
|
367
|
+
attr_reader :create_client_event
|
368
|
+
|
369
|
+
# @private
|
370
|
+
def initialize parent_rpcs = nil
|
371
|
+
create_client_event_config = parent_rpcs&.create_client_event if parent_rpcs&.respond_to? :create_client_event
|
372
|
+
@create_client_event = ::Gapic::Config::Method.new create_client_event_config
|
373
|
+
|
374
|
+
yield self if block_given?
|
375
|
+
end
|
376
|
+
end
|
377
|
+
end
|
378
|
+
end
|
379
|
+
end
|
380
|
+
end
|
381
|
+
end
|
382
|
+
end
|
383
|
+
end
|