kentaa-api 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +23 -0
  3. data/.rubocop.yml +1 -0
  4. data/Gemfile.lock +14 -14
  5. data/README.md +64 -21
  6. data/lib/kentaa/api.rb +4 -24
  7. data/lib/kentaa/api/client.rb +24 -24
  8. data/lib/kentaa/api/config.rb +6 -3
  9. data/lib/kentaa/api/request.rb +2 -2
  10. data/lib/kentaa/api/resources/action.rb +6 -2
  11. data/lib/kentaa/api/resources/base.rb +18 -5
  12. data/lib/kentaa/api/resources/donation_form.rb +7 -3
  13. data/lib/kentaa/api/resources/list.rb +61 -3
  14. data/lib/kentaa/api/resources/performance.rb +62 -0
  15. data/lib/kentaa/api/resources/project.rb +11 -3
  16. data/lib/kentaa/api/resources/recurring_donor.rb +1 -1
  17. data/lib/kentaa/api/resources/segment.rb +15 -3
  18. data/lib/kentaa/api/resources/site.rb +3 -3
  19. data/lib/kentaa/api/{clients → resources}/sites.rb +1 -1
  20. data/lib/kentaa/api/resources/team.rb +2 -2
  21. data/lib/kentaa/api/resources/user.rb +0 -6
  22. data/lib/kentaa/api/resources/users.rb +5 -32
  23. data/lib/kentaa/api/util.rb +13 -0
  24. data/lib/kentaa/api/version.rb +1 -1
  25. metadata +6 -25
  26. data/.travis.yml +0 -11
  27. data/lib/kentaa/api/clients/actions.rb +0 -34
  28. data/lib/kentaa/api/clients/base.rb +0 -15
  29. data/lib/kentaa/api/clients/donation_forms.rb +0 -24
  30. data/lib/kentaa/api/clients/donations.rb +0 -24
  31. data/lib/kentaa/api/clients/manual_donations.rb +0 -39
  32. data/lib/kentaa/api/clients/newsletter_subscriptions.rb +0 -24
  33. data/lib/kentaa/api/clients/projects.rb +0 -24
  34. data/lib/kentaa/api/clients/recurring_donors.rb +0 -24
  35. data/lib/kentaa/api/clients/segments.rb +0 -24
  36. data/lib/kentaa/api/clients/teams.rb +0 -24
  37. data/lib/kentaa/api/clients/users.rb +0 -39
  38. data/lib/kentaa/api/finder.rb +0 -44
  39. data/lib/kentaa/api/resources/actions.rb +0 -40
  40. data/lib/kentaa/api/resources/donation_forms.rb +0 -35
  41. data/lib/kentaa/api/resources/donations.rb +0 -35
  42. data/lib/kentaa/api/resources/manual_donations.rb +0 -40
  43. data/lib/kentaa/api/resources/newsletter_subscriptions.rb +0 -35
  44. data/lib/kentaa/api/resources/projects.rb +0 -35
  45. data/lib/kentaa/api/resources/recurring_donors.rb +0 -35
  46. data/lib/kentaa/api/resources/segments.rb +0 -35
  47. data/lib/kentaa/api/resources/teams.rb +0 -35
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Kentaa
4
+ module Api
5
+ module Util
6
+ module_function
7
+
8
+ def pluralize(string)
9
+ "#{string}s"
10
+ end
11
+ end
12
+ end
13
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Kentaa
4
4
  module Api
5
- VERSION = "0.5.0"
5
+ VERSION = "0.6.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kentaa-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kentaa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-04-16 00:00:00.000000000 Z
11
+ date: 2021-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -79,10 +79,10 @@ executables: []
79
79
  extensions: []
80
80
  extra_rdoc_files: []
81
81
  files:
82
+ - ".github/workflows/test.yml"
82
83
  - ".gitignore"
83
84
  - ".rspec"
84
85
  - ".rubocop.yml"
85
- - ".travis.yml"
86
86
  - Gemfile
87
87
  - Gemfile.lock
88
88
  - LICENSE.txt
@@ -93,24 +93,10 @@ files:
93
93
  - kentaa-api.gemspec
94
94
  - lib/kentaa/api.rb
95
95
  - lib/kentaa/api/client.rb
96
- - lib/kentaa/api/clients/actions.rb
97
- - lib/kentaa/api/clients/base.rb
98
- - lib/kentaa/api/clients/donation_forms.rb
99
- - lib/kentaa/api/clients/donations.rb
100
- - lib/kentaa/api/clients/manual_donations.rb
101
- - lib/kentaa/api/clients/newsletter_subscriptions.rb
102
- - lib/kentaa/api/clients/projects.rb
103
- - lib/kentaa/api/clients/recurring_donors.rb
104
- - lib/kentaa/api/clients/segments.rb
105
- - lib/kentaa/api/clients/sites.rb
106
- - lib/kentaa/api/clients/teams.rb
107
- - lib/kentaa/api/clients/users.rb
108
96
  - lib/kentaa/api/config.rb
109
97
  - lib/kentaa/api/exception.rb
110
- - lib/kentaa/api/finder.rb
111
98
  - lib/kentaa/api/request.rb
112
99
  - lib/kentaa/api/resources/action.rb
113
- - lib/kentaa/api/resources/actions.rb
114
100
  - lib/kentaa/api/resources/activity.rb
115
101
  - lib/kentaa/api/resources/address.rb
116
102
  - lib/kentaa/api/resources/banner.rb
@@ -119,33 +105,28 @@ files:
119
105
  - lib/kentaa/api/resources/contact.rb
120
106
  - lib/kentaa/api/resources/donation.rb
121
107
  - lib/kentaa/api/resources/donation_form.rb
122
- - lib/kentaa/api/resources/donation_forms.rb
123
- - lib/kentaa/api/resources/donations.rb
124
108
  - lib/kentaa/api/resources/error.rb
125
109
  - lib/kentaa/api/resources/list.rb
126
110
  - lib/kentaa/api/resources/location.rb
127
111
  - lib/kentaa/api/resources/manual_donation.rb
128
- - lib/kentaa/api/resources/manual_donations.rb
129
112
  - lib/kentaa/api/resources/newsletter_subscription.rb
130
- - lib/kentaa/api/resources/newsletter_subscriptions.rb
113
+ - lib/kentaa/api/resources/performance.rb
131
114
  - lib/kentaa/api/resources/photo.rb
132
115
  - lib/kentaa/api/resources/project.rb
133
- - lib/kentaa/api/resources/projects.rb
134
116
  - lib/kentaa/api/resources/question.rb
135
117
  - lib/kentaa/api/resources/recurring_donor.rb
136
- - lib/kentaa/api/resources/recurring_donors.rb
137
118
  - lib/kentaa/api/resources/registration_fee.rb
138
119
  - lib/kentaa/api/resources/resource.rb
139
120
  - lib/kentaa/api/resources/reward.rb
140
121
  - lib/kentaa/api/resources/segment.rb
141
- - lib/kentaa/api/resources/segments.rb
142
122
  - lib/kentaa/api/resources/site.rb
123
+ - lib/kentaa/api/resources/sites.rb
143
124
  - lib/kentaa/api/resources/team.rb
144
- - lib/kentaa/api/resources/teams.rb
145
125
  - lib/kentaa/api/resources/user.rb
146
126
  - lib/kentaa/api/resources/users.rb
147
127
  - lib/kentaa/api/resources/video.rb
148
128
  - lib/kentaa/api/response.rb
129
+ - lib/kentaa/api/util.rb
149
130
  - lib/kentaa/api/version.rb
150
131
  homepage: https://github.com/KentaaNL/kentaa-api
151
132
  licenses:
