How to use call method of Logging Package

Best Test-prof_ruby code snippet using Logging.call

client.rb

Source:client.rb Github

copy

Full Screen

...158 channel_args: @config.channel_args,159 interceptors: @config.interceptors160 )161 end162 # Service calls163 ##164 # Lists buckets.165 #166 # @overload list_buckets(request, options = nil)167 # Pass arguments to `list_buckets` via a request object, either of type168 # {::Google::Cloud::Logging::V2::ListBucketsRequest} or an equivalent Hash.169 #170 # @param request [::Google::Cloud::Logging::V2::ListBucketsRequest, ::Hash]171 # A request object representing the call parameters. Required. To specify no172 # parameters, or to keep all the default parameter values, pass an empty Hash.173 # @param options [::Gapic::CallOptions, ::Hash]174 # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.175 #176 # @overload list_buckets(parent: nil, page_token: nil, page_size: nil)177 # Pass arguments to `list_buckets` via keyword arguments. Note that at178 # least one keyword argument is required. To specify no parameters, or to keep all179 # the default parameter values, pass an empty Hash as a request object (see above).180 #181 # @param parent [::String]182 # Required. The parent resource whose buckets are to be listed:183 #184 # "projects/[PROJECT_ID]/locations/[LOCATION_ID]"185 # "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"186 # "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"187 # "folders/[FOLDER_ID]/locations/[LOCATION_ID]"188 #189 # Note: The locations portion of the resource must be specified, but190 # supplying the character `-` in place of [LOCATION_ID] will return all191 # buckets.192 # @param page_token [::String]193 # Optional. If present, then retrieve the next batch of results from the194 # preceding call to this method. `pageToken` must be the value of195 # `nextPageToken` from the previous response. The values of other method196 # parameters should be identical to those in the previous call.197 # @param page_size [::Integer]198 # Optional. The maximum number of results to return from this request.199 # Non-positive values are ignored. The presence of `nextPageToken` in the200 # response indicates that more results might be available.201 #202 # @yield [response, operation] Access the result along with the RPC operation203 # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogBucket>]204 # @yieldparam operation [::GRPC::ActiveCall::Operation]205 #206 # @return [::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogBucket>]207 #208 # @raise [::Google::Cloud::Error] if the RPC is aborted.209 #210 # @example Basic example211 # require "google/cloud/logging/v2"212 #213 # # Create a client object. The client can be reused for multiple calls.214 # client = Google::Cloud::Logging::V2::ConfigService::Client.new215 #216 # # Create a request. To set request fields, pass in keyword arguments.217 # request = Google::Cloud::Logging::V2::ListBucketsRequest.new218 #219 # # Call the list_buckets method.220 # result = client.list_buckets request221 #222 # # The returned object is of type Gapic::PagedEnumerable. You can223 # # iterate over all elements by calling #each, and the enumerable224 # # will lazily make API calls to fetch subsequent pages. Other225 # # methods are also available for managing paging directly.226 # result.each do |response|227 # # Each element is of type ::Google::Cloud::Logging::V2::LogBucket.228 # p response229 # end230 #231 def list_buckets request, options = nil232 raise ::ArgumentError, "request must be provided" if request.nil?233 request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::ListBucketsRequest234 # Converts hash and nil to an options object235 options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h236 # Customize the options with defaults237 metadata = @config.rpcs.list_buckets.metadata.to_h238 # Set x-goog-api-client and x-goog-user-project headers239 metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \240 lib_name: @config.lib_name, lib_version: @config.lib_version,241 gapic_version: ::Google::Cloud::Logging::V2::VERSION242 metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id243 header_params = {}244 if request.parent245 header_params["parent"] = request.parent246 end247 request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")248 metadata[:"x-goog-request-params"] ||= request_params_header249 options.apply_defaults timeout: @config.rpcs.list_buckets.timeout,250 metadata: metadata,251 retry_policy: @config.rpcs.list_buckets.retry_policy252 options.apply_defaults timeout: @config.timeout,253 metadata: @config.metadata,254 retry_policy: @config.retry_policy255 @config_service_stub.call_rpc :list_buckets, request, options: options do |response, operation|256 response = ::Gapic::PagedEnumerable.new @config_service_stub, :list_buckets, request, response, operation, options257 yield response, operation if block_given?258 return response259 end260 rescue ::GRPC::BadStatus => e261 raise ::Google::Cloud::Error.from_error(e)262 end263 ##264 # Gets a bucket.265 #266 # @overload get_bucket(request, options = nil)267 # Pass arguments to `get_bucket` via a request object, either of type268 # {::Google::Cloud::Logging::V2::GetBucketRequest} or an equivalent Hash.269 #270 # @param request [::Google::Cloud::Logging::V2::GetBucketRequest, ::Hash]271 # A request object representing the call parameters. Required. To specify no272 # parameters, or to keep all the default parameter values, pass an empty Hash.273 # @param options [::Gapic::CallOptions, ::Hash]274 # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.275 #276 # @overload get_bucket(name: nil)277 # Pass arguments to `get_bucket` via keyword arguments. Note that at278 # least one keyword argument is required. To specify no parameters, or to keep all279 # the default parameter values, pass an empty Hash as a request object (see above).280 #281 # @param name [::String]282 # Required. The resource name of the bucket:283 #284 # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"285 # "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"286 # "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"287 # "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"288 #289 # Example:290 # `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`.291 #292 # @yield [response, operation] Access the result along with the RPC operation293 # @yieldparam response [::Google::Cloud::Logging::V2::LogBucket]294 # @yieldparam operation [::GRPC::ActiveCall::Operation]295 #296 # @return [::Google::Cloud::Logging::V2::LogBucket]297 #298 # @raise [::Google::Cloud::Error] if the RPC is aborted.299 #300 # @example Basic example301 # require "google/cloud/logging/v2"302 #303 # # Create a client object. The client can be reused for multiple calls.304 # client = Google::Cloud::Logging::V2::ConfigService::Client.new305 #306 # # Create a request. To set request fields, pass in keyword arguments.307 # request = Google::Cloud::Logging::V2::GetBucketRequest.new308 #309 # # Call the get_bucket method.310 # result = client.get_bucket request311 #312 # # The returned object is of type Google::Cloud::Logging::V2::LogBucket.313 # p result314 #315 def get_bucket request, options = nil316 raise ::ArgumentError, "request must be provided" if request.nil?317 request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::GetBucketRequest318 # Converts hash and nil to an options object319 options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h320 # Customize the options with defaults321 metadata = @config.rpcs.get_bucket.metadata.to_h322 # Set x-goog-api-client and x-goog-user-project headers323 metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \324 lib_name: @config.lib_name, lib_version: @config.lib_version,325 gapic_version: ::Google::Cloud::Logging::V2::VERSION326 metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id327 header_params = {}328 if request.name329 header_params["name"] = request.name330 end331 request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")332 metadata[:"x-goog-request-params"] ||= request_params_header333 options.apply_defaults timeout: @config.rpcs.get_bucket.timeout,334 metadata: metadata,335 retry_policy: @config.rpcs.get_bucket.retry_policy336 options.apply_defaults timeout: @config.timeout,337 metadata: @config.metadata,338 retry_policy: @config.retry_policy339 @config_service_stub.call_rpc :get_bucket, request, options: options do |response, operation|340 yield response, operation if block_given?341 return response342 end343 rescue ::GRPC::BadStatus => e344 raise ::Google::Cloud::Error.from_error(e)345 end346 ##347 # Creates a bucket that can be used to store log entries. Once a bucket has348 # been created, the region cannot be changed.349 #350 # @overload create_bucket(request, options = nil)351 # Pass arguments to `create_bucket` via a request object, either of type352 # {::Google::Cloud::Logging::V2::CreateBucketRequest} or an equivalent Hash.353 #354 # @param request [::Google::Cloud::Logging::V2::CreateBucketRequest, ::Hash]355 # A request object representing the call parameters. Required. To specify no356 # parameters, or to keep all the default parameter values, pass an empty Hash.357 # @param options [::Gapic::CallOptions, ::Hash]358 # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.359 #360 # @overload create_bucket(parent: nil, bucket_id: nil, bucket: nil)361 # Pass arguments to `create_bucket` via keyword arguments. Note that at362 # least one keyword argument is required. To specify no parameters, or to keep all363 # the default parameter values, pass an empty Hash as a request object (see above).364 #365 # @param parent [::String]366 # Required. The resource in which to create the bucket:367 #368 # "projects/[PROJECT_ID]/locations/[LOCATION_ID]"369 #370 # Example: `"projects/my-logging-project/locations/global"`371 # @param bucket_id [::String]372 # Required. A client-assigned identifier such as `"my-bucket"`. Identifiers are373 # limited to 100 characters and can include only letters, digits,374 # underscores, hyphens, and periods.375 # @param bucket [::Google::Cloud::Logging::V2::LogBucket, ::Hash]376 # Required. The new bucket. The region specified in the new bucket must be compliant377 # with any Location Restriction Org Policy. The name field in the bucket is378 # ignored.379 #380 # @yield [response, operation] Access the result along with the RPC operation381 # @yieldparam response [::Google::Cloud::Logging::V2::LogBucket]382 # @yieldparam operation [::GRPC::ActiveCall::Operation]383 #384 # @return [::Google::Cloud::Logging::V2::LogBucket]385 #386 # @raise [::Google::Cloud::Error] if the RPC is aborted.387 #388 # @example Basic example389 # require "google/cloud/logging/v2"390 #391 # # Create a client object. The client can be reused for multiple calls.392 # client = Google::Cloud::Logging::V2::ConfigService::Client.new393 #394 # # Create a request. To set request fields, pass in keyword arguments.395 # request = Google::Cloud::Logging::V2::CreateBucketRequest.new396 #397 # # Call the create_bucket method.398 # result = client.create_bucket request399 #400 # # The returned object is of type Google::Cloud::Logging::V2::LogBucket.401 # p result402 #403 def create_bucket request, options = nil404 raise ::ArgumentError, "request must be provided" if request.nil?405 request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::CreateBucketRequest406 # Converts hash and nil to an options object407 options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h408 # Customize the options with defaults409 metadata = @config.rpcs.create_bucket.metadata.to_h410 # Set x-goog-api-client and x-goog-user-project headers411 metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \412 lib_name: @config.lib_name, lib_version: @config.lib_version,413 gapic_version: ::Google::Cloud::Logging::V2::VERSION414 metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id415 header_params = {}416 if request.parent417 header_params["parent"] = request.parent418 end419 request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")420 metadata[:"x-goog-request-params"] ||= request_params_header421 options.apply_defaults timeout: @config.rpcs.create_bucket.timeout,422 metadata: metadata,423 retry_policy: @config.rpcs.create_bucket.retry_policy424 options.apply_defaults timeout: @config.timeout,425 metadata: @config.metadata,426 retry_policy: @config.retry_policy427 @config_service_stub.call_rpc :create_bucket, request, options: options do |response, operation|428 yield response, operation if block_given?429 return response430 end431 rescue ::GRPC::BadStatus => e432 raise ::Google::Cloud::Error.from_error(e)433 end434 ##435 # Updates a bucket. This method replaces the following fields in the436 # existing bucket with values from the new bucket: `retention_period`437 #438 # If the retention period is decreased and the bucket is locked,439 # FAILED_PRECONDITION will be returned.440 #441 # If the bucket has a LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION442 # will be returned.443 #444 # A buckets region may not be modified after it is created.445 #446 # @overload update_bucket(request, options = nil)447 # Pass arguments to `update_bucket` via a request object, either of type448 # {::Google::Cloud::Logging::V2::UpdateBucketRequest} or an equivalent Hash.449 #450 # @param request [::Google::Cloud::Logging::V2::UpdateBucketRequest, ::Hash]451 # A request object representing the call parameters. Required. To specify no452 # parameters, or to keep all the default parameter values, pass an empty Hash.453 # @param options [::Gapic::CallOptions, ::Hash]454 # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.455 #456 # @overload update_bucket(name: nil, bucket: nil, update_mask: nil)457 # Pass arguments to `update_bucket` via keyword arguments. Note that at458 # least one keyword argument is required. To specify no parameters, or to keep all459 # the default parameter values, pass an empty Hash as a request object (see above).460 #461 # @param name [::String]462 # Required. The full resource name of the bucket to update.463 #464 # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"465 # "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"466 # "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"467 # "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"468 #469 # Example:470 # `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`. Also471 # requires permission "resourcemanager.projects.updateLiens" to set the472 # locked property473 # @param bucket [::Google::Cloud::Logging::V2::LogBucket, ::Hash]474 # Required. The updated bucket.475 # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]476 # Required. Field mask that specifies the fields in `bucket` that need an update. A477 # bucket field will be overwritten if, and only if, it is in the update478 # mask. `name` and output only fields cannot be updated.479 #480 # For a detailed `FieldMask` definition, see481 # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask482 #483 # Example: `updateMask=retention_days`.484 #485 # @yield [response, operation] Access the result along with the RPC operation486 # @yieldparam response [::Google::Cloud::Logging::V2::LogBucket]487 # @yieldparam operation [::GRPC::ActiveCall::Operation]488 #489 # @return [::Google::Cloud::Logging::V2::LogBucket]490 #491 # @raise [::Google::Cloud::Error] if the RPC is aborted.492 #493 # @example Basic example494 # require "google/cloud/logging/v2"495 #496 # # Create a client object. The client can be reused for multiple calls.497 # client = Google::Cloud::Logging::V2::ConfigService::Client.new498 #499 # # Create a request. To set request fields, pass in keyword arguments.500 # request = Google::Cloud::Logging::V2::UpdateBucketRequest.new501 #502 # # Call the update_bucket method.503 # result = client.update_bucket request504 #505 # # The returned object is of type Google::Cloud::Logging::V2::LogBucket.506 # p result507 #508 def update_bucket request, options = nil509 raise ::ArgumentError, "request must be provided" if request.nil?510 request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::UpdateBucketRequest511 # Converts hash and nil to an options object512 options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h513 # Customize the options with defaults514 metadata = @config.rpcs.update_bucket.metadata.to_h515 # Set x-goog-api-client and x-goog-user-project headers516 metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \517 lib_name: @config.lib_name, lib_version: @config.lib_version,518 gapic_version: ::Google::Cloud::Logging::V2::VERSION519 metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id520 header_params = {}521 if request.name522 header_params["name"] = request.name523 end524 request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")525 metadata[:"x-goog-request-params"] ||= request_params_header526 options.apply_defaults timeout: @config.rpcs.update_bucket.timeout,527 metadata: metadata,528 retry_policy: @config.rpcs.update_bucket.retry_policy529 options.apply_defaults timeout: @config.timeout,530 metadata: @config.metadata,531 retry_policy: @config.retry_policy532 @config_service_stub.call_rpc :update_bucket, request, options: options do |response, operation|533 yield response, operation if block_given?534 return response535 end536 rescue ::GRPC::BadStatus => e537 raise ::Google::Cloud::Error.from_error(e)538 end539 ##540 # Deletes a bucket.541 # Moves the bucket to the DELETE_REQUESTED state. After 7 days, the542 # bucket will be purged and all logs in the bucket will be permanently543 # deleted.544 #545 # @overload delete_bucket(request, options = nil)546 # Pass arguments to `delete_bucket` via a request object, either of type547 # {::Google::Cloud::Logging::V2::DeleteBucketRequest} or an equivalent Hash.548 #549 # @param request [::Google::Cloud::Logging::V2::DeleteBucketRequest, ::Hash]550 # A request object representing the call parameters. Required. To specify no551 # parameters, or to keep all the default parameter values, pass an empty Hash.552 # @param options [::Gapic::CallOptions, ::Hash]553 # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.554 #555 # @overload delete_bucket(name: nil)556 # Pass arguments to `delete_bucket` via keyword arguments. Note that at557 # least one keyword argument is required. To specify no parameters, or to keep all558 # the default parameter values, pass an empty Hash as a request object (see above).559 #560 # @param name [::String]561 # Required. The full resource name of the bucket to delete.562 #563 # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"564 # "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"565 # "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"566 # "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"567 #568 # Example:569 # `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`.570 #571 # @yield [response, operation] Access the result along with the RPC operation572 # @yieldparam response [::Google::Protobuf::Empty]573 # @yieldparam operation [::GRPC::ActiveCall::Operation]574 #575 # @return [::Google::Protobuf::Empty]576 #577 # @raise [::Google::Cloud::Error] if the RPC is aborted.578 #579 # @example Basic example580 # require "google/cloud/logging/v2"581 #582 # # Create a client object. The client can be reused for multiple calls.583 # client = Google::Cloud::Logging::V2::ConfigService::Client.new584 #585 # # Create a request. To set request fields, pass in keyword arguments.586 # request = Google::Cloud::Logging::V2::DeleteBucketRequest.new587 #588 # # Call the delete_bucket method.589 # result = client.delete_bucket request590 #591 # # The returned object is of type Google::Protobuf::Empty.592 # p result593 #594 def delete_bucket request, options = nil595 raise ::ArgumentError, "request must be provided" if request.nil?596 request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::DeleteBucketRequest597 # Converts hash and nil to an options object598 options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h599 # Customize the options with defaults600 metadata = @config.rpcs.delete_bucket.metadata.to_h601 # Set x-goog-api-client and x-goog-user-project headers602 metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \603 lib_name: @config.lib_name, lib_version: @config.lib_version,604 gapic_version: ::Google::Cloud::Logging::V2::VERSION605 metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id606 header_params = {}607 if request.name608 header_params["name"] = request.name609 end610 request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")611 metadata[:"x-goog-request-params"] ||= request_params_header612 options.apply_defaults timeout: @config.rpcs.delete_bucket.timeout,613 metadata: metadata,614 retry_policy: @config.rpcs.delete_bucket.retry_policy615 options.apply_defaults timeout: @config.timeout,616 metadata: @config.metadata,617 retry_policy: @config.retry_policy618 @config_service_stub.call_rpc :delete_bucket, request, options: options do |response, operation|619 yield response, operation if block_given?620 return response621 end622 rescue ::GRPC::BadStatus => e623 raise ::Google::Cloud::Error.from_error(e)624 end625 ##626 # Undeletes a bucket. A bucket that has been deleted may be undeleted within627 # the grace period of 7 days.628 #629 # @overload undelete_bucket(request, options = nil)630 # Pass arguments to `undelete_bucket` via a request object, either of type631 # {::Google::Cloud::Logging::V2::UndeleteBucketRequest} or an equivalent Hash.632 #633 # @param request [::Google::Cloud::Logging::V2::UndeleteBucketRequest, ::Hash]634 # A request object representing the call parameters. Required. To specify no635 # parameters, or to keep all the default parameter values, pass an empty Hash.636 # @param options [::Gapic::CallOptions, ::Hash]637 # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.638 #639 # @overload undelete_bucket(name: nil)640 # Pass arguments to `undelete_bucket` via keyword arguments. Note that at641 # least one keyword argument is required. To specify no parameters, or to keep all642 # the default parameter values, pass an empty Hash as a request object (see above).643 #644 # @param name [::String]645 # Required. The full resource name of the bucket to undelete.646 #647 # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"648 # "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"649 # "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"650 # "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"651 #652 # Example:653 # `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`.654 #655 # @yield [response, operation] Access the result along with the RPC operation656 # @yieldparam response [::Google::Protobuf::Empty]657 # @yieldparam operation [::GRPC::ActiveCall::Operation]658 #659 # @return [::Google::Protobuf::Empty]660 #661 # @raise [::Google::Cloud::Error] if the RPC is aborted.662 #663 # @example Basic example664 # require "google/cloud/logging/v2"665 #666 # # Create a client object. The client can be reused for multiple calls.667 # client = Google::Cloud::Logging::V2::ConfigService::Client.new668 #669 # # Create a request. To set request fields, pass in keyword arguments.670 # request = Google::Cloud::Logging::V2::UndeleteBucketRequest.new671 #672 # # Call the undelete_bucket method.673 # result = client.undelete_bucket request674 #675 # # The returned object is of type Google::Protobuf::Empty.676 # p result677 #678 def undelete_bucket request, options = nil679 raise ::ArgumentError, "request must be provided" if request.nil?680 request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::UndeleteBucketRequest681 # Converts hash and nil to an options object682 options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h683 # Customize the options with defaults684 metadata = @config.rpcs.undelete_bucket.metadata.to_h685 # Set x-goog-api-client and x-goog-user-project headers686 metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \687 lib_name: @config.lib_name, lib_version: @config.lib_version,688 gapic_version: ::Google::Cloud::Logging::V2::VERSION689 metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id690 header_params = {}691 if request.name692 header_params["name"] = request.name693 end694 request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")695 metadata[:"x-goog-request-params"] ||= request_params_header696 options.apply_defaults timeout: @config.rpcs.undelete_bucket.timeout,697 metadata: metadata,698 retry_policy: @config.rpcs.undelete_bucket.retry_policy699 options.apply_defaults timeout: @config.timeout,700 metadata: @config.metadata,701 retry_policy: @config.retry_policy702 @config_service_stub.call_rpc :undelete_bucket, request, options: options do |response, operation|703 yield response, operation if block_given?704 return response705 end706 rescue ::GRPC::BadStatus => e707 raise ::Google::Cloud::Error.from_error(e)708 end709 ##710 # Lists views on a bucket.711 #712 # @overload list_views(request, options = nil)713 # Pass arguments to `list_views` via a request object, either of type714 # {::Google::Cloud::Logging::V2::ListViewsRequest} or an equivalent Hash.715 #716 # @param request [::Google::Cloud::Logging::V2::ListViewsRequest, ::Hash]717 # A request object representing the call parameters. Required. To specify no718 # parameters, or to keep all the default parameter values, pass an empty Hash.719 # @param options [::Gapic::CallOptions, ::Hash]720 # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.721 #722 # @overload list_views(parent: nil, page_token: nil, page_size: nil)723 # Pass arguments to `list_views` via keyword arguments. Note that at724 # least one keyword argument is required. To specify no parameters, or to keep all725 # the default parameter values, pass an empty Hash as a request object (see above).726 #727 # @param parent [::String]728 # Required. The bucket whose views are to be listed:729 #730 # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"731 # @param page_token [::String]732 # Optional. If present, then retrieve the next batch of results from the733 # preceding call to this method. `pageToken` must be the value of734 # `nextPageToken` from the previous response. The values of other method735 # parameters should be identical to those in the previous call.736 # @param page_size [::Integer]737 # Optional. The maximum number of results to return from this request.738 # Non-positive values are ignored. The presence of `nextPageToken` in the739 # response indicates that more results might be available.740 #741 # @yield [response, operation] Access the result along with the RPC operation742 # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogView>]743 # @yieldparam operation [::GRPC::ActiveCall::Operation]744 #745 # @return [::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogView>]746 #747 # @raise [::Google::Cloud::Error] if the RPC is aborted.748 #749 # @example Basic example750 # require "google/cloud/logging/v2"751 #752 # # Create a client object. The client can be reused for multiple calls.753 # client = Google::Cloud::Logging::V2::ConfigService::Client.new754 #755 # # Create a request. To set request fields, pass in keyword arguments.756 # request = Google::Cloud::Logging::V2::ListViewsRequest.new757 #758 # # Call the list_views method.759 # result = client.list_views request760 #761 # # The returned object is of type Gapic::PagedEnumerable. You can762 # # iterate over all elements by calling #each, and the enumerable763 # # will lazily make API calls to fetch subsequent pages. Other764 # # methods are also available for managing paging directly.765 # result.each do |response|766 # # Each element is of type ::Google::Cloud::Logging::V2::LogView.767 # p response768 # end769 #770 def list_views request, options = nil771 raise ::ArgumentError, "request must be provided" if request.nil?772 request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::ListViewsRequest773 # Converts hash and nil to an options object774 options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h775 # Customize the options with defaults776 metadata = @config.rpcs.list_views.metadata.to_h777 # Set x-goog-api-client and x-goog-user-project headers778 metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \779 lib_name: @config.lib_name, lib_version: @config.lib_version,780 gapic_version: ::Google::Cloud::Logging::V2::VERSION781 metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id782 header_params = {}783 if request.parent784 header_params["parent"] = request.parent785 end786 request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")787 metadata[:"x-goog-request-params"] ||= request_params_header788 options.apply_defaults timeout: @config.rpcs.list_views.timeout,789 metadata: metadata,790 retry_policy: @config.rpcs.list_views.retry_policy791 options.apply_defaults timeout: @config.timeout,792 metadata: @config.metadata,793 retry_policy: @config.retry_policy794 @config_service_stub.call_rpc :list_views, request, options: options do |response, operation|795 response = ::Gapic::PagedEnumerable.new @config_service_stub, :list_views, request, response, operation, options796 yield response, operation if block_given?797 return response798 end799 rescue ::GRPC::BadStatus => e800 raise ::Google::Cloud::Error.from_error(e)801 end802 ##803 # Gets a view.804 #805 # @overload get_view(request, options = nil)806 # Pass arguments to `get_view` via a request object, either of type807 # {::Google::Cloud::Logging::V2::GetViewRequest} or an equivalent Hash.808 #809 # @param request [::Google::Cloud::Logging::V2::GetViewRequest, ::Hash]810 # A request object representing the call parameters. Required. To specify no811 # parameters, or to keep all the default parameter values, pass an empty Hash.812 # @param options [::Gapic::CallOptions, ::Hash]813 # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.814 #815 # @overload get_view(name: nil)816 # Pass arguments to `get_view` via keyword arguments. Note that at817 # least one keyword argument is required. To specify no parameters, or to keep all818 # the default parameter values, pass an empty Hash as a request object (see above).819 #820 # @param name [::String]821 # Required. The resource name of the policy:822 #823 # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"824 #825 # Example:826 # `"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id"`.827 #828 # @yield [response, operation] Access the result along with the RPC operation829 # @yieldparam response [::Google::Cloud::Logging::V2::LogView]830 # @yieldparam operation [::GRPC::ActiveCall::Operation]831 #832 # @return [::Google::Cloud::Logging::V2::LogView]833 #834 # @raise [::Google::Cloud::Error] if the RPC is aborted.835 #836 # @example Basic example837 # require "google/cloud/logging/v2"838 #839 # # Create a client object. The client can be reused for multiple calls.840 # client = Google::Cloud::Logging::V2::ConfigService::Client.new841 #842 # # Create a request. To set request fields, pass in keyword arguments.843 # request = Google::Cloud::Logging::V2::GetViewRequest.new844 #845 # # Call the get_view method.846 # result = client.get_view request847 #848 # # The returned object is of type Google::Cloud::Logging::V2::LogView.849 # p result850 #851 def get_view request, options = nil852 raise ::ArgumentError, "request must be provided" if request.nil?853 request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::GetViewRequest854 # Converts hash and nil to an options object855 options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h856 # Customize the options with defaults857 metadata = @config.rpcs.get_view.metadata.to_h858 # Set x-goog-api-client and x-goog-user-project headers859 metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \860 lib_name: @config.lib_name, lib_version: @config.lib_version,861 gapic_version: ::Google::Cloud::Logging::V2::VERSION862 metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id863 header_params = {}864 if request.name865 header_params["name"] = request.name866 end867 request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")868 metadata[:"x-goog-request-params"] ||= request_params_header869 options.apply_defaults timeout: @config.rpcs.get_view.timeout,870 metadata: metadata,871 retry_policy: @config.rpcs.get_view.retry_policy872 options.apply_defaults timeout: @config.timeout,873 metadata: @config.metadata,874 retry_policy: @config.retry_policy875 @config_service_stub.call_rpc :get_view, request, options: options do |response, operation|876 yield response, operation if block_given?877 return response878 end879 rescue ::GRPC::BadStatus => e880 raise ::Google::Cloud::Error.from_error(e)881 end882 ##883 # Creates a view over logs in a bucket. A bucket may contain a maximum of884 # 50 views.885 #886 # @overload create_view(request, options = nil)887 # Pass arguments to `create_view` via a request object, either of type888 # {::Google::Cloud::Logging::V2::CreateViewRequest} or an equivalent Hash.889 #890 # @param request [::Google::Cloud::Logging::V2::CreateViewRequest, ::Hash]891 # A request object representing the call parameters. Required. To specify no892 # parameters, or to keep all the default parameter values, pass an empty Hash.893 # @param options [::Gapic::CallOptions, ::Hash]894 # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.895 #896 # @overload create_view(parent: nil, view_id: nil, view: nil)897 # Pass arguments to `create_view` via keyword arguments. Note that at898 # least one keyword argument is required. To specify no parameters, or to keep all899 # the default parameter values, pass an empty Hash as a request object (see above).900 #901 # @param parent [::String]902 # Required. The bucket in which to create the view903 #904 # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"905 #906 # Example:907 # `"projects/my-logging-project/locations/my-location/buckets/my-bucket"`908 # @param view_id [::String]909 # Required. The id to use for this view.910 # @param view [::Google::Cloud::Logging::V2::LogView, ::Hash]911 # Required. The new view.912 #913 # @yield [response, operation] Access the result along with the RPC operation914 # @yieldparam response [::Google::Cloud::Logging::V2::LogView]915 # @yieldparam operation [::GRPC::ActiveCall::Operation]916 #917 # @return [::Google::Cloud::Logging::V2::LogView]918 #919 # @raise [::Google::Cloud::Error] if the RPC is aborted.920 #921 # @example Basic example922 # require "google/cloud/logging/v2"923 #924 # # Create a client object. The client can be reused for multiple calls.925 # client = Google::Cloud::Logging::V2::ConfigService::Client.new926 #927 # # Create a request. To set request fields, pass in keyword arguments.928 # request = Google::Cloud::Logging::V2::CreateViewRequest.new929 #930 # # Call the create_view method.931 # result = client.create_view request932 #933 # # The returned object is of type Google::Cloud::Logging::V2::LogView.934 # p result935 #936 def create_view request, options = nil937 raise ::ArgumentError, "request must be provided" if request.nil?938 request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::CreateViewRequest939 # Converts hash and nil to an options object940 options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h941 # Customize the options with defaults942 metadata = @config.rpcs.create_view.metadata.to_h943 # Set x-goog-api-client and x-goog-user-project headers944 metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \945 lib_name: @config.lib_name, lib_version: @config.lib_version,946 gapic_version: ::Google::Cloud::Logging::V2::VERSION947 metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id948 header_params = {}949 if request.parent950 header_params["parent"] = request.parent951 end952 request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")953 metadata[:"x-goog-request-params"] ||= request_params_header954 options.apply_defaults timeout: @config.rpcs.create_view.timeout,955 metadata: metadata,956 retry_policy: @config.rpcs.create_view.retry_policy957 options.apply_defaults timeout: @config.timeout,958 metadata: @config.metadata,959 retry_policy: @config.retry_policy960 @config_service_stub.call_rpc :create_view, request, options: options do |response, operation|961 yield response, operation if block_given?962 return response963 end964 rescue ::GRPC::BadStatus => e965 raise ::Google::Cloud::Error.from_error(e)966 end967 ##968 # Updates a view. This method replaces the following fields in the existing969 # view with values from the new view: `filter`.970 #971 # @overload update_view(request, options = nil)972 # Pass arguments to `update_view` via a request object, either of type973 # {::Google::Cloud::Logging::V2::UpdateViewRequest} or an equivalent Hash.974 #975 # @param request [::Google::Cloud::Logging::V2::UpdateViewRequest, ::Hash]976 # A request object representing the call parameters. Required. To specify no977 # parameters, or to keep all the default parameter values, pass an empty Hash.978 # @param options [::Gapic::CallOptions, ::Hash]979 # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.980 #981 # @overload update_view(name: nil, view: nil, update_mask: nil)982 # Pass arguments to `update_view` via keyword arguments. Note that at983 # least one keyword argument is required. To specify no parameters, or to keep all984 # the default parameter values, pass an empty Hash as a request object (see above).985 #986 # @param name [::String]987 # Required. The full resource name of the view to update988 #989 # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"990 #991 # Example:992 # `"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id"`.993 # @param view [::Google::Cloud::Logging::V2::LogView, ::Hash]994 # Required. The updated view.995 # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]996 # Optional. Field mask that specifies the fields in `view` that need997 # an update. A field will be overwritten if, and only if, it is998 # in the update mask. `name` and output only fields cannot be updated.999 #1000 # For a detailed `FieldMask` definition, see1001 # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask1002 #1003 # Example: `updateMask=filter`.1004 #1005 # @yield [response, operation] Access the result along with the RPC operation1006 # @yieldparam response [::Google::Cloud::Logging::V2::LogView]1007 # @yieldparam operation [::GRPC::ActiveCall::Operation]1008 #1009 # @return [::Google::Cloud::Logging::V2::LogView]1010 #1011 # @raise [::Google::Cloud::Error] if the RPC is aborted.1012 #1013 # @example Basic example1014 # require "google/cloud/logging/v2"1015 #1016 # # Create a client object. The client can be reused for multiple calls.1017 # client = Google::Cloud::Logging::V2::ConfigService::Client.new1018 #1019 # # Create a request. To set request fields, pass in keyword arguments.1020 # request = Google::Cloud::Logging::V2::UpdateViewRequest.new1021 #1022 # # Call the update_view method.1023 # result = client.update_view request1024 #1025 # # The returned object is of type Google::Cloud::Logging::V2::LogView.1026 # p result1027 #1028 def update_view request, options = nil1029 raise ::ArgumentError, "request must be provided" if request.nil?1030 request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::UpdateViewRequest1031 # Converts hash and nil to an options object1032 options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h1033 # Customize the options with defaults1034 metadata = @config.rpcs.update_view.metadata.to_h1035 # Set x-goog-api-client and x-goog-user-project headers1036 metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \1037 lib_name: @config.lib_name, lib_version: @config.lib_version,1038 gapic_version: ::Google::Cloud::Logging::V2::VERSION1039 metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id1040 header_params = {}1041 if request.name1042 header_params["name"] = request.name1043 end1044 request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")1045 metadata[:"x-goog-request-params"] ||= request_params_header1046 options.apply_defaults timeout: @config.rpcs.update_view.timeout,1047 metadata: metadata,1048 retry_policy: @config.rpcs.update_view.retry_policy1049 options.apply_defaults timeout: @config.timeout,1050 metadata: @config.metadata,1051 retry_policy: @config.retry_policy1052 @config_service_stub.call_rpc :update_view, request, options: options do |response, operation|1053 yield response, operation if block_given?1054 return response1055 end1056 rescue ::GRPC::BadStatus => e1057 raise ::Google::Cloud::Error.from_error(e)1058 end1059 ##1060 # Deletes a view from a bucket.1061 #1062 # @overload delete_view(request, options = nil)1063 # Pass arguments to `delete_view` via a request object, either of type1064 # {::Google::Cloud::Logging::V2::DeleteViewRequest} or an equivalent Hash.1065 #1066 # @param request [::Google::Cloud::Logging::V2::DeleteViewRequest, ::Hash]1067 # A request object representing the call parameters. Required. To specify no1068 # parameters, or to keep all the default parameter values, pass an empty Hash.1069 # @param options [::Gapic::CallOptions, ::Hash]1070 # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.1071 #1072 # @overload delete_view(name: nil)1073 # Pass arguments to `delete_view` via keyword arguments. Note that at1074 # least one keyword argument is required. To specify no parameters, or to keep all1075 # the default parameter values, pass an empty Hash as a request object (see above).1076 #1077 # @param name [::String]1078 # Required. The full resource name of the view to delete:1079 #1080 # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"1081 #1082 # Example:1083 # `"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id"`.1084 #1085 # @yield [response, operation] Access the result along with the RPC operation1086 # @yieldparam response [::Google::Protobuf::Empty]1087 # @yieldparam operation [::GRPC::ActiveCall::Operation]1088 #1089 # @return [::Google::Protobuf::Empty]1090 #1091 # @raise [::Google::Cloud::Error] if the RPC is aborted.1092 #1093 # @example Basic example1094 # require "google/cloud/logging/v2"1095 #1096 # # Create a client object. The client can be reused for multiple calls.1097 # client = Google::Cloud::Logging::V2::ConfigService::Client.new1098 #1099 # # Create a request. To set request fields, pass in keyword arguments.1100 # request = Google::Cloud::Logging::V2::DeleteViewRequest.new1101 #1102 # # Call the delete_view method.1103 # result = client.delete_view request1104 #1105 # # The returned object is of type Google::Protobuf::Empty.1106 # p result1107 #1108 def delete_view request, options = nil1109 raise ::ArgumentError, "request must be provided" if request.nil?1110 request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::DeleteViewRequest1111 # Converts hash and nil to an options object1112 options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h1113 # Customize the options with defaults1114 metadata = @config.rpcs.delete_view.metadata.to_h1115 # Set x-goog-api-client and x-goog-user-project headers1116 metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \1117 lib_name: @config.lib_name, lib_version: @config.lib_version,1118 gapic_version: ::Google::Cloud::Logging::V2::VERSION1119 metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id1120 header_params = {}1121 if request.name1122 header_params["name"] = request.name1123 end1124 request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")1125 metadata[:"x-goog-request-params"] ||= request_params_header1126 options.apply_defaults timeout: @config.rpcs.delete_view.timeout,1127 metadata: metadata,1128 retry_policy: @config.rpcs.delete_view.retry_policy1129 options.apply_defaults timeout: @config.timeout,1130 metadata: @config.metadata,1131 retry_policy: @config.retry_policy1132 @config_service_stub.call_rpc :delete_view, request, options: options do |response, operation|1133 yield response, operation if block_given?1134 return response1135 end1136 rescue ::GRPC::BadStatus => e1137 raise ::Google::Cloud::Error.from_error(e)1138 end1139 ##1140 # Lists sinks.1141 #1142 # @overload list_sinks(request, options = nil)1143 # Pass arguments to `list_sinks` via a request object, either of type1144 # {::Google::Cloud::Logging::V2::ListSinksRequest} or an equivalent Hash.1145 #1146 # @param request [::Google::Cloud::Logging::V2::ListSinksRequest, ::Hash]1147 # A request object representing the call parameters. Required. To specify no1148 # parameters, or to keep all the default parameter values, pass an empty Hash.1149 # @param options [::Gapic::CallOptions, ::Hash]1150 # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.1151 #1152 # @overload list_sinks(parent: nil, page_token: nil, page_size: nil)1153 # Pass arguments to `list_sinks` via keyword arguments. Note that at1154 # least one keyword argument is required. To specify no parameters, or to keep all1155 # the default parameter values, pass an empty Hash as a request object (see above).1156 #1157 # @param parent [::String]1158 # Required. The parent resource whose sinks are to be listed:1159 #1160 # "projects/[PROJECT_ID]"1161 # "organizations/[ORGANIZATION_ID]"1162 # "billingAccounts/[BILLING_ACCOUNT_ID]"1163 # "folders/[FOLDER_ID]"1164 # @param page_token [::String]1165 # Optional. If present, then retrieve the next batch of results from the1166 # preceding call to this method. `pageToken` must be the value of1167 # `nextPageToken` from the previous response. The values of other method1168 # parameters should be identical to those in the previous call.1169 # @param page_size [::Integer]1170 # Optional. The maximum number of results to return from this request.1171 # Non-positive values are ignored. The presence of `nextPageToken` in the1172 # response indicates that more results might be available.1173 #1174 # @yield [response, operation] Access the result along with the RPC operation1175 # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogSink>]1176 # @yieldparam operation [::GRPC::ActiveCall::Operation]1177 #1178 # @return [::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogSink>]1179 #1180 # @raise [::Google::Cloud::Error] if the RPC is aborted.1181 #1182 # @example Basic example1183 # require "google/cloud/logging/v2"1184 #1185 # # Create a client object. The client can be reused for multiple calls.1186 # client = Google::Cloud::Logging::V2::ConfigService::Client.new1187 #1188 # # Create a request. To set request fields, pass in keyword arguments.1189 # request = Google::Cloud::Logging::V2::ListSinksRequest.new1190 #1191 # # Call the list_sinks method.1192 # result = client.list_sinks request1193 #1194 # # The returned object is of type Gapic::PagedEnumerable. You can1195 # # iterate over all elements by calling #each, and the enumerable1196 # # will lazily make API calls to fetch subsequent pages. Other1197 # # methods are also available for managing paging directly.1198 # result.each do |response|1199 # # Each element is of type ::Google::Cloud::Logging::V2::LogSink.1200 # p response1201 # end1202 #1203 def list_sinks request, options = nil1204 raise ::ArgumentError, "request must be provided" if request.nil?1205 request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::ListSinksRequest1206 # Converts hash and nil to an options object1207 options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h1208 # Customize the options with defaults1209 metadata = @config.rpcs.list_sinks.metadata.to_h1210 # Set x-goog-api-client and x-goog-user-project headers1211 metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \1212 lib_name: @config.lib_name, lib_version: @config.lib_version,1213 gapic_version: ::Google::Cloud::Logging::V2::VERSION1214 metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id1215 header_params = {}1216 if request.parent1217 header_params["parent"] = request.parent1218 end1219 request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")1220 metadata[:"x-goog-request-params"] ||= request_params_header1221 options.apply_defaults timeout: @config.rpcs.list_sinks.timeout,1222 metadata: metadata,1223 retry_policy: @config.rpcs.list_sinks.retry_policy1224 options.apply_defaults timeout: @config.timeout,1225 metadata: @config.metadata,1226 retry_policy: @config.retry_policy1227 @config_service_stub.call_rpc :list_sinks, request, options: options do |response, operation|1228 response = ::Gapic::PagedEnumerable.new @config_service_stub, :list_sinks, request, response, operation, options1229 yield response, operation if block_given?1230 return response1231 end1232 rescue ::GRPC::BadStatus => e1233 raise ::Google::Cloud::Error.from_error(e)1234 end1235 ##1236 # Gets a sink.1237 #1238 # @overload get_sink(request, options = nil)1239 # Pass arguments to `get_sink` via a request object, either of type1240 # {::Google::Cloud::Logging::V2::GetSinkRequest} or an equivalent Hash.1241 #1242 # @param request [::Google::Cloud::Logging::V2::GetSinkRequest, ::Hash]1243 # A request object representing the call parameters. Required. To specify no1244 # parameters, or to keep all the default parameter values, pass an empty Hash.1245 # @param options [::Gapic::CallOptions, ::Hash]1246 # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.1247 #1248 # @overload get_sink(sink_name: nil)1249 # Pass arguments to `get_sink` via keyword arguments. Note that at1250 # least one keyword argument is required. To specify no parameters, or to keep all1251 # the default parameter values, pass an empty Hash as a request object (see above).1252 #1253 # @param sink_name [::String]1254 # Required. The resource name of the sink:1255 #1256 # "projects/[PROJECT_ID]/sinks/[SINK_ID]"1257 # "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"1258 # "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"1259 # "folders/[FOLDER_ID]/sinks/[SINK_ID]"1260 #1261 # Example: `"projects/my-project-id/sinks/my-sink-id"`.1262 #1263 # @yield [response, operation] Access the result along with the RPC operation1264 # @yieldparam response [::Google::Cloud::Logging::V2::LogSink]1265 # @yieldparam operation [::GRPC::ActiveCall::Operation]1266 #1267 # @return [::Google::Cloud::Logging::V2::LogSink]1268 #1269 # @raise [::Google::Cloud::Error] if the RPC is aborted.1270 #1271 # @example Basic example1272 # require "google/cloud/logging/v2"1273 #1274 # # Create a client object. The client can be reused for multiple calls.1275 # client = Google::Cloud::Logging::V2::ConfigService::Client.new1276 #1277 # # Create a request. To set request fields, pass in keyword arguments.1278 # request = Google::Cloud::Logging::V2::GetSinkRequest.new1279 #1280 # # Call the get_sink method.1281 # result = client.get_sink request1282 #1283 # # The returned object is of type Google::Cloud::Logging::V2::LogSink.1284 # p result1285 #1286 def get_sink request, options = nil1287 raise ::ArgumentError, "request must be provided" if request.nil?1288 request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::GetSinkRequest1289 # Converts hash and nil to an options object1290 options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h1291 # Customize the options with defaults1292 metadata = @config.rpcs.get_sink.metadata.to_h1293 # Set x-goog-api-client and x-goog-user-project headers1294 metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \1295 lib_name: @config.lib_name, lib_version: @config.lib_version,1296 gapic_version: ::Google::Cloud::Logging::V2::VERSION1297 metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id1298 header_params = {}1299 if request.sink_name1300 header_params["sink_name"] = request.sink_name1301 end1302 request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")1303 metadata[:"x-goog-request-params"] ||= request_params_header1304 options.apply_defaults timeout: @config.rpcs.get_sink.timeout,1305 metadata: metadata,1306 retry_policy: @config.rpcs.get_sink.retry_policy1307 options.apply_defaults timeout: @config.timeout,1308 metadata: @config.metadata,1309 retry_policy: @config.retry_policy1310 @config_service_stub.call_rpc :get_sink, request, options: options do |response, operation|1311 yield response, operation if block_given?1312 return response1313 end1314 rescue ::GRPC::BadStatus => e1315 raise ::Google::Cloud::Error.from_error(e)1316 end1317 ##1318 # Creates a sink that exports specified log entries to a destination. The1319 # export of newly-ingested log entries begins immediately, unless the sink's1320 # `writer_identity` is not permitted to write to the destination. A sink can1321 # export log entries only from the resource owning the sink.1322 #1323 # @overload create_sink(request, options = nil)1324 # Pass arguments to `create_sink` via a request object, either of type1325 # {::Google::Cloud::Logging::V2::CreateSinkRequest} or an equivalent Hash.1326 #1327 # @param request [::Google::Cloud::Logging::V2::CreateSinkRequest, ::Hash]1328 # A request object representing the call parameters. Required. To specify no1329 # parameters, or to keep all the default parameter values, pass an empty Hash.1330 # @param options [::Gapic::CallOptions, ::Hash]1331 # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.1332 #1333 # @overload create_sink(parent: nil, sink: nil, unique_writer_identity: nil)1334 # Pass arguments to `create_sink` via keyword arguments. Note that at1335 # least one keyword argument is required. To specify no parameters, or to keep all1336 # the default parameter values, pass an empty Hash as a request object (see above).1337 #1338 # @param parent [::String]1339 # Required. The resource in which to create the sink:1340 #1341 # "projects/[PROJECT_ID]"1342 # "organizations/[ORGANIZATION_ID]"1343 # "billingAccounts/[BILLING_ACCOUNT_ID]"1344 # "folders/[FOLDER_ID]"1345 #1346 # Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.1347 # @param sink [::Google::Cloud::Logging::V2::LogSink, ::Hash]1348 # Required. The new sink, whose `name` parameter is a sink identifier that1349 # is not already in use.1350 # @param unique_writer_identity [::Boolean]1351 # Optional. Determines the kind of IAM identity returned as `writer_identity`1352 # in the new sink. If this value is omitted or set to false, and if the1353 # sink's parent is a project, then the value returned as `writer_identity` is1354 # the same group or service account used by Logging before the addition of1355 # writer identities to this API. The sink's destination must be in the same1356 # project as the sink itself.1357 #1358 # If this field is set to true, or if the sink is owned by a non-project1359 # resource such as an organization, then the value of `writer_identity` will1360 # be a unique service account used only for exports from the new sink. For1361 # more information, see `writer_identity` in {::Google::Cloud::Logging::V2::LogSink LogSink}.1362 #1363 # @yield [response, operation] Access the result along with the RPC operation1364 # @yieldparam response [::Google::Cloud::Logging::V2::LogSink]1365 # @yieldparam operation [::GRPC::ActiveCall::Operation]1366 #1367 # @return [::Google::Cloud::Logging::V2::LogSink]1368 #1369 # @raise [::Google::Cloud::Error] if the RPC is aborted.1370 #1371 # @example Basic example1372 # require "google/cloud/logging/v2"1373 #1374 # # Create a client object. The client can be reused for multiple calls.1375 # client = Google::Cloud::Logging::V2::ConfigService::Client.new1376 #1377 # # Create a request. To set request fields, pass in keyword arguments.1378 # request = Google::Cloud::Logging::V2::CreateSinkRequest.new1379 #1380 # # Call the create_sink method.1381 # result = client.create_sink request1382 #1383 # # The returned object is of type Google::Cloud::Logging::V2::LogSink.1384 # p result1385 #1386 def create_sink request, options = nil1387 raise ::ArgumentError, "request must be provided" if request.nil?1388 request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::CreateSinkRequest1389 # Converts hash and nil to an options object1390 options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h1391 # Customize the options with defaults1392 metadata = @config.rpcs.create_sink.metadata.to_h1393 # Set x-goog-api-client and x-goog-user-project headers1394 metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \1395 lib_name: @config.lib_name, lib_version: @config.lib_version,1396 gapic_version: ::Google::Cloud::Logging::V2::VERSION1397 metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id1398 header_params = {}1399 if request.parent1400 header_params["parent"] = request.parent1401 end1402 request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")1403 metadata[:"x-goog-request-params"] ||= request_params_header1404 options.apply_defaults timeout: @config.rpcs.create_sink.timeout,1405 metadata: metadata,1406 retry_policy: @config.rpcs.create_sink.retry_policy1407 options.apply_defaults timeout: @config.timeout,1408 metadata: @config.metadata,1409 retry_policy: @config.retry_policy1410 @config_service_stub.call_rpc :create_sink, request, options: options do |response, operation|1411 yield response, operation if block_given?1412 return response1413 end1414 rescue ::GRPC::BadStatus => e1415 raise ::Google::Cloud::Error.from_error(e)1416 end1417 ##1418 # Updates a sink. This method replaces the following fields in the existing1419 # sink with values from the new sink: `destination`, and `filter`.1420 #1421 # The updated sink might also have a new `writer_identity`; see the1422 # `unique_writer_identity` field.1423 #1424 # @overload update_sink(request, options = nil)1425 # Pass arguments to `update_sink` via a request object, either of type1426 # {::Google::Cloud::Logging::V2::UpdateSinkRequest} or an equivalent Hash.1427 #1428 # @param request [::Google::Cloud::Logging::V2::UpdateSinkRequest, ::Hash]1429 # A request object representing the call parameters. Required. To specify no1430 # parameters, or to keep all the default parameter values, pass an empty Hash.1431 # @param options [::Gapic::CallOptions, ::Hash]1432 # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.1433 #1434 # @overload update_sink(sink_name: nil, sink: nil, unique_writer_identity: nil, update_mask: nil)1435 # Pass arguments to `update_sink` via keyword arguments. Note that at1436 # least one keyword argument is required. To specify no parameters, or to keep all1437 # the default parameter values, pass an empty Hash as a request object (see above).1438 #1439 # @param sink_name [::String]1440 # Required. The full resource name of the sink to update, including the parent1441 # resource and the sink identifier:1442 #1443 # "projects/[PROJECT_ID]/sinks/[SINK_ID]"1444 # "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"1445 # "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"1446 # "folders/[FOLDER_ID]/sinks/[SINK_ID]"1447 #1448 # Example: `"projects/my-project-id/sinks/my-sink-id"`.1449 # @param sink [::Google::Cloud::Logging::V2::LogSink, ::Hash]1450 # Required. The updated sink, whose name is the same identifier that appears as part1451 # of `sink_name`.1452 # @param unique_writer_identity [::Boolean]1453 # Optional. See {::Google::Cloud::Logging::V2::ConfigServiceV2::Client#create_sink sinks.create}1454 # for a description of this field. When updating a sink, the effect of this1455 # field on the value of `writer_identity` in the updated sink depends on both1456 # the old and new values of this field:1457 #1458 # + If the old and new values of this field are both false or both true,1459 # then there is no change to the sink's `writer_identity`.1460 # + If the old value is false and the new value is true, then1461 # `writer_identity` is changed to a unique service account.1462 # + It is an error if the old value is true and the new value is1463 # set to false or defaulted to false.1464 # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]1465 # Optional. Field mask that specifies the fields in `sink` that need1466 # an update. A sink field will be overwritten if, and only if, it is1467 # in the update mask. `name` and output only fields cannot be updated.1468 #1469 # An empty updateMask is temporarily treated as using the following mask1470 # for backwards compatibility purposes:1471 # destination,filter,includeChildren1472 # At some point in the future, behavior will be removed and specifying an1473 # empty updateMask will be an error.1474 #1475 # For a detailed `FieldMask` definition, see1476 # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask1477 #1478 # Example: `updateMask=filter`.1479 #1480 # @yield [response, operation] Access the result along with the RPC operation1481 # @yieldparam response [::Google::Cloud::Logging::V2::LogSink]1482 # @yieldparam operation [::GRPC::ActiveCall::Operation]1483 #1484 # @return [::Google::Cloud::Logging::V2::LogSink]1485 #1486 # @raise [::Google::Cloud::Error] if the RPC is aborted.1487 #1488 # @example Basic example1489 # require "google/cloud/logging/v2"1490 #1491 # # Create a client object. The client can be reused for multiple calls.1492 # client = Google::Cloud::Logging::V2::ConfigService::Client.new1493 #1494 # # Create a request. To set request fields, pass in keyword arguments.1495 # request = Google::Cloud::Logging::V2::UpdateSinkRequest.new1496 #1497 # # Call the update_sink method.1498 # result = client.update_sink request1499 #1500 # # The returned object is of type Google::Cloud::Logging::V2::LogSink.1501 # p result1502 #1503 def update_sink request, options = nil1504 raise ::ArgumentError, "request must be provided" if request.nil?1505 request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::UpdateSinkRequest1506 # Converts hash and nil to an options object1507 options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h1508 # Customize the options with defaults1509 metadata = @config.rpcs.update_sink.metadata.to_h1510 # Set x-goog-api-client and x-goog-user-project headers1511 metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \1512 lib_name: @config.lib_name, lib_version: @config.lib_version,1513 gapic_version: ::Google::Cloud::Logging::V2::VERSION1514 metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id1515 header_params = {}1516 if request.sink_name1517 header_params["sink_name"] = request.sink_name1518 end1519 request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")1520 metadata[:"x-goog-request-params"] ||= request_params_header1521 options.apply_defaults timeout: @config.rpcs.update_sink.timeout,1522 metadata: metadata,1523 retry_policy: @config.rpcs.update_sink.retry_policy1524 options.apply_defaults timeout: @config.timeout,1525 metadata: @config.metadata,1526 retry_policy: @config.retry_policy1527 @config_service_stub.call_rpc :update_sink, request, options: options do |response, operation|1528 yield response, operation if block_given?1529 return response1530 end1531 rescue ::GRPC::BadStatus => e1532 raise ::Google::Cloud::Error.from_error(e)1533 end1534 ##1535 # Deletes a sink. If the sink has a unique `writer_identity`, then that1536 # service account is also deleted.1537 #1538 # @overload delete_sink(request, options = nil)1539 # Pass arguments to `delete_sink` via a request object, either of type1540 # {::Google::Cloud::Logging::V2::DeleteSinkRequest} or an equivalent Hash.1541 #1542 # @param request [::Google::Cloud::Logging::V2::DeleteSinkRequest, ::Hash]1543 # A request object representing the call parameters. Required. To specify no1544 # parameters, or to keep all the default parameter values, pass an empty Hash.1545 # @param options [::Gapic::CallOptions, ::Hash]1546 # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.1547 #1548 # @overload delete_sink(sink_name: nil)1549 # Pass arguments to `delete_sink` via keyword arguments. Note that at1550 # least one keyword argument is required. To specify no parameters, or to keep all1551 # the default parameter values, pass an empty Hash as a request object (see above).1552 #1553 # @param sink_name [::String]1554 # Required. The full resource name of the sink to delete, including the parent1555 # resource and the sink identifier:1556 #1557 # "projects/[PROJECT_ID]/sinks/[SINK_ID]"1558 # "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"1559 # "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"1560 # "folders/[FOLDER_ID]/sinks/[SINK_ID]"1561 #1562 # Example: `"projects/my-project-id/sinks/my-sink-id"`.1563 #1564 # @yield [response, operation] Access the result along with the RPC operation1565 # @yieldparam response [::Google::Protobuf::Empty]1566 # @yieldparam operation [::GRPC::ActiveCall::Operation]1567 #1568 # @return [::Google::Protobuf::Empty]1569 #1570 # @raise [::Google::Cloud::Error] if the RPC is aborted.1571 #1572 # @example Basic example1573 # require "google/cloud/logging/v2"1574 #1575 # # Create a client object. The client can be reused for multiple calls.1576 # client = Google::Cloud::Logging::V2::ConfigService::Client.new1577 #1578 # # Create a request. To set request fields, pass in keyword arguments.1579 # request = Google::Cloud::Logging::V2::DeleteSinkRequest.new1580 #1581 # # Call the delete_sink method.1582 # result = client.delete_sink request1583 #1584 # # The returned object is of type Google::Protobuf::Empty.1585 # p result1586 #1587 def delete_sink request, options = nil1588 raise ::ArgumentError, "request must be provided" if request.nil?1589 request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::DeleteSinkRequest1590 # Converts hash and nil to an options object1591 options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h1592 # Customize the options with defaults1593 metadata = @config.rpcs.delete_sink.metadata.to_h1594 # Set x-goog-api-client and x-goog-user-project headers1595 metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \1596 lib_name: @config.lib_name, lib_version: @config.lib_version,1597 gapic_version: ::Google::Cloud::Logging::V2::VERSION1598 metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id1599 header_params = {}1600 if request.sink_name1601 header_params["sink_name"] = request.sink_name1602 end1603 request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")1604 metadata[:"x-goog-request-params"] ||= request_params_header1605 options.apply_defaults timeout: @config.rpcs.delete_sink.timeout,1606 metadata: metadata,1607 retry_policy: @config.rpcs.delete_sink.retry_policy1608 options.apply_defaults timeout: @config.timeout,1609 metadata: @config.metadata,1610 retry_policy: @config.retry_policy1611 @config_service_stub.call_rpc :delete_sink, request, options: options do |response, operation|1612 yield response, operation if block_given?1613 return response1614 end1615 rescue ::GRPC::BadStatus => e1616 raise ::Google::Cloud::Error.from_error(e)1617 end1618 ##1619 # Lists all the exclusions in a parent resource.1620 #1621 # @overload list_exclusions(request, options = nil)1622 # Pass arguments to `list_exclusions` via a request object, either of type1623 # {::Google::Cloud::Logging::V2::ListExclusionsRequest} or an equivalent Hash.1624 #1625 # @param request [::Google::Cloud::Logging::V2::ListExclusionsRequest, ::Hash]1626 # A request object representing the call parameters. Required. To specify no1627 # parameters, or to keep all the default parameter values, pass an empty Hash.1628 # @param options [::Gapic::CallOptions, ::Hash]1629 # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.1630 #1631 # @overload list_exclusions(parent: nil, page_token: nil, page_size: nil)1632 # Pass arguments to `list_exclusions` via keyword arguments. Note that at1633 # least one keyword argument is required. To specify no parameters, or to keep all1634 # the default parameter values, pass an empty Hash as a request object (see above).1635 #1636 # @param parent [::String]1637 # Required. The parent resource whose exclusions are to be listed.1638 #1639 # "projects/[PROJECT_ID]"1640 # "organizations/[ORGANIZATION_ID]"1641 # "billingAccounts/[BILLING_ACCOUNT_ID]"1642 # "folders/[FOLDER_ID]"1643 # @param page_token [::String]1644 # Optional. If present, then retrieve the next batch of results from the1645 # preceding call to this method. `pageToken` must be the value of1646 # `nextPageToken` from the previous response. The values of other method1647 # parameters should be identical to those in the previous call.1648 # @param page_size [::Integer]1649 # Optional. The maximum number of results to return from this request.1650 # Non-positive values are ignored. The presence of `nextPageToken` in the1651 # response indicates that more results might be available.1652 #1653 # @yield [response, operation] Access the result along with the RPC operation1654 # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogExclusion>]1655 # @yieldparam operation [::GRPC::ActiveCall::Operation]1656 #1657 # @return [::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogExclusion>]1658 #1659 # @raise [::Google::Cloud::Error] if the RPC is aborted.1660 #1661 # @example Basic example1662 # require "google/cloud/logging/v2"1663 #1664 # # Create a client object. The client can be reused for multiple calls.1665 # client = Google::Cloud::Logging::V2::ConfigService::Client.new1666 #1667 # # Create a request. To set request fields, pass in keyword arguments.1668 # request = Google::Cloud::Logging::V2::ListExclusionsRequest.new1669 #1670 # # Call the list_exclusions method.1671 # result = client.list_exclusions request1672 #1673 # # The returned object is of type Gapic::PagedEnumerable. You can1674 # # iterate over all elements by calling #each, and the enumerable1675 # # will lazily make API calls to fetch subsequent pages. Other1676 # # methods are also available for managing paging directly.1677 # result.each do |response|1678 # # Each element is of type ::Google::Cloud::Logging::V2::LogExclusion.1679 # p response1680 # end1681 #1682 def list_exclusions request, options = nil1683 raise ::ArgumentError, "request must be provided" if request.nil?1684 request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::ListExclusionsRequest1685 # Converts hash and nil to an options object1686 options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h1687 # Customize the options with defaults1688 metadata = @config.rpcs.list_exclusions.metadata.to_h1689 # Set x-goog-api-client and x-goog-user-project headers1690 metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \1691 lib_name: @config.lib_name, lib_version: @config.lib_version,1692 gapic_version: ::Google::Cloud::Logging::V2::VERSION1693 metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id1694 header_params = {}1695 if request.parent1696 header_params["parent"] = request.parent1697 end1698 request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")1699 metadata[:"x-goog-request-params"] ||= request_params_header1700 options.apply_defaults timeout: @config.rpcs.list_exclusions.timeout,1701 metadata: metadata,1702 retry_policy: @config.rpcs.list_exclusions.retry_policy1703 options.apply_defaults timeout: @config.timeout,1704 metadata: @config.metadata,1705 retry_policy: @config.retry_policy1706 @config_service_stub.call_rpc :list_exclusions, request, options: options do |response, operation|1707 response = ::Gapic::PagedEnumerable.new @config_service_stub, :list_exclusions, request, response, operation, options1708 yield response, operation if block_given?1709 return response1710 end1711 rescue ::GRPC::BadStatus => e1712 raise ::Google::Cloud::Error.from_error(e)1713 end1714 ##1715 # Gets the description of an exclusion.1716 #1717 # @overload get_exclusion(request, options = nil)1718 # Pass arguments to `get_exclusion` via a request object, either of type1719 # {::Google::Cloud::Logging::V2::GetExclusionRequest} or an equivalent Hash.1720 #1721 # @param request [::Google::Cloud::Logging::V2::GetExclusionRequest, ::Hash]1722 # A request object representing the call parameters. Required. To specify no1723 # parameters, or to keep all the default parameter values, pass an empty Hash.1724 # @param options [::Gapic::CallOptions, ::Hash]1725 # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.1726 #1727 # @overload get_exclusion(name: nil)1728 # Pass arguments to `get_exclusion` via keyword arguments. Note that at1729 # least one keyword argument is required. To specify no parameters, or to keep all1730 # the default parameter values, pass an empty Hash as a request object (see above).1731 #1732 # @param name [::String]1733 # Required. The resource name of an existing exclusion:1734 #1735 # "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"1736 # "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"1737 # "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"1738 # "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"1739 #1740 # Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.1741 #1742 # @yield [response, operation] Access the result along with the RPC operation1743 # @yieldparam response [::Google::Cloud::Logging::V2::LogExclusion]1744 # @yieldparam operation [::GRPC::ActiveCall::Operation]1745 #1746 # @return [::Google::Cloud::Logging::V2::LogExclusion]1747 #1748 # @raise [::Google::Cloud::Error] if the RPC is aborted.1749 #1750 # @example Basic example1751 # require "google/cloud/logging/v2"1752 #1753 # # Create a client object. The client can be reused for multiple calls.1754 # client = Google::Cloud::Logging::V2::ConfigService::Client.new1755 #1756 # # Create a request. To set request fields, pass in keyword arguments.1757 # request = Google::Cloud::Logging::V2::GetExclusionRequest.new1758 #1759 # # Call the get_exclusion method.1760 # result = client.get_exclusion request1761 #1762 # # The returned object is of type Google::Cloud::Logging::V2::LogExclusion.1763 # p result1764 #1765 def get_exclusion request, options = nil1766 raise ::ArgumentError, "request must be provided" if request.nil?1767 request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::GetExclusionRequest1768 # Converts hash and nil to an options object1769 options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h1770 # Customize the options with defaults1771 metadata = @config.rpcs.get_exclusion.metadata.to_h1772 # Set x-goog-api-client and x-goog-user-project headers1773 metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \1774 lib_name: @config.lib_name, lib_version: @config.lib_version,1775 gapic_version: ::Google::Cloud::Logging::V2::VERSION1776 metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id1777 header_params = {}1778 if request.name1779 header_params["name"] = request.name1780 end1781 request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")1782 metadata[:"x-goog-request-params"] ||= request_params_header1783 options.apply_defaults timeout: @config.rpcs.get_exclusion.timeout,1784 metadata: metadata,1785 retry_policy: @config.rpcs.get_exclusion.retry_policy1786 options.apply_defaults timeout: @config.timeout,1787 metadata: @config.metadata,1788 retry_policy: @config.retry_policy1789 @config_service_stub.call_rpc :get_exclusion, request, options: options do |response, operation|1790 yield response, operation if block_given?1791 return response1792 end1793 rescue ::GRPC::BadStatus => e1794 raise ::Google::Cloud::Error.from_error(e)1795 end1796 ##1797 # Creates a new exclusion in a specified parent resource.1798 # Only log entries belonging to that resource can be excluded.1799 # You can have up to 10 exclusions in a resource.1800 #1801 # @overload create_exclusion(request, options = nil)1802 # Pass arguments to `create_exclusion` via a request object, either of type1803 # {::Google::Cloud::Logging::V2::CreateExclusionRequest} or an equivalent Hash.1804 #1805 # @param request [::Google::Cloud::Logging::V2::CreateExclusionRequest, ::Hash]1806 # A request object representing the call parameters. Required. To specify no1807 # parameters, or to keep all the default parameter values, pass an empty Hash.1808 # @param options [::Gapic::CallOptions, ::Hash]1809 # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.1810 #1811 # @overload create_exclusion(parent: nil, exclusion: nil)1812 # Pass arguments to `create_exclusion` via keyword arguments. Note that at1813 # least one keyword argument is required. To specify no parameters, or to keep all1814 # the default parameter values, pass an empty Hash as a request object (see above).1815 #1816 # @param parent [::String]1817 # Required. The parent resource in which to create the exclusion:1818 #1819 # "projects/[PROJECT_ID]"1820 # "organizations/[ORGANIZATION_ID]"1821 # "billingAccounts/[BILLING_ACCOUNT_ID]"1822 # "folders/[FOLDER_ID]"1823 #1824 # Examples: `"projects/my-logging-project"`, `"organizations/123456789"`.1825 # @param exclusion [::Google::Cloud::Logging::V2::LogExclusion, ::Hash]1826 # Required. The new exclusion, whose `name` parameter is an exclusion name1827 # that is not already used in the parent resource.1828 #1829 # @yield [response, operation] Access the result along with the RPC operation1830 # @yieldparam response [::Google::Cloud::Logging::V2::LogExclusion]1831 # @yieldparam operation [::GRPC::ActiveCall::Operation]1832 #1833 # @return [::Google::Cloud::Logging::V2::LogExclusion]1834 #1835 # @raise [::Google::Cloud::Error] if the RPC is aborted.1836 #1837 # @example Basic example1838 # require "google/cloud/logging/v2"1839 #1840 # # Create a client object. The client can be reused for multiple calls.1841 # client = Google::Cloud::Logging::V2::ConfigService::Client.new1842 #1843 # # Create a request. To set request fields, pass in keyword arguments.1844 # request = Google::Cloud::Logging::V2::CreateExclusionRequest.new1845 #1846 # # Call the create_exclusion method.1847 # result = client.create_exclusion request1848 #1849 # # The returned object is of type Google::Cloud::Logging::V2::LogExclusion.1850 # p result1851 #1852 def create_exclusion request, options = nil1853 raise ::ArgumentError, "request must be provided" if request.nil?1854 request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::CreateExclusionRequest1855 # Converts hash and nil to an options object1856 options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h1857 # Customize the options with defaults1858 metadata = @config.rpcs.create_exclusion.metadata.to_h1859 # Set x-goog-api-client and x-goog-user-project headers1860 metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \1861 lib_name: @config.lib_name, lib_version: @config.lib_version,1862 gapic_version: ::Google::Cloud::Logging::V2::VERSION1863 metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id1864 header_params = {}1865 if request.parent1866 header_params["parent"] = request.parent1867 end1868 request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")1869 metadata[:"x-goog-request-params"] ||= request_params_header1870 options.apply_defaults timeout: @config.rpcs.create_exclusion.timeout,1871 metadata: metadata,1872 retry_policy: @config.rpcs.create_exclusion.retry_policy1873 options.apply_defaults timeout: @config.timeout,1874 metadata: @config.metadata,1875 retry_policy: @config.retry_policy1876 @config_service_stub.call_rpc :create_exclusion, request, options: options do |response, operation|1877 yield response, operation if block_given?1878 return response1879 end1880 rescue ::GRPC::BadStatus => e1881 raise ::Google::Cloud::Error.from_error(e)1882 end1883 ##1884 # Changes one or more properties of an existing exclusion.1885 #1886 # @overload update_exclusion(request, options = nil)1887 # Pass arguments to `update_exclusion` via a request object, either of type1888 # {::Google::Cloud::Logging::V2::UpdateExclusionRequest} or an equivalent Hash.1889 #1890 # @param request [::Google::Cloud::Logging::V2::UpdateExclusionRequest, ::Hash]1891 # A request object representing the call parameters. Required. To specify no1892 # parameters, or to keep all the default parameter values, pass an empty Hash.1893 # @param options [::Gapic::CallOptions, ::Hash]1894 # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.1895 #1896 # @overload update_exclusion(name: nil, exclusion: nil, update_mask: nil)1897 # Pass arguments to `update_exclusion` via keyword arguments. Note that at1898 # least one keyword argument is required. To specify no parameters, or to keep all1899 # the default parameter values, pass an empty Hash as a request object (see above).1900 #1901 # @param name [::String]1902 # Required. The resource name of the exclusion to update:1903 #1904 # "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"1905 # "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"1906 # "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"1907 # "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"1908 #1909 # Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.1910 # @param exclusion [::Google::Cloud::Logging::V2::LogExclusion, ::Hash]1911 # Required. New values for the existing exclusion. Only the fields specified in1912 # `update_mask` are relevant.1913 # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]1914 # Required. A non-empty list of fields to change in the existing exclusion. New values1915 # for the fields are taken from the corresponding fields in the1916 # {::Google::Cloud::Logging::V2::LogExclusion LogExclusion} included in this request. Fields not mentioned in1917 # `update_mask` are not changed and are ignored in the request.1918 #1919 # For example, to change the filter and description of an exclusion,1920 # specify an `update_mask` of `"filter,description"`.1921 #1922 # @yield [response, operation] Access the result along with the RPC operation1923 # @yieldparam response [::Google::Cloud::Logging::V2::LogExclusion]1924 # @yieldparam operation [::GRPC::ActiveCall::Operation]1925 #1926 # @return [::Google::Cloud::Logging::V2::LogExclusion]1927 #1928 # @raise [::Google::Cloud::Error] if the RPC is aborted.1929 #1930 # @example Basic example1931 # require "google/cloud/logging/v2"1932 #1933 # # Create a client object. The client can be reused for multiple calls.1934 # client = Google::Cloud::Logging::V2::ConfigService::Client.new1935 #1936 # # Create a request. To set request fields, pass in keyword arguments.1937 # request = Google::Cloud::Logging::V2::UpdateExclusionRequest.new1938 #1939 # # Call the update_exclusion method.1940 # result = client.update_exclusion request1941 #1942 # # The returned object is of type Google::Cloud::Logging::V2::LogExclusion.1943 # p result1944 #1945 def update_exclusion request, options = nil1946 raise ::ArgumentError, "request must be provided" if request.nil?1947 request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::UpdateExclusionRequest1948 # Converts hash and nil to an options object1949 options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h1950 # Customize the options with defaults1951 metadata = @config.rpcs.update_exclusion.metadata.to_h1952 # Set x-goog-api-client and x-goog-user-project headers1953 metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \1954 lib_name: @config.lib_name, lib_version: @config.lib_version,1955 gapic_version: ::Google::Cloud::Logging::V2::VERSION1956 metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id1957 header_params = {}1958 if request.name1959 header_params["name"] = request.name1960 end1961 request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")1962 metadata[:"x-goog-request-params"] ||= request_params_header1963 options.apply_defaults timeout: @config.rpcs.update_exclusion.timeout,1964 metadata: metadata,1965 retry_policy: @config.rpcs.update_exclusion.retry_policy1966 options.apply_defaults timeout: @config.timeout,1967 metadata: @config.metadata,1968 retry_policy: @config.retry_policy1969 @config_service_stub.call_rpc :update_exclusion, request, options: options do |response, operation|1970 yield response, operation if block_given?1971 return response1972 end1973 rescue ::GRPC::BadStatus => e1974 raise ::Google::Cloud::Error.from_error(e)1975 end1976 ##1977 # Deletes an exclusion.1978 #1979 # @overload delete_exclusion(request, options = nil)1980 # Pass arguments to `delete_exclusion` via a request object, either of type1981 # {::Google::Cloud::Logging::V2::DeleteExclusionRequest} or an equivalent Hash.1982 #1983 # @param request [::Google::Cloud::Logging::V2::DeleteExclusionRequest, ::Hash]1984 # A request object representing the call parameters. Required. To specify no1985 # parameters, or to keep all the default parameter values, pass an empty Hash.1986 # @param options [::Gapic::CallOptions, ::Hash]1987 # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.1988 #1989 # @overload delete_exclusion(name: nil)1990 # Pass arguments to `delete_exclusion` via keyword arguments. Note that at1991 # least one keyword argument is required. To specify no parameters, or to keep all1992 # the default parameter values, pass an empty Hash as a request object (see above).1993 #1994 # @param name [::String]1995 # Required. The resource name of an existing exclusion to delete:1996 #1997 # "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"1998 # "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"1999 # "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"2000 # "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"2001 #2002 # Example: `"projects/my-project-id/exclusions/my-exclusion-id"`.2003 #2004 # @yield [response, operation] Access the result along with the RPC operation2005 # @yieldparam response [::Google::Protobuf::Empty]2006 # @yieldparam operation [::GRPC::ActiveCall::Operation]2007 #2008 # @return [::Google::Protobuf::Empty]2009 #2010 # @raise [::Google::Cloud::Error] if the RPC is aborted.2011 #2012 # @example Basic example2013 # require "google/cloud/logging/v2"2014 #2015 # # Create a client object. The client can be reused for multiple calls.2016 # client = Google::Cloud::Logging::V2::ConfigService::Client.new2017 #2018 # # Create a request. To set request fields, pass in keyword arguments.2019 # request = Google::Cloud::Logging::V2::DeleteExclusionRequest.new2020 #2021 # # Call the delete_exclusion method.2022 # result = client.delete_exclusion request2023 #2024 # # The returned object is of type Google::Protobuf::Empty.2025 # p result2026 #2027 def delete_exclusion request, options = nil2028 raise ::ArgumentError, "request must be provided" if request.nil?2029 request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::DeleteExclusionRequest2030 # Converts hash and nil to an options object2031 options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h2032 # Customize the options with defaults2033 metadata = @config.rpcs.delete_exclusion.metadata.to_h2034 # Set x-goog-api-client and x-goog-user-project headers2035 metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \2036 lib_name: @config.lib_name, lib_version: @config.lib_version,2037 gapic_version: ::Google::Cloud::Logging::V2::VERSION2038 metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id2039 header_params = {}2040 if request.name2041 header_params["name"] = request.name2042 end2043 request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")2044 metadata[:"x-goog-request-params"] ||= request_params_header2045 options.apply_defaults timeout: @config.rpcs.delete_exclusion.timeout,2046 metadata: metadata,2047 retry_policy: @config.rpcs.delete_exclusion.retry_policy2048 options.apply_defaults timeout: @config.timeout,2049 metadata: @config.metadata,2050 retry_policy: @config.retry_policy2051 @config_service_stub.call_rpc :delete_exclusion, request, options: options do |response, operation|2052 yield response, operation if block_given?2053 return response2054 end2055 rescue ::GRPC::BadStatus => e2056 raise ::Google::Cloud::Error.from_error(e)2057 end2058 ##2059 # Gets the Logs Router CMEK settings for the given resource.2060 #2061 # Note: CMEK for the Logs Router can currently only be configured for GCP2062 # organizations. Once configured, it applies to all projects and folders in2063 # the GCP organization.2064 #2065 # See [Enabling CMEK for Logs2066 # Router](https://cloud.google.com/logging/docs/routing/managed-encryption)2067 # for more information.2068 #2069 # @overload get_cmek_settings(request, options = nil)2070 # Pass arguments to `get_cmek_settings` via a request object, either of type2071 # {::Google::Cloud::Logging::V2::GetCmekSettingsRequest} or an equivalent Hash.2072 #2073 # @param request [::Google::Cloud::Logging::V2::GetCmekSettingsRequest, ::Hash]2074 # A request object representing the call parameters. Required. To specify no2075 # parameters, or to keep all the default parameter values, pass an empty Hash.2076 # @param options [::Gapic::CallOptions, ::Hash]2077 # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.2078 #2079 # @overload get_cmek_settings(name: nil)2080 # Pass arguments to `get_cmek_settings` via keyword arguments. Note that at2081 # least one keyword argument is required. To specify no parameters, or to keep all2082 # the default parameter values, pass an empty Hash as a request object (see above).2083 #2084 # @param name [::String]2085 # Required. The resource for which to retrieve CMEK settings.2086 #2087 # "projects/[PROJECT_ID]/cmekSettings"2088 # "organizations/[ORGANIZATION_ID]/cmekSettings"2089 # "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"2090 # "folders/[FOLDER_ID]/cmekSettings"2091 #2092 # Example: `"organizations/12345/cmekSettings"`.2093 #2094 # Note: CMEK for the Logs Router can currently only be configured for GCP2095 # organizations. Once configured, it applies to all projects and folders in2096 # the GCP organization.2097 #2098 # @yield [response, operation] Access the result along with the RPC operation2099 # @yieldparam response [::Google::Cloud::Logging::V2::CmekSettings]2100 # @yieldparam operation [::GRPC::ActiveCall::Operation]2101 #2102 # @return [::Google::Cloud::Logging::V2::CmekSettings]2103 #2104 # @raise [::Google::Cloud::Error] if the RPC is aborted.2105 #2106 # @example Basic example2107 # require "google/cloud/logging/v2"2108 #2109 # # Create a client object. The client can be reused for multiple calls.2110 # client = Google::Cloud::Logging::V2::ConfigService::Client.new2111 #2112 # # Create a request. To set request fields, pass in keyword arguments.2113 # request = Google::Cloud::Logging::V2::GetCmekSettingsRequest.new2114 #2115 # # Call the get_cmek_settings method.2116 # result = client.get_cmek_settings request2117 #2118 # # The returned object is of type Google::Cloud::Logging::V2::CmekSettings.2119 # p result2120 #2121 def get_cmek_settings request, options = nil2122 raise ::ArgumentError, "request must be provided" if request.nil?2123 request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::GetCmekSettingsRequest2124 # Converts hash and nil to an options object2125 options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h2126 # Customize the options with defaults2127 metadata = @config.rpcs.get_cmek_settings.metadata.to_h2128 # Set x-goog-api-client and x-goog-user-project headers2129 metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \2130 lib_name: @config.lib_name, lib_version: @config.lib_version,2131 gapic_version: ::Google::Cloud::Logging::V2::VERSION2132 metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id2133 header_params = {}2134 if request.name2135 header_params["name"] = request.name2136 end2137 request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")2138 metadata[:"x-goog-request-params"] ||= request_params_header2139 options.apply_defaults timeout: @config.rpcs.get_cmek_settings.timeout,2140 metadata: metadata,2141 retry_policy: @config.rpcs.get_cmek_settings.retry_policy2142 options.apply_defaults timeout: @config.timeout,2143 metadata: @config.metadata,2144 retry_policy: @config.retry_policy2145 @config_service_stub.call_rpc :get_cmek_settings, request, options: options do |response, operation|2146 yield response, operation if block_given?2147 return response2148 end2149 rescue ::GRPC::BadStatus => e2150 raise ::Google::Cloud::Error.from_error(e)2151 end2152 ##2153 # Updates the Logs Router CMEK settings for the given resource.2154 #2155 # Note: CMEK for the Logs Router can currently only be configured for GCP2156 # organizations. Once configured, it applies to all projects and folders in2157 # the GCP organization.2158 #2159 # {::Google::Cloud::Logging::V2::ConfigServiceV2::Client#update_cmek_settings UpdateCmekSettings}2160 # will fail if 1) `kms_key_name` is invalid, or 2) the associated service2161 # account does not have the required2162 # `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or2163 # 3) access to the key is disabled.2164 #2165 # See [Enabling CMEK for Logs2166 # Router](https://cloud.google.com/logging/docs/routing/managed-encryption)2167 # for more information.2168 #2169 # @overload update_cmek_settings(request, options = nil)2170 # Pass arguments to `update_cmek_settings` via a request object, either of type2171 # {::Google::Cloud::Logging::V2::UpdateCmekSettingsRequest} or an equivalent Hash.2172 #2173 # @param request [::Google::Cloud::Logging::V2::UpdateCmekSettingsRequest, ::Hash]2174 # A request object representing the call parameters. Required. To specify no2175 # parameters, or to keep all the default parameter values, pass an empty Hash.2176 # @param options [::Gapic::CallOptions, ::Hash]2177 # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.2178 #2179 # @overload update_cmek_settings(name: nil, cmek_settings: nil, update_mask: nil)2180 # Pass arguments to `update_cmek_settings` via keyword arguments. Note that at2181 # least one keyword argument is required. To specify no parameters, or to keep all2182 # the default parameter values, pass an empty Hash as a request object (see above).2183 #2184 # @param name [::String]2185 # Required. The resource name for the CMEK settings to update.2186 #2187 # "projects/[PROJECT_ID]/cmekSettings"2188 # "organizations/[ORGANIZATION_ID]/cmekSettings"2189 # "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"2190 # "folders/[FOLDER_ID]/cmekSettings"2191 #2192 # Example: `"organizations/12345/cmekSettings"`.2193 #2194 # Note: CMEK for the Logs Router can currently only be configured for GCP2195 # organizations. Once configured, it applies to all projects and folders in2196 # the GCP organization.2197 # @param cmek_settings [::Google::Cloud::Logging::V2::CmekSettings, ::Hash]2198 # Required. The CMEK settings to update.2199 #2200 # See [Enabling CMEK for Logs2201 # Router](https://cloud.google.com/logging/docs/routing/managed-encryption)2202 # for more information.2203 # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]2204 # Optional. Field mask identifying which fields from `cmek_settings` should2205 # be updated. A field will be overwritten if and only if it is in the update2206 # mask. Output only fields cannot be updated.2207 #2208 # See {::Google::Protobuf::FieldMask FieldMask} for more information.2209 #2210 # Example: `"updateMask=kmsKeyName"`2211 #2212 # @yield [response, operation] Access the result along with the RPC operation2213 # @yieldparam response [::Google::Cloud::Logging::V2::CmekSettings]2214 # @yieldparam operation [::GRPC::ActiveCall::Operation]2215 #2216 # @return [::Google::Cloud::Logging::V2::CmekSettings]2217 #2218 # @raise [::Google::Cloud::Error] if the RPC is aborted.2219 #2220 # @example Basic example2221 # require "google/cloud/logging/v2"2222 #2223 # # Create a client object. The client can be reused for multiple calls.2224 # client = Google::Cloud::Logging::V2::ConfigService::Client.new2225 #2226 # # Create a request. To set request fields, pass in keyword arguments.2227 # request = Google::Cloud::Logging::V2::UpdateCmekSettingsRequest.new2228 #2229 # # Call the update_cmek_settings method.2230 # result = client.update_cmek_settings request2231 #2232 # # The returned object is of type Google::Cloud::Logging::V2::CmekSettings.2233 # p result2234 #2235 def update_cmek_settings request, options = nil2236 raise ::ArgumentError, "request must be provided" if request.nil?2237 request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::UpdateCmekSettingsRequest2238 # Converts hash and nil to an options object2239 options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h2240 # Customize the options with defaults2241 metadata = @config.rpcs.update_cmek_settings.metadata.to_h2242 # Set x-goog-api-client and x-goog-user-project headers2243 metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \2244 lib_name: @config.lib_name, lib_version: @config.lib_version,2245 gapic_version: ::Google::Cloud::Logging::V2::VERSION2246 metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id2247 header_params = {}2248 if request.name2249 header_params["name"] = request.name2250 end2251 request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")2252 metadata[:"x-goog-request-params"] ||= request_params_header2253 options.apply_defaults timeout: @config.rpcs.update_cmek_settings.timeout,2254 metadata: metadata,2255 retry_policy: @config.rpcs.update_cmek_settings.retry_policy2256 options.apply_defaults timeout: @config.timeout,2257 metadata: @config.metadata,2258 retry_policy: @config.retry_policy2259 @config_service_stub.call_rpc :update_cmek_settings, request, options: options do |response, operation|2260 yield response, operation if block_given?2261 return response2262 end2263 rescue ::GRPC::BadStatus => e2264 raise ::Google::Cloud::Error.from_error(e)2265 end2266 ##2267 # Configuration class for the ConfigService API.2268 #2269 # This class represents the configuration for ConfigService,2270 # providing control over timeouts, retry behavior, logging, transport2271 # parameters, and other low-level controls. Certain parameters can also be2272 # applied individually to specific RPCs. See2273 # {::Google::Cloud::Logging::V2::ConfigService::Client::Configuration::Rpcs}2274 # for a list of RPCs that can be configured independently.2275 #2276 # Configuration can be applied globally to all clients, or to a single client2277 # on construction.2278 #2279 # @example2280 #2281 # # Modify the global config, setting the timeout for2282 # # list_buckets to 20 seconds,2283 # # and all remaining timeouts to 10 seconds.2284 # ::Google::Cloud::Logging::V2::ConfigService::Client.configure do |config|2285 # config.timeout = 10.02286 # config.rpcs.list_buckets.timeout = 20.02287 # end2288 #2289 # # Apply the above configuration only to a new client.2290 # client = ::Google::Cloud::Logging::V2::ConfigService::Client.new do |config|2291 # config.timeout = 10.02292 # config.rpcs.list_buckets.timeout = 20.02293 # end2294 #2295 # @!attribute [rw] endpoint2296 # The hostname or hostname:port of the service endpoint.2297 # Defaults to `"logging.googleapis.com"`.2298 # @return [::String]2299 # @!attribute [rw] credentials2300 # Credentials to send with calls. You may provide any of the following types:2301 # * (`String`) The path to a service account key file in JSON format2302 # * (`Hash`) A service account key as a Hash2303 # * (`Google::Auth::Credentials`) A googleauth credentials object2304 # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))2305 # * (`Signet::OAuth2::Client`) A signet oauth2 client object2306 # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))2307 # * (`GRPC::Core::Channel`) a gRPC channel with included credentials2308 # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object2309 # * (`nil`) indicating no credentials2310 # @return [::Object]2311 # @!attribute [rw] scope2312 # The OAuth scopes2313 # @return [::Array<::String>]2314 # @!attribute [rw] lib_name2315 # The library name as recorded in instrumentation and logging2316 # @return [::String]2317 # @!attribute [rw] lib_version2318 # The library version as recorded in instrumentation and logging2319 # @return [::String]2320 # @!attribute [rw] channel_args2321 # Extra parameters passed to the gRPC channel. Note: this is ignored if a2322 # `GRPC::Core::Channel` object is provided as the credential.2323 # @return [::Hash]2324 # @!attribute [rw] interceptors2325 # An array of interceptors that are run before calls are executed.2326 # @return [::Array<::GRPC::ClientInterceptor>]2327 # @!attribute [rw] timeout2328 # The call timeout in seconds.2329 # @return [::Numeric]2330 # @!attribute [rw] metadata2331 # Additional gRPC headers to be sent with the call.2332 # @return [::Hash{::Symbol=>::String}]2333 # @!attribute [rw] retry_policy2334 # The retry policy. The value is a hash with the following keys:2335 # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.2336 # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.2337 # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.2338 # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should2339 # trigger a retry.2340 # @return [::Hash]2341 # @!attribute [rw] quota_project2342 # A separate project against which to charge quota.2343 # @return [::String]2344 #2345 class Configuration2346 extend ::Gapic::Config2347 config_attr :endpoint, "logging.googleapis.com", ::String2348 config_attr :credentials, nil do |value|2349 allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]2350 allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC2351 allowed.any? { |klass| klass === value }2352 end2353 config_attr :scope, nil, ::String, ::Array, nil2354 config_attr :lib_name, nil, ::String, nil2355 config_attr :lib_version, nil, ::String, nil2356 config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)2357 config_attr :interceptors, nil, ::Array, nil2358 config_attr :timeout, nil, ::Numeric, nil2359 config_attr :metadata, nil, ::Hash, nil2360 config_attr :retry_policy, nil, ::Hash, ::Proc, nil2361 config_attr :quota_project, nil, ::String, nil2362 # @private2363 def initialize parent_config = nil2364 @parent_config = parent_config unless parent_config.nil?2365 yield self if block_given?2366 end2367 ##2368 # Configurations for individual RPCs2369 # @return [Rpcs]2370 #2371 def rpcs2372 @rpcs ||= begin2373 parent_rpcs = nil2374 parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)2375 Rpcs.new parent_rpcs2376 end2377 end2378 ##2379 # Configuration RPC class for the ConfigService API.2380 #2381 # Includes fields providing the configuration for each RPC in this service.2382 # Each configuration object is of type `Gapic::Config::Method` and includes2383 # the following configuration fields:2384 #2385 # * `timeout` (*type:* `Numeric`) - The call timeout in seconds2386 # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers2387 # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields2388 # include the following keys:2389 # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.2390 # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.2391 # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.2392 # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should2393 # trigger a retry.2394 #2395 class Rpcs2396 ##2397 # RPC-specific configuration for `list_buckets`2398 # @return [::Gapic::Config::Method]2399 #...

