google-cloud-talent-v4beta1 0.2.5 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +8 -8
  3. data/LICENSE.md +188 -190
  4. data/README.md +67 -3
  5. data/lib/google/cloud/talent/v4beta1.rb +3 -0
  6. data/lib/google/cloud/talent/v4beta1/application_service/client.rb +20 -23
  7. data/lib/google/cloud/talent/v4beta1/application_service/paths.rb +2 -2
  8. data/lib/google/cloud/talent/v4beta1/application_service_services_pb.rb +5 -5
  9. data/lib/google/cloud/talent/v4beta1/company_service/client.rb +20 -23
  10. data/lib/google/cloud/talent/v4beta1/company_service/paths.rb +1 -1
  11. data/lib/google/cloud/talent/v4beta1/company_service_services_pb.rb +5 -5
  12. data/lib/google/cloud/talent/v4beta1/completion/client.rb +14 -11
  13. data/lib/google/cloud/talent/v4beta1/completion/paths.rb +1 -1
  14. data/lib/google/cloud/talent/v4beta1/completion_service_services_pb.rb +1 -1
  15. data/lib/google/cloud/talent/v4beta1/event_service/client.rb +13 -7
  16. data/lib/google/cloud/talent/v4beta1/event_service_services_pb.rb +1 -1
  17. data/lib/google/cloud/talent/v4beta1/job_service/client.rb +25 -28
  18. data/lib/google/cloud/talent/v4beta1/job_service/operations.rb +96 -11
  19. data/lib/google/cloud/talent/v4beta1/job_service/paths.rb +2 -2
  20. data/lib/google/cloud/talent/v4beta1/job_service_services_pb.rb +10 -10
  21. data/lib/google/cloud/talent/v4beta1/profile_service/client.rb +21 -24
  22. data/lib/google/cloud/talent/v4beta1/profile_service_services_pb.rb +6 -6
  23. data/lib/google/cloud/talent/v4beta1/tenant_service/client.rb +20 -23
  24. data/lib/google/cloud/talent/v4beta1/tenant_service_services_pb.rb +5 -5
  25. data/lib/google/cloud/talent/v4beta1/version.rb +1 -1
  26. data/proto_docs/google/api/field_behavior.rb +12 -0
  27. data/proto_docs/google/api/resource.rb +50 -14
  28. data/proto_docs/google/longrunning/operations.rb +17 -3
  29. data/proto_docs/google/protobuf/any.rb +5 -2
  30. data/proto_docs/google/protobuf/timestamp.rb +10 -1
  31. data/proto_docs/google/type/date.rb +14 -11
  32. data/proto_docs/google/type/latlng.rb +2 -2
  33. data/proto_docs/google/type/money.rb +1 -1
  34. data/proto_docs/google/type/timeofday.rb +2 -1
  35. metadata +19 -11
@@ -60,7 +60,7 @@ module Google
60
60
  parent_config = while namespace.any?
61
61
  parent_name = namespace.join "::"
62
62
  parent_const = const_get parent_name
63
- break parent_const.configure if parent_const&.respond_to? :configure
63
+ break parent_const.configure if parent_const.respond_to? :configure
64
64
  namespace.pop
65
65
  end
66
66
  default_config = Client::Configuration.new parent_config
@@ -71,10 +71,7 @@ module Google
71
71
 
72
72
  default_config.rpcs.get_job.timeout = 30.0
73
73
  default_config.rpcs.get_job.retry_policy = {
74
- initial_delay: 0.1,
75
- max_delay: 60.0,
76
- multiplier: 1.3,
77
- retry_codes: [4, 14]
74
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
78
75
  }
79
76
 
80
77
  default_config.rpcs.update_job.timeout = 30.0
@@ -83,20 +80,14 @@ module Google
83
80
 
84
81
  default_config.rpcs.delete_job.timeout = 30.0
85
82
  default_config.rpcs.delete_job.retry_policy = {
86
- initial_delay: 0.1,
87
- max_delay: 60.0,
88
- multiplier: 1.3,
89
- retry_codes: [4, 14]
83
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
90
84
  }
