gapic-common 0.0.2 → 0.3.1

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: 61e9f5126acf2882c769d5c5b938f76b6a43b8d275d715346c504242519a8c5f
4
- data.tar.gz: 5f4e2867a87dbaa3290564a80a4fd1e8b3312b8b8ebef715a715edcf32390dca
3
+ metadata.gz: 0b273a9734d7790746ebdd37a36fe67e7cd8d02d595ef98ece290f1659836c84
4
+ data.tar.gz: ecbf4561705eb6dcb260562c452dbb2f13ac803c08ea7b6df17ee811fa010a87
5
5
  SHA512:
6
- metadata.gz: 1f1fa01e04b526fac3077987b1972bdcb63587824a8ad9b8c4c592c1823e282755c0e4dae80a76a3c61e1155679d9e50a70789d75c22062776f67d9c1dc2a32d
7
- data.tar.gz: 89d78dd488b0ac40d8e6475c9cd8bb024d454d3b20d9a704c118b2e1da84ddd6d4c1c60f463682fc81949f6b232c6baad7ee960832628308037d7d7022202ed4
6
+ metadata.gz: 33dd83d1eafc82dd3fe79340e3780bbffd228e5373cd3f1c5ce28adea3c76896638e54a71e0a95a7de275d654460b1fc719766429f8d533b0849dbee57ccc9a1
7
+ data.tar.gz: b0094f935d8109734023d21c97f8d7436d8cc456a5882fe67ce1fc8f32ebf6643438dac8a14a90f7e14e772d0afe15fba31eae46535e9041eb6e6b58965060e1
@@ -1,2 +1,22 @@
1
1
  # Release History
2
2
 
3
+ ### 0.3.1 / 2020-06-19
4
+
5
+ * Fix file permissions
6
+
7
+ ### 0.3.0 / 2020-06-18
8
+
9
+ * Update the dependency on google-protobuf to 3.12.2
10
+
11
+ ### 0.2.1 / 2020-06-02
12
+
13
+ * Fix a crash when resetting a config field to nil when it has a parent but no default
14
+
15
+ ### 0.2.0 / 2020-03-17
16
+
17
+ * Support default call options in Gapic::Operation
18
+ * Fix implicit kwarg warnings under Ruby 2.7
19
+
20
+ ### 0.1.0 / 2020-01-09
21
+
22
+ Initial release
@@ -42,7 +42,7 @@ module Gapic
42
42
  #
43
43
  def initialize timeout: nil, metadata: nil, retry_policy: nil
44
44
  # Converts hash and nil to a policy object
45
- retry_policy = RetryPolicy.new retry_policy.to_h if retry_policy.respond_to? :to_h
45
+ retry_policy = RetryPolicy.new(**retry_policy.to_h) if retry_policy.respond_to? :to_h
46
46
 
47
47
  @timeout = timeout # allow to be nil so it can be overridden
48
48
  @metadata = metadata.to_h # Ensure always hash, even for nil
@@ -64,5 +64,13 @@ module Gapic
64
64
  @metadata = metadata.merge @metadata if metadata
65
65
  @retry_policy.apply_defaults retry_policy if @retry_policy.respond_to? :apply_defaults
66
66
  end
67
+
68
+ def to_h
69
+ {
70
+ timeout: timeout,
71
+ metadata: metadata,
72
+ retry_policy: retry_policy
73
+ }
74
+ end
67
75
  end
68
76
  end
@@ -14,6 +14,6 @@
14
14
 
15
15
  module Gapic
16
16
  module Common
17
- VERSION = "0.0.2".freeze
17
+ VERSION = "0.3.1".freeze
18
18
  end
19
19
  end
@@ -88,7 +88,7 @@ module Gapic
88
88
  valid_value ||= begin
89
89
  # Allow nil if parent config has the getter method.
90
90
  parent = instance_variable_get :@parent_config if instance_variable_defined? :@parent_config
91
- parent&.respond_to? name
91
+ parent&.respond_to? name_setter
92
92
  end
93
93
  end
94
94
  raise ArgumentError unless valid_value
@@ -112,7 +112,7 @@ module Gapic
112
112
  #
113
113
  def call request, options: nil
114
114
  # Converts hash and nil to an options object
115
- options = Gapic::CallOptions.new options.to_h if options.respond_to? :to_h
115
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
116
116
  deadline = calculate_deadline options
117
117
  metadata = options.metadata
118
118
 
@@ -83,13 +83,15 @@ module Gapic
83
83
  # looked up. Optional.
84
84
  # @param metadata_type [Class] The class type to be unpacked from the metadata. If not provided the class type
85
85
  # will be looked up. Optional.
86
+ # @param options [Gapic::CallOptions] call options for this operation
86
87
  #
87
- def initialize grpc_op, client, result_type: nil, metadata_type: nil
88
+ def initialize grpc_op, client, result_type: nil, metadata_type: nil, options: {}
88
89
  @grpc_op = grpc_op
89
90
  @client = client
90
91
  @result_type = result_type
91
92
  @metadata_type = metadata_type
92
93
  @on_done_callbacks = []
94
+ @options = options
93
95
  end
94
96
 
95
97
  ##
@@ -196,7 +198,7 @@ module Gapic
196
198
  #
197
199
  def cancel options: nil
198
200
  # Converts hash and nil to an options object
199
- options = Gapic::CallOptions.new options.to_h if options.respond_to? :to_h
201
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
200
202
 
201
203
  @client.cancel_operation({ name: @grpc_op.name }, options)
202
204
  end
@@ -209,7 +211,7 @@ module Gapic
209
211
  #
210
212
  def delete options: nil
211
213
  # Converts hash and nil to an options object
212
- options = Gapic::CallOptions.new options.to_h if options.respond_to? :to_h
214
+ options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
213
215
 
214
216
  @client.delete_operation({ name: @grpc_op.name }, options)
215
217
  end
@@ -223,9 +225,12 @@ module Gapic
223
225
  # @return [Gapic::Operation] Since this method changes internal state, it returns itself.
224
226
  #
225
227
  def reload! options: nil
226
- # Converts hash and nil to an options object
227
- options = Gapic::CallOptions.new options.to_h if options.respond_to? :to_h
228
-
228
+ options = if options.respond_to? :to_h
229
+ options.to_h.merge @options.to_h
230
+ else
231
+ @options.to_h
232
+ end
233
+ options = Gapic::CallOptions.new(**options)
229
234
  gax_op = @client.get_operation({ name: @grpc_op.name }, options)
230
235
  @grpc_op = gax_op.grpc_op
231
236
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gapic-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google API Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-27 00:00:00.000000000 Z
11
+ date: 2020-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -16,14 +16,20 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '3.2'
19
+ version: '3.12'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 3.12.2
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
27
  - - "~>"
25
28
  - !ruby/object:Gem::Version
26
- version: '3.2'
29
+ version: '3.12'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 3.12.2
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: googleapis-common-protos
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -98,14 +104,14 @@ dependencies:
98
104
  requirements:
99
105
  - - "~>"
100
106
  - !ruby/object:Gem::Version
101
- version: '1.1'
107
+ version: '1.5'
102
108
  type: :development
103
109
  prerelease: false
104
110
  version_requirements: !ruby/object:Gem::Requirement
105
111
  requirements:
106
112
  - - "~>"
107
113
  - !ruby/object:Gem::Version
108
- version: '1.1'
114
+ version: '1.5'
109
115
  - !ruby/object:Gem::Dependency
110
116
  name: google-style
111
117
  requirement: !ruby/object:Gem::Requirement
@@ -180,14 +186,14 @@ dependencies:
180
186
  name: rake
181
187
  requirement: !ruby/object:Gem::Requirement
182
188
  requirements:
183
- - - "~>"
189
+ - - ">="
184
190
  - !ruby/object:Gem::Version
185
191
  version: '12.0'
186
192
  type: :development
187
193
  prerelease: false
188
194
  version_requirements: !ruby/object:Gem::Requirement
189
195
  requirements:
190
- - - "~>"
196
+ - - ">="
191
197
  - !ruby/object:Gem::Version
192
198
  version: '12.0'
193
199
  - !ruby/object:Gem::Dependency
@@ -268,7 +274,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
268
274
  - !ruby/object:Gem::Version
269
275
  version: '0'
270
276
  requirements: []
271
- rubygems_version: 3.1.2
277
+ rubygems_version: 3.0.3
272
278
  signing_key:
273
279
  specification_version: 4
274
280
  summary: Common code for GAPIC-generated API clients