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,54 +1,54 @@
1
- # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
-
3
- module Gonebusy
4
- class EntitiesSearchResponse < BaseModel
5
- # array of Services matching query
6
- # @return [List of EntitiesServiceResponse]
7
- attr_accessor :services
8
-
9
- # array of Users matching query
10
- # @return [List of EntitiesUserResponse]
11
- attr_accessor :users
12
-
13
- # A mapping from model property names to API property names
14
- def self.names
15
- if @hash.nil?
16
- @hash = {}
17
- @hash["services"] = "services"
18
- @hash["users"] = "users"
19
- end
20
- @hash
21
- end
22
-
23
- def initialize(services = nil,
24
- users = nil)
25
- @services = services
26
- @users = users
27
- end
28
-
29
- # Creates an instance of the object from a hash
30
- def self.from_hash(hash)
31
- if hash == nil
32
- nil
33
- else
34
- # Extract variables from the hash
35
- # Parameter is an array, so we need to iterate through it
36
- services = nil
37
- if hash["services"] != nil
38
- services = Array.new
39
- hash["services"].each{|structure| services << (EntitiesServiceResponse.from_hash(structure) if structure)}
40
- end
41
- # Parameter is an array, so we need to iterate through it
42
- users = nil
43
- if hash["users"] != nil
44
- users = Array.new
45
- hash["users"].each{|structure| users << (EntitiesUserResponse.from_hash(structure) if structure)}
46
- end
47
-
48
- # Create object from extracted values
49
- EntitiesSearchResponse.new(services,
50
- users)
51
- end
52
- end
53
- end
54
- end
1
+ # This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class EntitiesSearchResponse < BaseModel
5
+ # array of Services matching query
6
+ # @return [List of EntitiesServiceResponse]
7
+ attr_accessor :services
8
+
9
+ # array of Users matching query
10
+ # @return [List of EntitiesUserResponse]
11
+ attr_accessor :users
12
+
13
+ # A mapping from model property names to API property names
14
+ def self.names
15
+ if @hash.nil?
16
+ @hash = {}
17
+ @hash["services"] = "services"
18
+ @hash["users"] = "users"
19
+ end
20
+ @hash
21
+ end
22
+
23
+ def initialize(services = nil,
24
+ users = nil)
25
+ @services = services
26
+ @users = users
27
+ end
28
+
29
+ # Creates an instance of the object from a hash
30
+ def self.from_hash(hash)
31
+ if hash == nil
32
+ nil
33
+ else
34
+ # Extract variables from the hash
35
+ # Parameter is an array, so we need to iterate through it
36
+ services = nil
37
+ if hash['services'] != nil
38
+ services = Array.new
39
+ hash['services'].each{|structure| services << (EntitiesServiceResponse.from_hash(structure) if structure)}
40
+ end
41
+ # Parameter is an array, so we need to iterate through it
42
+ users = nil
43
+ if hash['users'] != nil
44
+ users = Array.new
45
+ hash['users'].each{|structure| users << (EntitiesUserResponse.from_hash(structure) if structure)}
46
+ end
47
+
48
+ # Create object from extracted values
49
+ EntitiesSearchResponse.new(services,
50
+ users)
51
+ end
52
+ end
53
+ end
54
+ end
@@ -1,130 +1,134 @@
1
- # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
-
3
- module Gonebusy
4
- class EntitiesServiceResponse < BaseModel
5
- # array of Category ids Service belongs to
6
- # @return [List of Integer]
7
- attr_accessor :categories
8
-
9
- # description of Service
10
- # @return [String]
11
- attr_accessor :description
12
-
13
- # length of Service in minutes
14
- # @return [Integer]
15
- attr_accessor :duration
16
-
17
- # max length of Service in minutes
18
- # @return [Integer]
19
- attr_accessor :max_duration
20
-
21
- # id of Service
22
- # @return [Integer]
23
- attr_accessor :id
24
-
25
- # status of Service
26
- # @return [Boolean]
27
- attr_accessor :is_active
28
-
29
- # name of Service
30
- # @return [String]
31
- attr_accessor :name
32
-
33
- # id of owner of Service
34
- # @return [Integer]
35
- attr_accessor :owner_id
36
-
37
- # id of Pricing Model
38
- # @return [Integer]
39
- attr_accessor :price_model_id
40
-
41
- # array of Resource ids offering Service
42
- # @return [List of Integer]
43
- attr_accessor :resources
44
-
45
- # abbreviated name for Service
46
- # @return [String]
47
- attr_accessor :short_name
48
-
49
- # A mapping from model property names to API property names
50
- def self.names
51
- if @hash.nil?
52
- @hash = {}
53
- @hash["categories"] = "categories"
54
- @hash["description"] = "description"
55
- @hash["duration"] = "duration"
56
- @hash["max_duration"] = "max_duration"
57
- @hash["id"] = "id"
58
- @hash["is_active"] = "is_active"
59
- @hash["name"] = "name"
60
- @hash["owner_id"] = "owner_id"
61
- @hash["price_model_id"] = "price_model_id"
62
- @hash["resources"] = "resources"
63
- @hash["schedules"] = "schedules"
64
- @hash["short_name"] = "short_name"
65
- end
66
- @hash
67
- end
68
-
69
- def initialize(categories = nil,
70
- description = nil,
71
- duration = nil,
72
- max_duration = nil,
73
- id = nil,
74
- is_active = nil,
75
- name = nil,
76
- owner_id = nil,
77
- price_model_id = nil,
78
- resources = nil,
79
- schedules = nil,
80
- short_name = nil)
81
- @categories = categories
82
- @description = description
83
- @duration = duration
84
- @max_duration = max_duration
85
- @id = id
86
- @is_active = is_active
87
- @name = name
88
- @owner_id = owner_id
89
- @price_model_id = price_model_id
90
- @resources = resources
91
- @schedules = schedules
92
- @short_name = short_name
93
- end
94
-
95
- # Creates an instance of the object from a hash
96
- def self.from_hash(hash)
97
- if hash == nil
98
- nil
99
- else
100
- # Extract variables from the hash
101
- categories = hash["categories"]
102
- description = hash["description"]
103
- duration = hash["duration"]
104
- max_duration = hash["max_duration"]
105
- id = hash["id"]
106
- is_active = hash["is_active"]
107
- name = hash["name"]
108
- owner_id = hash["owner_id"]
109
- price_model_id = hash["price_model_id"]
110
- resources = hash["resources"]
111
- schedules = hash["schedules"]
112
- short_name = hash["short_name"]
113
-
114
- # Create object from extracted values
115
- EntitiesServiceResponse.new(categories,
116
- description,
117
- duration,
118
- max_duration,
119
- id,
120
- is_active,
121
- name,
122
- owner_id,
123
- price_model_id,
124
- resources,
125
- schedules,
126
- short_name)
127
- end
128
- end
129
- end
130
- end
1
+ # This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class EntitiesServiceResponse < BaseModel
5
+ # array of Category ids Service belongs to
6
+ # @return [List of Integer]
7
+ attr_accessor :categories
8
+
9
+ # description of Service
10
+ # @return [String]
11
+ attr_accessor :description
12
+
13
+ # length of Service in minutes
14
+ # @return [Integer]
15
+ attr_accessor :duration
16
+
17
+ # id of Service
18
+ # @return [Integer]
19
+ attr_accessor :id
20
+
21
+ # status of Service
22
+ # @return [Boolean]
23
+ attr_accessor :is_active
24
+
25
+ # max length of Service in minutes
26
+ # @return [Integer]
27
+ attr_accessor :max_duration
28
+
29
+ # name of Service
30
+ # @return [String]
31
+ attr_accessor :name
32
+
33
+ # id of owner of Service
34
+ # @return [Integer]
35
+ attr_accessor :owner_id
36
+
37
+ # id of Pricing Model
38
+ # @return [Integer]
39
+ attr_accessor :price_model_id
40
+
41
+ # array of Resource ids offering Service
42
+ # @return [List of Integer]
43
+ attr_accessor :resources
44
+
45
+ # array of Schedule ids, one for each Resource offering Service
46
+ # @return [List of Integer]
47
+ attr_accessor :schedules
48
+
49
+ # abbreviated name for Service
50
+ # @return [String]
51
+ attr_accessor :short_name
52
+
53
+ # A mapping from model property names to API property names
54
+ def self.names
55
+ if @hash.nil?
56
+ @hash = {}
57
+ @hash["categories"] = "categories"
58
+ @hash["description"] = "description"
59
+ @hash["duration"] = "duration"
60
+ @hash["id"] = "id"
61
+ @hash["is_active"] = "is_active"
62
+ @hash["max_duration"] = "max_duration"
63
+ @hash["name"] = "name"
64
+ @hash["owner_id"] = "owner_id"
65
+ @hash["price_model_id"] = "price_model_id"
66
+ @hash["resources"] = "resources"
67
+ @hash["schedules"] = "schedules"
68
+ @hash["short_name"] = "short_name"
69
+ end
70
+ @hash
71
+ end
72
+
73
+ def initialize(categories = nil,
74
+ description = nil,
75
+ duration = nil,
76
+ id = nil,
77
+ is_active = nil,
78
+ max_duration = nil,
79
+ name = nil,
80
+ owner_id = nil,
81
+ price_model_id = nil,
82
+ resources = nil,
83
+ schedules = nil,
84
+ short_name = nil)
85
+ @categories = categories
86
+ @description = description
87
+ @duration = duration
88
+ @id = id
89
+ @is_active = is_active
90
+ @max_duration = max_duration
91
+ @name = name
92
+ @owner_id = owner_id
93
+ @price_model_id = price_model_id
94
+ @resources = resources
95
+ @schedules = schedules
96
+ @short_name = short_name
97
+ end
98
+
99
+ # Creates an instance of the object from a hash
100
+ def self.from_hash(hash)
101
+ if hash == nil
102
+ nil
103
+ else
104
+ # Extract variables from the hash
105
+ categories = hash['categories']
106
+ description = hash['description']
107
+ duration = hash['duration']
108
+ id = hash['id']
109
+ is_active = hash['is_active']
110
+ max_duration = hash['max_duration']
111
+ name = hash['name']
112
+ owner_id = hash['owner_id']
113
+ price_model_id = hash['price_model_id']
114
+ resources = hash['resources']
115
+ schedules = hash['schedules']
116
+ short_name = hash['short_name']
117
+
118
+ # Create object from extracted values
119
+ EntitiesServiceResponse.new(categories,
120
+ description,
121
+ duration,
122
+ id,
123
+ is_active,
124
+ max_duration,
125
+ name,
126
+ owner_id,
127
+ price_model_id,
128
+ resources,
129
+ schedules,
130
+ short_name)
131
+ end
132
+ end
133
+ end
134
+ end
@@ -1,45 +1,44 @@
1
- # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
-
3
- require 'date'
4
- module Gonebusy
5
- class EntitiesSlots < BaseModel
6
- # date of availability
7
- # @return [DateTime]
8
- attr_accessor :date
9
-
10
- # array of available time slots
11
- # @return [List of String]
12
- attr_accessor :slots
13
-
14
- # A mapping from model property names to API property names
15
- def self.names
16
- if @hash.nil?
17
- @hash = {}
18
- @hash["date"] = "date"
19
- @hash["slots"] = "slots"
20
- end
21
- @hash
22
- end
23
-
24
- def initialize(date = nil,
25
- slots = nil)
26
- @date = date
27
- @slots = slots
28
- end
29
-
30
- # Creates an instance of the object from a hash
31
- def self.from_hash(hash)
32
- if hash == nil
33
- nil
34
- else
35
- # Extract variables from the hash
36
- date = DateTime.iso8601(hash["date"]) if hash["date"]
37
- slots = hash["slots"]
38
-
39
- # Create object from extracted values
40
- EntitiesSlots.new(date,
41
- slots)
42
- end
43
- end
44
- end
45
- end
1
+ # This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class EntitiesSlots < BaseModel
5
+ # date of availability
6
+ # @return [Date]
7
+ attr_accessor :date
8
+
9
+ # array of available time slots
10
+ # @return [List of String]
11
+ attr_accessor :slots
12
+
13
+ # A mapping from model property names to API property names
14
+ def self.names
15
+ if @hash.nil?
16
+ @hash = {}
17
+ @hash["date"] = "date"
18
+ @hash["slots"] = "slots"
19
+ end
20
+ @hash
21
+ end
22
+
23
+ def initialize(date = nil,
24
+ slots = nil)
25
+ @date = date
26
+ @slots = slots
27
+ end
28
+
29
+ # Creates an instance of the object from a hash
30
+ def self.from_hash(hash)
31
+ if hash == nil
32
+ nil
33
+ else
34
+ # Extract variables from the hash
35
+ date = hash['date']
36
+ slots = hash['slots']
37
+
38
+ # Create object from extracted values
39
+ EntitiesSlots.new(date,
40
+ slots)
41
+ end
42
+ end
43
+ end
44
+ end