kura 0.4.3 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2055945c222e4a141f646ffa69974eb97cd1ce26c5f7bf1910bb57044c573764
4
- data.tar.gz: b7118e38c616f8fc26c454230586647932b92a68661aece9c38a2bd915b7f430
3
+ metadata.gz: 74c035effdecfe9efbd8aac93065593f8250ad612f110d0aeef99e013209be27
4
+ data.tar.gz: 036f84aa09a18fc96668227d2c8379c8e404159e0da95994eaa7386ff5c235b9
5
5
  SHA512:
6
- metadata.gz: 51b8ebfccc735b923c577be770282e7af95ead82502ada51d228f541aa918f27fd8d2ae5b586f5ca55aaaf5e5a309b06a57f2c22b691e2806f102e1088faa0ce
7
- data.tar.gz: a0ec2909b094a50f3dbbb268e34ed9a78c030cfcd48c61c5c29c5699b9a9aac98579872dfc09050cfb12e92f9e29a4bd8a0ca7863548414c2ef8b0c800fcfb32
6
+ metadata.gz: 434f0ed22b2b34c19ca6f296db7130da225ba9a7b141a6d4c6f4e3a80ff5d119bd0271daeafda023daf7fa15eefd32db519ae05cd27e26b82f6babc96f207a42
7
+ data.tar.gz: 5fa5947df8551de2399bb8e48228dee99d62d73a8b3a941f6341a8c80944b9cdda9a83ff8fb1f95371271f25287248eaf57660e985e785094ce0ef660857721e
@@ -1,3 +1,9 @@
1
+ # 0.4.4
2
+
3
+ ## Enhancements
4
+
5
+ * Support [Routines API](https://cloud.google.com/bigquery/docs/reference/rest/v2/routines/).
6
+
1
7
  # 0.4.3
2
8
 
3
9
  ## Fixes
@@ -737,5 +737,72 @@ module Kura
737
737
  return nil if $!.respond_to?(:status_code) and $!.status_code == 404
738
738
  process_error($!)
739
739
  end
740
+
741
+ # Routines API
742
+ def routines(dataset_id, project_id: @default_project_id, limit: 1000, page_token: nil, &blk)
743
+ if blk
744
+ @api.list_routines(project_id, dataset_id, max_results: limit, page_token: page_token) do |result, err|
745
+ result &&= (result.routines || [])
746
+ blk.call(result, err)
747
+ end
748
+ else
749
+ @api.list_routines(project_id, dataset_id, max_results: limit, page_token: page_token)
750
+ end
751
+ rescue
752
+ process_error($!)
753
+ end
754
+
755
+ def routine(dataset_id, routine_id, project_id: @default_project_id, &blk)
756
+ if blk
757
+ @api.get_routine(project_id, dataset_id, routine_id) do |result, err|
758
+ if err.respond_to?(:status_code) and err.status_code == 404
759
+ result = nil
760
+ err = nil
761
+ end
762
+ blk.call(result, err)
763
+ end
764
+ else
765
+ @api.get_routine(project_id, dataset_id, routine_id)
766
+ end
767
+ rescue
768
+ return nil if $!.respond_to?(:status_code) and $!.status_code == 404
769
+ process_error($!)
770
+ end
771
+
772
+ def delete_routine(dataset_id, routine_id, project_id: @default_project_id, &blk)
773
+ @api.delete_routine(project_id, dataset_id, routine_id, &blk)
774
+ rescue
775
+ return nil if $!.respond_to?(:status_code) and $!.status_code == 404
776
+ process_error($!)
777
+ end
778
+
779
+ def insert_routine(dataset_id,
780
+ routine_id,
781
+ body,
782
+ project_id: @default_project_id,
783
+ routine_type: "PROCEDURE",
784
+ language: "SQL",
785
+ arguments: [],
786
+ return_type: nil,
787
+ imported_libraries: [],
788
+ description: nil)
789
+ @api.insert_routine(
790
+ project_id,
791
+ dataset_id,
792
+ Google::Apis::BigqueryV2::Routine.new(
793
+ routine_reference: Google::Apis::BigqueryV2::RoutineReference.new(
794
+ project_id: project_id,
795
+ dataset_id: dataset_id,
796
+ routine_id: routine_id
797
+ ),
798
+ arguments: arguments,
799
+ definition_body: body,
800
+ imported_libraries: imported_libraries,
801
+ language: language,
802
+ return_type: return_type,
803
+ routine_type: routine_type,
804
+ description: description
805
+ ))
806
+ end
740
807
  end
741
808
  end
@@ -1,3 +1,3 @@
1
1
  module Kura
2
- VERSION = "0.4.3"
2
+ VERSION = "0.4.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kura
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chikanaga Tomoyuki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-28 00:00:00.000000000 Z
11
+ date: 2020-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-api-client