Full Screen

Full Screen

call

Using AI Code Generation

copy

Full Screen

1Logging.new.call('Hello, World!')2 def call(message)3Logging.new.call('Hello, World!') do4 def call(message, &block)5Logging.new.call('Hello, World!') do6 def call(message, &block)7Logging.new.call('Hello, World!') do8 def call(message, &block)

Full Screen

Full Screen

call

Using AI Code Generation

copy

Full Screen

1logger.call("Hello World")2logger.call("Hello World")3logger.call("Hello World")4logger.call("Hello World")5logger.call("Hello World")

Full Screen

Full Screen

call

Using AI Code Generation

copy

Full Screen

1 def self.call(&block)2 File.open('log.txt', 'w') do |file|3 def self.call(&block)4 ActiveRecord::Base.logger = Logger.new(STDOUT)5 SQL (0.0ms) INSERT INTO `logs` (`message`) VALUES ('This is a message')6 SQL (0.0ms) INSERT INTO `logs` (`message`) VALUES ('This is another message')7 SQL (0.0ms) INSERT INTO `logs` (`message`) VALUES ('This is a message')8 SQL (0.0ms) INSERT INTO `logs` (`message`) VALUES ('This is another message')9 def self.call(&block)10 ActiveRecord::Base.establish_connection(

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Test-prof_ruby automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Most used method in

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful