clever_tap_dubit 0.3.2
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 +7 -0
- data/.gitignore +13 -0
- data/.rspec +1 -0
- data/.rubocop.yml +48 -0
- data/.travis.yml +6 -0
- data/Gemfile +16 -0
- data/LICENSE.txt +21 -0
- data/README.md +164 -0
- data/Rakefile +6 -0
- data/bin/console +8 -0
- data/bin/setup +8 -0
- data/clever_tap.gemspec +33 -0
- data/lib/clever_tap/client.rb +113 -0
- data/lib/clever_tap/config.rb +25 -0
- data/lib/clever_tap/entity.rb +87 -0
- data/lib/clever_tap/event.rb +30 -0
- data/lib/clever_tap/failed_response.rb +28 -0
- data/lib/clever_tap/profile.rb +7 -0
- data/lib/clever_tap/response.rb +34 -0
- data/lib/clever_tap/successful_response.rb +30 -0
- data/lib/clever_tap/uploader.rb +72 -0
- data/lib/clever_tap/version.rb +3 -0
- data/lib/clever_tap.rb +79 -0
- data/lib/clevertap-ruby.rb +1 -0
- data/spec/factories/profile.rb +36 -0
- data/spec/integrations/clever_tap_spec.rb +81 -0
- data/spec/rubocop_spec.rb +12 -0
- data/spec/shared/clever_tap_client.rb +13 -0
- data/spec/shared/entity.rb +105 -0
- data/spec/spec_helper.rb +18 -0
- data/spec/units/clever_tap_client_spec.rb +277 -0
- data/spec/units/clever_tap_spec.rb +88 -0
- data/spec/units/event_spec.rb +43 -0
- data/spec/units/failed_response_spec.rb +31 -0
- data/spec/units/profile_spec.rb +29 -0
- data/spec/units/response_spec.rb +63 -0
- data/spec/units/successful_response_spec.rb +112 -0
- data/spec/units/uploader_spec.rb +129 -0
- data/spec/vcr_cassettes/CleverTap/uploading_a_many_profiles/when_only_some_are_valid/partially_succeds.yml +42 -0
- data/spec/vcr_cassettes/CleverTap/uploading_a_profile/when_is_invalid/fails.yml +41 -0
- data/spec/vcr_cassettes/CleverTap/uploading_a_profile/when_is_valid/succeed.yml +35 -0
- data/spec/vcr_cassettes/CleverTap/uploading_an_event/when_is_valid/succeed.yml +34 -0
- data/spec/vcr_cassettes/CleverTap_Client/_upload/when_upload_records_are_homogenous/and_invalid_records/calls_on_failed_upload_once.yml +38 -0
- data/spec/vcr_cassettes/CleverTap_Client/_upload/when_upload_records_are_homogenous/and_invalid_records/returns_an_array_with_one_failed_Response_object.yml +38 -0
- data/spec/vcr_cassettes/CleverTap_Client/_upload/when_upload_records_are_homogenous/and_valid_records/and_objects_do_not_fit_upload_limit_/calls_on_successful_upload_proc_twice.yml +67 -0
- data/spec/vcr_cassettes/CleverTap_Client/_upload/when_upload_records_are_homogenous/and_valid_records/and_objects_do_not_fit_upload_limit_/returns_an_array_with_two_successful_Response_objects.yml +67 -0
- data/spec/vcr_cassettes/CleverTap_Client/_upload/when_upload_records_are_homogenous/and_valid_records/and_objects_fit_upload_limit_/calls_on_successful_upload_proc_once.yml +36 -0
- data/spec/vcr_cassettes/CleverTap_Client/_upload/when_upload_records_are_homogenous/and_valid_records/and_objects_fit_upload_limit_/returns_an_array_with_one_successful_Response_object.yml +36 -0
- data/spec/vcr_cassettes/CleverTap_Uploader/_call/when_age_is_invalid/behaves_like_validation_failure/failed_to_upload_the_profiles.yml +48 -0
- data/spec/vcr_cassettes/CleverTap_Uploader/_call/when_education_status_is_invalid/behaves_like_validation_failure/failed_to_upload_the_profiles.yml +49 -0
- data/spec/vcr_cassettes/CleverTap_Uploader/_call/when_email_is_invalid/behaves_like_validation_failure/failed_to_upload_the_profiles.yml +48 -0
- data/spec/vcr_cassettes/CleverTap_Uploader/_call/when_employment_status_is_invalid/behaves_like_validation_failure/failed_to_upload_the_profiles.yml +48 -0
- data/spec/vcr_cassettes/CleverTap_Uploader/_call/when_marital_status_is_invalid/behaves_like_validation_failure/failed_to_upload_the_profiles.yml +48 -0
- data/spec/vcr_cassettes/CleverTap_Uploader/_call/when_phone_is_invalid/behaves_like_validation_failure/failed_to_upload_the_profiles.yml +48 -0
- data/spec/vcr_cassettes/CleverTap_Uploader/_call/when_the_creation_date_field_is_missing/behaves_like_validation_failure/failed_to_upload_the_profiles.yml +48 -0
- data/spec/vcr_cassettes/CleverTap_Uploader/_call/with_invalid_credentials/failed_to_upload_the_profiles.yml +36 -0
- data/spec/vcr_cassettes/CleverTap_Uploader/_call/with_valid_data/makes_successful_upload.yml +36 -0
- data/spec/vcr_config.rb +13 -0
- metadata +192 -0
@@ -0,0 +1,48 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.clevertap.com/1/upload
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"d":[{"identity":"3","ts":1521649265,"type":"profile","profileData":{"identity":3,"created_at":"2018-03-21
|
9
|
+
18:21:05 +0200","Name":"John Rush","Email":"1234","Gender":"M","Phone":"+35922333232","Employed":"Y","Education":"Graduate","Married":"Y","Age":"18"}},{"identity":"4","ts":1521649265,"type":"profile","profileData":{"identity":4,"created_at":"2018-03-21
|
10
|
+
18:21:05 +0200","Name":"John Rush","Email":"1234","Gender":"M","Phone":"+35922333232","Employed":"Y","Education":"Graduate","Married":"Y","Age":"18"}}]}'
|
11
|
+
headers:
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
X-CleverTap-Account-Id:
|
15
|
+
- fake_account_id
|
16
|
+
X-CleverTap-Passcode:
|
17
|
+
- fake_passcode
|
18
|
+
User-Agent:
|
19
|
+
- Faraday v0.14.0
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
content-type:
|
26
|
+
- application/json;charset=utf-8
|
27
|
+
content-length:
|
28
|
+
- '945'
|
29
|
+
connection:
|
30
|
+
- Close
|
31
|
+
body:
|
32
|
+
encoding: UTF-8
|
33
|
+
string: '{ "status" : "fail" , "processed" : 0 , "unprocessed" : [ { "status"
|
34
|
+
: "fail" , "code" : 515 , "error" : "Profile data is incorrect. Email is not
|
35
|
+
valid.Skipped record number : 1" , "record" : { "identity" : "3" , "ts" :
|
36
|
+
1521649265 , "type" : "profile" , "profileData" : { "identity" : 3 , "created_at"
|
37
|
+
: "2018-03-21 18:21:05 +0200" , "Name" : "John Rush" , "Email" : "1234" ,
|
38
|
+
"Gender" : "M" , "Phone" : "+35922333232" , "Employed" : "Y" , "Education"
|
39
|
+
: "Graduate" , "Married" : "Y" , "Age" : "18"}}} , { "status" : "fail" , "code"
|
40
|
+
: 515 , "error" : "Profile data is incorrect. Email is not valid.Skipped record
|
41
|
+
number : 2" , "record" : { "identity" : "4" , "ts" : 1521649265 , "type" :
|
42
|
+
"profile" , "profileData" : { "identity" : 4 , "created_at" : "2018-03-21
|
43
|
+
18:21:05 +0200" , "Name" : "John Rush" , "Email" : "1234" , "Gender" : "M"
|
44
|
+
, "Phone" : "+35922333232" , "Employed" : "Y" , "Education" : "Graduate" ,
|
45
|
+
"Married" : "Y" , "Age" : "18"}}}]}'
|
46
|
+
http_version:
|
47
|
+
recorded_at: Wed, 21 Mar 2018 16:21:05 GMT
|
48
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,48 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.clevertap.com/1/upload
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"d":[{"identity":"7","ts":1521649266,"type":"profile","profileData":{"identity":7,"created_at":"2018-03-21
|
9
|
+
18:21:06 +0200","Name":"John Rush","Email":"example@gmail.com","Gender":"M","Phone":"+35922333232","Employed":"223","Education":"Graduate","Married":"Y","Age":"18"}},{"identity":"8","ts":1521649266,"type":"profile","profileData":{"identity":8,"created_at":"2018-03-21
|
10
|
+
18:21:06 +0200","Name":"John Rush","Email":"example@gmail.com","Gender":"M","Phone":"+35922333232","Employed":"123","Education":"Graduate","Married":"Y","Age":"18"}}]}'
|
11
|
+
headers:
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
X-CleverTap-Account-Id:
|
15
|
+
- fake_account_id
|
16
|
+
X-CleverTap-Passcode:
|
17
|
+
- fake_passcode
|
18
|
+
User-Agent:
|
19
|
+
- Faraday v0.14.0
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
content-type:
|
26
|
+
- application/json;charset=utf-8
|
27
|
+
content-length:
|
28
|
+
- '981'
|
29
|
+
connection:
|
30
|
+
- Close
|
31
|
+
body:
|
32
|
+
encoding: UTF-8
|
33
|
+
string: '{ "status" : "fail" , "processed" : 0 , "unprocessed" : [ { "status"
|
34
|
+
: "fail" , "code" : 517 , "error" : "Profile data is incorrect. Employed needs
|
35
|
+
to be Y/N.Skipped record number : 1" , "record" : { "identity" : "7" , "ts"
|
36
|
+
: 1521649266 , "type" : "profile" , "profileData" : { "identity" : 7 , "created_at"
|
37
|
+
: "2018-03-21 18:21:06 +0200" , "Name" : "John Rush" , "Email" : "example@gmail.com"
|
38
|
+
, "Gender" : "M" , "Phone" : 35922333232 , "Employed" : "223" , "Education"
|
39
|
+
: "Graduate" , "Married" : "Y" , "Age" : "18"}}} , { "status" : "fail" , "code"
|
40
|
+
: 517 , "error" : "Profile data is incorrect. Employed needs to be Y/N.Skipped
|
41
|
+
record number : 2" , "record" : { "identity" : "8" , "ts" : 1521649266 , "type"
|
42
|
+
: "profile" , "profileData" : { "identity" : 8 , "created_at" : "2018-03-21
|
43
|
+
18:21:06 +0200" , "Name" : "John Rush" , "Email" : "example@gmail.com" , "Gender"
|
44
|
+
: "M" , "Phone" : 35922333232 , "Employed" : "123" , "Education" : "Graduate"
|
45
|
+
, "Married" : "Y" , "Age" : "18"}}}]}'
|
46
|
+
http_version:
|
47
|
+
recorded_at: Wed, 21 Mar 2018 16:21:06 GMT
|
48
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,48 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.clevertap.com/1/upload
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"d":[{"identity":"11","ts":1521649266,"type":"profile","profileData":{"identity":11,"created_at":"2018-03-21
|
9
|
+
18:21:06 +0200","Name":"John Rush","Email":"example@gmail.com","Gender":"M","Phone":"+35922333232","Employed":"Y","Education":"Graduate","Married":"223","Age":"18"}},{"identity":"12","ts":1521649266,"type":"profile","profileData":{"identity":12,"created_at":"2018-03-21
|
10
|
+
18:21:06 +0200","Name":"John Rush","Email":"example@gmail.com","Gender":"M","Phone":"+35922333232","Employed":"Y","Education":"Graduate","Married":"123","Age":"18"}}]}'
|
11
|
+
headers:
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
X-CleverTap-Account-Id:
|
15
|
+
- fake_account_id
|
16
|
+
X-CleverTap-Passcode:
|
17
|
+
- fake_passcode
|
18
|
+
User-Agent:
|
19
|
+
- Faraday v0.14.0
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
content-type:
|
26
|
+
- application/json;charset=utf-8
|
27
|
+
content-length:
|
28
|
+
- '983'
|
29
|
+
connection:
|
30
|
+
- Close
|
31
|
+
body:
|
32
|
+
encoding: UTF-8
|
33
|
+
string: '{ "status" : "fail" , "processed" : 0 , "unprocessed" : [ { "status"
|
34
|
+
: "fail" , "code" : 519 , "error" : "Profile data is incorrect. Married needs
|
35
|
+
to be Y/N.Skipped record number : 1" , "record" : { "identity" : "11" , "ts"
|
36
|
+
: 1521649266 , "type" : "profile" , "profileData" : { "identity" : 11 , "created_at"
|
37
|
+
: "2018-03-21 18:21:06 +0200" , "Name" : "John Rush" , "Email" : "example@gmail.com"
|
38
|
+
, "Gender" : "M" , "Phone" : 35922333232 , "Employed" : "Y" , "Education"
|
39
|
+
: "Graduate" , "Married" : "223" , "Age" : "18"}}} , { "status" : "fail" ,
|
40
|
+
"code" : 519 , "error" : "Profile data is incorrect. Married needs to be Y/N.Skipped
|
41
|
+
record number : 2" , "record" : { "identity" : "12" , "ts" : 1521649266 ,
|
42
|
+
"type" : "profile" , "profileData" : { "identity" : 12 , "created_at" : "2018-03-21
|
43
|
+
18:21:06 +0200" , "Name" : "John Rush" , "Email" : "example@gmail.com" , "Gender"
|
44
|
+
: "M" , "Phone" : 35922333232 , "Employed" : "Y" , "Education" : "Graduate"
|
45
|
+
, "Married" : "123" , "Age" : "18"}}}]}'
|
46
|
+
http_version:
|
47
|
+
recorded_at: Wed, 21 Mar 2018 16:21:06 GMT
|
48
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,48 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.clevertap.com/1/upload
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"d":[{"identity":"5","ts":1521649265,"type":"profile","profileData":{"identity":5,"created_at":"2018-03-21
|
9
|
+
18:21:05 +0200","Name":"John Rush","Email":"example@gmail.com","Gender":"M","Phone":"223","Employed":"Y","Education":"Graduate","Married":"Y","Age":"18"}},{"identity":"6","ts":1521649265,"type":"profile","profileData":{"identity":6,"created_at":"2018-03-21
|
10
|
+
18:21:05 +0200","Name":"John Rush","Email":"example@gmail.com","Gender":"M","Phone":"123","Employed":"Y","Education":"Graduate","Married":"Y","Age":"18"}}]}'
|
11
|
+
headers:
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
X-CleverTap-Account-Id:
|
15
|
+
- fake_account_id
|
16
|
+
X-CleverTap-Passcode:
|
17
|
+
- fake_passcode
|
18
|
+
User-Agent:
|
19
|
+
- Faraday v0.14.0
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
content-type:
|
26
|
+
- application/json;charset=utf-8
|
27
|
+
content-length:
|
28
|
+
- '967'
|
29
|
+
connection:
|
30
|
+
- Close
|
31
|
+
body:
|
32
|
+
encoding: UTF-8
|
33
|
+
string: '{ "status" : "fail" , "processed" : 0 , "unprocessed" : [ { "status"
|
34
|
+
: "fail" , "code" : 516 , "error" : "Profile data is incorrect. Phone number
|
35
|
+
is not valid.Skipped record number : 1" , "record" : { "identity" : "5" ,
|
36
|
+
"ts" : 1521649265 , "type" : "profile" , "profileData" : { "identity" : 5
|
37
|
+
, "created_at" : "2018-03-21 18:21:05 +0200" , "Name" : "John Rush" , "Email"
|
38
|
+
: "example@gmail.com" , "Gender" : "M" , "Phone" : "223" , "Employed" : "Y"
|
39
|
+
, "Education" : "Graduate" , "Married" : "Y" , "Age" : "18"}}} , { "status"
|
40
|
+
: "fail" , "code" : 516 , "error" : "Profile data is incorrect. Phone number
|
41
|
+
is not valid.Skipped record number : 2" , "record" : { "identity" : "6" ,
|
42
|
+
"ts" : 1521649265 , "type" : "profile" , "profileData" : { "identity" : 6
|
43
|
+
, "created_at" : "2018-03-21 18:21:05 +0200" , "Name" : "John Rush" , "Email"
|
44
|
+
: "example@gmail.com" , "Gender" : "M" , "Phone" : "123" , "Employed" : "Y"
|
45
|
+
, "Education" : "Graduate" , "Married" : "Y" , "Age" : "18"}}}]}'
|
46
|
+
http_version:
|
47
|
+
recorded_at: Wed, 21 Mar 2018 16:21:06 GMT
|
48
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,48 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.clevertap.com/1/upload
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"d":[{"identity":"17","ts":0,"type":"profile","profileData":{"identity":17,"created_at":"2018-03-21
|
9
|
+
18:21:07 +0200","Name":"John Rush","Email":"example@gmail.com","Gender":"M","Phone":"+35922333232","Employed":"Y","Education":"Graduate","Married":"Y","Age":"18"}},{"identity":"18","ts":0,"type":"profile","profileData":{"identity":18,"created_at":"2018-03-21
|
10
|
+
18:21:07 +0200","Name":"John Rush","Email":"example@gmail.com","Gender":"M","Phone":"+35922333232","Employed":"Y","Education":"Graduate","Married":"Y","Age":"18"}}]}'
|
11
|
+
headers:
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
X-CleverTap-Account-Id:
|
15
|
+
- fake_account_id
|
16
|
+
X-CleverTap-Passcode:
|
17
|
+
- fake_passcode
|
18
|
+
User-Agent:
|
19
|
+
- Faraday v0.14.0
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
content-type:
|
26
|
+
- application/json;charset=utf-8
|
27
|
+
content-length:
|
28
|
+
- '973'
|
29
|
+
connection:
|
30
|
+
- Close
|
31
|
+
body:
|
32
|
+
encoding: UTF-8
|
33
|
+
string: '{ "status" : "fail" , "processed" : 0 , "unprocessed" : [ { "status"
|
34
|
+
: "fail" , "code" : 525 , "error" : "Timestamp should be present in the Unix
|
35
|
+
Epoch format. Skipped record number : 1" , "record" : { "identity" : "17"
|
36
|
+
, "ts" : 0 , "type" : "profile" , "profileData" : { "identity" : 17 , "created_at"
|
37
|
+
: "2018-03-21 18:21:07 +0200" , "Name" : "John Rush" , "Email" : "example@gmail.com"
|
38
|
+
, "Gender" : "M" , "Phone" : "+35922333232" , "Employed" : "Y" , "Education"
|
39
|
+
: "Graduate" , "Married" : "Y" , "Age" : "18"}}} , { "status" : "fail" , "code"
|
40
|
+
: 525 , "error" : "Timestamp should be present in the Unix Epoch format. Skipped
|
41
|
+
record number : 2" , "record" : { "identity" : "18" , "ts" : 0 , "type" :
|
42
|
+
"profile" , "profileData" : { "identity" : 18 , "created_at" : "2018-03-21
|
43
|
+
18:21:07 +0200" , "Name" : "John Rush" , "Email" : "example@gmail.com" , "Gender"
|
44
|
+
: "M" , "Phone" : "+35922333232" , "Employed" : "Y" , "Education" : "Graduate"
|
45
|
+
, "Married" : "Y" , "Age" : "18"}}}]}'
|
46
|
+
http_version:
|
47
|
+
recorded_at: Wed, 21 Mar 2018 16:21:07 GMT
|
48
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,36 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.clevertap.com/1/upload
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"d":[{"identity":"19","ts":1521649267,"type":"profile","profileData":{"identity":19,"created_at":"2018-03-21
|
9
|
+
18:21:07 +0200","Name":"John Rush","Email":"example@gmail.com","Gender":"M","Phone":"+35922333232","Employed":"Y","Education":"Graduate","Married":"Y","Age":"18"}}]}'
|
10
|
+
headers:
|
11
|
+
Content-Type:
|
12
|
+
- application/json
|
13
|
+
X-CleverTap-Account-Id:
|
14
|
+
- fake_account_id
|
15
|
+
X-CleverTap-Passcode:
|
16
|
+
- fake_passcode
|
17
|
+
User-Agent:
|
18
|
+
- Faraday v0.14.0
|
19
|
+
response:
|
20
|
+
status:
|
21
|
+
code: 401
|
22
|
+
message: Unauthorized
|
23
|
+
headers:
|
24
|
+
content-type:
|
25
|
+
- application/json;charset=utf-8
|
26
|
+
content-length:
|
27
|
+
- '73'
|
28
|
+
connection:
|
29
|
+
- Close
|
30
|
+
body:
|
31
|
+
encoding: UTF-8
|
32
|
+
string: '{ "status" : "fail" , "error" : "Account ID is not valid" , "code"
|
33
|
+
: 401}'
|
34
|
+
http_version:
|
35
|
+
recorded_at: Wed, 21 Mar 2018 16:21:07 GMT
|
36
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,36 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.clevertap.com/1/upload
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"d":[{"identity":"1","ts":1521649265,"type":"profile","profileData":{"identity":1,"created_at":"2018-03-21
|
9
|
+
18:21:05 +0200","Name":"John Rush","Email":"example@gmail.com","Gender":"M","Phone":"+35922333232","Employed":"Y","Education":"Graduate","Married":"Y","Age":"18"}},{"identity":"2","ts":1521649265,"type":"profile","profileData":{"identity":2,"created_at":"2018-03-21
|
10
|
+
18:21:05 +0200","Name":"John Rush","Email":"example@gmail.com","Gender":"M","Phone":"+35922333232","Employed":"Y","Education":"Graduate","Married":"Y","Age":"18"}}]}'
|
11
|
+
headers:
|
12
|
+
Content-Type:
|
13
|
+
- application/json
|
14
|
+
X-CleverTap-Account-Id:
|
15
|
+
- fake_account_id
|
16
|
+
X-CleverTap-Passcode:
|
17
|
+
- fake_passcode
|
18
|
+
User-Agent:
|
19
|
+
- Faraday v0.14.0
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
content-type:
|
26
|
+
- application/json;charset=utf-8
|
27
|
+
content-length:
|
28
|
+
- '63'
|
29
|
+
connection:
|
30
|
+
- Close
|
31
|
+
body:
|
32
|
+
encoding: UTF-8
|
33
|
+
string: '{ "status" : "success" , "processed" : 2 , "unprocessed" : [ ]}'
|
34
|
+
http_version:
|
35
|
+
recorded_at: Wed, 21 Mar 2018 16:21:05 GMT
|
36
|
+
recorded_with: VCR 4.0.0
|
data/spec/vcr_config.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
VCR.configure do |config|
|
2
|
+
config.cassette_library_dir = "#{File.dirname(__FILE__)}/vcr_cassettes"
|
3
|
+
config.hook_into :faraday
|
4
|
+
config.configure_rspec_metadata!
|
5
|
+
config.allow_http_connections_when_no_cassette = true
|
6
|
+
|
7
|
+
config.before_record do |record|
|
8
|
+
record.request.headers.merge!(
|
9
|
+
CleverTap::Client::ACCOUNT_HEADER => ['fake_account_id'],
|
10
|
+
CleverTap::Client::PASSCODE_HEADER => ['fake_passcode']
|
11
|
+
)
|
12
|
+
end
|
13
|
+
end
|
metadata
ADDED
@@ -0,0 +1,192 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: clever_tap_dubit
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.3.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kamen Kanev
|
8
|
+
- Svetoslav Blyahov
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2021-12-21 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: faraday
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '1.0'
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '1.0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: json
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: bundler
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">"
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '1.14'
|
49
|
+
type: :development
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">"
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '1.14'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: rake
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '10.0'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '10.0'
|
70
|
+
description: Gem providing easy access to the CleverTap API
|
71
|
+
email:
|
72
|
+
- opensource@tradeo.com
|
73
|
+
executables: []
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- ".gitignore"
|
78
|
+
- ".rspec"
|
79
|
+
- ".rubocop.yml"
|
80
|
+
- ".travis.yml"
|
81
|
+
- Gemfile
|
82
|
+
- LICENSE.txt
|
83
|
+
- README.md
|
84
|
+
- Rakefile
|
85
|
+
- bin/console
|
86
|
+
- bin/setup
|
87
|
+
- clever_tap.gemspec
|
88
|
+
- lib/clever_tap.rb
|
89
|
+
- lib/clever_tap/client.rb
|
90
|
+
- lib/clever_tap/config.rb
|
91
|
+
- lib/clever_tap/entity.rb
|
92
|
+
- lib/clever_tap/event.rb
|
93
|
+
- lib/clever_tap/failed_response.rb
|
94
|
+
- lib/clever_tap/profile.rb
|
95
|
+
- lib/clever_tap/response.rb
|
96
|
+
- lib/clever_tap/successful_response.rb
|
97
|
+
- lib/clever_tap/uploader.rb
|
98
|
+
- lib/clever_tap/version.rb
|
99
|
+
- lib/clevertap-ruby.rb
|
100
|
+
- spec/factories/profile.rb
|
101
|
+
- spec/integrations/clever_tap_spec.rb
|
102
|
+
- spec/rubocop_spec.rb
|
103
|
+
- spec/shared/clever_tap_client.rb
|
104
|
+
- spec/shared/entity.rb
|
105
|
+
- spec/spec_helper.rb
|
106
|
+
- spec/units/clever_tap_client_spec.rb
|
107
|
+
- spec/units/clever_tap_spec.rb
|
108
|
+
- spec/units/event_spec.rb
|
109
|
+
- spec/units/failed_response_spec.rb
|
110
|
+
- spec/units/profile_spec.rb
|
111
|
+
- spec/units/response_spec.rb
|
112
|
+
- spec/units/successful_response_spec.rb
|
113
|
+
- spec/units/uploader_spec.rb
|
114
|
+
- spec/vcr_cassettes/CleverTap/uploading_a_many_profiles/when_only_some_are_valid/partially_succeds.yml
|
115
|
+
- spec/vcr_cassettes/CleverTap/uploading_a_profile/when_is_invalid/fails.yml
|
116
|
+
- spec/vcr_cassettes/CleverTap/uploading_a_profile/when_is_valid/succeed.yml
|
117
|
+
- spec/vcr_cassettes/CleverTap/uploading_an_event/when_is_valid/succeed.yml
|
118
|
+
- spec/vcr_cassettes/CleverTap_Client/_upload/when_upload_records_are_homogenous/and_invalid_records/calls_on_failed_upload_once.yml
|
119
|
+
- spec/vcr_cassettes/CleverTap_Client/_upload/when_upload_records_are_homogenous/and_invalid_records/returns_an_array_with_one_failed_Response_object.yml
|
120
|
+
- spec/vcr_cassettes/CleverTap_Client/_upload/when_upload_records_are_homogenous/and_valid_records/and_objects_do_not_fit_upload_limit_/calls_on_successful_upload_proc_twice.yml
|
121
|
+
- spec/vcr_cassettes/CleverTap_Client/_upload/when_upload_records_are_homogenous/and_valid_records/and_objects_do_not_fit_upload_limit_/returns_an_array_with_two_successful_Response_objects.yml
|
122
|
+
- spec/vcr_cassettes/CleverTap_Client/_upload/when_upload_records_are_homogenous/and_valid_records/and_objects_fit_upload_limit_/calls_on_successful_upload_proc_once.yml
|
123
|
+
- spec/vcr_cassettes/CleverTap_Client/_upload/when_upload_records_are_homogenous/and_valid_records/and_objects_fit_upload_limit_/returns_an_array_with_one_successful_Response_object.yml
|
124
|
+
- spec/vcr_cassettes/CleverTap_Uploader/_call/when_age_is_invalid/behaves_like_validation_failure/failed_to_upload_the_profiles.yml
|
125
|
+
- spec/vcr_cassettes/CleverTap_Uploader/_call/when_education_status_is_invalid/behaves_like_validation_failure/failed_to_upload_the_profiles.yml
|
126
|
+
- spec/vcr_cassettes/CleverTap_Uploader/_call/when_email_is_invalid/behaves_like_validation_failure/failed_to_upload_the_profiles.yml
|
127
|
+
- spec/vcr_cassettes/CleverTap_Uploader/_call/when_employment_status_is_invalid/behaves_like_validation_failure/failed_to_upload_the_profiles.yml
|
128
|
+
- spec/vcr_cassettes/CleverTap_Uploader/_call/when_marital_status_is_invalid/behaves_like_validation_failure/failed_to_upload_the_profiles.yml
|
129
|
+
- spec/vcr_cassettes/CleverTap_Uploader/_call/when_phone_is_invalid/behaves_like_validation_failure/failed_to_upload_the_profiles.yml
|
130
|
+
- spec/vcr_cassettes/CleverTap_Uploader/_call/when_the_creation_date_field_is_missing/behaves_like_validation_failure/failed_to_upload_the_profiles.yml
|
131
|
+
- spec/vcr_cassettes/CleverTap_Uploader/_call/with_invalid_credentials/failed_to_upload_the_profiles.yml
|
132
|
+
- spec/vcr_cassettes/CleverTap_Uploader/_call/with_valid_data/makes_successful_upload.yml
|
133
|
+
- spec/vcr_config.rb
|
134
|
+
homepage: https://github.com/tradeo/clevertap-ruby
|
135
|
+
licenses:
|
136
|
+
- MIT
|
137
|
+
metadata:
|
138
|
+
allowed_push_host: https://rubygems.org
|
139
|
+
post_install_message:
|
140
|
+
rdoc_options: []
|
141
|
+
require_paths:
|
142
|
+
- lib
|
143
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
144
|
+
requirements:
|
145
|
+
- - ">="
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
version: '0'
|
148
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
requirements: []
|
154
|
+
rubygems_version: 3.2.22
|
155
|
+
signing_key:
|
156
|
+
specification_version: 4
|
157
|
+
summary: CleverTap API client
|
158
|
+
test_files:
|
159
|
+
- spec/factories/profile.rb
|
160
|
+
- spec/integrations/clever_tap_spec.rb
|
161
|
+
- spec/rubocop_spec.rb
|
162
|
+
- spec/shared/clever_tap_client.rb
|
163
|
+
- spec/shared/entity.rb
|
164
|
+
- spec/spec_helper.rb
|
165
|
+
- spec/units/clever_tap_client_spec.rb
|
166
|
+
- spec/units/clever_tap_spec.rb
|
167
|
+
- spec/units/event_spec.rb
|
168
|
+
- spec/units/failed_response_spec.rb
|
169
|
+
- spec/units/profile_spec.rb
|
170
|
+
- spec/units/response_spec.rb
|
171
|
+
- spec/units/successful_response_spec.rb
|
172
|
+
- spec/units/uploader_spec.rb
|
173
|
+
- spec/vcr_cassettes/CleverTap/uploading_a_many_profiles/when_only_some_are_valid/partially_succeds.yml
|
174
|
+
- spec/vcr_cassettes/CleverTap/uploading_a_profile/when_is_invalid/fails.yml
|
175
|
+
- spec/vcr_cassettes/CleverTap/uploading_a_profile/when_is_valid/succeed.yml
|
176
|
+
- spec/vcr_cassettes/CleverTap/uploading_an_event/when_is_valid/succeed.yml
|
177
|
+
- spec/vcr_cassettes/CleverTap_Client/_upload/when_upload_records_are_homogenous/and_invalid_records/calls_on_failed_upload_once.yml
|
178
|
+
- spec/vcr_cassettes/CleverTap_Client/_upload/when_upload_records_are_homogenous/and_invalid_records/returns_an_array_with_one_failed_Response_object.yml
|
179
|
+
- spec/vcr_cassettes/CleverTap_Client/_upload/when_upload_records_are_homogenous/and_valid_records/and_objects_do_not_fit_upload_limit_/calls_on_successful_upload_proc_twice.yml
|
180
|
+
- spec/vcr_cassettes/CleverTap_Client/_upload/when_upload_records_are_homogenous/and_valid_records/and_objects_do_not_fit_upload_limit_/returns_an_array_with_two_successful_Response_objects.yml
|
181
|
+
- spec/vcr_cassettes/CleverTap_Client/_upload/when_upload_records_are_homogenous/and_valid_records/and_objects_fit_upload_limit_/calls_on_successful_upload_proc_once.yml
|
182
|
+
- spec/vcr_cassettes/CleverTap_Client/_upload/when_upload_records_are_homogenous/and_valid_records/and_objects_fit_upload_limit_/returns_an_array_with_one_successful_Response_object.yml
|
183
|
+
- spec/vcr_cassettes/CleverTap_Uploader/_call/when_age_is_invalid/behaves_like_validation_failure/failed_to_upload_the_profiles.yml
|
184
|
+
- spec/vcr_cassettes/CleverTap_Uploader/_call/when_education_status_is_invalid/behaves_like_validation_failure/failed_to_upload_the_profiles.yml
|
185
|
+
- spec/vcr_cassettes/CleverTap_Uploader/_call/when_email_is_invalid/behaves_like_validation_failure/failed_to_upload_the_profiles.yml
|
186
|
+
- spec/vcr_cassettes/CleverTap_Uploader/_call/when_employment_status_is_invalid/behaves_like_validation_failure/failed_to_upload_the_profiles.yml
|
187
|
+
- spec/vcr_cassettes/CleverTap_Uploader/_call/when_marital_status_is_invalid/behaves_like_validation_failure/failed_to_upload_the_profiles.yml
|
188
|
+
- spec/vcr_cassettes/CleverTap_Uploader/_call/when_phone_is_invalid/behaves_like_validation_failure/failed_to_upload_the_profiles.yml
|
189
|
+
- spec/vcr_cassettes/CleverTap_Uploader/_call/when_the_creation_date_field_is_missing/behaves_like_validation_failure/failed_to_upload_the_profiles.yml
|
190
|
+
- spec/vcr_cassettes/CleverTap_Uploader/_call/with_invalid_credentials/failed_to_upload_the_profiles.yml
|
191
|
+
- spec/vcr_cassettes/CleverTap_Uploader/_call/with_valid_data/makes_successful_upload.yml
|
192
|
+
- spec/vcr_config.rb
|