google-cloud-talent 0.8.3 → 1.0.1

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 +203 -0
  5. data/MIGRATING.md +347 -0
  6. data/README.md +36 -25
  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 +75 -110
  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 -484
  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 -56
  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 -529
  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 -56
  25. data/lib/google/cloud/talent/v4beta1/completion_client.rb +0 -337
  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 -48
  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 -166
  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 -139
  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 -696
  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 -410
  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 -268
  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 -53
  63. data/lib/google/cloud/talent/v4beta1/filters_pb.rb +0 -187
  64. data/lib/google/cloud/talent/v4beta1/helpers.rb +0 -162
  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 -1510
  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 -88
  71. data/lib/google/cloud/talent/v4beta1/profile_pb.rb +0 -213
  72. data/lib/google/cloud/talent/v4beta1/profile_service_client.rb +0 -811
  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 -65
  76. data/lib/google/cloud/talent/v4beta1/tenant_pb.rb +0 -34
  77. data/lib/google/cloud/talent/v4beta1/tenant_service_client.rb +0 -471
  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 -55
@@ -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
- "ListProfiles": {
24
- "timeout_millis": 30000,
25
- "retry_codes_name": "idempotent",
26
- "retry_params_name": "default"
27
- },
28
- "CreateProfile": {
29
- "timeout_millis": 30000,
30
- "retry_codes_name": "non_idempotent",
31
- "retry_params_name": "default"
32
- },
33
- "GetProfile": {
34
- "timeout_millis": 30000,
35
- "retry_codes_name": "idempotent",
36
- "retry_params_name": "default"
37
- },
38
- "UpdateProfile": {
39
- "timeout_millis": 30000,
40
- "retry_codes_name": "non_idempotent",
41
- "retry_params_name": "default"
42
- },
43
- "DeleteProfile": {
44
- "timeout_millis": 30000,
45
- "retry_codes_name": "idempotent",
46
- "retry_params_name": "default"
47
- },
48
- "SearchProfiles": {
49
- "timeout_millis": 30000,
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,65 +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 2019 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
-
21
- require 'grpc'
22
- require 'google/cloud/talent/v4beta1/profile_service_pb'
23
-
24
- module Google
25
- module Cloud
26
- module Talent
27
- module V4beta1
28
- module ProfileService
29
- # A service that handles profile management, including profile CRUD,
30
- # enumeration and search.
31
- class Service
32
-
33
- include GRPC::GenericService
34
-
35
- self.marshal_class_method = :encode
36
- self.unmarshal_class_method = :decode
37
- self.service_name = 'google.cloud.talent.v4beta1.ProfileService'
38
-
39
- # Lists profiles by filter. The order is unspecified.
40
- rpc :ListProfiles, ListProfilesRequest, ListProfilesResponse
41
- # Creates and returns a new profile.
42
- rpc :CreateProfile, CreateProfileRequest, Profile
43
- # Gets the specified profile.
44
- rpc :GetProfile, GetProfileRequest, Profile
45
- # Updates the specified profile and returns the updated result.
46
- rpc :UpdateProfile, UpdateProfileRequest, Profile
47
- # Deletes the specified profile.
48
- # Prerequisite: The profile has no associated applications or assignments
49
- # associated.
50
- rpc :DeleteProfile, DeleteProfileRequest, Google::Protobuf::Empty
51
- # Searches for profiles within a tenant.
52
- #
53
- # For example, search by raw queries "software engineer in Mountain View" or
54
- # search by structured filters (location filter, education filter, etc.).
55
- #
56
- # See [SearchProfilesRequest][google.cloud.talent.v4beta1.SearchProfilesRequest] for more information.
57
- rpc :SearchProfiles, SearchProfilesRequest, SearchProfilesResponse
58
- end
59
-
60
- Stub = Service.rpc_stub_class
61
- end
62
- end
63
- end
64
- end
65
- 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,471 +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
- headers.merge!(metadata) unless metadata.nil?
182
- client_config_file = Pathname.new(__dir__).join(
183
- "tenant_service_client_config.json"
184
- )
185
- defaults = client_config_file.open do |f|
186
- Google::Gax.construct_settings(
187
- "google.cloud.talent.v4beta1.TenantService",
188
- JSON.parse(f.read),
189
- client_config,
190
- Google::Gax::Grpc::STATUS_CODE_NAMES,
191
- timeout,
192
- page_descriptors: PAGE_DESCRIPTORS,
193
- errors: Google::Gax::Grpc::API_ERRORS,
194
- metadata: headers
195
- )
196
- end
197
-
198
- # Allow overriding the service path/port in subclasses.
199
- service_path = service_address || self.class::SERVICE_ADDRESS
200
- port = service_port || self.class::DEFAULT_SERVICE_PORT
201
- interceptors = self.class::GRPC_INTERCEPTORS
202
- @tenant_service_stub = Google::Gax::Grpc.create_stub(
203
- service_path,
204
- port,
205
- chan_creds: chan_creds,
206
- channel: channel,
207
- updater_proc: updater_proc,
208
- scopes: scopes,
209
- interceptors: interceptors,
210
- &Google::Cloud::Talent::V4beta1::TenantService::Stub.method(:new)
211
- )
212
-
213
- @create_tenant = Google::Gax.create_api_call(
214
- @tenant_service_stub.method(:create_tenant),
215
- defaults["create_tenant"],
216
- exception_transformer: exception_transformer,
217
- params_extractor: proc do |request|
218
- {'parent' => request.parent}
219
- end
220
- )
221
- @get_tenant = Google::Gax.create_api_call(
222
- @tenant_service_stub.method(:get_tenant),
223
- defaults["get_tenant"],
224
- exception_transformer: exception_transformer,
225
- params_extractor: proc do |request|
226
- {'name' => request.name}
227
- end
228
- )
229
- @update_tenant = Google::Gax.create_api_call(
230
- @tenant_service_stub.method(:update_tenant),
231
- defaults["update_tenant"],
232
- exception_transformer: exception_transformer,
233
- params_extractor: proc do |request|
234
- {'tenant.name' => request.tenant.name}
235
- end
236
- )
237
- @delete_tenant = Google::Gax.create_api_call(
238
- @tenant_service_stub.method(:delete_tenant),
239
- defaults["delete_tenant"],
240
- exception_transformer: exception_transformer,
241
- params_extractor: proc do |request|
242
- {'name' => request.name}
243
- end
244
- )
245
- @list_tenants = Google::Gax.create_api_call(
246
- @tenant_service_stub.method(:list_tenants),
247
- defaults["list_tenants"],
248
- exception_transformer: exception_transformer,
249
- params_extractor: proc do |request|
250
- {'parent' => request.parent}
251
- end
252
- )
253
- end
254
-
255
- # Service calls
256
-
257
- # Creates a new tenant entity.
258
- #
259
- # @param parent [String]
260
- # Required. Resource name of the project under which the tenant is created.
261
- #
262
- # The format is "projects/{project_id}", for example,
263
- # "projects/foo".
264
- # @param tenant [Google::Cloud::Talent::V4beta1::Tenant | Hash]
265
- # Required. The tenant to be created.
266
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::Tenant`
267
- # can also be provided.
268
- # @param options [Google::Gax::CallOptions]
269
- # Overrides the default settings for this call, e.g, timeout,
270
- # retries, etc.
271
- # @yield [result, operation] Access the result along with the RPC operation
272
- # @yieldparam result [Google::Cloud::Talent::V4beta1::Tenant]
273
- # @yieldparam operation [GRPC::ActiveCall::Operation]
274
- # @return [Google::Cloud::Talent::V4beta1::Tenant]
275
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
276
- # @example
277
- # require "google/cloud/talent"
278
- #
279
- # tenant_client = Google::Cloud::Talent::TenantService.new(version: :v4beta1)
280
- # formatted_parent = Google::Cloud::Talent::V4beta1::TenantServiceClient.project_path("[PROJECT]")
281
- #
282
- # # TODO: Initialize `tenant`:
283
- # tenant = {}
284
- # response = tenant_client.create_tenant(formatted_parent, tenant)
285
-
286
- def create_tenant \
287
- parent,
288
- tenant,
289
- options: nil,
290
- &block
291
- req = {
292
- parent: parent,
293
- tenant: tenant
294
- }.delete_if { |_, v| v.nil? }
295
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::CreateTenantRequest)
296
- @create_tenant.call(req, options, &block)
297
- end
298
-
299
- # Retrieves specified tenant.
300
- #
301
- # @param name [String]
302
- # Required. The resource name of the tenant to be retrieved.
303
- #
304
- # The format is "projects/{project_id}/tenants/{tenant_id}", for example,
305
- # "projects/foo/tenants/bar".
306
- # @param options [Google::Gax::CallOptions]
307
- # Overrides the default settings for this call, e.g, timeout,
308
- # retries, etc.
309
- # @yield [result, operation] Access the result along with the RPC operation
310
- # @yieldparam result [Google::Cloud::Talent::V4beta1::Tenant]
311
- # @yieldparam operation [GRPC::ActiveCall::Operation]
312
- # @return [Google::Cloud::Talent::V4beta1::Tenant]
313
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
314
- # @example
315
- # require "google/cloud/talent"
316
- #
317
- # tenant_client = Google::Cloud::Talent::TenantService.new(version: :v4beta1)
318
- # formatted_name = Google::Cloud::Talent::V4beta1::TenantServiceClient.tenant_path("[PROJECT]", "[TENANT]")
319
- # response = tenant_client.get_tenant(formatted_name)
320
-
321
- def get_tenant \
322
- name,
323
- options: nil,
324
- &block
325
- req = {
326
- name: name
327
- }.delete_if { |_, v| v.nil? }
328
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::GetTenantRequest)
329
- @get_tenant.call(req, options, &block)
330
- end
331
-
332
- # Updates specified tenant.
333
- #
334
- # @param tenant [Google::Cloud::Talent::V4beta1::Tenant | Hash]
335
- # Required. The tenant resource to replace the current resource in the system.
336
- # A hash of the same form as `Google::Cloud::Talent::V4beta1::Tenant`
337
- # can also be provided.
338
- # @param update_mask [Google::Protobuf::FieldMask | Hash]
339
- # Strongly recommended for the best service experience.
340
- #
341
- # If {Google::Cloud::Talent::V4beta1::UpdateTenantRequest#update_mask update_mask} is provided, only the specified fields in
342
- # {Google::Cloud::Talent::V4beta1::UpdateTenantRequest#tenant tenant} are updated. Otherwise all the fields are updated.
343
- #
344
- # A field mask to specify the tenant fields to be updated. Only
345
- # top level fields of {Google::Cloud::Talent::V4beta1::Tenant Tenant} are supported.
346
- # A hash of the same form as `Google::Protobuf::FieldMask`
347
- # can also be provided.
348
- # @param options [Google::Gax::CallOptions]
349
- # Overrides the default settings for this call, e.g, timeout,
350
- # retries, etc.
351
- # @yield [result, operation] Access the result along with the RPC operation
352
- # @yieldparam result [Google::Cloud::Talent::V4beta1::Tenant]
353
- # @yieldparam operation [GRPC::ActiveCall::Operation]
354
- # @return [Google::Cloud::Talent::V4beta1::Tenant]
355
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
356
- # @example
357
- # require "google/cloud/talent"
358
- #
359
- # tenant_client = Google::Cloud::Talent::TenantService.new(version: :v4beta1)
360
- #
361
- # # TODO: Initialize `tenant`:
362
- # tenant = {}
363
- # response = tenant_client.update_tenant(tenant)
364
-
365
- def update_tenant \
366
- tenant,
367
- update_mask: nil,
368
- options: nil,
369
- &block
370
- req = {
371
- tenant: tenant,
372
- update_mask: update_mask
373
- }.delete_if { |_, v| v.nil? }
374
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::UpdateTenantRequest)
375
- @update_tenant.call(req, options, &block)
376
- end
377
-
378
- # Deletes specified tenant.
379
- #
380
- # @param name [String]
381
- # Required. The resource name of the tenant to be deleted.
382
- #
383
- # The format is "projects/{project_id}/tenants/{tenant_id}", for example,
384
- # "projects/foo/tenants/bar".
385
- # @param options [Google::Gax::CallOptions]
386
- # Overrides the default settings for this call, e.g, timeout,
387
- # retries, etc.
388
- # @yield [result, operation] Access the result along with the RPC operation
389
- # @yieldparam result []
390
- # @yieldparam operation [GRPC::ActiveCall::Operation]
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
- # formatted_name = Google::Cloud::Talent::V4beta1::TenantServiceClient.tenant_path("[PROJECT]", "[TENANT]")
397
- # tenant_client.delete_tenant(formatted_name)
398
-
399
- def delete_tenant \
400
- name,
401
- options: nil,
402
- &block
403
- req = {
404
- name: name
405
- }.delete_if { |_, v| v.nil? }
406
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::DeleteTenantRequest)
407
- @delete_tenant.call(req, options, &block)
408
- nil
409
- end
410
-
411
- # Lists all tenants associated with the project.
412
- #
413
- # @param parent [String]
414
- # Required. Resource name of the project under which the tenant is created.
415
- #
416
- # The format is "projects/{project_id}", for example,
417
- # "projects/foo".
418
- # @param page_size [Integer]
419
- # The maximum number of resources contained in the underlying API
420
- # response. If page streaming is performed per-resource, this
421
- # parameter does not affect the return value. If page streaming is
422
- # performed per-page, this determines the maximum number of
423
- # resources in a page.
424
- # @param options [Google::Gax::CallOptions]
425
- # Overrides the default settings for this call, e.g, timeout,
426
- # retries, etc.
427
- # @yield [result, operation] Access the result along with the RPC operation
428
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Cloud::Talent::V4beta1::Tenant>]
429
- # @yieldparam operation [GRPC::ActiveCall::Operation]
430
- # @return [Google::Gax::PagedEnumerable<Google::Cloud::Talent::V4beta1::Tenant>]
431
- # An enumerable of Google::Cloud::Talent::V4beta1::Tenant instances.
432
- # See Google::Gax::PagedEnumerable documentation for other
433
- # operations such as per-page iteration or access to the response
434
- # object.
435
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
436
- # @example
437
- # require "google/cloud/talent"
438
- #
439
- # tenant_client = Google::Cloud::Talent::TenantService.new(version: :v4beta1)
440
- # formatted_parent = Google::Cloud::Talent::V4beta1::TenantServiceClient.project_path("[PROJECT]")
441
- #
442
- # # Iterate over all results.
443
- # tenant_client.list_tenants(formatted_parent).each do |element|
444
- # # Process element.
445
- # end
446
- #
447
- # # Or iterate over results one page at a time.
448
- # tenant_client.list_tenants(formatted_parent).each_page do |page|
449
- # # Process each page at a time.
450
- # page.each do |element|
451
- # # Process element.
452
- # end
453
- # end
454
-
455
- def list_tenants \
456
- parent,
457
- page_size: nil,
458
- options: nil,
459
- &block
460
- req = {
461
- parent: parent,
462
- page_size: page_size
463
- }.delete_if { |_, v| v.nil? }
464
- req = Google::Gax::to_proto(req, Google::Cloud::Talent::V4beta1::ListTenantsRequest)
465
- @list_tenants.call(req, options, &block)
466
- end
467
- end
468
- end
469
- end
470
- end
471
- end