gonebusy-ruby-client 0.0.9 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +29 -68
  3. data/lib/gonebusy/api_helper.rb +181 -149
  4. data/lib/gonebusy/configuration.rb +51 -16
  5. data/lib/gonebusy/controllers/base_controller.rb +46 -45
  6. data/lib/gonebusy/controllers/bookings_controller.rb +257 -293
  7. data/lib/gonebusy/controllers/categories_controller.rb +151 -180
  8. data/lib/gonebusy/controllers/pricing_models_controller.rb +202 -241
  9. data/lib/gonebusy/controllers/resources_controller.rb +295 -355
  10. data/lib/gonebusy/controllers/schedules_controller.rb +361 -428
  11. data/lib/gonebusy/controllers/search_controller.rb +52 -63
  12. data/lib/gonebusy/controllers/services_controller.rb +310 -367
  13. data/lib/gonebusy/controllers/users_controller.rb +199 -239
  14. data/lib/gonebusy/exceptions/api_exception.rb +16 -16
  15. data/lib/gonebusy/exceptions/entities_error_error_exception.rb +27 -0
  16. data/lib/gonebusy/exceptions/entities_error_exception.rb +26 -26
  17. data/lib/gonebusy/gonebusy_client.rb +58 -58
  18. data/lib/gonebusy/http/auth/custom_auth.rb +15 -15
  19. data/lib/gonebusy/http/faraday_client.rb +43 -41
  20. data/lib/gonebusy/http/http_call_back.rb +17 -17
  21. data/lib/gonebusy/http/http_client.rb +84 -82
  22. data/lib/gonebusy/http/http_context.rb +15 -15
  23. data/lib/gonebusy/http/http_method_enum.rb +7 -7
  24. data/lib/gonebusy/http/http_request.rb +44 -44
  25. data/lib/gonebusy/http/http_response.rb +19 -19
  26. data/lib/gonebusy/models/base_model.rb +31 -31
  27. data/lib/gonebusy/models/cancel_booking_by_id_response.rb +35 -35
  28. data/lib/gonebusy/models/create_booking_body.rb +134 -80
  29. data/lib/gonebusy/models/create_booking_response.rb +35 -35
  30. data/lib/gonebusy/models/create_category_body.rb +71 -71
  31. data/lib/gonebusy/models/create_category_response.rb +35 -35
  32. data/lib/gonebusy/models/create_pricing_model_body.rb +80 -80
  33. data/lib/gonebusy/models/create_pricing_model_response.rb +35 -35
  34. data/lib/gonebusy/models/create_resource_body.rb +89 -89
  35. data/lib/gonebusy/models/create_resource_response.rb +35 -35
  36. data/lib/gonebusy/models/create_schedule_body.rb +143 -144
  37. data/lib/gonebusy/models/create_schedule_response.rb +35 -35
  38. data/lib/gonebusy/models/create_schedule_time_window_body.rb +116 -117
  39. data/lib/gonebusy/models/create_schedule_time_window_response.rb +35 -35
  40. data/lib/gonebusy/models/create_service_body.rb +107 -107
  41. data/lib/gonebusy/models/create_service_response.rb +35 -35
  42. data/lib/gonebusy/models/create_user_body.rb +89 -89
  43. data/lib/gonebusy/models/create_user_response.rb +35 -35
  44. data/lib/gonebusy/models/date_recurs_by_enum.rb +12 -12
  45. data/lib/gonebusy/models/delete_resource_by_id_response.rb +35 -35
  46. data/lib/gonebusy/models/delete_schedule_by_id_response.rb +35 -35
  47. data/lib/gonebusy/models/delete_schedule_time_window_by_id_response.rb +35 -35
  48. data/lib/gonebusy/models/delete_service_by_id_response.rb +35 -35
  49. data/lib/gonebusy/models/entities_address_entity.rb +116 -116
  50. data/lib/gonebusy/models/entities_availability_response.rb +58 -58
  51. data/lib/gonebusy/models/entities_booking_response.rb +71 -71
  52. data/lib/gonebusy/models/entities_category_response.rb +98 -98
  53. data/lib/gonebusy/models/entities_pricing_model_response.rb +89 -89
  54. data/lib/gonebusy/models/entities_resource_availabilities.rb +49 -49
  55. data/lib/gonebusy/models/entities_resource_response.rb +107 -107
  56. data/lib/gonebusy/models/entities_schedule_response.rb +76 -76
  57. data/lib/gonebusy/models/entities_search_response.rb +54 -54
  58. data/lib/gonebusy/models/entities_service_response.rb +134 -130
  59. data/lib/gonebusy/models/entities_slots.rb +44 -45
  60. data/lib/gonebusy/models/entities_thing_type_response.rb +44 -44
  61. data/lib/gonebusy/models/entities_time_window_response.rb +134 -135
  62. data/lib/gonebusy/models/entities_user_response.rb +152 -152
  63. data/lib/gonebusy/models/frequency_enum.rb +17 -17
  64. data/lib/gonebusy/models/gender_enum.rb +9 -9
  65. data/lib/gonebusy/models/get_booking_by_id_response.rb +35 -35
  66. data/lib/gonebusy/models/get_bookings_response.rb +40 -40
  67. data/lib/gonebusy/models/get_categories_response.rb +40 -40
  68. data/lib/gonebusy/models/get_category_by_id_response.rb +35 -35
  69. data/lib/gonebusy/models/get_pricing_model_by_id_response.rb +35 -35
  70. data/lib/gonebusy/models/get_pricing_models_response.rb +40 -40
  71. data/lib/gonebusy/models/get_resource_by_id_response.rb +35 -35
  72. data/lib/gonebusy/models/get_resource_things_response.rb +40 -40
  73. data/lib/gonebusy/models/get_resources_response.rb +40 -40
  74. data/lib/gonebusy/models/get_schedule_by_id_response.rb +35 -35
  75. data/lib/gonebusy/models/get_schedules_response.rb +40 -40
  76. data/lib/gonebusy/models/get_service_available_slots_by_id_response.rb +35 -35
  77. data/lib/gonebusy/models/get_service_by_id_response.rb +35 -35
  78. data/lib/gonebusy/models/get_services_response.rb +40 -40
  79. data/lib/gonebusy/models/get_user_by_id_response.rb +35 -35
  80. data/lib/gonebusy/models/get_users_response.rb +40 -40
  81. data/lib/gonebusy/models/occurrence_enum.rb +21 -21
  82. data/lib/gonebusy/models/recurs_by_enum.rb +15 -15
  83. data/lib/gonebusy/models/search_query_response.rb +35 -35
  84. data/lib/gonebusy/models/update_booking_by_id_body.rb +116 -0
  85. data/lib/gonebusy/models/update_booking_by_id_response.rb +35 -35
  86. data/lib/gonebusy/models/update_pricing_model_by_id_body.rb +62 -62
  87. data/lib/gonebusy/models/update_pricing_model_by_id_response.rb +35 -35
  88. data/lib/gonebusy/models/update_resource_by_id_body.rb +71 -71
  89. data/lib/gonebusy/models/update_resource_by_id_response.rb +35 -35
  90. data/lib/gonebusy/models/update_schedule_time_window_by_id_body.rb +116 -117
  91. data/lib/gonebusy/models/update_schedule_time_window_by_id_response.rb +35 -35
  92. data/lib/gonebusy/models/update_service_by_id_body.rb +98 -98
  93. data/lib/gonebusy/models/update_service_by_id_response.rb +35 -35
  94. data/lib/gonebusy/models/update_user_by_id_body.rb +89 -89
  95. data/lib/gonebusy/models/update_user_by_id_response.rb +35 -35
  96. data/lib/gonebusy.rb +108 -104
  97. metadata +53 -17
@@ -1,35 +1,35 @@
1
- # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
-
3
- module Gonebusy
4
- class GetServiceByIdResponse < BaseModel
5
- # TODO: Write general description for this method
6
- # @return [EntitiesServiceResponse]
7
- attr_accessor :service
8
-
9
- # A mapping from model property names to API property names
10
- def self.names
11
- if @hash.nil?
12
- @hash = {}
13
- @hash["service"] = "service"
14
- end
15
- @hash
16
- end
17
-
18
- def initialize(service = nil)
19
- @service = service
20
- end
21
-
22
- # Creates an instance of the object from a hash
23
- def self.from_hash(hash)
24
- if hash == nil
25
- nil
26
- else
27
- # Extract variables from the hash
28
- service = EntitiesServiceResponse.from_hash(hash["service"]) if hash["service"]
29
-
30
- # Create object from extracted values
31
- GetServiceByIdResponse.new(service)
32
- end
33
- end
34
- end
35
- end
1
+ # This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class GetServiceByIdResponse < BaseModel
5
+ # TODO: Write general description for this method
6
+ # @return [EntitiesServiceResponse]
7
+ attr_accessor :service
8
+
9
+ # A mapping from model property names to API property names
10
+ def self.names
11
+ if @hash.nil?
12
+ @hash = {}
13
+ @hash["service"] = "service"
14
+ end
15
+ @hash
16
+ end
17
+
18
+ def initialize(service = nil)
19
+ @service = service
20
+ end
21
+
22
+ # Creates an instance of the object from a hash
23
+ def self.from_hash(hash)
24
+ if hash == nil
25
+ nil
26
+ else
27
+ # Extract variables from the hash
28
+ service = EntitiesServiceResponse.from_hash(hash['service']) if hash['service']
29
+
30
+ # Create object from extracted values
31
+ GetServiceByIdResponse.new(service)
32
+ end
33
+ end
34
+ end
35
+ end
@@ -1,40 +1,40 @@
1
- # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
-
3
- module Gonebusy
4
- class GetServicesResponse < BaseModel
5
- # TODO: Write general description for this method
6
- # @return [List of EntitiesServiceResponse]
7
- attr_accessor :services
8
-
9
- # A mapping from model property names to API property names
10
- def self.names
11
- if @hash.nil?
12
- @hash = {}
13
- @hash["services"] = "services"
14
- end
15
- @hash
16
- end
17
-
18
- def initialize(services = nil)
19
- @services = services
20
- end
21
-
22
- # Creates an instance of the object from a hash
23
- def self.from_hash(hash)
24
- if hash == nil
25
- nil
26
- else
27
- # Extract variables from the hash
28
- # Parameter is an array, so we need to iterate through it
29
- services = nil
30
- if hash["services"] != nil
31
- services = Array.new
32
- hash["services"].each{|structure| services << (EntitiesServiceResponse.from_hash(structure) if structure)}
33
- end
34
-
35
- # Create object from extracted values
36
- GetServicesResponse.new(services)
37
- end
38
- end
39
- end
40
- end
1
+ # This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class GetServicesResponse < BaseModel
5
+ # TODO: Write general description for this method
6
+ # @return [List of EntitiesServiceResponse]
7
+ attr_accessor :services
8
+
9
+ # A mapping from model property names to API property names
10
+ def self.names
11
+ if @hash.nil?
12
+ @hash = {}
13
+ @hash["services"] = "services"
14
+ end
15
+ @hash
16
+ end
17
+
18
+ def initialize(services = nil)
19
+ @services = services
20
+ end
21
+
22
+ # Creates an instance of the object from a hash
23
+ def self.from_hash(hash)
24
+ if hash == nil
25
+ nil
26
+ else
27
+ # Extract variables from the hash
28
+ # Parameter is an array, so we need to iterate through it
29
+ services = nil
30
+ if hash['services'] != nil
31
+ services = Array.new
32
+ hash['services'].each{|structure| services << (EntitiesServiceResponse.from_hash(structure) if structure)}
33
+ end
34
+
35
+ # Create object from extracted values
36
+ GetServicesResponse.new(services)
37
+ end
38
+ end
39
+ end
40
+ end
@@ -1,35 +1,35 @@
1
- # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
-
3
- module Gonebusy
4
- class GetUserByIdResponse < BaseModel
5
- # TODO: Write general description for this method
6
- # @return [EntitiesUserResponse]
7
- attr_accessor :user
8
-
9
- # A mapping from model property names to API property names
10
- def self.names
11
- if @hash.nil?
12
- @hash = {}
13
- @hash["user"] = "user"
14
- end
15
- @hash
16
- end
17
-
18
- def initialize(user = nil)
19
- @user = user
20
- end
21
-
22
- # Creates an instance of the object from a hash
23
- def self.from_hash(hash)
24
- if hash == nil
25
- nil
26
- else
27
- # Extract variables from the hash
28
- user = EntitiesUserResponse.from_hash(hash["user"]) if hash["user"]
29
-
30
- # Create object from extracted values
31
- GetUserByIdResponse.new(user)
32
- end
33
- end
34
- end
35
- end
1
+ # This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class GetUserByIdResponse < BaseModel
5
+ # TODO: Write general description for this method
6
+ # @return [EntitiesUserResponse]
7
+ attr_accessor :user
8
+
9
+ # A mapping from model property names to API property names
10
+ def self.names
11
+ if @hash.nil?
12
+ @hash = {}
13
+ @hash["user"] = "user"
14
+ end
15
+ @hash
16
+ end
17
+
18
+ def initialize(user = nil)
19
+ @user = user
20
+ end
21
+
22
+ # Creates an instance of the object from a hash
23
+ def self.from_hash(hash)
24
+ if hash == nil
25
+ nil
26
+ else
27
+ # Extract variables from the hash
28
+ user = EntitiesUserResponse.from_hash(hash['user']) if hash['user']
29
+
30
+ # Create object from extracted values
31
+ GetUserByIdResponse.new(user)
32
+ end
33
+ end
34
+ end
35
+ end
@@ -1,40 +1,40 @@
1
- # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
-
3
- module Gonebusy
4
- class GetUsersResponse < BaseModel
5
- # TODO: Write general description for this method
6
- # @return [List of EntitiesUserResponse]
7
- attr_accessor :users
8
-
9
- # A mapping from model property names to API property names
10
- def self.names
11
- if @hash.nil?
12
- @hash = {}
13
- @hash["users"] = "users"
14
- end
15
- @hash
16
- end
17
-
18
- def initialize(users = nil)
19
- @users = users
20
- end
21
-
22
- # Creates an instance of the object from a hash
23
- def self.from_hash(hash)
24
- if hash == nil
25
- nil
26
- else
27
- # Extract variables from the hash
28
- # Parameter is an array, so we need to iterate through it
29
- users = nil
30
- if hash["users"] != nil
31
- users = Array.new
32
- hash["users"].each{|structure| users << (EntitiesUserResponse.from_hash(structure) if structure)}
33
- end
34
-
35
- # Create object from extracted values
36
- GetUsersResponse.new(users)
37
- end
38
- end
39
- end
40
- end
1
+ # This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class GetUsersResponse < BaseModel
5
+ # TODO: Write general description for this method
6
+ # @return [List of EntitiesUserResponse]
7
+ attr_accessor :users
8
+
9
+ # A mapping from model property names to API property names
10
+ def self.names
11
+ if @hash.nil?
12
+ @hash = {}
13
+ @hash["users"] = "users"
14
+ end
15
+ @hash
16
+ end
17
+
18
+ def initialize(users = nil)
19
+ @users = users
20
+ end
21
+
22
+ # Creates an instance of the object from a hash
23
+ def self.from_hash(hash)
24
+ if hash == nil
25
+ nil
26
+ else
27
+ # Extract variables from the hash
28
+ # Parameter is an array, so we need to iterate through it
29
+ users = nil
30
+ if hash['users'] != nil
31
+ users = Array.new
32
+ hash['users'].each{|structure| users << (EntitiesUserResponse.from_hash(structure) if structure)}
33
+ end
34
+
35
+ # Create object from extracted values
36
+ GetUsersResponse.new(users)
37
+ end
38
+ end
39
+ end
40
+ end
@@ -1,22 +1,22 @@
1
- # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
-
3
- module Gonebusy
4
- class OccurrenceEnum
5
- # TODO: Write general description for ENUM_4TH_TO_LAST
6
- # TODO: Write general description for ENUM_3RD_TO_LAST
7
- # TODO: Write general description for ENUM_2ND_TO_LAST
8
- # TODO: Write general description for LAST
9
- # TODO: Write general description for EVERY
10
- # TODO: Write general description for FIRST
11
- # TODO: Write general description for ENUM_2ND
12
- # TODO: Write general description for ENUM_3RD
13
- # TODO: Write general description for ENUM_4TH
14
- # TODO: Write general description for ENUM_5TH
15
- # TODO: Write general description for ENUM_6TH
16
- # TODO: Write general description for ENUM_7TH
17
- # TODO: Write general description for ENUM_8TH
18
- # TODO: Write general description for ENUM_9TH
19
- # TODO: Write general description for ENUM_10TH
20
- OCCURRENCE_ENUM = [ENUM_4TH_TO_LAST = '4th_to_last', ENUM_3RD_TO_LAST = '3rd_to_last', ENUM_2ND_TO_LAST = '2nd_to_last', LAST = 'last', EVERY = 'every', FIRST = 'first', ENUM_2ND = '2nd', ENUM_3RD = '3rd', ENUM_4TH = '4th', ENUM_5TH = '5th', ENUM_6TH = '6th', ENUM_7TH = '7th', ENUM_8TH = '8th', ENUM_9TH = '9th', ENUM_10TH = '10th']
21
- end
1
+ # This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class OccurrenceEnum
5
+ # TODO: Write general description for ENUM_4TH_TO_LAST
6
+ # TODO: Write general description for ENUM_3RD_TO_LAST
7
+ # TODO: Write general description for ENUM_2ND_TO_LAST
8
+ # TODO: Write general description for LAST
9
+ # TODO: Write general description for EVERY
10
+ # TODO: Write general description for FIRST
11
+ # TODO: Write general description for ENUM_2ND
12
+ # TODO: Write general description for ENUM_3RD
13
+ # TODO: Write general description for ENUM_4TH
14
+ # TODO: Write general description for ENUM_5TH
15
+ # TODO: Write general description for ENUM_6TH
16
+ # TODO: Write general description for ENUM_7TH
17
+ # TODO: Write general description for ENUM_8TH
18
+ # TODO: Write general description for ENUM_9TH
19
+ # TODO: Write general description for ENUM_10TH
20
+ OCCURRENCE_ENUM = [ENUM_4TH_TO_LAST = '4th_to_last', ENUM_3RD_TO_LAST = '3rd_to_last', ENUM_2ND_TO_LAST = '2nd_to_last', LAST = 'last', EVERY = 'every', FIRST = 'first', ENUM_2ND = '2nd', ENUM_3RD = '3rd', ENUM_4TH = '4th', ENUM_5TH = '5th', ENUM_6TH = '6th', ENUM_7TH = '7th', ENUM_8TH = '8th', ENUM_9TH = '9th', ENUM_10TH = '10th']
21
+ end
22
22
  end
