google-cloud-logging-v2 0.1.3 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58e6c423e898ff8201ef87f8988e943fa0447ef0eb46842075ff76b62b04a417
4
- data.tar.gz: 6dc3d9fe8b3bd056902894d714d8483aef854f41e8b266c68845040534a0ed70
3
+ metadata.gz: 8a5b18c47d9df6eaf0d43a4f89ea4eec3ac43db7c5d3d9d859fac76616f02c7c
4
+ data.tar.gz: c920287b91f5d4504001bc968a6fedd1015f77aee4b48e7f9b63d566e4495676
5
5
  SHA512:
6
- metadata.gz: f25b16f10e1cb1d30a32ef92d3951202fbe4d64ac113dcbdc8ef37aa3d072be150e0277faf368494d1eabaa429518ef22ef8d24ff48ace12361e407b1d1c68fe
7
- data.tar.gz: 3d618969930974a5d5d7130180e7424bb6c246450070121edc1b133656f96bd65810e5a1bf5f4e8851436eb3ae2d6dc0161e7eac3d8f8703499099aa2712ebce
6
+ metadata.gz: 0bbde3376f1a65bf40cbdf8ac94b70a848d370176ad7c0e987c873a62dbdd3c43d8bd6d97ee835ef008d8022905822f8a0682cd577c03a18752aeee552ab1cbe
7
+ data.tar.gz: a7d3bfd943e9ab7df3858d8dd0e92b7fd178ec6542c1f15e0a00da9c2765a88edbd7d2bd843741b20f8694c6068e1b6d109a4ee8c64ad971d436048993239bd9
@@ -207,7 +207,7 @@ module Google
207
207
  # Service calls
208
208
 
209
209
  ##
210
- # Lists buckets (Beta).
210
+ # Lists buckets.
211
211
  #
212
212
  # @overload list_buckets(request, options = nil)
213
213
  # Pass arguments to `list_buckets` via a request object, either of type
@@ -292,7 +292,7 @@ module Google
292
292
  end
293
293
 
294
294
  ##
295
- # Gets a bucket (Beta).
295
+ # Gets a bucket.
296
296
  #
297
297
  # @overload get_bucket(request, options = nil)
298
298
  # Pass arguments to `get_bucket` via a request object, either of type
@@ -365,6 +365,85 @@ module Google
365
365
  raise ::Google::Cloud::Error.from_error(e)
366
366
  end
367
367
 
