roqua-core-api 0.2.3 → 0.2.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 684f4a6cbec3185083dc457c736c3fb63b1b567a
4
- data.tar.gz: 2fc3f48a9f305c1ec6eb1ec2400592f07b55e7cd
3
+ metadata.gz: 9a4c4f6f88862ed1b7cd926af421153f10bf8199
4
+ data.tar.gz: d0f78eb13ea7b153bf388b1512225a62c571530b
5
5
  SHA512:
6
- metadata.gz: 6b051a343c8ac695cfb19646c1fc19fb429e26efa71b375f1a51012785701f11d42e5e3ace83212ae166ab6d97df68b3ff25780be90ef0dc197d153fa91bfb5d
7
- data.tar.gz: fcef952a87d0206325f58f86e3fcecfba61306f797dc43020eb729967555d968fe63e097ba3787c62515b0f40b28608cfd2bb4f293dd9b46f30bf7e99c3e6dea
6
+ metadata.gz: 754c820ef19069a062e6470e78175e93b157d6766f380b33c87c80f99cbab02b48cb1c384c8a0b2dd66b55af24e2f899229b4dccf5ce406ea4b2653452042f6d
7
+ data.tar.gz: 916e9fe188cbd2abd3d966592c85c6ceb6984a6e04241028ea1da455701dec9529cf520572abc8d2e08d93485d5515153fb9898b9e97e1285e237814e460d15a
data/ChangeLog.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 0.2.4
2
+
3
+ * Add SendTextMessage
4
+
1
5
  ### 0.2.3
2
6
 
3
7
  * Update httparty dependency
@@ -0,0 +1,23 @@
1
+ module Roqua
2
+ module CoreApi
3
+ # @api private
4
+ class SendTextMessageTo < ActiveInteraction::Base
5
+ string :person_id
6
+ hash :attributes do
7
+ string :body
8
+ string :reference, default: nil
9
+ end
10
+ string :username, default: ENV['CORE_BASICAUTH_ID']
11
+ string :password, default: ENV['CORE_BASICAUTH_SECRET']
12
+
13
+ # Possible variables in the body are:
14
+ # %firstname%,
15
+ # %lastname%,
16
+ # %initials%
17
+ def execute
18
+ CoreApi.basic_auth_session(username: username, password: password)
19
+ .post "/text_messages", text_message: attributes, person_id: person_id
20
+ end
21
+ end
22
+ end
23
+ end
@@ -1,5 +1,5 @@
1
1
  module Roqua
2
2
  module CoreApi
3
- VERSION = '0.2.3'
3
+ VERSION = '0.2.4'
4
4
  end
5
5
  end
@@ -24,6 +24,7 @@ module Roqua
24
24
  autoload :People
25
25
  autoload :Person
26
26
  autoload :SendEmailTo
27
+ autoload :SendTextMessageTo
27
28
  autoload :SendInviteEmail
28
29
  autoload :SsoLogin
29
30
  autoload :UpdatePerson
@@ -0,0 +1,14 @@
1
+ require 'spec_helper'
2
+
3
+ describe SendTextMessageTo do
4
+ let(:session) { Sessions::BasicAuthSession.new }
5
+ before { allow(Sessions::BasicAuthSession).to receive(:new).and_return session }
6
+
7
+ it 'performs a post on the text_messages api path providing the person_id and the text_message attributes' do
8
+ text_message_attributes = { body: 'some_body',
9
+ reference: 'some_reference'}
10
+ expect(session).to receive(:post).with '/text_messages', person_id: 'some_person_id',
11
+ text_message: text_message_attributes
12
+ SendTextMessageTo.run!(person_id: 'some_person_id', attributes: text_message_attributes)
13
+ end
14
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roqua-core-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marten Veldthuis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-12 00:00:00.000000000 Z
11
+ date: 2016-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -207,6 +207,7 @@ files:
207
207
  - lib/roqua/core_api/person.rb
208
208
  - lib/roqua/core_api/send_email_to.rb
209
209
  - lib/roqua/core_api/send_invite_email.rb
210
+ - lib/roqua/core_api/send_text_message_to.rb
210
211
  - lib/roqua/core_api/sessions.rb
211
212
  - lib/roqua/core_api/sessions/auth_session.rb
212
213
  - lib/roqua/core_api/sessions/basic_auth_session.rb
@@ -234,6 +235,7 @@ files:
234
235
  - spec/lib/roqua/core_api/models/person_spec.rb
235
236
  - spec/lib/roqua/core_api/send_email_to_spec.rb
236
237
  - spec/lib/roqua/core_api/send_invite_email_spec.rb
238
+ - spec/lib/roqua/core_api/send_text_message_to_spec.rb
237
239
  - spec/lib/roqua/core_api/sessions/auth_session_spec.rb
238
240
  - spec/lib/roqua/core_api/sessions/basic_auth_session_spec.rb
239
241
  - spec/lib/roqua/core_api/sessions/oauth_session_spec.rb
@@ -280,6 +282,7 @@ test_files:
280
282
  - spec/lib/roqua/core_api/models/person_spec.rb
281
283
  - spec/lib/roqua/core_api/send_email_to_spec.rb
282
284
  - spec/lib/roqua/core_api/send_invite_email_spec.rb
285
+ - spec/lib/roqua/core_api/send_text_message_to_spec.rb
283
286
  - spec/lib/roqua/core_api/sessions/auth_session_spec.rb
284
287
  - spec/lib/roqua/core_api/sessions/basic_auth_session_spec.rb
285
288
  - spec/lib/roqua/core_api/sessions/oauth_session_spec.rb
@@ -287,3 +290,4 @@ test_files:
287
290
  - spec/lib/roqua/core_api/update_dossier_spec.rb
288
291
  - spec/spec_helper.rb
289
292
  - spec/support/httpparty_helpers.rb
293
+ has_rdoc: