google-cloud-talent-v4beta1 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 ProfileService
26
+ # Credentials for the ProfileService API.
27
+ class Credentials < Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/cloud-platform",
30
+ "https://www.googleapis.com/auth/jobs"
31
+ ]
32
+ self.env_vars = [
33
+ "TALENT_CREDENTIALS",
34
+ "TALENT_KEYFILE",
35
+ "GOOGLE_CLOUD_CREDENTIALS",
36
+ "GOOGLE_CLOUD_KEYFILE",
37
+ "GCLOUD_KEYFILE",
38
+ "TALENT_CREDENTIALS_JSON",
39
+ "TALENT_KEYFILE_JSON",
40
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
41
+ "GOOGLE_CLOUD_KEYFILE_JSON",
42
+ "GCLOUD_KEYFILE_JSON"
43
+ ]
44
+ self.paths = [
45
+ "~/.config/google_cloud/application_default_credentials.json"
46
+ ]
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2020 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+
20
+ module Google
21
+ module Cloud
22
+ module Talent
23
+ module V4beta1
24
+ module ProfileService
25
+ # Path helper methods for the ProfileService API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified Profile resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `projects/{project}/tenants/{tenant}/profiles/{profile}`
33
+ #
34
+ # @param project [String]
35
+ # @param tenant [String]
36
+ # @param profile [String]
37
+ #
38
+ # @return [String]
39
+ def profile_path project:, tenant:, profile:
40
+ raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
41
+ raise ArgumentError, "tenant cannot contain /" if tenant.to_s.include? "/"
42
+
43
+ "projects/#{project}/tenants/#{tenant}/profiles/#{profile}"
44
+ end
45
+
46
+ ##
47
+ # Create a fully-qualified Tenant resource string.
48
+ #
49
+ # The resource will be in the following format:
50
+ #
51
+ # `projects/{project}/tenants/{tenant}`
52
+ #
53
+ # @param project [String]
54
+ # @param tenant [String]
55
+ #
56
+ # @return [String]
57
+ def tenant_path project:, tenant:
58
+ raise ArgumentError, "project cannot contain /" if project.to_s.include? "/"
59
+
60
+ "projects/#{project}/tenants/#{tenant}"
61
+ end
62
+
63
+ extend self
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,92 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/talent/v4beta1/profile_service.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/api/annotations_pb'
7
+ require 'google/api/client_pb'
8
+ require 'google/api/field_behavior_pb'
9
+ require 'google/api/resource_pb'
10
+ require 'google/cloud/talent/v4beta1/common_pb'
11
+ require 'google/cloud/talent/v4beta1/filters_pb'
12
+ require 'google/cloud/talent/v4beta1/histogram_pb'
13
+ require 'google/cloud/talent/v4beta1/profile_pb'
14
+ require 'google/longrunning/operations_pb'
15
+ require 'google/protobuf/any_pb'
16
+ require 'google/protobuf/empty_pb'
17
+ require 'google/protobuf/field_mask_pb'
18
+ require 'google/rpc/status_pb'
19
+ Google::Protobuf::DescriptorPool.generated_pool.build do
20
+ add_file("google/cloud/talent/v4beta1/profile_service.proto", :syntax => :proto3) 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
+ end
75
+
76
+ module Google
77
+ module Cloud
78
+ module Talent
79
+ module V4beta1
80
+ ListProfilesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ListProfilesRequest").msgclass
81
+ ListProfilesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.ListProfilesResponse").msgclass
82
+ CreateProfileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.CreateProfileRequest").msgclass
83
+ GetProfileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.GetProfileRequest").msgclass
84
+ UpdateProfileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.UpdateProfileRequest").msgclass
85
+ DeleteProfileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.DeleteProfileRequest").msgclass
86
+ SearchProfilesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SearchProfilesRequest").msgclass
87
+ SearchProfilesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SearchProfilesResponse").msgclass
88
+ SummarizedProfile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.SummarizedProfile").msgclass
89
+ end
90
+ end
91
+ end
92
+ end
@@ -0,0 +1,63 @@
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
+ require 'grpc'
20
+ require 'google/cloud/talent/v4beta1/profile_service_pb'
21
+
22
+ module Google
23
+ module Cloud
24
+ module Talent
25
+ module V4beta1
26
+ module ProfileService
27
+ # A service that handles profile management, including profile CRUD,
28
+ # enumeration and search.
29
+ class Service
30
+
31
+ include GRPC::GenericService
32
+
33
+ self.marshal_class_method = :encode
34
+ self.unmarshal_class_method = :decode
35
+ self.service_name = 'google.cloud.talent.v4beta1.ProfileService'
36
+
37
+ # Lists profiles by filter. The order is unspecified.
38
+ rpc :ListProfiles, ListProfilesRequest, ListProfilesResponse
39
+ # Creates and returns a new profile.
40
+ rpc :CreateProfile, CreateProfileRequest, Profile
41
+ # Gets the specified profile.
42
+ rpc :GetProfile, GetProfileRequest, Profile
43
+ # Updates the specified profile and returns the updated result.
44
+ rpc :UpdateProfile, UpdateProfileRequest, Profile
45
+ # Deletes the specified profile.
46
+ # Prerequisite: The profile has no associated applications or assignments
47
+ # associated.
48
+ rpc :DeleteProfile, DeleteProfileRequest, Google::Protobuf::Empty
49
+ # Searches for profiles within a tenant.
50
+ #
51
+ # For example, search by raw queries "software engineer in Mountain View" or
52
+ # search by structured filters (location filter, education filter, etc.).
53
+ #
54
+ # See [SearchProfilesRequest][google.cloud.talent.v4beta1.SearchProfilesRequest] for more information.
55
+ rpc :SearchProfiles, SearchProfilesRequest, SearchProfilesResponse
56
+ end
57
+
58
+ Stub = Service.rpc_stub_class
59
+ end
60
+ end
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,35 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/cloud/talent/v4beta1/tenant.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'google/api/field_behavior_pb'
7
+ require 'google/api/resource_pb'
8
+ require 'google/protobuf/timestamp_pb'
9
+ require 'google/api/annotations_pb'
10
+ Google::Protobuf::DescriptorPool.generated_pool.build do
11
+ add_file("google/cloud/talent/v4beta1/tenant.proto", :syntax => :proto3) 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
+ end
25
+
26
+ module Google
27
+ module Cloud
28
+ module Talent
29
+ module V4beta1
30
+ Tenant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Tenant").msgclass
31
+ Tenant::DataUsageType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.talent.v4beta1.Tenant.DataUsageType").enummodule
32
+ end
33
+ end
34
+ end
35
+ 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/tenant_service/credentials"
26
+ require "google/cloud/talent/v4beta1/tenant_service/paths"
27
+ require "google/cloud/talent/v4beta1/tenant_service/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module Talent
32
+ module V4beta1
33
+ ##
34
+ # A service that handles tenant management, including CRUD and enumeration.
35
+ #
36
+ # To load this service and instantiate a client:
37
+ #
38
+ # require "google/cloud/talent/v4beta1/tenant_service"
39
+ # client = Google::Cloud::Talent::V4beta1::TenantService::Client.new
40
+ #
41
+ module TenantService
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+
48
+ helper_path = ::File.join __dir__, "tenant_service", "helpers.rb"
49
+ require "google/cloud/talent/v4beta1/tenant_service/helpers" if ::File.file? helper_path
@@ -0,0 +1,712 @@
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/tenant_service_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Talent
25
+ module V4beta1
26
+ module TenantService
27
+ ##
28
+ # Client for the TenantService service.
29
+ #
30
+ # A service that handles tenant management, including CRUD and enumeration.
31
+ #
32
+ class Client
33
+ include Paths
34
+
35
+ # @private
36
+ attr_reader :tenant_service_stub
37
+
38
+ ##
39
+ # Configure the TenantService Client class.
40
+ #
41
+ # See {Google::Cloud::Talent::V4beta1::TenantService::Client::Configuration}
42
+ # for a description of the configuration fields.
43
+ #
44
+ # ## Example
45
+ #
46
+ # To modify the configuration for all TenantService clients:
47
+ #
48
+ # Google::Cloud::Talent::V4beta1::TenantService::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_tenant.timeout = 30.0
69
+
70
+ default_config.rpcs.get_tenant.timeout = 30.0
71
+ default_config.rpcs.get_tenant.retry_policy = {
72
+ initial_delay: 0.1,
73
+ max_delay: 60.0,
74
+ multiplier: 1.3,
75
+ retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
76
+ }
77
+
78
+ default_config.rpcs.update_tenant.timeout = 30.0
79
+
80
+ default_config.rpcs.delete_tenant.timeout = 30.0
81
+ default_config.rpcs.delete_tenant.retry_policy = {
82
+ initial_delay: 0.1,
83
+ max_delay: 60.0,
84
+ multiplier: 1.3,
85
+ retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
86
+ }
87
+
88
+ default_config.rpcs.list_tenants.timeout = 30.0
89
+ default_config.rpcs.list_tenants.retry_policy = {
90
+ initial_delay: 0.1,
91
+ max_delay: 60.0,
92
+ multiplier: 1.3,
93
+ retry_codes: ["DEADLINE_EXCEEDED", "UNAVAILABLE"]
94
+ }
95
+
96
+ default_config
97
+ end
98
+ yield @configure if block_given?
99
+ @configure
100
+ end
101
+
102
+ ##
103
+ # Configure the TenantService Client instance.
104
+ #
105
+ # The configuration is set to the derived mode, meaning that values can be changed,
106
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
107
+ # should be made on {Client.configure}.
108
+ #
109
+ # See {Google::Cloud::Talent::V4beta1::TenantService::Client::Configuration}
110
+ # for a description of the configuration fields.
111
+ #
112
+ # @yield [config] Configure the Client client.
113
+ # @yieldparam config [Client::Configuration]
114
+ #
115
+ # @return [Client::Configuration]
116
+ #
117
+ def configure
118
+ yield @config if block_given?
119
+ @config
120
+ end
121
+
122
+ ##
123
+ # Create a new TenantService client object.
124
+ #
125
+ # ## Examples
126
+ #
127
+ # To create a new TenantService client with the default
128
+ # configuration:
129
+ #
130
+ # client = Google::Cloud::Talent::V4beta1::TenantService::Client.new
131
+ #
132
+ # To create a new TenantService client with a custom
133
+ # configuration:
134
+ #
135
+ # client = Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config|
136
+ # config.timeout = 10_000
137
+ # end
138
+ #
139
+ # @yield [config] Configure the TenantService client.
140
+ # @yieldparam config [Client::Configuration]
141
+ #
142
+ def initialize
143
+ # These require statements are intentionally placed here to initialize
144
+ # the gRPC module only when it's required.
145
+ # See https://github.com/googleapis/toolkit/issues/446
146
+ require "gapic/grpc"
147
+ require "google/cloud/talent/v4beta1/tenant_service_services_pb"
148
+
149
+ # Create the configuration object
150
+ @config = Configuration.new Client.configure
151
+
152
+ # Yield the configuration if needed
153
+ yield @config if block_given?
154
+
155
+ # Create credentials
156
+ credentials = @config.credentials
157
+ credentials ||= Credentials.default scope: @config.scope
158
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
159
+ credentials = Credentials.new credentials, scope: @config.scope
160
+ end
161
+ @quota_project_id = credentials.respond_to?(:quota_project_id) ? credentials.quota_project_id : nil
162
+
163
+ @tenant_service_stub = Gapic::ServiceStub.new(
164
+ Google::Cloud::Talent::V4beta1::TenantService::Stub,
165
+ credentials: credentials,
166
+ endpoint: @config.endpoint,
167
+ channel_args: @config.channel_args,
168
+ interceptors: @config.interceptors
169
+ )
170
+ end
171
+
172
+ # Service calls
173
+
174
+ ##
175
+ # Creates a new tenant entity.
176
+ #
177
+ # @overload create_tenant(request, options = nil)
178
+ # Pass arguments to `create_tenant` via a request object, either of type
179
+ # {Google::Cloud::Talent::V4beta1::CreateTenantRequest} or an equivalent Hash.
180
+ #
181
+ # @param request [Google::Cloud::Talent::V4beta1::CreateTenantRequest, Hash]
182
+ # A request object representing the call parameters. Required. To specify no
183
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
184
+ # @param options [Gapic::CallOptions, Hash]
185
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
186
+ #
187
+ # @overload create_tenant(parent: nil, tenant: nil)
188
+ # Pass arguments to `create_tenant` via keyword arguments. Note that at
189
+ # least one keyword argument is required. To specify no parameters, or to keep all
190
+ # the default parameter values, pass an empty Hash as a request object (see above).
191
+ #
192
+ # @param parent [String]
193
+ # Required. Resource name of the project under which the tenant is created.
194
+ #
195
+ # The format is "projects/\\{project_id}", for example,
196
+ # "projects/foo".
197
+ # @param tenant [Google::Cloud::Talent::V4beta1::Tenant, Hash]
198
+ # Required. The tenant to be created.
199
+ #
200
+ # @yield [response, operation] Access the result along with the RPC operation
201
+ # @yieldparam response [Google::Cloud::Talent::V4beta1::Tenant]
202
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
203
+ #
204
+ # @return [Google::Cloud::Talent::V4beta1::Tenant]
205
+ #
206
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
207
+ #
208
+ def create_tenant request, options = nil
209
+ raise ArgumentError, "request must be provided" if request.nil?
210
+
211
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Talent::V4beta1::CreateTenantRequest
212
+
213
+ # Converts hash and nil to an options object
214
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
215
+
216
+ # Customize the options with defaults
217
+ metadata = @config.rpcs.create_tenant.metadata.to_h
218
+
219
+ # Set x-goog-api-client and x-goog-user-project headers
220
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
221
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
222
+ gapic_version: ::Google::Cloud::Talent::V4beta1::VERSION
223
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
224
+
225
+ header_params = {
226
+ "parent" => request.parent
227
+ }
228
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
229
+ metadata[:"x-goog-request-params"] ||= request_params_header
230
+
231
+ options.apply_defaults timeout: @config.rpcs.create_tenant.timeout,
232
+ metadata: metadata,
233
+ retry_policy: @config.rpcs.create_tenant.retry_policy
234
+ options.apply_defaults metadata: @config.metadata,
235
+ retry_policy: @config.retry_policy
236
+
237
+ @tenant_service_stub.call_rpc :create_tenant, request, options: options do |response, operation|
238
+ yield response, operation if block_given?
239
+ return response
240
+ end
241
+ rescue GRPC::BadStatus => e
242
+ raise Google::Cloud::Error.from_error(e)
243
+ end
244
+
245
+ ##
246
+ # Retrieves specified tenant.
247
+ #
248
+ # @overload get_tenant(request, options = nil)
249
+ # Pass arguments to `get_tenant` via a request object, either of type
250
+ # {Google::Cloud::Talent::V4beta1::GetTenantRequest} or an equivalent Hash.
251
+ #
252
+ # @param request [Google::Cloud::Talent::V4beta1::GetTenantRequest, Hash]
253
+ # A request object representing the call parameters. Required. To specify no
254
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
255
+ # @param options [Gapic::CallOptions, Hash]
256
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
257
+ #
258
+ # @overload get_tenant(name: nil)
259
+ # Pass arguments to `get_tenant` via keyword arguments. Note that at
260
+ # least one keyword argument is required. To specify no parameters, or to keep all
261
+ # the default parameter values, pass an empty Hash as a request object (see above).
262
+ #
263
+ # @param name [String]
264
+ # Required. The resource name of the tenant to be retrieved.
265
+ #
266
+ # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example,
267
+ # "projects/foo/tenants/bar".
268
+ #
269
+ # @yield [response, operation] Access the result along with the RPC operation
270
+ # @yieldparam response [Google::Cloud::Talent::V4beta1::Tenant]
271
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
272
+ #
273
+ # @return [Google::Cloud::Talent::V4beta1::Tenant]
274
+ #
275
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
276
+ #
277
+ def get_tenant request, options = nil
278
+ raise ArgumentError, "request must be provided" if request.nil?
279
+
280
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Talent::V4beta1::GetTenantRequest
281
+
282
+ # Converts hash and nil to an options object
283
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
284
+
285
+ # Customize the options with defaults
286
+ metadata = @config.rpcs.get_tenant.metadata.to_h
287
+
288
+ # Set x-goog-api-client and x-goog-user-project headers
289
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
290
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
291
+ gapic_version: ::Google::Cloud::Talent::V4beta1::VERSION
292
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
293
+
294
+ header_params = {
295
+ "name" => request.name
296
+ }
297
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
298
+ metadata[:"x-goog-request-params"] ||= request_params_header
299
+
300
+ options.apply_defaults timeout: @config.rpcs.get_tenant.timeout,
301
+ metadata: metadata,
302
+ retry_policy: @config.rpcs.get_tenant.retry_policy
303
+ options.apply_defaults metadata: @config.metadata,
304
+ retry_policy: @config.retry_policy
305
+
306
+ @tenant_service_stub.call_rpc :get_tenant, request, options: options do |response, operation|
307
+ yield response, operation if block_given?
308
+ return response
309
+ end
310
+ rescue GRPC::BadStatus => e
311
+ raise Google::Cloud::Error.from_error(e)
312
+ end
313
+
314
+ ##
315
+ # Updates specified tenant.
316
+ #
317
+ # @overload update_tenant(request, options = nil)
318
+ # Pass arguments to `update_tenant` via a request object, either of type
319
+ # {Google::Cloud::Talent::V4beta1::UpdateTenantRequest} or an equivalent Hash.
320
+ #
321
+ # @param request [Google::Cloud::Talent::V4beta1::UpdateTenantRequest, Hash]
322
+ # A request object representing the call parameters. Required. To specify no
323
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
324
+ # @param options [Gapic::CallOptions, Hash]
325
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
326
+ #
327
+ # @overload update_tenant(tenant: nil, update_mask: nil)
328
+ # Pass arguments to `update_tenant` via keyword arguments. Note that at
329
+ # least one keyword argument is required. To specify no parameters, or to keep all
330
+ # the default parameter values, pass an empty Hash as a request object (see above).
331
+ #
332
+ # @param tenant [Google::Cloud::Talent::V4beta1::Tenant, Hash]
333
+ # Required. The tenant resource to replace the current resource in the system.
334
+ # @param update_mask [Google::Protobuf::FieldMask, Hash]
335
+ # Strongly recommended for the best service experience.
336
+ #
337
+ # If {Google::Cloud::Talent::V4beta1::UpdateTenantRequest#update_mask update_mask} is provided, only the specified fields in
338
+ # {Google::Cloud::Talent::V4beta1::UpdateTenantRequest#tenant tenant} are updated. Otherwise all the fields are updated.
339
+ #
340
+ # A field mask to specify the tenant fields to be updated. Only
341
+ # top level fields of {Google::Cloud::Talent::V4beta1::Tenant Tenant} are supported.
342
+ #
343
+ # @yield [response, operation] Access the result along with the RPC operation
344
+ # @yieldparam response [Google::Cloud::Talent::V4beta1::Tenant]
345
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
346
+ #
347
+ # @return [Google::Cloud::Talent::V4beta1::Tenant]
348
+ #
349
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
350
+ #
351
+ def update_tenant request, options = nil
352
+ raise ArgumentError, "request must be provided" if request.nil?
353
+
354
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Talent::V4beta1::UpdateTenantRequest
355
+
356
+ # Converts hash and nil to an options object
357
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
358
+
359
+ # Customize the options with defaults
360
+ metadata = @config.rpcs.update_tenant.metadata.to_h
361
+
362
+ # Set x-goog-api-client and x-goog-user-project headers
363
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
364
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
365
+ gapic_version: ::Google::Cloud::Talent::V4beta1::VERSION
366
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
367
+
368
+ header_params = {
369
+ "tenant.name" => request.tenant.name
370
+ }
371
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
372
+ metadata[:"x-goog-request-params"] ||= request_params_header
373
+
374
+ options.apply_defaults timeout: @config.rpcs.update_tenant.timeout,
375
+ metadata: metadata,
376
+ retry_policy: @config.rpcs.update_tenant.retry_policy
377
+ options.apply_defaults metadata: @config.metadata,
378
+ retry_policy: @config.retry_policy
379
+
380
+ @tenant_service_stub.call_rpc :update_tenant, request, options: options do |response, operation|
381
+ yield response, operation if block_given?
382
+ return response
383
+ end
384
+ rescue GRPC::BadStatus => e
385
+ raise Google::Cloud::Error.from_error(e)
386
+ end
387
+
388
+ ##
389
+ # Deletes specified tenant.
390
+ #
391
+ # @overload delete_tenant(request, options = nil)
392
+ # Pass arguments to `delete_tenant` via a request object, either of type
393
+ # {Google::Cloud::Talent::V4beta1::DeleteTenantRequest} or an equivalent Hash.
394
+ #
395
+ # @param request [Google::Cloud::Talent::V4beta1::DeleteTenantRequest, Hash]
396
+ # A request object representing the call parameters. Required. To specify no
397
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
398
+ # @param options [Gapic::CallOptions, Hash]
399
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
400
+ #
401
+ # @overload delete_tenant(name: nil)
402
+ # Pass arguments to `delete_tenant` via keyword arguments. Note that at
403
+ # least one keyword argument is required. To specify no parameters, or to keep all
404
+ # the default parameter values, pass an empty Hash as a request object (see above).
405
+ #
406
+ # @param name [String]
407
+ # Required. The resource name of the tenant to be deleted.
408
+ #
409
+ # The format is "projects/\\{project_id}/tenants/\\{tenant_id}", for example,
410
+ # "projects/foo/tenants/bar".
411
+ #
412
+ # @yield [response, operation] Access the result along with the RPC operation
413
+ # @yieldparam response [Google::Protobuf::Empty]
414
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
415
+ #
416
+ # @return [Google::Protobuf::Empty]
417
+ #
418
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
419
+ #
420
+ def delete_tenant request, options = nil
421
+ raise ArgumentError, "request must be provided" if request.nil?
422
+
423
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Talent::V4beta1::DeleteTenantRequest
424
+
425
+ # Converts hash and nil to an options object
426
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
427
+
428
+ # Customize the options with defaults
429
+ metadata = @config.rpcs.delete_tenant.metadata.to_h
430
+
431
+ # Set x-goog-api-client and x-goog-user-project headers
432
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
433
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
434
+ gapic_version: ::Google::Cloud::Talent::V4beta1::VERSION
435
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
436
+
437
+ header_params = {
438
+ "name" => request.name
439
+ }
440
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
441
+ metadata[:"x-goog-request-params"] ||= request_params_header
442
+
443
+ options.apply_defaults timeout: @config.rpcs.delete_tenant.timeout,
444
+ metadata: metadata,
445
+ retry_policy: @config.rpcs.delete_tenant.retry_policy
446
+ options.apply_defaults metadata: @config.metadata,
447
+ retry_policy: @config.retry_policy
448
+
449
+ @tenant_service_stub.call_rpc :delete_tenant, request, options: options do |response, operation|
450
+ yield response, operation if block_given?
451
+ return response
452
+ end
453
+ rescue GRPC::BadStatus => e
454
+ raise Google::Cloud::Error.from_error(e)
455
+ end
456
+
457
+ ##
458
+ # Lists all tenants associated with the project.
459
+ #
460
+ # @overload list_tenants(request, options = nil)
461
+ # Pass arguments to `list_tenants` via a request object, either of type
462
+ # {Google::Cloud::Talent::V4beta1::ListTenantsRequest} or an equivalent Hash.
463
+ #
464
+ # @param request [Google::Cloud::Talent::V4beta1::ListTenantsRequest, Hash]
465
+ # A request object representing the call parameters. Required. To specify no
466
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
467
+ # @param options [Gapic::CallOptions, Hash]
468
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
469
+ #
470
+ # @overload list_tenants(parent: nil, page_token: nil, page_size: nil)
471
+ # Pass arguments to `list_tenants` via keyword arguments. Note that at
472
+ # least one keyword argument is required. To specify no parameters, or to keep all
473
+ # the default parameter values, pass an empty Hash as a request object (see above).
474
+ #
475
+ # @param parent [String]
476
+ # Required. Resource name of the project under which the tenant is created.
477
+ #
478
+ # The format is "projects/\\{project_id}", for example,
479
+ # "projects/foo".
480
+ # @param page_token [String]
481
+ # The starting indicator from which to return results.
482
+ # @param page_size [Integer]
483
+ # The maximum number of tenants to be returned, at most 100.
484
+ # Default is 100 if a non-positive number is provided.
485
+ #
486
+ # @yield [response, operation] Access the result along with the RPC operation
487
+ # @yieldparam response [Gapic::PagedEnumerable<Google::Cloud::Talent::V4beta1::Tenant>]
488
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
489
+ #
490
+ # @return [Gapic::PagedEnumerable<Google::Cloud::Talent::V4beta1::Tenant>]
491
+ #
492
+ # @raise [Google::Cloud::Error] if the RPC is aborted.
493
+ #
494
+ def list_tenants request, options = nil
495
+ raise ArgumentError, "request must be provided" if request.nil?
496
+
497
+ request = Gapic::Protobuf.coerce request, to: Google::Cloud::Talent::V4beta1::ListTenantsRequest
498
+
499
+ # Converts hash and nil to an options object
500
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
501
+
502
+ # Customize the options with defaults
503
+ metadata = @config.rpcs.list_tenants.metadata.to_h
504
+
505
+ # Set x-goog-api-client and x-goog-user-project headers
506
+ metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
507
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
508
+ gapic_version: ::Google::Cloud::Talent::V4beta1::VERSION
509
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
510
+
511
+ header_params = {
512
+ "parent" => request.parent
513
+ }
514
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
515
+ metadata[:"x-goog-request-params"] ||= request_params_header
516
+
517
+ options.apply_defaults timeout: @config.rpcs.list_tenants.timeout,
518
+ metadata: metadata,
519
+ retry_policy: @config.rpcs.list_tenants.retry_policy
520
+ options.apply_defaults metadata: @config.metadata,
521
+ retry_policy: @config.retry_policy
522
+
523
+ @tenant_service_stub.call_rpc :list_tenants, request, options: options do |response, operation|
524
+ response = Gapic::PagedEnumerable.new @tenant_service_stub, :list_tenants, request, response, operation, options
525
+ yield response, operation if block_given?
526
+ return response
527
+ end
528
+ rescue GRPC::BadStatus => e
529
+ raise Google::Cloud::Error.from_error(e)
530
+ end
531
+
532
+ ##
533
+ # Configuration class for the TenantService API.
534
+ #
535
+ # This class represents the configuration for TenantService,
536
+ # providing control over timeouts, retry behavior, logging, transport
537
+ # parameters, and other low-level controls. Certain parameters can also be
538
+ # applied individually to specific RPCs. See
539
+ # {Google::Cloud::Talent::V4beta1::TenantService::Client::Configuration::Rpcs}
540
+ # for a list of RPCs that can be configured independently.
541
+ #
542
+ # Configuration can be applied globally to all clients, or to a single client
543
+ # on construction.
544
+ #
545
+ # # Examples
546
+ #
547
+ # To modify the global config, setting the timeout for create_tenant
548
+ # to 20 seconds, and all remaining timeouts to 10 seconds:
549
+ #
550
+ # Google::Cloud::Talent::V4beta1::TenantService::Client.configure do |config|
551
+ # config.timeout = 10_000
552
+ # config.rpcs.create_tenant.timeout = 20_000
553
+ # end
554
+ #
555
+ # To apply the above configuration only to a new client:
556
+ #
557
+ # client = Google::Cloud::Talent::V4beta1::TenantService::Client.new do |config|
558
+ # config.timeout = 10_000
559
+ # config.rpcs.create_tenant.timeout = 20_000
560
+ # end
561
+ #
562
+ # @!attribute [rw] endpoint
563
+ # The hostname or hostname:port of the service endpoint.
564
+ # Defaults to `"jobs.googleapis.com"`.
565
+ # @return [String]
566
+ # @!attribute [rw] credentials
567
+ # Credentials to send with calls. You may provide any of the following types:
568
+ # * (`String`) The path to a service account key file in JSON format
569
+ # * (`Hash`) A service account key as a Hash
570
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
571
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
572
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
573
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
574
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
575
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
576
+ # * (`nil`) indicating no credentials
577
+ # @return [Object]
578
+ # @!attribute [rw] scope
579
+ # The OAuth scopes
580
+ # @return [Array<String>]
581
+ # @!attribute [rw] lib_name
582
+ # The library name as recorded in instrumentation and logging
583
+ # @return [String]
584
+ # @!attribute [rw] lib_version
585
+ # The library version as recorded in instrumentation and logging
586
+ # @return [String]
587
+ # @!attribute [rw] channel_args
588
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
589
+ # `GRPC::Core::Channel` object is provided as the credential.
590
+ # @return [Hash]
591
+ # @!attribute [rw] interceptors
592
+ # An array of interceptors that are run before calls are executed.
593
+ # @return [Array<GRPC::ClientInterceptor>]
594
+ # @!attribute [rw] timeout
595
+ # The call timeout in milliseconds.
596
+ # @return [Numeric]
597
+ # @!attribute [rw] metadata
598
+ # Additional gRPC headers to be sent with the call.
599
+ # @return [Hash{Symbol=>String}]
600
+ # @!attribute [rw] retry_policy
601
+ # The retry policy. The value is a hash with the following keys:
602
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
603
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
604
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
605
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
606
+ # trigger a retry.
607
+ # @return [Hash]
608
+ #
609
+ class Configuration
610
+ extend Gapic::Config
611
+
612
+ config_attr :endpoint, "jobs.googleapis.com", String
613
+ config_attr :credentials, nil do |value|
614
+ allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
615
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
616
+ allowed.any? { |klass| klass === value }
617
+ end
618
+ config_attr :scope, nil, String, Array, nil
619
+ config_attr :lib_name, nil, String, nil
620
+ config_attr :lib_version, nil, String, nil
621
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, Hash, nil)
622
+ config_attr :interceptors, nil, Array, nil
623
+ config_attr :timeout, nil, Numeric, nil
624
+ config_attr :metadata, nil, Hash, nil
625
+ config_attr :retry_policy, nil, Hash, Proc, nil
626
+
627
+ # @private
628
+ def initialize parent_config = nil
629
+ @parent_config = parent_config unless parent_config.nil?
630
+
631
+ yield self if block_given?
632
+ end
633
+
634
+ ##
635
+ # Configurations for individual RPCs
636
+ # @return [Rpcs]
637
+ #
638
+ def rpcs
639
+ @rpcs ||= begin
640
+ parent_rpcs = nil
641
+ parent_rpcs = @parent_config.rpcs if @parent_config&.respond_to? :rpcs
642
+ Rpcs.new parent_rpcs
643
+ end
644
+ end
645
+
646
+ ##
647
+ # Configuration RPC class for the TenantService API.
648
+ #
649
+ # Includes fields providing the configuration for each RPC in this service.
650
+ # Each configuration object is of type `Gapic::Config::Method` and includes
651
+ # the following configuration fields:
652
+ #
653
+ # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
654
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
655
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
656
+ # include the following keys:
657
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
658
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
659
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
660
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
661
+ # trigger a retry.
662
+ #
663
+ class Rpcs
664
+ ##
665
+ # RPC-specific configuration for `create_tenant`
666
+ # @return [Gapic::Config::Method]
667
+ #
668
+ attr_reader :create_tenant
669
+ ##
670
+ # RPC-specific configuration for `get_tenant`
671
+ # @return [Gapic::Config::Method]
672
+ #
673
+ attr_reader :get_tenant
674
+ ##
675
+ # RPC-specific configuration for `update_tenant`
676
+ # @return [Gapic::Config::Method]
677
+ #
678
+ attr_reader :update_tenant
679
+ ##
680
+ # RPC-specific configuration for `delete_tenant`
681
+ # @return [Gapic::Config::Method]
682
+ #
683
+ attr_reader :delete_tenant
684
+ ##
685
+ # RPC-specific configuration for `list_tenants`
686
+ # @return [Gapic::Config::Method]
687
+ #
688
+ attr_reader :list_tenants
689
+
690
+ # @private
691
+ def initialize parent_rpcs = nil
692
+ create_tenant_config = parent_rpcs&.create_tenant if parent_rpcs&.respond_to? :create_tenant
693
+ @create_tenant = Gapic::Config::Method.new create_tenant_config
694
+ get_tenant_config = parent_rpcs&.get_tenant if parent_rpcs&.respond_to? :get_tenant
695
+ @get_tenant = Gapic::Config::Method.new get_tenant_config
696
+ update_tenant_config = parent_rpcs&.update_tenant if parent_rpcs&.respond_to? :update_tenant
697
+ @update_tenant = Gapic::Config::Method.new update_tenant_config
698
+ delete_tenant_config = parent_rpcs&.delete_tenant if parent_rpcs&.respond_to? :delete_tenant
699
+ @delete_tenant = Gapic::Config::Method.new delete_tenant_config
700
+ list_tenants_config = parent_rpcs&.list_tenants if parent_rpcs&.respond_to? :list_tenants
701
+ @list_tenants = Gapic::Config::Method.new list_tenants_config
702
+
703
+ yield self if block_given?
704
+ end
705
+ end
706
+ end
707
+ end
708
+ end
709
+ end
710
+ end
711
+ end
712
+ end