@@ -1,16 +1,16 @@
1
- # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
-
3
- module Gonebusy
4
- class RecursByEnum
5
- # TODO: Write general description for ONCE
6
- # TODO: Write general description for DAILY
7
- # TODO: Write general description for WEEKEND
8
- # TODO: Write general description for MON_WED_FRI
9
- # TODO: Write general description for TUE_THU
10
- # TODO: Write general description for WEEKDAY
11
- # TODO: Write general description for WEEKLY
12
- # TODO: Write general description for MONTHLY
13
- # TODO: Write general description for YEARLY
14
- RECURS_BY_ENUM = [ONCE = 'once', DAILY = 'daily', WEEKEND = 'weekend', MON_WED_FRI = 'mon_wed_fri', TUE_THU = 'tue_thu', WEEKDAY = 'weekday', WEEKLY = 'weekly', MONTHLY = 'monthly', YEARLY = 'yearly']
15
- end
1
+ # This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class RecursByEnum
5
+ # TODO: Write general description for ONCE
6
+ # TODO: Write general description for DAILY
7
+ # TODO: Write general description for WEEKEND
8
+ # TODO: Write general description for MON_WED_FRI
9
+ # TODO: Write general description for TUE_THU
10
+ # TODO: Write general description for WEEKDAY
11
+ # TODO: Write general description for WEEKLY
12
+ # TODO: Write general description for MONTHLY
13
+ # TODO: Write general description for YEARLY
14
+ RECURS_BY_ENUM = [ONCE = 'once', DAILY = 'daily', WEEKEND = 'weekend', MON_WED_FRI = 'mon_wed_fri', TUE_THU = 'tue_thu', WEEKDAY = 'weekday', WEEKLY = 'weekly', MONTHLY = 'monthly', YEARLY = 'yearly']
15
+ end
16
16
  end
