globase 0.0.0.pre4 → 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/globase.rb +1 -1
- data/lib/globase/campaign.rb +1 -3
- data/lib/globase/list.rb +4 -0
- data/lib/globase/list_profile.rb +2 -1
- data/lib/globase/list_profiles_search.rb +28 -0
- data/lib/globase/nested_resource.rb +4 -2
- data/lib/globase/resource.rb +3 -1
- data/lib/globase/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f1c8b22579fbfa601657e0cd7da62666237fa1b
|
4
|
+
data.tar.gz: 5f79a2f29384327255254bbe27a32b9e28e83a2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd47bf57870c4392bb1afc8803cc06b56e63ab87f8f5f529a1bffcf75ff8d8f2660b0f575a75aecabe41da67ea133b24910694486a4a90725d213fbe5120735b
|
7
|
+
data.tar.gz: e2c436639e9907efe3089e9118097d12721bce4337571de86fb4222065d28079f041a4046b4209cac841c67e1169c1020532e453f27c914c0c6906d871231913
|
data/Gemfile.lock
CHANGED
data/lib/globase.rb
CHANGED
@@ -5,7 +5,7 @@ require 'active_support/inflector'
|
|
5
5
|
require 'active_support/core_ext/module/introspection'
|
6
6
|
require 'globase/configuration'
|
7
7
|
|
8
|
-
%w(base resource nested_resource template list campaign list_profile list_schema list_segment ).each do |c|
|
8
|
+
%w(base resource nested_resource template list campaign list_profile list_schema list_segment list_profiles_search ).each do |c|
|
9
9
|
require "globase/#{c}"
|
10
10
|
eval "Globase::#{c.camelcase}.set_fields"
|
11
11
|
end
|
data/lib/globase/campaign.rb
CHANGED
@@ -13,8 +13,6 @@ module Globase
|
|
13
13
|
raise NoMethodError
|
14
14
|
end
|
15
15
|
|
16
|
-
# send_request(method = :get, params = {}, relative_path = nil, data = nil)
|
17
|
-
|
18
16
|
def add_profile(list_profile, launchOptions = { data: nil }, params = {})
|
19
17
|
self.class.send_request(:post, params, "#{id}/addProfile/#{list_profile.id}", launchOptions)
|
20
18
|
end
|
@@ -34,7 +32,7 @@ module Globase
|
|
34
32
|
end
|
35
33
|
|
36
34
|
def fields
|
37
|
-
@fields = super | [:id, :list, :name, :type, :status, :sysCreated, :sysChanged, :ownerId, :ownerUsername, :ownerEmail, :spanCounts, :tags, :messages ]
|
35
|
+
@fields = super | [:id, :list, :name, :type, :status, :sysCreated, :sysChanged, :ownerId, :ownerUsername, :ownerEmail, :spanCounts, :tags, :messages, :duplicateEmail ]
|
38
36
|
end
|
39
37
|
|
40
38
|
def mandatory_fields_create
|
data/lib/globase/list.rb
CHANGED
@@ -17,6 +17,10 @@ module Globase
|
|
17
17
|
ListProfile.find(self, id, params)
|
18
18
|
end
|
19
19
|
|
20
|
+
def profiles_search(criteria = {}, expand = nil, force_deferred = false, params = {})
|
21
|
+
ListProfilesSearch.search(self, criteria, expand, force_deferred, params)
|
22
|
+
end
|
23
|
+
|
20
24
|
def schema(params = {})
|
21
25
|
@schema ||= ListSchema.get(self, params)
|
22
26
|
end
|
data/lib/globase/list_profile.rb
CHANGED
@@ -3,8 +3,9 @@ module Globase
|
|
3
3
|
|
4
4
|
def update(params = {})
|
5
5
|
if persisted
|
6
|
-
self.class.send_request(parent, :put, params, nil, data)
|
6
|
+
response_data = self.class.send_request(parent, :put, params, nil, data)
|
7
7
|
persisted = true
|
8
|
+
response_data
|
8
9
|
else
|
9
10
|
create(data, params = {})
|
10
11
|
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Globase
|
2
|
+
class ListProfilesSearch < NestedResource
|
3
|
+
|
4
|
+
class << self
|
5
|
+
|
6
|
+
def search(parent, criteria = {}, expand = "Profile", force_deferred = false, params = {})
|
7
|
+
send_request( parent,
|
8
|
+
:post,
|
9
|
+
params.merge(force_deferred: force_deferred, expand: expand),
|
10
|
+
'search',
|
11
|
+
criteria
|
12
|
+
)
|
13
|
+
end
|
14
|
+
|
15
|
+
def collection_name
|
16
|
+
:profiles
|
17
|
+
end
|
18
|
+
|
19
|
+
def fields
|
20
|
+
@fields = super | [ :list, :sysCreated, :sysChanged, :optOutEmail, :optOutSms, :unConfirmed, :email, :company, :firstName, :lastName, :externalId ]
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
|
@@ -9,20 +9,22 @@ module Globase
|
|
9
9
|
self.class.send_request(parent, :delete, params, id)
|
10
10
|
end
|
11
11
|
|
12
|
-
def create(
|
12
|
+
def create(params = {})
|
13
13
|
if persisted
|
14
14
|
update(params)
|
15
15
|
else
|
16
16
|
response_data = self.class.send_request(parent, :post, params, nil, data)
|
17
17
|
id = response_data[:id]
|
18
18
|
persisted = true
|
19
|
+
response_data
|
19
20
|
end
|
20
21
|
end
|
21
22
|
|
22
23
|
def update(params = {})
|
23
24
|
if persisted
|
24
|
-
self.class.send_request(parent, :put, params, id, data)
|
25
|
+
response_data = self.class.send_request(parent, :put, params, id, data)
|
25
26
|
persisted = true
|
27
|
+
response_data
|
26
28
|
else
|
27
29
|
create(data, params = {})
|
28
30
|
end
|
data/lib/globase/resource.rb
CHANGED
@@ -16,13 +16,15 @@ module Globase
|
|
16
16
|
response_data = self.class.send_request(:post, params, nil, data)
|
17
17
|
id = response_data[:id]
|
18
18
|
persisted = true
|
19
|
+
response_data
|
19
20
|
end
|
20
21
|
end
|
21
22
|
|
22
23
|
def update(params = {})
|
23
24
|
if persisted
|
24
|
-
self.class.send_request(:put, params, id, data)
|
25
|
+
response_data = self.class.send_request(:put, params, id, data)
|
25
26
|
persisted = true
|
27
|
+
response_data
|
26
28
|
else
|
27
29
|
create(data, params = {})
|
28
30
|
end
|
data/lib/globase/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: globase
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robin Wunderlin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -85,6 +85,7 @@ files:
|
|
85
85
|
- lib/globase/configuration.rb
|
86
86
|
- lib/globase/list.rb
|
87
87
|
- lib/globase/list_profile.rb
|
88
|
+
- lib/globase/list_profiles_search.rb
|
88
89
|
- lib/globase/list_schema.rb
|
89
90
|
- lib/globase/list_segment.rb
|
90
91
|
- lib/globase/nested_resource.rb
|
@@ -117,9 +118,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
117
118
|
version: 2.1.9
|
118
119
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
119
120
|
requirements:
|
120
|
-
- - "
|
121
|
+
- - ">="
|
121
122
|
- !ruby/object:Gem::Version
|
122
|
-
version:
|
123
|
+
version: '0'
|
123
124
|
requirements: []
|
124
125
|
rubyforge_project:
|
125
126
|
rubygems_version: 2.5.1
|