speakeasy_client_sdk_ruby 4.0.0 → 4.0.2

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: 44f27e3e09a07cc014a50265e1da6a0d87f0f31ff10748fa79c910bba8ca3329
4
- data.tar.gz: cf31e4ea81072802c9c823f01cf1f56ac49b74d8288ab74a207606debc91d61a
3
+ metadata.gz: 2314fb32b4721c7e785bb127695051eed53d546fc1e3453bd91dd4730f5e6af7
4
+ data.tar.gz: e1cfc315ae20214f8ad4ea3f249d3427a28a43e0095a72cf43af5aae0e321711
5
5
  SHA512:
6
- metadata.gz: b33c3cc5fef52f6636ff17d3d69b78b6b05a00e75fc644193e69a633e7aaba3b6151defc70de7fd18ce7ae720624839784fb38e113cbffa847617c3be940d6e7
7
- data.tar.gz: 55beebeb06f55c89f42271c77da97d03be1875696a45001aeb341bd7c0c23dc19cba149b9b7f586efe5d026e0818dfb5e630c7b0ab33fc02d2fbd40d4d5ed9d1
6
+ metadata.gz: 745162e2efb1105c2fe433abca93cc08abb92c0ef7994dad0098c42d32d925eea5d04e4f87a6efb0b796892bd7594e40bdd4b52ae41867ea8de3057ec5eea55a
7
+ data.tar.gz: d981a9982518e41bdaccaa69c21eb3fab314809a0c1f2f6487d1f34363c4f95f51fe1d000fb42ae0e294cb13452afe44fed26acadae5ce9119986cbd85adea98
@@ -36,7 +36,7 @@ module SpeakeasyClientSDK
36
36
  req_content_type, data, form = Utils.serialize_request_body(request, :request_body, :json)
37
37
  headers['content-type'] = req_content_type
38
38
  raise StandardError, 'request body is required' if data.nil? && form.nil?
39
- headers['Accept'] = '*/*'
39
+ headers['Accept'] = 'application/json'
40
40
  headers['user-agent'] = @sdk_configuration.user_agent
41
41
 
42
42
  r = @sdk_configuration.client.post(url) do |req|
@@ -56,7 +56,13 @@ module SpeakeasyClientSDK
56
56
  res = ::SpeakeasyClientSDK::Operations::PostWorkspaceEventsResponse.new(
57
57
  status_code: r.status, content_type: content_type, raw_response: r
58
58
  )
59
-
59
+ if r.status >= 200 && r.status < 300
60
+ elsif r.status >= 500 && r.status < 600
61
+ if Utils.match_content_type(content_type, 'application/json')
62
+ out = Utils.unmarshal_complex(r.env.response_body, ::SpeakeasyClientSDK::Shared::Error)
63
+ res.error = out
64
+ end
65
+ end
60
66
  res
61
67
  end
62
68
  end
@@ -18,12 +18,15 @@ module SpeakeasyClientSDK
18
18
  # HTTP response status code for this operation
19
19
  field :status_code, ::Integer
20
20
 
21
+ field :error, T.nilable(::SpeakeasyClientSDK::Shared::Error)
21
22
 
22
- sig { params(content_type: ::String, raw_response: ::Faraday::Response, status_code: ::Integer).void }
23
- def initialize(content_type: nil, raw_response: nil, status_code: nil)
23
+
24
+ sig { params(content_type: ::String, raw_response: ::Faraday::Response, status_code: ::Integer, error: T.nilable(::SpeakeasyClientSDK::Shared::Error)).void }
25
+ def initialize(content_type: nil, raw_response: nil, status_code: nil, error: nil)
24
26
  @content_type = content_type
25
27
  @raw_response = raw_response
26
28
  @status_code = status_code
29
+ @error = error
27
30
  end
28
31
  end
29
32
  end
@@ -41,9 +41,9 @@ module SpeakeasyClientSDK
41
41
  @globals = globals.nil? ? {} : globals
42
42
  @language = 'ruby'
43
43
  @openapi_doc_version = '0.4.0'
44
- @sdk_version = '4.0.0'
45
- @gen_version = '2.250.16'
46
- @user_agent = 'speakeasy-sdk/ruby 4.0.0 2.250.16 0.4.0 speakeasy_client_sdk_ruby'
44
+ @sdk_version = '4.0.2'
45
+ @gen_version = '2.250.22'
46
+ @user_agent = 'speakeasy-sdk/ruby 4.0.2 2.250.22 0.4.0 speakeasy_client_sdk_ruby'
47
47
  end
48
48
 
49
49
  sig { returns([String, T::Hash[Symbol, String]]) }
@@ -479,7 +479,9 @@ module SpeakeasyClientSDK
479
479
  end
480
480
 
481
481
  data = "#{username}:#{password}".encode
482
- req.headers['Authorization'] = "Basic #{Base64.encode64(data)}"
482
+ # Use strict_encode, because encode adds newlines after 60 chars
483
+ # https://docs.ruby-lang.org/en/3.0/Base64.html#method-i-encode64
484
+ req.headers['Authorization'] = "Basic #{Base64.strict_encode64(data)}"
483
485
  end
484
486
 
485
487
  sig { params(optional: T::Boolean).returns(T.proc.params(s: String).returns(DateTime)) }
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: 4.0.0
4
+ version: 4.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Speakeasy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-08 00:00:00.000000000 Z
11
+ date: 2024-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday