zuora_rest_client 1.2.2.0 → 1.2.2.1

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: 3637cbe1e944055ad2b7303e6e92735b736224dfa77ad00153430c6da7674db4
4
- data.tar.gz: de9dd2e15c1d52fec7533b6fa04ddeb4b8650f8b025a6b47d07c4d186710832d
3
+ metadata.gz: 3f12ba038bba293e7a7f2d016f2bca54f2a85e11d9e52130e7ec16acb2abbb2f
4
+ data.tar.gz: e9f44500267bb6b5d8cc4b664d2f6eaaa18fe4fa046dde5d38febf2bf3bc7559
5
5
  SHA512:
6
- metadata.gz: 76df5debfb8ec385702e50537e2693f1879fe62832fe683947b46a4159626a1142f705b27c4f8d54c8e6e74de48f8a403a61bb29fb69c8c39a8ac6b2291f88d3
7
- data.tar.gz: 1aa64f505dbddad21e621037d691f2c2120f4e1979c6df0637781685418624560f08dd607a9ff419246a520f88a0fb840874e3d9d486c7db71a90858179df2bf
6
+ metadata.gz: 3f364b079454965165ff34c71444205121d343284a2e96872b36f66553829941d89082f09c9ab6e2edc9077e5bc7f9d7be12e076c86aab4b1852e4879dd7d498
7
+ data.tar.gz: 90e96f0c58f97b3d4f0cdbf58b7408a0865aaf6316d96b0900050cc6d01c02200f0682aed36fe292b3da037271a85c053fed5af5f69357a900762e52c69284e7
@@ -12,6 +12,8 @@ module ZuoraRestClient
12
12
 
13
13
  class Client
14
14
 
15
+ attr_reader :connection
16
+
15
17
  DEFAULT_CLIENT_OPTIONS = {
16
18
  logger: Logger.new($stdout),
17
19
  log_level: :error,
@@ -119,6 +119,24 @@ module ZuoraRestClient
119
119
  process_response(response)
120
120
  end
121
121
 
122
+ def zuora_endpoint
123
+ if @environment.is_a? Symbol
124
+ if @environment.to_s.start_with?('services')
125
+ rest_endpoint = "https://#{@environment.to_s}.zuora.com/apps"
126
+ app_endpoint = "https://#{@environment.to_s}.zuora.com/apps/api"
127
+ else
128
+ rest_endpoint = "#{ZUORA_ENVIRONMENTS[@environment][:rest]}"
129
+ app_endpoint = "#{ZUORA_ENVIRONMENTS[@environment][:app]}/apps/api"
130
+ end
131
+ elsif @environment.is_a? Hash
132
+ rest_endpoint = "#{@environment[:rest]}"
133
+ app_endpoint = "#{@environment[:app]}/apps/api"
134
+ else
135
+ raise 'Possible values for environment are: :production, :api_sandbox, :test, :servicesNNN or a hash with base URL values for :rest and :app.'
136
+ end
137
+ OpenStruct.new({ rest: rest_endpoint, app: app_endpoint })
138
+ end
139
+
122
140
  private
123
141
 
124
142
  ZUORA_REST_MAJOR_VERSION = 'v1'
@@ -213,23 +231,5 @@ module ZuoraRestClient
213
231
  (path.start_with?('/action/') || path.start_with?('/object/'))
214
232
  end
215
233
 
216
- def zuora_endpoint
217
- if @environment.is_a? Symbol
218
- if @environment.to_s.start_with?('services')
219
- rest_endpoint = "https://#{@environment.to_s}.zuora.com/apps"
220
- app_endpoint = "https://#{@environment.to_s}.zuora.com/apps/api"
221
- else
222
- rest_endpoint = "#{ZUORA_ENVIRONMENTS[@environment][:rest]}"
223
- app_endpoint = "#{ZUORA_ENVIRONMENTS[@environment][:app]}/apps/api"
224
- end
225
- elsif @environment.is_a? Hash
226
- rest_endpoint = "#{@environment[:rest]}"
227
- app_endpoint = "#{@environment[:app]}/apps/api"
228
- else
229
- raise 'Possible values for environment are: :production, :api_sandbox, :test, :servicesNNN or a hash with base URL values for :rest and :app.'
230
- end
231
- OpenStruct.new({ rest: rest_endpoint, app: app_endpoint })
232
- end
233
-
234
234
  end
235
235
  end
@@ -1,3 +1,3 @@
1
1
  module ZuoraRestClient
2
- VERSION = '1.2.2.0'
2
+ VERSION = '1.2.2.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zuora_rest_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2.0
4
+ version: 1.2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Massad