google-cloud-talent-v4beta1 0.2.4 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.md +188 -190
  3. data/README.md +66 -2
  4. data/lib/google/cloud/talent/v4beta1.rb +3 -0
  5. data/lib/google/cloud/talent/v4beta1/application_service/client.rb +26 -20
  6. data/lib/google/cloud/talent/v4beta1/application_service/paths.rb +2 -2
  7. data/lib/google/cloud/talent/v4beta1/application_service_services_pb.rb +6 -6
  8. data/lib/google/cloud/talent/v4beta1/company_service/client.rb +26 -20
  9. data/lib/google/cloud/talent/v4beta1/company_service/paths.rb +1 -1
  10. data/lib/google/cloud/talent/v4beta1/company_service_services_pb.rb +6 -6
  11. data/lib/google/cloud/talent/v4beta1/completion/client.rb +16 -10
  12. data/lib/google/cloud/talent/v4beta1/completion/paths.rb +1 -1
  13. data/lib/google/cloud/talent/v4beta1/completion_service_services_pb.rb +2 -2
  14. data/lib/google/cloud/talent/v4beta1/event_service/client.rb +13 -7
  15. data/lib/google/cloud/talent/v4beta1/event_service_services_pb.rb +2 -2
  16. data/lib/google/cloud/talent/v4beta1/job_service/client.rb +31 -25
  17. data/lib/google/cloud/talent/v4beta1/job_service/operations.rb +96 -11
  18. data/lib/google/cloud/talent/v4beta1/job_service/paths.rb +2 -2
  19. data/lib/google/cloud/talent/v4beta1/job_service_services_pb.rb +11 -11
  20. data/lib/google/cloud/talent/v4beta1/profile_service/client.rb +27 -21
  21. data/lib/google/cloud/talent/v4beta1/profile_service_services_pb.rb +7 -7
  22. data/lib/google/cloud/talent/v4beta1/tenant_service/client.rb +26 -20
  23. data/lib/google/cloud/talent/v4beta1/tenant_service_services_pb.rb +6 -6
  24. data/lib/google/cloud/talent/v4beta1/version.rb +1 -1
  25. data/proto_docs/google/api/field_behavior.rb +6 -0
  26. data/proto_docs/google/api/resource.rb +50 -14
  27. data/proto_docs/google/longrunning/operations.rb +17 -3
  28. data/proto_docs/google/protobuf/any.rb +5 -2
  29. data/proto_docs/google/protobuf/timestamp.rb +10 -1
  30. data/proto_docs/google/type/latlng.rb +2 -2
  31. metadata +19 -11
@@ -27,7 +27,7 @@ module Google
27
27
  # A service handles client event report.
28
28
  class Service
29
29
 
30
- include GRPC::GenericService
30
+ include ::GRPC::GenericService
31
31
 
32
32
  self.marshal_class_method = :encode
33
33
  self.unmarshal_class_method = :decode
@@ -40,7 +40,7 @@ module Google
40
40
  # [Learn
41
41
  # more](https://cloud.google.com/talent-solution/docs/management-tools)
42
42
  # about self service tools.
43
- rpc :CreateClientEvent, Google::Cloud::Talent::V4beta1::CreateClientEventRequest, Google::Cloud::Talent::V4beta1::ClientEvent
43
+ rpc :CreateClientEvent, ::Google::Cloud::Talent::V4beta1::CreateClientEventRequest, ::Google::Cloud::Talent::V4beta1::ClientEvent
44
44
  end
45
45
 
46
46
  Stub = Service.rpc_stub_class
@@ -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
@@ -72,9 +72,9 @@ module Google
72
72
  default_config.rpcs.get_job.timeout = 30.0
73
73
  default_config.rpcs.get_job.retry_policy = {
74
74
  initial_delay: 0.1,
75
- max_delay: 60.0,
76
- multiplier: 1.3,
77
- retry_codes: [4, 14]
75
+ max_delay: 60.0,
76
+ multiplier: 1.3,
77
+ retry_codes: [4, 14]
78
78
  }
