gonebusy-ruby-client 0.0.2

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 +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +1963 -0
  4. data/lib/gonebusy/api_helper.rb +149 -0
  5. data/lib/gonebusy/configuration.rb +16 -0
  6. data/lib/gonebusy/controllers/base_controller.rb +45 -0
  7. data/lib/gonebusy/controllers/bookings_controller.rb +298 -0
  8. data/lib/gonebusy/controllers/categories_controller.rb +180 -0
  9. data/lib/gonebusy/controllers/pricing_models_controller.rb +241 -0
  10. data/lib/gonebusy/controllers/resources_controller.rb +355 -0
  11. data/lib/gonebusy/controllers/schedules_controller.rb +426 -0
  12. data/lib/gonebusy/controllers/search_controller.rb +64 -0
  13. data/lib/gonebusy/controllers/services_controller.rb +367 -0
  14. data/lib/gonebusy/controllers/users_controller.rb +288 -0
  15. data/lib/gonebusy/exceptions/api_exception.rb +16 -0
  16. data/lib/gonebusy/exceptions/entities_error_exception.rb +27 -0
  17. data/lib/gonebusy/gonebusy_client.rb +58 -0
  18. data/lib/gonebusy/http/auth/custom_auth.rb +16 -0
  19. data/lib/gonebusy/http/faraday_client.rb +41 -0
  20. data/lib/gonebusy/http/http_call_back.rb +17 -0
  21. data/lib/gonebusy/http/http_client.rb +82 -0
  22. data/lib/gonebusy/http/http_context.rb +15 -0
  23. data/lib/gonebusy/http/http_method_enum.rb +7 -0
  24. data/lib/gonebusy/http/http_request.rb +44 -0
  25. data/lib/gonebusy/http/http_response.rb +19 -0
  26. data/lib/gonebusy/models/base_model.rb +32 -0
  27. data/lib/gonebusy/models/cancel_booking_by_id_response.rb +35 -0
  28. data/lib/gonebusy/models/create_booking_body.rb +80 -0
  29. data/lib/gonebusy/models/create_booking_response.rb +35 -0
  30. data/lib/gonebusy/models/create_category_body.rb +71 -0
  31. data/lib/gonebusy/models/create_category_response.rb +35 -0
  32. data/lib/gonebusy/models/create_pricing_model_body.rb +80 -0
  33. data/lib/gonebusy/models/create_pricing_model_response.rb +35 -0
  34. data/lib/gonebusy/models/create_resource_body.rb +89 -0
  35. data/lib/gonebusy/models/create_resource_response.rb +35 -0
  36. data/lib/gonebusy/models/create_schedule_body.rb +144 -0
  37. data/lib/gonebusy/models/create_schedule_response.rb +35 -0
  38. data/lib/gonebusy/models/create_schedule_time_window_body.rb +117 -0
  39. data/lib/gonebusy/models/create_schedule_time_window_response.rb +35 -0
  40. data/lib/gonebusy/models/create_service_body.rb +98 -0
  41. data/lib/gonebusy/models/create_service_response.rb +35 -0
  42. data/lib/gonebusy/models/create_user_body.rb +89 -0
  43. data/lib/gonebusy/models/create_user_response.rb +35 -0
  44. data/lib/gonebusy/models/date_recurs_by_enum.rb +13 -0
  45. data/lib/gonebusy/models/delete_resource_by_id_response.rb +35 -0
  46. data/lib/gonebusy/models/delete_schedule_by_id_response.rb +35 -0
  47. data/lib/gonebusy/models/delete_schedule_time_window_by_id_response.rb +35 -0
  48. data/lib/gonebusy/models/delete_service_by_id_response.rb +35 -0
  49. data/lib/gonebusy/models/entities_address_entity.rb +116 -0
  50. data/lib/gonebusy/models/entities_availability_response.rb +58 -0
  51. data/lib/gonebusy/models/entities_booking_response.rb +71 -0
  52. data/lib/gonebusy/models/entities_category_response.rb +98 -0
  53. data/lib/gonebusy/models/entities_pricing_model_response.rb +89 -0
  54. data/lib/gonebusy/models/entities_resource_availabilities.rb +49 -0
  55. data/lib/gonebusy/models/entities_resource_response.rb +98 -0
  56. data/lib/gonebusy/models/entities_schedule_response.rb +76 -0
  57. data/lib/gonebusy/models/entities_search_response.rb +54 -0
  58. data/lib/gonebusy/models/entities_service_response.rb +116 -0
  59. data/lib/gonebusy/models/entities_slots.rb +45 -0
  60. data/lib/gonebusy/models/entities_thing_type_response.rb +44 -0
  61. data/lib/gonebusy/models/entities_time_window_response.rb +135 -0
  62. data/lib/gonebusy/models/entities_user_response.rb +152 -0
  63. data/lib/gonebusy/models/frequency_enum.rb +18 -0
  64. data/lib/gonebusy/models/gender_enum.rb +10 -0
  65. data/lib/gonebusy/models/get_booking_by_id_response.rb +35 -0
  66. data/lib/gonebusy/models/get_bookings_response.rb +40 -0
  67. data/lib/gonebusy/models/get_categories_response.rb +40 -0
  68. data/lib/gonebusy/models/get_category_by_id_response.rb +35 -0
  69. data/lib/gonebusy/models/get_pricing_model_by_id_response.rb +35 -0
  70. data/lib/gonebusy/models/get_pricing_models_response.rb +40 -0
  71. data/lib/gonebusy/models/get_resource_by_id_response.rb +35 -0
  72. data/lib/gonebusy/models/get_resource_things_response.rb +40 -0
  73. data/lib/gonebusy/models/get_resources_response.rb +40 -0
  74. data/lib/gonebusy/models/get_schedule_by_id_response.rb +35 -0
  75. data/lib/gonebusy/models/get_schedules_response.rb +40 -0
  76. data/lib/gonebusy/models/get_service_available_slots_by_id_response.rb +35 -0
  77. data/lib/gonebusy/models/get_service_by_id_response.rb +35 -0
  78. data/lib/gonebusy/models/get_services_response.rb +40 -0
  79. data/lib/gonebusy/models/get_user_by_id_response.rb +35 -0
  80. data/lib/gonebusy/models/get_users_pros_response.rb +40 -0
  81. data/lib/gonebusy/models/get_users_response.rb +40 -0
  82. data/lib/gonebusy/models/occurrence_enum.rb +22 -0
  83. data/lib/gonebusy/models/recurs_by_enum.rb +16 -0
  84. data/lib/gonebusy/models/search_query_response.rb +35 -0
  85. data/lib/gonebusy/models/update_booking_by_id_response.rb +35 -0
  86. data/lib/gonebusy/models/update_pricing_model_by_id_body.rb +62 -0
  87. data/lib/gonebusy/models/update_pricing_model_by_id_response.rb +35 -0
  88. data/lib/gonebusy/models/update_resource_by_id_body.rb +71 -0
  89. data/lib/gonebusy/models/update_resource_by_id_response.rb +35 -0
  90. data/lib/gonebusy/models/update_schedule_time_window_by_id_body.rb +117 -0
  91. data/lib/gonebusy/models/update_schedule_time_window_by_id_response.rb +35 -0
  92. data/lib/gonebusy/models/update_service_by_id_body.rb +89 -0
  93. data/lib/gonebusy/models/update_service_by_id_response.rb +35 -0
  94. data/lib/gonebusy/models/update_user_by_id_body.rb +89 -0
  95. data/lib/gonebusy/models/update_user_by_id_response.rb +35 -0
  96. data/lib/gonebusy.rb +105 -0
  97. metadata +186 -0