368
+ ##
369
+ # Creates a bucket that can be used to store log entries. Once a bucket has
370
+ # been created, the region cannot be changed.
371
+ #
372
+ # @overload create_bucket(request, options = nil)
373
+ # Pass arguments to `create_bucket` via a request object, either of type
374
+ # {::Google::Cloud::Logging::V2::CreateBucketRequest} or an equivalent Hash.
375
+ #
376
+ # @param request [::Google::Cloud::Logging::V2::CreateBucketRequest, ::Hash]
377
+ # A request object representing the call parameters. Required. To specify no
378
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
379
+ # @param options [::Gapic::CallOptions, ::Hash]
380
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
381
+ #
382
+ # @overload create_bucket(parent: nil, bucket_id: nil, bucket: nil)
383
+ # Pass arguments to `create_bucket` via keyword arguments. Note that at
384
+ # least one keyword argument is required. To specify no parameters, or to keep all
385
+ # the default parameter values, pass an empty Hash as a request object (see above).
386
+ #
387
+ # @param parent [::String]
388
+ # Required. The resource in which to create the bucket:
389
+ #
390
+ # "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
391
+ #
392
+ # Example: `"projects/my-logging-project/locations/global"`
393
+ # @param bucket_id [::String]
394
+ # Required. A client-assigned identifier such as `"my-bucket"`. Identifiers are
395
+ # limited to 100 characters and can include only letters, digits,
396
+ # underscores, hyphens, and periods.
397
+ # @param bucket [::Google::Cloud::Logging::V2::LogBucket, ::Hash]
398
+ # Required. The new bucket. The region specified in the new bucket must be compliant
399
+ # with any Location Restriction Org Policy. The name field in the bucket is
400
+ # ignored.
401
+ #
402
+ # @yield [response, operation] Access the result along with the RPC operation
403
+ # @yieldparam response [::Google::Cloud::Logging::V2::LogBucket]
404
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
405
+ #
406
+ # @return [::Google::Cloud::Logging::V2::LogBucket]
407
+ #
408
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
409
+ #
410
+ def create_bucket request, options = nil
411
+ raise ::ArgumentError, "request must be provided" if request.nil?
412
+
413
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::CreateBucketRequest
414
+
415
+ # Converts hash and nil to an options object
416
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
417
+
418
+ # Customize the options with defaults
419
+ metadata = @config.rpcs.create_bucket.metadata.to_h
420
+
421
+ # Set x-goog-api-client and x-goog-user-project headers
422
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
423
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
424
+ gapic_version: ::Google::Cloud::Logging::V2::VERSION
425
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
426
+
427
+ header_params = {
428
+ "parent" => request.parent
429
+ }
430
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
431
+ metadata[:"x-goog-request-params"] ||= request_params_header
432
+
433
+ options.apply_defaults timeout: @config.rpcs.create_bucket.timeout,
434
+ metadata: metadata,
435
+ retry_policy: @config.rpcs.create_bucket.retry_policy
436
+ options.apply_defaults metadata: @config.metadata,
437
+ retry_policy: @config.retry_policy
438
+
439
+ @config_service_stub.call_rpc :create_bucket, request, options: options do |response, operation|
440
+ yield response, operation if block_given?
441
+ return response
442
+ end
443
+ rescue ::GRPC::BadStatus => e
444
+ raise ::Google::Cloud::Error.from_error(e)
445
+ end
446
+
368
447
  ##
369
448
  # Updates a bucket. This method replaces the following fields in the
370
449
  # existing bucket with values from the new bucket: `retention_period`
@@ -376,7 +455,6 @@ module Google
376
455
  # will be returned.
377
456
  #
378
457
  # A buckets region may not be modified after it is created.
379
- # This method is in Beta.
380
458
  #
381
459
  # @overload update_bucket(request, options = nil)
382
460
  # Pass arguments to `update_bucket` via a request object, either of type
@@ -462,6 +540,537 @@ module Google
462
540
  raise ::Google::Cloud::Error.from_error(e)
463
541
  end
464
542
 