79
79
 
80
80
  default_config.rpcs.update_job.timeout = 30.0
@@ -84,9 +84,9 @@ module Google
84
84
  default_config.rpcs.delete_job.timeout = 30.0
85
85
  default_config.rpcs.delete_job.retry_policy = {
86
86
  initial_delay: 0.1,
87
- max_delay: 60.0,
88
- multiplier: 1.3,
89
- retry_codes: [4, 14]
87
+ max_delay: 60.0,
88
+ multiplier: 1.3,
89
+ retry_codes: [4, 14]
90
90
  }
91
91
 
92
92
  default_config.rpcs.batch_delete_jobs.timeout = 30.0
@@ -94,9 +94,9 @@ module Google
94
94
  default_config.rpcs.list_jobs.timeout = 30.0
95
95
  default_config.rpcs.list_jobs.retry_policy = {
96
96
  initial_delay: 0.1,
97
- max_delay: 60.0,
98
- multiplier: 1.3,
99
- retry_codes: [4, 14]
97
+ max_delay: 60.0,
98
+ multiplier: 1.3,
99
+ retry_codes: [4, 14]
100
100
  }
101
101
 
102
102
  default_config.rpcs.search_jobs.timeout = 30.0
@@ -164,7 +164,13 @@ module Google
164
164
 
165
165
  # Create credentials
166
166
  credentials = @config.credentials
167
- credentials ||= Credentials.default scope: @config.scope
167
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
168
+ # but only if the default endpoint does not have a region prefix.
169
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
170
+ @config.endpoint == Client.configure.endpoint &&
171
+ !@config.endpoint.split(".").first.include?("-")
172
+ credentials ||= Credentials.default scope: @config.scope,
173
+ enable_self_signed_jwt: enable_self_signed_jwt
168
174
  if credentials.is_a?(String) || credentials.is_a?(Hash)
169
175
  credentials = Credentials.new credentials, scope: @config.scope
170
176
  end
@@ -1528,14 +1534,14 @@ module Google
1528
1534
 
1529
1535
  config_attr :endpoint, "jobs.googleapis.com", ::String
1530
1536
  config_attr :credentials, nil do |value|
1531
- allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1537
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1532
1538
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1533
1539
  allowed.any? { |klass| klass === value }
1534
1540
  end
1535
1541
  config_attr :scope, nil, ::String, ::Array, nil
1536
1542
  config_attr :lib_name, nil, ::String, nil
1537
1543
  config_attr :lib_version, nil, ::String, nil
1538
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
1544
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1539
1545
  config_attr :interceptors, nil, ::Array, nil
1540
1546
  config_attr :timeout, nil, ::Numeric, nil
1541
1547
  config_attr :metadata, nil, ::Hash, nil
@@ -1556,7 +1562,7 @@ module Google
1556
1562
  def rpcs
1557
1563
  @rpcs ||= begin
1558
1564
  parent_rpcs = nil
1559
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
1565
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1560
1566
  Rpcs.new parent_rpcs
1561
1567
  end
1562
1568
  end
@@ -1568,7 +1574,7 @@ module Google
1568
1574
  # Each configuration object is of type `Gapic::Config::Method` and includes
1569
1575
  # the following configuration fields:
1570
1576
  #
1571
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
1577
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1572
1578
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1573
1579
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1574
1580
  # include the following keys:
@@ -1632,25 +1638,25 @@ module Google
1632
1638
 
1633
1639
  # @private
1634
1640
  def initialize parent_rpcs = nil
1635
- create_job_config = parent_rpcs&.create_job if parent_rpcs&.respond_to? :create_job
1641
+ create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job
1636
1642
  @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
1643
+ batch_create_jobs_config = parent_rpcs.batch_create_jobs if parent_rpcs.respond_to? :batch_create_jobs
1638
1644
  @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
1645
+ get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job
1640
1646
  @get_job = ::Gapic::Config::Method.new get_job_config
1641
- update_job_config = parent_rpcs&.update_job if parent_rpcs&.respond_to? :update_job
1647
+ update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job
1642
1648
  @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
1649
+ batch_update_jobs_config = parent_rpcs.batch_update_jobs if parent_rpcs.respond_to? :batch_update_jobs
1644
1650
  @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
1651
+ delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job
1646
1652
  @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
1653
+ batch_delete_jobs_config = parent_rpcs.batch_delete_jobs if parent_rpcs.respond_to? :batch_delete_jobs
1648
1654
  @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
1655
+ list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs
1650
1656
  @list_jobs = ::Gapic::Config::Method.new list_jobs_config
1651
- search_jobs_config = parent_rpcs&.search_jobs if parent_rpcs&.respond_to? :search_jobs
1657
+ search_jobs_config = parent_rpcs.search_jobs if parent_rpcs.respond_to? :search_jobs
1652
1658
  @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
1659
+ search_jobs_for_alert_config = parent_rpcs.search_jobs_for_alert if parent_rpcs.respond_to? :search_jobs_for_alert
1654
1660
  @search_jobs_for_alert = ::Gapic::Config::Method.new search_jobs_for_alert_config
1655
1661
 
1656
1662
  yield self if block_given?
@@ -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 for the specified long-running operation until it is done or reaches
400
+ # at most a specified timeout, returning the latest state. If the operation
401
+ # is 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
  #
@@ -475,14 +553,14 @@ module Google
475
553
 
476
554
  config_attr :endpoint, "jobs.googleapis.com", ::String
477
555
  config_attr :credentials, nil do |value|
478
- allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
556
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
479
557
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
480
558
  allowed.any? { |klass| klass === value }
481
559
  end
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}"
@@ -27,7 +27,7 @@ module Google
27
27
  # A service handles job management, including job CRUD, enumeration and search.
28
28
  class Service
29
29
 
30
- include GRPC::GenericService
30
+ include ::GRPC::GenericService
31
31
 
32
32
  self.marshal_class_method = :encode
33
33
  self.unmarshal_class_method = :decode
@@ -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,7 +61,7 @@ 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
@@ -69,9 +69,9 @@ module Google
69
69
  default_config.rpcs.list_profiles.timeout = 30.0
70
70
  default_config.rpcs.list_profiles.retry_policy = {
71
71
  initial_delay: 0.1,
72
- max_delay: 60.0,
73
- multiplier: 1.3,
74
- retry_codes: [4, 14]
72
+ max_delay: 60.0,
73
+ multiplier: 1.3,
74
+ retry_codes: [4, 14]
75
75
  }
76
76
 
77
77
  default_config.rpcs.create_profile.timeout = 30.0
@@ -79,9 +79,9 @@ module Google
79
79
  default_config.rpcs.get_profile.timeout = 30.0
80
80
  default_config.rpcs.get_profile.retry_policy = {
81
81
  initial_delay: 0.1,
82
- max_delay: 60.0,
83
- multiplier: 1.3,
84
- retry_codes: [4, 14]
82
+ max_delay: 60.0,
83
+ multiplier: 1.3,
84
+ retry_codes: [4, 14]
85
85
  }
86
86
 
87
87
  default_config.rpcs.update_profile.timeout = 30.0
@@ -89,9 +89,9 @@ module Google
89
89
  default_config.rpcs.delete_profile.timeout = 30.0
90
90
  default_config.rpcs.delete_profile.retry_policy = {
91
91
  initial_delay: 0.1,
92
- max_delay: 60.0,
93
- multiplier: 1.3,
94
- retry_codes: [4, 14]
92
+ max_delay: 60.0,
93
+ multiplier: 1.3,
94
+ retry_codes: [4, 14]
95
95
  }
96
96
 
97
97
  default_config.rpcs.search_profiles.timeout = 30.0
@@ -157,7 +157,13 @@ module Google
157
157
 
158
158
  # Create credentials
159
159
  credentials = @config.credentials
