ramco 0.1.2 → 0.2.2

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: dd44c1cc33aeb833b2361b21eb6e2dcbdd2b852bd8c46993ef272276b0964660
4
- data.tar.gz: 7d00666754d90a2b54e3c71de2c84649183b5421cea6bbd05f17c0e15ebdafc2
3
+ metadata.gz: d3385579b7d7b795e9d1404e6707327487cf46946d8060028afa13597854c7ba
4
+ data.tar.gz: 10dbbab9475a7715766a38848a0be042791126fafc1dfc1d485c4fd658340896
5
5
  SHA512:
6
- metadata.gz: 4303addff9362c7b601ae3eaec6833a325728dbb1e760a8a4c1f8477caa9fbe8e6ab7507629bf59b5e5f6f7da472ece142a30a380f96e9e5f2eb8e4972d245d8
7
- data.tar.gz: eb4c0537d6cb73dad7988532cd6f2a2a9878f280ffed03fd0c2f70e23ca2cd1e0dc40d3ddfc3ef75c0b7b13b5539d16ff82ec357bed7e493380dd0dcff580bc2
6
+ metadata.gz: 8487bbb88d0b9d02b07372381265631039d484c9640d2f758039cbd5f306719013ba89e6f3395618dd431329ac608fd3d9499ded1e1c2cafecfd319d320d2ab9
7
+ data.tar.gz: a820ac998c0325f3c7682cedbdd89fba630d442871bdaeadce8e1220a5d70f2b312e4a50f6f08640898b374d024de03e11e27c431b09ea9ab0d124e3b53b87f3
data/README.md CHANGED
@@ -80,6 +80,55 @@ Returns the globally unique id of a contact that matches the provided cobalt_use
80
80
  * cobalt_username = User’s username
81
81
  * cobalt_password = User’s password
82
82
 
83
+ ## UpdateEntity
84
+
85
+ Allows for modification of attributes of existing Entities.
86
+
87
+ ramco.update_entity({"entity" => "Contact", "guid" => "6868642f-0144-e811-9c17-00155d10120d", "attribute_values" => "FirstName=#Jane#,Birthday=1980-12-31,EmailVerified=true,NumChildren=3"})
88
+
89
+ * Post params:
90
+ * Entity = Type of entity being modified (ex: Contact)
91
+ * Guid = guid of entity being modified
92
+ * AttributeValues = Comma separated attribute=value pairs.
93
+ * StringDelimiter (optional) = User-specified delimiter used to wrap string values (default is #)
94
+
95
+ ### The AttributeValue parameter syntax
96
+
97
+ A comma delimited list of attribute value pairs like:
98
+
99
+ FirstName=#Joe#,Birthday=1980-12-31,EmailVerified=true,NumChildren=3
100
+
101
+ Strings must be wrapped with a delimiter. The default delimiter is ‘#’ but a user-specified delimiter can be utilized by including the optional StringDelimiter param.
102
+
103
+ OptionSets must be set to a numeric value valid for that optionset, or zero to clear current existing value. To determine values that are valid for an optionset, use the GetOptionSet api call.
104
+ Note that when updating an attribute of type EntityReferene, usually only the guid needs to be specified. In cases where the EntityReference can be of more than one type (ex: OwnerId can be SystemUser or Team) the value must be type:guid (SystemUser:fb50333e-6b9f-e111-8d5d- 00155d000140).
105
+
106
+ In instances where the string delimiter occurs in the string itself (ex: ‘Some#Text’), the delimiter must be Base64Encoded (ex: ‘SomeIw==Text’). Of course the option to change the delimiter using the StringDelimiter parameter exists as well.
107
+
108
+
109
+ ## CreateEntity
110
+
111
+ Allows for creation of a new entity record.
112
+
113
+ ramco.create_entity({"entity" => "Contact", "attribute_values" => "FirstName=#Jane#,Birthday=1980-12-31,EmailVerified=true,NumChildren=3"})
114
+
115
+ * Post params:
116
+ * Entity = Type of entity being modified (ex: Contact)
117
+ * AttributeValues = Comma separated attribute=value pairs.
118
+ * StringDelimiter (optional) = User-specified delimiter used to wrap string values (default is #)
119
+
120
+ ### The AttributeValue parameter syntax
121
+
122
+ The AttributeValue parameter for CreateEntity follows the same format as that for UpdateEntity.
123
+
124
+ ### PrimaryIdAttribute
125
+
126
+ Every entity type has a PrimaryIdAttribute which can be determined with a GetEntityMetadata call. If a specific guid is desired for the entity being created, it can be added to the AttributeValues parameter along with the other specified values. If the PrimaryIdAttribute is not specified, one will be automatically generated.
127
+
128
+ Example creating a Contact record (ContactId is PrimaryIdAttribute):
129
+
130
+ FirstName=#John#,LastName=#Doe#,ContactId= 84a4d17f-2e48-4a4b-bb28-26f7c14fc926, Birthday=1980-12-31
131
+
83
132
  ## ClearCache
84
133
 
85
134
  Clears the server-side metadata cache. If an entity or attribute has been added (or removed), then clearing the cache will permit the changes to be reflected immediately. The cache will normally expire every 24 hours.
@@ -17,6 +17,39 @@ class Ramco
17
17
  params['operation'] = "GetEntity"
18
18
  request(connection, params)
19
19
  end
20
+
21
+ # CreateEntity
22
+ # Allows for creation of a new entity record.
23
+ #
24
+ # Entity = Type of entity being modified (ex: Contact)
25
+ # AttributeValues = Comma separated attribute=value pairs.
26
+ # StringDelimiter (optional) = User-specified delimiter used to wrap string values (default is #)
27
+ #
28
+ # {"entity" => "Contact", "attribute_values" => "FirstName=#Jane#,Birthday=1980-12-31,EmailVerified=true,NumChildren=3"}
29
+ #
30
+ # Returns json
31
+ #
32
+ def create_entity(params={})
33
+ params['operation'] = "CreateEntity"
34
+ request(connection, params)
35
+ end
36
+
37
+ # UpdateEntity
38
+ # Allows for modification of attributes of existing Entities.
39
+ #
40
+ # Entity = Type of entity being modified (ex: Contact)
41
+ # Guid = guid of entity being modified
42
+ # AttributeValues = Comma separated attribute=value pairs.
43
+ # StringDelimiter (optional) = User-specified delimiter used to wrap string values (default is #)
44
+ #
45
+ # {"entity" => "Contact", "attribute_values" => "FirstName=#Jane#,Birthday=1980-12-31,EmailVerified=true,NumChildren=3"}
46
+ #
47
+ # Returns json
48
+ #
49
+ def update_entity(params={})
50
+ params['operation'] = "UpdateEntity"
51
+ request(connection, params)
52
+ end
20
53
  end
21
54
  end
22
55
  end
data/lib/ramco/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Ramco
2
- VERSION = "0.1.2"
2
+ VERSION = "0.2.2"
3
3
  end
data/ramco.gemspec CHANGED
@@ -4,7 +4,7 @@ require "ramco/version"
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = "ramco"
6
6
  spec.version = Ramco::VERSION
7
- spec.required_ruby_version = ">= 2.4.6"
7
+ spec.required_ruby_version = ">= 2.6.6"
8
8
  spec.authors = ["Kurt Kowitz"]
9
9
  spec.email = ["kurt@connectspaceinc.com"]
10
10
 
@@ -18,14 +18,14 @@ Gem::Specification.new do |spec|
18
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency 'faraday', '~> 0.9'
22
- spec.add_dependency 'faraday_middleware', '~> 0.9'
23
- spec.add_dependency 'multi_json', '~> 1.3'
24
- spec.add_dependency 'typhoeus', '~> 0.7.0'
25
-
21
+ spec.add_dependency 'faraday', ['>= 1.9', '< 2.0']
22
+ spec.add_dependency 'faraday_middleware', '~> 1.2'
23
+ spec.add_dependency 'multi_json', '~> 1.15'
24
+ spec.add_dependency 'typhoeus', '~> 1.4'
25
+
26
26
  spec.add_development_dependency "bundler"
27
27
  spec.add_development_dependency 'rake'
28
- spec.add_development_dependency 'rspec', '~>3.0'
28
+ spec.add_development_dependency 'rspec', '~>3.1'
29
29
  spec.add_development_dependency 'json_pure'
30
30
  spec.add_development_dependency 'webmock'
31
31
  spec.add_development_dependency 'vcr'
@@ -13,4 +13,30 @@ describe Ramco::API::Entity do
13
13
  end
14
14
  end
15
15
  end
16
+
17
+ describe "#update_entity" do
18
+ it "should update an entity" do
19
+ VCR.use_cassette('update entity') do
20
+ response = subject.update_entity({"entity" => "Contact", "guid" => "6868642f-0144-e811-9c17-00155d10120d", "attribute_values" => "FirstName=#Jane#,LastName=#Doe#"})
21
+ expect(response).to be_instance_of(Hash)
22
+ expect(response).to have_key "ContactId"
23
+ expect(response["ContactId"]).to eq("6868642f-0144-e811-9c17-00155d10120d")
24
+ expect(response["FirstName"]).to eq("Jane")
25
+ expect(response["LastName"]).to eq("Doe")
26
+ end
27
+ end
28
+ end
29
+
30
+ describe "#create_entity" do
31
+ it "should create an entity" do
32
+ VCR.use_cassette('create entity') do
33
+ response = subject.create_entity({"entity" => "Contact", "attribute_values" => "FirstName=#Jane#,LastName=#Doe#"})
34
+ expect(response).to be_instance_of(Hash)
35
+ expect(response).to have_key "ContactId"
36
+ expect(response["ContactId"]).to eq("6868642f-0144-e811-9c17-00155d10120d")
37
+ expect(response["FirstName"]).to eq("Jane")
38
+ expect(response["LastName"]).to eq("Doe")
39
+ end
40
+ end
41
+ end
16
42
  end
metadata CHANGED
@@ -1,71 +1,77 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ramco
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kurt Kowitz
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-24 00:00:00.000000000 Z
11
+ date: 2022-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '1.9'
20
+ - - "<"
18
21
  - !ruby/object:Gem::Version
19
- version: '0.9'
22
+ version: '2.0'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '1.9'
30
+ - - "<"
25
31
  - !ruby/object:Gem::Version
26
- version: '0.9'
32
+ version: '2.0'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: faraday_middleware
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
37
  - - "~>"
32
38
  - !ruby/object:Gem::Version
33
- version: '0.9'
39
+ version: '1.2'
34
40
  type: :runtime
35
41
  prerelease: false
36
42
  version_requirements: !ruby/object:Gem::Requirement
37
43
  requirements:
38
44
  - - "~>"
39
45
  - !ruby/object:Gem::Version
40
- version: '0.9'
46
+ version: '1.2'
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: multi_json
43
49
  requirement: !ruby/object:Gem::Requirement
44
50
  requirements:
45
51
  - - "~>"
46
52
  - !ruby/object:Gem::Version
47
- version: '1.3'
53
+ version: '1.15'
48
54
  type: :runtime
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
51
57
  requirements:
52
58
  - - "~>"
53
59
  - !ruby/object:Gem::Version
54
- version: '1.3'
60
+ version: '1.15'
55
61
  - !ruby/object:Gem::Dependency
56
62
  name: typhoeus
57
63
  requirement: !ruby/object:Gem::Requirement
58
64
  requirements:
59
65
  - - "~>"
60
66
  - !ruby/object:Gem::Version
61
- version: 0.7.0
67
+ version: '1.4'
62
68
  type: :runtime
63
69
  prerelease: false
64
70
  version_requirements: !ruby/object:Gem::Requirement
65
71
  requirements:
66
72
  - - "~>"
67
73
  - !ruby/object:Gem::Version
68
- version: 0.7.0
74
+ version: '1.4'
69
75
  - !ruby/object:Gem::Dependency
70
76
  name: bundler
71
77
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +106,14 @@ dependencies:
100
106
  requirements:
101
107
  - - "~>"
102
108
  - !ruby/object:Gem::Version
103
- version: '3.0'
109
+ version: '3.1'
104
110
  type: :development
105
111
  prerelease: false
106
112
  version_requirements: !ruby/object:Gem::Requirement
107
113
  requirements:
108
114
  - - "~>"
109
115
  - !ruby/object:Gem::Version
110
- version: '3.0'
116
+ version: '3.1'
111
117
  - !ruby/object:Gem::Dependency
112
118
  name: json_pure
113
119
  requirement: !ruby/object:Gem::Requirement
@@ -206,7 +212,7 @@ homepage: https://github.com/message-blocks/ramco
206
212
  licenses:
207
213
  - MIT
208
214
  metadata: {}
209
- post_install_message:
215
+ post_install_message:
210
216
  rdoc_options: []
211
217
  require_paths:
212
218
  - lib
@@ -214,15 +220,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
214
220
  requirements:
215
221
  - - ">="
216
222
  - !ruby/object:Gem::Version
217
- version: 2.4.6
223
+ version: 2.6.6
218
224
  required_rubygems_version: !ruby/object:Gem::Requirement
219
225
  requirements:
220
226
  - - ">="
221
227
  - !ruby/object:Gem::Version
222
228
  version: '0'
223
229
  requirements: []
224
- rubygems_version: 3.0.3
225
- signing_key:
230
+ rubygems_version: 3.3.7
231
+ signing_key:
226
232
  specification_version: 4
227
233
  summary: Access RAMCOAMS in ruby.
228
234
  test_files: