zuora_connect 1.5.39 → 1.5.40a

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
  SHA1:
3
- metadata.gz: 1964b6b0f5a04eb7b8f09d08dbcd7c4244efb872
4
- data.tar.gz: 8d012a83c41603d3f59750b9f492017b44248ad6
3
+ metadata.gz: 8e915f67ad5993527d65b4e4c115ea8dc6f34894
4
+ data.tar.gz: b6b098aa03fb13fbe8a05da49bdf97446f82b15b
5
5
  SHA512:
6
- metadata.gz: 30149960f2eb05408cabf05fe0bcbb3bf07ba3d49ab6c0eb945814082fe96af6d08dce2414c2648e94149d811868413870eb58c391efd4d65244211d34823829
7
- data.tar.gz: 15fb91eafb1e765c442cc4a9d8ce5a5887ffc720c3108ee586570ce36ae26432eaf71cbaa33ae351b5de71602d53148f4fc43ff67813fe9cc9505d1d2de29bd3
6
+ metadata.gz: 697525f9ca8900e9248af96adbfd3829d5dd1ccec432178a0efb38ff0381f6f4dec20dd7e3b28ba26a389bec3d8df7f3df77faa192d96c5ade7b3321156644e4
7
+ data.tar.gz: 9457e97af890e84d393e6b18d554601ec5325df5ab4ba18d1398ad596742f2e62ec909299087316569d987bbeb3636f90a601ec70d7862e6d032154816d30418
@@ -197,10 +197,17 @@ module ZuoraConnect
197
197
  #EXAMPLE: {"name": "ftp_login_14","username": "ftplogin7","tenant_type": "Custom","password": "test2","url": "www.ftp.com","custom_data": { "path": "/var/usr/test"}}
198
198
  def update_logins(options)
199
199
  update_login_count ||= 0
200
-
201
200
  response = HTTParty.post(ZuoraConnect.configuration.url + "/api/#{self.api_version}/tools/tasks/#{self.id}/logins",:body => {:access_token => self.username}.merge(options))
201
+ parsed_json = JSON.parse(response.body)
202
202
  if response.code == 200
203
- return JSON.parse(response.body)
203
+ if defined?(Redis.current)
204
+ self.build_task(parsed_json, self.data_lookup)
205
+ self.last_refresh = Time.now.to_i
206
+ self.cache_app_instance
207
+ end
208
+ return parsed_json
209
+ elsif response.code == 400
210
+ raise ZuoraConnect::Exceptions::APIError.new(message: parsed_json['errors'].join(' '), response: response.body, code: response.code)
204
211
  else
205
212
  raise ZuoraConnect::Exceptions::ConnectCommunicationError.new("Error Communicating with Connect", response.body, response.code)
206
213
  end
@@ -34,6 +34,23 @@ module ZuoraConnect
34
34
  end
35
35
  end
36
36
 
37
+ class APIError < Error
38
+ attr_reader :code, :response
39
+ attr_writer :default_message
40
+
41
+ def initialize(message: nil,response: nil, code: nil)
42
+ @code = code
43
+ @message = message
44
+ @response = response
45
+ @default_message = "Connect update error."
46
+ end
47
+
48
+ def to_s
49
+ @message || @default_message
50
+ end
51
+
52
+ end
53
+
37
54
  class AccessDenied < Error
38
55
  attr_writer :default_message
39
56
 
@@ -1,3 +1,3 @@
1
1
  module ZuoraConnect
2
- VERSION = "1.5.39"
2
+ VERSION = "1.5.40a"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zuora_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.39
4
+ version: 1.5.40a
5
5
  platform: ruby
6
6
  authors:
7
7
  - Connect Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-09 00:00:00.000000000 Z
11
+ date: 2018-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: apartment
@@ -319,54 +319,54 @@ required_ruby_version: !ruby/object:Gem::Requirement
319
319
  version: '0'
320
320
  required_rubygems_version: !ruby/object:Gem::Requirement
321
321
  requirements:
322
- - - ">="
322
+ - - ">"
323
323
  - !ruby/object:Gem::Version
324
- version: '0'
324
+ version: 1.3.1
325
325
  requirements: []
326
326
  rubyforge_project:
327
- rubygems_version: 2.6.8
327
+ rubygems_version: 2.6.14
328
328
  signing_key:
329
329
  specification_version: 4
330
330
  summary: Summary of Connect.
331
331
  test_files:
332
332
  - test/controllers/zuora_connect/api/v1/app_instance_controller_test.rb
333
- - test/dummy/bin/rake
334
- - test/dummy/bin/bundle
335
- - test/dummy/bin/setup
336
- - test/dummy/bin/rails
337
- - test/dummy/Rakefile
338
- - test/dummy/public/favicon.ico
339
- - test/dummy/public/404.html
340
- - test/dummy/public/422.html
341
- - test/dummy/public/500.html
342
- - test/dummy/app/controllers/application_controller.rb
343
- - test/dummy/app/views/layouts/application.html.erb
344
- - test/dummy/app/helpers/application_helper.rb
345
333
  - test/dummy/app/assets/javascripts/application.js
346
334
  - test/dummy/app/assets/stylesheets/application.css
347
- - test/dummy/README.rdoc
348
- - test/dummy/config.ru
349
- - test/dummy/config/locales/en.yml
350
- - test/dummy/config/routes.rb
351
- - test/dummy/config/environment.rb
352
- - test/dummy/config/database.yml
353
- - test/dummy/config/secrets.yml
335
+ - test/dummy/app/controllers/application_controller.rb
336
+ - test/dummy/app/helpers/application_helper.rb
337
+ - test/dummy/app/views/layouts/application.html.erb
338
+ - test/dummy/bin/bundle
339
+ - test/dummy/bin/rails
340
+ - test/dummy/bin/rake
341
+ - test/dummy/bin/setup
342
+ - test/dummy/config/application.rb
354
343
  - test/dummy/config/boot.rb
355
- - test/dummy/config/environments/production.rb
344
+ - test/dummy/config/database.yml
345
+ - test/dummy/config/environment.rb
356
346
  - test/dummy/config/environments/development.rb
347
+ - test/dummy/config/environments/production.rb
357
348
  - test/dummy/config/environments/test.rb
349
+ - test/dummy/config/initializers/assets.rb
358
350
  - test/dummy/config/initializers/backtrace_silencers.rb
351
+ - test/dummy/config/initializers/cookies_serializer.rb
359
352
  - test/dummy/config/initializers/filter_parameter_logging.rb
360
- - test/dummy/config/initializers/assets.rb
361
353
  - test/dummy/config/initializers/inflections.rb
354
+ - test/dummy/config/initializers/mime_types.rb
362
355
  - test/dummy/config/initializers/session_store.rb
363
356
  - test/dummy/config/initializers/wrap_parameters.rb
364
- - test/dummy/config/initializers/mime_types.rb
365
- - test/dummy/config/initializers/cookies_serializer.rb
366
- - test/dummy/config/application.rb
367
- - test/lib/generators/zuora_connect/datatable_generator_test.rb
368
- - test/test_helper.rb
357
+ - test/dummy/config/locales/en.yml
358
+ - test/dummy/config/routes.rb
359
+ - test/dummy/config/secrets.yml
360
+ - test/dummy/config.ru
361
+ - test/dummy/public/404.html
362
+ - test/dummy/public/422.html
363
+ - test/dummy/public/500.html
364
+ - test/dummy/public/favicon.ico
365
+ - test/dummy/Rakefile
366
+ - test/dummy/README.rdoc
369
367
  - test/fixtures/zuora_connect/app_instances.yml
370
368
  - test/integration/navigation_test.rb
369
+ - test/lib/generators/zuora_connect/datatable_generator_test.rb
371
370
  - test/models/zuora_connect/app_instance_test.rb
371
+ - test/test_helper.rb
372
372
  - test/zuora_connect_test.rb