160
- credentials ||= Credentials.default scope: @config.scope
160
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
161
+ # but only if the default endpoint does not have a region prefix.
162
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
163
+ @config.endpoint == Client.configure.endpoint &&
164
+ !@config.endpoint.split(".").first.include?("-")
165
+ credentials ||= Credentials.default scope: @config.scope,
166
+ enable_self_signed_jwt: enable_self_signed_jwt
161
167
  if credentials.is_a?(String) || credentials.is_a?(Hash)
162
168
  credentials = Credentials.new credentials, scope: @config.scope
163
169
  end
@@ -888,14 +894,14 @@ module Google
888
894
 
889
895
  config_attr :endpoint, "jobs.googleapis.com", ::String
890
896
  config_attr :credentials, nil do |value|
891
- allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
897
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
892
898
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
893
899
  allowed.any? { |klass| klass === value }
894
900
  end
895
901
  config_attr :scope, nil, ::String, ::Array, nil
896
902
  config_attr :lib_name, nil, ::String, nil
897
903
  config_attr :lib_version, nil, ::String, nil
898
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
904
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
899
905
  config_attr :interceptors, nil, ::Array, nil
900
906
  config_attr :timeout, nil, ::Numeric, nil
901
907
  config_attr :metadata, nil, ::Hash, nil
@@ -916,7 +922,7 @@ module Google
916
922
  def rpcs
917
923
  @rpcs ||= begin
918
924
  parent_rpcs = nil
919
- parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config&.respond_to?(:rpcs)
925
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
920
926
  Rpcs.new parent_rpcs
921
927
  end
922
928
  end
@@ -928,7 +934,7 @@ module Google
928
934
  # Each configuration object is of type `Gapic::Config::Method` and includes
929
935
  # the following configuration fields:
930
936
  #
931
- # * `timeout` (*type:* `Numeric`) - The call timeout in milliseconds
937
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
932
938
  # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
933
939
  # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
934
940
  # include the following keys:
@@ -972,17 +978,17 @@ module Google
972
978
 
973
979
  # @private
974
980
  def initialize parent_rpcs = nil
975
- list_profiles_config = parent_rpcs&.list_profiles if parent_rpcs&.respond_to? :list_profiles
981
+ list_profiles_config = parent_rpcs.list_profiles if parent_rpcs.respond_to? :list_profiles
976
982
  @list_profiles = ::Gapic::Config::Method.new list_profiles_config
977
- create_profile_config = parent_rpcs&.create_profile if parent_rpcs&.respond_to? :create_profile
983
+ create_profile_config = parent_rpcs.create_profile if parent_rpcs.respond_to? :create_profile
978
984
  @create_profile = ::Gapic::Config::Method.new create_profile_config
979
- get_profile_config = parent_rpcs&.get_profile if parent_rpcs&.respond_to? :get_profile
985
+ get_profile_config = parent_rpcs.get_profile if parent_rpcs.respond_to? :get_profile
980
986
  @get_profile = ::Gapic::Config::Method.new get_profile_config
981
- update_profile_config = parent_rpcs&.update_profile if parent_rpcs&.respond_to? :update_profile
987
+ update_profile_config = parent_rpcs.update_profile if parent_rpcs.respond_to? :update_profile
982
988
  @update_profile = ::Gapic::Config::Method.new update_profile_config
983
- delete_profile_config = parent_rpcs&.delete_profile if parent_rpcs&.respond_to? :delete_profile
989
+ delete_profile_config = parent_rpcs.delete_profile if parent_rpcs.respond_to? :delete_profile
984
990
  @delete_profile = ::Gapic::Config::Method.new delete_profile_config
985
- search_profiles_config = parent_rpcs&.search_profiles if parent_rpcs&.respond_to? :search_profiles
991
+ search_profiles_config = parent_rpcs.search_profiles if parent_rpcs.respond_to? :search_profiles
986
992
  @search_profiles = ::Gapic::Config::Method.new search_profiles_config
987
993
 
988
994
  yield self if block_given?