543
+ ##
544
+ # Deletes a bucket.
545
+ # Moves the bucket to the DELETE_REQUESTED state. After 7 days, the
546
+ # bucket will be purged and all logs in the bucket will be permanently
547
+ # deleted.
548
+ #
549
+ # @overload delete_bucket(request, options = nil)
550
+ # Pass arguments to `delete_bucket` via a request object, either of type
551
+ # {::Google::Cloud::Logging::V2::DeleteBucketRequest} or an equivalent Hash.
552
+ #
553
+ # @param request [::Google::Cloud::Logging::V2::DeleteBucketRequest, ::Hash]
554
+ # A request object representing the call parameters. Required. To specify no
555
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
556
+ # @param options [::Gapic::CallOptions, ::Hash]
557
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
558
+ #
559
+ # @overload delete_bucket(name: nil)
560
+ # Pass arguments to `delete_bucket` via keyword arguments. Note that at
561
+ # least one keyword argument is required. To specify no parameters, or to keep all
562
+ # the default parameter values, pass an empty Hash as a request object (see above).
563
+ #
564
+ # @param name [::String]
565
+ # Required. The full resource name of the bucket to delete.
566
+ #
567
+ # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
568
+ # "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
569
+ # "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
570
+ # "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
571
+ #
572
+ # Example:
573
+ # `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`.
574
+ #
575
+ # @yield [response, operation] Access the result along with the RPC operation
576
+ # @yieldparam response [::Google::Protobuf::Empty]
577
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
578
+ #
579
+ # @return [::Google::Protobuf::Empty]
580
+ #
581
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
582
+ #
583
+ def delete_bucket request, options = nil
584
+ raise ::ArgumentError, "request must be provided" if request.nil?
585
+
586
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::DeleteBucketRequest
587
+
588
+ # Converts hash and nil to an options object
589
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
590
+
591
+ # Customize the options with defaults
592
+ metadata = @config.rpcs.delete_bucket.metadata.to_h
593
+
594
+ # Set x-goog-api-client and x-goog-user-project headers
595
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
596
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
597
+ gapic_version: ::Google::Cloud::Logging::V2::VERSION
598
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
599
+
600
+ header_params = {
601
+ "name" => request.name
602
+ }
603
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
604
+ metadata[:"x-goog-request-params"] ||= request_params_header
605
+
606
+ options.apply_defaults timeout: @config.rpcs.delete_bucket.timeout,
607
+ metadata: metadata,
608
+ retry_policy: @config.rpcs.delete_bucket.retry_policy
609
+ options.apply_defaults metadata: @config.metadata,
610
+ retry_policy: @config.retry_policy
611
+
612
+ @config_service_stub.call_rpc :delete_bucket, request, options: options do |response, operation|
613
+ yield response, operation if block_given?
614
+ return response
615
+ end
616
+ rescue ::GRPC::BadStatus => e
617
+ raise ::Google::Cloud::Error.from_error(e)
618
+ end
619
+
620
+ ##
621
+ # Undeletes a bucket. A bucket that has been deleted may be undeleted within
622
+ # the grace period of 7 days.
623
+ #
624
+ # @overload undelete_bucket(request, options = nil)
625
+ # Pass arguments to `undelete_bucket` via a request object, either of type
626
+ # {::Google::Cloud::Logging::V2::UndeleteBucketRequest} or an equivalent Hash.
627
+ #
628
+ # @param request [::Google::Cloud::Logging::V2::UndeleteBucketRequest, ::Hash]
629
+ # A request object representing the call parameters. Required. To specify no
630
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
631
+ # @param options [::Gapic::CallOptions, ::Hash]
632
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
633
+ #
634
+ # @overload undelete_bucket(name: nil)
635
+ # Pass arguments to `undelete_bucket` via keyword arguments. Note that at
636
+ # least one keyword argument is required. To specify no parameters, or to keep all
637
+ # the default parameter values, pass an empty Hash as a request object (see above).
638
+ #
639
+ # @param name [::String]
640
+ # Required. The full resource name of the bucket to undelete.
641
+ #
642
+ # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
643
+ # "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
644
+ # "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
645
+ # "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
646
+ #
647
+ # Example:
648
+ # `"projects/my-project-id/locations/my-location/buckets/my-bucket-id"`.
649
+ #
650
+ # @yield [response, operation] Access the result along with the RPC operation
651
+ # @yieldparam response [::Google::Protobuf::Empty]
652
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
653
+ #
654
+ # @return [::Google::Protobuf::Empty]
655
+ #
656
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
657
+ #
658
+ def undelete_bucket request, options = nil
659
+ raise ::ArgumentError, "request must be provided" if request.nil?
660
+
661
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::UndeleteBucketRequest
662
+
663
+ # Converts hash and nil to an options object
664
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
665
+
666
+ # Customize the options with defaults
667
+ metadata = @config.rpcs.undelete_bucket.metadata.to_h
668
+
669
+ # Set x-goog-api-client and x-goog-user-project headers
670
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
671
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
672
+ gapic_version: ::Google::Cloud::Logging::V2::VERSION
673
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
674
+
675
+ header_params = {
676
+ "name" => request.name
677
+ }
678
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
679
+ metadata[:"x-goog-request-params"] ||= request_params_header
680
+
681
+ options.apply_defaults timeout: @config.rpcs.undelete_bucket.timeout,
682
+ metadata: metadata,
683
+ retry_policy: @config.rpcs.undelete_bucket.retry_policy
684
+ options.apply_defaults metadata: @config.metadata,
685
+ retry_policy: @config.retry_policy
686
+
687
+ @config_service_stub.call_rpc :undelete_bucket, request, options: options do |response, operation|
688
+ yield response, operation if block_given?
689
+ return response
690
+ end
691
+ rescue ::GRPC::BadStatus => e
692
+ raise ::Google::Cloud::Error.from_error(e)
693
+ end
694
+
695
+ ##
696
+ # Lists views on a bucket.
697
+ #
698
+ # @overload list_views(request, options = nil)
699
+ # Pass arguments to `list_views` via a request object, either of type
700
+ # {::Google::Cloud::Logging::V2::ListViewsRequest} or an equivalent Hash.
701
+ #
702
+ # @param request [::Google::Cloud::Logging::V2::ListViewsRequest, ::Hash]
703
+ # A request object representing the call parameters. Required. To specify no
704
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
705
+ # @param options [::Gapic::CallOptions, ::Hash]
706
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
707
+ #
708
+ # @overload list_views(parent: nil, page_token: nil, page_size: nil)
709
+ # Pass arguments to `list_views` via keyword arguments. Note that at
710
+ # least one keyword argument is required. To specify no parameters, or to keep all
711
+ # the default parameter values, pass an empty Hash as a request object (see above).
712
+ #
713
+ # @param parent [::String]
714
+ # Required. The bucket whose views are to be listed:
715
+ #
716
+ # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
717
+ # @param page_token [::String]
718
+ # Optional. If present, then retrieve the next batch of results from the
719
+ # preceding call to this method. `pageToken` must be the value of
720
+ # `nextPageToken` from the previous response. The values of other method
721
+ # parameters should be identical to those in the previous call.
722
+ # @param page_size [::Integer]
723
+ # Optional. The maximum number of results to return from this request.
724
+ # Non-positive values are ignored. The presence of `nextPageToken` in the
725
+ # response indicates that more results might be available.
726
+ #
727
+ # @yield [response, operation] Access the result along with the RPC operation
728
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogView>]
729
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
730
+ #
731
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogView>]
732
+ #
733
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
734
+ #
735
+ def list_views request, options = nil
736
+ raise ::ArgumentError, "request must be provided" if request.nil?
737
+
738
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::ListViewsRequest
739
+
740
+ # Converts hash and nil to an options object
741
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
742
+
743
+ # Customize the options with defaults
744
+ metadata = @config.rpcs.list_views.metadata.to_h
745
+
746
+ # Set x-goog-api-client and x-goog-user-project headers
747
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
748
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
749
+ gapic_version: ::Google::Cloud::Logging::V2::VERSION
750
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
751
+
752
+ header_params = {
753
+ "parent" => request.parent
754
+ }
755
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
756
+ metadata[:"x-goog-request-params"] ||= request_params_header
757
+
758
+ options.apply_defaults timeout: @config.rpcs.list_views.timeout,
759
+ metadata: metadata,
760
+ retry_policy: @config.rpcs.list_views.retry_policy
761
+ options.apply_defaults metadata: @config.metadata,
762
+ retry_policy: @config.retry_policy
763
+
764
+ @config_service_stub.call_rpc :list_views, request, options: options do |response, operation|
765
+ response = ::Gapic::PagedEnumerable.new @config_service_stub, :list_views, request, response, operation, options
766
+ yield response, operation if block_given?
767
+ return response
768
+ end
769
+ rescue ::GRPC::BadStatus => e
770
+ raise ::Google::Cloud::Error.from_error(e)
771
+ end
772
+
773
+ ##
774
+ # Gets a view.
775
+ #
776
+ # @overload get_view(request, options = nil)
777
+ # Pass arguments to `get_view` via a request object, either of type
778
+ # {::Google::Cloud::Logging::V2::GetViewRequest} or an equivalent Hash.
779
+ #
780
+ # @param request [::Google::Cloud::Logging::V2::GetViewRequest, ::Hash]
781
+ # A request object representing the call parameters. Required. To specify no
782
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
783
+ # @param options [::Gapic::CallOptions, ::Hash]
784
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
785
+ #
786
+ # @overload get_view(name: nil)
787
+ # Pass arguments to `get_view` via keyword arguments. Note that at
788
+ # least one keyword argument is required. To specify no parameters, or to keep all
789
+ # the default parameter values, pass an empty Hash as a request object (see above).
790
+ #
791
+ # @param name [::String]
792
+ # Required. The resource name of the policy:
793
+ #
794
+ # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
795
+ #
796
+ # Example:
797
+ # `"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id"`.
798
+ #
799
+ # @yield [response, operation] Access the result along with the RPC operation
800
+ # @yieldparam response [::Google::Cloud::Logging::V2::LogView]
801
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
802
+ #
803
+ # @return [::Google::Cloud::Logging::V2::LogView]
804
+ #
805
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
806
+ #
807
+ def get_view request, options = nil
808
+ raise ::ArgumentError, "request must be provided" if request.nil?
809
+
810
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::GetViewRequest
811
+
812
+ # Converts hash and nil to an options object
813
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
814
+
815
+ # Customize the options with defaults
816
+ metadata = @config.rpcs.get_view.metadata.to_h
817
+
818
+ # Set x-goog-api-client and x-goog-user-project headers
819
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
820
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
821
+ gapic_version: ::Google::Cloud::Logging::V2::VERSION
822
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
823
+
824
+ header_params = {
825
+ "name" => request.name
826
+ }
827
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
828
+ metadata[:"x-goog-request-params"] ||= request_params_header
829
+
830
+ options.apply_defaults timeout: @config.rpcs.get_view.timeout,
831
+ metadata: metadata,
832
+ retry_policy: @config.rpcs.get_view.retry_policy
833
+ options.apply_defaults metadata: @config.metadata,
834
+ retry_policy: @config.retry_policy
835
+
836
+ @config_service_stub.call_rpc :get_view, request, options: options do |response, operation|
837
+ yield response, operation if block_given?
838
+ return response
839
+ end
840
+ rescue ::GRPC::BadStatus => e
841
+ raise ::Google::Cloud::Error.from_error(e)
842
+ end
843
+
844
+ ##
845
+ # Creates a view over logs in a bucket. A bucket may contain a maximum of
846
+ # 50 views.
847
+ #
848
+ # @overload create_view(request, options = nil)
849
+ # Pass arguments to `create_view` via a request object, either of type
850
+ # {::Google::Cloud::Logging::V2::CreateViewRequest} or an equivalent Hash.
851
+ #
852
+ # @param request [::Google::Cloud::Logging::V2::CreateViewRequest, ::Hash]
853
+ # A request object representing the call parameters. Required. To specify no
854
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
855
+ # @param options [::Gapic::CallOptions, ::Hash]
856
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
857
+ #
858
+ # @overload create_view(parent: nil, view_id: nil, view: nil)
859
+ # Pass arguments to `create_view` via keyword arguments. Note that at
860
+ # least one keyword argument is required. To specify no parameters, or to keep all
861
+ # the default parameter values, pass an empty Hash as a request object (see above).
862
+ #
863
+ # @param parent [::String]
864
+ # Required. The bucket in which to create the view
865
+ #
866
+ # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
867
+ #
868
+ # Example:
869
+ # `"projects/my-logging-project/locations/my-location/buckets/my-bucket"`
870
+ # @param view_id [::String]
871
+ # Required. The id to use for this view.
872
+ # @param view [::Google::Cloud::Logging::V2::LogView, ::Hash]
873
+ # Required. The new view.
874
+ #
875
+ # @yield [response, operation] Access the result along with the RPC operation
876
+ # @yieldparam response [::Google::Cloud::Logging::V2::LogView]
877
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
878
+ #
879
+ # @return [::Google::Cloud::Logging::V2::LogView]
880
+ #
881
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
882
+ #
883
+ def create_view request, options = nil
884
+ raise ::ArgumentError, "request must be provided" if request.nil?
885
+
886
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::CreateViewRequest
887
+
888
+ # Converts hash and nil to an options object
889
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
890
+
891
+ # Customize the options with defaults
892
+ metadata = @config.rpcs.create_view.metadata.to_h
893
+
894
+ # Set x-goog-api-client and x-goog-user-project headers
895
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
896
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
897
+ gapic_version: ::Google::Cloud::Logging::V2::VERSION
898
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
899
+
900
+ header_params = {
901
+ "parent" => request.parent
902
+ }
903
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
904
+ metadata[:"x-goog-request-params"] ||= request_params_header
905
+
906
+ options.apply_defaults timeout: @config.rpcs.create_view.timeout,
907
+ metadata: metadata,
908
+ retry_policy: @config.rpcs.create_view.retry_policy
909
+ options.apply_defaults metadata: @config.metadata,
910
+ retry_policy: @config.retry_policy
911
+
912
+ @config_service_stub.call_rpc :create_view, request, options: options do |response, operation|
913
+ yield response, operation if block_given?
914
+ return response
915
+ end
916
+ rescue ::GRPC::BadStatus => e
917
+ raise ::Google::Cloud::Error.from_error(e)
918
+ end
919
+
920
+ ##
921
+ # Updates a view. This method replaces the following fields in the existing
922
+ # view with values from the new view: `filter`.
923
+ #
924
+ # @overload update_view(request, options = nil)
925
+ # Pass arguments to `update_view` via a request object, either of type
926
+ # {::Google::Cloud::Logging::V2::UpdateViewRequest} or an equivalent Hash.
927
+ #
928
+ # @param request [::Google::Cloud::Logging::V2::UpdateViewRequest, ::Hash]
929
+ # A request object representing the call parameters. Required. To specify no
930
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
931
+ # @param options [::Gapic::CallOptions, ::Hash]
932
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
933
+ #
934
+ # @overload update_view(name: nil, view: nil, update_mask: nil)
935
+ # Pass arguments to `update_view` via keyword arguments. Note that at
936
+ # least one keyword argument is required. To specify no parameters, or to keep all
937
+ # the default parameter values, pass an empty Hash as a request object (see above).
938
+ #
939
+ # @param name [::String]
940
+ # Required. The full resource name of the view to update
941
+ #
942
+ # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
943
+ #
944
+ # Example:
945
+ # `"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id"`.
946
+ # @param view [::Google::Cloud::Logging::V2::LogView, ::Hash]
947
+ # Required. The updated view.
948
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
949
+ # Optional. Field mask that specifies the fields in `view` that need
950
+ # an update. A field will be overwritten if, and only if, it is
951
+ # in the update mask. `name` and output only fields cannot be updated.
952
+ #
953
+ # For a detailed `FieldMask` definition, see
954
+ # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
955
+ #
956
+ # Example: `updateMask=filter`.
957
+ #
958
+ # @yield [response, operation] Access the result along with the RPC operation
959
+ # @yieldparam response [::Google::Cloud::Logging::V2::LogView]
960
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
961
+ #
962
+ # @return [::Google::Cloud::Logging::V2::LogView]
963
+ #
964
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
965
+ #
966
+ def update_view request, options = nil
967
+ raise ::ArgumentError, "request must be provided" if request.nil?
968
+
969
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::UpdateViewRequest
970
+
971
+ # Converts hash and nil to an options object
972
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
973
+
974
+ # Customize the options with defaults
975
+ metadata = @config.rpcs.update_view.metadata.to_h
976
+
977
+ # Set x-goog-api-client and x-goog-user-project headers
978
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
979
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
980
+ gapic_version: ::Google::Cloud::Logging::V2::VERSION
981
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
982
+
983
+ header_params = {
984
+ "name" => request.name
985
+ }
986
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
987
+ metadata[:"x-goog-request-params"] ||= request_params_header
988
+
989
+ options.apply_defaults timeout: @config.rpcs.update_view.timeout,
990
+ metadata: metadata,
991
+ retry_policy: @config.rpcs.update_view.retry_policy
992
+ options.apply_defaults metadata: @config.metadata,
993
+ retry_policy: @config.retry_policy
994
+
995
+ @config_service_stub.call_rpc :update_view, request, options: options do |response, operation|
996
+ yield response, operation if block_given?
997
+ return response
998
+ end
999
+ rescue ::GRPC::BadStatus => e
1000
+ raise ::Google::Cloud::Error.from_error(e)
1001
+ end
1002
+
1003
+ ##
1004
+ # Deletes a view from a bucket.
1005
+ #
1006
+ # @overload delete_view(request, options = nil)
1007
+ # Pass arguments to `delete_view` via a request object, either of type
1008
+ # {::Google::Cloud::Logging::V2::DeleteViewRequest} or an equivalent Hash.
1009
+ #
1010
+ # @param request [::Google::Cloud::Logging::V2::DeleteViewRequest, ::Hash]
1011
+ # A request object representing the call parameters. Required. To specify no
1012
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1013
+ # @param options [::Gapic::CallOptions, ::Hash]
1014
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1015
+ #
1016
+ # @overload delete_view(name: nil)
1017
+ # Pass arguments to `delete_view` via keyword arguments. Note that at
1018
+ # least one keyword argument is required. To specify no parameters, or to keep all
1019
+ # the default parameter values, pass an empty Hash as a request object (see above).
1020
+ #
1021
+ # @param name [::String]
1022
+ # Required. The full resource name of the view to delete:
1023
+ #
1024
+ # "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
1025
+ #
1026
+ # Example:
1027
+ # `"projects/my-project-id/locations/my-location/buckets/my-bucket-id/views/my-view-id"`.
1028
+ #
1029
+ # @yield [response, operation] Access the result along with the RPC operation
1030
+ # @yieldparam response [::Google::Protobuf::Empty]
1031
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1032
+ #
1033
+ # @return [::Google::Protobuf::Empty]
1034
+ #
1035
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1036
+ #
1037
+ def delete_view request, options = nil
1038
+ raise ::ArgumentError, "request must be provided" if request.nil?
1039
+
1040
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::DeleteViewRequest
1041
+
1042
+ # Converts hash and nil to an options object
1043
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1044
+
1045
+ # Customize the options with defaults
1046
+ metadata = @config.rpcs.delete_view.metadata.to_h
1047
+
1048
+ # Set x-goog-api-client and x-goog-user-project headers
1049
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1050
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1051
+ gapic_version: ::Google::Cloud::Logging::V2::VERSION
1052
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1053
+
1054
+ header_params = {
1055
+ "name" => request.name
1056
+ }
1057
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1058
+ metadata[:"x-goog-request-params"] ||= request_params_header
1059
+
1060
+ options.apply_defaults timeout: @config.rpcs.delete_view.timeout,
1061
+ metadata: metadata,
1062
+ retry_policy: @config.rpcs.delete_view.retry_policy
1063
+ options.apply_defaults metadata: @config.metadata,
1064
+ retry_policy: @config.retry_policy
1065
+
1066
+ @config_service_stub.call_rpc :delete_view, request, options: options do |response, operation|
1067
+ yield response, operation if block_given?
1068
+ return response
1069
+ end
1070
+ rescue ::GRPC::BadStatus => e
1071
+ raise ::Google::Cloud::Error.from_error(e)
1072
+ end
1073
+
465
1074
  ##
466
1075
  # Lists sinks.
467
1076
  #
@@ -1616,11 +2225,51 @@ module Google
1616
2225
  #
1617
2226
  attr_reader :get_bucket
1618
2227
  ##
2228
+ # RPC-specific configuration for `create_bucket`
2229
+ # @return [::Gapic::Config::Method]
2230
+ #
2231
+ attr_reader :create_bucket
2232
+ ##
1619
2233
  # RPC-specific configuration for `update_bucket`
1620
2234
  # @return [::Gapic::Config::Method]
1621
2235
  #
1622
2236
  attr_reader :update_bucket
1623
2237
  ##
2238
+ # RPC-specific configuration for `delete_bucket`
2239
+ # @return [::Gapic::Config::Method]
2240
+ #
2241
+ attr_reader :delete_bucket
2242
+ ##
2243
+ # RPC-specific configuration for `undelete_bucket`
2244
+ # @return [::Gapic::Config::Method]
2245
+ #
2246
+ attr_reader :undelete_bucket
2247
+ ##
2248
+ # RPC-specific configuration for `list_views`
2249
+ # @return [::Gapic::Config::Method]
2250
+ #
2251
+ attr_reader :list_views
2252
+ ##
2253
+ # RPC-specific configuration for `get_view`
2254
+ # @return [::Gapic::Config::Method]
2255
+ #
2256
+ attr_reader :get_view
2257
+ ##
2258
+ # RPC-specific configuration for `create_view`
2259
+ # @return [::Gapic::Config::Method]
2260
+ #
2261
+ attr_reader :create_view
2262
+ ##
2263
+ # RPC-specific configuration for `update_view`
2264
+ # @return [::Gapic::Config::Method]
2265
+ #
2266
+ attr_reader :update_view
2267
+ ##
2268
+ # RPC-specific configuration for `delete_view`
2269
+ # @return [::Gapic::Config::Method]
2270
+ #
2271
+ attr_reader :delete_view
2272
+ ##
1624
2273
  # RPC-specific configuration for `list_sinks`
1625
2274
  # @return [::Gapic::Config::Method]
1626
2275
  #
@@ -1687,8 +2336,24 @@ module Google
1687
2336
  @list_buckets = ::Gapic::Config::Method.new list_buckets_config
1688
2337
  get_bucket_config = parent_rpcs&.get_bucket if parent_rpcs&.respond_to? :get_bucket
1689
2338
  @get_bucket = ::Gapic::Config::Method.new get_bucket_config
2339
+ create_bucket_config = parent_rpcs&.create_bucket if parent_rpcs&.respond_to? :create_bucket
2340
+ @create_bucket = ::Gapic::Config::Method.new create_bucket_config
1690
2341
  update_bucket_config = parent_rpcs&.update_bucket if parent_rpcs&.respond_to? :update_bucket
1691
2342
  @update_bucket = ::Gapic::Config::Method.new update_bucket_config
2343
+ delete_bucket_config = parent_rpcs&.delete_bucket if parent_rpcs&.respond_to? :delete_bucket
2344
+ @delete_bucket = ::Gapic::Config::Method.new delete_bucket_config
2345
+ undelete_bucket_config = parent_rpcs&.undelete_bucket if parent_rpcs&.respond_to? :undelete_bucket
2346
+ @undelete_bucket = ::Gapic::Config::Method.new undelete_bucket_config
2347
+ list_views_config = parent_rpcs&.list_views if parent_rpcs&.respond_to? :list_views
2348
+ @list_views = ::Gapic::Config::Method.new list_views_config
2349
+ get_view_config = parent_rpcs&.get_view if parent_rpcs&.respond_to? :get_view
2350
+ @get_view = ::Gapic::Config::Method.new get_view_config
2351
+ create_view_config = parent_rpcs&.create_view if parent_rpcs&.respond_to? :create_view
2352
+ @create_view = ::Gapic::Config::Method.new create_view_config
2353
+ update_view_config = parent_rpcs&.update_view if parent_rpcs&.respond_to? :update_view
2354
+ @update_view = ::Gapic::Config::Method.new update_view_config
2355
+ delete_view_config = parent_rpcs&.delete_view if parent_rpcs&.respond_to? :delete_view
2356
+ @delete_view = ::Gapic::Config::Method.new delete_view_config
1692
2357
  list_sinks_config = parent_rpcs&.list_sinks if parent_rpcs&.respond_to? :list_sinks
1693
2358
  @list_sinks = ::Gapic::Config::Method.new list_sinks_config
1694
2359
  get_sink_config = parent_rpcs&.get_sink if parent_rpcs&.respond_to? :get_sink