access 2.0.53 → 2.0.54

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
  SHA1:
3
- metadata.gz: b0d4870ee288eda3b8d17d95c8e5d376a6309ece
4
- data.tar.gz: ae177e4336c9269fca5b32b12df4b4960738484e
3
+ metadata.gz: f103f34997586f364b06742c1ca1a45dec1c4495
4
+ data.tar.gz: fc3398d13bef4073364a725aaf1472705fec6932
5
5
  SHA512:
6
- metadata.gz: d61a8c4057a81f37099c4bf2447c2933683267d293af370164e5949a6dac49ad8052fc4477fa9d986883c89cc3737f1cb15cc0b4b851cb5cce2126bd86befab1
7
- data.tar.gz: 05f10b77777e1c7a7bb33d9ecb443fd9a5cbf293eb9c03be2143c955816391c992335a3d1e18b05cce2a0aea6421091cee29125f0224ae6b4617f17b8e401f04
6
+ metadata.gz: 3c761563fad79ceeb68fdf97c7702fc0e97b087b825f9034c0871756c49cae1fd70bb766e43c744b6a18bad94bef1d0d46efe52e23ac36124c268fc8e8084ca9
7
+ data.tar.gz: 2b2454d09e5a08fd986c9f4969274b67a6a5c1d1fff9120c7e23d95ba6ff8fef972663ea32e5ecbca08d5b72033dd09f724ae9ed1c6ef567a31a63f6ad371094
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- access (2.0.53)
4
+ access (2.0.54)
5
5
  hashie (~> 3.3.1)
6
6
  httparty (~> 0.13.3)
7
7
 
@@ -111,3 +111,6 @@ DEPENDENCIES
111
111
  simplecov
112
112
  vcr
113
113
  webmock
114
+
115
+ BUNDLED WITH
116
+ 1.13.6
data/README.md CHANGED
@@ -35,7 +35,7 @@ You can configure the following options:
35
35
 
36
36
  You can set config settings by creating environment variables called:
37
37
 
38
- `ENV['ACCESS_TOKEN']`, `ENV['ACCESS_ENVIRONMENT']`, `ENV['ACCESS_RETURN_JSON']`, `ENV['ACCESS_HASHIFY']`, `ENV['ACCESS_TIMEOUT']`. `ENV['ACCESS_DEBUG_OUTPUT']`
38
+ `ENV['ACCESS_TOKEN']`, `ENV['ACCESS_ENVIRONMENT']`, `ENV['ACCESS_RETURN_JSON']`, `ENV['ACCESS_HASHIFY']`, `ENV['ACCESS_TIMEOUT']`, `ENV['ACCESS_DEBUG_OUTPUT']`.
39
39
 
40
40
  #### Config via Initializer
41
41
 
@@ -265,6 +265,25 @@ Access::OauthApplication.delete **application_id**, options
265
265
  Access::Verify.filter options
266
266
  ```
267
267
 
268
+ ####AMT
269
+
270
+ Need amt permission scope for your application before you can access these api's
271
+
272
+ ```ruby
273
+ # pass in an array of members you want to import with the required parameters:
274
+ # https://docs.accessdevelopment.com/amt/importing-members.html#overview
275
+ members_array = [{organization_customer_identifier: 'example', program_customer_identifier: 'example', member_customer_identifier: 'example' }]
276
+ a = Access::Amt.import(members_array)
277
+ ```
278
+
279
+ ```ruby
280
+ a = Access::Amt.list()
281
+ ```
282
+ a = Access::Amt.show(**import_id**)
283
+ ```ruby
284
+
285
+ ```
286
+
268
287
  ## Contributing
269
288
 
270
289
  1. Fork it ( https://github.com/access-development/api-ruby/fork )
@@ -6,6 +6,7 @@ require "access/config"
6
6
  require "access/much_meta"
7
7
  require "access/aggregations"
8
8
  require "access/api"
9
+ require "access/amt"
9
10
  require "access/autocomplete"
10
11
  require "access/campaign"
11
12
  require "access/category"
@@ -0,0 +1,28 @@
1
+ module Access
2
+ class Amt
3
+ include Access::MuchMeta
4
+
5
+ def self.import(members = [], options = {})
6
+ Access::Api.new.import_members members, options
7
+ end
8
+
9
+ def self.list(options = {})
10
+ Access::Api.new.list_imports options
11
+ end
12
+
13
+ def self.show(import_key, options = {})
14
+ Access::Api.new.show_import import_key, options
15
+ end
16
+
17
+ def self.process_batch(chunk)
18
+ chunk.map { |member_import| new(member_import) }
19
+ end
20
+
21
+ def initialize(values)
22
+ @used_fields = []
23
+ set_up_methods(values)
24
+ set_values(values)
25
+ end
26
+
27
+ end
28
+ end
@@ -418,6 +418,25 @@ module Access
418
418
  end
419
419
  end
420
420
 
421
+ # AMT
422
+
423
+ def import_members(members, options = {})
424
+ request.post('/imports', 'amt', options.merge({import: {members: members}})) do |response|
425
+ AmtResponse.new(response)
426
+ end
427
+ end
428
+
429
+ def list_imports(options = {})
430
+ request.get('/imports', 'amt', options) do |response|
431
+ AmtResponse.new(response)
432
+ end
433
+ end
434
+
435
+ def show_import(import_key, options = {})
436
+ request.get("/imports/#{import_key}", 'amt', options) do |response|
437
+ AmtResponse.new(response)
438
+ end
439
+ end
421
440
 
422
441
  private
423
442
 
@@ -89,7 +89,11 @@ module Access
89
89
  url = Access.config.api_environment == 'development' ? "http://" : "https://"
90
90
  url += api_type
91
91
  url += !!environment ? Access::Config::DOMAINS[environment] : Access::Config::DOMAINS[Access.config.api_environment]
92
- url += Access.config.api_environment == 'development' ? ".rws-api.dev/v1" : ".adcrws.com/v1"
92
+ if api_type == "amt"
93
+ url += Access.config.api_environment == 'development' ? ".amt.dev/api/v1" : ".accessdevelopment.com/api/v1"
94
+ else
95
+ url += Access.config.api_environment == 'development' ? ".rws-api.dev/v1" : ".adcrws.com/v1"
96
+ end
93
97
  url += path
94
98
  end
95
99
 
@@ -19,6 +19,8 @@ module Access
19
19
  attr_reader :channel_name, :channel_type, :channel_identifier, :channel_description
20
20
  #shopping cart count
21
21
  attr_reader :total_cart_count
22
+ #amt
23
+ attr_reader :data
22
24
 
23
25
  def initialize(response)
24
26
  @response = response # Setting this temporarily so i can have a working member reg call, since it doesn't follow the resource [] best practices
@@ -224,4 +226,14 @@ module Access
224
226
  end
225
227
  end
226
228
 
229
+ class AmtResponse < Response
230
+ def process_data
231
+ @data = Access::Amt.process_batch(@data) if @data
232
+ end
233
+
234
+ def all_valid?
235
+ @data.all?{|import| import.invalid_members_count.zero? }
236
+ end
237
+ end
238
+
227
239
  end
@@ -1,4 +1,4 @@
1
1
  module Access
2
- VERSION = "2.0.53"
2
+ VERSION = "2.0.54"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: access
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.53
4
+ version: 2.0.54
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Eggett
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-10-20 00:00:00.000000000 Z
13
+ date: 2016-10-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -234,6 +234,7 @@ files:
234
234
  - bin/setup
235
235
  - lib/access.rb
236
236
  - lib/access/aggregations.rb
237
+ - lib/access/amt.rb
237
238
  - lib/access/api.rb
238
239
  - lib/access/autocomplete.rb
239
240
  - lib/access/campaign.rb
@@ -404,7 +405,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
404
405
  version: '0'
405
406
  requirements: []
406
407
  rubyforge_project:
407
- rubygems_version: 2.4.5
408
+ rubygems_version: 2.4.6
408
409
  signing_key:
409
410
  specification_version: 4
410
411
  summary: Ruby wrapper for Access API