91
85
 
92
86
  default_config.rpcs.batch_delete_jobs.timeout = 30.0
93
87
 
94
88
  default_config.rpcs.list_jobs.timeout = 30.0
95
89
  default_config.rpcs.list_jobs.retry_policy = {
96
- initial_delay: 0.1,
97
- max_delay: 60.0,
98
- multiplier: 1.3,
99
- retry_codes: [4, 14]
90
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
100
91
  }
101
92
 
102
93
  default_config.rpcs.search_jobs.timeout = 30.0
@@ -164,8 +155,14 @@ module Google
164
155
 
165
156
  # Create credentials
166
157
  credentials = @config.credentials
167
- credentials ||= Credentials.default scope: @config.scope
168
- if credentials.is_a?(String) || credentials.is_a?(Hash)
158
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
159
+ # but only if the default endpoint does not have a region prefix.
160
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
161
+ @config.endpoint == Client.configure.endpoint &&
162
+ !@config.endpoint.split(".").first.include?("-")
163
+ credentials ||= Credentials.default scope: @config.scope,
164
+ enable_self_signed_jwt: enable_self_signed_jwt
165
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
169
166
  credentials = Credentials.new credentials, scope: @config.scope
170
167
  end
171
168
  @quota_project_id = @config.quota_project
@@ -1535,7 +1532,7 @@ module Google
1535
1532
  config_attr :scope, nil, ::String, ::Array, nil
1536
1533
  config_attr :lib_name, nil, ::String, nil
1537
1534
  config_attr :lib_version, nil, ::String, nil
1538
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
1535
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1539
1536
  config_attr :interceptors, nil, ::Array, nil
1540
1537
  config_attr :timeout, nil, ::Numeric, nil
1541
1538
  config_attr :metadata, nil, ::Hash, nil
@@ -1556,7 +1553,7 @@ module Google
1556
1553
  def rpcs
1557
1554
  @rpcs ||= begin
1558
1555
  parent_rpcs = nil
1559
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
1556
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1560
1557
  Rpcs.new parent_rpcs
1561
1558
  end
1562
1559
  end
@@ -1568,7 +1565,7 @@ module Google
1568
1565
  # Each configuration object is of type `Gapic::Config::Method` and includes
1569
1566
  # the following configuration fields:
1570
1567
  #
1571
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
1568
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1572
1569
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1573
1570
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1574
1571
  # include the following keys:
@@ -1632,25 +1629,25 @@ module Google
1632
1629
 
1633
1630
  # @private
1634
1631
  def initialize parent_rpcs = nil
1635
- create_job_config = parent_rpcs&.create_job if parent_rpcs&.respond_to? :create_job
1632
+ create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job
1636
1633
  @create_job = ::Gapic::Config::Method.new create_job_config
1637
- batch_create_jobs_config = parent_rpcs&.batch_create_jobs if parent_rpcs&.respond_to? :batch_create_jobs
1634
+ batch_create_jobs_config = parent_rpcs.batch_create_jobs if parent_rpcs.respond_to? :batch_create_jobs
1638
1635
  @batch_create_jobs = ::Gapic::Config::Method.new batch_create_jobs_config
1639
- get_job_config = parent_rpcs&.get_job if parent_rpcs&.respond_to? :get_job
1636
+ get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job
1640
1637
  @get_job = ::Gapic::Config::Method.new get_job_config
1641
- update_job_config = parent_rpcs&.update_job if parent_rpcs&.respond_to? :update_job
1638
+ update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job
1642
1639
  @update_job = ::Gapic::Config::Method.new update_job_config
1643
- batch_update_jobs_config = parent_rpcs&.batch_update_jobs if parent_rpcs&.respond_to? :batch_update_jobs
1640
+ batch_update_jobs_config = parent_rpcs.batch_update_jobs if parent_rpcs.respond_to? :batch_update_jobs
1644
1641
  @batch_update_jobs = ::Gapic::Config::Method.new batch_update_jobs_config
