goteamup 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +3 -0
  3. data/CHANGELOG.md +5 -0
  4. data/CODE_OF_CONDUCT.md +84 -0
  5. data/Gemfile +10 -0
  6. data/Gemfile.lock +34 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +37 -0
  9. data/Rakefile +8 -0
  10. data/lib/goteamup/attendances/base.rb +24 -0
  11. data/lib/goteamup/attendances/confirm.rb +26 -0
  12. data/lib/goteamup/attendances/list.rb +28 -0
  13. data/lib/goteamup/attendances/no_show.rb +26 -0
  14. data/lib/goteamup/attendances/show.rb +22 -0
  15. data/lib/goteamup/auth/access_token.rb +29 -0
  16. data/lib/goteamup/auth/authorize.rb +41 -0
  17. data/lib/goteamup/auth.rb +14 -0
  18. data/lib/goteamup/base.rb +52 -0
  19. data/lib/goteamup/business/base.rb +9 -0
  20. data/lib/goteamup/business/show.rb +22 -0
  21. data/lib/goteamup/config.rb +12 -0
  22. data/lib/goteamup/customer/accept_invite.rb +31 -0
  23. data/lib/goteamup/customer/base.rb +29 -0
  24. data/lib/goteamup/customer/create.rb +31 -0
  25. data/lib/goteamup/customer/list.rb +28 -0
  26. data/lib/goteamup/customer/show.rb +22 -0
  27. data/lib/goteamup/customer/update.rb +30 -0
  28. data/lib/goteamup/customer_membership/base.rb +19 -0
  29. data/lib/goteamup/customer_membership/list.rb +29 -0
  30. data/lib/goteamup/customer_membership/show.rb +22 -0
  31. data/lib/goteamup/customer_membership/usage.rb +28 -0
  32. data/lib/goteamup/event/base.rb +39 -0
  33. data/lib/goteamup/event/cancel.rb +28 -0
  34. data/lib/goteamup/event/cancel_waitlist.rb +28 -0
  35. data/lib/goteamup/event/join_waitlist.rb +28 -0
  36. data/lib/goteamup/event/late_cancel.rb +28 -0
  37. data/lib/goteamup/event/list.rb +28 -0
  38. data/lib/goteamup/event/register.rb +30 -0
  39. data/lib/goteamup/event/show.rb +22 -0
  40. data/lib/goteamup/user/base.rb +14 -0
  41. data/lib/goteamup/user/show.rb +22 -0
  42. data/lib/goteamup/user/update.rb +22 -0
  43. data/lib/goteamup/venue/base.rb +14 -0
  44. data/lib/goteamup/venue/list.rb +22 -0
  45. data/lib/goteamup/venue/show.rb +22 -0
  46. data/lib/goteamup/version.rb +5 -0
  47. data/lib/goteamup.rb +27 -0
  48. metadata +92 -0
@@ -0,0 +1,22 @@
1
+ module Goteamup
2
+ module Customer
3
+ class Show < Base
4
+ private
5
+
6
+ def headers
7
+ {
8
+ 'Authorization' => Goteamup.configuration.application_token,
9
+ 'Business-ID' => params[:business_id].to_s
10
+ }
11
+ end
12
+
13
+ def request_method_klass
14
+ Net::HTTP::Get
15
+ end
16
+
17
+ def endpoint
18
+ "business/v1/customers/#{params[:id]}"
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,30 @@
1
+ module Goteamup
2
+ module Customer
3
+ class Update < Base
4
+ private
5
+
6
+ def headers
7
+ {
8
+ 'Authorization' => Goteamup.configuration.application_token,
9
+ 'Business-ID' => params[:business_id].to_s
10
+ }
11
+ end
12
+
13
+ def request_params
14
+ {
15
+ first_name: params[:first_name],
16
+ last_name: params[:last_name],
17
+ fields: params[:fields]
18
+ }
19
+ end
20
+
21
+ def request_method_klass
22
+ Net::HTTP::Put
23
+ end
24
+
25
+ def endpoint
26
+ "business/v1/customers/#{params[:id]}"
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,19 @@
1
+ module Goteamup
2
+ module CustomerMembership
3
+ def self.list(params = {})
4
+ List.call(params)
5
+ end
6
+
7
+ def self.show(params = {})
8
+ Show.call(params)
9
+ end
10
+
11
+ def self.usage(params = {})
12
+ Usage.call(params)
13
+ end
14
+ end
15
+ end
16
+
17
+ require_relative './show'
18
+ require_relative './list'
19
+ require_relative './usage'
@@ -0,0 +1,29 @@
1
+ module Goteamup
2
+ module CustomerMembership
3
+ class List < Base
4
+ private
5
+
6
+ def headers
7
+ {
8
+ 'Authorization' => Goteamup.configuration.application_token,
9
+ 'Business-ID' => params[:business_id].to_s,
10
+ 'Customer-ID' => params[:customer_id].to_s
11
+ }
12
+ end
13
+
14
+ def request_method_klass
15
+ Net::HTTP::Get
16
+ end
17
+
18
+ def endpoint
19
+ "business/v1/customermemberships#{query}"
20
+ end
21
+
22
+ def query
23
+ return '' if params[:query].blank?
24
+
25
+ "?#{params[:query].to_h.to_query}"
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,22 @@
1
+ module Goteamup
2
+ module CustomerMembership
3
+ class Show < Base
4
+ private
5
+
6
+ def headers
7
+ {
8
+ 'Authorization' => Goteamup.configuration.application_token,
9
+ 'Business-ID' => params[:business_id].to_s
10
+ }
11
+ end
12
+
13
+ def request_method_klass
14
+ Net::HTTP::Get
15
+ end
16
+
17
+ def endpoint
18
+ "business/v1/customermemberships/#{params[:id]}"
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,28 @@
1
+ module Goteamup
2
+ module CustomerMembership
3
+ class Usage < Base
4
+ private
5
+
6
+ def headers
7
+ {
8
+ 'Authorization' => Goteamup.configuration.application_token,
9
+ 'Business-ID' => params[:business_id].to_s
10
+ }
11
+ end
12
+
13
+ def request_method_klass
14
+ Net::HTTP::Get
15
+ end
16
+
17
+ def endpoint
18
+ "business/v1/customermemberships/#{params[:id]}/usage#{query}"
19
+ end
20
+
21
+ def query
22
+ return '' if params[:query].blank?
23
+
24
+ "?#{params[:query].to_h.to_query}"
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,39 @@
1
+ module Goteamup
2
+ module Event
3
+ def self.list(params = {})
4
+ List.call(params)
5
+ end
6
+
7
+ def self.show(params = {})
8
+ Show.call(params)
9
+ end
10
+
11
+ def self.register(params = {})
12
+ Register.call(params)
13
+ end
14
+
15
+ def self.cancel_waitlist(params = {})
16
+ CancelWaitlist.call(params)
17
+ end
18
+
19
+ def self.cancel(params = {})
20
+ Cancel.call(params)
21
+ end
22
+
23
+ def self.join_waitlist(params = {})
24
+ JoinWaitlist.call(params)
25
+ end
26
+
27
+ def self.late_cancel(params = {})
28
+ LateCancel.call(params)
29
+ end
30
+ end
31
+ end
32
+
33
+ require_relative './cancel'
34
+ require_relative './cancel_waitlist'
35
+ require_relative './join_waitlist'
36
+ require_relative './late_cancel'
37
+ require_relative './list'
38
+ require_relative './register'
39
+ require_relative './show'
@@ -0,0 +1,28 @@
1
+ module Goteamup
2
+ module Event
3
+ class Cancel < Base
4
+ private
5
+
6
+ def headers
7
+ {
8
+ 'Authorization' => Goteamup.configuration.application_token,
9
+ 'Business-ID' => params[:business_id].to_s
10
+ }
11
+ end
12
+
13
+ def request_params
14
+ {
15
+ customer: params[:customer]
16
+ }
17
+ end
18
+
19
+ def request_method_klass
20
+ Net::HTTP::Post
21
+ end
22
+
23
+ def endpoint
24
+ "business/v1/events/#{params[:id]}/cancel"
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,28 @@
1
+ module Goteamup
2
+ module Event
3
+ class CancelWaitlist < Base
4
+ private
5
+
6
+ def headers
7
+ {
8
+ 'Authorization' => Goteamup.configuration.application_token,
9
+ 'Business-ID' => params[:business_id].to_s
10
+ }
11
+ end
12
+
13
+ def request_params
14
+ {
15
+ customer: params[:customer]
16
+ }
17
+ end
18
+
19
+ def request_method_klass
20
+ Net::HTTP::Post
21
+ end
22
+
23
+ def endpoint
24
+ "business/v1/events/#{params[:id]}/cancel_waitlist"
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,28 @@
1
+ module Goteamup
2
+ module Event
3
+ class JoinWaitlist < Base
4
+ private
5
+
6
+ def headers
7
+ {
8
+ 'Authorization' => Goteamup.configuration.application_token,
9
+ 'Business-ID' => params[:business_id].to_s
10
+ }
11
+ end
12
+
13
+ def request_params
14
+ {
15
+ customer: params[:customer]
16
+ }
17
+ end
18
+
19
+ def request_method_klass
20
+ Net::HTTP::Post
21
+ end
22
+
23
+ def endpoint
24
+ "business/v1/events/#{params[:id]}/join_waitlist"
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,28 @@
1
+ module Goteamup
2
+ module Event
3
+ class LateCancel < Base
4
+ private
5
+
6
+ def headers
7
+ {
8
+ 'Authorization' => Goteamup.configuration.application_token,
9
+ 'Business-ID' => params[:business_id].to_s
10
+ }
11
+ end
12
+
13
+ def request_params
14
+ {
15
+ customer: params[:customer]
16
+ }
17
+ end
18
+
19
+ def request_method_klass
20
+ Net::HTTP::Post
21
+ end
22
+
23
+ def endpoint
24
+ "business/v1/events/#{params[:id]}/late_cancel"
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,28 @@
1
+ module Goteamup
2
+ module Event
3
+ class List < Base
4
+ private
5
+
6
+ def headers
7
+ {
8
+ 'Authorization' => Goteamup.configuration.application_token,
9
+ 'Business-ID' => params[:business_id].to_s
10
+ }
11
+ end
12
+
13
+ def request_method_klass
14
+ Net::HTTP::Get
15
+ end
16
+
17
+ def endpoint
18
+ "business/v1/events#{query}"
19
+ end
20
+
21
+ def query
22
+ return '' if params[:query].blank?
23
+
24
+ "?#{params[:query].to_h.to_query}"
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,30 @@
1
+ module Goteamup
2
+ module Event
3
+ class Register < Base
4
+ private
5
+
6
+ def headers
7
+ {
8
+ 'Authorization' => Goteamup.configuration.application_token,
9
+ 'Business-ID' => params[:business_id].to_s
10
+ }
11
+ end
12
+
13
+ def request_params
14
+ {
15
+ customer: params[:customer],
16
+ comped: params[:comped],
17
+ customer_membership: params[:customer_membership],
18
+ }
19
+ end
20
+
21
+ def request_method_klass
22
+ Net::HTTP::Post
23
+ end
24
+
25
+ def endpoint
26
+ "business/v1/events/#{params[:id]}/register"
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,22 @@
1
+ module Goteamup
2
+ module Event
3
+ class Show < Base
4
+ private
5
+
6
+ def headers
7
+ {
8
+ 'Authorization' => Goteamup.configuration.application_token,
9
+ 'Business-ID' => params[:business_id].to_s
10
+ }
11
+ end
12
+
13
+ def request_method_klass
14
+ Net::HTTP::Get
15
+ end
16
+
17
+ def endpoint
18
+ "business/v1/events/#{params[:id]}"
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,14 @@
1
+ module Goteamup
2
+ module User
3
+ def self.show(params = {})
4
+ Show.call(params)
5
+ end
6
+
7
+ def self.update(params = {})
8
+ Update.call(params)
9
+ end
10
+ end
11
+ end
12
+
13
+ require_relative './update'
14
+ require_relative './show'
@@ -0,0 +1,22 @@
1
+ module Goteamup
2
+ module User
3
+ class Show < Base
4
+ private
5
+
6
+ def headers
7
+ {
8
+ 'Authorization' => Goteamup.configuration.application_token,
9
+ 'Business-ID' => params[:business_id].to_s
10
+ }
11
+ end
12
+
13
+ def request_method_klass
14
+ Net::HTTP::Get
15
+ end
16
+
17
+ def endpoint
18
+ 'business/v1/user'
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ module Goteamup
2
+ module User
3
+ class Show < Base
4
+ private
5
+
6
+ def headers
7
+ {
8
+ 'Authorization' => Goteamup.configuration.application_token,
9
+ 'Business-ID' => params[:business_id].to_s
10
+ }
11
+ end
12
+
13
+ def request_method_klass
14
+ Net::HTTP::Post
15
+ end
16
+
17
+ def endpoint
18
+ 'business/v1/user'
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,14 @@
1
+ module Goteamup
2
+ module Venue
3
+ def self.list(params = {})
4
+ List.call(params)
5
+ end
6
+
7
+ def self.show(params = {})
8
+ Show.call(params)
9
+ end
10
+ end
11
+ end
12
+
13
+ require_relative './list'
14
+ require_relative './show'
@@ -0,0 +1,22 @@
1
+ module Goteamup
2
+ module Venue
3
+ class List < Base
4
+ private
5
+
6
+ def headers
7
+ {
8
+ 'Authorization' => Goteamup.configuration.application_token,
9
+ 'Business-ID' => params[:business_id].to_s
10
+ }
11
+ end
12
+
13
+ def request_method_klass
14
+ Net::HTTP::Get
15
+ end
16
+
17
+ def endpoint
18
+ 'business/v1/venues'
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ module Goteamup
2
+ module Venue
3
+ class Show < Base
4
+ private
5
+
6
+ def headers
7
+ {
8
+ 'Authorization' => Goteamup.configuration.application_token,
9
+ 'Business-ID' => params[:business_id].to_s
10
+ }
11
+ end
12
+
13
+ def request_method_klass
14
+ Net::HTTP::Get
15
+ end
16
+
17
+ def endpoint
18
+ "business/v1/attendances/#{params[:id]}"
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Goteamup
4
+ VERSION = "0.1.0"
5
+ end
data/lib/goteamup.rb ADDED
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "goteamup/version"
4
+
5
+ module Goteamup
6
+ class Error < StandardError; end
7
+
8
+ class << self
9
+ attr_accessor :configuration
10
+
11
+ def configure
12
+ self.configuration ||= Config.new
13
+ yield(configuration)
14
+ end
15
+ end
16
+ end
17
+
18
+ require_relative 'goteamup/config'
19
+ require_relative 'goteamup/base'
20
+ require_relative 'goteamup/auth'
21
+ require_relative 'goteamup/attendances/base'
22
+ require_relative 'goteamup/business/base'
23
+ require_relative 'goteamup/customer/base'
24
+ require_relative 'goteamup/customer_membership/base'
25
+ require_relative 'goteamup/user/base'
26
+ require_relative 'goteamup/venue/base'
27
+ require_relative 'goteamup/event/base'
metadata ADDED
@@ -0,0 +1,92 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: goteamup
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Aditya Kapoor
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2024-07-19 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Ruby wrapper around the GoTeamup API.
14
+ email:
15
+ - adityakapoor.mait@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".rspec"
21
+ - CHANGELOG.md
22
+ - CODE_OF_CONDUCT.md
23
+ - Gemfile
24
+ - Gemfile.lock
25
+ - LICENSE.txt
26
+ - README.md
27
+ - Rakefile
28
+ - lib/goteamup.rb
29
+ - lib/goteamup/attendances/base.rb
30
+ - lib/goteamup/attendances/confirm.rb
31
+ - lib/goteamup/attendances/list.rb
32
+ - lib/goteamup/attendances/no_show.rb
33
+ - lib/goteamup/attendances/show.rb
34
+ - lib/goteamup/auth.rb
35
+ - lib/goteamup/auth/access_token.rb
36
+ - lib/goteamup/auth/authorize.rb
37
+ - lib/goteamup/base.rb
38
+ - lib/goteamup/business/base.rb
39
+ - lib/goteamup/business/show.rb
40
+ - lib/goteamup/config.rb
41
+ - lib/goteamup/customer/accept_invite.rb
42
+ - lib/goteamup/customer/base.rb
43
+ - lib/goteamup/customer/create.rb
44
+ - lib/goteamup/customer/list.rb
45
+ - lib/goteamup/customer/show.rb
46
+ - lib/goteamup/customer/update.rb
47
+ - lib/goteamup/customer_membership/base.rb
48
+ - lib/goteamup/customer_membership/list.rb
49
+ - lib/goteamup/customer_membership/show.rb
50
+ - lib/goteamup/customer_membership/usage.rb
51
+ - lib/goteamup/event/base.rb
52
+ - lib/goteamup/event/cancel.rb
53
+ - lib/goteamup/event/cancel_waitlist.rb
54
+ - lib/goteamup/event/join_waitlist.rb
55
+ - lib/goteamup/event/late_cancel.rb
56
+ - lib/goteamup/event/list.rb
57
+ - lib/goteamup/event/register.rb
58
+ - lib/goteamup/event/show.rb
59
+ - lib/goteamup/user/base.rb
60
+ - lib/goteamup/user/show.rb
61
+ - lib/goteamup/user/update.rb
62
+ - lib/goteamup/venue/base.rb
63
+ - lib/goteamup/venue/list.rb
64
+ - lib/goteamup/venue/show.rb
65
+ - lib/goteamup/version.rb
66
+ homepage: https://github.com/goteamup-ruby
67
+ licenses:
68
+ - MIT
69
+ metadata:
70
+ homepage_uri: https://github.com/goteamup-ruby
71
+ source_code_uri: https://github.com/goteamup-ruby
72
+ changelog_uri: https://github.com/goteamup-ruby
73
+ post_install_message:
74
+ rdoc_options: []
75
+ require_paths:
76
+ - lib
77
+ required_ruby_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: 2.6.0
82
+ required_rubygems_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ requirements: []
88
+ rubygems_version: 3.2.33
89
+ signing_key:
90
+ specification_version: 4
91
+ summary: Ruby wrapper around the GoTeamup API.
92
+ test_files: []