speakeasy_client_sdk_ruby 1.18.0 → 1.20.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: 47c155b10048ebd799261aff78b1b2e31573fa2d792ff338945b1cb71c52ed4d
4
- data.tar.gz: 297ca544fc4cfb80b220c18aed44de4439ffebac7cf7864ebac0a90dc6b480dc
3
+ metadata.gz: 04e7455e5a090999ec6a3ab7d5022d9506ad401e759d35b083040fd0a7986727
4
+ data.tar.gz: 6dbfb31e6f2e1d58ab785a6f46b971503aa6f9c634811a79ae5d29c3aa0efc0a
5
5
  SHA512:
6
- metadata.gz: d7342de388baf3a79a8551b7a921a9297e16279361ea229ec3123c095d5f5606a4954e8630eac2c277c8866cc9552f2d3a9b79b67360c7a6bbd24e067d15013f
7
- data.tar.gz: ef36a640fe266aada15d87a94695cc1612867116e60a421a9c60e734100a831ce99139c0dccc6c02469e7872d3fb488c74d836f1f0e7d43cb09fed5dd117547f
6
+ metadata.gz: a26b8638fe37021da08bac29fcf517b68f5516bbece34d91b45303f10b5fc80d4226f09de95ed26af66cf416a192d51a45eee14ab2c3ce6dc75297bc4c9f09cc
7
+ data.tar.gz: fdd5792141f21786c730b0df08eaaec12ed2c01dec6850f2c731e6ccfe875b829683714bd62585decf1964bcfd88193f7e49600c8a8977fc267009b595c875c5
@@ -38,8 +38,8 @@ module OpenApiSDK
38
38
  @server = server_url.nil? ? '' : server_url
39
39
  @language = 'ruby'
40
40
  @openapi_doc_version = '0.3.0'
41
- @sdk_version = '1.18.0'
42
- @gen_version = '2.81.1'
41
+ @sdk_version = '1.20.0'
42
+ @gen_version = '2.84.1'
43
43
  end
44
44
 
45
45
  sig { returns([String, T::Hash[Symbol, String]]) }
@@ -70,7 +70,7 @@ module SpeakeasyClientSDK
70
70
  end
71
71
  end
72
72
 
73
- return items.join(',') if !items.empty?
73
+ items.join(',') if !items.empty?
74
74
  elsif obj.is_a? Hash
75
75
  items = []
76
76
  obj.each do |key, value|
@@ -83,8 +83,8 @@ module SpeakeasyClientSDK
83
83
  items.append(val_to_string(value))
84
84
  end
85
85
  end
86
- return items.join(',') if !items.empty?
87
86
 
87
+ items.join(',') if !items.empty?
88
88
  elsif obj.is_a? Array
89
89
  items = obj.filter { |v| !v.nil? }.map { |v| val_to_string(v) }.join(',')
90
90
  else
@@ -289,7 +289,7 @@ module SpeakeasyClientSDK
289
289
  param = path_params.send(f.name) if !path_params.nil?
290
290
  param = _populate_from_globals(f.name, param, 'pathParam', gbls)
291
291
  end
292
-
292
+
293
293
  f_name = param_metadata.fetch(:field_name, f.name)
294
294
  serialization = param_metadata.fetch(:serialization, '')
295
295
  if serialization != ''
@@ -3,7 +3,6 @@
3
3
  # typed: true
4
4
  # frozen_string_literal: true
5
5
 
6
- require_relative 'sdk/utils/retries'
7
6
  require_relative 'sdk/utils/utils'
8
7
  require_relative 'sdk/utils/metadata_fields'
9
8
  require_relative 'sdk/sdk'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: speakeasy_client_sdk_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.18.0
4
+ version: 1.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Speakeasy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-04 00:00:00.000000000 Z
11
+ date: 2023-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -175,7 +175,6 @@ files:
175
175
  - lib/sdk/sdk.rb
176
176
  - lib/sdk/sdkconfiguration.rb
177
177
  - lib/sdk/utils/metadata_fields.rb
178
- - lib/sdk/utils/retries.rb
179
178
  - lib/sdk/utils/utils.rb
180
179
  - lib/speakeasy_client_sdk_ruby.rb
181
180
  homepage: https://github.com/speakeasy-api/openapi-generation
@@ -1,130 +0,0 @@
1
- # Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
2
-
3
- # typed: true
4
- # frozen_string_literal: true
5
-
6
- require 'sorbet-runtime'
7
-
8
- module SpeakeasyClientSDK
9
- class BackoffStrategy
10
- extend T::Sig
11
-
12
- attr_accessor :initial_interval, :max_interval, :exponent, :max_elapsed_time
13
-
14
- sig { params(initial_interval: Integer, max_interval: Integer, exponent: Float, max_elapsed_time: Integer).void }
15
- def initialize(initial_interval, max_interval, exponent, max_elapsed_time)
16
- @initial_interval = initial_interval
17
- @max_interval = max_interval
18
- @exponent = exponent
19
- @max_elapsed_time = max_elapsed_time
20
- end
21
- end
22
-
23
- class RetryConfig
24
- extend T::Sig
25
-
26
- attr_accessor :strategy, :backoff, :retry_connection_errors
27
-
28
- sig { params(strategy: String, retry_connection_errors: bool).void }
29
- def initialize(strategy, retry_connection_errors)
30
- @strategy = strategy
31
- @retry_connection_errors = retry_connection_errors
32
- end
33
- end
34
-
35
- class RetriesContainer
36
- extend T::Sig
37
-
38
- attr_accessor :config, :status_codes
39
-
40
- sig { params(config: RetryConfig, status_codes: Array[String]).void }
41
- def initialize(config, status_codes)
42
- @config = config
43
- @status_codes = status_codes
44
- end
45
- end
46
-
47
- class TemporaryError < StandardError
48
- extend T::Sig
49
-
50
- attr_accessor :response
51
-
52
- sig { params(response: requests.Response).void }
53
- def initialize(response)
54
- @response = response
55
- end
56
- end
57
-
58
- class PermanentError < StandardError
59
- extend T::Sig
60
-
61
- attr_accessor :inner
62
-
63
- sig { params(inner: StandardError).void }
64
- def initialize(inner)
65
- @inner = inner
66
- end
67
- end
68
-
69
- def self.retry(fun, retries)
70
- if retries.config.strategy == 'backoff'
71
- do_request = lambda do
72
- begin
73
- res = fun.call
74
- retries.status_codes.each do |code|
75
- if code.upcase.include? 'X'
76
- code_range = code[0].to_i
77
- s = res.status_code / 100
78
- raise TemporaryError, res if s >= code_range && s < code_range + 1
79
- else
80
- parsed_code = code.to_i
81
- raise TemporaryError, res if res.status_code == parsed_code
82
- end
83
- end
84
- rescue Faraday::ConnectionFailed => e
85
- if !retries.config.config.retry_connection_errors
86
- raise
87
- else
88
- raise PermanentError, e
89
- end
90
- rescue Faraday::TimeoutError => e
91
- if !retries.config.config.retry_connection_errors
92
- raise
93
- else
94
- raise PermanentError, e
95
- end
96
- rescue TemporaryError
97
- raise
98
- rescue StandardError => e
99
- raise PermanentError, e
100
- end
101
- return res
102
- end
103
- retry_with_backoff(do_request, retries.config.backoff.initial_interval,
104
- retries.config.backoff.max_interval, retries.config.backoff.exponent,
105
- retries.config.backoff.max_elapsed_time)
106
- else
107
- fun.call
108
- end
109
- end
110
-
111
- def self.retry_with_backoff(fun, initial_interval = 500, max_interval = 60_000,
112
- exponent = 1.5, max_elapsed_time = 3_600_000)
113
- start = round(Time.now.to_i * 1000)
114
- x = 0
115
- loop do
116
- return fun.call
117
- rescue PermanentError => e
118
- raise e.inner
119
- rescue TemporaryError => e
120
- now = round(Time.now.to_i * 1000)
121
- return e.response if now - start > max_elapsed_time
122
-
123
- sleep = ((initial_interval / 1000) * exponent**x + rand)
124
- sleep = max_interval / 1000 if sleep > max_interval / 1000
125
-
126
- sleep(sleep)
127
- x += 1
128
- end
129
- end
130
- end