1645
- delete_job_config = parent_rpcs&.delete_job if parent_rpcs&.respond_to? :delete_job
1642
+ delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job
1646
1643
  @delete_job = ::Gapic::Config::Method.new delete_job_config
1647
- batch_delete_jobs_config = parent_rpcs&.batch_delete_jobs if parent_rpcs&.respond_to? :batch_delete_jobs
1644
+ batch_delete_jobs_config = parent_rpcs.batch_delete_jobs if parent_rpcs.respond_to? :batch_delete_jobs
1648
1645
  @batch_delete_jobs = ::Gapic::Config::Method.new batch_delete_jobs_config
1649
- list_jobs_config = parent_rpcs&.list_jobs if parent_rpcs&.respond_to? :list_jobs
1646
+ list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs
1650
1647
  @list_jobs = ::Gapic::Config::Method.new list_jobs_config
1651
- search_jobs_config = parent_rpcs&.search_jobs if parent_rpcs&.respond_to? :search_jobs
1648
+ search_jobs_config = parent_rpcs.search_jobs if parent_rpcs.respond_to? :search_jobs
1652
1649
  @search_jobs = ::Gapic::Config::Method.new search_jobs_config
1653
- search_jobs_for_alert_config = parent_rpcs&.search_jobs_for_alert if parent_rpcs&.respond_to? :search_jobs_for_alert
1650
+ search_jobs_for_alert_config = parent_rpcs.search_jobs_for_alert if parent_rpcs.respond_to? :search_jobs_for_alert
1654
1651
  @search_jobs_for_alert = ::Gapic::Config::Method.new search_jobs_for_alert_config
1655
1652
 
1656
1653
  yield self if block_given?
@@ -82,7 +82,7 @@ module Google
82
82
  # Create credentials
83
83
  credentials = @config.credentials
84
84
  credentials ||= Credentials.default scope: @config.scope
85
- if credentials.is_a?(String) || credentials.is_a?(Hash)
85
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
86
86
  credentials = Credentials.new credentials, scope: @config.scope
87
87
  end
88
88
  @quota_project_id = @config.quota_project
@@ -103,8 +103,13 @@ module Google
103
103
  # Lists operations that match the specified filter in the request. If the
104
104
  # server doesn't support this method, it returns `UNIMPLEMENTED`.
105
105
  #
106
- # NOTE: the `name` binding below allows API services to override the binding
107
- # to use different resource name schemes, such as `users/*/operations`.
106
+ # NOTE: the `name` binding allows API services to override the binding
107
+ # to use different resource name schemes, such as `users/*/operations`. To
108
+ # override the binding, API services can add a binding such as
109
+ # `"/v1/{name=users/*}/operations"` to their service configuration.
110
+ # For backwards compatibility, the default name includes the operations
111
+ # collection id, however overriding users must ensure the name binding
112
+ # is the parent resource, without the operations collection id.
108
113
  #
109
114
  # @overload list_operations(request, options = nil)
110
115
  # Pass arguments to `list_operations` via a request object, either of type
@@ -122,7 +127,7 @@ module Google
122
127
  # the default parameter values, pass an empty Hash as a request object (see above).
123
128
  #
124
129
  # @param name [::String]
125
- # The name of the operation collection.
130
+ # The name of the operation's parent resource.
126
131
  # @param filter [::String]
127
132
  # The standard list filter.
128
133
  # @param page_size [::Integer]
@@ -390,6 +395,79 @@ module Google
390
395
  raise ::Google::Cloud::Error.from_error(e)
391
396
  end
392
397
 
398
+ ##
399
+ # Waits until the specified long-running operation is done or reaches at most
400
+ # a specified timeout, returning the latest state. If the operation is
401
+ # already done, the latest state is immediately returned. If the timeout
402
+ # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
403
+ # timeout is used. If the server does not support this method, it returns
404
+ # `google.rpc.Code.UNIMPLEMENTED`.
405
+ # Note that this method is on a best-effort basis. It may return the latest
406
+ # state before the specified timeout (including immediately), meaning even an
407
+ # immediate response is no guarantee that the operation is done.
408
+ #
409
+ # @overload wait_operation(request, options = nil)
410
+ # Pass arguments to `wait_operation` via a request object, either of type
411
+ # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash.
412
+ #
413
+ # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash]
414
+ # A request object representing the call parameters. Required. To specify no
415
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
416
+ # @param options [::Gapic::CallOptions, ::Hash]
417
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
418
+ #
419
+ # @overload wait_operation(name: nil, timeout: nil)
420
+ # Pass arguments to `wait_operation` via keyword arguments. Note that at
421
+ # least one keyword argument is required. To specify no parameters, or to keep all
422
+ # the default parameter values, pass an empty Hash as a request object (see above).
423
+ #
424
+ # @param name [::String]
425
+ # The name of the operation resource to wait on.
426
+ # @param timeout [::Google::Protobuf::Duration, ::Hash]
427
+ # The maximum duration to wait before timing out. If left blank, the wait
428
+ # will be at most the time permitted by the underlying HTTP/RPC protocol.
429
+ # If RPC context deadline is also specified, the shorter one will be used.
430
+ #
431
+ # @yield [response, operation] Access the result along with the RPC operation
432
+ # @yieldparam response [::Gapic::Operation]
433
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
434
+ #
435
+ # @return [::Gapic::Operation]
436
+ #
437
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
438
+ #
439
+ def wait_operation request, options = nil
440
+ raise ::ArgumentError, "request must be provided" if request.nil?
441
+
442
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest
443
+
444
+ # Converts hash and nil to an options object
445
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
446
+
447
+ # Customize the options with defaults
448
+ metadata = @config.rpcs.wait_operation.metadata.to_h
449
+
450
+ # Set x-goog-api-client and x-goog-user-project headers
451
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
452
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
453
+ gapic_version: ::Google::Cloud::Talent::V4beta1::VERSION
454
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
455
+
456
+ options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
457
+ metadata: metadata,
458
+ retry_policy: @config.rpcs.wait_operation.retry_policy
459
+ options.apply_defaults metadata: @config.metadata,
460
+ retry_policy: @config.retry_policy
461
+
462
+ @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
463
+ response = ::Gapic::Operation.new response, @operations_client, options: options
464
+ yield response, operation if block_given?
465
+ return response
466
+ end
467
+ rescue ::GRPC::BadStatus => e
468
+ raise ::Google::Cloud::Error.from_error(e)
469
+ end
470
+
393
471
  ##
394
472
  # Configuration class for the Operations API.
395
473
  #
@@ -482,7 +560,7 @@ module Google
482
560
  config_attr :scope, nil, ::String, ::Array, nil
483
561
  config_attr :lib_name, nil, ::String, nil
484
562
  config_attr :lib_version, nil, ::String, nil
485
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
563
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
486
564
  config_attr :interceptors, nil, ::Array, nil
487
565
  config_attr :timeout, nil, ::Numeric, nil
488
566
  config_attr :metadata, nil, ::Hash, nil
@@ -503,7 +581,7 @@ module Google
503
581
  def rpcs
504
582
  @rpcs ||= begin
505
583
  parent_rpcs = nil
506
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
584
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
507
585
  Rpcs.new parent_rpcs
508
586
  end
509
587
  end
@@ -515,7 +593,7 @@ module Google
515
593
  # Each configuration object is of type `Gapic::Config::Method` and includes
516
594
  # the following configuration fields:
517
595
  #
518
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
596
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
519
597
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
520
598
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
521
599
  # include the following keys:
@@ -546,17 +624,24 @@ module Google
546
624
  # @return [::Gapic::Config::Method]
547
625
  #
548
626
  attr_reader :cancel_operation
627
+ ##
628
+ # RPC-specific configuration for `wait_operation`
629
+ # @return [::Gapic::Config::Method]
630
+ #
631
+ attr_reader :wait_operation
549
632
 
550
633
  # @private
551
634
  def initialize parent_rpcs = nil
552
- list_operations_config = parent_rpcs&.list_operations if parent_rpcs&.respond_to? :list_operations
635
+ list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations
553
636
  @list_operations = ::Gapic::Config::Method.new list_operations_config
554
- get_operation_config = parent_rpcs&.get_operation if parent_rpcs&.respond_to? :get_operation
637
+ get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation
555
638
  @get_operation = ::Gapic::Config::Method.new get_operation_config
556
- delete_operation_config = parent_rpcs&.delete_operation if parent_rpcs&.respond_to? :delete_operation
639
+ delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation
557
640
  @delete_operation = ::Gapic::Config::Method.new delete_operation_config
558
- cancel_operation_config = parent_rpcs&.cancel_operation if parent_rpcs&.respond_to? :cancel_operation
641
+ cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation
559
642
  @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config
643
+ wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation
644
+ @wait_operation = ::Gapic::Config::Method.new wait_operation_config
560
645
 
561
646
  yield self if block_given?
562
647
  end
@@ -53,7 +53,7 @@ module Google
53
53
 
54
54
  "projects/#{project}/tenants/#{tenant}/companies/#{company}"
55
55
  end),
56
- "company:project" => (proc do |project:, company:|
56
+ "company:project" => (proc do |project:, company:|
57
57
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
58
58
 
59
59
  "projects/#{project}/companies/#{company}"
@@ -94,7 +94,7 @@ module Google
94
94
 
95
95
  "projects/#{project}/tenants/#{tenant}/jobs/#{job}"
96
96
  end),
97
- "job:project" => (proc do |project:, job:|
97
+ "job:project" => (proc do |project:, job:|
98
98
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
99
99
 
100
100
  "projects/#{project}/jobs/#{job}"
@@ -37,34 +37,34 @@ module Google
37
37
  #
38
38
  # Typically, the job becomes searchable within 10 seconds, but it may take
39
39
  # up to 5 minutes.
40
- rpc :CreateJob, Google::Cloud::Talent::V4beta1::CreateJobRequest, Google::Cloud::Talent::V4beta1::Job
40
+ rpc :CreateJob, ::Google::Cloud::Talent::V4beta1::CreateJobRequest, ::Google::Cloud::Talent::V4beta1::Job
41
41
  # Begins executing a batch create jobs operation.
42
- rpc :BatchCreateJobs, Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest, Google::Longrunning::Operation
42
+ rpc :BatchCreateJobs, ::Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest, ::Google::Longrunning::Operation
43
43
  # Retrieves the specified job, whose status is OPEN or recently EXPIRED
44
44
  # within the last 90 days.
45
- rpc :GetJob, Google::Cloud::Talent::V4beta1::GetJobRequest, Google::Cloud::Talent::V4beta1::Job
45
+ rpc :GetJob, ::Google::Cloud::Talent::V4beta1::GetJobRequest, ::Google::Cloud::Talent::V4beta1::Job
46
46
  # Updates specified job.
47
47
  #
48
48
  # Typically, updated contents become visible in search results within 10
49
49
  # seconds, but it may take up to 5 minutes.
50
- rpc :UpdateJob, Google::Cloud::Talent::V4beta1::UpdateJobRequest, Google::Cloud::Talent::V4beta1::Job
50
+ rpc :UpdateJob, ::Google::Cloud::Talent::V4beta1::UpdateJobRequest, ::Google::Cloud::Talent::V4beta1::Job
51
51
  # Begins executing a batch update jobs operation.
52
- rpc :BatchUpdateJobs, Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest, Google::Longrunning::Operation
52
+ rpc :BatchUpdateJobs, ::Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest, ::Google::Longrunning::Operation
53
53
  # Deletes the specified job.
54
54
  #
55
55
  # Typically, the job becomes unsearchable within 10 seconds, but it may take
56
56
  # up to 5 minutes.
57
- rpc :DeleteJob, Google::Cloud::Talent::V4beta1::DeleteJobRequest, Google::Protobuf::Empty
57
+ rpc :DeleteJob, ::Google::Cloud::Talent::V4beta1::DeleteJobRequest, ::Google::Protobuf::Empty
58
58
  # Deletes a list of [Job][google.cloud.talent.v4beta1.Job]s by filter.
59
- rpc :BatchDeleteJobs, Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest, Google::Protobuf::Empty
59
+ rpc :BatchDeleteJobs, ::Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest, ::Google::Protobuf::Empty
60
60
  # Lists jobs by filter.
61
- rpc :ListJobs, Google::Cloud::Talent::V4beta1::ListJobsRequest, Google::Cloud::Talent::V4beta1::ListJobsResponse
61
+ rpc :ListJobs, ::Google::Cloud::Talent::V4beta1::ListJobsRequest, ::Google::Cloud::Talent::V4beta1::ListJobsResponse
62
62
  # Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest].
63
63
  #
64
64
  # This call constrains the [visibility][google.cloud.talent.v4beta1.Job.visibility] of jobs
65
65
  # present in the database, and only returns jobs that the caller has
66
66
  # permission to search against.
67
- rpc :SearchJobs, Google::Cloud::Talent::V4beta1::SearchJobsRequest, Google::Cloud::Talent::V4beta1::SearchJobsResponse
67
+ rpc :SearchJobs, ::Google::Cloud::Talent::V4beta1::SearchJobsRequest, ::Google::Cloud::Talent::V4beta1::SearchJobsResponse
68
68
  # Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest].
69
69
  #
70
70
  # This API call is intended for the use case of targeting passive job
@@ -75,7 +75,7 @@ module Google
75
75
  # This call constrains the [visibility][google.cloud.talent.v4beta1.Job.visibility] of jobs
76
76
  # present in the database, and only returns jobs the caller has
77
77
  # permission to search against.
78
- rpc :SearchJobsForAlert, Google::Cloud::Talent::V4beta1::SearchJobsRequest, Google::Cloud::Talent::V4beta1::SearchJobsResponse
78
+ rpc :SearchJobsForAlert, ::Google::Cloud::Talent::V4beta1::SearchJobsRequest, ::Google::Cloud::Talent::V4beta1::SearchJobsResponse
79
79
  end
80
80
 
81
81
  Stub = Service.rpc_stub_class
@@ -61,37 +61,28 @@ module Google
61
61
  parent_config = while namespace.any?
62
62
  parent_name = namespace.join "::"
63
63
  parent_const = const_get parent_name
64
- break parent_const.configure if parent_const&.respond_to? :configure
64
+ break parent_const.configure if parent_const.respond_to? :configure
65
65
  namespace.pop
66
66
  end
67
67
  default_config = Client::Configuration.new parent_config
68
68
 
69
69
  default_config.rpcs.list_profiles.timeout = 30.0
70
70
  default_config.rpcs.list_profiles.retry_policy = {
71
- initial_delay: 0.1,
72
- max_delay: 60.0,
73
- multiplier: 1.3,
74
- retry_codes: [4, 14]
71
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
75
72
  }
76
73
 
77
74
  default_config.rpcs.create_profile.timeout = 30.0
78
75
 
79
76
  default_config.rpcs.get_profile.timeout = 30.0
80
77
  default_config.rpcs.get_profile.retry_policy = {
81
- initial_delay: 0.1,
82
- max_delay: 60.0,
83
- multiplier: 1.3,
84
- retry_codes: [4, 14]
78
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
85
79
  }
86
80
 
87
81
  default_config.rpcs.update_profile.timeout = 30.0
88
82
 
89
83
  default_config.rpcs.delete_profile.timeout = 30.0
90
84
  default_config.rpcs.delete_profile.retry_policy = {
91
- initial_delay: 0.1,
92
- max_delay: 60.0,
93
- multiplier: 1.3,
94
- retry_codes: [4, 14]
85
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
95
86
  }
96
87
 
97
88
  default_config.rpcs.search_profiles.timeout = 30.0
@@ -157,8 +148,14 @@ module Google
157
148
 
158
149
  # Create credentials
159
150
  credentials = @config.credentials
160
- credentials ||= Credentials.default scope: @config.scope
161
- if credentials.is_a?(String) || credentials.is_a?(Hash)
151
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
152
+ # but only if the default endpoint does not have a region prefix.
153
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
154
+ @config.endpoint == Client.configure.endpoint &&
155
+ !@config.endpoint.split(".").first.include?("-")
156
+ credentials ||= Credentials.default scope: @config.scope,
157
+ enable_self_signed_jwt: enable_self_signed_jwt
158
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
162
159
  credentials = Credentials.new credentials, scope: @config.scope
163
160
  end
164
161
  @quota_project_id = @config.quota_project
@@ -895,7 +892,7 @@ module Google
895
892
  config_attr :scope, nil, ::String, ::Array, nil
896
893
  config_attr :lib_name, nil, ::String, nil
897
894
  config_attr :lib_version, nil, ::String, nil
898
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
895
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
899
896
  config_attr :interceptors, nil, ::Array, nil
900
897
  config_attr :timeout, nil, ::Numeric, nil
901
898
  config_attr :metadata, nil, ::Hash, nil
@@ -916,7 +913,7 @@ module Google
916
913
  def rpcs
917
914
  @rpcs ||= begin
918
915
  parent_rpcs = nil
919
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
916
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
920
917
  Rpcs.new parent_rpcs
921
918
  end
922
919
  end
@@ -928,7 +925,7 @@ module Google
928
925
  # Each configuration object is of type `Gapic::Config::Method` and includes
929
926
  # the following configuration fields:
930
927
  #
931
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
928
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
932
929
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
933
930
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
934
931
  # include the following keys:
@@ -972,17 +969,17 @@ module Google
972
969
 
973
970
  # @private
974
971
  def initialize parent_rpcs = nil
975
- list_profiles_config = parent_rpcs&.list_profiles if parent_rpcs&.respond_to? :list_profiles
972
+ list_profiles_config = parent_rpcs.list_profiles if parent_rpcs.respond_to? :list_profiles
976
973
  @list_profiles = ::Gapic::Config::Method.new list_profiles_config
977
- create_profile_config = parent_rpcs&.create_profile if parent_rpcs&.respond_to? :create_profile
974
+ create_profile_config = parent_rpcs.create_profile if parent_rpcs.respond_to? :create_profile
978
975
  @create_profile = ::Gapic::Config::Method.new create_profile_config
979
- get_profile_config = parent_rpcs&.get_profile if parent_rpcs&.respond_to? :get_profile
976
+ get_profile_config = parent_rpcs.get_profile if parent_rpcs.respond_to? :get_profile
980
977
  @get_profile = ::Gapic::Config::Method.new get_profile_config
981
- update_profile_config = parent_rpcs&.update_profile if parent_rpcs&.respond_to? :update_profile
978
+ update_profile_config = parent_rpcs.update_profile if parent_rpcs.respond_to? :update_profile
982
979
  @update_profile = ::Gapic::Config::Method.new update_profile_config
983
- delete_profile_config = parent_rpcs&.delete_profile if parent_rpcs&.respond_to? :delete_profile
980
+ delete_profile_config = parent_rpcs.delete_profile if parent_rpcs.respond_to? :delete_profile
984
981
  @delete_profile = ::Gapic::Config::Method.new delete_profile_config
985
- search_profiles_config = parent_rpcs&.search_profiles if parent_rpcs&.respond_to? :search_profiles
982
+ search_profiles_config = parent_rpcs.search_profiles if parent_rpcs.respond_to? :search_profiles
986
983
  @search_profiles = ::Gapic::Config::Method.new search_profiles_config
987
984
 
988
985
  yield self if block_given?