google-cloud-talent 0.10.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +2 -1
  3. data/AUTHENTICATION.md +51 -59
  4. data/LICENSE.md +201 -0
  5. data/MIGRATING.md +347 -0
  6. data/README.md +97 -27
  7. data/lib/{google/cloud/talent/v4beta1/doc/google/protobuf/empty.rb → google-cloud-talent.rb} +4 -14
  8. data/lib/google/cloud/talent.rb +203 -453
  9. data/lib/google/cloud/talent/version.rb +6 -2
  10. metadata +76 -111
  11. data/LICENSE +0 -201
  12. data/lib/google/cloud/talent/v4beta1.rb +0 -543
  13. data/lib/google/cloud/talent/v4beta1/application_pb.rb +0 -63
  14. data/lib/google/cloud/talent/v4beta1/application_service_client.rb +0 -527
  15. data/lib/google/cloud/talent/v4beta1/application_service_client_config.json +0 -51
  16. data/lib/google/cloud/talent/v4beta1/application_service_pb.rb +0 -55
  17. data/lib/google/cloud/talent/v4beta1/application_service_services_pb.rb +0 -55
  18. data/lib/google/cloud/talent/v4beta1/batch_pb.rb +0 -18
  19. data/lib/google/cloud/talent/v4beta1/common_pb.rb +0 -341
  20. data/lib/google/cloud/talent/v4beta1/company_pb.rb +0 -41
  21. data/lib/google/cloud/talent/v4beta1/company_service_client.rb +0 -536
  22. data/lib/google/cloud/talent/v4beta1/company_service_client_config.json +0 -51
  23. data/lib/google/cloud/talent/v4beta1/company_service_pb.rb +0 -56
  24. data/lib/google/cloud/talent/v4beta1/company_service_services_pb.rb +0 -55
  25. data/lib/google/cloud/talent/v4beta1/completion_client.rb +0 -344
  26. data/lib/google/cloud/talent/v4beta1/completion_client_config.json +0 -31
  27. data/lib/google/cloud/talent/v4beta1/completion_service_pb.rb +0 -56
  28. data/lib/google/cloud/talent/v4beta1/completion_service_services_pb.rb +0 -47
  29. data/lib/google/cloud/talent/v4beta1/credentials.rb +0 -42
  30. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/application.rb +0 -162
  31. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/application_service.rb +0 -100
  32. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/common.rb +0 -1057
  33. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/company.rb +0 -107
  34. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/company_service.rb +0 -116
  35. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/completion_service.rb +0 -130
  36. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/event.rb +0 -224
  37. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/event_service.rb +0 -36
  38. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/filters.rb +0 -763
  39. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/histogram.rb +0 -50
  40. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/job.rb +0 -331
  41. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/job_service.rb +0 -694
  42. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/profile.rb +0 -750
  43. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/profile_service.rb +0 -361
  44. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/tenant.rb +0 -70
  45. data/lib/google/cloud/talent/v4beta1/doc/google/cloud/talent/v4beta1/tenant_service.rb +0 -96
  46. data/lib/google/cloud/talent/v4beta1/doc/google/longrunning/operations.rb +0 -51
  47. data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/any.rb +0 -131
  48. data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/duration.rb +0 -91
  49. data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/field_mask.rb +0 -222
  50. data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/timestamp.rb +0 -113
  51. data/lib/google/cloud/talent/v4beta1/doc/google/protobuf/wrappers.rb +0 -34
  52. data/lib/google/cloud/talent/v4beta1/doc/google/rpc/status.rb +0 -39
  53. data/lib/google/cloud/talent/v4beta1/doc/google/type/date.rb +0 -43
  54. data/lib/google/cloud/talent/v4beta1/doc/google/type/latlng.rb +0 -31
  55. data/lib/google/cloud/talent/v4beta1/doc/google/type/money.rb +0 -36
  56. data/lib/google/cloud/talent/v4beta1/doc/google/type/postal_address.rb +0 -128
  57. data/lib/google/cloud/talent/v4beta1/doc/google/type/timeofday.rb +0 -37
  58. data/lib/google/cloud/talent/v4beta1/event_pb.rb +0 -69
  59. data/lib/google/cloud/talent/v4beta1/event_service_client.rb +0 -271
  60. data/lib/google/cloud/talent/v4beta1/event_service_client_config.json +0 -31
  61. data/lib/google/cloud/talent/v4beta1/event_service_pb.rb +0 -27
  62. data/lib/google/cloud/talent/v4beta1/event_service_services_pb.rb +0 -52
  63. data/lib/google/cloud/talent/v4beta1/filters_pb.rb +0 -187
  64. data/lib/google/cloud/talent/v4beta1/helpers.rb +0 -179
  65. data/lib/google/cloud/talent/v4beta1/histogram_pb.rb +0 -27
  66. data/lib/google/cloud/talent/v4beta1/job_pb.rb +0 -72
  67. data/lib/google/cloud/talent/v4beta1/job_service_client.rb +0 -1521
  68. data/lib/google/cloud/talent/v4beta1/job_service_client_config.json +0 -76
  69. data/lib/google/cloud/talent/v4beta1/job_service_pb.rb +0 -166
  70. data/lib/google/cloud/talent/v4beta1/job_service_services_pb.rb +0 -87
  71. data/lib/google/cloud/talent/v4beta1/profile_pb.rb +0 -213
  72. data/lib/google/cloud/talent/v4beta1/profile_service_client.rb +0 -765
  73. data/lib/google/cloud/talent/v4beta1/profile_service_client_config.json +0 -56
  74. data/lib/google/cloud/talent/v4beta1/profile_service_pb.rb +0 -91
  75. data/lib/google/cloud/talent/v4beta1/profile_service_services_pb.rb +0 -64
  76. data/lib/google/cloud/talent/v4beta1/tenant_pb.rb +0 -34
  77. data/lib/google/cloud/talent/v4beta1/tenant_service_client.rb +0 -474
  78. data/lib/google/cloud/talent/v4beta1/tenant_service_client_config.json +0 -51
  79. data/lib/google/cloud/talent/v4beta1/tenant_service_pb.rb +0 -55
  80. data/lib/google/cloud/talent/v4beta1/tenant_service_services_pb.rb +0 -54
@@ -1,56 +0,0 @@
1
- {
2
- "interfaces": {
3
- "google.cloud.talent.v4beta1.ProfileService": {
4
- "retry_codes": {
5
- "idempotent": [
6
- "DEADLINE_EXCEEDED",
7
- "UNAVAILABLE"
8
- ],
9
- "non_idempotent": []
10
- },
11
- "retry_params": {
12
- "default": {
13
- "initial_retry_delay_millis": 100,
14
- "retry_delay_multiplier": 1.3,
15
- "max_retry_delay_millis": 60000,
16
- "initial_rpc_timeout_millis": 20000,
17
- "rpc_timeout_multiplier": 1.0,
18
- "max_rpc_timeout_millis": 20000,
19
- "total_timeout_millis": 600000
20
- }
21
- },
22
- "methods": {
23
- "DeleteProfile": {
24
- "timeout_millis": 60000,
25
- "retry_codes_name": "idempotent",
26
- "retry_params_name": "default"
27
- },
28
- "SearchProfiles": {
29
- "timeout_millis": 60000,
30
- "retry_codes_name": "non_idempotent",
31
- "retry_params_name": "default"
32
- },
33
- "ListProfiles": {
34
- "timeout_millis": 60000,
35
- "retry_codes_name": "idempotent",
36
- "retry_params_name": "default"
37
- },
38
- "CreateProfile": {
39
- "timeout_millis": 60000,
40
- "retry_codes_name": "non_idempotent",
41
- "retry_params_name": "default"
42
- },
43
- "GetProfile": {
44
- "timeout_millis": 60000,
45
- "retry_codes_name": "idempotent",
46
- "retry_params_name": "default"
47
- },
48
- "UpdateProfile": {
49
- "timeout_millis": 60000,
50
- "retry_codes_name": "non_idempotent",
51
- "retry_params_name": "default"
52
- }
53
- }
54
- }
55
- }
56
- }
@@ -1,91 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: google/cloud/talent/v4beta1/profile_service.proto
3
-
4
-
5
- require 'google/protobuf'
6
-
7
- require 'google/api/annotations_pb'
8
- require 'google/api/client_pb'
9
- require 'google/api/field_behavior_pb'
10
- require 'google/api/resource_pb'
11
- require 'google/cloud/talent/v4beta1/common_pb'
12
- require 'google/cloud/talent/v4beta1/filters_pb'
13
- require 'google/cloud/talent/v4beta1/histogram_pb'
14
- require 'google/cloud/talent/v4beta1/profile_pb'
15
- require 'google/longrunning/operations_pb'
16
- require 'google/protobuf/any_pb'
17
- require 'google/protobuf/empty_pb'
18
- require 'google/protobuf/field_mask_pb'
19
- require 'google/rpc/status_pb'
20
- Google::Protobuf::DescriptorPool.generated_pool.build do
21
- add_message "google.cloud.talent.v4beta1.ListProfilesRequest" do
22
- optional :parent, :string, 1
23
- optional :filter, :string, 5
24
- optional :page_token, :string, 2
25
- optional :page_size, :int32, 3
26
- optional :read_mask, :message, 4, "google.protobuf.FieldMask"
27
- end
28
- add_message "google.cloud.talent.v4beta1.ListProfilesResponse" do
29
- repeated :profiles, :message, 1, "google.cloud.talent.v4beta1.Profile"
30
- optional :next_page_token, :string, 2
31
- end
32
- add_message "google.cloud.talent.v4beta1.CreateProfileRequest" do
33
- optional :parent, :string, 1
34
- optional :profile, :message, 2, "google.cloud.talent.v4beta1.Profile"
35
- end
36
- add_message "google.cloud.talent.v4beta1.GetProfileRequest" do
37
- optional :name, :string, 1
38
- end
39
- add_message "google.cloud.talent.v4beta1.UpdateProfileRequest" do
40
- optional :profile, :message, 1, "google.cloud.talent.v4beta1.Profile"
41
- optional :update_mask, :message, 2, "google.protobuf.FieldMask"
42
- end
43
- add_message "google.cloud.talent.v4beta1.DeleteProfileRequest" do
44
- optional :name, :string, 1
45
- end
46
- add_message "google.cloud.talent.v4beta1.SearchProfilesRequest" do
47
- optional :parent, :string, 1
48
- optional :request_metadata, :message, 2, "google.cloud.talent.v4beta1.RequestMetadata"
49
- optional :profile_query, :message, 3, "google.cloud.talent.v4beta1.ProfileQuery"
50
- optional :page_size, :int32, 4
51
- optional :page_token, :string, 5
52
- optional :offset, :int32, 6
53
- optional :disable_spell_check, :bool, 7
54
- optional :order_by, :string, 8
55
- optional :case_sensitive_sort, :bool, 9
56
- repeated :histogram_queries, :message, 10, "google.cloud.talent.v4beta1.HistogramQuery"
57
- optional :result_set_id, :string, 12
58
- optional :strict_keywords_search, :bool, 13
59
- end
60
- add_message "google.cloud.talent.v4beta1.SearchProfilesResponse" do
61
- optional :estimated_total_size, :int64, 1
62
- optional :spell_correction, :message, 2, "google.cloud.talent.v4beta1.SpellingCorrection"
63
- optional :metadata, :message, 3, "google.cloud.talent.v4beta1.ResponseMetadata"
64
- optional :next_page_token, :string, 4
65
- repeated :histogram_query_results, :message, 5, "google.cloud.talent.v4beta1.HistogramQueryResult"
66
- repeated :summarized_profiles, :message, 6, "google.cloud.talent.v4beta1.SummarizedProfile"
67
- optional :result_set_id, :string, 7
68
- end
69
- add_message "google.cloud.talent.v4beta1.SummarizedProfile" do
70
- repeated :profiles, :message, 1, "google.cloud.talent.v4beta1.Profile"
71
- optional :summary, :message, 2, "google.cloud.talent.v4beta1.Profile"
72
- end
73
- end
74
-
75
- module Google
76
- module Cloud
77
- module Talent
78
- module V4beta1
79
- ListProfilesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ListProfilesRequest").msgclass
80
- ListProfilesResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ListProfilesResponse").msgclass
81
- CreateProfileRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CreateProfileRequest").msgclass
82
- GetProfileRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.GetProfileRequest").msgclass
83
- UpdateProfileRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.UpdateProfileRequest").msgclass
84
- DeleteProfileRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.DeleteProfileRequest").msgclass
85
- SearchProfilesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SearchProfilesRequest").msgclass
86
- SearchProfilesResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SearchProfilesResponse").msgclass
87
- SummarizedProfile = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SummarizedProfile").msgclass
88
- end
89
- end
90
- end
91
- end
@@ -1,64 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # Source: google/cloud/talent/v4beta1/profile_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
-
20
- require 'grpc'
21
- require 'google/cloud/talent/v4beta1/profile_service_pb'
22
-
23
- module Google
24
- module Cloud
25
- module Talent
26
- module V4beta1
27
- module ProfileService
28
- # A service that handles profile management, including profile CRUD,
29
- # enumeration and search.
30
- class Service
31
-
32
- include GRPC::GenericService
33
-
34
- self.marshal_class_method = :encode
35
- self.unmarshal_class_method = :decode
36
- self.service_name = 'google.cloud.talent.v4beta1.ProfileService'
37
-
38
- # Lists profiles by filter. The order is unspecified.
39
- rpc :ListProfiles, ListProfilesRequest, ListProfilesResponse
40
- # Creates and returns a new profile.
41
- rpc :CreateProfile, CreateProfileRequest, Profile
42
- # Gets the specified profile.
43
- rpc :GetProfile, GetProfileRequest, Profile
44
- # Updates the specified profile and returns the updated result.
45
- rpc :UpdateProfile, UpdateProfileRequest, Profile
46
- # Deletes the specified profile.
47
- # Prerequisite: The profile has no associated applications or assignments
48
- # associated.
49
- rpc :DeleteProfile, DeleteProfileRequest, Google::Protobuf::Empty
50
- # Searches for profiles within a tenant.
51
- #
52
- # For example, search by raw queries "software engineer in Mountain View" or
53
- # search by structured filters (location filter, education filter, etc.).
54
- #
55
- # See [SearchProfilesRequest][google.cloud.talent.v4beta1.SearchProfilesRequest] for more information.
56
- rpc :SearchProfiles, SearchProfilesRequest, SearchProfilesResponse
57
- end
58
-
59
- Stub = Service.rpc_stub_class
60
- end
61
- end
62
- end
63
- end
64
- end
@@ -1,34 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: google/cloud/talent/v4beta1/tenant.proto
3
-
4
-
5
- require 'google/protobuf'
6
-
7
- require 'google/api/field_behavior_pb'
8
- require 'google/api/resource_pb'
9
- require 'google/protobuf/timestamp_pb'
10
- require 'google/api/annotations_pb'
11
- Google::Protobuf::DescriptorPool.generated_pool.build do
12
- add_message "google.cloud.talent.v4beta1.Tenant" do
13
- optional :name, :string, 1
14
- optional :external_id, :string, 2
15
- optional :usage_type, :enum, 3, "google.cloud.talent.v4beta1.Tenant.DataUsageType"
16
- repeated :keyword_searchable_profile_custom_attributes, :string, 4
17
- end
18
- add_enum "google.cloud.talent.v4beta1.Tenant.DataUsageType" do
19
- value :DATA_USAGE_TYPE_UNSPECIFIED, 0
20
- value :AGGREGATED, 1
21
- value :ISOLATED, 2
22
- end
23
- end
24
-
25
- module Google
26
- module Cloud
27
- module Talent
28
- module V4beta1
29
- Tenant = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Tenant").msgclass
30
- Tenant::DataUsageType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Tenant.DataUsageType").enummodule
31
- end
32
- end
33
- end
34
- end
@@ -1,474 +0,0 @@
1
- # Copyright 2020 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
- # EDITING INSTRUCTIONS
16
- # This file was generated from the file
17
- # https://github.com/googleapis/googleapis/blob/master/google/cloud/talent/v4beta1/tenant_service.proto,
18
- # and updates to that file get reflected here through a refresh process.
19
- # For the short term, the refresh process will only be runnable by Google
20
- # engineers.
21
-
22
-
23
- require "json"
24
- require "pathname"
25
-
26
- require "google/gax"
27
-
28
- require "google/cloud/talent/v4beta1/tenant_service_pb"
29
- require "google/cloud/talent/v4beta1/credentials"
30
- require "google/cloud/talent/version"
31
-
32
- module Google
33
- module Cloud
34
- module Talent
35
- module V4beta1
36
- # A service that handles tenant management, including CRUD and enumeration.
37
- #
38
- # @!attribute [r] tenant_service_stub
39
- # @return [Google::Cloud::Talent::V4beta1::TenantService::Stub]
40
- class TenantServiceClient
41
- # @private
42
- attr_reader :tenant_service_stub
43
-
44
- # The default address of the service.
45
- SERVICE_ADDRESS = "jobs.googleapis.com".freeze
46
-
47
- # The default port of the service.
48
- DEFAULT_SERVICE_PORT = 443
49
-
50
- # The default set of gRPC interceptors.
51
- GRPC_INTERCEPTORS = []
52
-
53
- DEFAULT_TIMEOUT = 30
54
-
55
- PAGE_DESCRIPTORS = {
56
- "list_tenants" => Google::Gax::PageDescriptor.new(
57
- "page_token",
58
- "next_page_token",
59
- "tenants")
60
- }.freeze
61
-
62
- private_constant :PAGE_DESCRIPTORS
63
-
64
- # The scopes needed to make gRPC calls to all of the methods defined in
65
- # this service.
66
- ALL_SCOPES = [
67
- "https://www.googleapis.com/auth/cloud-platform",
68
- "https://www.googleapis.com/auth/jobs"
69
- ].freeze
70
-
71
-
72
- PROJECT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
73
- "projects/{project}"
74
- )
75
-
76
- private_constant :PROJECT_PATH_TEMPLATE
77
-
78
- TENANT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
79
- "projects/{project}/tenants/{tenant}"
80
- )
81
-
82
- private_constant :TENANT_PATH_TEMPLATE
83
-
84
- # Returns a fully-qualified project resource name string.
85
- # @param project [String]
86
- # @return [String]
87
- def self.project_path project
88
- PROJECT_PATH_TEMPLATE.render(
89
- :"project" => project
90
- )
91
- end
92
-
93
- # Returns a fully-qualified tenant resource name string.
94
- # @param project [String]
95
- # @param tenant [String]
96
- # @return [String]
97
- def self.tenant_path project, tenant
98
- TENANT_PATH_TEMPLATE.render(
99
- :"project" => project,
100
- :"tenant" => tenant
101
- )
102
- end
103
-
104
- # @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
105
- # Provides the means for authenticating requests made by the client. This parameter can
106
- # be many types.
107
- # A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
108
- # authenticating requests made by this client.
109
- # A `String` will be treated as the path to the keyfile to be used for the construction of
110
- # credentials for this client.
111
- # A `Hash` will be treated as the contents of a keyfile to be used for the construction of
112
- # credentials for this client.
113
- # A `GRPC::Core::Channel` will be used to make calls through.
114
- # A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
115
- # should already be composed with a `GRPC::Core::CallCredentials` object.
116
- # A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
117
- # metadata for requests, generally, to give OAuth credentials.
118
- # @param scopes [Array<String>]
119
- # The OAuth scopes for this service. This parameter is ignored if
120
- # an updater_proc is supplied.
121
- # @param client_config [Hash]
122
- # A Hash for call options for each method. See
123
- # Google::Gax#construct_settings for the structure of
124
- # this data. Falls back to the default config if not specified
125
- # or the specified config is missing data points.
126
- # @param timeout [Numeric]
127
- # The default timeout, in seconds, for calls made through this client.
128
- # @param metadata [Hash]
129
- # Default metadata to be sent with each request. This can be overridden on a per call basis.
130
- # @param service_address [String]
131
- # Override for the service hostname, or `nil` to leave as the default.
132
- # @param service_port [Integer]
133
- # Override for the service port, or `nil` to leave as the default.
134
- # @param exception_transformer [Proc]
135
- # An optional proc that intercepts any exceptions raised during an API call to inject
136
- # custom error handling.
137
- def initialize \
138
- credentials: nil,
139
- scopes: ALL_SCOPES,
140
- client_config: {},
141
- timeout: DEFAULT_TIMEOUT,
142
- metadata: nil,
143
- service_address: nil,
144
- service_port: nil,
145
- exception_transformer: nil,
146
- lib_name: nil,
147
- lib_version: ""
148
- # These require statements are intentionally placed here to initialize
149
- # the gRPC module only when it's required.
150
- # See https://github.com/googleapis/toolkit/issues/446
151
- require "google/gax/grpc"
152
- require "google/cloud/talent/v4beta1/tenant_service_services_pb"
153
-
154
- credentials ||= Google::Cloud::Talent::V4beta1::Credentials.default
155
-
156
- if credentials.is_a?(String) || credentials.is_a?(Hash)
157
- updater_proc = Google::Cloud::Talent::V4beta1::Credentials.new(credentials).updater_proc
158
- end
159
- if credentials.is_a?(GRPC::Core::Channel)
160
- channel = credentials
161
- end
162
- if credentials.is_a?(GRPC::Core::ChannelCredentials)
163
- chan_creds = credentials
164
- end
165
- if credentials.is_a?(Proc)
166
- updater_proc = credentials
167
- end
168
- if credentials.is_a?(Google::Auth::Credentials)
169
- updater_proc = credentials.updater_proc
170
- end
171
-
172
- package_version = Google::Cloud::Talent::VERSION
173
-
174
- google_api_client = "gl-ruby/#{RUBY_VERSION}"
175
- google_api_client << " #{lib_name}/#{lib_version}" if lib_name
176
- google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}"
177
- google_api_client << " grpc/#{GRPC::VERSION}"
178
- google_api_client.freeze
179
-
180
- headers = { :"x-goog-api-client" => google_api_client }
181
- if credentials.respond_to?(:quota_project_id) && credentials.quota_project_id
182
- headers[:"x-goog-user-project"] = credentials.quota_project_id
183
- end
184
- headers.merge!(metadata) unless metadata.nil?
185
- client_config_file = Pathname.new(__dir__).join(
186
- "tenant_service_client_config.json"
187
- )
188
- defaults = client_config_file.open do |f|
189
- Google::Gax.construct_settings(
190
- "google.cloud.talent.v4beta1.TenantService",
191
- JSON.parse(f.read),
192
- client_config,
193
- Google::Gax::Grpc::STATUS_CODE_NAMES,
194
- timeout,
195
- page_descriptors: PAGE_DESCRIPTORS,
196
- errors: Google::Gax::Grpc::API_ERRORS,
197
- metadata: headers
198
- )
199
- end
200
-
201
- # Allow overriding the service path/port in subclasses.
202
- service_path = service_address || self.class::SERVICE_ADDRESS
203
- port = service_port || self.class::DEFAULT_SERVICE_PORT
204
- interceptors = self.class::GRPC_INTERCEPTORS
205
- @tenant_service_stub = Google::Gax::Grpc.create_stub(
206
- service_path,
207
- port,
208
- chan_creds: chan_creds,
209
- channel: channel,
210
- updater_proc: updater_proc,
211
- scopes: scopes,
212
- interceptors: interceptors,
213
- &Google::Cloud::Talent::V4beta1::TenantService::Stub.method(:new)
214
- )
215
-
216
- @delete_tenant = Google::Gax.create_api_call(
217
- @tenant_service_stub.method(:delete_tenant),
218
- defaults["delete_tenant"],
219
- exception_transformer: exception_transformer,
220
- params_extractor: proc do |request|
221
- {'name' => request.name}
222
- end
223
- )
224
- @create_tenant = Google::Gax.create_api_call(
225
- @tenant_service_stub.method(:create_tenant),
226
- defaults["create_tenant"],
227
- exception_transformer: exception_transformer,
228
- params_extractor: proc do |request|
229
- {'parent' => request.parent}
230
- end
231
- )
232
- @get_tenant = Google::Gax.create_api_call(
233
- @tenant_service_stub.method(:get_tenant),
234
- defaults["get_tenant"],
235
- exception_transformer: exception_transformer,
236
- params_extractor: proc do |request|
237
- {'name' => request.name}
238
- end
239
- )
240
- @update_tenant = Google::Gax.create_api_call(
241
- @tenant_service_stub.method(:update_tenant),
242
- defaults["update_tenant"],
243
- exception_transformer: exception_transformer,
244
- params_extractor: proc do |request|
245
- {'tenant.name' => request.tenant.name}
246
- end
247
- )
248
- @list_tenants = Google::Gax.create_api_call(
249
- @tenant_service_stub.method(:list_tenants),
250
- defaults["list_tenants"],
251
- exception_transformer: exception_transformer,
252
- params_extractor: proc do |request|
253
- {'parent' => request.parent}
254
- end
255
- )
256
- end
257
-
258
- # Service calls
259
-
260
- # Deletes specified tenant.
261
- #
262
- # @param name [String]
263
- # Required. The resource name of the tenant to be deleted.
264
- #
265
- # The format is "projects/{project_id}/tenants/{tenant_id}", for example,
266
- # "projects/foo/tenants/bar".
267
- # @param options [Google::Gax::CallOptions]
268
- # Overrides the default settings for this call, e.g, timeout,
269
- # retries, etc.
270
- # @yield [result, operation] Access the result along with the RPC operation
271
- # @yieldparam result []
272
- # @yieldparam operation [GRPC::ActiveCall::Operation]
273
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
274
- # @example
275
- # require "google/cloud/talent"
276
- #
277
- # tenant_client = Google::Cloud::Talent::TenantService.new(version: :v4beta1)
278
- # formatted_name = Google::Cloud::Talent::V4beta1::TenantServiceClient.tenant_path("[PROJECT]", "[TENANT]")
279
- # tenant_client.delete_tenant(formatted_name)
280
-
281
- def delete_tenant \
282
- name,
283
- options: nil,
284
- &block
285
- req = {
286
- name: name
287
- }.delete_if { |_, v| v.nil? }
288
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::DeleteTenantRequest)
289
- @delete_tenant.call(req, options, &block)
290
- nil
291
- end
292
-
293
- # Creates a new tenant entity.
294
- #
295
- # @param parent [String]
296
- # Required. Resource name of the project under which the tenant is created.
297
- #
298
- # The format is "projects/{project_id}", for example,
299
- # "projects/foo".
300
- # @param tenant [Google::Cloud::Talent::V4beta1::Tenant | Hash]
301
- # Required. The tenant to be created.
302
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::Tenant`
303
- # can also be provided.
304
- # @param options [Google::Gax::CallOptions]
305
- # Overrides the default settings for this call, e.g, timeout,
306
- # retries, etc.
307
- # @yield [result, operation] Access the result along with the RPC operation
308
- # @yieldparam result [Google::Cloud::Talent::V4beta1::Tenant]
309
- # @yieldparam operation [GRPC::ActiveCall::Operation]
310
- # @return [Google::Cloud::Talent::V4beta1::Tenant]
311
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
312
- # @example
313
- # require "google/cloud/talent"
314
- #
315
- # tenant_client = Google::Cloud::Talent::TenantService.new(version: :v4beta1)
316
- # formatted_parent = Google::Cloud::Talent::V4beta1::TenantServiceClient.project_path("[PROJECT]")
317
- #
318
- # # TODO: Initialize `tenant`:
319
- # tenant = {}
320
- # response = tenant_client.create_tenant(formatted_parent, tenant)
321
-
322
- def create_tenant \
323
- parent,
324
- tenant,
325
- options: nil,
326
- &block
327
- req = {
328
- parent: parent,
329
- tenant: tenant
330
- }.delete_if { |_, v| v.nil? }
331
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::CreateTenantRequest)
332
- @create_tenant.call(req, options, &block)
333
- end
334
-
335
- # Retrieves specified tenant.
336
- #
337
- # @param name [String]
338
- # Required. The resource name of the tenant to be retrieved.
339
- #
340
- # The format is "projects/{project_id}/tenants/{tenant_id}", for example,
341
- # "projects/foo/tenants/bar".
342
- # @param options [Google::Gax::CallOptions]
343
- # Overrides the default settings for this call, e.g, timeout,
344
- # retries, etc.
345
- # @yield [result, operation] Access the result along with the RPC operation
346
- # @yieldparam result [Google::Cloud::Talent::V4beta1::Tenant]
347
- # @yieldparam operation [GRPC::ActiveCall::Operation]
348
- # @return [Google::Cloud::Talent::V4beta1::Tenant]
349
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
350
- # @example
351
- # require "google/cloud/talent"
352
- #
353
- # tenant_client = Google::Cloud::Talent::TenantService.new(version: :v4beta1)
354
- # formatted_name = Google::Cloud::Talent::V4beta1::TenantServiceClient.tenant_path("[PROJECT]", "[TENANT]")
355
- # response = tenant_client.get_tenant(formatted_name)
356
-
357
- def get_tenant \
358
- name,
359
- options: nil,
360
- &block
361
- req = {
362
- name: name
363
- }.delete_if { |_, v| v.nil? }
364
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::GetTenantRequest)
365
- @get_tenant.call(req, options, &block)
366
- end
367
-
368
- # Updates specified tenant.
369
- #
370
- # @param tenant [Google::Cloud::Talent::V4beta1::Tenant | Hash]
371
- # Required. The tenant resource to replace the current resource in the system.
372
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::Tenant`
373
- # can also be provided.
374
- # @param update_mask [Google::Protobuf::FieldMask | Hash]
375
- # Strongly recommended for the best service experience.
376
- #
377
- # If {Google::Cloud::Talent::V4beta1::UpdateTenantRequest#update_mask update_mask} is provided, only the specified fields in
378
- # {Google::Cloud::Talent::V4beta1::UpdateTenantRequest#tenant tenant} are updated. Otherwise all the fields are updated.
379
- #
380
- # A field mask to specify the tenant fields to be updated. Only
381
- # top level fields of {Google::Cloud::Talent::V4beta1::Tenant Tenant} are supported.
382
- # A hash of the same form as `Google::Protobuf::FieldMask`
383
- # can also be provided.
384
- # @param options [Google::Gax::CallOptions]
385
- # Overrides the default settings for this call, e.g, timeout,
386
- # retries, etc.
387
- # @yield [result, operation] Access the result along with the RPC operation
388
- # @yieldparam result [Google::Cloud::Talent::V4beta1::Tenant]
389
- # @yieldparam operation [GRPC::ActiveCall::Operation]
390
- # @return [Google::Cloud::Talent::V4beta1::Tenant]
391
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
392
- # @example
393
- # require "google/cloud/talent"
394
- #
395
- # tenant_client = Google::Cloud::Talent::TenantService.new(version: :v4beta1)
396
- #
397
- # # TODO: Initialize `tenant`:
398
- # tenant = {}
399
- # response = tenant_client.update_tenant(tenant)
400
-
401
- def update_tenant \
402
- tenant,
403
- update_mask: nil,
404
- options: nil,
405
- &block
406
- req = {
407
- tenant: tenant,
408
- update_mask: update_mask
409
- }.delete_if { |_, v| v.nil? }
410
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::UpdateTenantRequest)
411
- @update_tenant.call(req, options, &block)
412
- end
413
-
414
- # Lists all tenants associated with the project.
415
- #
416
- # @param parent [String]
417
- # Required. Resource name of the project under which the tenant is created.
418
- #
419
- # The format is "projects/{project_id}", for example,
420
- # "projects/foo".
421
- # @param page_size [Integer]
422
- # The maximum number of resources contained in the underlying API
423
- # response. If page streaming is performed per-resource, this
424
- # parameter does not affect the return value. If page streaming is
425
- # performed per-page, this determines the maximum number of
426
- # resources in a page.
427
- # @param options [Google::Gax::CallOptions]
428
- # Overrides the default settings for this call, e.g, timeout,
429
- # retries, etc.
430
- # @yield [result, operation] Access the result along with the RPC operation
431
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::Talent::V4beta1::Tenant>]
432
- # @yieldparam operation [GRPC::ActiveCall::Operation]
433
- # @return [Google::Gax::PagedEnumerable<Google::Cloud::Talent::V4beta1::Tenant>]
434
- # An enumerable of Google::Cloud::Talent::V4beta1::Tenant instances.
435
- # See Google::Gax::PagedEnumerable documentation for other
436
- # operations such as per-page iteration or access to the response
437
- # object.
438
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
439
- # @example
440
- # require "google/cloud/talent"
441
- #
442
- # tenant_client = Google::Cloud::Talent::TenantService.new(version: :v4beta1)
443
- # formatted_parent = Google::Cloud::Talent::V4beta1::TenantServiceClient.project_path("[PROJECT]")
444
- #
445
- # # Iterate over all results.
446
- # tenant_client.list_tenants(formatted_parent).each do |element|
447
- # # Process element.
448
- # end
449
- #
450
- # # Or iterate over results one page at a time.
451
- # tenant_client.list_tenants(formatted_parent).each_page do |page|
452
- # # Process each page at a time.
453
- # page.each do |element|
454
- # # Process element.
455
- # end
456
- # end
457
-
458
- def list_tenants \
459
- parent,
460
- page_size: nil,
461
- options: nil,
462
- &block
463
- req = {
464
- parent: parent,
465
- page_size: page_size
466
- }.delete_if { |_, v| v.nil? }
467
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::ListTenantsRequest)
468
- @list_tenants.call(req, options, &block)
469
- end
470
- end
471
- end
472
- end
473
- end
474
- end