Class: Grafeas::V1::Grafeas::Client
- Inherits:
-
Object
- Object
- Grafeas::V1::Grafeas::Client
- Includes:
- Paths
- Defined in:
- lib/grafeas/v1/grafeas/client.rb
Overview
Client for the Grafeas service.
Grafeas API.
Retrieves analysis results of Cloud components such as Docker container images.
Analysis results are stored as a series of occurrences. An Occurrence
contains information about a specific analysis instance on a resource. An
occurrence refers to a Note
. A note contains details describing the
analysis and is generally stored in a separate project, called a Provider
.
Multiple occurrences can refer to the same note.
For example, an SSL vulnerability could affect multiple images. In this case, there would be one note for the vulnerability and an occurrence for each image with the vulnerability referring to that note.
Defined Under Namespace
Classes: Configuration
Class Method Summary collapse
-
.configure {|config| ... } ⇒ Client::Configuration
Configure the Grafeas Client class.
Instance Method Summary collapse
-
#batch_create_notes(request, options = nil) {|response, operation| ... } ⇒ ::Grafeas::V1::BatchCreateNotesResponse
Creates new notes in batch.
-
#batch_create_occurrences(request, options = nil) {|response, operation| ... } ⇒ ::Grafeas::V1::BatchCreateOccurrencesResponse
Creates new occurrences in batch.
-
#configure {|config| ... } ⇒ Client::Configuration
Configure the Grafeas Client instance.
-
#create_note(request, options = nil) {|response, operation| ... } ⇒ ::Grafeas::V1::Note
Creates a new note.
-
#create_occurrence(request, options = nil) {|response, operation| ... } ⇒ ::Grafeas::V1::Occurrence
Creates a new occurrence.
-
#delete_note(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes the specified note.
-
#delete_occurrence(request, options = nil) {|response, operation| ... } ⇒ ::Google::Protobuf::Empty
Deletes the specified occurrence.
-
#get_note(request, options = nil) {|response, operation| ... } ⇒ ::Grafeas::V1::Note
Gets the specified note.
-
#get_occurrence(request, options = nil) {|response, operation| ... } ⇒ ::Grafeas::V1::Occurrence
Gets the specified occurrence.
-
#get_occurrence_note(request, options = nil) {|response, operation| ... } ⇒ ::Grafeas::V1::Note
Gets the note attached to the specified occurrence.
-
#initialize {|config| ... } ⇒ Client
constructor
Create a new Grafeas client object.
-
#list_note_occurrences(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Grafeas::V1::Occurrence>
Lists occurrences referencing the specified note.
-
#list_notes(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Grafeas::V1::Note>
Lists notes for the specified project.
-
#list_occurrences(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Grafeas::V1::Occurrence>
Lists occurrences for the specified project.
-
#update_note(request, options = nil) {|response, operation| ... } ⇒ ::Grafeas::V1::Note
Updates the specified note.
-
#update_occurrence(request, options = nil) {|response, operation| ... } ⇒ ::Grafeas::V1::Occurrence
Updates the specified occurrence.
Methods included from Paths
#note_path, #occurrence_path, #project_path
Constructor Details
#initialize {|config| ... } ⇒ Client
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
# File 'lib/grafeas/v1/grafeas/client.rb', line 201 def initialize # These require statements are intentionally placed here to initialize # the gRPC module only when it's required. # See https://github.com/googleapis/toolkit/issues/446 require "gapic/grpc" require "grafeas/v1/grafeas_services_pb" # Create the configuration object @config = Configuration.new Client.configure # Yield the configuration if needed yield @config if block_given? # Create credentials credentials = @config.credentials @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id @grafeas_stub = ::Gapic::ServiceStub.new( ::Grafeas::V1::Grafeas::Stub, credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, interceptors: @config.interceptors ) end |
Class Method Details
.configure {|config| ... } ⇒ Client::Configuration
Configure the Grafeas Client class.
See Configuration for a description of the configuration fields.
Example
To modify the configuration for all Grafeas clients:
::Grafeas::V1::Grafeas::Client.configure do |config|
config.timeout = 10.0
end
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/grafeas/v1/grafeas/client.rb', line 68 def self.configure @configure ||= begin namespace = ["Grafeas", "V1"] parent_config = while namespace.any? parent_name = namespace.join "::" parent_const = const_get parent_name break parent_const.configure if parent_const&.respond_to? :configure namespace.pop end default_config = Client::Configuration.new parent_config default_config.rpcs.get_occurrence.timeout = 30.0 default_config.rpcs.get_occurrence.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.list_occurrences.timeout = 30.0 default_config.rpcs.list_occurrences.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.delete_occurrence.timeout = 30.0 default_config.rpcs.delete_occurrence.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.create_occurrence.timeout = 30.0 default_config.rpcs.batch_create_occurrences.timeout = 30.0 default_config.rpcs.update_occurrence.timeout = 30.0 default_config.rpcs.get_occurrence_note.timeout = 30.0 default_config.rpcs.get_occurrence_note.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.get_note.timeout = 30.0 default_config.rpcs.get_note.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.list_notes.timeout = 30.0 default_config.rpcs.list_notes.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.delete_note.timeout = 30.0 default_config.rpcs.delete_note.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] } default_config.rpcs.create_note.timeout = 30.0 default_config.rpcs.batch_create_notes.timeout = 30.0 default_config.rpcs.update_note.timeout = 30.0 default_config.rpcs.list_note_occurrences.timeout = 30.0 default_config.rpcs.list_note_occurrences.retry_policy = { initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] } default_config end yield @configure if block_given? @configure end |
Instance Method Details
#batch_create_notes(request, options = nil) ⇒ ::Grafeas::V1::BatchCreateNotesResponse #batch_create_notes(parent: nil, notes: nil) ⇒ ::Grafeas::V1::BatchCreateNotesResponse
Creates new notes in batch.
1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 |
# File 'lib/grafeas/v1/grafeas/client.rb', line 1030 def batch_create_notes request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Grafeas::V1::BatchCreateNotesRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.batch_create_notes..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Grafeas::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.batch_create_notes.timeout, metadata: , retry_policy: @config.rpcs.batch_create_notes.retry_policy .apply_defaults metadata: @config., retry_policy: @config.retry_policy @grafeas_stub.call_rpc :batch_create_notes, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#batch_create_occurrences(request, options = nil) ⇒ ::Grafeas::V1::BatchCreateOccurrencesResponse #batch_create_occurrences(parent: nil, occurrences: nil) ⇒ ::Grafeas::V1::BatchCreateOccurrencesResponse
Creates new occurrences in batch.
542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 |
# File 'lib/grafeas/v1/grafeas/client.rb', line 542 def batch_create_occurrences request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Grafeas::V1::BatchCreateOccurrencesRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.batch_create_occurrences..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Grafeas::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.batch_create_occurrences.timeout, metadata: , retry_policy: @config.rpcs.batch_create_occurrences.retry_policy .apply_defaults metadata: @config., retry_policy: @config.retry_policy @grafeas_stub.call_rpc :batch_create_occurrences, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#configure {|config| ... } ⇒ Client::Configuration
Configure the Grafeas Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on configure.
See Configuration for a description of the configuration fields.
176 177 178 179 |
# File 'lib/grafeas/v1/grafeas/client.rb', line 176 def configure yield @config if block_given? @config end |
#create_note(request, options = nil) ⇒ ::Grafeas::V1::Note #create_note(parent: nil, note_id: nil, note: nil) ⇒ ::Grafeas::V1::Note
Creates a new note.
961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 |
# File 'lib/grafeas/v1/grafeas/client.rb', line 961 def create_note request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Grafeas::V1::CreateNoteRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_note..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Grafeas::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.create_note.timeout, metadata: , retry_policy: @config.rpcs.create_note.retry_policy .apply_defaults metadata: @config., retry_policy: @config.retry_policy @grafeas_stub.call_rpc :create_note, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#create_occurrence(request, options = nil) ⇒ ::Grafeas::V1::Occurrence #create_occurrence(parent: nil, occurrence: nil) ⇒ ::Grafeas::V1::Occurrence
Creates a new occurrence.
473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 |
# File 'lib/grafeas/v1/grafeas/client.rb', line 473 def create_occurrence request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Grafeas::V1::CreateOccurrenceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_occurrence..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Grafeas::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.create_occurrence.timeout, metadata: , retry_policy: @config.rpcs.create_occurrence.retry_policy .apply_defaults metadata: @config., retry_policy: @config.retry_policy @grafeas_stub.call_rpc :create_occurrence, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_note(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_note(name: nil) ⇒ ::Google::Protobuf::Empty
Deletes the specified note.
890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 |
# File 'lib/grafeas/v1/grafeas/client.rb', line 890 def delete_note request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Grafeas::V1::DeleteNoteRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_note..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Grafeas::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.delete_note.timeout, metadata: , retry_policy: @config.rpcs.delete_note.retry_policy .apply_defaults metadata: @config., retry_policy: @config.retry_policy @grafeas_stub.call_rpc :delete_note, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_occurrence(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_occurrence(name: nil) ⇒ ::Google::Protobuf::Empty
Deletes the specified occurrence. For example, use this method to delete an occurrence when the occurrence is no longer applicable for the given resource.
404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 |
# File 'lib/grafeas/v1/grafeas/client.rb', line 404 def delete_occurrence request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Grafeas::V1::DeleteOccurrenceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_occurrence..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Grafeas::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.delete_occurrence.timeout, metadata: , retry_policy: @config.rpcs.delete_occurrence.retry_policy .apply_defaults metadata: @config., retry_policy: @config.retry_policy @grafeas_stub.call_rpc :delete_occurrence, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_note(request, options = nil) ⇒ ::Grafeas::V1::Note #get_note(name: nil) ⇒ ::Grafeas::V1::Note
Gets the specified note.
748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 |
# File 'lib/grafeas/v1/grafeas/client.rb', line 748 def get_note request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Grafeas::V1::GetNoteRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_note..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Grafeas::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_note.timeout, metadata: , retry_policy: @config.rpcs.get_note.retry_policy .apply_defaults metadata: @config., retry_policy: @config.retry_policy @grafeas_stub.call_rpc :get_note, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_occurrence(request, options = nil) ⇒ ::Grafeas::V1::Occurrence #get_occurrence(name: nil) ⇒ ::Grafeas::V1::Occurrence
Gets the specified occurrence.
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 |
# File 'lib/grafeas/v1/grafeas/client.rb', line 260 def get_occurrence request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Grafeas::V1::GetOccurrenceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_occurrence..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Grafeas::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_occurrence.timeout, metadata: , retry_policy: @config.rpcs.get_occurrence.retry_policy .apply_defaults metadata: @config., retry_policy: @config.retry_policy @grafeas_stub.call_rpc :get_occurrence, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_occurrence_note(request, options = nil) ⇒ ::Grafeas::V1::Note #get_occurrence_note(name: nil) ⇒ ::Grafeas::V1::Note
Gets the note attached to the specified occurrence. Consumer projects can use this method to get a note that belongs to a provider project.
681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 |
# File 'lib/grafeas/v1/grafeas/client.rb', line 681 def get_occurrence_note request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Grafeas::V1::GetOccurrenceNoteRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_occurrence_note..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Grafeas::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_occurrence_note.timeout, metadata: , retry_policy: @config.rpcs.get_occurrence_note.retry_policy .apply_defaults metadata: @config., retry_policy: @config.retry_policy @grafeas_stub.call_rpc :get_occurrence_note, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_note_occurrences(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Grafeas::V1::Occurrence> #list_note_occurrences(name: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Grafeas::V1::Occurrence>
Lists occurrences referencing the specified note. Provider projects can use this method to get all occurrences across consumer projects referencing the specified note.
1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 |
# File 'lib/grafeas/v1/grafeas/client.rb', line 1176 def list_note_occurrences request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Grafeas::V1::ListNoteOccurrencesRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_note_occurrences..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Grafeas::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_note_occurrences.timeout, metadata: , retry_policy: @config.rpcs.list_note_occurrences.retry_policy .apply_defaults metadata: @config., retry_policy: @config.retry_policy @grafeas_stub.call_rpc :list_note_occurrences, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @grafeas_stub, :list_note_occurrences, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_notes(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Grafeas::V1::Note> #list_notes(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Grafeas::V1::Note>
Lists notes for the specified project.
822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 |
# File 'lib/grafeas/v1/grafeas/client.rb', line 822 def list_notes request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Grafeas::V1::ListNotesRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_notes..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Grafeas::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_notes.timeout, metadata: , retry_policy: @config.rpcs.list_notes.retry_policy .apply_defaults metadata: @config., retry_policy: @config.retry_policy @grafeas_stub.call_rpc :list_notes, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @grafeas_stub, :list_notes, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_occurrences(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Grafeas::V1::Occurrence> #list_occurrences(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Grafeas::V1::Occurrence>
Lists occurrences for the specified project.
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 |
# File 'lib/grafeas/v1/grafeas/client.rb', line 334 def list_occurrences request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Grafeas::V1::ListOccurrencesRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_occurrences..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Grafeas::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "parent" => request.parent } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_occurrences.timeout, metadata: , retry_policy: @config.rpcs.list_occurrences.retry_policy .apply_defaults metadata: @config., retry_policy: @config.retry_policy @grafeas_stub.call_rpc :list_occurrences, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @grafeas_stub, :list_occurrences, request, response, operation, yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_note(request, options = nil) ⇒ ::Grafeas::V1::Note #update_note(name: nil, note: nil, update_mask: nil) ⇒ ::Grafeas::V1::Note
Updates the specified note.
1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 |
# File 'lib/grafeas/v1/grafeas/client.rb', line 1101 def update_note request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Grafeas::V1::UpdateNoteRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_note..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Grafeas::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_note.timeout, metadata: , retry_policy: @config.rpcs.update_note.retry_policy .apply_defaults metadata: @config., retry_policy: @config.retry_policy @grafeas_stub.call_rpc :update_note, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#update_occurrence(request, options = nil) ⇒ ::Grafeas::V1::Occurrence #update_occurrence(name: nil, occurrence: nil, update_mask: nil) ⇒ ::Grafeas::V1::Occurrence
Updates the specified occurrence.
613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 |
# File 'lib/grafeas/v1/grafeas/client.rb', line 613 def update_occurrence request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Grafeas::V1::UpdateOccurrenceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_occurrence..to_h # Set x-goog-api-client and x-goog-user-project headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Grafeas::V1::VERSION [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "name" => request.name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_occurrence.timeout, metadata: , retry_policy: @config.rpcs.update_occurrence.retry_policy .apply_defaults metadata: @config., retry_policy: @config.retry_policy @grafeas_stub.call_rpc :update_occurrence, request, options: do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |