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
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 1f15ae71dd55581a16e43cc709b487b4aba346360f21c7d89a7ed5c714f0ff39
4
+ data.tar.gz: 91ead78f639d6198fa6214cfee0855a9115728a447067707034fe22ba6530518
5
+ SHA512:
6
+ metadata.gz: c4073430cf800dbb4638d58c0fb2983976f707641124774a96531930b246b6a4648897df76d7ecc1d9c1de5f88de3da8cfb744ff934f9d7fd44192ceeacf956d
7
+ data.tar.gz: 8590daf3cff5aa4c999aea3a4bf17ebf209a6e01c10bed14f37fbe1317e0ea337bb435f98dd3072dab05ee90087702b1bc3b25ea8dd08c0656719122f7d13f84
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2024-07-19
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at adityakapoor.mait@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in goteamup.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
data/Gemfile.lock ADDED
@@ -0,0 +1,34 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ goteamup (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ diff-lcs (1.5.0)
10
+ rake (13.2.1)
11
+ rspec (3.12.0)
12
+ rspec-core (~> 3.12.0)
13
+ rspec-expectations (~> 3.12.0)
14
+ rspec-mocks (~> 3.12.0)
15
+ rspec-core (3.12.2)
16
+ rspec-support (~> 3.12.0)
17
+ rspec-expectations (3.12.3)
18
+ diff-lcs (>= 1.2.0, < 2.0)
19
+ rspec-support (~> 3.12.0)
20
+ rspec-mocks (3.12.6)
21
+ diff-lcs (>= 1.2.0, < 2.0)
22
+ rspec-support (~> 3.12.0)
23
+ rspec-support (3.12.1)
24
+
25
+ PLATFORMS
26
+ arm64-darwin-21
27
+
28
+ DEPENDENCIES
29
+ goteamup!
30
+ rake (~> 13.0)
31
+ rspec (~> 3.0)
32
+
33
+ BUNDLED WITH
34
+ 2.3.25
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2024 Aditya Kapoor
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # Goteamup
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/goteamup`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Install the gem and add to the application's Gemfile by executing:
10
+
11
+ $ bundle add goteamup
12
+
13
+ If bundler is not being used to manage dependencies, install the gem by executing:
14
+
15
+ $ gem install goteamup
16
+
17
+ ## Usage
18
+
19
+ TODO: Write usage instructions here
20
+
21
+ ## Development
22
+
23
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
24
+
25
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
26
+
27
+ ## Contributing
28
+
29
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/goteamup. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/goteamup/blob/master/CODE_OF_CONDUCT.md).
30
+
31
+ ## License
32
+
33
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
34
+
35
+ ## Code of Conduct
36
+
37
+ Everyone interacting in the Goteamup project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/goteamup/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
@@ -0,0 +1,24 @@
1
+ module Goteamup
2
+ module Attendances
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.confirm(params = {})
12
+ Confirm.call(params)
13
+ end
14
+
15
+ def self.no_show(params = {})
16
+ NoShow.call(params)
17
+ end
18
+ end
19
+ end
20
+
21
+ require_relative './show'
22
+ require_relative './list'
23
+ require_relative './confirm'
24
+ require_relative './no_show'
@@ -0,0 +1,26 @@
1
+ module Goteamup
2
+ module Attendances
3
+ class Confirm < 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
+ end
16
+
17
+ def request_method_klass
18
+ Net::HTTP::Post
19
+ end
20
+
21
+ def endpoint
22
+ "business/v1/attendances/#{params[:id]}/confirm"
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,28 @@
1
+ module Goteamup
2
+ module Attendances
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/attendances#{query}"
19
+ end
20
+
21
+ def query
22
+ return '' if params[:query].blank?
23
+
24
+ "?query=#{params[:query].to_h.to_query}"
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,26 @@
1
+ module Goteamup
2
+ module Attendances
3
+ class NoShow < 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
+ end
16
+
17
+ def request_method_klass
18
+ Net::HTTP::Post
19
+ end
20
+
21
+ def endpoint
22
+ "business/v1/attendances/#{params[:id]}/no_show"
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,22 @@
1
+ module Goteamup
2
+ module Attendances
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,29 @@
1
+ module Goteamup
2
+ module Auth
3
+ class AccessToken < Base
4
+ private
5
+
6
+ def request_params
7
+ {
8
+ client_id: Goteamup.configuration.client_id,
9
+ client_secret: Goteamup.configuration.client_secret,
10
+ response_type: params[:code]
11
+ }
12
+ end
13
+
14
+ def headers
15
+ {
16
+ 'Content-Type': 'multipart/form-data'
17
+ }
18
+ end
19
+
20
+ def request_method_klass
21
+ Net::HTTP::Post
22
+ end
23
+
24
+ def endpoint
25
+ 'auth/access_token'
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,41 @@
1
+ module Goteamup
2
+ module Auth
3
+ class Authorize < Base
4
+
5
+ def make_request
6
+ http = Net::HTTP.new(request_url.hostname, request_url.port)
7
+ http.use_ssl = true
8
+ http.set_debug_output($stdout) unless Rails.env.production?
9
+ request = request_method_klass.new(request_url, request_headers)
10
+ request.set_form request_params, 'multipart/form-data'
11
+ @response = http.request(request)
12
+ end
13
+
14
+ private
15
+
16
+ def request_params
17
+ [
18
+ ['client_id', Goteamup.configuration.client_id],
19
+ ['redirect_uri', Goteamup.configuration.redirect_uri || params[:redirect_uri]],
20
+ ['response_type', 'code'],
21
+ ['scope', params[:scope] || 'read'],
22
+ ['state', params[:state].to_s],
23
+ ]
24
+ end
25
+
26
+ def headers
27
+ {
28
+ 'Content-Type' => 'multipart/form-data'
29
+ }
30
+ end
31
+
32
+ def request_method_klass
33
+ Net::HTTP::Get
34
+ end
35
+
36
+ def endpoint
37
+ 'auth/authorize'
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,14 @@
1
+ module Goteamup
2
+ module Auth
3
+ def self.authorize(params = {})
4
+ Authorize.call(params)
5
+ end
6
+
7
+ def self.access_token(params = {})
8
+ AccessToken.call(params)
9
+ end
10
+ end
11
+ end
12
+
13
+ require_relative './auth/authorize'
14
+ require_relative './auth/access_token'
@@ -0,0 +1,52 @@
1
+ module Goteamup
2
+ class Base
3
+ BASE_URL = 'https://goteamup.com/api'
4
+
5
+ attr_reader :params, :result
6
+
7
+ def self.call(params)
8
+ new(params).tap do |object|
9
+ object.make_request
10
+ object.package_result
11
+ end
12
+ end
13
+
14
+ def initialize(params)
15
+ @params = params
16
+ end
17
+
18
+ def make_request
19
+ http = Net::HTTP.new(request_url.host, request_url.port)
20
+ http.use_ssl = true
21
+ http.set_debug_output($stdout) unless Rails.env.production?
22
+ request = request_method_klass.new(request_url, request_headers)
23
+ request.body = request_params.to_json unless request_method_klass == Net::HTTP::Get
24
+ @response = http.request(request)
25
+ end
26
+
27
+ def package_result
28
+ response = JSON.parse(@response.body) rescue ''
29
+ @result = { response: response, status_code: @response.code, success: success? }
30
+ end
31
+
32
+ private
33
+
34
+ def request_params
35
+ {}
36
+ end
37
+
38
+ def request_headers
39
+ {
40
+ 'Content-Type' => 'application/json'
41
+ }.merge(headers)
42
+ end
43
+
44
+ def request_url
45
+ @request_url ||= URI([BASE_URL, endpoint].join('/'))
46
+ end
47
+
48
+ def success?
49
+ (@response.code.to_i / 100) == 2
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,9 @@
1
+ module Goteamup
2
+ module Business
3
+ def self.show(params = {})
4
+ Show.call(params)
5
+ end
6
+ end
7
+ end
8
+
9
+ require_relative './show'
@@ -0,0 +1,22 @@
1
+ module Goteamup
2
+ module Business
3
+ class Show < Base
4
+ private
5
+
6
+ def headers
7
+ {
8
+ 'Authorization' => Goteamup.configuration.application_token,
9
+ 'Business-ID' => params[: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/business'
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,12 @@
1
+ module Goteamup
2
+ class Config
3
+ attr_accessor :client_id, :client_secret, :application_token, :redirect_uri
4
+
5
+ def initialize(client_id: nil, client_secret: nil, application_token: nil, redirect_uri: nil)
6
+ @client_id = client_id
7
+ @client_secret = client_secret
8
+ @application_token = application_token
9
+ @redirect_uri = redirect_uri
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,31 @@
1
+ module Goteamup
2
+ module Customer
3
+ class AcceptInvite < 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
+ email: params[:email],
16
+ invite_code: params[:invite_code],
17
+ token: params[:token],
18
+ password: params[:password]
19
+ }
20
+ end
21
+
22
+ def request_method_klass
23
+ Net::HTTP::Post
24
+ end
25
+
26
+ def endpoint
27
+ 'business/v1/accept_invite'
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,29 @@
1
+ module Goteamup
2
+ module Customer
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.create(params = {})
12
+ Create.call(params)
13
+ end
14
+
15
+ def self.update(params = {})
16
+ Update.call(params)
17
+ end
18
+
19
+ def self.accept_invite(params = {})
20
+ AcceptInvite.call(params)
21
+ end
22
+ end
23
+ end
24
+
25
+ require_relative './list'
26
+ require_relative './show'
27
+ require_relative './create'
28
+ require_relative './update'
29
+ require_relative './accept_invite'
@@ -0,0 +1,31 @@
1
+ module Goteamup
2
+ module Customer
3
+ class Create < 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
+ email: params[:email],
18
+ fields: params[:fields]
19
+ }
20
+ end
21
+
22
+ def request_method_klass
23
+ Net::HTTP::Post
24
+ end
25
+
26
+ def endpoint
27
+ "business/v1/customers/#{params[:id]}"
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,28 @@
1
+ module Goteamup
2
+ module Customer
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/customers?#{query}"
19
+ end
20
+
21
+ def query
22
+ return '' if params[:query].blank?
23
+
24
+ "?query=#{params[:query].to_h.to_query}"
25
+ end
26
+ end
27
+ end
28
+ end