data/.travis.yml DELETED
@@ -1,11 +0,0 @@
1
- language: ruby
2
- sudo: false
3
- cache: bundler
4
- before_install:
5
- - gem update --system
6
- rvm:
7
- - 2.4.10
8
- - 2.5.9
9
- - 2.6.7
10
- - 2.7.3
11
- - 3.0.1
@@ -1,34 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Kentaa
4
- module Api
5
- module Clients
6
- class Actions < Base
7
- def all(options = {})
8
- actions = Kentaa::Api::Resources::Actions.new(config, options)
9
- actions.all
10
- end
11
-
12
- def list(options = {})
13
- actions = Kentaa::Api::Resources::Actions.new(config, options)
14
- actions.load
15
- end
16
-
17
- def get(id, options = {})
18
- action = Kentaa::Api::Resources::Action.new(config, id: id, options: options)
19
- action.load
20
- end
21
-
22
- def create(attributes = {}, options = {})
23
- action = Kentaa::Api::Resources::Actions.new(config, options)
24
- action.create(attributes)
25
- end
26
-
27
- def update(id, attributes = {}, options = {})
28
- action = Kentaa::Api::Resources::Action.new(config, id: id, options: options)
29
- action.save(attributes)
30
- end
31
- end
32
- end
33
- end
34
- end
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Kentaa
4
- module Api
5
- module Clients
6
- class Base
7
- attr_reader :config
8
-
9
- def initialize(config)
10
- @config = config
11
- end
12
- end
13
- end
14
- end
15
- end
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Kentaa
4
- module Api
5
- module Clients
6
- class DonationForms < Base
7
- def all(options = {})
8
- donation_forms = Kentaa::Api::Resources::DonationForms.new(config, options)
9
- donation_forms.all
10
- end
11
-
12
- def list(options = {})
13
- donation_forms = Kentaa::Api::Resources::DonationForms.new(config, options)
14
- donation_forms.load
15
- end
16
-
17
- def get(id, options = {})
18
- donation_form = Kentaa::Api::Resources::DonationForm.new(config, id: id, options: options)
19
- donation_form.load
20
- end
21
- end
22
- end
23
- end
24
- end
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Kentaa
4
- module Api
5
- module Clients
6
- class Donations < Base
7
- def all(options = {})
8
- donations = Kentaa::Api::Resources::Donations.new(config, options)
9
- donations.all
10
- end
11
-
12
- def list(options = {})
13
- donations = Kentaa::Api::Resources::Donations.new(config, options)
14
- donations.load
15
- end
16
-
17
- def get(id, options = {})
18
- donation = Kentaa::Api::Resources::Donation.new(config, id: id, options: options)
19
- donation.load
20
- end
21
- end
22
- end
23
- end
24
- end
@@ -1,39 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Kentaa
4
- module Api
5
- module Clients
6
- class ManualDonations < Base
7
- def all(options = {})
8
- donations = Kentaa::Api::Resources::ManualDonations.new(config, options)
9
- donations.all
10
- end
11
-
12
- def list(options = {})
13
- donations = Kentaa::Api::Resources::ManualDonations.new(config, options)
14
- donations.load
15
- end
16
-
17
- def get(id, options = {})
18
- donation = Kentaa::Api::Resources::ManualDonation.new(config, id: id, options: options)
19
- donation.load
20
- end
21
-
22
- def create(attributes = {}, options = {})
23
- donation = Kentaa::Api::Resources::ManualDonations.new(config, options)
24
- donation.create(attributes)
25
- end
26
-
27
- def update(id, attributes = {}, options = {})
28
- donation = Kentaa::Api::Resources::ManualDonation.new(config, id: id, options: options)
29
- donation.save(attributes)
30
- end
31
-
32
- def delete(id, options = {})
33
- donation = Kentaa::Api::Resources::ManualDonation.new(config, id: id, options: options)
34
- donation.delete
35
- end
36
- end
37
- end
38
- end
39
- end
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Kentaa
4
- module Api
5
- module Clients
6
- class NewsletterSubscriptions < Base
7
- def all(options = {})
8
- newsletter_subscriptions = Kentaa::Api::Resources::NewsletterSubscriptions.new(config, options)
9
- newsletter_subscriptions.all
10
- end
11
-
12
- def list(options = {})
13
- newsletter_subscriptions = Kentaa::Api::Resources::NewsletterSubscriptions.new(config, options)
14
- newsletter_subscriptions.load
15
- end
16
-
17
- def get(id, options = {})
18
- newsletter_subscription = Kentaa::Api::Resources::NewsletterSubscription.new(config, id: id, options: options)
19
- newsletter_subscription.load
20
- end
21
- end
22
- end
23
- end
24
- end
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Kentaa
4
- module Api
5
- module Clients
6
- class Projects < Base
7
- def all(options = {})
8
- projects = Kentaa::Api::Resources::Projects.new(config, options)
9
- projects.all
10
- end
11
-
12
- def list(options = {})
13
- projects = Kentaa::Api::Resources::Projects.new(config, options)
14
- projects.load
15
- end
16
-
17
- def get(id, options = {})
18
- project = Kentaa::Api::Resources::Project.new(config, id: id, options: options)
19
- project.load
20
- end
21
- end
22
- end
23
- end
24
- end
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Kentaa
4
- module Api
5
- module Clients
6
- class RecurringDonors < Base
7
- def all(options = {})
8
- recurring_donors = Kentaa::Api::Resources::RecurringDonors.new(config, options)
9
- recurring_donors.all
10
- end
11
-
12
- def list(options = {})
13
- recurring_donors = Kentaa::Api::Resources::RecurringDonors.new(config, options)
14
- recurring_donors.load
15
- end
16
-
17
- def get(id, options = {})
18
- recurring_donor = Kentaa::Api::Resources::RecurringDonor.new(config, id: id, options: options)
19
- recurring_donor.load
20
- end
21
- end
22
- end
23
- end
24
- end
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Kentaa
4
- module Api
5
- module Clients
6
- class Segments < Base
7
- def all(options = {})
8
- segments = Kentaa::Api::Resources::Segments.new(config, options)
9
- segments.all
10
- end
11
-
12
- def list(options = {})
13
- segments = Kentaa::Api::Resources::Segments.new(config, options)
14
- segments.load
15
- end
16
-
17
- def get(id, options = {})
18
- segment = Kentaa::Api::Resources::Segment.new(config, id: id, options: options)
19
- segment.load
20
- end
21
- end
22
- end
23
- end
24
- end
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Kentaa
4
- module Api
5
- module Clients
6
- class Teams < Base
7
- def all(options = {})
8
- teams = Kentaa::Api::Resources::Teams.new(config, options)
9
- teams.all
10
- end
11
-
12
- def list(options = {})
13
- teams = Kentaa::Api::Resources::Teams.new(config, options)
14
- teams.load
15
- end
16
-
17
- def get(id, options = {})
18
- team = Kentaa::Api::Resources::Team.new(config, id: id, options: options)
19
- team.load
20
- end
21
- end
22
- end
23
- end
24
- end
@@ -1,39 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Kentaa
4
- module Api
5
- module Clients
6
- class Users < Base
7
- def all(options = {})
8
- users = Kentaa::Api::Resources::Users.new(config, options)
9
- users.all
10
- end
11
-
12
- def list(options = {})
13
- users = Kentaa::Api::Resources::Users.new(config, options)
14
- users.load
15
- end
16
-
17
- def get(id, options = {})
18
- user = Kentaa::Api::Resources::User.new(config, id: id, options: options)
19
- user.load
20
- end
21
-
22
- def create(attributes = {}, options = {})
23
- user = Kentaa::Api::Resources::Users.new(config, options)
24
- user.create(attributes)
25
- end
26
-
27
- def update(id, attributes = {}, options = {})
28
- user = Kentaa::Api::Resources::User.new(config, id: id, options: options)
29
- user.save(attributes)
30
- end
31
-
32
- def auth(attributes = {}, options = {})
33
- user = Kentaa::Api::Resources::Users.new(config, options)
34
- user.auth(attributes)
35
- end
36
- end
37
- end
38
- end
39
- end
@@ -1,44 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Kentaa
4
- module Api
5
- class Finder
6
- attr_reader :config
7
-
8
- def initialize(config)
9
- @config = config
10
- end
11
-
12
- def by_object_key(object_key)
13
- klass, id = object_key.split("_")
14
-
15
- case klass
16
- when "Action"
17
- client = Kentaa::Api::Clients::Actions.new(config)
18
- client.get(id)
19
- when "Donation"
20
- client = Kentaa::Api::Clients::Donations.new(config)
21
- client.get(id)
22
- when "NewsletterSubscription"
23
- client = Kentaa::Api::Clients::NewsletterSubscriptions.new(config)
24
- client.get(id)
25
- when "Project"
26
- client = Kentaa::Api::Clients::Projects.new(config)
27
- client.get(id)
28
- when "Segment"
29
- client = Kentaa::Api::Clients::Segments.new(config)
30
- client.get(id)
31
- when "Site"
32
- client = Kentaa::Api::Clients::Sites.new(config)
33
- client.current
34
- when "Team"
35
- client = Kentaa::Api::Clients::Teams.new(config)
36
- client.get(id)
37
- when "User"
38
- client = Kentaa::Api::Clients::Users.new(config)
39
- client.get(id)
40
- end
41
- end
42
- end
43
- end
44
- end