access 2.0.53 → 2.0.54
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 +4 -4
- data/Gemfile.lock +4 -1
- data/README.md +20 -1
- data/lib/access.rb +1 -0
- data/lib/access/amt.rb +28 -0
- data/lib/access/api.rb +19 -0
- data/lib/access/request.rb +5 -1
- data/lib/access/response.rb +12 -0
- data/lib/access/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f103f34997586f364b06742c1ca1a45dec1c4495
|
4
|
+
data.tar.gz: fc3398d13bef4073364a725aaf1472705fec6932
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c761563fad79ceeb68fdf97c7702fc0e97b087b825f9034c0871756c49cae1fd70bb766e43c744b6a18bad94bef1d0d46efe52e23ac36124c268fc8e8084ca9
|
7
|
+
data.tar.gz: 2b2454d09e5a08fd986c9f4969274b67a6a5c1d1fff9120c7e23d95ba6ff8fef972663ea32e5ecbca08d5b72033dd09f724ae9ed1c6ef567a31a63f6ad371094
|
data/Gemfile.lock
CHANGED
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']
|
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 )
|
data/lib/access.rb
CHANGED
data/lib/access/amt.rb
ADDED
@@ -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
|
data/lib/access/api.rb
CHANGED
@@ -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
|
|
data/lib/access/request.rb
CHANGED
@@ -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
|
-
|
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
|
|
data/lib/access/response.rb
CHANGED
@@ -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
|
data/lib/access/version.rb
CHANGED
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.
|
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-
|
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.
|
408
|
+
rubygems_version: 2.4.6
|
408
409
|
signing_key:
|
409
410
|
specification_version: 4
|
410
411
|
summary: Ruby wrapper for Access API
|