@@ -0,0 +1,89 @@
1
+ # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class EntitiesPricingModelResponse < BaseModel
5
+ # currency symbol, as per ISO-4217
6
+ # @return [String]
7
+ attr_accessor :currency
8
+
9
+ # id of PricingModel
10
+ # @return [Integer]
11
+ attr_accessor :id
12
+
13
+ # name of PricingModel
14
+ # @return [String]
15
+ attr_accessor :name
16
+
17
+ # notes and description
18
+ # @return [String]
19
+ attr_accessor :notes
20
+
21
+ # id of owner of PricingModel
22
+ # @return [Integer]
23
+ attr_accessor :owner_id
24
+
25
+ # price/rate
26
+ # @return [String]
27
+ attr_accessor :price
28
+
29
+ # type of PricingModel
30
+ # @return [String]
31
+ attr_accessor :pricing_model_type
32
+
33
+ # A mapping from model property names to API property names
34
+ def self.names
35
+ if @hash.nil?
36
+ @hash = {}
37
+ @hash["currency"] = "currency"
38
+ @hash["id"] = "id"
39
+ @hash["name"] = "name"
40
+ @hash["notes"] = "notes"
41
+ @hash["owner_id"] = "owner_id"
42
+ @hash["price"] = "price"
43
+ @hash["pricing_model_type"] = "pricing_model_type"
44
+ end
45
+ @hash
46
+ end
47
+
48
+ def initialize(currency = nil,
49
+ id = nil,
50
+ name = nil,
51
+ notes = nil,
52
+ owner_id = nil,
53
+ price = nil,
54
+ pricing_model_type = nil)
55
+ @currency = currency
56
+ @id = id
57
+ @name = name
58
+ @notes = notes
59
+ @owner_id = owner_id
60
+ @price = price
61
+ @pricing_model_type = pricing_model_type
62
+ end
63
+
64
+ # Creates an instance of the object from a hash
65
+ def self.from_hash(hash)
66
+ if hash == nil
67
+ nil
68
+ else
69
+ # Extract variables from the hash
70
+ currency = hash["currency"]
71
+ id = hash["id"]
72
+ name = hash["name"]
73
+ notes = hash["notes"]
74
+ owner_id = hash["owner_id"]
75
+ price = hash["price"]
76
+ pricing_model_type = hash["pricing_model_type"]
77
+
78
+ # Create object from extracted values
79
+ EntitiesPricingModelResponse.new(currency,
80
+ id,
81
+ name,
82
+ notes,
83
+ owner_id,
84
+ price,
85
+ pricing_model_type)
86
+ end
87
+ end
88
+ end
89
+ end
@@ -0,0 +1,49 @@
1
+ # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class EntitiesResourceAvailabilities < BaseModel
5
+ # array of available date and time slots
6
+ # @return [List of EntitiesSlots]
7
+ attr_accessor :available_slots
8
+
9
+ # id of Resource
10
+ # @return [Integer]
11
+ attr_accessor :id
12
+
13
+ # A mapping from model property names to API property names
14
+ def self.names
15
+ if @hash.nil?
16
+ @hash = {}
17
+ @hash["available_slots"] = "available_slots"
18
+ @hash["id"] = "id"
19
+ end
20
+ @hash
21
+ end
22
+
23
+ def initialize(available_slots = nil,
24
+ id = nil)
25
+ @available_slots = available_slots
26
+ @id = id
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
+ available_slots = nil
37
+ if hash["available_slots"] != nil
38
+ available_slots = Array.new
39
+ hash["available_slots"].each{|structure| available_slots << (EntitiesSlots.from_hash(structure) if structure)}
40
+ end
41
+ id = hash["id"]
42
+
43
+ # Create object from extracted values
44
+ EntitiesResourceAvailabilities.new(available_slots,
45
+ id)
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,98 @@
1
+ # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class EntitiesResourceResponse < BaseModel
5
+ # capacity of Resource, if applicable
6
+ # @return [Integer]
7
+ attr_accessor :capacity
8
+
9
+ # description of Resource
10
+ # @return [String]
11
+ attr_accessor :description
12
+
13
+ # gender of Resource, if applicable
14
+ # @return [Integer]
15
+ attr_accessor :gender
16
+
17
+ # id of Resource
18
+ # @return [Integer]
19
+ attr_accessor :id
20
+
21
+ # name of Resource
22
+ # @return [String]
23
+ attr_accessor :name
24
+
25
+ # id of User owning Resource
26
+ # @return [Integer]
27
+ attr_accessor :owner_id
28
+
29
+ # type of Resource
30
+ # @return [String]
31
+ attr_accessor :resource_type
32
+
33
+ # type Id of Thing Resource, if applicable
34
+ # @return [Integer]
35
+ attr_accessor :thing_type_id
36
+
37
+ # A mapping from model property names to API property names
38
+ def self.names
39
+ if @hash.nil?
40
+ @hash = {}
41
+ @hash["capacity"] = "capacity"
42
+ @hash["description"] = "description"
43
+ @hash["gender"] = "gender"
44
+ @hash["id"] = "id"
45
+ @hash["name"] = "name"
46
+ @hash["owner_id"] = "owner_id"
47
+ @hash["resource_type"] = "resource_type"
48
+ @hash["thing_type_id"] = "thing_type_id"
49
+ end
50
+ @hash
51
+ end
52
+
53
+ def initialize(capacity = nil,
54
+ description = nil,
55
+ gender = nil,
56
+ id = nil,
57
+ name = nil,
58
+ owner_id = nil,
59
+ resource_type = nil,
60
+ thing_type_id = nil)
61
+ @capacity = capacity
62
+ @description = description
63
+ @gender = gender
64
+ @id = id
65
+ @name = name
66
+ @owner_id = owner_id
67
+ @resource_type = resource_type
68
+ @thing_type_id = thing_type_id
69
+ end
70
+
71
+ # Creates an instance of the object from a hash
72
+ def self.from_hash(hash)
73
+ if hash == nil
74
+ nil
75
+ else
76
+ # Extract variables from the hash
77
+ capacity = hash["capacity"]
78
+ description = hash["description"]
79
+ gender = hash["gender"]
80
+ id = hash["id"]
81
+ name = hash["name"]
82
+ owner_id = hash["owner_id"]
83
+ resource_type = hash["resource_type"]
84
+ thing_type_id = hash["thing_type_id"]
85
+
86
+ # Create object from extracted values
87
+ EntitiesResourceResponse.new(capacity,
88
+ description,
89
+ gender,
90
+ id,
91
+ name,
92
+ owner_id,
93
+ resource_type,
94
+ thing_type_id)
95
+ end
96
+ end
97
+ end
98
+ end
@@ -0,0 +1,76 @@
1
+ # This file was automatically generated for GoneBusy Inc. by APIMATIC v2.0 ( https://apimatic.io ).
2
+
3
+ module Gonebusy
4
+ class EntitiesScheduleResponse < BaseModel
5
+ # id of Schedule
6
+ # @return [Integer]
7
+ attr_accessor :id
8
+
9
+ # id of owner of Schedule
10
+ # @return [Integer]
11
+ attr_accessor :owner_id
12
+
13
+ # id of Resource
14
+ # @return [Integer]
15
+ attr_accessor :resource_id
16
+
17
+ # id of Service
18
+ # @return [Integer]
19
+ attr_accessor :service_id
20
+
21
+ # array of TimeWindows making up Schedule
22
+ # @return [List of EntitiesTimeWindowResponse]
23
+ attr_accessor :time_windows
24
+
25
+ # A mapping from model property names to API property names
26
+ def self.names
27
+ if @hash.nil?
28
+ @hash = {}
29
+ @hash["id"] = "id"
30
+ @hash["owner_id"] = "owner_id"
31
+ @hash["resource_id"] = "resource_id"
32
+ @hash["service_id"] = "service_id"
33
+ @hash["time_windows"] = "time_windows"
34
+ end
35
+ @hash
36
+ end
37
+
38
+ def initialize(id = nil,
39
+ owner_id = nil,
40
+ resource_id = nil,
41
+ service_id = nil,
42
+ time_windows = nil)
43
+ @id = id
44
+ @owner_id = owner_id
45
+ @resource_id = resource_id
46
+ @service_id = service_id
47
+ @time_windows = time_windows
48
+ end
49
+
50
+ # Creates an instance of the object from a hash
51
+ def self.from_hash(hash)
52
+ if hash == nil
53
+ nil
54
+ else
55
+ # Extract variables from the hash
56
+ id = hash["id"]
57
+ owner_id = hash["owner_id"]
58
+ resource_id = hash["resource_id"]
59
+ service_id = hash["service_id"]
60
+ # Parameter is an array, so we need to iterate through it
61
+ time_windows = nil
62
+ if hash["time_windows"] != nil
63
+ time_windows = Array.new
64
+ hash["time_windows"].each{|structure| time_windows << (EntitiesTimeWindowResponse.from_hash(structure) if structure)}
65
+ end
66
+
67
+ # Create object from extracted values
68
+ EntitiesScheduleResponse.new(id,
69
+ owner_id,
70
+ resource_id,
71
+ service_id,
72
+ time_windows)
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +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
@@ -0,0 +1,116 @@
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 in minutes of Service
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
+ # name of Service
26
+ # @return [String]
27
+ attr_accessor :name
28
+
29
+ # id of owner of Service
30
+ # @return [Integer]
31
+ attr_accessor :owner_id
32
+
33
+ # id of Pricing Model
34
+ # @return [Integer]
35
+ attr_accessor :price_model_id
36
+
37
+ # array of Resource ids offering Service
38
+ # @return [List of Integer]
39
+ attr_accessor :resources
40
+
41
+ # abbreviated name for Service
42
+ # @return [String]
43
+ attr_accessor :short_name
44
+
45
+ # A mapping from model property names to API property names
46
+ def self.names
47
+ if @hash.nil?
48
+ @hash = {}
49
+ @hash["categories"] = "categories"
50
+ @hash["description"] = "description"
51
+ @hash["duration"] = "duration"
52
+ @hash["id"] = "id"
53
+ @hash["is_active"] = "is_active"
54
+ @hash["name"] = "name"
55
+ @hash["owner_id"] = "owner_id"
56
+ @hash["price_model_id"] = "price_model_id"
57
+ @hash["resources"] = "resources"
58
+ @hash["short_name"] = "short_name"
59
+ end
60
+ @hash
61
+ end
62
+
63
+ def initialize(categories = nil,
64
+ description = nil,
65
+ duration = nil,
66
+ id = nil,
67
+ is_active = nil,
68
+ name = nil,
69
+ owner_id = nil,
70
+ price_model_id = nil,
71
+ resources = nil,
72
+ short_name = nil)
73
+ @categories = categories
74
+ @description = description
75
+ @duration = duration
76
+ @id = id
77
+ @is_active = is_active
78
+ @name = name
79
+ @owner_id = owner_id
80
+ @price_model_id = price_model_id
81
+ @resources = resources
82
+ @short_name = short_name
83
+ end
84
+
85
+ # Creates an instance of the object from a hash
86
+ def self.from_hash(hash)
87
+ if hash == nil
88
+ nil
89
+ else
90
+ # Extract variables from the hash
91
+ categories = hash["categories"]
92
+ description = hash["description"]
93
+ duration = hash["duration"]
94
+ id = hash["id"]
95
+ is_active = hash["is_active"]
96
+ name = hash["name"]
97
+ owner_id = hash["owner_id"]
98
+ price_model_id = hash["price_model_id"]
99
+ resources = hash["resources"]
100
+ short_name = hash["short_name"]
101
+
102
+ # Create object from extracted values
103
+ EntitiesServiceResponse.new(categories,
104
+ description,
105
+ duration,
106
+ id,
107
+ is_active,
108
+ name,
109
+ owner_id,
110
+ price_model_id,
111
+ resources,
112
+ short_name)
113
+ end
114
+ end
115
+ end
116
+ end