google-cloud-talent-v4beta1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +169 -0
  4. data/LICENSE.md +203 -0
  5. data/README.md +71 -0
  6. data/lib/google-cloud-talent-v4beta1.rb +21 -0
  7. data/lib/google/cloud/common_resources_pb.rb +15 -0
  8. data/lib/google/cloud/talent/v4beta1.rb +41 -0
  9. data/lib/google/cloud/talent/v4beta1/application_pb.rb +64 -0
  10. data/lib/google/cloud/talent/v4beta1/application_service.rb +50 -0
  11. data/lib/google/cloud/talent/v4beta1/application_service/client.rb +717 -0
  12. data/lib/google/cloud/talent/v4beta1/application_service/credentials.rb +52 -0
  13. data/lib/google/cloud/talent/v4beta1/application_service/paths.rb +155 -0
  14. data/lib/google/cloud/talent/v4beta1/application_service_pb.rb +56 -0
  15. data/lib/google/cloud/talent/v4beta1/application_service_services_pb.rb +54 -0
  16. data/lib/google/cloud/talent/v4beta1/batch_pb.rb +19 -0
  17. data/lib/google/cloud/talent/v4beta1/common_pb.rb +342 -0
  18. data/lib/google/cloud/talent/v4beta1/company_pb.rb +42 -0
  19. data/lib/google/cloud/talent/v4beta1/company_service.rb +49 -0
  20. data/lib/google/cloud/talent/v4beta1/company_service/client.rb +732 -0
  21. data/lib/google/cloud/talent/v4beta1/company_service/credentials.rb +52 -0
  22. data/lib/google/cloud/talent/v4beta1/company_service/paths.rb +105 -0
  23. data/lib/google/cloud/talent/v4beta1/company_service_pb.rb +57 -0
  24. data/lib/google/cloud/talent/v4beta1/company_service_services_pb.rb +54 -0
  25. data/lib/google/cloud/talent/v4beta1/completion.rb +49 -0
  26. data/lib/google/cloud/talent/v4beta1/completion/client.rb +407 -0
  27. data/lib/google/cloud/talent/v4beta1/completion/credentials.rb +52 -0
  28. data/lib/google/cloud/talent/v4beta1/completion/paths.rb +105 -0
  29. data/lib/google/cloud/talent/v4beta1/completion_service_pb.rb +57 -0
  30. data/lib/google/cloud/talent/v4beta1/completion_service_services_pb.rb +46 -0
  31. data/lib/google/cloud/talent/v4beta1/event_pb.rb +70 -0
  32. data/lib/google/cloud/talent/v4beta1/event_service.rb +49 -0
  33. data/lib/google/cloud/talent/v4beta1/event_service/client.rb +379 -0
  34. data/lib/google/cloud/talent/v4beta1/event_service/credentials.rb +52 -0
  35. data/lib/google/cloud/talent/v4beta1/event_service/paths.rb +64 -0
  36. data/lib/google/cloud/talent/v4beta1/event_service_pb.rb +28 -0
  37. data/lib/google/cloud/talent/v4beta1/event_service_services_pb.rb +51 -0
  38. data/lib/google/cloud/talent/v4beta1/filters_pb.rb +188 -0
  39. data/lib/google/cloud/talent/v4beta1/histogram_pb.rb +28 -0
  40. data/lib/google/cloud/talent/v4beta1/job_pb.rb +73 -0
  41. data/lib/google/cloud/talent/v4beta1/job_service.rb +50 -0
  42. data/lib/google/cloud/talent/v4beta1/job_service/client.rb +1660 -0
  43. data/lib/google/cloud/talent/v4beta1/job_service/credentials.rb +52 -0
  44. data/lib/google/cloud/talent/v4beta1/job_service/operations.rb +564 -0
  45. data/lib/google/cloud/talent/v4beta1/job_service/paths.rb +146 -0
  46. data/lib/google/cloud/talent/v4beta1/job_service_pb.rb +167 -0
  47. data/lib/google/cloud/talent/v4beta1/job_service_services_pb.rb +86 -0
  48. data/lib/google/cloud/talent/v4beta1/profile_pb.rb +214 -0
  49. data/lib/google/cloud/talent/v4beta1/profile_service.rb +50 -0
  50. data/lib/google/cloud/talent/v4beta1/profile_service/client.rb +992 -0
  51. data/lib/google/cloud/talent/v4beta1/profile_service/credentials.rb +52 -0
  52. data/lib/google/cloud/talent/v4beta1/profile_service/paths.rb +69 -0
  53. data/lib/google/cloud/talent/v4beta1/profile_service_pb.rb +92 -0
  54. data/lib/google/cloud/talent/v4beta1/profile_service_services_pb.rb +63 -0
  55. data/lib/google/cloud/talent/v4beta1/tenant_pb.rb +35 -0
  56. data/lib/google/cloud/talent/v4beta1/tenant_service.rb +49 -0
  57. data/lib/google/cloud/talent/v4beta1/tenant_service/client.rb +712 -0
  58. data/lib/google/cloud/talent/v4beta1/tenant_service/credentials.rb +52 -0
  59. data/lib/google/cloud/talent/v4beta1/tenant_service/paths.rb +64 -0
  60. data/lib/google/cloud/talent/v4beta1/tenant_service_pb.rb +56 -0
  61. data/lib/google/cloud/talent/v4beta1/tenant_service_services_pb.rb +53 -0
  62. data/lib/google/cloud/talent/v4beta1/version.rb +28 -0
  63. data/proto_docs/README.md +4 -0
  64. data/proto_docs/google/api/field_behavior.rb +59 -0
  65. data/proto_docs/google/api/resource.rb +247 -0
  66. data/proto_docs/google/cloud/talent/v4beta1/application.rb +169 -0
  67. data/proto_docs/google/cloud/talent/v4beta1/application_service.rb +122 -0
  68. data/proto_docs/google/cloud/talent/v4beta1/common.rb +1106 -0
  69. data/proto_docs/google/cloud/talent/v4beta1/company.rb +117 -0
  70. data/proto_docs/google/cloud/talent/v4beta1/company_service.rb +138 -0
  71. data/proto_docs/google/cloud/talent/v4beta1/completion_service.rb +143 -0
  72. data/proto_docs/google/cloud/talent/v4beta1/event.rb +237 -0
  73. data/proto_docs/google/cloud/talent/v4beta1/event_service.rb +43 -0
  74. data/proto_docs/google/cloud/talent/v4beta1/filters.rb +818 -0
  75. data/proto_docs/google/cloud/talent/v4beta1/histogram.rb +69 -0
  76. data/proto_docs/google/cloud/talent/v4beta1/job.rb +356 -0
  77. data/proto_docs/google/cloud/talent/v4beta1/job_service.rb +746 -0
  78. data/proto_docs/google/cloud/talent/v4beta1/profile.rb +811 -0
  79. data/proto_docs/google/cloud/talent/v4beta1/profile_service.rb +392 -0
  80. data/proto_docs/google/cloud/talent/v4beta1/tenant.rb +77 -0
  81. data/proto_docs/google/cloud/talent/v4beta1/tenant_service.rb +118 -0
  82. data/proto_docs/google/longrunning/operations.rb +150 -0
  83. data/proto_docs/google/protobuf/any.rb +138 -0
  84. data/proto_docs/google/protobuf/duration.rb +98 -0
  85. data/proto_docs/google/protobuf/empty.rb +36 -0
  86. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  87. data/proto_docs/google/protobuf/timestamp.rb +120 -0
  88. data/proto_docs/google/protobuf/wrappers.rb +121 -0
  89. data/proto_docs/google/rpc/status.rb +46 -0
  90. data/proto_docs/google/type/date.rb +50 -0
  91. data/proto_docs/google/type/latlng.rb +38 -0
  92. data/proto_docs/google/type/money.rb +43 -0
  93. data/proto_docs/google/type/postal_address.rb +135 -0
  94. data/proto_docs/google/type/timeofday.rb +44 -0
  95. metadata +251 -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 V4beta1
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,105 @@
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 V4beta1
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
+ # @overload company_path(project:, tenant:, company:)
31
+ # The resource will be in the following format:
32
+ #
33
+ # `projects/{project}/tenants/{tenant}/companies/{company}`
34
+ #
35
+ # @param project [String]
36
+ # @param tenant [String]
37
+ # @param company [String]
38
+ #
39
+ # @overload company_path(project:, company:)
40
+ # The resource will be in the following format:
41
+ #
42
+ # `projects/{project}/companies/{company}`
43
+ #
44
+ # @param project [String]
45
+ # @param company [String]
46
+ #
47
+ # @return [String]
48
+ def company_path **args
49
+ resources = {
50
+ "company:project:tenant" => (proc do |project:, tenant:, company:|
51
+ raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
52
+ raise ArgumentError, "tenant cannot contain /" if tenant.to_s.include? "/"
53
+
54
+ "projects/#{project}/tenants/#{tenant}/companies/#{company}"
55
+ end),
56
+ "company:project" => (proc do |project:, company:|
57
+ raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
58
+
59
+ "projects/#{project}/companies/#{company}"
60
+ end)
61
+ }
62
+
63
+ resource = resources[args.keys.sort.join(":")]
64
+ raise ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
65
+ resource.call(**args)
66
+ end
67
+
68
+ ##
69
+ # Create a fully-qualified Project resource string.
70
+ #
71
+ # The resource will be in the following format:
72
+ #
73
+ # `projects/{project}`
74
+ #
75
+ # @param project [String]
76
+ #
77
+ # @return [String]
78
+ def project_path project:
79
+ "projects/#{project}"
80
+ end
81
+
82
+ ##
83
+ # Create a fully-qualified Tenant resource string.
84
+ #
85
+ # The resource will be in the following format:
86
+ #
87
+ # `projects/{project}/tenants/{tenant}`
88
+ #
89
+ # @param project [String]
90
+ # @param tenant [String]
91
+ #
92
+ # @return [String]
93
+ def tenant_path project:, tenant:
94
+ raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
95
+
96
+ "projects/#{project}/tenants/#{tenant}"
97
+ end
98
+
99
+ extend self
100
+ end
101
+ end
102
+ end
103
+ end
104
+ end
105
+ end
@@ -0,0 +1,57 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/talent/v4beta1/completion_service.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/api/annotations_pb'
7
+ require 'google/api/field_behavior_pb'
8
+ require 'google/api/resource_pb'
9
+ require 'google/cloud/talent/v4beta1/common_pb'
10
+ require 'google/api/client_pb'
11
+ Google::Protobuf::DescriptorPool.generated_pool.build do
12
+ add_file("google/cloud/talent/v4beta1/completion_service.proto", :syntax => :proto3) do
13
+ add_message "google.cloud.talent.v4beta1.CompleteQueryRequest" do
14
+ optional :parent, :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.v4beta1.CompleteQueryRequest.CompletionScope"
20
+ optional :type, :enum, 7, "google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType"
21
+ end
22
+ add_enum "google.cloud.talent.v4beta1.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.v4beta1.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.v4beta1.CompleteQueryResponse" do
34
+ repeated :completion_results, :message, 1, "google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult"
35
+ optional :metadata, :message, 2, "google.cloud.talent.v4beta1.ResponseMetadata"
36
+ end
37
+ add_message "google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult" do
38
+ optional :suggestion, :string, 1
39
+ optional :type, :enum, 2, "google.cloud.talent.v4beta1.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 V4beta1
49
+ CompleteQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompleteQueryRequest").msgclass
50
+ CompleteQueryRequest::CompletionScope = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionScope").enummodule
51
+ CompleteQueryRequest::CompletionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType").enummodule
52
+ CompleteQueryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CompleteQueryResponse").msgclass
53
+ CompleteQueryResponse::CompletionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.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/v4beta1/completion_service.proto for package 'google.cloud.talent.v4beta1'
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/v4beta1/completion_service_pb'
21
+
22
+ module Google
23
+ module Cloud
24
+ module Talent
25
+ module V4beta1
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.v4beta1.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, CompleteQueryRequest, CompleteQueryResponse
39
+ end
40
+
41
+ Stub = Service.rpc_stub_class
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,70 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/talent/v4beta1/event.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/api/field_behavior_pb'
7
+ require 'google/protobuf/timestamp_pb'
8
+ require 'google/api/annotations_pb'
9
+ Google::Protobuf::DescriptorPool.generated_pool.build do
10
+ add_file("google/cloud/talent/v4beta1/event.proto", :syntax => :proto3) do
11
+ add_message "google.cloud.talent.v4beta1.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.v4beta1.JobEvent"
18
+ optional :profile_event, :message, 6, "google.cloud.talent.v4beta1.ProfileEvent"
19
+ end
20
+ end
21
+ add_message "google.cloud.talent.v4beta1.JobEvent" do
22
+ optional :type, :enum, 1, "google.cloud.talent.v4beta1.JobEvent.JobEventType"
23
+ repeated :jobs, :string, 2
24
+ optional :profile, :string, 3
25
+ end
26
+ add_enum "google.cloud.talent.v4beta1.JobEvent.JobEventType" do
27
+ value :JOB_EVENT_TYPE_UNSPECIFIED, 0
28
+ value :IMPRESSION, 1
29
+ value :VIEW, 2
30
+ value :VIEW_REDIRECT, 3
31
+ value :APPLICATION_START, 4
32
+ value :APPLICATION_FINISH, 5
33
+ value :APPLICATION_QUICK_SUBMISSION, 6
34
+ value :APPLICATION_REDIRECT, 7
35
+ value :APPLICATION_START_FROM_SEARCH, 8
36
+ value :APPLICATION_REDIRECT_FROM_SEARCH, 9
37
+ value :APPLICATION_COMPANY_SUBMIT, 10
38
+ value :BOOKMARK, 11
39
+ value :NOTIFICATION, 12
40
+ value :HIRED, 13
41
+ value :SENT_CV, 14
42
+ value :INTERVIEW_GRANTED, 15
43
+ end
44
+ add_message "google.cloud.talent.v4beta1.ProfileEvent" do
45
+ optional :type, :enum, 1, "google.cloud.talent.v4beta1.ProfileEvent.ProfileEventType"
46
+ repeated :profiles, :string, 2
47
+ repeated :jobs, :string, 6
48
+ end
49
+ add_enum "google.cloud.talent.v4beta1.ProfileEvent.ProfileEventType" do
50
+ value :PROFILE_EVENT_TYPE_UNSPECIFIED, 0
51
+ value :IMPRESSION, 1
52
+ value :VIEW, 2
53
+ value :BOOKMARK, 3
54
+ end
55
+ end
56
+ end
57
+
58
+ module Google
59
+ module Cloud
60
+ module Talent
61
+ module V4beta1
62
+ ClientEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ClientEvent").msgclass
63
+ JobEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.JobEvent").msgclass
64
+ JobEvent::JobEventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.JobEvent.JobEventType").enummodule
65
+ ProfileEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ProfileEvent").msgclass
66
+ ProfileEvent::ProfileEventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ProfileEvent.ProfileEventType").enummodule
67
+ end
68
+ end
69
+ end
70
+ 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/v4beta1/version"
24
+
25
+ require "google/cloud/talent/v4beta1/event_service/credentials"
26
+ require "google/cloud/talent/v4beta1/event_service/paths"
27
+ require "google/cloud/talent/v4beta1/event_service/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module Talent
32
+ module V4beta1
33
+ ##
34
+ # A service handles client event report.
35
+ #
36
+ # To load this service and instantiate a client:
37
+ #
38
+ # require "google/cloud/talent/v4beta1/event_service"
39
+ # client = Google::Cloud::Talent::V4beta1::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/v4beta1/event_service/helpers" if ::File.file? helper_path
@@ -0,0 +1,379 @@
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/v4beta1/event_service_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Talent
25
+ module V4beta1
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::V4beta1::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::V4beta1::EventService::Client.configure do |config|
49
+ # config.timeout = 10_000
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", "V4beta1"]
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::V4beta1::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::V4beta1::EventService::Client.new
105
+ #
106
+ # To create a new EventService client with a custom
107
+ # configuration:
108
+ #
109
+ # client = Google::Cloud::Talent::V4beta1::EventService::Client.new do |config|
110
+ # config.timeout = 10_000
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/v4beta1/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 = credentials.respond_to?(:quota_project_id) ? credentials.quota_project_id : nil
136
+
137
+ @event_service_stub = Gapic::ServiceStub.new(
138
+ Google::Cloud::Talent::V4beta1::EventService::Stub,
139
+ credentials: credentials,
140
+ endpoint: @config.endpoint,
141
+ channel_args: @config.channel_args,
142
+ interceptors: @config.interceptors
143
+ )
144
+ end
145
+
146
+ # Service calls
147
+
148
+ ##
149
+ # Report events issued when end user interacts with customer's application
150
+ # that uses Cloud Talent Solution. You may inspect the created events in
151
+ # [self service
152
+ # tools](https://console.cloud.google.com/talent-solution/overview).
153
+ # [Learn
154
+ # more](https://cloud.google.com/talent-solution/docs/management-tools)
155
+ # about self service tools.
156
+ #
157
+ # @overload create_client_event(request, options = nil)
158
+ # Pass arguments to `create_client_event` via a request object, either of type
159
+ # {Google::Cloud::Talent::V4beta1::CreateClientEventRequest} or an equivalent Hash.
160
+ #
161
+ # @param request [Google::Cloud::Talent::V4beta1::CreateClientEventRequest, Hash]
162
+ # A request object representing the call parameters. Required. To specify no
163
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
164
+ # @param options [Gapic::CallOptions, Hash]
165
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
166
+ #
167
+ # @overload create_client_event(parent: nil, client_event: nil)
168
+ # Pass arguments to `create_client_event` via keyword arguments. Note that at
169
+ # least one keyword argument is required. To specify no parameters, or to keep all
170
+ # the default parameter values, pass an empty Hash as a request object (see above).
171
+ #
172
+ # @param parent [String]
173
+ # Required. Resource name of the tenant under which the event is created.
174
+ #
175
+ # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example,
176
+ # "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant
177
+ # is created, for example, "projects/foo".
178
+ # @param client_event [Google::Cloud::Talent::V4beta1::ClientEvent, Hash]
179
+ # Required. Events issued when end user interacts with customer's application that
180
+ # uses Cloud Talent Solution.
181
+ #
182
+ # @yield [response, operation] Access the result along with the RPC operation
183
+ # @yieldparam response [Google::Cloud::Talent::V4beta1::ClientEvent]
184
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
185
+ #
186
+ # @return [Google::Cloud::Talent::V4beta1::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::V4beta1::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::V4beta1::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::V4beta1::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::V4beta1::EventService::Client.configure do |config|
246
+ # config.timeout = 10_000
247
+ # config.rpcs.create_client_event.timeout = 20_000
248
+ # end
249
+ #
250
+ # To apply the above configuration only to a new client:
251
+ #
252
+ # client = Google::Cloud::Talent::V4beta1::EventService::Client.new do |config|
253
+ # config.timeout = 10_000
254
+ # config.rpcs.create_client_event.timeout = 20_000
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 milliseconds.
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
+ #
304
+ class Configuration
305
+ extend Gapic::Config
306
+
307
+ config_attr :endpoint, "jobs.googleapis.com", String
308
+ config_attr :credentials, nil do |value|
309
+ allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
310
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
311
+ allowed.any? { |klass| klass === value }
312
+ end
313
+ config_attr :scope, nil, String, Array, nil
314
+ config_attr :lib_name, nil, String, nil
315
+ config_attr :lib_version, nil, String, nil
316
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, Hash, nil)
317
+ config_attr :interceptors, nil, Array, nil
318
+ config_attr :timeout, nil, Numeric, nil
319
+ config_attr :metadata, nil, Hash, nil
320
+ config_attr :retry_policy, nil, Hash, Proc, nil
321
+
322
+ # @private
323
+ def initialize parent_config = nil
324
+ @parent_config = parent_config unless parent_config.nil?
325
+
326
+ yield self if block_given?
327
+ end
328
+
329
+ ##
330
+ # Configurations for individual RPCs
331
+ # @return [Rpcs]
332
+ #
333
+ def rpcs
334
+ @rpcs ||= begin
335
+ parent_rpcs = nil
336
+ parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to? :rpcs
337
+ Rpcs.new parent_rpcs
338
+ end
339
+ end
340
+
341
+ ##
342
+ # Configuration RPC class for the EventService API.
343
+ #
344
+ # Includes fields providing the configuration for each RPC in this service.
345
+ # Each configuration object is of type `Gapic::Config::Method` and includes
346
+ # the following configuration fields:
347
+ #
348
+ # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
349
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
350
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
351
+ # include the following keys:
352
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
353
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
354
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
355
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
356
+ # trigger a retry.
357
+ #
358
+ class Rpcs
359
+ ##
360
+ # RPC-specific configuration for `create_client_event`
361
+ # @return [Gapic::Config::Method]
362
+ #
363
+ attr_reader :create_client_event
364
+
365
+ # @private
366
+ def initialize parent_rpcs = nil
367
+ create_client_event_config = parent_rpcs&.create_client_event if parent_rpcs&.respond_to? :create_client_event
368
+ @create_client_event = Gapic::Config::Method.new create_client_event_config
369
+
370
+ yield self if block_given?
371
+ end
372
+ end
373
+ end
374
+ end
375
+ end
376
+ end
377
+ end
378
+ end
379
+ end