@@ -1,35 +1,35 @@
1
- # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
-
3
- module Gonebusy
4
- class SearchQueryResponse < BaseModel
5
- # TODO: Write general description for this method
6
- # @return [EntitiesSearchResponse]
7
- attr_accessor :results
8
-
9
- # A mapping from model property names to API property names
10
- def self.names
11
- if @hash.nil?
12
- @hash = {}
13
- @hash["results"] = "results"
14
- end
15
- @hash
16
- end
17
-
18
- def initialize(results = nil)
19
- @results = results
20
- end
21
-
22
- # Creates an instance of the object from a hash
23
- def self.from_hash(hash)
24
- if hash == nil
25
- nil
26
- else
27
- # Extract variables from the hash
28
- results = EntitiesSearchResponse.from_hash(hash["results"]) if hash["results"]
29
-
30
- # Create object from extracted values
31
- SearchQueryResponse.new(results)
32
- end
33
- end
34
- end
35
- end
1
+ # This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class SearchQueryResponse < BaseModel
5
+ # TODO: Write general description for this method
6
+ # @return [EntitiesSearchResponse]
7
+ attr_accessor :results
8
+
9
+ # A mapping from model property names to API property names
10
+ def self.names
11
+ if @hash.nil?
12
+ @hash = {}
13
+ @hash["results"] = "results"
14
+ end
15
+ @hash
16
+ end
17
+
18
+ def initialize(results = nil)
19
+ @results = results
20
+ end
21
+
22
+ # Creates an instance of the object from a hash
23
+ def self.from_hash(hash)
24
+ if hash == nil
25
+ nil
26
+ else
27
+ # Extract variables from the hash
28
+ results = EntitiesSearchResponse.from_hash(hash['results']) if hash['results']
29
+
30
+ # Create object from extracted values
31
+ SearchQueryResponse.new(results)
32
+ end
33
+ end
34
+ end
35
+ end