salesforcebulk 4.0.1 → 4.0.3

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: f032203ffa9c8c7b62236b41582b120f71ea8db3d61c47225d9e50c8c0cd5df6
4
- data.tar.gz: f2af5753284c05df4280f2b170b03cce923c2a229e9c86eb6c2573843d2a3fd7
3
+ metadata.gz: 23924cf7343edb50354ce417301d08a3bf4065f7f07c9f166d525ebc26df1b91
4
+ data.tar.gz: b18a09f9695b629081da7f09e00edc5ca5c1cb9424512c42ae5ee55f83a1689f
5
5
  SHA512:
6
- metadata.gz: e7a8a9ea7f98d8dba1f482482b6dd693f76978a01069b206d6bda1c1e6a681e59384b4ed8a493586520fb45941689b2479051f0af55df0e3104b2796f3427a0f
7
- data.tar.gz: f1f7a957d188f22704c8ae6d756435faa70344b4c65ae76ea27223202f6e2159078b58c866c073ec3b48dce14323616710a4b5833ac25007f329f3e7f720fd96
6
+ metadata.gz: 0a28b8252b9263b01fa3e5c0ce793c0cc0130fd0d1691c546fff6fb7848bf2069103dc7b1a5d489c8f426cf5af82320a747c97cd38707e6111054c0dfa9252c0
7
+ data.tar.gz: 6e01558a369c92fe96102797fcf1c70589c693dff038ac5d3ca259a244824a2fcf19a9479d31007924f87e859d9618b79309f2b7d63501b3ab59175ea811848a
@@ -18,17 +18,19 @@ module SalesforceBulk
18
18
  attr_accessor :version
19
19
 
20
20
  # The ID for authenticated session
21
- attr_reader :session_id
21
+ attr_accessor :session_id
22
22
 
23
23
  def initialize(options={})
24
24
  options = {:login_host => 'login.salesforce.com', :version => 24.0}.merge(options)
25
25
 
26
- assert_valid_keys(options, :username, :password, :login_host, :version)
26
+ assert_valid_keys(options, :username, :password, :login_host, :version, :instance_host, :session_id)
27
27
 
28
28
  self.username = options[:username]
29
29
  self.password = "#{options[:password]}"
30
30
  self.login_host = options[:login_host]
31
31
  self.version = options[:version]
32
+ self.instance_host = options[:instance_host]
33
+ self.session_id = options[:session_id]
32
34
 
33
35
  @api_path_prefix = "/services/async/#{version}/"
34
36
  @valid_operations = [:delete, :insert, :update, :upsert, :query]
@@ -5,25 +5,28 @@ module SalesforceBulk
5
5
  attr_accessor :response
6
6
  # The status code from the server response body.
7
7
  attr_accessor :error_code
8
-
8
+
9
9
  def initialize(response)
10
10
  self.response = response
11
-
12
- data = XmlSimple.xml_in(response.body, 'ForceArray' => false)
13
-
14
- if data
15
- # seems responses for CSV requests use a different XML return format
16
- # (use invalid_error.xml for reference)
17
- if !data['exceptionMessage'].nil?
18
- message = data['exceptionMessage']
19
- else
20
- # SOAP error response
21
- message = data['Body']['Fault']['faultstring']
11
+ self.error_code = response.code
12
+
13
+ if (300..308).cover?(error_code.to_i)
14
+ message = "Moved to #{response['location']}"
15
+ else
16
+ data = XmlSimple.xml_in(response.body, 'ForceArray' => false)
17
+
18
+ if data
19
+ # seems responses for CSV requests use a different XML return format
20
+ # (use invalid_error.xml for reference)
21
+ if !data['exceptionMessage'].nil?
22
+ message = data['exceptionMessage']
23
+ else
24
+ # SOAP error response
25
+ message = data['Body']['Fault']['faultstring']
26
+ end
22
27
  end
23
-
24
- self.error_code = response.code
25
28
  end
26
-
29
+
27
30
  super(message)
28
31
  end
29
32
  end
@@ -1,3 +1,3 @@
1
1
  module SalesforceBulk
2
- VERSION = "4.0.1"
2
+ VERSION = "4.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: salesforcebulk
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.1
4
+ version: 4.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier Julio
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-13 00:00:00.000000000 Z
11
+ date: 2023-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xml-simple
@@ -115,7 +115,7 @@ files:
115
115
  homepage: https://github.com/javierjulio/salesforce_bulk
116
116
  licenses: []
117
117
  metadata: {}
118
- post_install_message:
118
+ post_install_message:
119
119
  rdoc_options: []
120
120
  require_paths:
121
121
  - lib
@@ -130,8 +130,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  requirements: []
133
- rubygems_version: 3.1.4
134
- signing_key:
133
+ rubygems_version: 3.4.5
134
+ signing_key:
135
135
  specification_version: 4
136
136
  summary: Full capability support for the Salesforce Bulk API.
137
137
  test_files: []